Socket
Socket
Sign inDemoInstall

@googlemaps/markerclusterer

Package Overview
Dependencies
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@googlemaps/markerclusterer - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

16

dist/algorithms/core.d.ts

@@ -37,2 +37,12 @@ /**

}
export interface AlgorithmOutput {
/**
* The clusters returned based upon the {@link AlgorithmInput}.
*/
clusters: Cluster[];
/**
* A boolean flag indicating that the clusters have not changed.
*/
changed?: boolean;
}
export interface Algorithm {

@@ -42,3 +52,3 @@ /**

*/
calculate: ({ markers, map }: AlgorithmInput) => Cluster[];
calculate: ({ markers, map }: AlgorithmInput) => AlgorithmOutput;
}

@@ -73,3 +83,3 @@ export interface AlgorithmOptions {

*/
abstract calculate({ markers, map }: AlgorithmInput): Cluster[];
abstract calculate({ markers, map }: AlgorithmInput): AlgorithmOutput;
/**

@@ -99,3 +109,3 @@ * Clusters the markers and called from {@link calculate}.

constructor({ viewportPadding, ...options }: ViewportAlgorithmOptions);
calculate({ markers, map, mapCanvasProjection, }: AlgorithmInput): Cluster[];
calculate({ markers, map, mapCanvasProjection, }: AlgorithmInput): AlgorithmOutput;
protected abstract cluster({ markers, map }: AlgorithmInput): Cluster[];

@@ -102,0 +112,0 @@ }

@@ -34,2 +34,5 @@ /**

*
* The Grid algorithm does not implement caching and markers may flash as the
* viewport changes. Instead use {@link SuperClusterAlgorithm}.
*
* @see https://www.npmjs.com/package/@turf/clusters-dbscan

@@ -36,0 +39,0 @@ */

@@ -28,3 +28,7 @@ /**

/**
* The default Grid algorithm historically used in Google Maps marker clustering.
* The default Grid algorithm historically used in Google Maps marker
* clustering.
*
* The Grid algorithm does not implement caching and markers may flash as the
* viewport changes. Instead use {@link SuperClusterAlgorithm}.
*/

@@ -31,0 +35,0 @@ export declare class GridAlgorithm extends AbstractViewportAlgorithm {

@@ -24,2 +24,5 @@ /**

*
* The Grid algorithm does not implement caching and markers may flash as the
* viewport changes. Instead use {@link SuperClusterAlgorithm}.
*
* @see https://www.npmjs.com/package/@turf/clusters-kmeans

@@ -26,0 +29,0 @@ */

4

dist/algorithms/noop.d.ts

@@ -16,3 +16,3 @@ /**

*/
import { AbstractAlgorithm, AlgorithmInput, AlgorithmOptions } from "./core";
import { AbstractAlgorithm, AlgorithmInput, AlgorithmOptions, AlgorithmOutput } from "./core";
import { Cluster } from "../cluster";

@@ -24,4 +24,4 @@ /**

constructor({ ...options }: AlgorithmOptions);
calculate({ markers, map, mapCanvasProjection, }: AlgorithmInput): Cluster[];
calculate({ markers, map, mapCanvasProjection, }: AlgorithmInput): AlgorithmOutput;
protected cluster(input: AlgorithmInput): Cluster[];
}

@@ -17,3 +17,3 @@ /**

/// <reference types="google.maps" />
import { AbstractAlgorithm, AlgorithmInput } from "./core";
import { AbstractAlgorithm, AlgorithmInput, AlgorithmOutput } from "./core";
import SuperCluster, { ClusterFeature } from "supercluster";

@@ -34,4 +34,8 @@ import { Cluster } from "../cluster";

protected markers: google.maps.Marker[];
protected clusters: Cluster[];
protected state: {
zoom: number;
};
constructor({ maxZoom, radius, ...options }: SuperClusterOptions);
calculate(input: AlgorithmInput): Cluster[];
calculate(input: AlgorithmInput): AlgorithmOutput;
cluster({ map }: AlgorithmInput): Cluster[];

@@ -38,0 +42,0 @@ protected transformCluster({ geometry: { coordinates: [lng, lat], }, properties, }: ClusterFeature<{

@@ -221,13 +221,18 @@ import { featureCollection, point } from '@turf/helpers';

if (map.getZoom() >= this.maxZoom) {
return this.noop({
markers,
return {
clusters: this.noop({
markers,
map,
mapCanvasProjection,
}),
changed: false,
};
}
return {
clusters: this.cluster({
markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),
map,
mapCanvasProjection,
});
}
return this.cluster({
markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),
map,
mapCanvasProjection,
});
}),
};
}

@@ -262,3 +267,7 @@ }

/**
* The default Grid algorithm historically used in Google Maps marker clustering.
* The default Grid algorithm historically used in Google Maps marker
* clustering.
*
* The Grid algorithm does not implement caching and markers may flash as the
* viewport changes. Instead use {@link SuperClusterAlgorithm}.
*/

@@ -326,3 +335,6 @@ class GridAlgorithm extends AbstractViewportAlgorithm {

calculate({ markers, map, mapCanvasProjection, }) {
return this.cluster({ markers, map, mapCanvasProjection });
return {
clusters: this.cluster({ markers, map, mapCanvasProjection }),
changed: false,
};
}

@@ -352,2 +364,5 @@ cluster(input) {

*
* The Grid algorithm does not implement caching and markers may flash as the
* viewport changes. Instead use {@link SuperClusterAlgorithm}.
*
* @see https://www.npmjs.com/package/@turf/clusters-kmeans

@@ -418,2 +433,5 @@ */

*
* The Grid algorithm does not implement caching and markers may flash as the
* viewport changes. Instead use {@link SuperClusterAlgorithm}.
*
* @see https://www.npmjs.com/package/@turf/clusters-dbscan

@@ -469,5 +487,8 @@ */

this.superCluster = new SuperCluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));
this.state = { zoom: null };
}
calculate(input) {
let changed = false;
if (!equal(input.markers, this.markers)) {
changed = true;
// TODO use proxy to avoid copy?

@@ -490,8 +511,18 @@ this.markers = [...input.markers];

}
return this.cluster(input);
const state = { zoom: input.map.getZoom() };
if (!changed) {
if (this.state.zoom > this.maxZoom && state.zoom > this.maxZoom) ;
else {
changed = changed || !equal(this.state, state);
}
}
this.state = state;
if (changed) {
this.clusters = this.cluster(input);
}
return { clusters: this.clusters, changed };
}
cluster({ map }) {
const { west, south, east, north } = map.getBounds().toJSON();
return this.superCluster
.getClusters([west, south, east, north], map.getZoom())
.getClusters([-180, -90, 180, 90], map.getZoom())
.map(this.transformCluster.bind(this));

@@ -758,3 +789,3 @@ }

google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);
const clusters = this.algorithm.calculate({
const { clusters, changed } = this.algorithm.calculate({
markers: this.markers,

@@ -764,7 +795,10 @@ map,

});
// reset visibility of markers and clusters
this.reset();
// store new clusters
this.clusters = clusters;
this.renderClusters();
// allow algorithms to return flag on whether the clusters/markers have changed
if (changed || changed == undefined) {
// reset visibility of markers and clusters
this.reset();
// store new clusters
this.clusters = clusters;
this.renderClusters();
}
google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);

@@ -771,0 +805,0 @@ }

@@ -1,2 +0,2 @@

