!function(){var t={8545:function(t){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function DBSCAN(t,r,o,i){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,r,o,i)}DBSCAN.prototype.run=function(t,r,o,i){this._init(t,r,o,i);for(var a=0;a=this.minPts&&(r=this._mergeArrays(r,a))}1!==this._assigned[i]&&this._addToCluster(i,t)}},DBSCAN.prototype._addToCluster=function(t,r){this.clusters[r].push(t),this._assigned[t]=1},DBSCAN.prototype._regionQuery=function(t){for(var r=[],o=0;o0){for(p=0;p=0);return t},KMEANS.prototype.assign=function(){for(var t,r=!1,o=this.dataset.length,i=0;i=this.minPts)return o}},OPTICS.prototype._regionQuery=function(t,r){r=r||this.epsilon;for(var o=[],i=0,a=this.dataset.length;ia&&(o=i):r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,c=!0,l=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return c=t.done,t},e:function e(t){l=!0,u=t},f:function f(){try{c||null==o.return||o.return()}finally{if(l)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);o=0?a:-a;return i},dist:function dist(t,r,o){var i=Math.abs(t-r);return o?i:i*i}}},8662:function(t,r,o){"use strict";var i=o(1639),a=i.eudist,u=i.dist;t.exports={kmrand:function kmrand(t,r){for(var o={},i=[],a=r<<2,u=t.length,c=t[0].length>0;i.length0;){var l=t[Math.floor(Math.random()*u)],p=c?l.join("_"):"".concat(l);o[p]||(o[p]=!0,i.push(l))}if(i.length0,d=t[Math.floor(Math.random()*l)];p?d.join("_"):"".concat(d);for(c.push(d);c.length0,k=[];if(o)p="kmrand"==o?c(t,r):"kmpp"==o?l(t,r,a):o;else for(var P={},M=0;p.length',i.divClass=t.divClass,i.align=t.align,i.isDebugMode=t.debug,i.onClick=t.onClick,i.onMouseOver=t.onMouseOver,i.isBoolean=function(t){return"boolean"===typeof t},i.isNotUndefined=function(t){return"undefined"!==typeof t},i.hasContent=function(t){return t.length>0},i.isString=function(t){return"string"===typeof t},i.isFunction=function(t){return"function"===typeof t},o}return function map_google_marker_createClass(t,r,o){return r&&map_google_marker_defineProperties(t.prototype,r),o&&map_google_marker_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(GoogleMapsHtmlOverlay,[{key:"onAdd",value:function onAdd(){var t=this;t.div=document.createElement("div"),t.div.style.position="absolute",t.isNotUndefined(t.divClass)&&t.hasContent(t.divClass)&&(t.div.className=t.divClass),t.isNotUndefined(t.html)&&t.hasContent(t.html)&&t.isString(t.html)&&(t.div.innerHTML=t.html),t.isBoolean(t.isDebugMode)&&t.isDebugMode&&(t.div.className="debug-mode",t.div.innerHTML='
Debug mode
',t.div.setAttribute("style","position: absolute;border: 5px dashed red;height: 150px;width: 150px;display: flex;justify-content: center;align-items: center;")),t.getPanes().overlayMouseTarget.appendChild(t.div),google.maps.event.addDomListener(t.div,"click",(function(r){google.maps.event.trigger(t,"click"),t.isFunction(t.onClick)&&t.onClick(),r.stopPropagation()})),google.maps.event.addDomListener(t.div,"mouseover",(function(r){google.maps.event.trigger(t,"mouseover"),t.isFunction(t.onMouseOver)&&t.onMouseOver(),r.stopPropagation()}))}},{key:"draw",value:function draw(){var t=this,r=document.querySelector(".popup");r.length||(r=t.div);var o=t.getProjection();if(!o)return console.log("GoogleMapsHtmlOverlay: current map is missing"),null;var i=o.fromLatLngToDivPixel(t.getPosition()),a={y:void 0,x:void 0},u=r.offsetWidth,c=r.offsetHeight;switch(Array.isArray(t.align)?t.align.join(" "):""){case"left top":a.y=c,a.x=u;break;case"left center":a.y=c/2,a.x=u;break;case"left bottom":a.y=0,a.x=u;break;case"center top":a.y=c,a.x=u/2;break;case"center center":default:a.y=c/2,a.x=u/2;break;case"center bottom":a.y=0,a.x=u/2;break;case"right top":a.y=c,a.x=0;break;case"right center":a.y=c/2,a.x=0;break;case"right bottom":a.y=0,a.x=0}t.div.style.top="".concat(i.y-a.y,"px"),t.div.style.left="".concat(i.x-a.x,"px")}},{key:"getPosition",value:function getPosition(){return new google.maps.LatLng(this.position)}},{key:"getDiv",value:function getDiv(){return this.div}},{key:"setPosition",value:function setPosition(t,r){var o=this;o.position=t,o.align=r,o.draw()}},{key:"remove",value:function remove(){this.setMap(null),this.div.remove()}},{key:"getDraggable",value:function getDraggable(){return!1}}]),GoogleMapsHtmlOverlay}()}};function map_google_defineProperties(t,r){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:[],i=this;i.el=t,i.config=o,i.markers=[],r["init".concat(i.getName())]=function(){i.googleApiLoaded()};var a=document.createElement("script");a.src="https://maps.googleapis.com/maps/api/js?key=".concat(o.key,"&callback=init").concat(i.getName()),a.async=!0,a.defer=!0,document.head.appendChild(a)}},{key:"googleApiLoaded",value:function googleApiLoaded(){var r=this,o=r.el,i=r.config,u=o.querySelector(".mapAPI-map"),c=i.mapZoom&&"0"!==i.mapZoom?parseInt(i.mapZoom):10,l=i.center&&","!==i.center?{lat:i.center[1],lng:i.center[0]}:{lat:0,lng:0},p=i.style?i.style:null;console.log("".concat(r.getName(),": API is loaded")),r.MarkerUI=d.init(),r.map=new google.maps.Map(u,{zoom:c,center:l,fullscreenControl:!0,styles:p}),r.default_zoom=c,u.classList.add("mapboxgl-map"),r.popup=new r.MarkerUI({map:r.map,align:["center","top"],divClass:"mapboxgl-popup popup mapboxgl-popup-anchor-bottom d-none",html:'
\xd7
'}),r.popup.setMap(r.map),r.geocoder=new google.maps.Geocoder,r.cluster=new t.default(r.map,null,{styles:[{width:30,height:30,className:"mapboxgl-cluster"}]}),o.dispatchEvent(new Event(a))}},{key:"addMarker",value:function addMarker(t,r){var o=this,i={lat:t[1],lng:t[0]},a=new o.MarkerUI({position:i,map:o.map,align:["center","top"],html:'
').concat(r.icon,"
"),onClick:function onClick(){var t=document.querySelector("#Marker".concat(r.id));o.showPopup(i,r.content),t.dispatchEvent(new Event(u))}});return o.markers.push(a),o.cluster.addMarker(a),a}},{key:"showPopup",value:function showPopup(t,r){var o=this,i=o.popup.getDiv();o.config.flyToMarker&&(o.map.setCenter(t),o.config.noZoom||o.map.setZoom(18)),i.style.opacity="0",i.classList.remove("d-none"),i.querySelector(".mapboxgl-popup-content .html").innerHTML=r,i.querySelector(".mapboxgl-popup-close-button").addEventListener("click",(function(t){t.preventDefault(),o.hidePopup()})),o.popup.setPosition(t,["center","top"]),i.style.opacity="1",i.style["margin-top"]="-1rem"}},{key:"hidePopup",value:function hidePopup(){var t=this;t.popup.getDiv().classList.add("d-none"),t.config.noRestoreBounds&&!t.config.flyToBounds||t.restoreBounds(),t.el.dispatchEvent(new Event(c))}},{key:"geocode",value:function geocode(t,r){var o=this;o.geocoder.geocode({address:t},(function(t,i){if("OK"===i)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Geocode was not successful for the following reason: ").concat(i))}))}},{key:"reverseGeocode",value:function reverseGeocode(t,r){var o=this;o.geocoder.geocode({location:latlng},(function(t,i){if("OK"===i)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Reverse Geocoding was not successful for the following reason: ").concat(i))}))}},{key:"addGeoJson",value:function addGeoJson(t){var r=this,o=JSON.parse(t.geojson),i=(o.features[0].geometry.coordinates,new google.maps.LatLngBounds);o.features.forEach((function(o){var a=o.id,u=o.geometry.coordinates,c=o.properties.content;r.addMarker(u,{id:a,content:c,icon:o.icon,flyToMarker:t.flyToMarker}),i.extend({lat:u[1],lng:u[0]})})),r.markers.length>1?r.map.fitBounds(i,{padding:30}):r.markers[0]&&r.map.setCenter(r.markers[0].getPosition()),r.default_bounds=i,r.default_zoom=r.map.getZoom()}},{key:"getMap",value:function getMap(){return this.map}},{key:"getPopup",value:function getPopup(){return this.popup}},{key:"restoreBounds",value:function restoreBounds(){var t=this;t.default_bounds&&t.markers.length>1?t.map.fitBounds(t.default_bounds,{padding:30}):(t.markers[0]&&t.map.setCenter(t.markers[0].getPosition()),t.restoreZoom())}},{key:"restoreZoom",value:function restoreZoom(){this.map.setZoom(this.default_zoom)}}]),GoogleMapsDriver}();return o}(window),g={ENVS:["xs","sm","md","lg","xl","xxl","xxxl"],MAP_DRIVER:h};function map_api_defineProperties(t,r){for(var o=0;o'),console.log("".concat(u,": init ").concat(o.getName(),"...")),r.drv=o,r.el=t,r.config=l,o.init(t,l),t.addEventListener(a,(function(){r.addMarkers()}))}return function map_api_createClass(t,r,o){return r&&map_api_defineProperties(t.prototype,r),o&&map_api_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(MapAPI,[{key:"getMap",value:function getMap(){return ui.map}},{key:"dispose",value:function dispose(){this.el=null,this.el.classList.remove("".concat(u,"-active"))}},{key:"addMarkers",value:function addMarkers(){console.log("".concat(u,": addMarkers"));var t=this,r=t.el,o=t.drv,a=t.config;if(t.map=o.getMap(),a.geojson)console.log("".concat(u,": setting up geocode data")),o.addGeoJson(a);else if(a.address)console.log(a.address),console.log("".concat(u,": setting up address marker")),o.geocode(a.address,(function(r){console.log(r);var i=r[0].geometry.location.lat(),c=r[0].geometry.location.lng();console.log("".concat(u,": setting up single lat/lng marker lat: ").concat(i," lng: ").concat(c)),o.addMarker([c,i],a),t.map.setCenter({lat:i,lng:c})}));else if(a.lat&&a.lng){var c=a.lat,l=a.lng;console.log("".concat(u,": setting up single lat/lng marker lat: ").concat(c," lng: ").concat(l)),o.addMarker([l,c],a)}r.classList.add("".concat(u,"-active")),r.dispatchEvent(new Event(i)),console.log("".concat(u,": Map is loaded"))}}]),MapAPI}(),p=function init(){console.log("".concat(u,": init")),document.querySelectorAll(".".concat(u)).forEach((function(t,r){new l(t)}))};t.addEventListener("".concat(o),p),t.addEventListener("".concat(r),p)}(window)}()}();