function MarkerClusterer(e,t,r){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=e,this.markers_=[],this.clusters_=[],this.markersCluster_={},this.markersUniqueID=1,this.sizes=[53,56,66,78,90],this.styles_=[],this.cssClass_="",this.cssDefaultClass_="cluster",this.setIndex_=0,this.ready_=!1;var s=r||{};this.gridSize_=void 0!==s.gridSize?s.gridSize:60,this.minClusterSize_=s.minimumClusterSize||2,this.ignoreHiddenMarkers_=s.ignoreHiddenMarkers||!1,this.maxZoom_=s.maxZoom||null,this.styles_=s.styles||[],this.cssClass_=s.cssClass||null,this.imagePath_=s.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=s.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,null!=s.zoomOnClick&&(this.zoomOnClick_=s.zoomOnClick),this.averageCenter_=!1,null!=s.averageCenter&&(this.averageCenter_=s.averageCenter),this.onMouseoverCluster_=s.onMouseoverCluster,this.onMouseoutCluster_=s.onMouseoutCluster,this.drawCluster_=s.drawCluster,this.hideCluster_=s.hideCluster,this.showCluster_=s.showCluster,this.onAddCluster_=s.onAddCluster,this.onRemoveCluster_=s.onRemoveCluster,this.setupStyles_(),this.setMap(e),this.prevZoom_=this.map_.getZoom();var o=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var e=o.map_.getZoom();o.prevZoom_!=e&&(o.prevZoom_=e,o.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){o.redraw()}),t&&t.length&&this.addMarkers(t,!1)}function Cluster(e){this.markerClusterer_=e,this.map_=e.getMap(),this.gridSize_=e.getGridSize(),this.minClusterSize_=e.getMinClusterSize(),this.averageCenter_=e.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,e.getStyles(),e.getGridSize())}function ClusterIcon(e,t,r){e.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.styles_=t,this.padding_=r||0,this.cluster_=e,this.center_=null,this.map_=e.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}function defaultClusterOnAdd(t){if(t.div_=document.createElement("DIV"),t.visible_){var e=t.getPosFromLatLng_(t.center_);t.div_.style.cssText=t.createCss(e),t.div_.innerHTML=t.sums_.text,t.addClass()}t.getPanes().overlayMouseTarget.appendChild(t.div_);var r=!1,s=!1;google.maps.event.addDomListener(t.div_,"click",function(e){r||t.triggerClusterClick(e)}),google.maps.event.addDomListener(t.div_,"mousedown",function(){s=!(r=!1)}),google.maps.event.addDomListener(t.div_,"mouseup",function(){s=r=!1}),google.maps.event.addDomListener(t.div_,"mousemove",function(){s&&(r=!0)}),google.maps.event.addDomListener(t.div_,"mouseover",function(e){t.triggerClusterMouseover(e)}),google.maps.event.addDomListener(t.div_,"mouseout",function(e){t.triggerClusterMouseout(e)})}function defaultClusterDraw(e){if(e.visible_){var t=e.getPosFromLatLng_(e.center_);e.div_.style.top=t.y+"px",e.div_.style.left=t.x+"px"}}function defaultClusterHide(e){e.div_&&(e.div_.style.display="none",e.div_.className=""),e.visible_=!1}function defaultClusterShow(e){if(e.div_){var t=e.getPosFromLatLng_(e.center_);e.div_.style.cssText=e.createCss(t),e.div_.style.display="",e.addClass()}e.visible_=!0}function defaultClusterOnRemove(e){e.div_&&e.div_.parentNode&&(e.hide(),e.div_.parentNode.removeChild(e.div_),e.div_=null)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://raw.githubusercontent.com/gmaps-marker-clusterer/gmaps-marker-clusterer/master/images/m",MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",MarkerClusterer.prototype.extend=function(e,t){return function(e){for(var t in e.prototype)this.prototype[t]=e.prototype[t];return this}.apply(e,[t])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var e,t=0;e=this.sizes[t];t++){var r="";r="function"==typeof this.imagePath_?this.imagePath_(t,e):this.imagePath_+(t+1)+"."+this.imageExtension_,this.styles_.push({url:r,height:e,width:e})}},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var e,t=this.getMarkers(),r=new google.maps.LatLngBounds,s=0;e=t[s];s++)r.extend(e.getPosition());this.map_.fitBounds(r)},MarkerClusterer.prototype.setStyles=function(e){this.styles_=e},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.setMaxZoom=function(e){this.maxZoom_=e},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.getMarkersCluster=function(e){return this.clusters_[this.markersCluster_[e.uniqueID]]},MarkerClusterer.prototype.calculator_=function(e,t){for(var r=0,s=e.length,o=s;0!==o;)o=parseInt(o/10,10),r++;return{text:s,index:r=Math.min(r,t)}},MarkerClusterer.prototype.setCalculator=function(e){this.calculator_=e},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(e,t){for(var r,s=0;r=e[s];s++)this.pushMarkerTo_(r);t||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(e){if(e.isAdded=!1,e.draggable){var t=this;google.maps.event.addListener(e,"dragend",function(){e.isAdded=!1,t.repaint()})}e.uniqueID=this.markersUniqueID,this.markersUniqueID++,this.markers_.push(e)},MarkerClusterer.prototype.addMarker=function(e,t){this.pushMarkerTo_(e),t||this.redraw()},MarkerClusterer.prototype.removeMarker_=function(e){var t=-1;if(this.markers_.indexOf)t=this.markers_.indexOf(e);else for(var r,s=0;r=this.markers_[s];s++)if(r==e){t=s;break}return-1!=t&&(e.setMap(null),this.markers_.splice(t,1),delete this.markersCluster_[e.uniqueID],!0)},MarkerClusterer.prototype.removeMarker=function(e,t){var r=this.removeMarker_(e);return!(t||!r)&&(this.resetViewport(),this.redraw(),!0)},MarkerClusterer.prototype.removeMarkers=function(e,t){for(var r=!1,s=e.length;0<=s;s--){var o=e[s],i=this.removeMarker_(o);r=r||i}if(!t&&r)return this.resetViewport(),this.redraw(),!0},MarkerClusterer.prototype.setReady_=function(e){this.ready_||(this.ready_=e,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getClusters=function(){return this.clusters_},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(e){this.map_=e},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(e){this.gridSize_=e},MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinClusterSize=function(e){this.minClusterSize_=e},MarkerClusterer.prototype.getExtendedBounds=function(e){var t=this.getProjection(),r=new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()),s=new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()),o=t.fromLatLngToDivPixel(r);o.x+=this.gridSize_,o.y-=this.gridSize_;var i=t.fromLatLngToDivPixel(s);i.x-=this.gridSize_,i.y+=this.gridSize_;var n=t.fromDivPixelToLatLng(o),a=t.fromDivPixelToLatLng(i);return e.extend(n),e.extend(a),e},MarkerClusterer.prototype.isMarkerInBounds_=function(e,t){return t.contains(e.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[],this.markersCluster_={},this.markersUniqueID=1},MarkerClusterer.prototype.resetViewport=function(e){for(var t,r=0;t=this.clusters_[r];r++)t.remove();var s;for(r=0;s=this.markers_[r];r++)s.isAdded=!1,e&&s.setMap(null);this.clusters_=[],this.markersCluster_={},this.markersUniqueID=1},MarkerClusterer.prototype.repaint=function(){var r=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var e,t=0;e=r[t];t++)e.remove()},0)},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.distanceBetweenPoints_=function(e,t){if(!e||!t)return 0;var r=(t.lat()-e.lat())*Math.PI/180,s=(t.lng()-e.lng())*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},MarkerClusterer.prototype.addToClosestCluster_=function(e){for(var t,r=4e4,s=null,o=(e.getPosition(),null),i=0;t=this.clusters_[i];i++){var n=t.getCenter();if(n){var a=this.distanceBetweenPoints_(n,e.getPosition());a=this.minClusterSize_&&e.setMap(null),this.updateIcon(),!0},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var e,t=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),s=0;e=r[s];s++)t.extend(e.getPosition());return t},Cluster.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.calculateBounds_=function(){var e=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(e)},Cluster.prototype.isMarkerInClusterBounds=function(e){return this.bounds_.contains(e.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var e=this.map_.getZoom(),t=this.markerClusterer_.getMaxZoom();if(t&&t