!function(u){"use strict";var e;function g(t,e,i){this.extend(g,google.maps.OverlayView),this.map_=t,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var s=i||{};this.gridSize_=s.gridSize||60,this.minClusterSize_=s.minimumClusterSize||2,this.maxZoom_=s.maxZoom||null,this.styles_=s.styles||[],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.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var r=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var t=r.map_.getZoom();r.prevZoom_!=t&&(r.prevZoom_=t,r.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){r.redraw()}),e&&e.length&&this.addMarkers(e,!1)}function a(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new s(this,t.getStyles(),t.getGridSize())}function s(t,e,i){t.getMarkerClusterer().extend(s,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}u(function(){u('script[type="widgetkit/map"]').each(function(){var t=u(this),p=u("
").attr(t.data()),l=JSON.parse(this.innerHTML);t.replaceWith(p),e||(e=u.Deferred(),window.wkInitializeGoogleMapsApi=e.resolve,u.getScript("//maps.google.com/maps/api/js?callback=wkInitializeGoogleMapsApi&key="+(window.GOOGLE_MAPS_API_KEY||""))),e.promise().then(function(){var r,t,e,o,i,s=l.markers,n=[],a=window.MapsMarkerHelper||!1;Object.keys(l).forEach(function(t){isNaN(l[t])||(l[t]=Number(l[t]))}),e=s.length?new google.maps.LatLng(s[0].lat,s[0].lng):new google.maps.LatLng(-34.397,150.644),t={zoom:parseInt(l.zoom,10),center:e,streetViewControl:l.mapctrl,navigationControl:l.mapctrl,scrollwheel:l.zoomwheel,draggable:l.draggable,mapTypeId:google.maps.MapTypeId[l.maptypeid.toUpperCase()],mapTypeControl:l.maptypecontrol,zoomControl:l.zoomcontrol,disableDefaultUI:l.disabledefaultui,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU,mapTypeIds:["styled_map",google.maps.MapTypeId.ROADMAP,google.maps.MapTypeId.SATELLITE]},zoomControlOptions:{style:l.mapctrl?google.maps.ZoomControlStyle.DEFAULT:google.maps.ZoomControlStyle.SMALL}},r=new google.maps.Map(p[0],t),p.data("googlemap",r).on("display.uk.check",function(){google.maps.event.trigger(r,"resize")}),s.length&&l.directions&&(o=u('').css({padding:"5px 1px","text-decoration":"none"}),(i=u("
").css({"-webkit-background-clip":"padding-box",padding:"1px 4px",backgroundColor:"white",borderColor:"rgba(0, 0, 0, 0.14902)",borderStyle:"solid",borderWidth:"1px",cursor:"pointer",textAlign:"center",fontFamily:"Roboto, Arial, sans-serif",fontWeight:500,boxShadow:"rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px",index:1})).html(''+(l.directionsText||"Get Directions")+""),o.append(i),o.setHref=function(t,e){this.attr("href","http://maps.google.com/?daddr="+t+","+e)},r.controls[google.maps.ControlPosition.TOP_RIGHT].push(o[0])),s.length&&l.marker&&(s.forEach(function(t,e){var i,s=new google.maps.Marker({position:new google.maps.LatLng(t.lat,t.lng),map:r,title:t.title});(a&&t.icon||l.marker_icon)&&a.setIcon(s,t.icon||l.marker_icon),n.push(s),1<=l.marker&&(i=new google.maps.InfoWindow({content:t.content,maxWidth:l.popup_max_width?parseInt(l.popup_max_width,10):300}),google.maps.event.addListener(s,"click",function(){2<=l.marker&&t.content&&i.open(r,s),o&&(o.setHref(t.lat,t.lng),o.show())}),0===e&&(3===l.marker&&t.content&&i.open(r,s),o&&(o.setHref(t.lat,t.lng),o.show())))}),r.panTo(new google.maps.LatLng(s[0].lat,s[0].lng))),l.markercluster&&(this.markerCluster=new g(r,n));var h=new google.maps.StyledMapType([{featureType:"all",elementType:"all",stylers:[{invert_lightness:l.styler_invert_lightness},{hue:l.styler_hue},{saturation:l.styler_saturation},{lightness:l.styler_lightness},{gamma:l.styler_gamma}]}],{name:"Styled"});r.mapTypes.set("styled_map",h),"ROADMAP"==l.maptypeid.toUpperCase()&&r.setMapTypeId("styled_map")})})}),g.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://raw.githubusercontent.com/googlemaps/js-marker-clusterer/gh-pages/images/m",g.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",g.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},g.prototype.onAdd=function(){this.setReady_(!0)},g.prototype.draw=function(){},g.prototype.setupStyles_=function(){if(!this.styles_.length)for(var t,e=0;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})},g.prototype.fitMapToMarkers=function(){for(var t,e=this.getMarkers(),i=new google.maps.LatLngBounds,s=0;t=e[s];s++)i.extend(t.getPosition());this.map_.fitBounds(i)},g.prototype.setStyles=function(t){this.styles_=t},g.prototype.getStyles=function(){return this.styles_},g.prototype.isZoomOnClick=function(){return this.zoomOnClick_},g.prototype.isAverageCenter=function(){return this.averageCenter_},g.prototype.getMarkers=function(){return this.markers_},g.prototype.getTotalMarkers=function(){return this.markers_.length},g.prototype.setMaxZoom=function(t){this.maxZoom_=t},g.prototype.getMaxZoom=function(){return this.maxZoom_},g.prototype.calculator_=function(t,e){for(var i=0,s=t.length,r=s;0!==r;)r=parseInt(r/10,10),i++;return{text:s,index:i=Math.min(i,e)}},g.prototype.setCalculator=function(t){this.calculator_=t},g.prototype.getCalculator=function(){return this.calculator_},g.prototype.addMarkers=function(t,e){for(var i,s=0;i=t[s];s++)this.pushMarkerTo_(i);e||this.redraw()},g.prototype.pushMarkerTo_=function(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)},g.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw()},g.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i,s=0;i=this.markers_[s];s++)if(i==t){e=s;break}return-1!=e&&(t.setMap(null),this.markers_.splice(e,1),!0)},g.prototype.removeMarker=function(t,e){var i=this.removeMarker_(t);return!(e||!i)&&(this.resetViewport(),this.redraw(),!0)},g.prototype.removeMarkers=function(t,e){for(var i,s=!1,r=0;i=t[r];r++){var o=this.removeMarker_(i);s=s||o}if(!e&&s)return this.resetViewport(),this.redraw(),!0},g.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},g.prototype.getTotalClusters=function(){return this.clusters_.length},g.prototype.getMap=function(){return this.map_},g.prototype.setMap=function(t){this.map_=t},g.prototype.getGridSize=function(){return this.gridSize_},g.prototype.setGridSize=function(t){this.gridSize_=t},g.prototype.getMinClusterSize=function(){return this.minClusterSize_},g.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},g.prototype.getExtendedBounds=function(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),s=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),r=e.fromLatLngToDivPixel(i);r.x+=this.gridSize_,r.y-=this.gridSize_;var o=e.fromLatLngToDivPixel(s);o.x-=this.gridSize_,o.y+=this.gridSize_;var n=e.fromDivPixelToLatLng(r),a=e.fromDivPixelToLatLng(o);return t.extend(n),t.extend(a),t},g.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},g.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},g.prototype.resetViewport=function(t){for(var e,i=0;e=this.clusters_[i];i++)e.remove();var s;for(i=0;s=this.markers_[i];i++)s.isAdded=!1,t&&s.setMap(null);this.clusters_=[]},g.prototype.repaint=function(){var i=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var t,e=0;t=i[e];e++)t.remove()},0)},g.prototype.redraw=function(){this.createClusters_()},g.prototype.distanceBetweenPoints_=function(t,e){if(!t||!e)return 0;var i=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,r=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)))},g.prototype.addToClosestCluster_=function(t){for(var e,i=4e4,s=null,r=(t.getPosition(),0);e=this.clusters_[r];r++){var o=e.getCenter();if(o){var n=this.distanceBetweenPoints_(o,t.getPosition());n=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0},a.prototype.getMarkerClusterer=function(){return this.markerClusterer_},a.prototype.getBounds=function(){for(var t,e=new google.maps.LatLngBounds(this.center_,this.center_),i=this.getMarkers(),s=0;t=i[s];s++)e.extend(t.getPosition());return e},a.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},a.prototype.getSize=function(){return this.markers_.length},a.prototype.getMarkers=function(){return this.markers_},a.prototype.getCenter=function(){return this.center_},a.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},a.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},a.prototype.getMap=function(){return this.map_},a.prototype.updateIcon=function(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&e '},parseColor:function(e){var s,a;return"rgba("+(a=(s=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(e))?[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16),1]:(s=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(e))?[17*parseInt(s[1],16),17*parseInt(s[2],16),17*parseInt(s[3],16),1]:(s=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))?[parseInt(s[1]),parseInt(s[2]),parseInt(s[3]),1]:(s=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(e))?[parseInt(s[1],10),parseInt(s[2],10),parseInt(s[3],10),parseFloat(s[4])]:this.colors[e]||[230,88,87,1])[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},setIcon:function(e,s){function a(){e.setIcon({url:r,anchor:t})}var r,t=new google.maps.Point(11,40);if(!s.trim())return r="https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png",a();if(-1!=s.indexOf("/")){var n=new Image;n.onload=function(){r=n.src,t=new google.maps.Point(Math.ceil(n.width/2),n.height),a()},n.onerror=function(){return r="https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png",a()},n.src=s}else r="data:image/svg+xml;base64,"+btoa(this.getSVG.apply(this,s.split(" "))),t=new google.maps.Point(11,34),a()}};