webpack-bootstrap-ui-kit/dist/js/app_SilverShop.Page.Checkou...

1 line
28 KiB
JavaScript

!function(){var t={821:function(t){t.exports={AJAX:"ajax-load",AJAXMAIN:"ajax-main-load",MAININIT:"main-init",TABHIDDEN:"tab-hidden",TABFOCUSED:"tab-focused",OFFLINE:"offline",ONLINE:"online",BACKONLINE:"back-online",TOUCHENABLE:"touch-enabled",TOUCHDISABLED:"touch-disabled",LOADED:"load",SWIPELEFT:"swipeleft panleft",SWIPERIGHT:"swiperight panright",ALLERTAPPEARED:"alert-appeared",ALERTREMOVED:"alert-removed",LODEDANDREADY:"load-ready",LAZYIMAGEREADY:"image-lazy-bg-loaded",LAZYIMAGESREADY:"images-lazy-loaded",MAPLOADED:"map-loaded",MAPAPILOADED:"map-api-loaded",MAPMARKERCLICK:"map-marker-click",MAPPOPUPCLOSE:"map-popup-close",SCROLL:"scroll",RESIZE:"resize",CAROUSEL_READY:"bs.carousel.ready",SET_TARGET_UPDATE:"set-target-update",RESTORE_FIELD:"restore-field",FORM_INIT_BASICS:"form-basics",FORM_INIT_STEPPED:"form-init-stepped",FORM_INIT_VALIDATE:"form-init-validate",FORM_INIT_VALIDATE_FIELD:"form-init-validate-field",FORM_INIT_STORAGE:"form-init-storage",FORM_VALIDATION_FAILED:"form-validation-failed",FORM_STEPPED_NEW_STEP:"form-new-step",FORM_STEPPED_FIRST_STEP:"form-first-step",FORM_STEPPED_LAST_STEP:"form-last-step",FORM_FIELDS:"input,textarea,select"}}},e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n](i,i.exports,o),i.exports}o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=jQuery,e=o.n(t),n=o(821),i=o.n(n);function r(t){return(r="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})(t)}function s(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(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 o,n=p(t);if(e){var i=p(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return u(this,o)}}function u(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?c(t):e}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var h={init:function(){return function(t){!function(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&&a(t,e)}(r,google.maps.OverlayView);var e,o,n,i=l(r);function r(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var o=c(e=i.call(this));return o.setMap(t.map),o.position=t.position,o.html=t.html?t.html:'<div class="mapboxgl-marker"><i class="marker-icon fas fa-map-marker-alt"></i></div>',o.divClass=t.divClass,o.align=t.align,o.isDebugMode=t.debug,o.onClick=t.onClick,o.onMouseOver=t.onMouseOver,o.isBoolean=function(t){return"boolean"===typeof t},o.isNotUndefined=function(t){return"undefined"!==typeof t},o.hasContent=function(t){return t.length>0},o.isString=function(t){return"string"===typeof t},o.isFunction=function(t){return"function"===typeof t},e}return e=r,(o=[{key:"onAdd",value:function(){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='<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>',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(e){google.maps.event.trigger(t,"click"),t.isFunction(t.onClick)&&t.onClick(),e.stopPropagation()})),google.maps.event.addDomListener(t.div,"mouseover",(function(e){google.maps.event.trigger(t,"mouseover"),t.isFunction(t.onMouseOver)&&t.onMouseOver(),e.stopPropagation()}))}},{key:"draw",value:function(){var t=this,e=$(t.div).find(".mapboxgl-marker,.marker-pin,.mapboxgl-popup,.popup");e.length||(e=$(t.div));var o=t.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(t.position)),n={y:void 0,x:void 0},i=e.outerWidth(),r=e.outerHeight();switch(Array.isArray(t.align)?t.align.join(" "):""){case"left top":n.y=r,n.x=i;break;case"left center":n.y=r/2,n.x=i;break;case"left bottom":n.y=0,n.x=i;break;case"center top":n.y=r,n.x=i/2;break;case"center center":n.y=r/2,n.x=i/2;break;case"center bottom":n.y=0,n.x=i/2;break;case"right top":n.y=r,n.x=0;break;case"right center":n.y=r/2,n.x=0;break;case"right bottom":n.y=0,n.x=0;break;default:n.y=r/2,n.x=i/2}t.div.style.top="".concat(o.y-n.y,"px"),t.div.style.left="".concat(o.x-n.x,"px")}},{key:"getPosition",value:function(){return this.position}},{key:"getDiv",value:function(){return this.div}},{key:"setPosition",value:function(t,e){var o=this;o.position=t,o.align=e,o.draw()}}])&&s(e.prototype,o),n&&s(e,n),r}()}},g=function(t,e){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)};function d(t,e){function o(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var f=function(){return(f=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var m=function t(){!function(t,e){for(var o in e.prototype)t.prototype[o]=e.prototype[o]}(t,google.maps.OverlayView)};function _(t){return Object.keys(t).reduce((function(e,o){return t[o]&&e.push(o+":"+t[o]),e}),[]).join(";")}function y(t){return t?t+"px":void 0}var v=function(t){function e(e,o){var n=t.call(this)||this;return n.cluster_=e,n.styles_=o,n.center_=null,n.div_=null,n.sums_=null,n.visible_=!1,n.style=null,n.setMap(e.getMap()),n}return d(e,t),e.prototype.onAdd=function(){var t,e,o=this,n=this.cluster_.getMarkerClusterer(),i=google.maps.version.split("."),r=i[0],s=i[1],a=100*parseInt(r,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(){e=t})),google.maps.event.addDomListener(this.div_,"mousedown",(function(){t=!0,e=!1})),a>=332&&google.maps.event.addDomListener(this.div_,"touchstart",(function(t){t.stopPropagation()})),google.maps.event.addDomListener(this.div_,"click",(function(i){if(t=!1,!e){if(google.maps.event.trigger(n,"click",o.cluster_),google.maps.event.trigger(n,"clusterclick",o.cluster_),n.getZoomOnClick()){var r=n.getMaxZoom(),s=o.cluster_.getBounds();n.getMap().fitBounds(s),setTimeout((function(){n.getMap().fitBounds(s),null!==r&&n.getMap().getZoom()>r&&n.getMap().setZoom(r+1)}),100)}i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation()}})),google.maps.event.addDomListener(this.div_,"mouseover",(function(){google.maps.event.trigger(n,"mouseover",o.cluster_)})),google.maps.event.addDomListener(this.div_,"mouseout",(function(){google.maps.event.trigger(n,"mouseout",o.cluster_)}))},e.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)},e.prototype.draw=function(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}},e.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},e.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},e.prototype.getLabelDivHtml=function(){return'\n<div aria-label="'+this.cluster_.getMarkerClusterer().ariaLabelFn(this.sums_.text)+'" style="'+_({position:"absolute",top:y(this.anchorText_[0]),left:y(this.anchorText_[1]),color:this.style.textColor,"font-size":y(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:y(this.style.width),"line-height":y(this.style.textLineHeight)})+'" tabindex="0">\n <span aria-hidden="true">'+this.sums_.text+"</span>\n</div>\n"},e.prototype.getImageElementHtml=function(){var t=(this.style.backgroundPosition||"0 0").split(" "),e=parseInt(t[0].replace(/^\s+|\s+$/g,""),10),o=parseInt(t[1].replace(/^\s+|\s+$/g,""),10),n={};if(this.cluster_.getMarkerClusterer().getEnableRetinaIcons())n={width:y(this.style.width),height:y(this.style.height)};else{var i=[-1*o,-1*e+this.style.width,-1*o+this.style.height,-1*e];n={clip:"rect("+i[0]+"px, "+i[1]+"px, "+i[2]+"px, "+i[3]+"px)"}}var r=_(f({position:"absolute",top:y(o),left:y(e)},n));return'<img alt="'+this.sums_.text+'" aria-hidden="true" src="'+this.style.url+'" style="'+r+'"/>'},e.prototype.useStyle=function(t){this.sums_=t;var e=Math.max(0,t.index-1);e=Math.min(this.styles_.length-1,e),this.style=this.styles_[e],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-"+e)},e.prototype.setCenter=function(t){this.center_=t},e.prototype.createCss_=function(t){return _({"z-index":""+this.cluster_.getMarkerClusterer().getZIndex(),top:y(t.y),left:y(t.x),width:y(this.style.width),height:y(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"})},e.prototype.getPosFromLatLng_=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x=Math.floor(e.x-this.anchorIcon_[1]),e.y=Math.floor(e.y-this.anchorIcon_[0]),e},e}(m),k=function(){function t(t){this.markerClusterer_=t,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 v(this,this.markerClusterer_.getStyles())}return t.prototype.getSize=function(){return this.markers_.length},t.prototype.getMarkers=function(){return this.markers_},t.prototype.getCenter=function(){return this.center_},t.prototype.getMap=function(){return this.map_},t.prototype.getMarkerClusterer=function(){return this.markerClusterer_},t.prototype.getBounds=function(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),o=0;o<e.length;o++)t.extend(e[o].getPosition());return t},t.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},t.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded_(t))return!1;if(this.center_){if(this.averageCenter_){var e=this.markers_.length+1,o=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(o,n),this.calculateBounds_()}}else this.center_=t.getPosition(),this.calculateBounds_();t.isAdded=!0,this.markers_.push(t);var i=this.markers_.length,r=this.markerClusterer_.getMaxZoom();if(null!==r&&this.map_.getZoom()>r)t.getMap()!==this.map_&&t.setMap(this.map_);else if(i<this.minClusterSize_)t.getMap()!==this.map_&&t.setMap(this.map_);else if(i===this.minClusterSize_)for(var s=0;s<i;s++)this.markers_[s].setMap(null);else t.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},t.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},t.prototype.updateIcon=function(){var t=this.markers_.length,e=this.markerClusterer_.getMaxZoom();if(null!==e&&this.map_.getZoom()>e)this.clusterIcon_.hide();else if(t<this.minClusterSize_)this.clusterIcon_.hide();else{var o=this.markerClusterer_.getStyles().length,n=this.markerClusterer_.getCalculator()(this.markers_,o);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(n),this.clusterIcon_.show()}},t.prototype.isMarkerAlreadyAdded_=function(t){if(this.markers_.indexOf)return-1!==this.markers_.indexOf(t);for(var e=0;e<this.markers_.length;e++)if(t===this.markers_[e])return!0;return!1},t}(),M=function(t,e,o){return void 0!==t[e]?t[e]:o};!function(t){function e(o,n,i){void 0===n&&(n=[]),void 0===i&&(i={});var r=t.call(this)||this;return r.options=i,r.markers_=[],r.clusters_=[],r.listeners_=[],r.activeMap_=null,r.ready_=!1,r.ariaLabelFn=r.options.ariaLabelFn||function(){return""},r.zIndex_=r.options.zIndex||google.maps.Marker.MAX_ZINDEX+1,r.gridSize_=r.options.gridSize||60,r.minClusterSize_=r.options.minimumClusterSize||2,r.maxZoom_=r.options.maxZoom||null,r.styles_=r.options.styles||[],r.title_=r.options.title||"",r.zoomOnClick_=M(r.options,"zoomOnClick",!0),r.averageCenter_=M(r.options,"averageCenter",!1),r.ignoreHidden_=M(r.options,"ignoreHidden",!1),r.enableRetinaIcons_=M(r.options,"enableRetinaIcons",!1),r.imagePath_=r.options.imagePath||e.IMAGE_PATH,r.imageExtension_=r.options.imageExtension||e.IMAGE_EXTENSION,r.imageSizes_=r.options.imageSizes||e.IMAGE_SIZES,r.calculator_=r.options.calculator||e.CALCULATOR,r.batchSize_=r.options.batchSize||e.BATCH_SIZE,r.batchSizeIE_=r.options.batchSizeIE||e.BATCH_SIZE_IE,r.clusterClass_=r.options.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(r.batchSize_=r.batchSizeIE_),r.setupStyles_(),r.addMarkers(n,!0),r.setMap(o),r}d(e,t),e.prototype.onAdd=function(){var t=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 e=t.getMap(),o=e.minZoom||0,n=Math.min(e.maxZoom||100,e.mapTypes[e.getMapTypeId()].maxZoom),i=Math.min(Math.max(t.getMap().getZoom(),o),n);t.prevZoom_!=i&&(t.prevZoom_=i,t.resetViewport_(!1))})),google.maps.event.addListener(this.getMap(),"idle",(function(){t.redraw_()}))]},e.prototype.onRemove=function(){for(var t=0;t<this.markers_.length;t++)this.markers_[t].getMap()!==this.activeMap_&&this.markers_[t].setMap(this.activeMap_);for(t=0;t<this.clusters_.length;t++)this.clusters_[t].remove();this.clusters_=[];for(t=0;t<this.listeners_.length;t++)google.maps.event.removeListener(this.listeners_[t]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},e.prototype.draw=function(){},e.prototype.setupStyles_=function(){if(!(this.styles_.length>0))for(var t=0;t<this.imageSizes_.length;t++){var o=this.imageSizes_[t];this.styles_.push(e.withDefaultStyle({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:o,width:o}))}},e.prototype.fitMapToMarkers=function(t){for(var e=this.getMarkers(),o=new google.maps.LatLngBounds,n=0;n<e.length;n++)!e[n].getVisible()&&this.getIgnoreHidden()||o.extend(e[n].getPosition());this.getMap().fitBounds(o,t)},e.prototype.getGridSize=function(){return this.gridSize_},e.prototype.setGridSize=function(t){this.gridSize_=t},e.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},e.prototype.setMinimumClusterSize=function(t){this.minClusterSize_=t},e.prototype.getMaxZoom=function(){return this.maxZoom_},e.prototype.setMaxZoom=function(t){this.maxZoom_=t},e.prototype.getZIndex=function(){return this.zIndex_},e.prototype.setZIndex=function(t){this.zIndex_=t},e.prototype.getStyles=function(){return this.styles_},e.prototype.setStyles=function(t){this.styles_=t},e.prototype.getTitle=function(){return this.title_},e.prototype.setTitle=function(t){this.title_=t},e.prototype.getZoomOnClick=function(){return this.zoomOnClick_},e.prototype.setZoomOnClick=function(t){this.zoomOnClick_=t},e.prototype.getAverageCenter=function(){return this.averageCenter_},e.prototype.setAverageCenter=function(t){this.averageCenter_=t},e.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},e.prototype.setIgnoreHidden=function(t){this.ignoreHidden_=t},e.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},e.prototype.setEnableRetinaIcons=function(t){this.enableRetinaIcons_=t},e.prototype.getImageExtension=function(){return this.imageExtension_},e.prototype.setImageExtension=function(t){this.imageExtension_=t},e.prototype.getImagePath=function(){return this.imagePath_},e.prototype.setImagePath=function(t){this.imagePath_=t},e.prototype.getImageSizes=function(){return this.imageSizes_},e.prototype.setImageSizes=function(t){this.imageSizes_=t},e.prototype.getCalculator=function(){return this.calculator_},e.prototype.setCalculator=function(t){this.calculator_=t},e.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},e.prototype.setBatchSizeIE=function(t){this.batchSizeIE_=t},e.prototype.getClusterClass=function(){return this.clusterClass_},e.prototype.setClusterClass=function(t){this.clusterClass_=t},e.prototype.getMarkers=function(){return this.markers_},e.prototype.getTotalMarkers=function(){return this.markers_.length},e.prototype.getClusters=function(){return this.clusters_},e.prototype.getTotalClusters=function(){return this.clusters_.length},e.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw_()},e.prototype.addMarkers=function(t,e){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&this.pushMarkerTo_(t[o]);e||this.redraw_()},e.prototype.pushMarkerTo_=function(t){var e=this;t.getDraggable()&&google.maps.event.addListener(t,"dragend",(function(){e.ready_&&(t.isAdded=!1,e.repaint())})),t.isAdded=!1,this.markers_.push(t)},e.prototype.removeMarker=function(t,e){var o=this.removeMarker_(t);return!e&&o&&this.repaint(),o},e.prototype.removeMarkers=function(t,e){for(var o=!1,n=0;n<t.length;n++){var i=this.removeMarker_(t[n]);o=o||i}return!e&&o&&this.repaint(),o},e.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var o=0;o<this.markers_.length;o++)if(t===this.markers_[o]){e=o;break}return-1!==e&&(t.setMap(null),this.markers_.splice(e,1),!0)},e.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},e.prototype.repaint=function(){var t=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout((function(){for(var e=0;e<t.length;e++)t[e].remove()}),0)},e.prototype.getExtendedBounds=function(t){var e=this.getProjection(),o=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),i=e.fromLatLngToDivPixel(o);i.x+=this.gridSize_,i.y-=this.gridSize_;var r=e.fromLatLngToDivPixel(n);r.x-=this.gridSize_,r.y+=this.gridSize_;var s=e.fromDivPixelToLatLng(i),a=e.fromDivPixelToLatLng(r);return t.extend(s),t.extend(a),t},e.prototype.redraw_=function(){this.createClusters_(0)},e.prototype.resetViewport_=function(t){for(var e=0;e<this.clusters_.length;e++)this.clusters_[e].remove();this.clusters_=[];for(e=0;e<this.markers_.length;e++){var o=this.markers_[e];o.isAdded=!1,t&&o.setMap(null)}},e.prototype.distanceBetweenPoints_=function(t,e){var o=(e.lat()-t.lat())*Math.PI/180,n=(e.lng()-t.lng())*Math.PI/180,i=Math.sin(o/2)*Math.sin(o/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(i),Math.sqrt(1-i)))},e.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},e.prototype.addToClosestCluster_=function(t){for(var e=4e4,o=null,n=0;n<this.clusters_.length;n++){var i,r=(i=this.clusters_[n]).getCenter();if(r){var s=this.distanceBetweenPoints_(r,t.getPosition());s<e&&(e=s,o=i)}}o&&o.isMarkerInClusterBounds(t)?o.addMarker(t):((i=new k(this)).addMarker(t),this.clusters_.push(i))},e.prototype.createClusters_=function(t){var e=this;if(this.ready_){var o;0===t&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!==typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),o=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 n=this.getExtendedBounds(o),i=Math.min(t+this.batchSize_,this.markers_.length),r=t;r<i;r++){var s=this.markers_[r];!s.isAdded&&this.isMarkerInBounds_(s,n)&&(!this.ignoreHidden_||this.ignoreHidden_&&s.getVisible())&&this.addToClosestCluster_(s)}if(i<this.markers_.length)this.timerRefStatic=window.setTimeout((function(){e.createClusters_(i)}),0);else{delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this);for(r=0;r<this.clusters_.length;r++)this.clusters_[r].updateIcon()}}},e.CALCULATOR=function(t,e){for(var o=0,n=t.length,i=n;0!==i;)i=Math.floor(i/10),o++;return o=Math.min(o,e),{text:n.toString(),index:o,title:""}},e.withDefaultStyle=function(t){return f({textColor:"black",textSize:11,textDecoration:"none",textLineHeight:t.height,fontWeight:"bold",fontStyle:"normal",fontFamily:"Arial,sans-serif",backgroundPosition:"0 0"},t)},e.BATCH_SIZE=2e3,e.BATCH_SIZE_IE=500,e.IMAGE_PATH="../images/m",e.IMAGE_EXTENSION="png",e.IMAGE_SIZES=[53,56,66,78,90]}(m);function b(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var x={ENVS:["xs","sm","md","lg","xl","xxl","xxxl"],MAP_DRIVER:function(t){return function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,n,r;return o=e,(n=[{key:"getName",value:function(){return"GoogleMapsDriver"}},{key:"init",value:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this,i=window;n.$el=e,n.config=o,n.markers=[],i["init".concat(n.getName())]=function(){n.googleApiLoaded()},t("body").append('<script async defer src="https://maps.googleapis.com/maps/api/js?key='.concat(o.key,"&callback=init").concat(n.getName(),'"><\/script>'))}},{key:"googleApiLoaded",value:function(){var e=this,o=e.$el,n=e.config,r=o.find(".mapAPI-map"),s=n.mapZoom?n.mapZoom:10,a=n.center?{lat:n.center[1],lng:n.center[0]}:{lat:0,lng:0},l=n.style?n.style:null;console.log("".concat(e.getName(),": API is loaded")),e.MarkerUI=h.init(t),e.map=new google.maps.Map(r[0],{zoom:s,center:a,fullscreenControl:!0,styles:l}),e.default_zoom=s,r.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.geocoder=new google.maps.Geocoder,o.trigger(i().MAPAPILOADED)}},{key:"addMarker",value:function(e,o){var n=this,r={lat:e[1],lng:e[0]},s=new n.MarkerUI({position:r,map:n.map,align:["center","top"],html:'<div class="mapboxgl-marker"><div id="Marker'.concat(o.id,'" data-id="').concat(o.id,'" class="marker">').concat(o.icon,"</div></div>"),onClick:function(){var e=t("#Marker".concat(o.id));n.showPopup(r,o.content),e.trigger(i().MAPMARKERCLICK)}});return n.markers.push(s),s}},{key:"showPopup",value:function(e,o){var n=this,i=t(n.popup.getDiv());n.config.flyToMarker&&(n.map.setCenter(e),n.config.noZoom||n.map.setZoom(18)),i.css({opacity:"0"}),i.removeClass("d-none"),i.find(".mapboxgl-popup-content .html").html(o),i.find(".mapboxgl-popup-close-button").on("click",(function(t){t.preventDefault(),n.hidePopup()})),n.popup.setPosition(e,["center","top"]),i.css({"margin-top":"-1rem",opacity:"1"})}},{key:"hidePopup",value:function(){var e=this;t(e.popup.getDiv()).addClass("d-none"),e.config.noRestoreBounds&&!e.config.flyToBounds||e.restoreBounds(),e.$el.trigger(i().MAPPOPUPCLOSE)}},{key:"geocode",value:function(t,e){var o=this;o.geocoder.geocode({address:t},(function(t,n){if("OK"===n)return"function"===typeof e&&e(t),t;console.error("".concat(o.getName(),": Geocode was not successful for the following reason: ").concat(n))}))}},{key:"reverseGeocode",value:function(t,e){var o=this;o.geocoder.geocode({location:latlng},(function(t,n){if("OK"===n)return"function"===typeof e&&e(t),t;console.error("".concat(o.getName(),": Reverse Geocoding was not successful for the following reason: ").concat(n))}))}},{key:"addGeoJson",value:function(t){var e=this,o=(t.geojson.features[0].geometry.coordinates,new google.maps.LatLngBounds);t.geojson.features.forEach((function(n){var i=n.id,r=n.geometry.coordinates,s=n.properties.content;e.addMarker(r,{id:i,content:s,icon:n.icon,flyToMarker:t.flyToMarker}),o.extend({lat:r[1],lng:r[0]})})),e.markers.length>1?e.map.fitBounds(o,{padding:30}):e.markers[0]&&e.map.setCenter(e.markers[0].getPosition()),e.default_bounds=o,e.default_zoom=e.map.getZoom()}},{key:"getMap",value:function(){return this.map}},{key:"getPopup",value:function(){return this.popup}},{key:"restoreBounds",value:function(){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(){this.map.setZoom(this.default_zoom)}}])&&b(o.prototype,n),r&&b(o,r),e}()}(e())};function C(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}!function(t){var e="jsMapAPI",o=e,n=t("body"),r=x.MAP_DRIVER,s=window,a=function(){function a(s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var l=this,u=new r;l.$el=t(s);var c=l.$el,p=c.data();p.center=[p.lng?p.lng:n.data("default-lng"),p.lat?p.lat:n.data("default-lat")],p.style=p.style?jQuery.parseJSON(p.style):null,p["font-family"]=n.css("font-family"),p.icon||(p.icon='<i class="fas fa-map-marker-alt"></i>'),console.log("".concat(e,": init ").concat(u.getName(),"...")),u.init(c,p),l.drv=u,c.on(i().MAPAPILOADED,(function(t){if(l.map=u.getMap(),p.geojson)console.log("".concat(e,": setting up geocode data")),u.addGeoJson(p);else if(p.address)console.log(p.address),console.log("".concat(e,": setting up address marker")),u.geocode(p.address,(function(t){console.log(t);var o=t[0].geometry.location.lat(),n=t[0].geometry.location.lng();console.log("".concat(e,": setting up single lat/lng marker lat: ").concat(o," lng: ").concat(n)),u.addMarker([n,o],p),l.map.setCenter({lat:o,lng:n})}));else if(p.lat&&p.lng){var n=p.lat,r=p.lng;console.log("".concat(e,": setting up single lat/lng marker lat: ").concat(n," lng: ").concat(r)),u.addMarker([r,n],p)}c.data(o,l),c.addClass("".concat(e,"-active")),c.trigger(i().MAPLOADED),console.log("".concat(e,": Map is loaded"))}))}var l,u,c;return l=a,c=[{key:"_jQueryInterface",value:function(){if("undefined"!==typeof s.localStorage)return this.each((function(){var e=t(this),n=e.data(o);n||(n=new a(this),e.data(o,n))}))}}],(u=[{key:"getMap",value:function(){return ui.map}},{key:"dispose",value:function(){var n=this;n.$el=null,t.removeData(n.$el[0],o),n.$el.removeClass("".concat(e,"-active"))}}])&&C(l.prototype,u),c&&C(l,c),a}();t.fn[e]=a._jQueryInterface,t.fn[e].Constructor=a,t.fn[e].noConflict=function(){return t.fn[e]=JQUERY_NO_CONFLICT,a._jQueryInterface},t(s).on("".concat(i().AJAX," ").concat(i().LOADED),(function(){t(".mapAPI-map-container").jsMapAPI()}))}(e())}()}();