webpack-bootstrap-ui-kit/dist/js/app_Site.Controllers.MapElementController.js
2021-01-31 16:57:40 +07:00

1 line
32 KiB
JavaScript

!function(){"use strict";var e={609:function(e){e.exports=jQuery}},t={};function __webpack_require__(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e=__webpack_require__(609),t=__webpack_require__.n(e),r="ajax-load",o="load",n="map-loaded",i="map-api-loaded",s="map-marker-click",a="map-popup-close",l=function extendStatics(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){function __(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var u=function __assign(){return(u=Object.assign||function __assign(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};var c=function OverlayViewSafe(){!function extend(e,t){for(var r in t.prototype)e.prototype[r]=t.prototype[r]}(OverlayViewSafe,google.maps.OverlayView)};function toCssText(e){return Object.keys(e).reduce((function(t,r){return e[r]&&t.push(r+":"+e[r]),t}),[]).join(";")}function coercePixels(e){return e?e+"px":void 0}var p=function(e){function ClusterIcon(t,r){var o=e.call(this)||this;return o.cluster_=t,o.styles_=r,o.center_=null,o.div_=null,o.sums_=null,o.visible_=!1,o.style=null,o.setMap(t.getMap()),o}return __extends(ClusterIcon,e),ClusterIcon.prototype.onAdd=function(){var e,t,r=this,o=this.cluster_.getMarkerClusterer(),n=google.maps.version.split("."),i=n[0],s=n[1],a=100*parseInt(i,10)+parseInt(s,10);this.div_=document.createElement("div"),this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",(function(){t=e})),google.maps.event.addDomListener(this.div_,"mousedown",(function(){e=!0,t=!1})),a>=332&&google.maps.event.addDomListener(this.div_,"touchstart",(function(e){e.stopPropagation()})),google.maps.event.addDomListener(this.div_,"click",(function(n){if(e=!1,!t){if(google.maps.event.trigger(o,"click",r.cluster_),google.maps.event.trigger(o,"clusterclick",r.cluster_),o.getZoomOnClick()){var i=o.getMaxZoom(),s=r.cluster_.getBounds();o.getMap().fitBounds(s),setTimeout((function(){o.getMap().fitBounds(s),null!==i&&o.getMap().getZoom()>i&&o.getMap().setZoom(i+1)}),100)}n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation()}})),google.maps.event.addDomListener(this.div_,"mouseover",(function(){google.maps.event.trigger(o,"mouseover",r.cluster_)})),google.maps.event.addDomListener(this.div_,"mouseout",(function(){google.maps.event.trigger(o,"mouseout",r.cluster_)}))},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.draw=function(){if(this.visible_){var e=this.getPosFromLatLng_(this.center_);this.div_.style.top=e.y+"px",this.div_.style.left=e.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){this.div_&&(this.div_.className=this.className_,this.div_.style.cssText=this.createCss_(this.getPosFromLatLng_(this.center_)),this.div_.innerHTML=(this.style.url?this.getImageElementHtml():"")+this.getLabelDivHtml(),"undefined"===typeof this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""),this.visible_=!0},ClusterIcon.prototype.getLabelDivHtml=function(){return'\n<div aria-label="'+this.cluster_.getMarkerClusterer().ariaLabelFn(this.sums_.text)+'" style="'+toCssText({position:"absolute",top:coercePixels(this.anchorText_[0]),left:coercePixels(this.anchorText_[1]),color:this.style.textColor,"font-size":coercePixels(this.style.textSize),"font-family":this.style.fontFamily,"font-weight":this.style.fontWeight,"font-style":this.style.fontStyle,"text-decoration":this.style.textDecoration,"text-align":"center",width:coercePixels(this.style.width),"line-height":coercePixels(this.style.textLineHeight)})+'" tabindex="0">\n <span aria-hidden="true">'+this.sums_.text+"</span>\n</div>\n"},ClusterIcon.prototype.getImageElementHtml=function(){var e=(this.style.backgroundPosition||"0 0").split(" "),t=parseInt(e[0].replace(/^\s+|\s+$/g,""),10),r=parseInt(e[1].replace(/^\s+|\s+$/g,""),10),o={};if(this.cluster_.getMarkerClusterer().getEnableRetinaIcons())o={width:coercePixels(this.style.width),height:coercePixels(this.style.height)};else{var n=[-1*r,-1*t+this.style.width,-1*r+this.style.height,-1*t];o={clip:"rect("+n[0]+"px, "+n[1]+"px, "+n[2]+"px, "+n[3]+"px)"}}var i=toCssText(u({position:"absolute",top:coercePixels(r),left:coercePixels(t)},o));return'<img alt="'+this.sums_.text+'" aria-hidden="true" src="'+this.style.url+'" style="'+i+'"/>'},ClusterIcon.prototype.useStyle=function(e){this.sums_=e;var t=Math.max(0,e.index-1);t=Math.min(this.styles_.length-1,t),this.style=this.styles_[t],this.anchorText_=this.style.anchorText||[0,0],this.anchorIcon_=this.style.anchorIcon||[Math.floor(this.style.height/2),Math.floor(this.style.width/2)],this.className_=this.cluster_.getMarkerClusterer().getClusterClass()+" "+(this.style.className||"cluster-"+t)},ClusterIcon.prototype.setCenter=function(e){this.center_=e},ClusterIcon.prototype.createCss_=function(e){return toCssText({"z-index":""+this.cluster_.getMarkerClusterer().getZIndex(),top:coercePixels(e.y),left:coercePixels(e.x),width:coercePixels(this.style.width),height:coercePixels(this.style.height),cursor:"pointer",position:"absolute","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-o-user-select":"none","user-select":"none"})},ClusterIcon.prototype.getPosFromLatLng_=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return t.x=Math.floor(t.x-this.anchorIcon_[1]),t.y=Math.floor(t.y-this.anchorIcon_[0]),t},ClusterIcon}(c),g=function(){function Cluster(e){this.markerClusterer_=e,this.map_=this.markerClusterer_.getMap(),this.minClusterSize_=this.markerClusterer_.getMinimumClusterSize(),this.averageCenter_=this.markerClusterer_.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new p(this,this.markerClusterer_.getStyles())}return Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center_,this.center_),t=this.getMarkers(),r=0;r<t.length;r++)e.extend(t[r].getPosition());return e},Cluster.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},Cluster.prototype.addMarker=function(e){if(this.isMarkerAlreadyAdded_(e))return!1;if(this.center_){if(this.averageCenter_){var t=this.markers_.length+1,r=(this.center_.lat()*(t-1)+e.getPosition().lat())/t,o=(this.center_.lng()*(t-1)+e.getPosition().lng())/t;this.center_=new google.maps.LatLng(r,o),this.calculateBounds_()}}else this.center_=e.getPosition(),this.calculateBounds_();e.isAdded=!0,this.markers_.push(e);var n=this.markers_.length,i=this.markerClusterer_.getMaxZoom();if(null!==i&&this.map_.getZoom()>i)e.getMap()!==this.map_&&e.setMap(this.map_);else if(n<this.minClusterSize_)e.getMap()!==this.map_&&e.setMap(this.map_);else if(n===this.minClusterSize_)for(var s=0;s<n;s++)this.markers_[s].setMap(null);else e.setMap(null);return!0},Cluster.prototype.isMarkerInClusterBounds=function(e){return this.bounds_.contains(e.getPosition())},Cluster.prototype.calculateBounds_=function(){var e=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(e)},Cluster.prototype.updateIcon=function(){var e=this.markers_.length,t=this.markerClusterer_.getMaxZoom();if(null!==t&&this.map_.getZoom()>t)this.clusterIcon_.hide();else if(e<this.minClusterSize_)this.clusterIcon_.hide();else{var r=this.markerClusterer_.getStyles().length,o=this.markerClusterer_.getCalculator()(this.markers_,r);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(o),this.clusterIcon_.show()}},Cluster.prototype.isMarkerAlreadyAdded_=function(e){if(this.markers_.indexOf)return-1!==this.markers_.indexOf(e);for(var t=0;t<this.markers_.length;t++)if(e===this.markers_[t])return!0;return!1},Cluster}(),h=function getOption(e,t,r){return void 0!==e[t]?e[t]:r},d=function(e){function MarkerClusterer(t,r,o){void 0===r&&(r=[]),void 0===o&&(o={});var n=e.call(this)||this;return n.options=o,n.markers_=[],n.clusters_=[],n.listeners_=[],n.activeMap_=null,n.ready_=!1,n.ariaLabelFn=n.options.ariaLabelFn||function(){return""},n.zIndex_=n.options.zIndex||google.maps.Marker.MAX_ZINDEX+1,n.gridSize_=n.options.gridSize||60,n.minClusterSize_=n.options.minimumClusterSize||2,n.maxZoom_=n.options.maxZoom||null,n.styles_=n.options.styles||[],n.title_=n.options.title||"",n.zoomOnClick_=h(n.options,"zoomOnClick",!0),n.averageCenter_=h(n.options,"averageCenter",!1),n.ignoreHidden_=h(n.options,"ignoreHidden",!1),n.enableRetinaIcons_=h(n.options,"enableRetinaIcons",!1),n.imagePath_=n.options.imagePath||MarkerClusterer.IMAGE_PATH,n.imageExtension_=n.options.imageExtension||MarkerClusterer.IMAGE_EXTENSION,n.imageSizes_=n.options.imageSizes||MarkerClusterer.IMAGE_SIZES,n.calculator_=n.options.calculator||MarkerClusterer.CALCULATOR,n.batchSize_=n.options.batchSize||MarkerClusterer.BATCH_SIZE,n.batchSizeIE_=n.options.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE,n.clusterClass_=n.options.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(n.batchSize_=n.batchSizeIE_),n.setupStyles_(),n.addMarkers(r,!0),n.setMap(t),n}return __extends(MarkerClusterer,e),MarkerClusterer.prototype.onAdd=function(){var e=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.prevZoom_=this.getMap().getZoom(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",(function(){var t=e.getMap(),r=t.minZoom||0,o=Math.min(t.maxZoom||100,t.mapTypes[t.getMapTypeId()].maxZoom),n=Math.min(Math.max(e.getMap().getZoom(),r),o);e.prevZoom_!=n&&(e.prevZoom_=n,e.resetViewport_(!1))})),google.maps.event.addListener(this.getMap(),"idle",(function(){e.redraw_()}))]},MarkerClusterer.prototype.onRemove=function(){for(var e=0;e<this.markers_.length;e++)this.markers_[e].getMap()!==this.activeMap_&&this.markers_[e].setMap(this.activeMap_);for(e=0;e<this.clusters_.length;e++)this.clusters_[e].remove();this.clusters_=[];for(e=0;e<this.listeners_.length;e++)google.maps.event.removeListener(this.listeners_[e]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!(this.styles_.length>0))for(var e=0;e<this.imageSizes_.length;e++){var t=this.imageSizes_[e];this.styles_.push(MarkerClusterer.withDefaultStyle({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t}))}},MarkerClusterer.prototype.fitMapToMarkers=function(e){for(var t=this.getMarkers(),r=new google.maps.LatLngBounds,o=0;o<t.length;o++)!t[o].getVisible()&&this.getIgnoreHidden()||r.extend(t[o].getPosition());this.getMap().fitBounds(r,e)},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(e){this.gridSize_=e},MarkerClusterer.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinimumClusterSize=function(e){this.minClusterSize_=e},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.setMaxZoom=function(e){this.maxZoom_=e},MarkerClusterer.prototype.getZIndex=function(){return this.zIndex_},MarkerClusterer.prototype.setZIndex=function(e){this.zIndex_=e},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.setStyles=function(e){this.styles_=e},MarkerClusterer.prototype.getTitle=function(){return this.title_},MarkerClusterer.prototype.setTitle=function(e){this.title_=e},MarkerClusterer.prototype.getZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.setZoomOnClick=function(e){this.zoomOnClick_=e},MarkerClusterer.prototype.getAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.setAverageCenter=function(e){this.averageCenter_=e},MarkerClusterer.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},MarkerClusterer.prototype.setIgnoreHidden=function(e){this.ignoreHidden_=e},MarkerClusterer.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},MarkerClusterer.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons_=e},MarkerClusterer.prototype.getImageExtension=function(){return this.imageExtension_},MarkerClusterer.prototype.setImageExtension=function(e){this.imageExtension_=e},MarkerClusterer.prototype.getImagePath=function(){return this.imagePath_},MarkerClusterer.prototype.setImagePath=function(e){this.imagePath_=e},MarkerClusterer.prototype.getImageSizes=function(){return this.imageSizes_},MarkerClusterer.prototype.setImageSizes=function(e){this.imageSizes_=e},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.setCalculator=function(e){this.calculator_=e},MarkerClusterer.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},MarkerClusterer.prototype.setBatchSizeIE=function(e){this.batchSizeIE_=e},MarkerClusterer.prototype.getClusterClass=function(){return this.clusterClass_},MarkerClusterer.prototype.setClusterClass=function(e){this.clusterClass_=e},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.getClusters=function(){return this.clusters_},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.addMarker=function(e,t){this.pushMarkerTo_(e),t||this.redraw_()},MarkerClusterer.prototype.addMarkers=function(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.pushMarkerTo_(e[r]);t||this.redraw_()},MarkerClusterer.prototype.pushMarkerTo_=function(e){var t=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",(function(){t.ready_&&(e.isAdded=!1,t.repaint())})),e.isAdded=!1,this.markers_.push(e)},MarkerClusterer.prototype.removeMarker=function(e,t){var r=this.removeMarker_(e);return!t&&r&&this.repaint(),r},MarkerClusterer.prototype.removeMarkers=function(e,t){for(var r=!1,o=0;o<e.length;o++){var n=this.removeMarker_(e[o]);r=r||n}return!t&&r&&this.repaint(),r},MarkerClusterer.prototype.removeMarker_=function(e){var t=-1;if(this.markers_.indexOf)t=this.markers_.indexOf(e);else for(var r=0;r<this.markers_.length;r++)if(e===this.markers_[r]){t=r;break}return-1!==t&&(e.setMap(null),this.markers_.splice(t,1),!0)},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},MarkerClusterer.prototype.repaint=function(){var e=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout((function(){for(var t=0;t<e.length;t++)e[t].remove()}),0)},MarkerClusterer.prototype.getExtendedBounds=function(e){var t=this.getProjection(),r=new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()),o=new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()),n=t.fromLatLngToDivPixel(r);n.x+=this.gridSize_,n.y-=this.gridSize_;var i=t.fromLatLngToDivPixel(o);i.x-=this.gridSize_,i.y+=this.gridSize_;var s=t.fromDivPixelToLatLng(n),a=t.fromDivPixelToLatLng(i);return e.extend(s),e.extend(a),e},MarkerClusterer.prototype.redraw_=function(){this.createClusters_(0)},MarkerClusterer.prototype.resetViewport_=function(e){for(var t=0;t<this.clusters_.length;t++)this.clusters_[t].remove();this.clusters_=[];for(t=0;t<this.markers_.length;t++){var r=this.markers_[t];r.isAdded=!1,e&&r.setMap(null)}},MarkerClusterer.prototype.distanceBetweenPoints_=function(e,t){var r=(t.lat()-e.lat())*Math.PI/180,o=(t.lng()-e.lng())*Math.PI/180,n=Math.sin(r/2)*Math.sin(r/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 6371*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))},MarkerClusterer.prototype.isMarkerInBounds_=function(e,t){return t.contains(e.getPosition())},MarkerClusterer.prototype.addToClosestCluster_=function(e){for(var t=4e4,r=null,o=0;o<this.clusters_.length;o++){var n,i=(n=this.clusters_[o]).getCenter();if(i){var s=this.distanceBetweenPoints_(i,e.getPosition());s<t&&(t=s,r=n)}}r&&r.isMarkerInClusterBounds(e)?r.addMarker(e):((n=new g(this)).addMarker(e),this.clusters_.push(n))},MarkerClusterer.prototype.createClusters_=function(e){var t=this;if(this.ready_){var r;0===e&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!==typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),r=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));for(var o=this.getExtendedBounds(r),n=Math.min(e+this.batchSize_,this.markers_.length),i=e;i<n;i++){var s=this.markers_[i];!s.isAdded&&this.isMarkerInBounds_(s,o)&&(!this.ignoreHidden_||this.ignoreHidden_&&s.getVisible())&&this.addToClosestCluster_(s)}if(n<this.markers_.length)this.timerRefStatic=window.setTimeout((function(){t.createClusters_(n)}),0);else{delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this);for(i=0;i<this.clusters_.length;i++)this.clusters_[i].updateIcon()}}},MarkerClusterer.CALCULATOR=function(e,t){for(var r=0,o=e.length,n=o;0!==n;)n=Math.floor(n/10),r++;return r=Math.min(r,t),{text:o.toString(),index:r,title:""}},MarkerClusterer.withDefaultStyle=function(e){return u({textColor:"black",textSize:11,textDecoration:"none",textLineHeight:e.height,fontWeight:"bold",fontStyle:"normal",fontFamily:"Arial,sans-serif",backgroundPosition:"0 0"},e)},MarkerClusterer.BATCH_SIZE=2e3,MarkerClusterer.BATCH_SIZE_IE=500,MarkerClusterer.IMAGE_PATH="../images/m",MarkerClusterer.IMAGE_EXTENSION="png",MarkerClusterer.IMAGE_SIZES=[53,56,66,78,90],MarkerClusterer}(c);function _typeof(e){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=function _isNativeReflectConstruct(){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(e){return!1}}();return function _createSuperInternal(){var r,o=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!==typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f={init:function init(){return function(e){!function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}(GoogleMapsHtmlOverlay,google.maps.OverlayView);var r=_createSuper(GoogleMapsHtmlOverlay);function GoogleMapsHtmlOverlay(e){var t;!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,GoogleMapsHtmlOverlay);var o=_assertThisInitialized(t=r.call(this));return o.ownerMap=e.map,o.position=e.position,o.html=e.html?e.html:'<div class="mapboxgl-marker"><i class="marker-icon fas fa-map-marker-alt"></i></div>',o.divClass=e.divClass,o.align=e.align,o.isDebugMode=e.debug,o.onClick=e.onClick,o.onMouseOver=e.onMouseOver,o.isBoolean=function(e){return"boolean"===typeof e},o.isNotUndefined=function(e){return"undefined"!==typeof e},o.hasContent=function(e){return e.length>0},o.isString=function(e){return"string"===typeof e},o.isFunction=function(e){return"function"===typeof e},t}return function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}(GoogleMapsHtmlOverlay,[{key:"onAdd",value:function onAdd(){var e=this;e.div=document.createElement("div"),e.div.style.position="absolute",e.isNotUndefined(e.divClass)&&e.hasContent(e.divClass)&&(e.div.className=e.divClass),e.isNotUndefined(e.html)&&e.hasContent(e.html)&&e.isString(e.html)&&(e.div.innerHTML=e.html),e.isBoolean(e.isDebugMode)&&e.isDebugMode&&(e.div.className="debug-mode",e.div.innerHTML='<div style="height: 10px; width: 10px; background: red; border-radius: 100%;"></div><div style="position: absolute; top: 5px; padding: 5px; width: 130px; text-align: center; font-size: 18px; text-transform: uppercase; font-weight: bolder; background: red; color: white; font-family: Arial;">Debug mode</div>',e.div.setAttribute("style","position: absolute;border: 5px dashed red;height: 150px;width: 150px;display: flex;justify-content: center;align-items: center;")),e.getPanes().overlayMouseTarget.appendChild(e.div),google.maps.event.addDomListener(e.div,"click",(function(t){google.maps.event.trigger(e,"click"),e.isFunction(e.onClick)&&e.onClick(),t.stopPropagation()})),google.maps.event.addDomListener(e.div,"mouseover",(function(t){google.maps.event.trigger(e,"mouseover"),e.isFunction(e.onMouseOver)&&e.onMouseOver(),t.stopPropagation()}))}},{key:"draw",value:function draw(){var e=this,r=t()(e.div).find(".mapboxgl-marker,.marker-pin,.mapboxgl-popup,.popup");r.length||(r=t()(e.div));var o=e.getProjection();if(!o)return console.log("GoogleMapsHtmlOverlay: current map is missing"),null;var n=o.fromLatLngToDivPixel(e.getPosition()),i={y:void 0,x:void 0},s=r.outerWidth(),a=r.outerHeight();switch(Array.isArray(e.align)?e.align.join(" "):""){case"left top":i.y=a,i.x=s;break;case"left center":i.y=a/2,i.x=s;break;case"left bottom":i.y=0,i.x=s;break;case"center top":i.y=a,i.x=s/2;break;case"center center":i.y=a/2,i.x=s/2;break;case"center bottom":i.y=0,i.x=s/2;break;case"right top":i.y=a,i.x=0;break;case"right center":i.y=a/2,i.x=0;break;case"right bottom":i.y=0,i.x=0;break;default:i.y=a/2,i.x=s/2}e.div.style.top="".concat(n.y-i.y,"px"),e.div.style.left="".concat(n.x-i.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(e,t){var r=this;r.position=e,r.align=t,r.draw()}},{key:"remove",value:function remove(){this.setMap(null),this.div.remove()}},{key:"getDraggable",value:function getDraggable(){return!1}}]),GoogleMapsHtmlOverlay}()}};function _map_google_defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var $,_={ENVS:["xs","sm","md","lg","xl","xxl","xxxl"],MAP_DRIVER:($=t(),function(){function GoogleMapsDriver(){!function _map_google_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,GoogleMapsDriver)}return function _map_google_createClass(e,t,r){return t&&_map_google_defineProperties(e.prototype,t),r&&_map_google_defineProperties(e,r),e}(GoogleMapsDriver,[{key:"getName",value:function getName(){return"GoogleMapsDriver"}},{key:"init",value:function init(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this,o=window;r.$el=e,r.config=t,r.markers=[],o["init".concat(r.getName())]=function(){r.googleApiLoaded()},$("body").append('<script async defer src="https://maps.googleapis.com/maps/api/js?key='.concat(t.key,"&callback=init").concat(r.getName(),'"><\/script>'))}},{key:"googleApiLoaded",value:function googleApiLoaded(){var e=this,t=e.$el,r=e.config,o=t.find(".mapAPI-map"),n=r.mapZoom?r.mapZoom:10,s=r.center?{lat:r.center[1],lng:r.center[0]}:{lat:0,lng:0},a=r.style?r.style:null;console.log("".concat(e.getName(),": API is loaded")),e.MarkerUI=f.init($),e.map=new google.maps.Map(o[0],{zoom:n,center:s,fullscreenControl:!0,styles:a}),e.default_zoom=n,o.addClass("mapboxgl-map"),e.popup=new e.MarkerUI({map:e.map,align:["center","top"],divClass:"mapboxgl-popup popup mapboxgl-popup-anchor-bottom d-none",html:'<div class="mapboxgl-popup-tip"></div><div class="mapboxgl-popup-content"><div class="mapboxgl-popup-close-button" type="button" aria-label="Close popup">\xd7</div><div class="html"></div></div>'}),e.popup.setMap(e.map),e.geocoder=new google.maps.Geocoder,e.cluster=new d(e.map,null,{styles:[{width:30,height:30,className:"mapboxgl-cluster"}]}),t.trigger(i)}},{key:"addMarker",value:function addMarker(e,t){var r=this,o={lat:e[1],lng:e[0]},n=new r.MarkerUI({position:o,map:r.map,align:["center","top"],html:'<div class="mapboxgl-marker"><div id="Marker'.concat(t.id,'" data-id="').concat(t.id,'" class="marker">').concat(t.icon,"</div></div>"),onClick:function onClick(){var e=$("#Marker".concat(t.id));r.showPopup(o,t.content),e.trigger(s)}});return r.markers.push(n),r.cluster.addMarker(n),n}},{key:"showPopup",value:function showPopup(e,t){var r=this,o=$(r.popup.getDiv());r.config.flyToMarker&&(r.map.setCenter(e),r.config.noZoom||r.map.setZoom(18)),o.css({opacity:"0"}),o.removeClass("d-none"),o.find(".mapboxgl-popup-content .html").html(t),o.find(".mapboxgl-popup-close-button").on("click",(function(e){e.preventDefault(),r.hidePopup()})),r.popup.setPosition(e,["center","top"]),o.css({"margin-top":"-1rem",opacity:"1"})}},{key:"hidePopup",value:function hidePopup(){var e=this;$(e.popup.getDiv()).addClass("d-none"),e.config.noRestoreBounds&&!e.config.flyToBounds||e.restoreBounds(),e.$el.trigger(a)}},{key:"geocode",value:function geocode(e,t){var r=this;r.geocoder.geocode({address:e},(function(e,o){if("OK"===o)return"function"===typeof t&&t(e),e;console.error("".concat(r.getName(),": Geocode was not successful for the following reason: ").concat(o))}))}},{key:"reverseGeocode",value:function reverseGeocode(e,t){var r=this;r.geocoder.geocode({location:latlng},(function(e,o){if("OK"===o)return"function"===typeof t&&t(e),e;console.error("".concat(r.getName(),": Reverse Geocoding was not successful for the following reason: ").concat(o))}))}},{key:"addGeoJson",value:function addGeoJson(e){var t=this,r=(e.geojson.features[0].geometry.coordinates,new google.maps.LatLngBounds);e.geojson.features.forEach((function(o){var n=o.id,i=o.geometry.coordinates,s=o.properties.content;t.addMarker(i,{id:n,content:s,icon:o.icon,flyToMarker:e.flyToMarker}),r.extend({lat:i[1],lng:i[0]})})),t.markers.length>1?t.map.fitBounds(r,{padding:30}):t.markers[0]&&t.map.setCenter(t.markers[0].getPosition()),t.default_bounds=r,t.default_zoom=t.map.getZoom()}},{key:"getMap",value:function getMap(){return this.map}},{key:"getPopup",value:function getPopup(){return this.popup}},{key:"restoreBounds",value:function restoreBounds(){var e=this;e.default_bounds&&e.markers.length>1?e.map.fitBounds(e.default_bounds,{padding:30}):(e.markers[0]&&e.map.setCenter(e.markers[0].getPosition()),e.restoreZoom())}},{key:"restoreZoom",value:function restoreZoom(){this.map.setZoom(this.default_zoom)}}]),GoogleMapsDriver}())},jQuery=__webpack_require__(609);function _ui_map_api_defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}!function($){var e="jsMapAPI",t=e,s=$("body"),a=_.MAP_DRIVER,l=window,u=function(){function MapAPI(r){!function _ui_map_api_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,MapAPI);var o=this,l=new a;o.$el=$(r);var u=o.$el,c=u.data();c.center=[c.lng?c.lng:s.data("default-lng"),c.lat?c.lat:s.data("default-lat")],c.style=c.style?jQuery.parseJSON(c.style):null,c["font-family"]=s.css("font-family"),c.icon||(c.icon='<i class="fas fa-map-marker-alt"></i>'),console.log("".concat(e,": init ").concat(l.getName(),"...")),l.init(u,c),o.drv=l,u.on(i,(function(r){if(o.map=l.getMap(),c.geojson)console.log("".concat(e,": setting up geocode data")),l.addGeoJson(c);else if(c.address)console.log(c.address),console.log("".concat(e,": setting up address marker")),l.geocode(c.address,(function(t){console.log(t);var r=t[0].geometry.location.lat(),n=t[0].geometry.location.lng();console.log("".concat(e,": setting up single lat/lng marker lat: ").concat(r," lng: ").concat(n)),l.addMarker([n,r],c),o.map.setCenter({lat:r,lng:n})}));else if(c.lat&&c.lng){var i=c.lat,s=c.lng;console.log("".concat(e,": setting up single lat/lng marker lat: ").concat(i," lng: ").concat(s)),l.addMarker([s,i],c)}u.data(t,o),u.addClass("".concat(e,"-active")),u.trigger(n),console.log("".concat(e,": Map is loaded"))}))}return function _ui_map_api_createClass(e,t,r){return t&&_ui_map_api_defineProperties(e.prototype,t),r&&_ui_map_api_defineProperties(e,r),e}(MapAPI,[{key:"getMap",value:function getMap(){return ui.map}},{key:"dispose",value:function dispose(){var r=this;r.$el=null,$.removeData(r.$el[0],t),r.$el.removeClass("".concat(e,"-active"))}}],[{key:"_jQueryInterface",value:function _jQueryInterface(){var e=this;if("undefined"!==typeof l.localStorage)return this.each((function(){var r=$(e),o=r.data(t);o||(o=new MapAPI(e),r.data(t,o))}))}}]),MapAPI}();$.fn[e]=u._jQueryInterface,$.fn[e].Constructor=u,$.fn[e].noConflict=function(){return $.fn[e]=JQUERY_NO_CONFLICT,u._jQueryInterface},$(l).on("".concat(r," ").concat(o),(function(){$(".mapAPI-map-container").jsMapAPI()}))}(t());function Site_Controllers_MapElementController_defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}!function($){var e=window,t=(document,$("body")),i="LocationUI",l=function(){function LocationUI(){!function Site_Controllers_MapElementController_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,LocationUI)}return function Site_Controllers_MapElementController_createClass(e,t,r){return t&&Site_Controllers_MapElementController_defineProperties(e.prototype,t),r&&Site_Controllers_MapElementController_defineProperties(e,r),e}(LocationUI,null,[{key:"init",value:function init(){this.dispose(),console.log("Initializing: ".concat(i))}},{key:"initMap",value:function initMap(){$(".mapAPI-map-container").find(".marker").on("".concat(s),(function(e){var r=$(e.currentTarget).data("id");t.find(".locations .location").removeClass("active"),t.find('.locations .location[data-id="'.concat(r,'"]')).addClass("active")})),t.find(".locations .location").on("click",(function(e){var r=$(e.currentTarget).data("id");t.find("#Marker".concat(r)).click()})),$(".mapAPI-map-container").on(a,(function(e){t.find(".locations .location").removeClass("active")}))}},{key:"dispose",value:function dispose(){console.log("Destroying: ".concat(i))}}]),LocationUI}();$(e).on("".concat(r," ").concat(o),(function(){l.init()})),$(e).on(n,(function(){l.initMap()}))}(t())}()}();