var markerClusterer=function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=i(t);if(e){var o=i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t,e){return t(e={exports:{}},e.exports),e.exports}var g,m,v=function(t){return t&&t.Math==Math&&t},y=v("object"==typeof globalThis&&globalThis)||v("object"==typeof window&&window)||v("object"==typeof self&&self)||v("object"==typeof p&&p)||function(){return this}()||Function("return this")(),b=function(t){try{return!!t()}catch(t){return!0}},_=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),w={}.propertyIsEnumerable,k=Object.getOwnPropertyDescriptor,M={f:k&&!w.call({1:2},1)?function(t){var e=k(this,t);return!!e&&e.enumerable}:w},O=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},x={}.toString,P=function(t){return x.call(t).slice(8,-1)},S="".split,E=b((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==P(t)?S.call(t,""):Object(t)}:Object,C=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},A=function(t){return E(C(t))},j=function(t){return"function"==typeof t},L=function(t){return"object"==typeof t?null!==t:j(t)},T=function(t){return j(t)?t:void 0},I=function(t,e){return arguments.length<2?T(y[t]):y[t]&&y[t][e]},N=I("navigator","userAgent")||"",D=y.process,F=y.Deno,R=D&&D.versions||F&&F.version,z=R&&R.v8;z?m=(g=z.split("."))[0]<4?1:g[0]+g[1]:N&&(!(g=N.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=N.match(/Chrome\/(\d+)/))&&(m=g[1]);var q=m&&+m,G=!!Object.getOwnPropertySymbols&&!b((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&q&&q<41})),Z=G&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,B=Z?function(t){return"symbol"==typeof t}:function(t){var e=I("Symbol");return j(e)&&Object(t)instanceof e},V=function(t){if(j(t))return t;throw TypeError(function(t){try{return String(t)}catch(t){return"Object"}}(t)+" is not a function")},U=function(t,e){try{Object.defineProperty(y,t,{value:e,configurable:!0,writable:!0})}catch(r){y[t]=e}return e},Q="__core-js_shared__",W=y[Q]||U(Q,{}),X=d((function(t){(t.exports=function(t,e){return W[t]||(W[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.18.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),J=function(t){return Object(C(t))},K={}.hasOwnProperty,H=Object.hasOwn||function(t,e){return K.call(J(t),e)},$=0,Y=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+Y).toString(36)},et=X("wks"),rt=y.Symbol,nt=Z?rt:rt&&rt.withoutSetter||tt,ot=function(t){return H(et,t)&&(G||"string"==typeof et[t])||(G&&H(rt,t)?et[t]=rt[t]:et[t]=nt("Symbol."+t)),et[t]},it=ot("toPrimitive"),st=function(t,e){if(!L(t)||B(t))return t;var r,n,o=null==(r=t[it])?void 0:V(r);if(o){if(void 0===e&&(e="default"),n=o.call(t,e),!L(n)||B(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&j(r=t.toString)&&!L(n=r.call(t)))return n;if(j(r=t.valueOf)&&!L(n=r.call(t)))return n;if("string"!==e&&j(r=t.toString)&&!L(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(t,e)},at=function(t){var e=st(t,"string");return B(e)?e:String(e)},ut=y.document,ct=L(ut)&&L(ut.createElement),ft=function(t){return ct?ut.createElement(t):{}},lt=!_&&!b((function(){return 7!=Object.defineProperty(ft("div"),"a",{get:function(){return 7}}).a})),ht=Object.getOwnPropertyDescriptor,pt={f:_?ht:function(t,e){if(t=A(t),e=at(e),lt)try{return ht(t,e)}catch(t){}if(H(t,e))return O(!M.f.call(t,e),t[e])}},dt=function(t){if(L(t))return t;throw TypeError(String(t)+" is not an object")},gt=Object.defineProperty,mt={f:_?gt:function(t,e,r){if(dt(t),e=at(e),dt(r),lt)try{return gt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},vt=_?function(t,e,r){return mt.f(t,e,O(1,r))}:function(t,e,r){return t[e]=r,t},yt=Function.toString;j(W.inspectSource)||(W.inspectSource=function(t){return yt.call(t)});var bt,_t,wt,kt=W.inspectSource,Mt=y.WeakMap,Ot=j(Mt)&&/native code/.test(kt(Mt)),xt=X("keys"),Pt=function(t){return xt[t]||(xt[t]=tt(t))},St={},Et="Object already initialized",Ct=y.WeakMap;if(Ot||W.state){var At=W.state||(W.state=new Ct),jt=At.get,Lt=At.has,Tt=At.set;bt=function(t,e){if(Lt.call(At,t))throw new TypeError(Et);return e.facade=t,Tt.call(At,t,e),e},_t=function(t){return jt.call(At,t)||{}},wt=function(t){return Lt.call(At,t)}}else{var It=Pt("state");St[It]=!0,bt=function(t,e){if(H(t,It))throw new TypeError(Et);return e.facade=t,vt(t,It,e),e},_t=function(t){return H(t,It)?t[It]:{}},wt=function(t){return H(t,It)}}var Nt={set:bt,get:_t,has:wt,enforce:function(t){return wt(t)?_t(t):bt(t,{})},getterFor:function(t){return function(e){var r;if(!L(e)||(r=_t(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},Dt=Function.prototype,Ft=_&&Object.getOwnPropertyDescriptor,Rt=H(Dt,"name"),zt={EXISTS:Rt,PROPER:Rt&&"something"===function(){}.name,CONFIGURABLE:Rt&&(!_||_&&Ft(Dt,"name").configurable)},qt=d((function(t){var e=zt.CONFIGURABLE,r=Nt.get,n=Nt.enforce,o=String(String).split("String");(t.exports=function(t,r,i,s){var a,u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet,l=s&&void 0!==s.name?s.name:r;j(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!H(i,"name")||e&&i.name!==l)&&vt(i,"name",l),(a=n(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==y?(u?!f&&t[r]&&(c=!0):delete t[r],c?t[r]=i:vt(t,r,i)):c?t[r]=i:U(r,i)})(Function.prototype,"toString",(function(){return j(this)&&r(this).source||kt(this)}))})),Gt=Math.ceil,Zt=Math.floor,Bt=function(t){var e=+t;return e!=e||0===e?0:(e>0?Zt:Gt)(e)},Vt=Math.max,Ut=Math.min,Qt=function(t,e){var r=Bt(t);return r<0?Vt(r+e,0):Ut(r,e)},Wt=Math.min,Xt=function(t){return(e=t.length)>0?Wt(Bt(e),9007199254740991):0;var e},Jt=function(t){return function(e,r,n){var o,i=A(e),s=Xt(i),a=Qt(n,s);if(t&&r!=r){for(;s>a;)if((o=i[a++])!=o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},Kt={includes:Jt(!0),indexOf:Jt(!1)},Ht=Kt.indexOf,$t=function(t,e){var r,n=A(t),o=0,i=[];for(r in n)!H(St,r)&&H(n,r)&&i.push(r);for(;e.length>o;)H(n,r=e[o++])&&(~Ht(i,r)||i.push(r));return i},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],te=Yt.concat("length","prototype"),ee={f:Object.getOwnPropertyNames||function(t){return $t(t,te)}},re={f:Object.getOwnPropertySymbols},ne=I("Reflect","ownKeys")||function(t){var e=ee.f(dt(t)),r=re.f;return r?e.concat(r(t)):e},oe=function(t,e){for(var r=ne(e),n=mt.f,o=pt.f,i=0;i<r.length;i++){var s=r[i];H(t,s)||n(t,s,o(e,s))}},ie=/#|\.prototype\./,se=function(t,e){var r=ue[ae(t)];return r==fe||r!=ce&&(j(e)?b(e):!!e)},ae=se.normalize=function(t){return String(t).replace(ie,".").toLowerCase()},ue=se.data={},ce=se.NATIVE="N",fe=se.POLYFILL="P",le=se,he=pt.f,pe=function(t,e){var r,n,o,i,s,a=t.target,u=t.global,c=t.stat;if(r=u?y:c?y[a]||U(a,{}):(y[a]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(s=he(r,n))&&s.value:r[n],!le(u?n:a+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;oe(i,o)}(t.sham||o&&o.sham)&&vt(i,"sham",!0),qt(r,n,i,t)}},de=Array.isArray||function(t){return"Array"==P(t)},ge={};ge[ot("toStringTag")]="z";var me="[object z]"===String(ge),ve=ot("toStringTag"),ye="Arguments"==P(function(){return arguments}()),be=me?P:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ve))?r:ye?P(e):"Object"==(n=P(e))&&j(e.callee)?"Arguments":n},_e=[],we=I("Reflect","construct"),ke=/^\s*(?:class|function)\b/,Me=ke.exec,Oe=!ke.exec((function(){})),xe=function(t){if(!j(t))return!1;try{return we(Object,_e,t),!0}catch(t){return!1}},Pe=!we||b((function(){var t;return xe(xe.call)||!xe(Object)||!xe((function(){t=!0}))||t}))?function(t){if(!j(t))return!1;switch(be(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Oe||!!Me.call(ke,kt(t))}:xe,Se=ot("species"),Ee=function(t,e){return new(function(t){var e;return de(t)&&(e=t.constructor,(Pe(e)&&(e===Array||de(e.prototype))||L(e)&&null===(e=e[Se]))&&(e=void 0)),void 0===e?Array:e}(t))(0===e?0:e)},Ce=[].push,Ae=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,s=7==t,a=5==t||i;return function(u,c,f,l){for(var h,p,d=J(u),g=E(d),m=function(t,e,r){if(V(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}(c,f,3),v=Xt(g),y=0,b=l||Ee,_=e?b(u,v):r||s?b(u,0):void 0;v>y;y++)if((a||y in g)&&(p=m(h=g[y],y,d),t))if(e)_[y]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:Ce.call(_,h)}else switch(t){case 4:return!1;case 7:Ce.call(_,h)}return i?-1:n||o?o:_}},je={forEach:Ae(0),map:Ae(1),filter:Ae(2),some:Ae(3),every:Ae(4),find:Ae(5),findIndex:Ae(6),filterReject:Ae(7)},Le=ot("species"),Te=function(t){return q>=51||!b((function(){var e=[];return(e.constructor={})[Le]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ie=je.map;function Ne(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}pe({target:"Array",proto:!0,forced:!Te("map")},{map:function(t){return Ie(this,t,arguments.length>1?arguments[1]:void 0)}});var De=function(t){return function(e,r,n,o){V(r);var i=J(e),s=E(i),a=Xt(i),u=t?a-1:0,c=t?-1:1;if(n<2)for(;;){if(u in s){o=s[u],u+=c;break}if(u+=c,t?u<0:a<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:a>u;u+=c)u in s&&(o=r(o,s[u],u,i));return o}},Fe={left:De(!1),right:De(!0)},Re=function(t,e){var r=[][t];return!!r&&b((function(){r.call(null,e||function(){throw 1},1)}))},ze="process"==P(y.process),qe=Fe.left;pe({target:"Array",proto:!0,forced:!Re("reduce")||!ze&&q>79&&q<83},{reduce:function(t){return qe(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Ge=je.filter;pe({target:"Array",proto:!0,forced:!Te("filter")},{filter:function(t){return Ge(this,t,arguments.length>1?arguments[1]:void 0)}});var Ze=function(){function t(r){var n=r.markers,o=r.position;e(this,t),this.markers=n,o&&(o instanceof google.maps.LatLng?this._position=o:this._position=new google.maps.LatLng(o))}return n(t,[{key:"bounds",get:function(){if(0!==this.markers.length||this._position)return this.markers.reduce((function(t,e){return t.extend(e.getPosition())}),new google.maps.LatLngBounds(this._position,this._position))}},{key:"position",get:function(){return this._position||this.bounds.getCenter()}},{key:"count",get:function(){return this.markers.filter((function(t){return t.getVisible()})).length}},{key:"push",value:function(t){this.markers.push(t)}},{key:"delete",value:function(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}]),t}(),Be=function(t,e,r,n){var o=Ve(t.getBounds(),e,n);return r.filter((function(t){return o.contains(t.getPosition())}))},Ve=function(t,e,r){var n=Qe(t,e),o=n.northEast,i=n.southWest,s=We({northEast:o,southWest:i},r);return Xe(s,e)},Ue=function(t,e){var r=(e.lat-t.lat)*Math.PI/180,n=(e.lng-t.lng)*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},Qe=function(t,e){return{northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}},We=function(t,e){var r=t.northEast,n=t.southWest;return r.x+=e,r.y-=e,n.x-=e,n.y+=e,{northEast:r,southWest:n}},Xe=function(t,e){var r=t.northEast,n=t.southWest,o=new google.maps.LatLngBounds;return o.extend(e.fromDivPixelToLatLng(r)),o.extend(e.fromDivPixelToLatLng(n)),o},Je=function(){function t(r){var n=r.maxZoom,o=void 0===n?16:n;e(this,t),this.maxZoom=o}return n(t,[{key:"noop",value:function(t){var e=t.markers;return He(e)}}]),t}(),Ke=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.viewportPadding,s=void 0===o?60:o,a=Ne(t,["viewportPadding"]);return(n=r.call(this,a)).viewportPadding=60,n.viewportPadding=s,n}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return r.getZoom()>=this.maxZoom?this.noop({markers:e,map:r,mapCanvasProjection:n}):this.cluster({markers:Be(r,n,e,this.viewportPadding),map:r,mapCanvasProjection:n})}}]),i}(Je),He=function(t){return t.map((function(t){return new Ze({position:t.getPosition(),markers:[t]})}))},$e={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Ye=ft("span").classList,tr=Ye&&Ye.constructor&&Ye.constructor.prototype,er=tr===Object.prototype?void 0:tr,rr=je.forEach,nr=Re("forEach")?[].forEach:function(t){return rr(this,t,arguments.length>1?arguments[1]:void 0)},or=function(t){if(t&&t.forEach!==nr)try{vt(t,"forEach",nr)}catch(e){t.forEach=nr}};for(var ir in $e)$e[ir]&&or(y[ir]&&y[ir].prototype);or(er),pe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var sr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?4e4:o,a=t.gridSize,u=void 0===a?40:a,c=Ne(t,["maxDistance","gridSize"]);return(n=r.call(this,c)).clusters=[],n.maxDistance=s,n.gridSize=u,n}return n(i,[{key:"cluster",value:function(t){var e=this,r=t.markers,n=t.map,o=t.mapCanvasProjection;return this.clusters=[],r.forEach((function(t){e.addToClosestCluster(t,n,o)})),this.clusters}},{key:"addToClosestCluster",value:function(t,e,r){for(var n=this.maxDistance,o=null,i=0;i<this.clusters.length;i++){var s=this.clusters[i],a=Ue(s.bounds.getCenter().toJSON(),t.getPosition().toJSON());a<n&&(n=a,o=s)}if(o&&Ve(o.bounds,r,this.gridSize).contains(t.getPosition()))o.push(t);else{var u=new Ze({markers:[t]});this.clusters.push(u)}}}]),i}(Ke),ar=function(t){o(i,t);var r=u(i);function i(t){e(this,i);var n=Ne(t,[]);return r.call(this,n)}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return this.cluster({markers:e,map:r,mapCanvasProjection:n})}},{key:"cluster",value:function(t){return this.noop(t)}}]),i}(Je),ur=6371008.8,cr={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*ur,kilometers:6371.0088,kilometres:6371.0088,meters:ur,metres:ur,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:ur/1852,radians:1,yards:6967335.223679999};function fr(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!gr(t[0])||!gr(t[1]))throw new Error("coordinates must contain numbers");return function(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}({type:"Point",coordinates:t},e,r)}function lr(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function hr(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t*r}function pr(t){return t%360*Math.PI/180}function dr(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return hr(function(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t/r}(t,e),r)}function gr(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function mr(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return vr(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return vr(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return br(t);default:throw new Error("unknown GeoJSON type")}}function vr(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=yr(t.properties),e.geometry=br(t.geometry),e}function yr(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:Array.isArray(n)?e[r]=n.map((function(t){return t})):e[r]=yr(n):e[r]=n})),e):e}function br(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return br(t)})),e):(e.coordinates=_r(t.coordinates),e)}function _r(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return _r(t)}))}function wr(t,e,r){if(null!==t)for(var n,o,i,s,a,u,c,f,l=0,h=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,m=d?t.features.length:1,v=0;v<m;v++){a=(f=!!(c=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<a;y++){var b=0,_=0;if(null!==(s=f?c.geometries[y]:c)){u=s.coordinates;var w=s.type;switch(l=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,h,v,b,_))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],h,v,b,_))return!1;h++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(o=0;o<u[n].length-l;o++){if(!1===e(u[n][o],h,v,b,_))return!1;h++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(_=0,o=0;o<u[n].length;o++){for(i=0;i<u[n][o].length-l;i++){if(!1===e(u[n][o][i],h,v,b,_))return!1;h++}_++}b++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===wr(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kr(t){var e=[];return wr(t,(function(t){e.push(t)})),e}var Mr=function(t,e,r){for(var n=t.length,o=0,i=0;i<n;i++){var s=(t[i]||0)-(e[i]||0);o+=s*s}return r?Math.sqrt(o):o},Or=Mr,xr=function(t,e,r){var n=Math.abs(t-e);return r?n:n*n},Pr=Mr,Sr=function(t,e){for(var r={},n=[],o=e<<2,i=t.length,s=t[0].length>0;n.length<e&&o-- >0;){var a=t[Math.floor(Math.random()*i)],u=s?a.join("_"):""+a;r[u]||(r[u]=!0,n.push(a))}if(n.length<e)throw new Error("Error initializating clusters");return n},Er=function(t,e){var r=t[0].length?Or:xr,n=[],o=t.length,i=t[0].length>0,s=t[Math.floor(Math.random()*o)];i&&s.join("_");for(n.push(s);n.length<e;){for(var a=[],u=n.length,c=0,f=[],l=0;l<o;l++){for(var h=1/0,p=0;p<u;p++){var d=r(t[l],n[p]);d<=h&&(h=d)}a[l]=h}for(var g=0;g<o;g++)c+=a[g];for(var m=0;m<o;m++)f[m]={i:m,v:t[m],pr:a[m]/c,cs:0};f.sort((function(t,e){return t.pr-e.pr})),f[0].cs=f[0].pr;for(var v=1;v<o;v++)f[v].cs=f[v-1].cs+f[v].pr;for(var y=Math.random(),b=0;b<o-1&&f[b++].cs<y;);n.push(f[b-1].v)}return n};function Cr(t,e,r){r=r||[];for(var n=0;n<t;n++)r[n]=e;return r}var Ar=function(t,e,r,n){var o=[],i=[],s=[],a=[],u=!1,c=n||1e4,f=t.length,l=t[0].length,h=l>0,p=[];if(r)o="kmrand"==r?Sr(t,e):"kmpp"==r?Er(t,e):r;else for(var d={};o.length<e;){var g=Math.floor(Math.random()*f);d[g]||(d[g]=!0,o.push(t[g]))}do{Cr(e,0,p);for(var m=0;m<f;m++){for(var v=1/0,y=0,b=0;b<e;b++){(a=h?Pr(t[m],o[b]):Math.abs(t[m]-o[b]))<=v&&(v=a,y=b)}s[m]=y,p[y]++}for(var _=[],w=(i=[],0);w<e;w++)_[w]=h?Cr(l,0,_[w]):0,i[w]=o[w];if(h){for(var k=0;k<e;k++)o[k]=[];for(var M=0;M<f;M++)for(var O=_[s[M]],x=t[M],P=0;P<l;P++)O[P]+=x[P];u=!0;for(var S=0;S<e;S++){for(var E=o[S],C=_[S],A=i[S],j=p[S],L=0;L<l;L++)E[L]=C[L]/j||0;if(u)for(var T=0;T<l;T++)if(A[T]!=E[T]){u=!1;break}}}else{for(var I=0;I<f;I++){_[s[I]]+=t[I]}for(var N=0;N<e;N++)o[N]=_[N]/p[N]||0;u=!0;for(var D=0;D<e;D++)if(i[D]!=o[D]){u=!1;break}}u=u||--c<=0}while(!u);return{it:1e4-c,k:e,idxs:s,centroids:o}};var jr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.numberOfClusters,s=Ne(t,["numberOfClusters"]);return(n=r.call(this,s)).numberOfClusters=o,n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.map,n=[];return 0===e.length||function(t,e){void 0===e&&(e={});var r=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(r/2)),e.numberOfClusters>r&&(e.numberOfClusters=r),!0!==e.mutate&&(t=mr(t));var n=kr(t),o=n.slice(0,e.numberOfClusters),i=Ar(n,e.numberOfClusters,o),s={};return i.centroids.forEach((function(t,e){s[e]=t})),function(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}(t,(function(t,e){var r=i.idxs[e];t.properties.cluster=r,t.properties.centroid=s[r]})),t}(lr(e.map((function(t){return fr([t.getPosition().lng(),t.getPosition().lat()])}))),{numberOfClusters:this.numberOfClusters instanceof Function?this.numberOfClusters(e.length,r.getZoom()):this.numberOfClusters}).features.forEach((function(t,r){n[t.properties.cluster]||(n[t.properties.cluster]=new Ze({position:{lng:t.properties.centroid[0],lat:t.properties.centroid[1]},markers:[]})),n[t.properties.cluster].push(e[r])})),n}}]),i}(Ke),Lr=Object.keys||function(t){return $t(t,Yt)},Tr=Object.assign,Ir=Object.defineProperty,Nr=!Tr||b((function(){if(_&&1!==Tr({b:1},Tr(Ir({},"a",{enumerable:!0,get:function(){Ir(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Tr({},t)[r]||Lr(Tr({},e)).join("")!=n}))?function(t,e){for(var r=J(t),n=arguments.length,o=1,i=re.f,s=M.f;n>o;)for(var a,u=E(arguments[o++]),c=i?Lr(u).concat(i(u)):Lr(u),f=c.length,l=0;f>l;)a=c[l++],_&&!s.call(u,a)||(r[a]=u[a]);return r}:Tr;function Dr(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Fr(t,e,r){void 0===r&&(r={});var n=Dr(t),o=Dr(e),i=pr(o[1]-n[1]),s=pr(o[0]-n[0]),a=pr(n[1]),u=pr(o[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return hr(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}pe({target:"Object",stat:!0,forced:Object.assign!==Nr},{assign:Nr});var Rr=d((function(t){function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var o=0;o<this._datasetLength;o++)if(1!==this._visited[o]){this._visited[o]=1;var i=this._regionQuery(o);if(i.length<this.minPts)this.noise.push(o);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(o,s),this._expandCluster(s,i)}}return this.clusters},e.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},e.prototype._expandCluster=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];if(1!==this._visited[n]){this._visited[n]=1;var o=this._regionQuery(n);o.length>=this.minPts&&(e=this._mergeArrays(e,o))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r<this._datasetLength;r++){this.distance(this.dataset[t],this.dataset[r])<this.epsilon&&e.push(r)}return e},e.prototype._mergeArrays=function(t,e){for(var r=e.length,n=0;n<r;n++){var o=e[n];t.indexOf(o)<0&&t.push(o)}return t},e.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=e)})),zr=d((function(t){function e(t,e,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,r)}e.prototype.init=function(t,e,r){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==r&&(this.distance=r)},e.prototype.run=function(t,e){this.init(t,e);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var o=!0;o;){o=this.assign();for(var i=0;i<this.k;i++){for(var s=new Array(f),a=0,u=0;u<f;u++)s[u]=0;for(var c=0;c<r;c++){var f=this.dataset[c].length;if(i===this.assignments[c]){for(u=0;u<f;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<f;u++)s[u]/=a;this.centroids[i]=s}else this.centroids[i]=this.randomCentroid(),o=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,r=this.dataset.length-1;do{e=Math.round(Math.random()*r),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;n<r;n++)(t=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),r=0;r<this.assignments.length;r++)void 0===e[t=this.assignments[r]]&&(e[t]=[]),e[t].push(r);return e},e.prototype.argmin=function(t,e,r){for(var n,o=Number.MAX_VALUE,i=0,s=e.length,a=0;a<s;a++)(n=r(t,e[a]))<o&&(o=n,i=a);return i},e.prototype.distance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;){var o=t[n]-e[n];r+=o*o}return Math.sqrt(r)},t.exports&&(t.exports=e)})),qr=d((function(t){function e(t,e,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,r)}e.prototype.insert=function(t,e){for(var r=this._queue.length,n=r;n--;){var o=this._priorities[n];"desc"===this._sorting?e>o&&(r=n):e<o&&(r=n)}this._insertAt(t,e,r)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,r=this._queue.length;e<r;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,r){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var n=0;n<t.length;n++)this.insert(t[n],e[n])}r&&(this._sorting=r)},e.prototype._insertAt=function(t,e,r){this._queue.length===r?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(r,0,t),this._priorities.splice(r,0,e))},t.exports&&(t.exports=e)})),Gr=d((function(t){if(t.exports)var e=qr;function r(t,e,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,r,n)}r.prototype.run=function(t,r,n,o){this._init(t,r,n,o);for(var i=0,s=this.dataset.length;i<s;i++)if(1!==this._processed[i]){this._processed[i]=1,this.clusters.push([i]);var a=this.clusters.length-1;this._orderedList.push(i);var u=new e(null,null,"asc"),c=this._regionQuery(i);void 0!==this._distanceToCore(i)&&(this._updateQueue(i,c,u),this._expandCluster(a,u))}return this.clusters},r.prototype.getReachabilityPlot=function(){for(var t=[],e=0,r=this._orderedList.length;e<r;e++){var n=this._orderedList[e],o=this._reachability[n];t.push([n,o])}return t},r.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},r.prototype._updateQueue=function(t,e,r){var n=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===n._processed[e]){var o=n.distance(n.dataset[t],n.dataset[e]),i=Math.max(n._coreDistance,o);void 0===n._reachability[e]?(n._reachability[e]=i,r.insert(e,i)):i<n._reachability[e]&&(n._reachability[e]=i,r.remove(e),r.insert(e,i))}}))},r.prototype._expandCluster=function(t,e){for(var r=e.getElements(),n=0,o=r.length;n<o;n++){var i=r[n];if(void 0===this._processed[i]){var s=this._regionQuery(i);this._processed[i]=1,this.clusters[t].push(i),this._orderedList.push(i),void 0!==this._distanceToCore(i)&&(this._updateQueue(i,s,e),this._expandCluster(t,e))}}},r.prototype._distanceToCore=function(t){for(var e=this.epsilon,r=0;r<e;r++){if(this._regionQuery(t,r).length>=this.minPts)return r}},r.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,o=this.dataset.length;n<o;n++)this.distance(this.dataset[t],this.dataset[n])<e&&r.push(n);return r},r.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=r)})),Zr=d((function(t){t.exports&&(t.exports={DBSCAN:Rr,KMEANS:zr,OPTICS:Gr,PriorityQueue:qr})}));Zr.DBSCAN,Zr.KMEANS,Zr.OPTICS,Zr.PriorityQueue;var Br={units:"kilometers",mutate:!1,minPoints:1},Vr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?200:o,a=t.minPoints,u=void 0===a?Br.minPoints:a,c=Ne(t,["maxDistance","minPoints"]);return(n=r.call(this,c)).maxDistance=s,n.options=Object.assign(Object.assign({},Br),{minPoints:u}),n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.mapCanvasProjection,n=lr(e.map((function(t){var e=r.fromLatLngToContainerPixel(t.getPosition());return fr([e.x,e.y])}))),o=[];return function(t,e,r){void 0===r&&(r={}),!0!==r.mutate&&(t=mr(t)),r.minPoints=r.minPoints||3;var n=new Zr.DBSCAN,o=n.run(kr(t),dr(e,r.units),r.minPoints,Fr),i=-1;return o.forEach((function(e){i++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=i,r.properties.dbscan="core"}))})),n.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t}(n,this.maxDistance,this.options).features.forEach((function(t,r){o[t.properties.cluster]||(o[t.properties.cluster]=[]),o[t.properties.cluster].push(e[r])})),o.map((function(t){return new Ze({markers:t})}))}}]),i}(Ke);function Ur(t,e,r,n,o,i){if(o-n<=r)return;const s=n+o>>1;Qr(t,e,s,n,o,i%2),Ur(t,e,r,n,s-1,i+1),Ur(t,e,r,s+1,o,i+1)}function Qr(t,e,r,n,o,i){for(;o>n;){if(o-n>600){const s=o-n+1,a=r-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);Qr(t,e,r,Math.max(n,Math.floor(r-a*c/s+f)),Math.min(o,Math.floor(r+(s-a)*c/s+f)),i)}const s=e[2*r+i];let a=n,u=o;for(Wr(t,e,n,r),e[2*o+i]>s&&Wr(t,e,n,o);a<u;){for(Wr(t,e,a,u),a++,u--;e[2*a+i]<s;)a++;for(;e[2*u+i]>s;)u--}e[2*n+i]===s?Wr(t,e,n,u):(u++,Wr(t,e,u,o)),u<=r&&(n=u+1),r<=u&&(o=u-1)}}function Wr(t,e,r,n){Xr(t,r,n),Xr(e,2*r,2*n),Xr(e,2*r+1,2*n+1)}function Xr(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function Jr(t,e,r,n){const o=t-r,i=e-n;return o*o+i*i}const Kr=t=>t[0],Hr=t=>t[1];class $r{constructor(t,e=Kr,r=Hr,n=64,o=Float64Array){this.nodeSize=n,this.points=t;const i=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new i(t.length),a=this.coords=new o(2*t.length);for(let n=0;n<t.length;n++)s[n]=n,a[2*n]=e(t[n]),a[2*n+1]=r(t[n]);Ur(s,a,n,0,s.length-1,0)}range(t,e,r,n){return function(t,e,r,n,o,i,s){const a=[0,t.length-1,0],u=[];let c,f;for(;a.length;){const l=a.pop(),h=a.pop(),p=a.pop();if(h-p<=s){for(let s=p;s<=h;s++)c=e[2*s],f=e[2*s+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[s]);continue}const d=Math.floor((p+h)/2);c=e[2*d],f=e[2*d+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[d]);const g=(l+1)%2;(0===l?r<=c:n<=f)&&(a.push(p),a.push(d-1),a.push(g)),(0===l?o>=c:i>=f)&&(a.push(d+1),a.push(h),a.push(g))}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)}within(t,e,r){return function(t,e,r,n,o,i){const s=[0,t.length-1,0],a=[],u=o*o;for(;s.length;){const c=s.pop(),f=s.pop(),l=s.pop();if(f-l<=i){for(let o=l;o<=f;o++)Jr(e[2*o],e[2*o+1],r,n)<=u&&a.push(t[o]);continue}const h=Math.floor((l+f)/2),p=e[2*h],d=e[2*h+1];Jr(p,d,r,n)<=u&&a.push(t[h]);const g=(c+1)%2;(0===c?r-o<=p:n-o<=d)&&(s.push(l),s.push(h-1),s.push(g)),(0===c?r+o>=p:n+o>=d)&&(s.push(h+1),s.push(f),s.push(g))}return a}(this.ids,this.coords,t,e,r,this.nodeSize)}}const Yr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},tn=Math.fround||(en=new Float32Array(1),t=>(en[0]=+t,en[0]));var en;class rn{constructor(t){this.options=ln(Object.create(Yr),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:r,maxZoom:n,nodeSize:o}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(on(t[e],e));this.trees[n+1]=new $r(s,hn,pn,o,Float32Array),e&&console.timeEnd(i);for(let t=n;t>=r;t--){const r=+Date.now();s=this._cluster(s,t),this.trees[t]=new $r(s,hn,pn,o,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let o=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,o=180;else if(r>o){const t=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,o,i],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(un(r),cn(i),un(o),cn(n)),u=[];for(const t of a){const e=s.points[t];u.push(e.numPoints?sn(e):this.points[e.index])}return u}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(n);const i=o.points[e];if(!i)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o.within(i.x,i.y,s),u=[];for(const e of a){const r=o.points[e];r.parentId===t&&u.push(r.numPoints?sn(r):this.points[r.index])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:i,radius:s}=this.options,a=s/i,u=(r-a)/o,c=(r+1+a)/o,f={features:[]};return this._addTileFeatures(n.range((e-a)/o,u,(e+1+a)/o,c),n.points,e,r,o,f),0===e&&this._addTileFeatures(n.range(1-a/o,u,1,c),n.points,o,r,o,f),e===o-1&&this._addTileFeatures(n.range(0,u,a/o,c),n.points,-1,r,o,f),f.features.length?f:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,o){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?o+i.point_count<=n?o+=i.point_count:o=this._appendLeaves(t,i.cluster_id,r,n,o):o<n?o++:t.push(e),t.length===r)break}return o}_addTileFeatures(t,e,r,n,o,i){for(const s of t){const t=e[s],a=t.numPoints;let u,c,f;if(a)u=an(t),c=t.x,f=t.y;else{const e=this.points[t.index];u=e.properties,c=un(e.geometry.coordinates[0]),f=cn(e.geometry.coordinates[1])}const l={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(f*o-n))]],tags:u};let h;a?h=t.id:this.options.generateId?h=t.index:this.points[t.index].id&&(h=this.points[t.index].id),void 0!==h&&(l.id=h),i.features.push(l)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))}_cluster(t,e){const r=[],{radius:n,extent:o,reduce:i,minPoints:s}=this.options,a=n/(o*Math.pow(2,e));for(let n=0;n<t.length;n++){const o=t[n];if(o.zoom<=e)continue;o.zoom=e;const u=this.trees[e+1],c=u.within(o.x,o.y,a),f=o.numPoints||1;let l=f;for(const t of c){const r=u.points[t];r.zoom>e&&(l+=r.numPoints||1)}if(l>=s){let t=o.x*f,s=o.y*f,a=i&&f>1?this._map(o,!0):null;const h=(n<<5)+(e+1)+this.points.length;for(const r of c){const n=u.points[r];if(n.zoom<=e)continue;n.zoom=e;const c=n.numPoints||1;t+=n.x*c,s+=n.y*c,n.parentId=h,i&&(a||(a=this._map(o,!0)),i(a,this._map(n)))}o.parentId=h,r.push(nn(t/l,s/l,h,l,a))}else if(r.push(o),l>1)for(const t of c){const n=u.points[t];n.zoom<=e||(n.zoom=e,r.push(n))}}return r}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?ln({},t.properties):t.properties;const r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?ln({},n):n}}function nn(t,e,r,n,o){return{x:tn(t),y:tn(e),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:o}}function on(t,e){const[r,n]=t.geometry.coordinates;return{x:tn(un(r)),y:tn(cn(n)),zoom:1/0,index:e,parentId:-1}}function sn(t){return{type:"Feature",id:t.id,properties:an(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),fn(t.y)]}};var e}function an(t){const e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return ln(ln({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function un(t){return t/360+.5}function cn(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fn(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ln(t,e){for(const r in e)t[r]=e[r];return t}function hn(t){return t.x}function pn(t){return t.y}var dn,gn=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},mn=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxZoom,s=t.radius,a=void 0===s?60:s,u=Ne(t,["maxZoom","radius"]);return(n=r.call(this,{maxZoom:o})).superCluster=new rn(Object.assign({maxZoom:n.maxZoom,radius:a},u)),n}return n(i,[{key:"calculate",value:function(t){if(!gn(t.markers,this.markers)){this.markers=f(t.markers);var e=this.markers.map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().lng(),t.getPosition().lat()]},properties:{marker:t}}}));this.superCluster.load(e)}return this.cluster(t)}},{key:"cluster",value:function(t){var e=t.map,r=e.getBounds().toJSON(),n=r.west,o=r.south,i=r.east,s=r.north;return this.superCluster.getClusters([n,o,i,s],e.getZoom()).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function(t){var e=c(t.geometry.coordinates,2),r=e[0],n=e[1],o=t.properties;if(o.cluster)return new Ze({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:n,lng:r})});var i=o.marker;return new Ze({markers:[i],position:i.getPosition()})}}]),i}(Je),vn=_?Object.defineProperties:function(t,e){dt(t);for(var r,n=Lr(e),o=n.length,i=0;o>i;)mt.f(t,r=n[i++],e[r]);return t},yn=I("document","documentElement"),bn=Pt("IE_PROTO"),_n=function(){},wn=function(t){return"<script>"+t+"</"+"script>"},kn=function(t){t.write(wn("")),t.close();var e=t.parentWindow.Object;return t=null,e},Mn=function(){try{dn=new ActiveXObject("htmlfile")}catch(t){}var t,e;Mn="undefined"!=typeof document?document.domain&&dn?kn(dn):((e=ft("iframe")).style.display="none",yn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(wn("document.F=Object")),t.close(),t.F):kn(dn);for(var r=Yt.length;r--;)delete Mn.prototype[Yt[r]];return Mn()};St[bn]=!0;var On=Object.create||function(t,e){var r;return null!==t?(_n.prototype=dt(t),r=new _n,_n.prototype=null,r[bn]=t):r=Mn(),void 0===e?r:vn(r,e)},xn=ot("unscopables"),Pn=Array.prototype;null==Pn[xn]&&mt.f(Pn,xn,{configurable:!0,value:On(null)});var Sn=Kt.includes;pe({target:"Array",proto:!0},{includes:function(t){return Sn(this,t,arguments.length>1?arguments[1]:void 0)}}),function(t){Pn[xn][t]=!0}("includes");var En=ot("match"),Cn=function(t){if(function(t){var e;return L(t)&&(void 0!==(e=t[En])?!!e:"RegExp"==P(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},An=function(t){if("Symbol"===be(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},jn=ot("match");pe({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[jn]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~An(C(this)).indexOf(An(Cn(t)),arguments.length>1?arguments[1]:void 0)}});var Ln=Kt.indexOf,Tn=[].indexOf,In=!!Tn&&1/[1].indexOf(1,-0)<0,Nn=Re("indexOf");pe({target:"Array",proto:!0,forced:In||!Nn},{indexOf:function(t){return In?Tn.apply(this,arguments)||0:Ln(this,t,arguments.length>1?arguments[1]:void 0)}});var Dn=function(t,e,r){var n=at(e);n in t?mt.f(t,n,O(0,r)):t[n]=r},Fn=Te("splice"),Rn=Math.max,zn=Math.min,qn=9007199254740991,Gn="Maximum allowed length exceeded";pe({target:"Array",proto:!0,forced:!Fn},{splice:function(t,e){var r,n,o,i,s,a,u=J(this),c=Xt(u),f=Qt(t,c),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=c-f):(r=l-2,n=zn(Rn(Bt(e),0),c-f)),c+r-n>qn)throw TypeError(Gn);for(o=Ee(u,n),i=0;i<n;i++)(s=f+i)in u&&Dn(o,i,u[s]);if(o.length=n,r<n){for(i=f;i<c-n;i++)a=i+r,(s=i+n)in u?u[a]=u[s]:delete u[a];for(i=c;i>c-n+r;i--)delete u[i-1]}else if(r>n)for(i=c-n;i>f;i--)a=i+r-1,(s=i+n-1)in u?u[a]=u[s]:delete u[a];for(i=0;i<r;i++)u[i+f]=arguments[i+2];return u.length=c-n+r,o}});var Zn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return dt(r),function(t){if("object"==typeof t||j(t))return t;throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Bn=function(t,e,r){var n,o;return Zn&&j(n=e.constructor)&&n!==r&&L(o=n.prototype)&&o!==r.prototype&&Zn(t,o),t},Vn=1..valueOf,Un=function(t){return Vn.call(t)},Qn="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Wn=RegExp("^"+Qn+Qn+"*"),Xn=RegExp(Qn+Qn+"*$"),Jn=function(t){return function(e){var r=An(C(e));return 1&t&&(r=r.replace(Wn,"")),2&t&&(r=r.replace(Xn,"")),r}},Kn={start:Jn(1),end:Jn(2),trim:Jn(3)},Hn=ee.f,$n=pt.f,Yn=mt.f,to=Kn.trim,eo="Number",ro=y.Number,no=ro.prototype,oo=function(t){var e=st(t,"number");return"bigint"==typeof e?e:io(e)},io=function(t){var e,r,n,o,i,s,a,u,c=st(t,"number");if(B(c))throw TypeError("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(43===(e=(c=to(c)).charCodeAt(0))||45===e){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(s=(i=c.slice(2)).length,a=0;a<s;a++)if((u=i.charCodeAt(a))<48||u>o)return NaN;return parseInt(i,n)}return+c};if(le(eo,!ro(" 0o1")||!ro("0b1")||ro("+0x1"))){for(var so,ao=function(t){var e=arguments.length<1?0:ro(oo(t)),r=this;return r instanceof ao&&b((function(){Un(r)}))?Bn(Object(e),r,ao):e},uo=_?Hn(ro):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),co=0;uo.length>co;co++)H(ro,so=uo[co])&&!H(ao,so)&&Yn(ao,so,$n(ro,so));ao.prototype=no,no.constructor=ao,qt(y,eo,ao)}var fo=function t(r,n){e(this,t),this.markers={sum:r.length};var o=n.map((function(t){return t.count})),i=o.reduce((function(t,e){return t+e}),0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min.apply(Math,f(o)),max:Math.max.apply(Math,f(o))}}},lo=function(){function t(){e(this,t)}return n(t,[{key:"render",value:function(t,e){var r=t.count,n=t.position,o=r>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff",i=window.btoa('\n <svg fill="'.concat(o,'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">\n <circle cx="120" cy="120" opacity=".6" r="70" />\n <circle cx="120" cy="120" opacity=".3" r="90" />\n <circle cx="120" cy="120" opacity=".2" r="110" />\n </svg>'));return new google.maps.Marker({position:n,icon:{url:"data:image/svg+xml;base64,".concat(i),scaledSize:new google.maps.Size(45,45)},label:{text:String(r),color:"rgba(255,255,255,0.9)",fontSize:"12px"},zIndex:Number(google.maps.Marker.MAX_ZINDEX)+r})}}]),t}();var ho,po=function t(){e(this,t),function(t,e){for(var r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)};t.MarkerClustererEvents=void 0,(ho=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",ho.CLUSTERING_END="clusteringend",ho.CLUSTER_CLICK="click";var go=function(t,e,r){r.fitBounds(e.bounds)},mo=function(r){o(s,r);var i=u(s);function s(t){var r,n=t.map,o=t.markers,a=void 0===o?[]:o,u=t.algorithm,c=void 0===u?new mn({}):u,l=t.renderer,h=void 0===l?new lo:l,p=t.onClusterClick,d=void 0===p?go:p;return e(this,s),(r=i.call(this)).markers=f(a),r.clusters=[],r.algorithm=c,r.renderer=h,r.onClusterClick=d,n&&r.setMap(n),r}return n(s,[{key:"addMarker",value:function(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}},{key:"addMarkers",value:function(t,e){var r=this;t.forEach((function(t){r.addMarker(t,!0)})),e||this.render()}},{key:"removeMarker",value:function(t,e){var r=this.markers.indexOf(t);return-1!==r&&(t.setMap(null),this.markers.splice(r,1),e||this.render(),!0)}},{key:"removeMarkers",value:function(t,e){var r=this,n=!1;return t.forEach((function(t){n=r.removeMarker(t,!0)||n})),n&&!e&&this.render(),n}},{key:"clearMarkers",value:function(t){this.markers.length=0,t||this.render()}},{key:"render",value:function(){var e=this.getMap();if(e instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});this.reset(),this.clusters=r,this.renderClusters(),google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}},{key:"onAdd",value:function(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function(){this.markers.forEach((function(t){return t.setMap(null)})),this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function(){var e=this,r=new fo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach((function(o){1===o.markers.length?o.marker=o.markers[0]:(o.marker=e.renderer.render(o,r),e.onClusterClick&&o.marker.addListener("click",(function(r){google.maps.event.trigger(e,t.MarkerClustererEvents.CLUSTER_CLICK,o),e.onClusterClick(r,o,n)}))),o.marker.setMap(n)}))}}]),s}(po);return t.AbstractAlgorithm=Je,t.AbstractViewportAlgorithm=Ke,t.Cluster=Ze,t.ClusterStats=fo,t.DBScanAlgorithm=Vr,t.DefaultRenderer=lo,t.GridAlgorithm=sr,t.KmeansAlgorithm=jr,t.MarkerClusterer=mo,t.NoopAlgorithm=ar,t.SuperClusterAlgorithm=mn,t.defaultOnClusterClickHandler=go,t.distanceBetweenPoints=Ue,t.extendBoundsToPaddedViewport=Ve,t.extendPixelBounds=We,t.filterMarkersToPaddedViewport=Be,t.noop=He,t.pixelBoundsToLatLngBounds=Xe,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
var markerClusterer=function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=i(t);if(e){var o=i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t,e){return t(e={exports:{}},e.exports),e.exports}var m,g,v=function(t){return t&&t.Math==Math&&t},y=v("object"==typeof globalThis&&globalThis)||v("object"==typeof window&&window)||v("object"==typeof self&&self)||v("object"==typeof p&&p)||function(){return this}()||Function("return this")(),b=function(t){try{return!!t()}catch(t){return!0}},_=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),w={}.propertyIsEnumerable,k=Object.getOwnPropertyDescriptor,M={f:k&&!w.call({1:2},1)?function(t){var e=k(this,t);return!!e&&e.enumerable}:w},x=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},O={}.toString,P=function(t){return O.call(t).slice(8,-1)},S="".split,E=b((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==P(t)?S.call(t,""):Object(t)}:Object,C=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},A=function(t){return E(C(t))},j=function(t){return"function"==typeof t},L=function(t){return"object"==typeof t?null!==t:j(t)},T=function(t){return j(t)?t:void 0},I=function(t,e){return arguments.length<2?T(y[t]):y[t]&&y[t][e]},N=I("navigator","userAgent")||"",D=y.process,F=y.Deno,z=D&&D.versions||F&&F.version,R=z&&z.v8;R?g=(m=R.split("."))[0]<4?1:m[0]+m[1]:N&&(!(m=N.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=N.match(/Chrome\/(\d+)/))&&(g=m[1]);var Z=g&&+g,q=!!Object.getOwnPropertySymbols&&!b((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Z&&Z<41})),G=q&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,B=G?function(t){return"symbol"==typeof t}:function(t){var e=I("Symbol");return j(e)&&Object(t)instanceof e},V=function(t){if(j(t))return t;throw TypeError(function(t){try{return String(t)}catch(t){return"Object"}}(t)+" is not a function")},U=function(t,e){try{Object.defineProperty(y,t,{value:e,configurable:!0,writable:!0})}catch(r){y[t]=e}return e},Q="__core-js_shared__",W=y[Q]||U(Q,{}),X=d((function(t){(t.exports=function(t,e){return W[t]||(W[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.18.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),K=function(t){return Object(C(t))},H={}.hasOwnProperty,J=Object.hasOwn||function(t,e){return H.call(K(t),e)},$=0,Y=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+Y).toString(36)},et=X("wks"),rt=y.Symbol,nt=G?rt:rt&&rt.withoutSetter||tt,ot=function(t){return J(et,t)&&(q||"string"==typeof et[t])||(q&&J(rt,t)?et[t]=rt[t]:et[t]=nt("Symbol."+t)),et[t]},it=ot("toPrimitive"),st=function(t,e){if(!L(t)||B(t))return t;var r,n,o=null==(r=t[it])?void 0:V(r);if(o){if(void 0===e&&(e="default"),n=o.call(t,e),!L(n)||B(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&j(r=t.toString)&&!L(n=r.call(t)))return n;if(j(r=t.valueOf)&&!L(n=r.call(t)))return n;if("string"!==e&&j(r=t.toString)&&!L(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(t,e)},at=function(t){var e=st(t,"string");return B(e)?e:String(e)},ut=y.document,ct=L(ut)&&L(ut.createElement),ft=function(t){return ct?ut.createElement(t):{}},lt=!_&&!b((function(){return 7!=Object.defineProperty(ft("div"),"a",{get:function(){return 7}}).a})),ht=Object.getOwnPropertyDescriptor,pt={f:_?ht:function(t,e){if(t=A(t),e=at(e),lt)try{return ht(t,e)}catch(t){}if(J(t,e))return x(!M.f.call(t,e),t[e])}},dt=function(t){if(L(t))return t;throw TypeError(String(t)+" is not an object")},mt=Object.defineProperty,gt={f:_?mt:function(t,e,r){if(dt(t),e=at(e),dt(r),lt)try{return mt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},vt=_?function(t,e,r){return gt.f(t,e,x(1,r))}:function(t,e,r){return t[e]=r,t},yt=Function.toString;j(W.inspectSource)||(W.inspectSource=function(t){return yt.call(t)});var bt,_t,wt,kt=W.inspectSource,Mt=y.WeakMap,xt=j(Mt)&&/native code/.test(kt(Mt)),Ot=X("keys"),Pt=function(t){return Ot[t]||(Ot[t]=tt(t))},St={},Et="Object already initialized",Ct=y.WeakMap;if(xt||W.state){var At=W.state||(W.state=new Ct),jt=At.get,Lt=At.has,Tt=At.set;bt=function(t,e){if(Lt.call(At,t))throw new TypeError(Et);return e.facade=t,Tt.call(At,t,e),e},_t=function(t){return jt.call(At,t)||{}},wt=function(t){return Lt.call(At,t)}}else{var It=Pt("state");St[It]=!0,bt=function(t,e){if(J(t,It))throw new TypeError(Et);return e.facade=t,vt(t,It,e),e},_t=function(t){return J(t,It)?t[It]:{}},wt=function(t){return J(t,It)}}var Nt={set:bt,get:_t,has:wt,enforce:function(t){return wt(t)?_t(t):bt(t,{})},getterFor:function(t){return function(e){var r;if(!L(e)||(r=_t(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},Dt=Function.prototype,Ft=_&&Object.getOwnPropertyDescriptor,zt=J(Dt,"name"),Rt={EXISTS:zt,PROPER:zt&&"something"===function(){}.name,CONFIGURABLE:zt&&(!_||_&&Ft(Dt,"name").configurable)},Zt=d((function(t){var e=Rt.CONFIGURABLE,r=Nt.get,n=Nt.enforce,o=String(String).split("String");(t.exports=function(t,r,i,s){var a,u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet,l=s&&void 0!==s.name?s.name:r;j(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!J(i,"name")||e&&i.name!==l)&&vt(i,"name",l),(a=n(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==y?(u?!f&&t[r]&&(c=!0):delete t[r],c?t[r]=i:vt(t,r,i)):c?t[r]=i:U(r,i)})(Function.prototype,"toString",(function(){return j(this)&&r(this).source||kt(this)}))})),qt=Math.ceil,Gt=Math.floor,Bt=function(t){var e=+t;return e!=e||0===e?0:(e>0?Gt:qt)(e)},Vt=Math.max,Ut=Math.min,Qt=function(t,e){var r=Bt(t);return r<0?Vt(r+e,0):Ut(r,e)},Wt=Math.min,Xt=function(t){return(e=t.length)>0?Wt(Bt(e),9007199254740991):0;var e},Kt=function(t){return function(e,r,n){var o,i=A(e),s=Xt(i),a=Qt(n,s);if(t&&r!=r){for(;s>a;)if((o=i[a++])!=o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},Ht={includes:Kt(!0),indexOf:Kt(!1)},Jt=Ht.indexOf,$t=function(t,e){var r,n=A(t),o=0,i=[];for(r in n)!J(St,r)&&J(n,r)&&i.push(r);for(;e.length>o;)J(n,r=e[o++])&&(~Jt(i,r)||i.push(r));return i},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],te=Yt.concat("length","prototype"),ee={f:Object.getOwnPropertyNames||function(t){return $t(t,te)}},re={f:Object.getOwnPropertySymbols},ne=I("Reflect","ownKeys")||function(t){var e=ee.f(dt(t)),r=re.f;return r?e.concat(r(t)):e},oe=function(t,e){for(var r=ne(e),n=gt.f,o=pt.f,i=0;i<r.length;i++){var s=r[i];J(t,s)||n(t,s,o(e,s))}},ie=/#|\.prototype\./,se=function(t,e){var r=ue[ae(t)];return r==fe||r!=ce&&(j(e)?b(e):!!e)},ae=se.normalize=function(t){return String(t).replace(ie,".").toLowerCase()},ue=se.data={},ce=se.NATIVE="N",fe=se.POLYFILL="P",le=se,he=pt.f,pe=function(t,e){var r,n,o,i,s,a=t.target,u=t.global,c=t.stat;if(r=u?y:c?y[a]||U(a,{}):(y[a]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(s=he(r,n))&&s.value:r[n],!le(u?n:a+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;oe(i,o)}(t.sham||o&&o.sham)&&vt(i,"sham",!0),Zt(r,n,i,t)}},de=Array.isArray||function(t){return"Array"==P(t)},me={};me[ot("toStringTag")]="z";var ge="[object z]"===String(me),ve=ot("toStringTag"),ye="Arguments"==P(function(){return arguments}()),be=ge?P:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ve))?r:ye?P(e):"Object"==(n=P(e))&&j(e.callee)?"Arguments":n},_e=[],we=I("Reflect","construct"),ke=/^\s*(?:class|function)\b/,Me=ke.exec,xe=!ke.exec((function(){})),Oe=function(t){if(!j(t))return!1;try{return we(Object,_e,t),!0}catch(t){return!1}},Pe=!we||b((function(){var t;return Oe(Oe.call)||!Oe(Object)||!Oe((function(){t=!0}))||t}))?function(t){if(!j(t))return!1;switch(be(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return xe||!!Me.call(ke,kt(t))}:Oe,Se=ot("species"),Ee=function(t,e){return new(function(t){var e;return de(t)&&(e=t.constructor,(Pe(e)&&(e===Array||de(e.prototype))||L(e)&&null===(e=e[Se]))&&(e=void 0)),void 0===e?Array:e}(t))(0===e?0:e)},Ce=[].push,Ae=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,s=7==t,a=5==t||i;return function(u,c,f,l){for(var h,p,d=K(u),m=E(d),g=function(t,e,r){if(V(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}(c,f,3),v=Xt(m),y=0,b=l||Ee,_=e?b(u,v):r||s?b(u,0):void 0;v>y;y++)if((a||y in m)&&(p=g(h=m[y],y,d),t))if(e)_[y]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:Ce.call(_,h)}else switch(t){case 4:return!1;case 7:Ce.call(_,h)}return i?-1:n||o?o:_}},je={forEach:Ae(0),map:Ae(1),filter:Ae(2),some:Ae(3),every:Ae(4),find:Ae(5),findIndex:Ae(6),filterReject:Ae(7)},Le=ot("species"),Te=function(t){return Z>=51||!b((function(){var e=[];return(e.constructor={})[Le]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ie=je.map;function Ne(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}pe({target:"Array",proto:!0,forced:!Te("map")},{map:function(t){return Ie(this,t,arguments.length>1?arguments[1]:void 0)}});var De=function(t){return function(e,r,n,o){V(r);var i=K(e),s=E(i),a=Xt(i),u=t?a-1:0,c=t?-1:1;if(n<2)for(;;){if(u in s){o=s[u],u+=c;break}if(u+=c,t?u<0:a<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:a>u;u+=c)u in s&&(o=r(o,s[u],u,i));return o}},Fe={left:De(!1),right:De(!0)},ze=function(t,e){var r=[][t];return!!r&&b((function(){r.call(null,e||function(){throw 1},1)}))},Re="process"==P(y.process),Ze=Fe.left;pe({target:"Array",proto:!0,forced:!ze("reduce")||!Re&&Z>79&&Z<83},{reduce:function(t){return Ze(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var qe=je.filter;pe({target:"Array",proto:!0,forced:!Te("filter")},{filter:function(t){return qe(this,t,arguments.length>1?arguments[1]:void 0)}});var Ge=function(){function t(r){var n=r.markers,o=r.position;e(this,t),this.markers=n,o&&(o instanceof google.maps.LatLng?this._position=o:this._position=new google.maps.LatLng(o))}return n(t,[{key:"bounds",get:function(){if(0!==this.markers.length||this._position)return this.markers.reduce((function(t,e){return t.extend(e.getPosition())}),new google.maps.LatLngBounds(this._position,this._position))}},{key:"position",get:function(){return this._position||this.bounds.getCenter()}},{key:"count",get:function(){return this.markers.filter((function(t){return t.getVisible()})).length}},{key:"push",value:function(t){this.markers.push(t)}},{key:"delete",value:function(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}]),t}(),Be=function(t,e,r,n){var o=Ve(t.getBounds(),e,n);return r.filter((function(t){return o.contains(t.getPosition())}))},Ve=function(t,e,r){var n=Qe(t,e),o=n.northEast,i=n.southWest,s=We({northEast:o,southWest:i},r);return Xe(s,e)},Ue=function(t,e){var r=(e.lat-t.lat)*Math.PI/180,n=(e.lng-t.lng)*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},Qe=function(t,e){return{northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}},We=function(t,e){var r=t.northEast,n=t.southWest;return r.x+=e,r.y-=e,n.x-=e,n.y+=e,{northEast:r,southWest:n}},Xe=function(t,e){var r=t.northEast,n=t.southWest,o=new google.maps.LatLngBounds;return o.extend(e.fromDivPixelToLatLng(r)),o.extend(e.fromDivPixelToLatLng(n)),o},Ke=function(){function t(r){var n=r.maxZoom,o=void 0===n?16:n;e(this,t),this.maxZoom=o}return n(t,[{key:"noop",value:function(t){var e=t.markers;return Je(e)}}]),t}(),He=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.viewportPadding,s=void 0===o?60:o,a=Ne(t,["viewportPadding"]);return(n=r.call(this,a)).viewportPadding=60,n.viewportPadding=s,n}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return r.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e,map:r,mapCanvasProjection:n}),changed:!1}:{clusters:this.cluster({markers:Be(r,n,e,this.viewportPadding),map:r,mapCanvasProjection:n})}}}]),i}(Ke),Je=function(t){return t.map((function(t){return new Ge({position:t.getPosition(),markers:[t]})}))},$e={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Ye=ft("span").classList,tr=Ye&&Ye.constructor&&Ye.constructor.prototype,er=tr===Object.prototype?void 0:tr,rr=je.forEach,nr=ze("forEach")?[].forEach:function(t){return rr(this,t,arguments.length>1?arguments[1]:void 0)},or=function(t){if(t&&t.forEach!==nr)try{vt(t,"forEach",nr)}catch(e){t.forEach=nr}};for(var ir in $e)$e[ir]&&or(y[ir]&&y[ir].prototype);or(er),pe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var sr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?4e4:o,a=t.gridSize,u=void 0===a?40:a,c=Ne(t,["maxDistance","gridSize"]);return(n=r.call(this,c)).clusters=[],n.maxDistance=s,n.gridSize=u,n}return n(i,[{key:"cluster",value:function(t){var e=this,r=t.markers,n=t.map,o=t.mapCanvasProjection;return this.clusters=[],r.forEach((function(t){e.addToClosestCluster(t,n,o)})),this.clusters}},{key:"addToClosestCluster",value:function(t,e,r){for(var n=this.maxDistance,o=null,i=0;i<this.clusters.length;i++){var s=this.clusters[i],a=Ue(s.bounds.getCenter().toJSON(),t.getPosition().toJSON());a<n&&(n=a,o=s)}if(o&&Ve(o.bounds,r,this.gridSize).contains(t.getPosition()))o.push(t);else{var u=new Ge({markers:[t]});this.clusters.push(u)}}}]),i}(He),ar=function(t){o(i,t);var r=u(i);function i(t){e(this,i);var n=Ne(t,[]);return r.call(this,n)}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return{clusters:this.cluster({markers:e,map:r,mapCanvasProjection:n}),changed:!1}}},{key:"cluster",value:function(t){return this.noop(t)}}]),i}(Ke),ur=6371008.8,cr={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*ur,kilometers:6371.0088,kilometres:6371.0088,meters:ur,metres:ur,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:ur/1852,radians:1,yards:6967335.223679999};function fr(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!mr(t[0])||!mr(t[1]))throw new Error("coordinates must contain numbers");return function(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}({type:"Point",coordinates:t},e,r)}function lr(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function hr(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t*r}function pr(t){return t%360*Math.PI/180}function dr(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return hr(function(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t/r}(t,e),r)}function mr(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function gr(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return vr(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return vr(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return br(t);default:throw new Error("unknown GeoJSON type")}}function vr(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=yr(t.properties),e.geometry=br(t.geometry),e}function yr(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:Array.isArray(n)?e[r]=n.map((function(t){return t})):e[r]=yr(n):e[r]=n})),e):e}function br(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return br(t)})),e):(e.coordinates=_r(t.coordinates),e)}function _r(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return _r(t)}))}function wr(t,e,r){if(null!==t)for(var n,o,i,s,a,u,c,f,l=0,h=0,p=t.type,d="FeatureCollection"===p,m="Feature"===p,g=d?t.features.length:1,v=0;v<g;v++){a=(f=!!(c=d?t.features[v].geometry:m?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<a;y++){var b=0,_=0;if(null!==(s=f?c.geometries[y]:c)){u=s.coordinates;var w=s.type;switch(l=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,h,v,b,_))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],h,v,b,_))return!1;h++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(o=0;o<u[n].length-l;o++){if(!1===e(u[n][o],h,v,b,_))return!1;h++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(_=0,o=0;o<u[n].length;o++){for(i=0;i<u[n][o].length-l;i++){if(!1===e(u[n][o][i],h,v,b,_))return!1;h++}_++}b++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===wr(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kr(t){var e=[];return wr(t,(function(t){e.push(t)})),e}var Mr=function(t,e,r){for(var n=t.length,o=0,i=0;i<n;i++){var s=(t[i]||0)-(e[i]||0);o+=s*s}return r?Math.sqrt(o):o},xr=Mr,Or=function(t,e,r){var n=Math.abs(t-e);return r?n:n*n},Pr=Mr,Sr=function(t,e){for(var r={},n=[],o=e<<2,i=t.length,s=t[0].length>0;n.length<e&&o-- >0;){var a=t[Math.floor(Math.random()*i)],u=s?a.join("_"):""+a;r[u]||(r[u]=!0,n.push(a))}if(n.length<e)throw new Error("Error initializating clusters");return n},Er=function(t,e){var r=t[0].length?xr:Or,n=[],o=t.length,i=t[0].length>0,s=t[Math.floor(Math.random()*o)];i&&s.join("_");for(n.push(s);n.length<e;){for(var a=[],u=n.length,c=0,f=[],l=0;l<o;l++){for(var h=1/0,p=0;p<u;p++){var d=r(t[l],n[p]);d<=h&&(h=d)}a[l]=h}for(var m=0;m<o;m++)c+=a[m];for(var g=0;g<o;g++)f[g]={i:g,v:t[g],pr:a[g]/c,cs:0};f.sort((function(t,e){return t.pr-e.pr})),f[0].cs=f[0].pr;for(var v=1;v<o;v++)f[v].cs=f[v-1].cs+f[v].pr;for(var y=Math.random(),b=0;b<o-1&&f[b++].cs<y;);n.push(f[b-1].v)}return n};function Cr(t,e,r){r=r||[];for(var n=0;n<t;n++)r[n]=e;return r}var Ar=function(t,e,r,n){var o=[],i=[],s=[],a=[],u=!1,c=n||1e4,f=t.length,l=t[0].length,h=l>0,p=[];if(r)o="kmrand"==r?Sr(t,e):"kmpp"==r?Er(t,e):r;else for(var d={};o.length<e;){var m=Math.floor(Math.random()*f);d[m]||(d[m]=!0,o.push(t[m]))}do{Cr(e,0,p);for(var g=0;g<f;g++){for(var v=1/0,y=0,b=0;b<e;b++){(a=h?Pr(t[g],o[b]):Math.abs(t[g]-o[b]))<=v&&(v=a,y=b)}s[g]=y,p[y]++}for(var _=[],w=(i=[],0);w<e;w++)_[w]=h?Cr(l,0,_[w]):0,i[w]=o[w];if(h){for(var k=0;k<e;k++)o[k]=[];for(var M=0;M<f;M++)for(var x=_[s[M]],O=t[M],P=0;P<l;P++)x[P]+=O[P];u=!0;for(var S=0;S<e;S++){for(var E=o[S],C=_[S],A=i[S],j=p[S],L=0;L<l;L++)E[L]=C[L]/j||0;if(u)for(var T=0;T<l;T++)if(A[T]!=E[T]){u=!1;break}}}else{for(var I=0;I<f;I++){_[s[I]]+=t[I]}for(var N=0;N<e;N++)o[N]=_[N]/p[N]||0;u=!0;for(var D=0;D<e;D++)if(i[D]!=o[D]){u=!1;break}}u=u||--c<=0}while(!u);return{it:1e4-c,k:e,idxs:s,centroids:o}};var jr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.numberOfClusters,s=Ne(t,["numberOfClusters"]);return(n=r.call(this,s)).numberOfClusters=o,n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.map,n=[];return 0===e.length||function(t,e){void 0===e&&(e={});var r=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(r/2)),e.numberOfClusters>r&&(e.numberOfClusters=r),!0!==e.mutate&&(t=gr(t));var n=kr(t),o=n.slice(0,e.numberOfClusters),i=Ar(n,e.numberOfClusters,o),s={};return i.centroids.forEach((function(t,e){s[e]=t})),function(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}(t,(function(t,e){var r=i.idxs[e];t.properties.cluster=r,t.properties.centroid=s[r]})),t}(lr(e.map((function(t){return fr([t.getPosition().lng(),t.getPosition().lat()])}))),{numberOfClusters:this.numberOfClusters instanceof Function?this.numberOfClusters(e.length,r.getZoom()):this.numberOfClusters}).features.forEach((function(t,r){n[t.properties.cluster]||(n[t.properties.cluster]=new Ge({position:{lng:t.properties.centroid[0],lat:t.properties.centroid[1]},markers:[]})),n[t.properties.cluster].push(e[r])})),n}}]),i}(He),Lr=Object.keys||function(t){return $t(t,Yt)},Tr=Object.assign,Ir=Object.defineProperty,Nr=!Tr||b((function(){if(_&&1!==Tr({b:1},Tr(Ir({},"a",{enumerable:!0,get:function(){Ir(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Tr({},t)[r]||Lr(Tr({},e)).join("")!=n}))?function(t,e){for(var r=K(t),n=arguments.length,o=1,i=re.f,s=M.f;n>o;)for(var a,u=E(arguments[o++]),c=i?Lr(u).concat(i(u)):Lr(u),f=c.length,l=0;f>l;)a=c[l++],_&&!s.call(u,a)||(r[a]=u[a]);return r}:Tr;function Dr(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Fr(t,e,r){void 0===r&&(r={});var n=Dr(t),o=Dr(e),i=pr(o[1]-n[1]),s=pr(o[0]-n[0]),a=pr(n[1]),u=pr(o[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return hr(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}pe({target:"Object",stat:!0,forced:Object.assign!==Nr},{assign:Nr});var zr=d((function(t){function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var o=0;o<this._datasetLength;o++)if(1!==this._visited[o]){this._visited[o]=1;var i=this._regionQuery(o);if(i.length<this.minPts)this.noise.push(o);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(o,s),this._expandCluster(s,i)}}return this.clusters},e.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},e.prototype._expandCluster=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];if(1!==this._visited[n]){this._visited[n]=1;var o=this._regionQuery(n);o.length>=this.minPts&&(e=this._mergeArrays(e,o))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r<this._datasetLength;r++){this.distance(this.dataset[t],this.dataset[r])<this.epsilon&&e.push(r)}return e},e.prototype._mergeArrays=function(t,e){for(var r=e.length,n=0;n<r;n++){var o=e[n];t.indexOf(o)<0&&t.push(o)}return t},e.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=e)})),Rr=d((function(t){function e(t,e,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,r)}e.prototype.init=function(t,e,r){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==r&&(this.distance=r)},e.prototype.run=function(t,e){this.init(t,e);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var o=!0;o;){o=this.assign();for(var i=0;i<this.k;i++){for(var s=new Array(f),a=0,u=0;u<f;u++)s[u]=0;for(var c=0;c<r;c++){var f=this.dataset[c].length;if(i===this.assignments[c]){for(u=0;u<f;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<f;u++)s[u]/=a;this.centroids[i]=s}else this.centroids[i]=this.randomCentroid(),o=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,r=this.dataset.length-1;do{e=Math.round(Math.random()*r),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;n<r;n++)(t=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),r=0;r<this.assignments.length;r++)void 0===e[t=this.assignments[r]]&&(e[t]=[]),e[t].push(r);return e},e.prototype.argmin=function(t,e,r){for(var n,o=Number.MAX_VALUE,i=0,s=e.length,a=0;a<s;a++)(n=r(t,e[a]))<o&&(o=n,i=a);return i},e.prototype.distance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;){var o=t[n]-e[n];r+=o*o}return Math.sqrt(r)},t.exports&&(t.exports=e)})),Zr=d((function(t){function e(t,e,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,r)}e.prototype.insert=function(t,e){for(var r=this._queue.length,n=r;n--;){var o=this._priorities[n];"desc"===this._sorting?e>o&&(r=n):e<o&&(r=n)}this._insertAt(t,e,r)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,r=this._queue.length;e<r;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,r){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var n=0;n<t.length;n++)this.insert(t[n],e[n])}r&&(this._sorting=r)},e.prototype._insertAt=function(t,e,r){this._queue.length===r?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(r,0,t),this._priorities.splice(r,0,e))},t.exports&&(t.exports=e)})),qr=d((function(t){if(t.exports)var e=Zr;function r(t,e,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,r,n)}r.prototype.run=function(t,r,n,o){this._init(t,r,n,o);for(var i=0,s=this.dataset.length;i<s;i++)if(1!==this._processed[i]){this._processed[i]=1,this.clusters.push([i]);var a=this.clusters.length-1;this._orderedList.push(i);var u=new e(null,null,"asc"),c=this._regionQuery(i);void 0!==this._distanceToCore(i)&&(this._updateQueue(i,c,u),this._expandCluster(a,u))}return this.clusters},r.prototype.getReachabilityPlot=function(){for(var t=[],e=0,r=this._orderedList.length;e<r;e++){var n=this._orderedList[e],o=this._reachability[n];t.push([n,o])}return t},r.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},r.prototype._updateQueue=function(t,e,r){var n=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===n._processed[e]){var o=n.distance(n.dataset[t],n.dataset[e]),i=Math.max(n._coreDistance,o);void 0===n._reachability[e]?(n._reachability[e]=i,r.insert(e,i)):i<n._reachability[e]&&(n._reachability[e]=i,r.remove(e),r.insert(e,i))}}))},r.prototype._expandCluster=function(t,e){for(var r=e.getElements(),n=0,o=r.length;n<o;n++){var i=r[n];if(void 0===this._processed[i]){var s=this._regionQuery(i);this._processed[i]=1,this.clusters[t].push(i),this._orderedList.push(i),void 0!==this._distanceToCore(i)&&(this._updateQueue(i,s,e),this._expandCluster(t,e))}}},r.prototype._distanceToCore=function(t){for(var e=this.epsilon,r=0;r<e;r++){if(this._regionQuery(t,r).length>=this.minPts)return r}},r.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,o=this.dataset.length;n<o;n++)this.distance(this.dataset[t],this.dataset[n])<e&&r.push(n);return r},r.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=r)})),Gr=d((function(t){t.exports&&(t.exports={DBSCAN:zr,KMEANS:Rr,OPTICS:qr,PriorityQueue:Zr})}));Gr.DBSCAN,Gr.KMEANS,Gr.OPTICS,Gr.PriorityQueue;var Br={units:"kilometers",mutate:!1,minPoints:1},Vr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?200:o,a=t.minPoints,u=void 0===a?Br.minPoints:a,c=Ne(t,["maxDistance","minPoints"]);return(n=r.call(this,c)).maxDistance=s,n.options=Object.assign(Object.assign({},Br),{minPoints:u}),n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.mapCanvasProjection,n=lr(e.map((function(t){var e=r.fromLatLngToContainerPixel(t.getPosition());return fr([e.x,e.y])}))),o=[];return function(t,e,r){void 0===r&&(r={}),!0!==r.mutate&&(t=gr(t)),r.minPoints=r.minPoints||3;var n=new Gr.DBSCAN,o=n.run(kr(t),dr(e,r.units),r.minPoints,Fr),i=-1;return o.forEach((function(e){i++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=i,r.properties.dbscan="core"}))})),n.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t}(n,this.maxDistance,this.options).features.forEach((function(t,r){o[t.properties.cluster]||(o[t.properties.cluster]=[]),o[t.properties.cluster].push(e[r])})),o.map((function(t){return new Ge({markers:t})}))}}]),i}(He);function Ur(t,e,r,n,o,i){if(o-n<=r)return;const s=n+o>>1;Qr(t,e,s,n,o,i%2),Ur(t,e,r,n,s-1,i+1),Ur(t,e,r,s+1,o,i+1)}function Qr(t,e,r,n,o,i){for(;o>n;){if(o-n>600){const s=o-n+1,a=r-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);Qr(t,e,r,Math.max(n,Math.floor(r-a*c/s+f)),Math.min(o,Math.floor(r+(s-a)*c/s+f)),i)}const s=e[2*r+i];let a=n,u=o;for(Wr(t,e,n,r),e[2*o+i]>s&&Wr(t,e,n,o);a<u;){for(Wr(t,e,a,u),a++,u--;e[2*a+i]<s;)a++;for(;e[2*u+i]>s;)u--}e[2*n+i]===s?Wr(t,e,n,u):(u++,Wr(t,e,u,o)),u<=r&&(n=u+1),r<=u&&(o=u-1)}}function Wr(t,e,r,n){Xr(t,r,n),Xr(e,2*r,2*n),Xr(e,2*r+1,2*n+1)}function Xr(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function Kr(t,e,r,n){const o=t-r,i=e-n;return o*o+i*i}const Hr=t=>t[0],Jr=t=>t[1];class $r{constructor(t,e=Hr,r=Jr,n=64,o=Float64Array){this.nodeSize=n,this.points=t;const i=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new i(t.length),a=this.coords=new o(2*t.length);for(let n=0;n<t.length;n++)s[n]=n,a[2*n]=e(t[n]),a[2*n+1]=r(t[n]);Ur(s,a,n,0,s.length-1,0)}range(t,e,r,n){return function(t,e,r,n,o,i,s){const a=[0,t.length-1,0],u=[];let c,f;for(;a.length;){const l=a.pop(),h=a.pop(),p=a.pop();if(h-p<=s){for(let s=p;s<=h;s++)c=e[2*s],f=e[2*s+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[s]);continue}const d=Math.floor((p+h)/2);c=e[2*d],f=e[2*d+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[d]);const m=(l+1)%2;(0===l?r<=c:n<=f)&&(a.push(p),a.push(d-1),a.push(m)),(0===l?o>=c:i>=f)&&(a.push(d+1),a.push(h),a.push(m))}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)}within(t,e,r){return function(t,e,r,n,o,i){const s=[0,t.length-1,0],a=[],u=o*o;for(;s.length;){const c=s.pop(),f=s.pop(),l=s.pop();if(f-l<=i){for(let o=l;o<=f;o++)Kr(e[2*o],e[2*o+1],r,n)<=u&&a.push(t[o]);continue}const h=Math.floor((l+f)/2),p=e[2*h],d=e[2*h+1];Kr(p,d,r,n)<=u&&a.push(t[h]);const m=(c+1)%2;(0===c?r-o<=p:n-o<=d)&&(s.push(l),s.push(h-1),s.push(m)),(0===c?r+o>=p:n+o>=d)&&(s.push(h+1),s.push(f),s.push(m))}return a}(this.ids,this.coords,t,e,r,this.nodeSize)}}const Yr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},tn=Math.fround||(en=new Float32Array(1),t=>(en[0]=+t,en[0]));var en;class rn{constructor(t){this.options=ln(Object.create(Yr),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:r,maxZoom:n,nodeSize:o}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(on(t[e],e));this.trees[n+1]=new $r(s,hn,pn,o,Float32Array),e&&console.timeEnd(i);for(let t=n;t>=r;t--){const r=+Date.now();s=this._cluster(s,t),this.trees[t]=new $r(s,hn,pn,o,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let o=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,o=180;else if(r>o){const t=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,o,i],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(un(r),cn(i),un(o),cn(n)),u=[];for(const t of a){const e=s.points[t];u.push(e.numPoints?sn(e):this.points[e.index])}return u}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(n);const i=o.points[e];if(!i)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o.within(i.x,i.y,s),u=[];for(const e of a){const r=o.points[e];r.parentId===t&&u.push(r.numPoints?sn(r):this.points[r.index])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:i,radius:s}=this.options,a=s/i,u=(r-a)/o,c=(r+1+a)/o,f={features:[]};return this._addTileFeatures(n.range((e-a)/o,u,(e+1+a)/o,c),n.points,e,r,o,f),0===e&&this._addTileFeatures(n.range(1-a/o,u,1,c),n.points,o,r,o,f),e===o-1&&this._addTileFeatures(n.range(0,u,a/o,c),n.points,-1,r,o,f),f.features.length?f:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,o){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?o+i.point_count<=n?o+=i.point_count:o=this._appendLeaves(t,i.cluster_id,r,n,o):o<n?o++:t.push(e),t.length===r)break}return o}_addTileFeatures(t,e,r,n,o,i){for(const s of t){const t=e[s],a=t.numPoints;let u,c,f;if(a)u=an(t),c=t.x,f=t.y;else{const e=this.points[t.index];u=e.properties,c=un(e.geometry.coordinates[0]),f=cn(e.geometry.coordinates[1])}const l={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(f*o-n))]],tags:u};let h;a?h=t.id:this.options.generateId?h=t.index:this.points[t.index].id&&(h=this.points[t.index].id),void 0!==h&&(l.id=h),i.features.push(l)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))}_cluster(t,e){const r=[],{radius:n,extent:o,reduce:i,minPoints:s}=this.options,a=n/(o*Math.pow(2,e));for(let n=0;n<t.length;n++){const o=t[n];if(o.zoom<=e)continue;o.zoom=e;const u=this.trees[e+1],c=u.within(o.x,o.y,a),f=o.numPoints||1;let l=f;for(const t of c){const r=u.points[t];r.zoom>e&&(l+=r.numPoints||1)}if(l>=s){let t=o.x*f,s=o.y*f,a=i&&f>1?this._map(o,!0):null;const h=(n<<5)+(e+1)+this.points.length;for(const r of c){const n=u.points[r];if(n.zoom<=e)continue;n.zoom=e;const c=n.numPoints||1;t+=n.x*c,s+=n.y*c,n.parentId=h,i&&(a||(a=this._map(o,!0)),i(a,this._map(n)))}o.parentId=h,r.push(nn(t/l,s/l,h,l,a))}else if(r.push(o),l>1)for(const t of c){const n=u.points[t];n.zoom<=e||(n.zoom=e,r.push(n))}}return r}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?ln({},t.properties):t.properties;const r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?ln({},n):n}}function nn(t,e,r,n,o){return{x:tn(t),y:tn(e),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:o}}function on(t,e){const[r,n]=t.geometry.coordinates;return{x:tn(un(r)),y:tn(cn(n)),zoom:1/0,index:e,parentId:-1}}function sn(t){return{type:"Feature",id:t.id,properties:an(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),fn(t.y)]}};var e}function an(t){const e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return ln(ln({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function un(t){return t/360+.5}function cn(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fn(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ln(t,e){for(const r in e)t[r]=e[r];return t}function hn(t){return t.x}function pn(t){return t.y}var dn,mn=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},gn=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxZoom,s=t.radius,a=void 0===s?60:s,u=Ne(t,["maxZoom","radius"]);return(n=r.call(this,{maxZoom:o})).superCluster=new rn(Object.assign({maxZoom:n.maxZoom,radius:a},u)),n.state={zoom:null},n}return n(i,[{key:"calculate",value:function(t){var e=!1;if(!mn(t.markers,this.markers)){e=!0,this.markers=f(t.markers);var r=this.markers.map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().lng(),t.getPosition().lat()]},properties:{marker:t}}}));this.superCluster.load(r)}var n={zoom:t.map.getZoom()};return e||this.state.zoom>this.maxZoom&&n.zoom>this.maxZoom||(e=e||!mn(this.state,n)),this.state=n,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}},{key:"cluster",value:function(t){var e=t.map;return this.superCluster.getClusters([-180,-90,180,90],e.getZoom()).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function(t){var e=c(t.geometry.coordinates,2),r=e[0],n=e[1],o=t.properties;if(o.cluster)return new Ge({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:n,lng:r})});var i=o.marker;return new Ge({markers:[i],position:i.getPosition()})}}]),i}(Ke),vn=_?Object.defineProperties:function(t,e){dt(t);for(var r,n=Lr(e),o=n.length,i=0;o>i;)gt.f(t,r=n[i++],e[r]);return t},yn=I("document","documentElement"),bn=Pt("IE_PROTO"),_n=function(){},wn=function(t){return"<script>"+t+"</"+"script>"},kn=function(t){t.write(wn("")),t.close();var e=t.parentWindow.Object;return t=null,e},Mn=function(){try{dn=new ActiveXObject("htmlfile")}catch(t){}var t,e;Mn="undefined"!=typeof document?document.domain&&dn?kn(dn):((e=ft("iframe")).style.display="none",yn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(wn("document.F=Object")),t.close(),t.F):kn(dn);for(var r=Yt.length;r--;)delete Mn.prototype[Yt[r]];return Mn()};St[bn]=!0;var xn=Object.create||function(t,e){var r;return null!==t?(_n.prototype=dt(t),r=new _n,_n.prototype=null,r[bn]=t):r=Mn(),void 0===e?r:vn(r,e)},On=ot("unscopables"),Pn=Array.prototype;null==Pn[On]&&gt.f(Pn,On,{configurable:!0,value:xn(null)});var Sn=Ht.includes;pe({target:"Array",proto:!0},{includes:function(t){return Sn(this,t,arguments.length>1?arguments[1]:void 0)}}),function(t){Pn[On][t]=!0}("includes");var En=ot("match"),Cn=function(t){if(function(t){var e;return L(t)&&(void 0!==(e=t[En])?!!e:"RegExp"==P(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},An=function(t){if("Symbol"===be(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},jn=ot("match");pe({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[jn]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~An(C(this)).indexOf(An(Cn(t)),arguments.length>1?arguments[1]:void 0)}});var Ln=Ht.indexOf,Tn=[].indexOf,In=!!Tn&&1/[1].indexOf(1,-0)<0,Nn=ze("indexOf");pe({target:"Array",proto:!0,forced:In||!Nn},{indexOf:function(t){return In?Tn.apply(this,arguments)||0:Ln(this,t,arguments.length>1?arguments[1]:void 0)}});var Dn=function(t,e,r){var n=at(e);n in t?gt.f(t,n,x(0,r)):t[n]=r},Fn=Te("splice"),zn=Math.max,Rn=Math.min,Zn=9007199254740991,qn="Maximum allowed length exceeded";pe({target:"Array",proto:!0,forced:!Fn},{splice:function(t,e){var r,n,o,i,s,a,u=K(this),c=Xt(u),f=Qt(t,c),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=c-f):(r=l-2,n=Rn(zn(Bt(e),0),c-f)),c+r-n>Zn)throw TypeError(qn);for(o=Ee(u,n),i=0;i<n;i++)(s=f+i)in u&&Dn(o,i,u[s]);if(o.length=n,r<n){for(i=f;i<c-n;i++)a=i+r,(s=i+n)in u?u[a]=u[s]:delete u[a];for(i=c;i>c-n+r;i--)delete u[i-1]}else if(r>n)for(i=c-n;i>f;i--)a=i+r-1,(s=i+n-1)in u?u[a]=u[s]:delete u[a];for(i=0;i<r;i++)u[i+f]=arguments[i+2];return u.length=c-n+r,o}});var Gn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return dt(r),function(t){if("object"==typeof t||j(t))return t;throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Bn=function(t,e,r){var n,o;return Gn&&j(n=e.constructor)&&n!==r&&L(o=n.prototype)&&o!==r.prototype&&Gn(t,o),t},Vn=1..valueOf,Un=function(t){return Vn.call(t)},Qn="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Wn=RegExp("^"+Qn+Qn+"*"),Xn=RegExp(Qn+Qn+"*$"),Kn=function(t){return function(e){var r=An(C(e));return 1&t&&(r=r.replace(Wn,"")),2&t&&(r=r.replace(Xn,"")),r}},Hn={start:Kn(1),end:Kn(2),trim:Kn(3)},Jn=ee.f,$n=pt.f,Yn=gt.f,to=Hn.trim,eo="Number",ro=y.Number,no=ro.prototype,oo=function(t){var e=st(t,"number");return"bigint"==typeof e?e:io(e)},io=function(t){var e,r,n,o,i,s,a,u,c=st(t,"number");if(B(c))throw TypeError("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(43===(e=(c=to(c)).charCodeAt(0))||45===e){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(s=(i=c.slice(2)).length,a=0;a<s;a++)if((u=i.charCodeAt(a))<48||u>o)return NaN;return parseInt(i,n)}return+c};if(le(eo,!ro(" 0o1")||!ro("0b1")||ro("+0x1"))){for(var so,ao=function(t){var e=arguments.length<1?0:ro(oo(t)),r=this;return r instanceof ao&&b((function(){Un(r)}))?Bn(Object(e),r,ao):e},uo=_?Jn(ro):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),co=0;uo.length>co;co++)J(ro,so=uo[co])&&!J(ao,so)&&Yn(ao,so,$n(ro,so));ao.prototype=no,no.constructor=ao,Zt(y,eo,ao)}var fo=function t(r,n){e(this,t),this.markers={sum:r.length};var o=n.map((function(t){return t.count})),i=o.reduce((function(t,e){return t+e}),0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min.apply(Math,f(o)),max:Math.max.apply(Math,f(o))}}},lo=function(){function t(){e(this,t)}return n(t,[{key:"render",value:function(t,e){var r=t.count,n=t.position,o=r>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff",i=window.btoa('\n <svg fill="'.concat(o,'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">\n <circle cx="120" cy="120" opacity=".6" r="70" />\n <circle cx="120" cy="120" opacity=".3" r="90" />\n <circle cx="120" cy="120" opacity=".2" r="110" />\n </svg>'));return new google.maps.Marker({position:n,icon:{url:"data:image/svg+xml;base64,".concat(i),scaledSize:new google.maps.Size(45,45)},label:{text:String(r),color:"rgba(255,255,255,0.9)",fontSize:"12px"},zIndex:Number(google.maps.Marker.MAX_ZINDEX)+r})}}]),t}();var ho,po=function t(){e(this,t),function(t,e){for(var r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)};t.MarkerClustererEvents=void 0,(ho=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",ho.CLUSTERING_END="clusteringend",ho.CLUSTER_CLICK="click";var mo=function(t,e,r){r.fitBounds(e.bounds)},go=function(r){o(s,r);var i=u(s);function s(t){var r,n=t.map,o=t.markers,a=void 0===o?[]:o,u=t.algorithm,c=void 0===u?new gn({}):u,l=t.renderer,h=void 0===l?new lo:l,p=t.onClusterClick,d=void 0===p?mo:p;return e(this,s),(r=i.call(this)).markers=f(a),r.clusters=[],r.algorithm=c,r.renderer=h,r.onClusterClick=d,n&&r.setMap(n),r}return n(s,[{key:"addMarker",value:function(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}},{key:"addMarkers",value:function(t,e){var r=this;t.forEach((function(t){r.addMarker(t,!0)})),e||this.render()}},{key:"removeMarker",value:function(t,e){var r=this.markers.indexOf(t);return-1!==r&&(t.setMap(null),this.markers.splice(r,1),e||this.render(),!0)}},{key:"removeMarkers",value:function(t,e){var r=this,n=!1;return t.forEach((function(t){n=r.removeMarker(t,!0)||n})),n&&!e&&this.render(),n}},{key:"clearMarkers",value:function(t){this.markers.length=0,t||this.render()}},{key:"render",value:function(){var e=this.getMap();if(e instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()}),n=r.clusters,o=r.changed;(o||null==o)&&(this.reset(),this.clusters=n,this.renderClusters()),google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}},{key:"onAdd",value:function(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function(){this.markers.forEach((function(t){return t.setMap(null)})),this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function(){var e=this,r=new fo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach((function(o){1===o.markers.length?o.marker=o.markers[0]:(o.marker=e.renderer.render(o,r),e.onClusterClick&&o.marker.addListener("click",(function(r){google.maps.event.trigger(e,t.MarkerClustererEvents.CLUSTER_CLICK,o),e.onClusterClick(r,o,n)}))),o.marker.setMap(n)}))}}]),s}(po);return t.AbstractAlgorithm=Ke,t.AbstractViewportAlgorithm=He,t.Cluster=Ge,t.ClusterStats=fo,t.DBScanAlgorithm=Vr,t.DefaultRenderer=lo,t.GridAlgorithm=sr,t.KmeansAlgorithm=jr,t.MarkerClusterer=go,t.NoopAlgorithm=ar,t.SuperClusterAlgorithm=gn,t.defaultOnClusterClickHandler=mo,t.distanceBetweenPoints=Ue,t.extendBoundsToPaddedViewport=Ve,t.extendPixelBounds=We,t.filterMarkersToPaddedViewport=Be,t.noop=Je,t.pixelBoundsToLatLngBounds=Xe,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
//# sourceMappingURL=index.min.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).markerClusterer={})}(this,(function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=i(t);if(e){var o=i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t,e){return t(e={exports:{}},e.exports),e.exports}var g,m,v=function(t){return t&&t.Math==Math&&t},y=v("object"==typeof globalThis&&globalThis)||v("object"==typeof window&&window)||v("object"==typeof self&&self)||v("object"==typeof p&&p)||function(){return this}()||Function("return this")(),b=function(t){try{return!!t()}catch(t){return!0}},_=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),w={}.propertyIsEnumerable,k=Object.getOwnPropertyDescriptor,M={f:k&&!w.call({1:2},1)?function(t){var e=k(this,t);return!!e&&e.enumerable}:w},x=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},O={}.toString,P=function(t){return O.call(t).slice(8,-1)},S="".split,E=b((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==P(t)?S.call(t,""):Object(t)}:Object,C=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},A=function(t){return E(C(t))},j=function(t){return"function"==typeof t},L=function(t){return"object"==typeof t?null!==t:j(t)},T=function(t){return j(t)?t:void 0},I=function(t,e){return arguments.length<2?T(y[t]):y[t]&&y[t][e]},N=I("navigator","userAgent")||"",D=y.process,F=y.Deno,R=D&&D.versions||F&&F.version,z=R&&R.v8;z?m=(g=z.split("."))[0]<4?1:g[0]+g[1]:N&&(!(g=N.match(/Edge\/(\d+)/))||g[1]>=74)&&(g=N.match(/Chrome\/(\d+)/))&&(m=g[1]);var q=m&&+m,G=!!Object.getOwnPropertySymbols&&!b((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&q&&q<41})),Z=G&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,B=Z?function(t){return"symbol"==typeof t}:function(t){var e=I("Symbol");return j(e)&&Object(t)instanceof e},V=function(t){if(j(t))return t;throw TypeError(function(t){try{return String(t)}catch(t){return"Object"}}(t)+" is not a function")},U=function(t,e){try{Object.defineProperty(y,t,{value:e,configurable:!0,writable:!0})}catch(r){y[t]=e}return e},Q="__core-js_shared__",W=y[Q]||U(Q,{}),X=d((function(t){(t.exports=function(t,e){return W[t]||(W[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.18.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),J=function(t){return Object(C(t))},K={}.hasOwnProperty,H=Object.hasOwn||function(t,e){return K.call(J(t),e)},$=0,Y=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+Y).toString(36)},et=X("wks"),rt=y.Symbol,nt=Z?rt:rt&&rt.withoutSetter||tt,ot=function(t){return H(et,t)&&(G||"string"==typeof et[t])||(G&&H(rt,t)?et[t]=rt[t]:et[t]=nt("Symbol."+t)),et[t]},it=ot("toPrimitive"),st=function(t,e){if(!L(t)||B(t))return t;var r,n,o=null==(r=t[it])?void 0:V(r);if(o){if(void 0===e&&(e="default"),n=o.call(t,e),!L(n)||B(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&j(r=t.toString)&&!L(n=r.call(t)))return n;if(j(r=t.valueOf)&&!L(n=r.call(t)))return n;if("string"!==e&&j(r=t.toString)&&!L(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(t,e)},at=function(t){var e=st(t,"string");return B(e)?e:String(e)},ut=y.document,ct=L(ut)&&L(ut.createElement),ft=function(t){return ct?ut.createElement(t):{}},lt=!_&&!b((function(){return 7!=Object.defineProperty(ft("div"),"a",{get:function(){return 7}}).a})),ht=Object.getOwnPropertyDescriptor,pt={f:_?ht:function(t,e){if(t=A(t),e=at(e),lt)try{return ht(t,e)}catch(t){}if(H(t,e))return x(!M.f.call(t,e),t[e])}},dt=function(t){if(L(t))return t;throw TypeError(String(t)+" is not an object")},gt=Object.defineProperty,mt={f:_?gt:function(t,e,r){if(dt(t),e=at(e),dt(r),lt)try{return gt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},vt=_?function(t,e,r){return mt.f(t,e,x(1,r))}:function(t,e,r){return t[e]=r,t},yt=Function.toString;j(W.inspectSource)||(W.inspectSource=function(t){return yt.call(t)});var bt,_t,wt,kt=W.inspectSource,Mt=y.WeakMap,xt=j(Mt)&&/native code/.test(kt(Mt)),Ot=X("keys"),Pt=function(t){return Ot[t]||(Ot[t]=tt(t))},St={},Et="Object already initialized",Ct=y.WeakMap;if(xt||W.state){var At=W.state||(W.state=new Ct),jt=At.get,Lt=At.has,Tt=At.set;bt=function(t,e){if(Lt.call(At,t))throw new TypeError(Et);return e.facade=t,Tt.call(At,t,e),e},_t=function(t){return jt.call(At,t)||{}},wt=function(t){return Lt.call(At,t)}}else{var It=Pt("state");St[It]=!0,bt=function(t,e){if(H(t,It))throw new TypeError(Et);return e.facade=t,vt(t,It,e),e},_t=function(t){return H(t,It)?t[It]:{}},wt=function(t){return H(t,It)}}var Nt={set:bt,get:_t,has:wt,enforce:function(t){return wt(t)?_t(t):bt(t,{})},getterFor:function(t){return function(e){var r;if(!L(e)||(r=_t(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},Dt=Function.prototype,Ft=_&&Object.getOwnPropertyDescriptor,Rt=H(Dt,"name"),zt={EXISTS:Rt,PROPER:Rt&&"something"===function(){}.name,CONFIGURABLE:Rt&&(!_||_&&Ft(Dt,"name").configurable)},qt=d((function(t){var e=zt.CONFIGURABLE,r=Nt.get,n=Nt.enforce,o=String(String).split("String");(t.exports=function(t,r,i,s){var a,u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet,l=s&&void 0!==s.name?s.name:r;j(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!H(i,"name")||e&&i.name!==l)&&vt(i,"name",l),(a=n(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==y?(u?!f&&t[r]&&(c=!0):delete t[r],c?t[r]=i:vt(t,r,i)):c?t[r]=i:U(r,i)})(Function.prototype,"toString",(function(){return j(this)&&r(this).source||kt(this)}))})),Gt=Math.ceil,Zt=Math.floor,Bt=function(t){var e=+t;return e!=e||0===e?0:(e>0?Zt:Gt)(e)},Vt=Math.max,Ut=Math.min,Qt=function(t,e){var r=Bt(t);return r<0?Vt(r+e,0):Ut(r,e)},Wt=Math.min,Xt=function(t){return(e=t.length)>0?Wt(Bt(e),9007199254740991):0;var e},Jt=function(t){return function(e,r,n){var o,i=A(e),s=Xt(i),a=Qt(n,s);if(t&&r!=r){for(;s>a;)if((o=i[a++])!=o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},Kt={includes:Jt(!0),indexOf:Jt(!1)},Ht=Kt.indexOf,$t=function(t,e){var r,n=A(t),o=0,i=[];for(r in n)!H(St,r)&&H(n,r)&&i.push(r);for(;e.length>o;)H(n,r=e[o++])&&(~Ht(i,r)||i.push(r));return i},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],te=Yt.concat("length","prototype"),ee={f:Object.getOwnPropertyNames||function(t){return $t(t,te)}},re={f:Object.getOwnPropertySymbols},ne=I("Reflect","ownKeys")||function(t){var e=ee.f(dt(t)),r=re.f;return r?e.concat(r(t)):e},oe=function(t,e){for(var r=ne(e),n=mt.f,o=pt.f,i=0;i<r.length;i++){var s=r[i];H(t,s)||n(t,s,o(e,s))}},ie=/#|\.prototype\./,se=function(t,e){var r=ue[ae(t)];return r==fe||r!=ce&&(j(e)?b(e):!!e)},ae=se.normalize=function(t){return String(t).replace(ie,".").toLowerCase()},ue=se.data={},ce=se.NATIVE="N",fe=se.POLYFILL="P",le=se,he=pt.f,pe=function(t,e){var r,n,o,i,s,a=t.target,u=t.global,c=t.stat;if(r=u?y:c?y[a]||U(a,{}):(y[a]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(s=he(r,n))&&s.value:r[n],!le(u?n:a+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;oe(i,o)}(t.sham||o&&o.sham)&&vt(i,"sham",!0),qt(r,n,i,t)}},de=Array.isArray||function(t){return"Array"==P(t)},ge={};ge[ot("toStringTag")]="z";var me="[object z]"===String(ge),ve=ot("toStringTag"),ye="Arguments"==P(function(){return arguments}()),be=me?P:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ve))?r:ye?P(e):"Object"==(n=P(e))&&j(e.callee)?"Arguments":n},_e=[],we=I("Reflect","construct"),ke=/^\s*(?:class|function)\b/,Me=ke.exec,xe=!ke.exec((function(){})),Oe=function(t){if(!j(t))return!1;try{return we(Object,_e,t),!0}catch(t){return!1}},Pe=!we||b((function(){var t;return Oe(Oe.call)||!Oe(Object)||!Oe((function(){t=!0}))||t}))?function(t){if(!j(t))return!1;switch(be(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return xe||!!Me.call(ke,kt(t))}:Oe,Se=ot("species"),Ee=function(t,e){return new(function(t){var e;return de(t)&&(e=t.constructor,(Pe(e)&&(e===Array||de(e.prototype))||L(e)&&null===(e=e[Se]))&&(e=void 0)),void 0===e?Array:e}(t))(0===e?0:e)},Ce=[].push,Ae=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,s=7==t,a=5==t||i;return function(u,c,f,l){for(var h,p,d=J(u),g=E(d),m=function(t,e,r){if(V(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}(c,f,3),v=Xt(g),y=0,b=l||Ee,_=e?b(u,v):r||s?b(u,0):void 0;v>y;y++)if((a||y in g)&&(p=m(h=g[y],y,d),t))if(e)_[y]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:Ce.call(_,h)}else switch(t){case 4:return!1;case 7:Ce.call(_,h)}return i?-1:n||o?o:_}},je={forEach:Ae(0),map:Ae(1),filter:Ae(2),some:Ae(3),every:Ae(4),find:Ae(5),findIndex:Ae(6),filterReject:Ae(7)},Le=ot("species"),Te=function(t){return q>=51||!b((function(){var e=[];return(e.constructor={})[Le]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ie=je.map;function Ne(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}pe({target:"Array",proto:!0,forced:!Te("map")},{map:function(t){return Ie(this,t,arguments.length>1?arguments[1]:void 0)}});var De=function(t){return function(e,r,n,o){V(r);var i=J(e),s=E(i),a=Xt(i),u=t?a-1:0,c=t?-1:1;if(n<2)for(;;){if(u in s){o=s[u],u+=c;break}if(u+=c,t?u<0:a<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:a>u;u+=c)u in s&&(o=r(o,s[u],u,i));return o}},Fe={left:De(!1),right:De(!0)},Re=function(t,e){var r=[][t];return!!r&&b((function(){r.call(null,e||function(){throw 1},1)}))},ze="process"==P(y.process),qe=Fe.left;pe({target:"Array",proto:!0,forced:!Re("reduce")||!ze&&q>79&&q<83},{reduce:function(t){return qe(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Ge=je.filter;pe({target:"Array",proto:!0,forced:!Te("filter")},{filter:function(t){return Ge(this,t,arguments.length>1?arguments[1]:void 0)}});var Ze=function(){function t(r){var n=r.markers,o=r.position;e(this,t),this.markers=n,o&&(o instanceof google.maps.LatLng?this._position=o:this._position=new google.maps.LatLng(o))}return n(t,[{key:"bounds",get:function(){if(0!==this.markers.length||this._position)return this.markers.reduce((function(t,e){return t.extend(e.getPosition())}),new google.maps.LatLngBounds(this._position,this._position))}},{key:"position",get:function(){return this._position||this.bounds.getCenter()}},{key:"count",get:function(){return this.markers.filter((function(t){return t.getVisible()})).length}},{key:"push",value:function(t){this.markers.push(t)}},{key:"delete",value:function(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}]),t}(),Be=function(t,e,r,n){var o=Ve(t.getBounds(),e,n);return r.filter((function(t){return o.contains(t.getPosition())}))},Ve=function(t,e,r){var n=Qe(t,e),o=n.northEast,i=n.southWest,s=We({northEast:o,southWest:i},r);return Xe(s,e)},Ue=function(t,e){var r=(e.lat-t.lat)*Math.PI/180,n=(e.lng-t.lng)*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},Qe=function(t,e){return{northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}},We=function(t,e){var r=t.northEast,n=t.southWest;return r.x+=e,r.y-=e,n.x-=e,n.y+=e,{northEast:r,southWest:n}},Xe=function(t,e){var r=t.northEast,n=t.southWest,o=new google.maps.LatLngBounds;return o.extend(e.fromDivPixelToLatLng(r)),o.extend(e.fromDivPixelToLatLng(n)),o},Je=function(){function t(r){var n=r.maxZoom,o=void 0===n?16:n;e(this,t),this.maxZoom=o}return n(t,[{key:"noop",value:function(t){var e=t.markers;return He(e)}}]),t}(),Ke=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.viewportPadding,s=void 0===o?60:o,a=Ne(t,["viewportPadding"]);return(n=r.call(this,a)).viewportPadding=60,n.viewportPadding=s,n}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return r.getZoom()>=this.maxZoom?this.noop({markers:e,map:r,mapCanvasProjection:n}):this.cluster({markers:Be(r,n,e,this.viewportPadding),map:r,mapCanvasProjection:n})}}]),i}(Je),He=function(t){return t.map((function(t){return new Ze({position:t.getPosition(),markers:[t]})}))},$e={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Ye=ft("span").classList,tr=Ye&&Ye.constructor&&Ye.constructor.prototype,er=tr===Object.prototype?void 0:tr,rr=je.forEach,nr=Re("forEach")?[].forEach:function(t){return rr(this,t,arguments.length>1?arguments[1]:void 0)},or=function(t){if(t&&t.forEach!==nr)try{vt(t,"forEach",nr)}catch(e){t.forEach=nr}};for(var ir in $e)$e[ir]&&or(y[ir]&&y[ir].prototype);or(er),pe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var sr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?4e4:o,a=t.gridSize,u=void 0===a?40:a,c=Ne(t,["maxDistance","gridSize"]);return(n=r.call(this,c)).clusters=[],n.maxDistance=s,n.gridSize=u,n}return n(i,[{key:"cluster",value:function(t){var e=this,r=t.markers,n=t.map,o=t.mapCanvasProjection;return this.clusters=[],r.forEach((function(t){e.addToClosestCluster(t,n,o)})),this.clusters}},{key:"addToClosestCluster",value:function(t,e,r){for(var n=this.maxDistance,o=null,i=0;i<this.clusters.length;i++){var s=this.clusters[i],a=Ue(s.bounds.getCenter().toJSON(),t.getPosition().toJSON());a<n&&(n=a,o=s)}if(o&&Ve(o.bounds,r,this.gridSize).contains(t.getPosition()))o.push(t);else{var u=new Ze({markers:[t]});this.clusters.push(u)}}}]),i}(Ke),ar=function(t){o(i,t);var r=u(i);function i(t){e(this,i);var n=Ne(t,[]);return r.call(this,n)}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return this.cluster({markers:e,map:r,mapCanvasProjection:n})}},{key:"cluster",value:function(t){return this.noop(t)}}]),i}(Je),ur=6371008.8,cr={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*ur,kilometers:6371.0088,kilometres:6371.0088,meters:ur,metres:ur,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:ur/1852,radians:1,yards:6967335.223679999};function fr(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!gr(t[0])||!gr(t[1]))throw new Error("coordinates must contain numbers");return function(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}({type:"Point",coordinates:t},e,r)}function lr(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function hr(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t*r}function pr(t){return t%360*Math.PI/180}function dr(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return hr(function(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t/r}(t,e),r)}function gr(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function mr(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return vr(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return vr(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return br(t);default:throw new Error("unknown GeoJSON type")}}function vr(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=yr(t.properties),e.geometry=br(t.geometry),e}function yr(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:Array.isArray(n)?e[r]=n.map((function(t){return t})):e[r]=yr(n):e[r]=n})),e):e}function br(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return br(t)})),e):(e.coordinates=_r(t.coordinates),e)}function _r(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return _r(t)}))}function wr(t,e,r){if(null!==t)for(var n,o,i,s,a,u,c,f,l=0,h=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,m=d?t.features.length:1,v=0;v<m;v++){a=(f=!!(c=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<a;y++){var b=0,_=0;if(null!==(s=f?c.geometries[y]:c)){u=s.coordinates;var w=s.type;switch(l=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,h,v,b,_))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],h,v,b,_))return!1;h++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(o=0;o<u[n].length-l;o++){if(!1===e(u[n][o],h,v,b,_))return!1;h++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(_=0,o=0;o<u[n].length;o++){for(i=0;i<u[n][o].length-l;i++){if(!1===e(u[n][o][i],h,v,b,_))return!1;h++}_++}b++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===wr(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kr(t){var e=[];return wr(t,(function(t){e.push(t)})),e}var Mr=function(t,e,r){for(var n=t.length,o=0,i=0;i<n;i++){var s=(t[i]||0)-(e[i]||0);o+=s*s}return r?Math.sqrt(o):o},xr=Mr,Or=function(t,e,r){var n=Math.abs(t-e);return r?n:n*n},Pr=Mr,Sr=function(t,e){for(var r={},n=[],o=e<<2,i=t.length,s=t[0].length>0;n.length<e&&o-- >0;){var a=t[Math.floor(Math.random()*i)],u=s?a.join("_"):""+a;r[u]||(r[u]=!0,n.push(a))}if(n.length<e)throw new Error("Error initializating clusters");return n},Er=function(t,e){var r=t[0].length?xr:Or,n=[],o=t.length,i=t[0].length>0,s=t[Math.floor(Math.random()*o)];i&&s.join("_");for(n.push(s);n.length<e;){for(var a=[],u=n.length,c=0,f=[],l=0;l<o;l++){for(var h=1/0,p=0;p<u;p++){var d=r(t[l],n[p]);d<=h&&(h=d)}a[l]=h}for(var g=0;g<o;g++)c+=a[g];for(var m=0;m<o;m++)f[m]={i:m,v:t[m],pr:a[m]/c,cs:0};f.sort((function(t,e){return t.pr-e.pr})),f[0].cs=f[0].pr;for(var v=1;v<o;v++)f[v].cs=f[v-1].cs+f[v].pr;for(var y=Math.random(),b=0;b<o-1&&f[b++].cs<y;);n.push(f[b-1].v)}return n};function Cr(t,e,r){r=r||[];for(var n=0;n<t;n++)r[n]=e;return r}var Ar=function(t,e,r,n){var o=[],i=[],s=[],a=[],u=!1,c=n||1e4,f=t.length,l=t[0].length,h=l>0,p=[];if(r)o="kmrand"==r?Sr(t,e):"kmpp"==r?Er(t,e):r;else for(var d={};o.length<e;){var g=Math.floor(Math.random()*f);d[g]||(d[g]=!0,o.push(t[g]))}do{Cr(e,0,p);for(var m=0;m<f;m++){for(var v=1/0,y=0,b=0;b<e;b++){(a=h?Pr(t[m],o[b]):Math.abs(t[m]-o[b]))<=v&&(v=a,y=b)}s[m]=y,p[y]++}for(var _=[],w=(i=[],0);w<e;w++)_[w]=h?Cr(l,0,_[w]):0,i[w]=o[w];if(h){for(var k=0;k<e;k++)o[k]=[];for(var M=0;M<f;M++)for(var x=_[s[M]],O=t[M],P=0;P<l;P++)x[P]+=O[P];u=!0;for(var S=0;S<e;S++){for(var E=o[S],C=_[S],A=i[S],j=p[S],L=0;L<l;L++)E[L]=C[L]/j||0;if(u)for(var T=0;T<l;T++)if(A[T]!=E[T]){u=!1;break}}}else{for(var I=0;I<f;I++){_[s[I]]+=t[I]}for(var N=0;N<e;N++)o[N]=_[N]/p[N]||0;u=!0;for(var D=0;D<e;D++)if(i[D]!=o[D]){u=!1;break}}u=u||--c<=0}while(!u);return{it:1e4-c,k:e,idxs:s,centroids:o}};var jr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.numberOfClusters,s=Ne(t,["numberOfClusters"]);return(n=r.call(this,s)).numberOfClusters=o,n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.map,n=[];return 0===e.length||function(t,e){void 0===e&&(e={});var r=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(r/2)),e.numberOfClusters>r&&(e.numberOfClusters=r),!0!==e.mutate&&(t=mr(t));var n=kr(t),o=n.slice(0,e.numberOfClusters),i=Ar(n,e.numberOfClusters,o),s={};return i.centroids.forEach((function(t,e){s[e]=t})),function(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}(t,(function(t,e){var r=i.idxs[e];t.properties.cluster=r,t.properties.centroid=s[r]})),t}(lr(e.map((function(t){return fr([t.getPosition().lng(),t.getPosition().lat()])}))),{numberOfClusters:this.numberOfClusters instanceof Function?this.numberOfClusters(e.length,r.getZoom()):this.numberOfClusters}).features.forEach((function(t,r){n[t.properties.cluster]||(n[t.properties.cluster]=new Ze({position:{lng:t.properties.centroid[0],lat:t.properties.centroid[1]},markers:[]})),n[t.properties.cluster].push(e[r])})),n}}]),i}(Ke),Lr=Object.keys||function(t){return $t(t,Yt)},Tr=Object.assign,Ir=Object.defineProperty,Nr=!Tr||b((function(){if(_&&1!==Tr({b:1},Tr(Ir({},"a",{enumerable:!0,get:function(){Ir(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Tr({},t)[r]||Lr(Tr({},e)).join("")!=n}))?function(t,e){for(var r=J(t),n=arguments.length,o=1,i=re.f,s=M.f;n>o;)for(var a,u=E(arguments[o++]),c=i?Lr(u).concat(i(u)):Lr(u),f=c.length,l=0;f>l;)a=c[l++],_&&!s.call(u,a)||(r[a]=u[a]);return r}:Tr;function Dr(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Fr(t,e,r){void 0===r&&(r={});var n=Dr(t),o=Dr(e),i=pr(o[1]-n[1]),s=pr(o[0]-n[0]),a=pr(n[1]),u=pr(o[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return hr(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}pe({target:"Object",stat:!0,forced:Object.assign!==Nr},{assign:Nr});var Rr=d((function(t){function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var o=0;o<this._datasetLength;o++)if(1!==this._visited[o]){this._visited[o]=1;var i=this._regionQuery(o);if(i.length<this.minPts)this.noise.push(o);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(o,s),this._expandCluster(s,i)}}return this.clusters},e.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},e.prototype._expandCluster=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];if(1!==this._visited[n]){this._visited[n]=1;var o=this._regionQuery(n);o.length>=this.minPts&&(e=this._mergeArrays(e,o))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r<this._datasetLength;r++){this.distance(this.dataset[t],this.dataset[r])<this.epsilon&&e.push(r)}return e},e.prototype._mergeArrays=function(t,e){for(var r=e.length,n=0;n<r;n++){var o=e[n];t.indexOf(o)<0&&t.push(o)}return t},e.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=e)})),zr=d((function(t){function e(t,e,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,r)}e.prototype.init=function(t,e,r){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==r&&(this.distance=r)},e.prototype.run=function(t,e){this.init(t,e);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var o=!0;o;){o=this.assign();for(var i=0;i<this.k;i++){for(var s=new Array(f),a=0,u=0;u<f;u++)s[u]=0;for(var c=0;c<r;c++){var f=this.dataset[c].length;if(i===this.assignments[c]){for(u=0;u<f;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<f;u++)s[u]/=a;this.centroids[i]=s}else this.centroids[i]=this.randomCentroid(),o=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,r=this.dataset.length-1;do{e=Math.round(Math.random()*r),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;n<r;n++)(t=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),r=0;r<this.assignments.length;r++)void 0===e[t=this.assignments[r]]&&(e[t]=[]),e[t].push(r);return e},e.prototype.argmin=function(t,e,r){for(var n,o=Number.MAX_VALUE,i=0,s=e.length,a=0;a<s;a++)(n=r(t,e[a]))<o&&(o=n,i=a);return i},e.prototype.distance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;){var o=t[n]-e[n];r+=o*o}return Math.sqrt(r)},t.exports&&(t.exports=e)})),qr=d((function(t){function e(t,e,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,r)}e.prototype.insert=function(t,e){for(var r=this._queue.length,n=r;n--;){var o=this._priorities[n];"desc"===this._sorting?e>o&&(r=n):e<o&&(r=n)}this._insertAt(t,e,r)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,r=this._queue.length;e<r;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,r){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var n=0;n<t.length;n++)this.insert(t[n],e[n])}r&&(this._sorting=r)},e.prototype._insertAt=function(t,e,r){this._queue.length===r?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(r,0,t),this._priorities.splice(r,0,e))},t.exports&&(t.exports=e)})),Gr=d((function(t){if(t.exports)var e=qr;function r(t,e,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,r,n)}r.prototype.run=function(t,r,n,o){this._init(t,r,n,o);for(var i=0,s=this.dataset.length;i<s;i++)if(1!==this._processed[i]){this._processed[i]=1,this.clusters.push([i]);var a=this.clusters.length-1;this._orderedList.push(i);var u=new e(null,null,"asc"),c=this._regionQuery(i);void 0!==this._distanceToCore(i)&&(this._updateQueue(i,c,u),this._expandCluster(a,u))}return this.clusters},r.prototype.getReachabilityPlot=function(){for(var t=[],e=0,r=this._orderedList.length;e<r;e++){var n=this._orderedList[e],o=this._reachability[n];t.push([n,o])}return t},r.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},r.prototype._updateQueue=function(t,e,r){var n=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===n._processed[e]){var o=n.distance(n.dataset[t],n.dataset[e]),i=Math.max(n._coreDistance,o);void 0===n._reachability[e]?(n._reachability[e]=i,r.insert(e,i)):i<n._reachability[e]&&(n._reachability[e]=i,r.remove(e),r.insert(e,i))}}))},r.prototype._expandCluster=function(t,e){for(var r=e.getElements(),n=0,o=r.length;n<o;n++){var i=r[n];if(void 0===this._processed[i]){var s=this._regionQuery(i);this._processed[i]=1,this.clusters[t].push(i),this._orderedList.push(i),void 0!==this._distanceToCore(i)&&(this._updateQueue(i,s,e),this._expandCluster(t,e))}}},r.prototype._distanceToCore=function(t){for(var e=this.epsilon,r=0;r<e;r++){if(this._regionQuery(t,r).length>=this.minPts)return r}},r.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,o=this.dataset.length;n<o;n++)this.distance(this.dataset[t],this.dataset[n])<e&&r.push(n);return r},r.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=r)})),Zr=d((function(t){t.exports&&(t.exports={DBSCAN:Rr,KMEANS:zr,OPTICS:Gr,PriorityQueue:qr})}));Zr.DBSCAN,Zr.KMEANS,Zr.OPTICS,Zr.PriorityQueue;var Br={units:"kilometers",mutate:!1,minPoints:1},Vr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?200:o,a=t.minPoints,u=void 0===a?Br.minPoints:a,c=Ne(t,["maxDistance","minPoints"]);return(n=r.call(this,c)).maxDistance=s,n.options=Object.assign(Object.assign({},Br),{minPoints:u}),n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.mapCanvasProjection,n=lr(e.map((function(t){var e=r.fromLatLngToContainerPixel(t.getPosition());return fr([e.x,e.y])}))),o=[];return function(t,e,r){void 0===r&&(r={}),!0!==r.mutate&&(t=mr(t)),r.minPoints=r.minPoints||3;var n=new Zr.DBSCAN,o=n.run(kr(t),dr(e,r.units),r.minPoints,Fr),i=-1;return o.forEach((function(e){i++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=i,r.properties.dbscan="core"}))})),n.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t}(n,this.maxDistance,this.options).features.forEach((function(t,r){o[t.properties.cluster]||(o[t.properties.cluster]=[]),o[t.properties.cluster].push(e[r])})),o.map((function(t){return new Ze({markers:t})}))}}]),i}(Ke);function Ur(t,e,r,n,o,i){if(o-n<=r)return;const s=n+o>>1;Qr(t,e,s,n,o,i%2),Ur(t,e,r,n,s-1,i+1),Ur(t,e,r,s+1,o,i+1)}function Qr(t,e,r,n,o,i){for(;o>n;){if(o-n>600){const s=o-n+1,a=r-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);Qr(t,e,r,Math.max(n,Math.floor(r-a*c/s+f)),Math.min(o,Math.floor(r+(s-a)*c/s+f)),i)}const s=e[2*r+i];let a=n,u=o;for(Wr(t,e,n,r),e[2*o+i]>s&&Wr(t,e,n,o);a<u;){for(Wr(t,e,a,u),a++,u--;e[2*a+i]<s;)a++;for(;e[2*u+i]>s;)u--}e[2*n+i]===s?Wr(t,e,n,u):(u++,Wr(t,e,u,o)),u<=r&&(n=u+1),r<=u&&(o=u-1)}}function Wr(t,e,r,n){Xr(t,r,n),Xr(e,2*r,2*n),Xr(e,2*r+1,2*n+1)}function Xr(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function Jr(t,e,r,n){const o=t-r,i=e-n;return o*o+i*i}const Kr=t=>t[0],Hr=t=>t[1];class $r{constructor(t,e=Kr,r=Hr,n=64,o=Float64Array){this.nodeSize=n,this.points=t;const i=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new i(t.length),a=this.coords=new o(2*t.length);for(let n=0;n<t.length;n++)s[n]=n,a[2*n]=e(t[n]),a[2*n+1]=r(t[n]);Ur(s,a,n,0,s.length-1,0)}range(t,e,r,n){return function(t,e,r,n,o,i,s){const a=[0,t.length-1,0],u=[];let c,f;for(;a.length;){const l=a.pop(),h=a.pop(),p=a.pop();if(h-p<=s){for(let s=p;s<=h;s++)c=e[2*s],f=e[2*s+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[s]);continue}const d=Math.floor((p+h)/2);c=e[2*d],f=e[2*d+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[d]);const g=(l+1)%2;(0===l?r<=c:n<=f)&&(a.push(p),a.push(d-1),a.push(g)),(0===l?o>=c:i>=f)&&(a.push(d+1),a.push(h),a.push(g))}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)}within(t,e,r){return function(t,e,r,n,o,i){const s=[0,t.length-1,0],a=[],u=o*o;for(;s.length;){const c=s.pop(),f=s.pop(),l=s.pop();if(f-l<=i){for(let o=l;o<=f;o++)Jr(e[2*o],e[2*o+1],r,n)<=u&&a.push(t[o]);continue}const h=Math.floor((l+f)/2),p=e[2*h],d=e[2*h+1];Jr(p,d,r,n)<=u&&a.push(t[h]);const g=(c+1)%2;(0===c?r-o<=p:n-o<=d)&&(s.push(l),s.push(h-1),s.push(g)),(0===c?r+o>=p:n+o>=d)&&(s.push(h+1),s.push(f),s.push(g))}return a}(this.ids,this.coords,t,e,r,this.nodeSize)}}const Yr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},tn=Math.fround||(en=new Float32Array(1),t=>(en[0]=+t,en[0]));var en;class rn{constructor(t){this.options=ln(Object.create(Yr),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:r,maxZoom:n,nodeSize:o}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(on(t[e],e));this.trees[n+1]=new $r(s,hn,pn,o,Float32Array),e&&console.timeEnd(i);for(let t=n;t>=r;t--){const r=+Date.now();s=this._cluster(s,t),this.trees[t]=new $r(s,hn,pn,o,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let o=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,o=180;else if(r>o){const t=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,o,i],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(un(r),cn(i),un(o),cn(n)),u=[];for(const t of a){const e=s.points[t];u.push(e.numPoints?sn(e):this.points[e.index])}return u}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(n);const i=o.points[e];if(!i)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o.within(i.x,i.y,s),u=[];for(const e of a){const r=o.points[e];r.parentId===t&&u.push(r.numPoints?sn(r):this.points[r.index])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:i,radius:s}=this.options,a=s/i,u=(r-a)/o,c=(r+1+a)/o,f={features:[]};return this._addTileFeatures(n.range((e-a)/o,u,(e+1+a)/o,c),n.points,e,r,o,f),0===e&&this._addTileFeatures(n.range(1-a/o,u,1,c),n.points,o,r,o,f),e===o-1&&this._addTileFeatures(n.range(0,u,a/o,c),n.points,-1,r,o,f),f.features.length?f:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,o){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?o+i.point_count<=n?o+=i.point_count:o=this._appendLeaves(t,i.cluster_id,r,n,o):o<n?o++:t.push(e),t.length===r)break}return o}_addTileFeatures(t,e,r,n,o,i){for(const s of t){const t=e[s],a=t.numPoints;let u,c,f;if(a)u=an(t),c=t.x,f=t.y;else{const e=this.points[t.index];u=e.properties,c=un(e.geometry.coordinates[0]),f=cn(e.geometry.coordinates[1])}const l={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(f*o-n))]],tags:u};let h;a?h=t.id:this.options.generateId?h=t.index:this.points[t.index].id&&(h=this.points[t.index].id),void 0!==h&&(l.id=h),i.features.push(l)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))}_cluster(t,e){const r=[],{radius:n,extent:o,reduce:i,minPoints:s}=this.options,a=n/(o*Math.pow(2,e));for(let n=0;n<t.length;n++){const o=t[n];if(o.zoom<=e)continue;o.zoom=e;const u=this.trees[e+1],c=u.within(o.x,o.y,a),f=o.numPoints||1;let l=f;for(const t of c){const r=u.points[t];r.zoom>e&&(l+=r.numPoints||1)}if(l>=s){let t=o.x*f,s=o.y*f,a=i&&f>1?this._map(o,!0):null;const h=(n<<5)+(e+1)+this.points.length;for(const r of c){const n=u.points[r];if(n.zoom<=e)continue;n.zoom=e;const c=n.numPoints||1;t+=n.x*c,s+=n.y*c,n.parentId=h,i&&(a||(a=this._map(o,!0)),i(a,this._map(n)))}o.parentId=h,r.push(nn(t/l,s/l,h,l,a))}else if(r.push(o),l>1)for(const t of c){const n=u.points[t];n.zoom<=e||(n.zoom=e,r.push(n))}}return r}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?ln({},t.properties):t.properties;const r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?ln({},n):n}}function nn(t,e,r,n,o){return{x:tn(t),y:tn(e),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:o}}function on(t,e){const[r,n]=t.geometry.coordinates;return{x:tn(un(r)),y:tn(cn(n)),zoom:1/0,index:e,parentId:-1}}function sn(t){return{type:"Feature",id:t.id,properties:an(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),fn(t.y)]}};var e}function an(t){const e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return ln(ln({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function un(t){return t/360+.5}function cn(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fn(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ln(t,e){for(const r in e)t[r]=e[r];return t}function hn(t){return t.x}function pn(t){return t.y}var dn,gn=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},mn=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxZoom,s=t.radius,a=void 0===s?60:s,u=Ne(t,["maxZoom","radius"]);return(n=r.call(this,{maxZoom:o})).superCluster=new rn(Object.assign({maxZoom:n.maxZoom,radius:a},u)),n}return n(i,[{key:"calculate",value:function(t){if(!gn(t.markers,this.markers)){this.markers=f(t.markers);var e=this.markers.map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().lng(),t.getPosition().lat()]},properties:{marker:t}}}));this.superCluster.load(e)}return this.cluster(t)}},{key:"cluster",value:function(t){var e=t.map,r=e.getBounds().toJSON(),n=r.west,o=r.south,i=r.east,s=r.north;return this.superCluster.getClusters([n,o,i,s],e.getZoom()).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function(t){var e=c(t.geometry.coordinates,2),r=e[0],n=e[1],o=t.properties;if(o.cluster)return new Ze({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:n,lng:r})});var i=o.marker;return new Ze({markers:[i],position:i.getPosition()})}}]),i}(Je),vn=_?Object.defineProperties:function(t,e){dt(t);for(var r,n=Lr(e),o=n.length,i=0;o>i;)mt.f(t,r=n[i++],e[r]);return t},yn=I("document","documentElement"),bn=Pt("IE_PROTO"),_n=function(){},wn=function(t){return"<script>"+t+"</"+"script>"},kn=function(t){t.write(wn("")),t.close();var e=t.parentWindow.Object;return t=null,e},Mn=function(){try{dn=new ActiveXObject("htmlfile")}catch(t){}var t,e;Mn="undefined"!=typeof document?document.domain&&dn?kn(dn):((e=ft("iframe")).style.display="none",yn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(wn("document.F=Object")),t.close(),t.F):kn(dn);for(var r=Yt.length;r--;)delete Mn.prototype[Yt[r]];return Mn()};St[bn]=!0;var xn=Object.create||function(t,e){var r;return null!==t?(_n.prototype=dt(t),r=new _n,_n.prototype=null,r[bn]=t):r=Mn(),void 0===e?r:vn(r,e)},On=ot("unscopables"),Pn=Array.prototype;null==Pn[On]&&mt.f(Pn,On,{configurable:!0,value:xn(null)});var Sn=Kt.includes;pe({target:"Array",proto:!0},{includes:function(t){return Sn(this,t,arguments.length>1?arguments[1]:void 0)}}),function(t){Pn[On][t]=!0}("includes");var En=ot("match"),Cn=function(t){if(function(t){var e;return L(t)&&(void 0!==(e=t[En])?!!e:"RegExp"==P(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},An=function(t){if("Symbol"===be(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},jn=ot("match");pe({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[jn]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~An(C(this)).indexOf(An(Cn(t)),arguments.length>1?arguments[1]:void 0)}});var Ln=Kt.indexOf,Tn=[].indexOf,In=!!Tn&&1/[1].indexOf(1,-0)<0,Nn=Re("indexOf");pe({target:"Array",proto:!0,forced:In||!Nn},{indexOf:function(t){return In?Tn.apply(this,arguments)||0:Ln(this,t,arguments.length>1?arguments[1]:void 0)}});var Dn=function(t,e,r){var n=at(e);n in t?mt.f(t,n,x(0,r)):t[n]=r},Fn=Te("splice"),Rn=Math.max,zn=Math.min,qn=9007199254740991,Gn="Maximum allowed length exceeded";pe({target:"Array",proto:!0,forced:!Fn},{splice:function(t,e){var r,n,o,i,s,a,u=J(this),c=Xt(u),f=Qt(t,c),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=c-f):(r=l-2,n=zn(Rn(Bt(e),0),c-f)),c+r-n>qn)throw TypeError(Gn);for(o=Ee(u,n),i=0;i<n;i++)(s=f+i)in u&&Dn(o,i,u[s]);if(o.length=n,r<n){for(i=f;i<c-n;i++)a=i+r,(s=i+n)in u?u[a]=u[s]:delete u[a];for(i=c;i>c-n+r;i--)delete u[i-1]}else if(r>n)for(i=c-n;i>f;i--)a=i+r-1,(s=i+n-1)in u?u[a]=u[s]:delete u[a];for(i=0;i<r;i++)u[i+f]=arguments[i+2];return u.length=c-n+r,o}});var Zn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return dt(r),function(t){if("object"==typeof t||j(t))return t;throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Bn=function(t,e,r){var n,o;return Zn&&j(n=e.constructor)&&n!==r&&L(o=n.prototype)&&o!==r.prototype&&Zn(t,o),t},Vn=1..valueOf,Un=function(t){return Vn.call(t)},Qn="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Wn=RegExp("^"+Qn+Qn+"*"),Xn=RegExp(Qn+Qn+"*$"),Jn=function(t){return function(e){var r=An(C(e));return 1&t&&(r=r.replace(Wn,"")),2&t&&(r=r.replace(Xn,"")),r}},Kn={start:Jn(1),end:Jn(2),trim:Jn(3)},Hn=ee.f,$n=pt.f,Yn=mt.f,to=Kn.trim,eo="Number",ro=y.Number,no=ro.prototype,oo=function(t){var e=st(t,"number");return"bigint"==typeof e?e:io(e)},io=function(t){var e,r,n,o,i,s,a,u,c=st(t,"number");if(B(c))throw TypeError("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(43===(e=(c=to(c)).charCodeAt(0))||45===e){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(s=(i=c.slice(2)).length,a=0;a<s;a++)if((u=i.charCodeAt(a))<48||u>o)return NaN;return parseInt(i,n)}return+c};if(le(eo,!ro(" 0o1")||!ro("0b1")||ro("+0x1"))){for(var so,ao=function(t){var e=arguments.length<1?0:ro(oo(t)),r=this;return r instanceof ao&&b((function(){Un(r)}))?Bn(Object(e),r,ao):e},uo=_?Hn(ro):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),co=0;uo.length>co;co++)H(ro,so=uo[co])&&!H(ao,so)&&Yn(ao,so,$n(ro,so));ao.prototype=no,no.constructor=ao,qt(y,eo,ao)}var fo=function t(r,n){e(this,t),this.markers={sum:r.length};var o=n.map((function(t){return t.count})),i=o.reduce((function(t,e){return t+e}),0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min.apply(Math,f(o)),max:Math.max.apply(Math,f(o))}}},lo=function(){function t(){e(this,t)}return n(t,[{key:"render",value:function(t,e){var r=t.count,n=t.position,o=r>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff",i=window.btoa('\n <svg fill="'.concat(o,'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">\n <circle cx="120" cy="120" opacity=".6" r="70" />\n <circle cx="120" cy="120" opacity=".3" r="90" />\n <circle cx="120" cy="120" opacity=".2" r="110" />\n </svg>'));return new google.maps.Marker({position:n,icon:{url:"data:image/svg+xml;base64,".concat(i),scaledSize:new google.maps.Size(45,45)},label:{text:String(r),color:"rgba(255,255,255,0.9)",fontSize:"12px"},zIndex:Number(google.maps.Marker.MAX_ZINDEX)+r})}}]),t}();var ho,po=function t(){e(this,t),function(t,e){for(var r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)};t.MarkerClustererEvents=void 0,(ho=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",ho.CLUSTERING_END="clusteringend",ho.CLUSTER_CLICK="click";var go=function(t,e,r){r.fitBounds(e.bounds)},mo=function(r){o(s,r);var i=u(s);function s(t){var r,n=t.map,o=t.markers,a=void 0===o?[]:o,u=t.algorithm,c=void 0===u?new mn({}):u,l=t.renderer,h=void 0===l?new lo:l,p=t.onClusterClick,d=void 0===p?go:p;return e(this,s),(r=i.call(this)).markers=f(a),r.clusters=[],r.algorithm=c,r.renderer=h,r.onClusterClick=d,n&&r.setMap(n),r}return n(s,[{key:"addMarker",value:function(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}},{key:"addMarkers",value:function(t,e){var r=this;t.forEach((function(t){r.addMarker(t,!0)})),e||this.render()}},{key:"removeMarker",value:function(t,e){var r=this.markers.indexOf(t);return-1!==r&&(t.setMap(null),this.markers.splice(r,1),e||this.render(),!0)}},{key:"removeMarkers",value:function(t,e){var r=this,n=!1;return t.forEach((function(t){n=r.removeMarker(t,!0)||n})),n&&!e&&this.render(),n}},{key:"clearMarkers",value:function(t){this.markers.length=0,t||this.render()}},{key:"render",value:function(){var e=this.getMap();if(e instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});this.reset(),this.clusters=r,this.renderClusters(),google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}},{key:"onAdd",value:function(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function(){this.markers.forEach((function(t){return t.setMap(null)})),this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function(){var e=this,r=new fo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach((function(o){1===o.markers.length?o.marker=o.markers[0]:(o.marker=e.renderer.render(o,r),e.onClusterClick&&o.marker.addListener("click",(function(r){google.maps.event.trigger(e,t.MarkerClustererEvents.CLUSTER_CLICK,o),e.onClusterClick(r,o,n)}))),o.marker.setMap(n)}))}}]),s}(po);t.AbstractAlgorithm=Je,t.AbstractViewportAlgorithm=Ke,t.Cluster=Ze,t.ClusterStats=fo,t.DBScanAlgorithm=Vr,t.DefaultRenderer=lo,t.GridAlgorithm=sr,t.KmeansAlgorithm=jr,t.MarkerClusterer=mo,t.NoopAlgorithm=ar,t.SuperClusterAlgorithm=mn,t.defaultOnClusterClickHandler=go,t.distanceBetweenPoints=Ue,t.extendBoundsToPaddedViewport=Ve,t.extendPixelBounds=We,t.filterMarkersToPaddedViewport=Be,t.noop=He,t.pixelBoundsToLatLngBounds=Xe,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).markerClusterer={})}(this,(function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=i(t);if(e){var o=i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t,e){return t(e={exports:{}},e.exports),e.exports}var m,g,v=function(t){return t&&t.Math==Math&&t},y=v("object"==typeof globalThis&&globalThis)||v("object"==typeof window&&window)||v("object"==typeof self&&self)||v("object"==typeof p&&p)||function(){return this}()||Function("return this")(),b=function(t){try{return!!t()}catch(t){return!0}},_=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),w={}.propertyIsEnumerable,k=Object.getOwnPropertyDescriptor,M={f:k&&!w.call({1:2},1)?function(t){var e=k(this,t);return!!e&&e.enumerable}:w},x=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},O={}.toString,P=function(t){return O.call(t).slice(8,-1)},S="".split,E=b((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==P(t)?S.call(t,""):Object(t)}:Object,C=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},A=function(t){return E(C(t))},j=function(t){return"function"==typeof t},L=function(t){return"object"==typeof t?null!==t:j(t)},T=function(t){return j(t)?t:void 0},I=function(t,e){return arguments.length<2?T(y[t]):y[t]&&y[t][e]},N=I("navigator","userAgent")||"",D=y.process,F=y.Deno,z=D&&D.versions||F&&F.version,R=z&&z.v8;R?g=(m=R.split("."))[0]<4?1:m[0]+m[1]:N&&(!(m=N.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=N.match(/Chrome\/(\d+)/))&&(g=m[1]);var Z=g&&+g,q=!!Object.getOwnPropertySymbols&&!b((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Z&&Z<41})),G=q&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,B=G?function(t){return"symbol"==typeof t}:function(t){var e=I("Symbol");return j(e)&&Object(t)instanceof e},V=function(t){if(j(t))return t;throw TypeError(function(t){try{return String(t)}catch(t){return"Object"}}(t)+" is not a function")},U=function(t,e){try{Object.defineProperty(y,t,{value:e,configurable:!0,writable:!0})}catch(r){y[t]=e}return e},Q="__core-js_shared__",W=y[Q]||U(Q,{}),X=d((function(t){(t.exports=function(t,e){return W[t]||(W[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.18.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),K=function(t){return Object(C(t))},H={}.hasOwnProperty,J=Object.hasOwn||function(t,e){return H.call(K(t),e)},$=0,Y=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+Y).toString(36)},et=X("wks"),rt=y.Symbol,nt=G?rt:rt&&rt.withoutSetter||tt,ot=function(t){return J(et,t)&&(q||"string"==typeof et[t])||(q&&J(rt,t)?et[t]=rt[t]:et[t]=nt("Symbol."+t)),et[t]},it=ot("toPrimitive"),st=function(t,e){if(!L(t)||B(t))return t;var r,n,o=null==(r=t[it])?void 0:V(r);if(o){if(void 0===e&&(e="default"),n=o.call(t,e),!L(n)||B(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&j(r=t.toString)&&!L(n=r.call(t)))return n;if(j(r=t.valueOf)&&!L(n=r.call(t)))return n;if("string"!==e&&j(r=t.toString)&&!L(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}(t,e)},at=function(t){var e=st(t,"string");return B(e)?e:String(e)},ut=y.document,ct=L(ut)&&L(ut.createElement),ft=function(t){return ct?ut.createElement(t):{}},lt=!_&&!b((function(){return 7!=Object.defineProperty(ft("div"),"a",{get:function(){return 7}}).a})),ht=Object.getOwnPropertyDescriptor,pt={f:_?ht:function(t,e){if(t=A(t),e=at(e),lt)try{return ht(t,e)}catch(t){}if(J(t,e))return x(!M.f.call(t,e),t[e])}},dt=function(t){if(L(t))return t;throw TypeError(String(t)+" is not an object")},mt=Object.defineProperty,gt={f:_?mt:function(t,e,r){if(dt(t),e=at(e),dt(r),lt)try{return mt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},vt=_?function(t,e,r){return gt.f(t,e,x(1,r))}:function(t,e,r){return t[e]=r,t},yt=Function.toString;j(W.inspectSource)||(W.inspectSource=function(t){return yt.call(t)});var bt,_t,wt,kt=W.inspectSource,Mt=y.WeakMap,xt=j(Mt)&&/native code/.test(kt(Mt)),Ot=X("keys"),Pt=function(t){return Ot[t]||(Ot[t]=tt(t))},St={},Et="Object already initialized",Ct=y.WeakMap;if(xt||W.state){var At=W.state||(W.state=new Ct),jt=At.get,Lt=At.has,Tt=At.set;bt=function(t,e){if(Lt.call(At,t))throw new TypeError(Et);return e.facade=t,Tt.call(At,t,e),e},_t=function(t){return jt.call(At,t)||{}},wt=function(t){return Lt.call(At,t)}}else{var It=Pt("state");St[It]=!0,bt=function(t,e){if(J(t,It))throw new TypeError(Et);return e.facade=t,vt(t,It,e),e},_t=function(t){return J(t,It)?t[It]:{}},wt=function(t){return J(t,It)}}var Nt={set:bt,get:_t,has:wt,enforce:function(t){return wt(t)?_t(t):bt(t,{})},getterFor:function(t){return function(e){var r;if(!L(e)||(r=_t(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},Dt=Function.prototype,Ft=_&&Object.getOwnPropertyDescriptor,zt=J(Dt,"name"),Rt={EXISTS:zt,PROPER:zt&&"something"===function(){}.name,CONFIGURABLE:zt&&(!_||_&&Ft(Dt,"name").configurable)},Zt=d((function(t){var e=Rt.CONFIGURABLE,r=Nt.get,n=Nt.enforce,o=String(String).split("String");(t.exports=function(t,r,i,s){var a,u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet,l=s&&void 0!==s.name?s.name:r;j(i)&&("Symbol("===String(l).slice(0,7)&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!J(i,"name")||e&&i.name!==l)&&vt(i,"name",l),(a=n(i)).source||(a.source=o.join("string"==typeof l?l:""))),t!==y?(u?!f&&t[r]&&(c=!0):delete t[r],c?t[r]=i:vt(t,r,i)):c?t[r]=i:U(r,i)})(Function.prototype,"toString",(function(){return j(this)&&r(this).source||kt(this)}))})),qt=Math.ceil,Gt=Math.floor,Bt=function(t){var e=+t;return e!=e||0===e?0:(e>0?Gt:qt)(e)},Vt=Math.max,Ut=Math.min,Qt=function(t,e){var r=Bt(t);return r<0?Vt(r+e,0):Ut(r,e)},Wt=Math.min,Xt=function(t){return(e=t.length)>0?Wt(Bt(e),9007199254740991):0;var e},Kt=function(t){return function(e,r,n){var o,i=A(e),s=Xt(i),a=Qt(n,s);if(t&&r!=r){for(;s>a;)if((o=i[a++])!=o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},Ht={includes:Kt(!0),indexOf:Kt(!1)},Jt=Ht.indexOf,$t=function(t,e){var r,n=A(t),o=0,i=[];for(r in n)!J(St,r)&&J(n,r)&&i.push(r);for(;e.length>o;)J(n,r=e[o++])&&(~Jt(i,r)||i.push(r));return i},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],te=Yt.concat("length","prototype"),ee={f:Object.getOwnPropertyNames||function(t){return $t(t,te)}},re={f:Object.getOwnPropertySymbols},ne=I("Reflect","ownKeys")||function(t){var e=ee.f(dt(t)),r=re.f;return r?e.concat(r(t)):e},oe=function(t,e){for(var r=ne(e),n=gt.f,o=pt.f,i=0;i<r.length;i++){var s=r[i];J(t,s)||n(t,s,o(e,s))}},ie=/#|\.prototype\./,se=function(t,e){var r=ue[ae(t)];return r==fe||r!=ce&&(j(e)?b(e):!!e)},ae=se.normalize=function(t){return String(t).replace(ie,".").toLowerCase()},ue=se.data={},ce=se.NATIVE="N",fe=se.POLYFILL="P",le=se,he=pt.f,pe=function(t,e){var r,n,o,i,s,a=t.target,u=t.global,c=t.stat;if(r=u?y:c?y[a]||U(a,{}):(y[a]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(s=he(r,n))&&s.value:r[n],!le(u?n:a+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;oe(i,o)}(t.sham||o&&o.sham)&&vt(i,"sham",!0),Zt(r,n,i,t)}},de=Array.isArray||function(t){return"Array"==P(t)},me={};me[ot("toStringTag")]="z";var ge="[object z]"===String(me),ve=ot("toStringTag"),ye="Arguments"==P(function(){return arguments}()),be=ge?P:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ve))?r:ye?P(e):"Object"==(n=P(e))&&j(e.callee)?"Arguments":n},_e=[],we=I("Reflect","construct"),ke=/^\s*(?:class|function)\b/,Me=ke.exec,xe=!ke.exec((function(){})),Oe=function(t){if(!j(t))return!1;try{return we(Object,_e,t),!0}catch(t){return!1}},Pe=!we||b((function(){var t;return Oe(Oe.call)||!Oe(Object)||!Oe((function(){t=!0}))||t}))?function(t){if(!j(t))return!1;switch(be(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return xe||!!Me.call(ke,kt(t))}:Oe,Se=ot("species"),Ee=function(t,e){return new(function(t){var e;return de(t)&&(e=t.constructor,(Pe(e)&&(e===Array||de(e.prototype))||L(e)&&null===(e=e[Se]))&&(e=void 0)),void 0===e?Array:e}(t))(0===e?0:e)},Ce=[].push,Ae=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,s=7==t,a=5==t||i;return function(u,c,f,l){for(var h,p,d=K(u),m=E(d),g=function(t,e,r){if(V(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}(c,f,3),v=Xt(m),y=0,b=l||Ee,_=e?b(u,v):r||s?b(u,0):void 0;v>y;y++)if((a||y in m)&&(p=g(h=m[y],y,d),t))if(e)_[y]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:Ce.call(_,h)}else switch(t){case 4:return!1;case 7:Ce.call(_,h)}return i?-1:n||o?o:_}},je={forEach:Ae(0),map:Ae(1),filter:Ae(2),some:Ae(3),every:Ae(4),find:Ae(5),findIndex:Ae(6),filterReject:Ae(7)},Le=ot("species"),Te=function(t){return Z>=51||!b((function(){var e=[];return(e.constructor={})[Le]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ie=je.map;function Ne(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}pe({target:"Array",proto:!0,forced:!Te("map")},{map:function(t){return Ie(this,t,arguments.length>1?arguments[1]:void 0)}});var De=function(t){return function(e,r,n,o){V(r);var i=K(e),s=E(i),a=Xt(i),u=t?a-1:0,c=t?-1:1;if(n<2)for(;;){if(u in s){o=s[u],u+=c;break}if(u+=c,t?u<0:a<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:a>u;u+=c)u in s&&(o=r(o,s[u],u,i));return o}},Fe={left:De(!1),right:De(!0)},ze=function(t,e){var r=[][t];return!!r&&b((function(){r.call(null,e||function(){throw 1},1)}))},Re="process"==P(y.process),Ze=Fe.left;pe({target:"Array",proto:!0,forced:!ze("reduce")||!Re&&Z>79&&Z<83},{reduce:function(t){return Ze(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var qe=je.filter;pe({target:"Array",proto:!0,forced:!Te("filter")},{filter:function(t){return qe(this,t,arguments.length>1?arguments[1]:void 0)}});var Ge=function(){function t(r){var n=r.markers,o=r.position;e(this,t),this.markers=n,o&&(o instanceof google.maps.LatLng?this._position=o:this._position=new google.maps.LatLng(o))}return n(t,[{key:"bounds",get:function(){if(0!==this.markers.length||this._position)return this.markers.reduce((function(t,e){return t.extend(e.getPosition())}),new google.maps.LatLngBounds(this._position,this._position))}},{key:"position",get:function(){return this._position||this.bounds.getCenter()}},{key:"count",get:function(){return this.markers.filter((function(t){return t.getVisible()})).length}},{key:"push",value:function(t){this.markers.push(t)}},{key:"delete",value:function(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}]),t}(),Be=function(t,e,r,n){var o=Ve(t.getBounds(),e,n);return r.filter((function(t){return o.contains(t.getPosition())}))},Ve=function(t,e,r){var n=Qe(t,e),o=n.northEast,i=n.southWest,s=We({northEast:o,southWest:i},r);return Xe(s,e)},Ue=function(t,e){var r=(e.lat-t.lat)*Math.PI/180,n=(e.lng-t.lng)*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(t.lat*Math.PI/180)*Math.cos(e.lat*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},Qe=function(t,e){return{northEast:e.fromLatLngToDivPixel(t.getNorthEast()),southWest:e.fromLatLngToDivPixel(t.getSouthWest())}},We=function(t,e){var r=t.northEast,n=t.southWest;return r.x+=e,r.y-=e,n.x-=e,n.y+=e,{northEast:r,southWest:n}},Xe=function(t,e){var r=t.northEast,n=t.southWest,o=new google.maps.LatLngBounds;return o.extend(e.fromDivPixelToLatLng(r)),o.extend(e.fromDivPixelToLatLng(n)),o},Ke=function(){function t(r){var n=r.maxZoom,o=void 0===n?16:n;e(this,t),this.maxZoom=o}return n(t,[{key:"noop",value:function(t){var e=t.markers;return Je(e)}}]),t}(),He=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.viewportPadding,s=void 0===o?60:o,a=Ne(t,["viewportPadding"]);return(n=r.call(this,a)).viewportPadding=60,n.viewportPadding=s,n}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return r.getZoom()>=this.maxZoom?{clusters:this.noop({markers:e,map:r,mapCanvasProjection:n}),changed:!1}:{clusters:this.cluster({markers:Be(r,n,e,this.viewportPadding),map:r,mapCanvasProjection:n})}}}]),i}(Ke),Je=function(t){return t.map((function(t){return new Ge({position:t.getPosition(),markers:[t]})}))},$e={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Ye=ft("span").classList,tr=Ye&&Ye.constructor&&Ye.constructor.prototype,er=tr===Object.prototype?void 0:tr,rr=je.forEach,nr=ze("forEach")?[].forEach:function(t){return rr(this,t,arguments.length>1?arguments[1]:void 0)},or=function(t){if(t&&t.forEach!==nr)try{vt(t,"forEach",nr)}catch(e){t.forEach=nr}};for(var ir in $e)$e[ir]&&or(y[ir]&&y[ir].prototype);or(er),pe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var sr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?4e4:o,a=t.gridSize,u=void 0===a?40:a,c=Ne(t,["maxDistance","gridSize"]);return(n=r.call(this,c)).clusters=[],n.maxDistance=s,n.gridSize=u,n}return n(i,[{key:"cluster",value:function(t){var e=this,r=t.markers,n=t.map,o=t.mapCanvasProjection;return this.clusters=[],r.forEach((function(t){e.addToClosestCluster(t,n,o)})),this.clusters}},{key:"addToClosestCluster",value:function(t,e,r){for(var n=this.maxDistance,o=null,i=0;i<this.clusters.length;i++){var s=this.clusters[i],a=Ue(s.bounds.getCenter().toJSON(),t.getPosition().toJSON());a<n&&(n=a,o=s)}if(o&&Ve(o.bounds,r,this.gridSize).contains(t.getPosition()))o.push(t);else{var u=new Ge({markers:[t]});this.clusters.push(u)}}}]),i}(He),ar=function(t){o(i,t);var r=u(i);function i(t){e(this,i);var n=Ne(t,[]);return r.call(this,n)}return n(i,[{key:"calculate",value:function(t){var e=t.markers,r=t.map,n=t.mapCanvasProjection;return{clusters:this.cluster({markers:e,map:r,mapCanvasProjection:n}),changed:!1}}},{key:"cluster",value:function(t){return this.noop(t)}}]),i}(Ke),ur=6371008.8,cr={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*ur,kilometers:6371.0088,kilometres:6371.0088,meters:ur,metres:ur,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:ur/1852,radians:1,yards:6967335.223679999};function fr(t,e,r){if(void 0===r&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!mr(t[0])||!mr(t[1]))throw new Error("coordinates must contain numbers");return function(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}({type:"Point",coordinates:t},e,r)}function lr(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function hr(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t*r}function pr(t){return t%360*Math.PI/180}function dr(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return hr(function(t,e){void 0===e&&(e="kilometers");var r=cr[e];if(!r)throw new Error(e+" units is invalid");return t/r}(t,e),r)}function mr(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function gr(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return vr(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return vr(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return br(t);default:throw new Error("unknown GeoJSON type")}}function vr(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=yr(t.properties),e.geometry=br(t.geometry),e}function yr(t){var e={};return t?(Object.keys(t).forEach((function(r){var n=t[r];"object"==typeof n?null===n?e[r]=null:Array.isArray(n)?e[r]=n.map((function(t){return t})):e[r]=yr(n):e[r]=n})),e):e}function br(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return br(t)})),e):(e.coordinates=_r(t.coordinates),e)}function _r(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return _r(t)}))}function wr(t,e,r){if(null!==t)for(var n,o,i,s,a,u,c,f,l=0,h=0,p=t.type,d="FeatureCollection"===p,m="Feature"===p,g=d?t.features.length:1,v=0;v<g;v++){a=(f=!!(c=d?t.features[v].geometry:m?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<a;y++){var b=0,_=0;if(null!==(s=f?c.geometries[y]:c)){u=s.coordinates;var w=s.type;switch(l=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,h,v,b,_))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],h,v,b,_))return!1;h++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(o=0;o<u[n].length-l;o++){if(!1===e(u[n][o],h,v,b,_))return!1;h++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(_=0,o=0;o<u[n].length;o++){for(i=0;i<u[n][o].length-l;i++){if(!1===e(u[n][o][i],h,v,b,_))return!1;h++}_++}b++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===wr(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kr(t){var e=[];return wr(t,(function(t){e.push(t)})),e}var Mr=function(t,e,r){for(var n=t.length,o=0,i=0;i<n;i++){var s=(t[i]||0)-(e[i]||0);o+=s*s}return r?Math.sqrt(o):o},xr=Mr,Or=function(t,e,r){var n=Math.abs(t-e);return r?n:n*n},Pr=Mr,Sr=function(t,e){for(var r={},n=[],o=e<<2,i=t.length,s=t[0].length>0;n.length<e&&o-- >0;){var a=t[Math.floor(Math.random()*i)],u=s?a.join("_"):""+a;r[u]||(r[u]=!0,n.push(a))}if(n.length<e)throw new Error("Error initializating clusters");return n},Er=function(t,e){var r=t[0].length?xr:Or,n=[],o=t.length,i=t[0].length>0,s=t[Math.floor(Math.random()*o)];i&&s.join("_");for(n.push(s);n.length<e;){for(var a=[],u=n.length,c=0,f=[],l=0;l<o;l++){for(var h=1/0,p=0;p<u;p++){var d=r(t[l],n[p]);d<=h&&(h=d)}a[l]=h}for(var m=0;m<o;m++)c+=a[m];for(var g=0;g<o;g++)f[g]={i:g,v:t[g],pr:a[g]/c,cs:0};f.sort((function(t,e){return t.pr-e.pr})),f[0].cs=f[0].pr;for(var v=1;v<o;v++)f[v].cs=f[v-1].cs+f[v].pr;for(var y=Math.random(),b=0;b<o-1&&f[b++].cs<y;);n.push(f[b-1].v)}return n};function Cr(t,e,r){r=r||[];for(var n=0;n<t;n++)r[n]=e;return r}var Ar=function(t,e,r,n){var o=[],i=[],s=[],a=[],u=!1,c=n||1e4,f=t.length,l=t[0].length,h=l>0,p=[];if(r)o="kmrand"==r?Sr(t,e):"kmpp"==r?Er(t,e):r;else for(var d={};o.length<e;){var m=Math.floor(Math.random()*f);d[m]||(d[m]=!0,o.push(t[m]))}do{Cr(e,0,p);for(var g=0;g<f;g++){for(var v=1/0,y=0,b=0;b<e;b++){(a=h?Pr(t[g],o[b]):Math.abs(t[g]-o[b]))<=v&&(v=a,y=b)}s[g]=y,p[y]++}for(var _=[],w=(i=[],0);w<e;w++)_[w]=h?Cr(l,0,_[w]):0,i[w]=o[w];if(h){for(var k=0;k<e;k++)o[k]=[];for(var M=0;M<f;M++)for(var x=_[s[M]],O=t[M],P=0;P<l;P++)x[P]+=O[P];u=!0;for(var S=0;S<e;S++){for(var E=o[S],C=_[S],A=i[S],j=p[S],L=0;L<l;L++)E[L]=C[L]/j||0;if(u)for(var T=0;T<l;T++)if(A[T]!=E[T]){u=!1;break}}}else{for(var I=0;I<f;I++){_[s[I]]+=t[I]}for(var N=0;N<e;N++)o[N]=_[N]/p[N]||0;u=!0;for(var D=0;D<e;D++)if(i[D]!=o[D]){u=!1;break}}u=u||--c<=0}while(!u);return{it:1e4-c,k:e,idxs:s,centroids:o}};var jr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.numberOfClusters,s=Ne(t,["numberOfClusters"]);return(n=r.call(this,s)).numberOfClusters=o,n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.map,n=[];return 0===e.length||function(t,e){void 0===e&&(e={});var r=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(r/2)),e.numberOfClusters>r&&(e.numberOfClusters=r),!0!==e.mutate&&(t=gr(t));var n=kr(t),o=n.slice(0,e.numberOfClusters),i=Ar(n,e.numberOfClusters,o),s={};return i.centroids.forEach((function(t,e){s[e]=t})),function(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}(t,(function(t,e){var r=i.idxs[e];t.properties.cluster=r,t.properties.centroid=s[r]})),t}(lr(e.map((function(t){return fr([t.getPosition().lng(),t.getPosition().lat()])}))),{numberOfClusters:this.numberOfClusters instanceof Function?this.numberOfClusters(e.length,r.getZoom()):this.numberOfClusters}).features.forEach((function(t,r){n[t.properties.cluster]||(n[t.properties.cluster]=new Ge({position:{lng:t.properties.centroid[0],lat:t.properties.centroid[1]},markers:[]})),n[t.properties.cluster].push(e[r])})),n}}]),i}(He),Lr=Object.keys||function(t){return $t(t,Yt)},Tr=Object.assign,Ir=Object.defineProperty,Nr=!Tr||b((function(){if(_&&1!==Tr({b:1},Tr(Ir({},"a",{enumerable:!0,get:function(){Ir(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Tr({},t)[r]||Lr(Tr({},e)).join("")!=n}))?function(t,e){for(var r=K(t),n=arguments.length,o=1,i=re.f,s=M.f;n>o;)for(var a,u=E(arguments[o++]),c=i?Lr(u).concat(i(u)):Lr(u),f=c.length,l=0;f>l;)a=c[l++],_&&!s.call(u,a)||(r[a]=u[a]);return r}:Tr;function Dr(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Fr(t,e,r){void 0===r&&(r={});var n=Dr(t),o=Dr(e),i=pr(o[1]-n[1]),s=pr(o[0]-n[0]),a=pr(n[1]),u=pr(o[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return hr(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}pe({target:"Object",stat:!0,forced:Object.assign!==Nr},{assign:Nr});var zr=d((function(t){function e(t,e,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,r,n)}e.prototype.run=function(t,e,r,n){this._init(t,e,r,n);for(var o=0;o<this._datasetLength;o++)if(1!==this._visited[o]){this._visited[o]=1;var i=this._regionQuery(o);if(i.length<this.minPts)this.noise.push(o);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(o,s),this._expandCluster(s,i)}}return this.clusters},e.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},e.prototype._expandCluster=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];if(1!==this._visited[n]){this._visited[n]=1;var o=this._regionQuery(n);o.length>=this.minPts&&(e=this._mergeArrays(e,o))}1!==this._assigned[n]&&this._addToCluster(n,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],r=0;r<this._datasetLength;r++){this.distance(this.dataset[t],this.dataset[r])<this.epsilon&&e.push(r)}return e},e.prototype._mergeArrays=function(t,e){for(var r=e.length,n=0;n<r;n++){var o=e[n];t.indexOf(o)<0&&t.push(o)}return t},e.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=e)})),Rr=d((function(t){function e(t,e,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,r)}e.prototype.init=function(t,e,r){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==r&&(this.distance=r)},e.prototype.run=function(t,e){this.init(t,e);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var o=!0;o;){o=this.assign();for(var i=0;i<this.k;i++){for(var s=new Array(f),a=0,u=0;u<f;u++)s[u]=0;for(var c=0;c<r;c++){var f=this.dataset[c].length;if(i===this.assignments[c]){for(u=0;u<f;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<f;u++)s[u]/=a;this.centroids[i]=s}else this.centroids[i]=this.randomCentroid(),o=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,r=this.dataset.length-1;do{e=Math.round(Math.random()*r),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,r=this.dataset.length,n=0;n<r;n++)(t=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),r=0;r<this.assignments.length;r++)void 0===e[t=this.assignments[r]]&&(e[t]=[]),e[t].push(r);return e},e.prototype.argmin=function(t,e,r){for(var n,o=Number.MAX_VALUE,i=0,s=e.length,a=0;a<s;a++)(n=r(t,e[a]))<o&&(o=n,i=a);return i},e.prototype.distance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;){var o=t[n]-e[n];r+=o*o}return Math.sqrt(r)},t.exports&&(t.exports=e)})),Zr=d((function(t){function e(t,e,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,r)}e.prototype.insert=function(t,e){for(var r=this._queue.length,n=r;n--;){var o=this._priorities[n];"desc"===this._sorting?e>o&&(r=n):e<o&&(r=n)}this._insertAt(t,e,r)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,r=this._queue.length;e<r;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,r){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var n=0;n<t.length;n++)this.insert(t[n],e[n])}r&&(this._sorting=r)},e.prototype._insertAt=function(t,e,r){this._queue.length===r?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(r,0,t),this._priorities.splice(r,0,e))},t.exports&&(t.exports=e)})),qr=d((function(t){if(t.exports)var e=Zr;function r(t,e,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,r,n)}r.prototype.run=function(t,r,n,o){this._init(t,r,n,o);for(var i=0,s=this.dataset.length;i<s;i++)if(1!==this._processed[i]){this._processed[i]=1,this.clusters.push([i]);var a=this.clusters.length-1;this._orderedList.push(i);var u=new e(null,null,"asc"),c=this._regionQuery(i);void 0!==this._distanceToCore(i)&&(this._updateQueue(i,c,u),this._expandCluster(a,u))}return this.clusters},r.prototype.getReachabilityPlot=function(){for(var t=[],e=0,r=this._orderedList.length;e<r;e++){var n=this._orderedList[e],o=this._reachability[n];t.push([n,o])}return t},r.prototype._init=function(t,e,r,n){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),r&&(this.minPts=r),n&&(this.distance=n)},r.prototype._updateQueue=function(t,e,r){var n=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===n._processed[e]){var o=n.distance(n.dataset[t],n.dataset[e]),i=Math.max(n._coreDistance,o);void 0===n._reachability[e]?(n._reachability[e]=i,r.insert(e,i)):i<n._reachability[e]&&(n._reachability[e]=i,r.remove(e),r.insert(e,i))}}))},r.prototype._expandCluster=function(t,e){for(var r=e.getElements(),n=0,o=r.length;n<o;n++){var i=r[n];if(void 0===this._processed[i]){var s=this._regionQuery(i);this._processed[i]=1,this.clusters[t].push(i),this._orderedList.push(i),void 0!==this._distanceToCore(i)&&(this._updateQueue(i,s,e),this._expandCluster(t,e))}}},r.prototype._distanceToCore=function(t){for(var e=this.epsilon,r=0;r<e;r++){if(this._regionQuery(t,r).length>=this.minPts)return r}},r.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var r=[],n=0,o=this.dataset.length;n<o;n++)this.distance(this.dataset[t],this.dataset[n])<e&&r.push(n);return r},r.prototype._euclideanDistance=function(t,e){for(var r=0,n=Math.min(t.length,e.length);n--;)r+=(t[n]-e[n])*(t[n]-e[n]);return Math.sqrt(r)},t.exports&&(t.exports=r)})),Gr=d((function(t){t.exports&&(t.exports={DBSCAN:zr,KMEANS:Rr,OPTICS:qr,PriorityQueue:Zr})}));Gr.DBSCAN,Gr.KMEANS,Gr.OPTICS,Gr.PriorityQueue;var Br={units:"kilometers",mutate:!1,minPoints:1},Vr=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxDistance,s=void 0===o?200:o,a=t.minPoints,u=void 0===a?Br.minPoints:a,c=Ne(t,["maxDistance","minPoints"]);return(n=r.call(this,c)).maxDistance=s,n.options=Object.assign(Object.assign({},Br),{minPoints:u}),n}return n(i,[{key:"cluster",value:function(t){var e=t.markers,r=t.mapCanvasProjection,n=lr(e.map((function(t){var e=r.fromLatLngToContainerPixel(t.getPosition());return fr([e.x,e.y])}))),o=[];return function(t,e,r){void 0===r&&(r={}),!0!==r.mutate&&(t=gr(t)),r.minPoints=r.minPoints||3;var n=new Gr.DBSCAN,o=n.run(kr(t),dr(e,r.units),r.minPoints,Fr),i=-1;return o.forEach((function(e){i++,e.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster=i,r.properties.dbscan="core"}))})),n.noise.forEach((function(e){var r=t.features[e];r.properties||(r.properties={}),r.properties.cluster?r.properties.dbscan="edge":r.properties.dbscan="noise"})),t}(n,this.maxDistance,this.options).features.forEach((function(t,r){o[t.properties.cluster]||(o[t.properties.cluster]=[]),o[t.properties.cluster].push(e[r])})),o.map((function(t){return new Ge({markers:t})}))}}]),i}(He);function Ur(t,e,r,n,o,i){if(o-n<=r)return;const s=n+o>>1;Qr(t,e,s,n,o,i%2),Ur(t,e,r,n,s-1,i+1),Ur(t,e,r,s+1,o,i+1)}function Qr(t,e,r,n,o,i){for(;o>n;){if(o-n>600){const s=o-n+1,a=r-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);Qr(t,e,r,Math.max(n,Math.floor(r-a*c/s+f)),Math.min(o,Math.floor(r+(s-a)*c/s+f)),i)}const s=e[2*r+i];let a=n,u=o;for(Wr(t,e,n,r),e[2*o+i]>s&&Wr(t,e,n,o);a<u;){for(Wr(t,e,a,u),a++,u--;e[2*a+i]<s;)a++;for(;e[2*u+i]>s;)u--}e[2*n+i]===s?Wr(t,e,n,u):(u++,Wr(t,e,u,o)),u<=r&&(n=u+1),r<=u&&(o=u-1)}}function Wr(t,e,r,n){Xr(t,r,n),Xr(e,2*r,2*n),Xr(e,2*r+1,2*n+1)}function Xr(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function Kr(t,e,r,n){const o=t-r,i=e-n;return o*o+i*i}const Hr=t=>t[0],Jr=t=>t[1];class $r{constructor(t,e=Hr,r=Jr,n=64,o=Float64Array){this.nodeSize=n,this.points=t;const i=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new i(t.length),a=this.coords=new o(2*t.length);for(let n=0;n<t.length;n++)s[n]=n,a[2*n]=e(t[n]),a[2*n+1]=r(t[n]);Ur(s,a,n,0,s.length-1,0)}range(t,e,r,n){return function(t,e,r,n,o,i,s){const a=[0,t.length-1,0],u=[];let c,f;for(;a.length;){const l=a.pop(),h=a.pop(),p=a.pop();if(h-p<=s){for(let s=p;s<=h;s++)c=e[2*s],f=e[2*s+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[s]);continue}const d=Math.floor((p+h)/2);c=e[2*d],f=e[2*d+1],c>=r&&c<=o&&f>=n&&f<=i&&u.push(t[d]);const m=(l+1)%2;(0===l?r<=c:n<=f)&&(a.push(p),a.push(d-1),a.push(m)),(0===l?o>=c:i>=f)&&(a.push(d+1),a.push(h),a.push(m))}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)}within(t,e,r){return function(t,e,r,n,o,i){const s=[0,t.length-1,0],a=[],u=o*o;for(;s.length;){const c=s.pop(),f=s.pop(),l=s.pop();if(f-l<=i){for(let o=l;o<=f;o++)Kr(e[2*o],e[2*o+1],r,n)<=u&&a.push(t[o]);continue}const h=Math.floor((l+f)/2),p=e[2*h],d=e[2*h+1];Kr(p,d,r,n)<=u&&a.push(t[h]);const m=(c+1)%2;(0===c?r-o<=p:n-o<=d)&&(s.push(l),s.push(h-1),s.push(m)),(0===c?r+o>=p:n+o>=d)&&(s.push(h+1),s.push(f),s.push(m))}return a}(this.ids,this.coords,t,e,r,this.nodeSize)}}const Yr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},tn=Math.fround||(en=new Float32Array(1),t=>(en[0]=+t,en[0]));var en;class rn{constructor(t){this.options=ln(Object.create(Yr),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:r,maxZoom:n,nodeSize:o}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(on(t[e],e));this.trees[n+1]=new $r(s,hn,pn,o,Float32Array),e&&console.timeEnd(i);for(let t=n;t>=r;t--){const r=+Date.now();s=this._cluster(s,t),this.trees[t]=new $r(s,hn,pn,o,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-r)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let r=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let o=180===t[2]?180:((t[2]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,o=180;else if(r>o){const t=this.getClusters([r,n,180,i],e),s=this.getClusters([-180,n,o,i],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(un(r),cn(i),un(o),cn(n)),u=[];for(const t of a){const e=s.points[t];u.push(e.numPoints?sn(e):this.points[e.index])}return u}getChildren(t){const e=this._getOriginId(t),r=this._getOriginZoom(t),n="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(n);const i=o.points[e];if(!i)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),a=o.within(i.x,i.y,s),u=[];for(const e of a){const r=o.points[e];r.parentId===t&&u.push(r.numPoints?sn(r):this.points[r.index])}if(0===u.length)throw new Error(n);return u}getLeaves(t,e,r){e=e||10,r=r||0;const n=[];return this._appendLeaves(n,t,e,r,0),n}getTile(t,e,r){const n=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:i,radius:s}=this.options,a=s/i,u=(r-a)/o,c=(r+1+a)/o,f={features:[]};return this._addTileFeatures(n.range((e-a)/o,u,(e+1+a)/o,c),n.points,e,r,o,f),0===e&&this._addTileFeatures(n.range(1-a/o,u,1,c),n.points,o,r,o,f),e===o-1&&this._addTileFeatures(n.range(0,u,a/o,c),n.points,-1,r,o,f),f.features.length?f:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}_appendLeaves(t,e,r,n,o){const i=this.getChildren(e);for(const e of i){const i=e.properties;if(i&&i.cluster?o+i.point_count<=n?o+=i.point_count:o=this._appendLeaves(t,i.cluster_id,r,n,o):o<n?o++:t.push(e),t.length===r)break}return o}_addTileFeatures(t,e,r,n,o,i){for(const s of t){const t=e[s],a=t.numPoints;let u,c,f;if(a)u=an(t),c=t.x,f=t.y;else{const e=this.points[t.index];u=e.properties,c=un(e.geometry.coordinates[0]),f=cn(e.geometry.coordinates[1])}const l={type:1,geometry:[[Math.round(this.options.extent*(c*o-r)),Math.round(this.options.extent*(f*o-n))]],tags:u};let h;a?h=t.id:this.options.generateId?h=t.index:this.points[t.index].id&&(h=this.points[t.index].id),void 0!==h&&(l.id=h),i.features.push(l)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))}_cluster(t,e){const r=[],{radius:n,extent:o,reduce:i,minPoints:s}=this.options,a=n/(o*Math.pow(2,e));for(let n=0;n<t.length;n++){const o=t[n];if(o.zoom<=e)continue;o.zoom=e;const u=this.trees[e+1],c=u.within(o.x,o.y,a),f=o.numPoints||1;let l=f;for(const t of c){const r=u.points[t];r.zoom>e&&(l+=r.numPoints||1)}if(l>=s){let t=o.x*f,s=o.y*f,a=i&&f>1?this._map(o,!0):null;const h=(n<<5)+(e+1)+this.points.length;for(const r of c){const n=u.points[r];if(n.zoom<=e)continue;n.zoom=e;const c=n.numPoints||1;t+=n.x*c,s+=n.y*c,n.parentId=h,i&&(a||(a=this._map(o,!0)),i(a,this._map(n)))}o.parentId=h,r.push(nn(t/l,s/l,h,l,a))}else if(r.push(o),l>1)for(const t of c){const n=u.points[t];n.zoom<=e||(n.zoom=e,r.push(n))}}return r}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?ln({},t.properties):t.properties;const r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?ln({},n):n}}function nn(t,e,r,n,o){return{x:tn(t),y:tn(e),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:o}}function on(t,e){const[r,n]=t.geometry.coordinates;return{x:tn(un(r)),y:tn(cn(n)),zoom:1/0,index:e,parentId:-1}}function sn(t){return{type:"Feature",id:t.id,properties:an(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),fn(t.y)]}};var e}function an(t){const e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return ln(ln({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function un(t){return t/360+.5}function cn(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fn(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ln(t,e){for(const r in e)t[r]=e[r];return t}function hn(t){return t.x}function pn(t){return t.y}var dn,mn=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if((n=e.length)!=r.length)return!1;for(o=n;0!=o--;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var s=i[o];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},gn=function(t){o(i,t);var r=u(i);function i(t){var n;e(this,i);var o=t.maxZoom,s=t.radius,a=void 0===s?60:s,u=Ne(t,["maxZoom","radius"]);return(n=r.call(this,{maxZoom:o})).superCluster=new rn(Object.assign({maxZoom:n.maxZoom,radius:a},u)),n.state={zoom:null},n}return n(i,[{key:"calculate",value:function(t){var e=!1;if(!mn(t.markers,this.markers)){e=!0,this.markers=f(t.markers);var r=this.markers.map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().lng(),t.getPosition().lat()]},properties:{marker:t}}}));this.superCluster.load(r)}var n={zoom:t.map.getZoom()};return e||this.state.zoom>this.maxZoom&&n.zoom>this.maxZoom||(e=e||!mn(this.state,n)),this.state=n,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}},{key:"cluster",value:function(t){var e=t.map;return this.superCluster.getClusters([-180,-90,180,90],e.getZoom()).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function(t){var e=c(t.geometry.coordinates,2),r=e[0],n=e[1],o=t.properties;if(o.cluster)return new Ge({markers:this.superCluster.getLeaves(o.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:n,lng:r})});var i=o.marker;return new Ge({markers:[i],position:i.getPosition()})}}]),i}(Ke),vn=_?Object.defineProperties:function(t,e){dt(t);for(var r,n=Lr(e),o=n.length,i=0;o>i;)gt.f(t,r=n[i++],e[r]);return t},yn=I("document","documentElement"),bn=Pt("IE_PROTO"),_n=function(){},wn=function(t){return"<script>"+t+"</"+"script>"},kn=function(t){t.write(wn("")),t.close();var e=t.parentWindow.Object;return t=null,e},Mn=function(){try{dn=new ActiveXObject("htmlfile")}catch(t){}var t,e;Mn="undefined"!=typeof document?document.domain&&dn?kn(dn):((e=ft("iframe")).style.display="none",yn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(wn("document.F=Object")),t.close(),t.F):kn(dn);for(var r=Yt.length;r--;)delete Mn.prototype[Yt[r]];return Mn()};St[bn]=!0;var xn=Object.create||function(t,e){var r;return null!==t?(_n.prototype=dt(t),r=new _n,_n.prototype=null,r[bn]=t):r=Mn(),void 0===e?r:vn(r,e)},On=ot("unscopables"),Pn=Array.prototype;null==Pn[On]&&gt.f(Pn,On,{configurable:!0,value:xn(null)});var Sn=Ht.includes;pe({target:"Array",proto:!0},{includes:function(t){return Sn(this,t,arguments.length>1?arguments[1]:void 0)}}),function(t){Pn[On][t]=!0}("includes");var En=ot("match"),Cn=function(t){if(function(t){var e;return L(t)&&(void 0!==(e=t[En])?!!e:"RegExp"==P(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},An=function(t){if("Symbol"===be(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},jn=ot("match");pe({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[jn]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~An(C(this)).indexOf(An(Cn(t)),arguments.length>1?arguments[1]:void 0)}});var Ln=Ht.indexOf,Tn=[].indexOf,In=!!Tn&&1/[1].indexOf(1,-0)<0,Nn=ze("indexOf");pe({target:"Array",proto:!0,forced:In||!Nn},{indexOf:function(t){return In?Tn.apply(this,arguments)||0:Ln(this,t,arguments.length>1?arguments[1]:void 0)}});var Dn=function(t,e,r){var n=at(e);n in t?gt.f(t,n,x(0,r)):t[n]=r},Fn=Te("splice"),zn=Math.max,Rn=Math.min,Zn=9007199254740991,qn="Maximum allowed length exceeded";pe({target:"Array",proto:!0,forced:!Fn},{splice:function(t,e){var r,n,o,i,s,a,u=K(this),c=Xt(u),f=Qt(t,c),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=c-f):(r=l-2,n=Rn(zn(Bt(e),0),c-f)),c+r-n>Zn)throw TypeError(qn);for(o=Ee(u,n),i=0;i<n;i++)(s=f+i)in u&&Dn(o,i,u[s]);if(o.length=n,r<n){for(i=f;i<c-n;i++)a=i+r,(s=i+n)in u?u[a]=u[s]:delete u[a];for(i=c;i>c-n+r;i--)delete u[i-1]}else if(r>n)for(i=c-n;i>f;i--)a=i+r-1,(s=i+n-1)in u?u[a]=u[s]:delete u[a];for(i=0;i<r;i++)u[i+f]=arguments[i+2];return u.length=c-n+r,o}});var Gn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return dt(r),function(t){if("object"==typeof t||j(t))return t;throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Bn=function(t,e,r){var n,o;return Gn&&j(n=e.constructor)&&n!==r&&L(o=n.prototype)&&o!==r.prototype&&Gn(t,o),t},Vn=1..valueOf,Un=function(t){return Vn.call(t)},Qn="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Wn=RegExp("^"+Qn+Qn+"*"),Xn=RegExp(Qn+Qn+"*$"),Kn=function(t){return function(e){var r=An(C(e));return 1&t&&(r=r.replace(Wn,"")),2&t&&(r=r.replace(Xn,"")),r}},Hn={start:Kn(1),end:Kn(2),trim:Kn(3)},Jn=ee.f,$n=pt.f,Yn=gt.f,to=Hn.trim,eo="Number",ro=y.Number,no=ro.prototype,oo=function(t){var e=st(t,"number");return"bigint"==typeof e?e:io(e)},io=function(t){var e,r,n,o,i,s,a,u,c=st(t,"number");if(B(c))throw TypeError("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(43===(e=(c=to(c)).charCodeAt(0))||45===e){if(88===(r=c.charCodeAt(2))||120===r)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(s=(i=c.slice(2)).length,a=0;a<s;a++)if((u=i.charCodeAt(a))<48||u>o)return NaN;return parseInt(i,n)}return+c};if(le(eo,!ro(" 0o1")||!ro("0b1")||ro("+0x1"))){for(var so,ao=function(t){var e=arguments.length<1?0:ro(oo(t)),r=this;return r instanceof ao&&b((function(){Un(r)}))?Bn(Object(e),r,ao):e},uo=_?Jn(ro):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),co=0;uo.length>co;co++)J(ro,so=uo[co])&&!J(ao,so)&&Yn(ao,so,$n(ro,so));ao.prototype=no,no.constructor=ao,Zt(y,eo,ao)}var fo=function t(r,n){e(this,t),this.markers={sum:r.length};var o=n.map((function(t){return t.count})),i=o.reduce((function(t,e){return t+e}),0);this.clusters={count:n.length,markers:{mean:i/n.length,sum:i,min:Math.min.apply(Math,f(o)),max:Math.max.apply(Math,f(o))}}},lo=function(){function t(){e(this,t)}return n(t,[{key:"render",value:function(t,e){var r=t.count,n=t.position,o=r>Math.max(10,e.clusters.markers.mean)?"#ff0000":"#0000ff",i=window.btoa('\n <svg fill="'.concat(o,'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">\n <circle cx="120" cy="120" opacity=".6" r="70" />\n <circle cx="120" cy="120" opacity=".3" r="90" />\n <circle cx="120" cy="120" opacity=".2" r="110" />\n </svg>'));return new google.maps.Marker({position:n,icon:{url:"data:image/svg+xml;base64,".concat(i),scaledSize:new google.maps.Size(45,45)},label:{text:String(r),color:"rgba(255,255,255,0.9)",fontSize:"12px"},zIndex:Number(google.maps.Marker.MAX_ZINDEX)+r})}}]),t}();var ho,po=function t(){e(this,t),function(t,e){for(var r in e.prototype)t.prototype[r]=e.prototype[r]}(t,google.maps.OverlayView)};t.MarkerClustererEvents=void 0,(ho=t.MarkerClustererEvents||(t.MarkerClustererEvents={})).CLUSTERING_BEGIN="clusteringbegin",ho.CLUSTERING_END="clusteringend",ho.CLUSTER_CLICK="click";var mo=function(t,e,r){r.fitBounds(e.bounds)},go=function(r){o(s,r);var i=u(s);function s(t){var r,n=t.map,o=t.markers,a=void 0===o?[]:o,u=t.algorithm,c=void 0===u?new gn({}):u,l=t.renderer,h=void 0===l?new lo:l,p=t.onClusterClick,d=void 0===p?mo:p;return e(this,s),(r=i.call(this)).markers=f(a),r.clusters=[],r.algorithm=c,r.renderer=h,r.onClusterClick=d,n&&r.setMap(n),r}return n(s,[{key:"addMarker",value:function(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}},{key:"addMarkers",value:function(t,e){var r=this;t.forEach((function(t){r.addMarker(t,!0)})),e||this.render()}},{key:"removeMarker",value:function(t,e){var r=this.markers.indexOf(t);return-1!==r&&(t.setMap(null),this.markers.splice(r,1),e||this.render(),!0)}},{key:"removeMarkers",value:function(t,e){var r=this,n=!1;return t.forEach((function(t){n=r.removeMarker(t,!0)||n})),n&&!e&&this.render(),n}},{key:"clearMarkers",value:function(t){this.markers.length=0,t||this.render()}},{key:"render",value:function(){var e=this.getMap();if(e instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()}),n=r.clusters,o=r.changed;(o||null==o)&&(this.reset(),this.clusters=n,this.renderClusters()),google.maps.event.trigger(this,t.MarkerClustererEvents.CLUSTERING_END,this)}}},{key:"onAdd",value:function(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function(){this.markers.forEach((function(t){return t.setMap(null)})),this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function(){var e=this,r=new fo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach((function(o){1===o.markers.length?o.marker=o.markers[0]:(o.marker=e.renderer.render(o,r),e.onClusterClick&&o.marker.addListener("click",(function(r){google.maps.event.trigger(e,t.MarkerClustererEvents.CLUSTER_CLICK,o),e.onClusterClick(r,o,n)}))),o.marker.setMap(n)}))}}]),s}(po);t.AbstractAlgorithm=Ke,t.AbstractViewportAlgorithm=He,t.Cluster=Ge,t.ClusterStats=fo,t.DBScanAlgorithm=Vr,t.DefaultRenderer=lo,t.GridAlgorithm=sr,t.KmeansAlgorithm=jr,t.MarkerClusterer=go,t.NoopAlgorithm=ar,t.SuperClusterAlgorithm=gn,t.defaultOnClusterClickHandler=mo,t.distanceBetweenPoints=Ue,t.extendBoundsToPaddedViewport=Ve,t.extendPixelBounds=We,t.filterMarkersToPaddedViewport=Be,t.noop=Je,t.pixelBoundsToLatLngBounds=Xe,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.js.map
{
"name": "@googlemaps/markerclusterer",
"version": "1.0.5",
"version": "1.0.6",
"description": "Creates and manages per-zoom-level clusters for large amounts of markers.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc