mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
105 lines
79 KiB
JavaScript
105 lines
79 KiB
JavaScript
/*
|
||
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
||
* This devtool is neither made for production nor for readable output files.
|
||
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
||
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||
* or disable the default devtool with "devtool: false".
|
||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||
*/
|
||
/******/ (function() { // webpackBootstrap
|
||
/******/ "use strict";
|
||
/******/ var __webpack_modules__ = ({
|
||
|
||
/***/ "./src/js/types/SilverShop.Page.CheckoutPageController.js":
|
||
/*!****************************************************************************!*\
|
||
!*** ./src/js/types/SilverShop.Page.CheckoutPageController.js + 7 modules ***!
|
||
\****************************************************************************/
|
||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||
|
||
eval("// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXTERNAL MODULE: external \"jQuery\"\nvar external_jQuery_ = __webpack_require__(\"jquery\");\nvar external_jQuery_default = /*#__PURE__*/__webpack_require__.n(external_jQuery_);\n;// CONCATENATED MODULE: ./src/js/_events.js\n/**\n * Add your global events here\n */\n/* harmony default export */ var _events = ({\n AJAX: 'ajax-load',\n AJAXMAIN: 'ajax-main-load',\n MAININIT: 'main-init',\n TABHIDDEN: 'tab-hidden',\n TABFOCUSED: 'tab-focused',\n OFFLINE: 'offline',\n ONLINE: 'online',\n BACKONLINE: 'back-online',\n TOUCHENABLE: 'touch-enabled',\n TOUCHDISABLED: 'touch-disabled',\n LOADED: 'load',\n SWIPELEFT: 'swipeleft panleft',\n SWIPERIGHT: 'swiperight panright',\n ALLERTAPPEARED: 'alert-appeared',\n ALERTREMOVED: 'alert-removed',\n LODEDANDREADY: 'load-ready',\n LAZYIMAGEREADY: 'image-lazy-bg-loaded',\n LAZYIMAGESREADY: 'images-lazy-loaded',\n MAPLOADED: 'map-loaded',\n MAPAPILOADED: 'map-api-loaded',\n MAPMARKERCLICK: 'map-marker-click',\n MAPPOPUPCLOSE: 'map-popup-close',\n SCROLL: 'scroll',\n RESIZE: 'resize',\n CAROUSEL_READY: 'bs.carousel.ready',\n SET_TARGET_UPDATE: 'set-target-update',\n RESTORE_FIELD: 'restore-field',\n FORM_INIT_BASICS: 'form-basics',\n FORM_INIT_STEPPED: 'form-init-stepped',\n FORM_INIT_VALIDATE: 'form-init-validate',\n FORM_INIT_VALIDATE_FIELD: 'form-init-validate-field',\n FORM_INIT_STORAGE: 'form-init-storage',\n FORM_VALIDATION_FAILED: 'form-validation-failed',\n FORM_STEPPED_NEW_STEP: 'form-new-step',\n FORM_STEPPED_FIRST_STEP: 'form-first-step',\n FORM_STEPPED_LAST_STEP: 'form-last-step',\n FORM_FIELDS: 'input,textarea,select'\n});\n;// CONCATENATED MODULE: ./src/scss/_components/_ui.map.scss\n// extracted by mini-css-extract-plugin\n\n;// CONCATENATED MODULE: ./node_modules/.pnpm/@googlemaps/markerclustererplus@1.0.3/node_modules/@googlemaps/markerclustererplus/dist/index.esm.js\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n};\n\nfunction __extends(d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n};\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\n/**\r\n * Extends an object's prototype by another's.\r\n *\r\n * @param type1 The Type to be extended.\r\n * @param type2 The Type to extend with.\r\n * @ignore\r\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction extend(type1, type2) {\n // eslint-disable-next-line prefer-const\n for (var property in type2.prototype) {\n type1.prototype[property] = type2.prototype[property];\n }\n}\n/**\r\n * @ignore\r\n */\n\n\nvar OverlayViewSafe =\n/** @class */\nfunction () {\n function OverlayViewSafe() {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n extend(OverlayViewSafe, google.maps.OverlayView);\n }\n\n return OverlayViewSafe;\n}();\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\n/**\r\n *\r\n * @hidden\r\n */\n\n\nfunction toCssText(styles) {\n return Object.keys(styles).reduce(function (acc, key) {\n if (styles[key]) {\n acc.push(key + \":\" + styles[key]);\n }\n\n return acc;\n }, []).join(\";\");\n}\n/**\r\n *\r\n * @hidden\r\n */\n\n\nfunction coercePixels(pixels) {\n return pixels ? pixels + \"px\" : undefined;\n}\n/**\r\n * A cluster icon.\r\n */\n\n\nvar ClusterIcon =\n/** @class */\nfunction (_super) {\n __extends(ClusterIcon, _super);\n /**\r\n * @param cluster_ The cluster with which the icon is to be associated.\r\n * @param styles_ An array of {@link ClusterIconStyle} defining the cluster icons\r\n * to use for various cluster sizes.\r\n */\n\n\n function ClusterIcon(cluster_, styles_) {\n var _this = _super.call(this) || this;\n\n _this.cluster_ = cluster_;\n _this.styles_ = styles_;\n _this.center_ = null;\n _this.div_ = null;\n _this.sums_ = null;\n _this.visible_ = false;\n _this.style = null;\n\n _this.setMap(cluster_.getMap()); // Note: this causes onAdd to be called\n\n\n return _this;\n }\n /**\r\n * Adds the icon to the DOM.\r\n */\n\n\n ClusterIcon.prototype.onAdd = function () {\n var _this = this;\n\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n var mc = this.cluster_.getMarkerClusterer();\n\n var _a = google.maps.version.split(\".\"),\n major = _a[0],\n minor = _a[1];\n\n var gmVersion = parseInt(major, 10) * 100 + parseInt(minor, 10);\n this.div_ = document.createElement(\"div\");\n\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_); // Fix for Issue 157\n\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n google.maps.event.addDomListener(this.div_, \"mousedown\", function () {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n }); // March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522\n // But it doesn't work with earlier releases so do a version check.\n\n if (gmVersion >= 332) {\n // Ugly version-dependent code\n google.maps.event.addDomListener(this.div_, \"touchstart\", function (e) {\n e.stopPropagation();\n });\n }\n\n google.maps.event.addDomListener(this.div_, \"click\", function (e) {\n cMouseDownInCluster = false;\n\n if (!cDraggingMapByCluster) {\n /**\r\n * This event is fired when a cluster marker is clicked.\r\n * @name MarkerClusterer#click\r\n * @param {Cluster} c The cluster that was clicked.\r\n * @event\r\n */\n google.maps.event.trigger(mc, \"click\", _this.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", _this.cluster_); // deprecated name\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n var mz_1 = mc.getMaxZoom();\n\n var theBounds_1 = _this.cluster_.getBounds();\n\n mc.getMap().fitBounds(theBounds_1); // There is a fix for Issue 170 here:\n\n setTimeout(function () {\n mc.getMap().fitBounds(theBounds_1); // Don't zoom beyond the max zoom level\n\n if (mz_1 !== null && mc.getMap().getZoom() > mz_1) {\n mc.getMap().setZoom(mz_1 + 1);\n }\n }, 100);\n } // Prevent event propagation to the map:\n\n\n e.cancelBubble = true;\n\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n google.maps.event.addDomListener(this.div_, \"mouseover\", function () {\n /**\r\n * This event is fired when the mouse moves over a cluster marker.\r\n * @name MarkerClusterer#mouseover\r\n * @param {Cluster} c The cluster that the mouse moved over.\r\n * @event\r\n */\n google.maps.event.trigger(mc, \"mouseover\", _this.cluster_);\n });\n google.maps.event.addDomListener(this.div_, \"mouseout\", function () {\n /**\r\n * This event is fired when the mouse moves out of a cluster marker.\r\n * @name MarkerClusterer#mouseout\r\n * @param {Cluster} c The cluster that the mouse moved out of.\r\n * @event\r\n */\n google.maps.event.trigger(mc, \"mouseout\", _this.cluster_);\n });\n };\n /**\r\n * Removes the icon from the DOM.\r\n */\n\n\n ClusterIcon.prototype.onRemove = function () {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n };\n /**\r\n * Draws the icon.\r\n */\n\n\n ClusterIcon.prototype.draw = function () {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n }\n };\n /**\r\n * Hides the icon.\r\n */\n\n\n ClusterIcon.prototype.hide = function () {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n\n this.visible_ = false;\n };\n /**\r\n * Positions and shows the icon.\r\n */\n\n\n ClusterIcon.prototype.show = function () {\n if (this.div_) {\n this.div_.className = this.className_;\n this.div_.style.cssText = this.createCss_(this.getPosFromLatLng_(this.center_));\n this.div_.innerHTML = (this.style.url ? this.getImageElementHtml() : \"\") + this.getLabelDivHtml();\n\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n\n this.div_.style.display = \"\";\n }\n\n this.visible_ = true;\n };\n\n ClusterIcon.prototype.getLabelDivHtml = function () {\n var mc = this.cluster_.getMarkerClusterer();\n var ariaLabel = mc.ariaLabelFn(this.sums_.text);\n var divStyle = {\n position: \"absolute\",\n top: coercePixels(this.anchorText_[0]),\n left: coercePixels(this.anchorText_[1]),\n color: this.style.textColor,\n \"font-size\": coercePixels(this.style.textSize),\n \"font-family\": this.style.fontFamily,\n \"font-weight\": this.style.fontWeight,\n \"font-style\": this.style.fontStyle,\n \"text-decoration\": this.style.textDecoration,\n \"text-align\": \"center\",\n width: coercePixels(this.style.width),\n \"line-height\": coercePixels(this.style.textLineHeight)\n };\n return \"\\n<div aria-label=\\\"\" + ariaLabel + \"\\\" style=\\\"\" + toCssText(divStyle) + \"\\\" tabindex=\\\"0\\\">\\n <span aria-hidden=\\\"true\\\">\" + this.sums_.text + \"</span>\\n</div>\\n\";\n };\n\n ClusterIcon.prototype.getImageElementHtml = function () {\n // NOTE: values must be specified in px units\n var bp = (this.style.backgroundPosition || \"0 0\").split(\" \");\n var spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var dimensions = {};\n\n if (this.cluster_.getMarkerClusterer().getEnableRetinaIcons()) {\n dimensions = {\n width: coercePixels(this.style.width),\n height: coercePixels(this.style.height)\n };\n } else {\n var _a = [-1 * spriteV, -1 * spriteH + this.style.width, -1 * spriteV + this.style.height, -1 * spriteH],\n Y1 = _a[0],\n X1 = _a[1],\n Y2 = _a[2],\n X2 = _a[3];\n dimensions = {\n clip: \"rect(\" + Y1 + \"px, \" + X1 + \"px, \" + Y2 + \"px, \" + X2 + \"px)\"\n };\n }\n\n var cssText = toCssText(_assign({\n position: \"absolute\",\n top: coercePixels(spriteV),\n left: coercePixels(spriteH)\n }, dimensions));\n return \"<img alt=\\\"\" + this.sums_.text + \"\\\" aria-hidden=\\\"true\\\" src=\\\"\" + this.style.url + \"\\\" style=\\\"\" + cssText + \"\\\"/>\";\n };\n /**\r\n * Sets the icon styles to the appropriate element in the styles array.\r\n *\r\n * @ignore\r\n * @param sums The icon label text and styles index.\r\n */\n\n\n ClusterIcon.prototype.useStyle = function (sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n this.style = this.styles_[index];\n this.anchorText_ = this.style.anchorText || [0, 0];\n this.anchorIcon_ = this.style.anchorIcon || [Math.floor(this.style.height / 2), Math.floor(this.style.width / 2)];\n this.className_ = this.cluster_.getMarkerClusterer().getClusterClass() + \" \" + (this.style.className || \"cluster-\" + index);\n };\n /**\r\n * Sets the position at which to center the icon.\r\n *\r\n * @param center The latlng to set as the center.\r\n */\n\n\n ClusterIcon.prototype.setCenter = function (center) {\n this.center_ = center;\n };\n /**\r\n * Creates the `cssText` style parameter based on the position of the icon.\r\n *\r\n * @param pos The position of the icon.\r\n * @return The CSS style text.\r\n */\n\n\n ClusterIcon.prototype.createCss_ = function (pos) {\n return toCssText({\n \"z-index\": \"\" + this.cluster_.getMarkerClusterer().getZIndex(),\n top: coercePixels(pos.y),\n left: coercePixels(pos.x),\n width: coercePixels(this.style.width),\n height: coercePixels(this.style.height),\n cursor: \"pointer\",\n position: \"absolute\",\n \"-webkit-user-select\": \"none\",\n \"-khtml-user-select\": \"none\",\n \"-moz-user-select\": \"none\",\n \"-o-user-select\": \"none\",\n \"user-select\": \"none\"\n });\n };\n /**\r\n * Returns the position at which to place the DIV depending on the latlng.\r\n *\r\n * @param latlng The position in latlng.\r\n * @return The position in pixels.\r\n */\n\n\n ClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x = Math.floor(pos.x - this.anchorIcon_[1]);\n pos.y = Math.floor(pos.y - this.anchorIcon_[0]);\n return pos;\n };\n\n return ClusterIcon;\n}(OverlayViewSafe);\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\n/**\r\n * Creates a single cluster that manages a group of proximate markers.\r\n * Used internally, do not call this constructor directly.\r\n */\n\n\nvar Cluster =\n/** @class */\nfunction () {\n /**\r\n *\r\n * @param markerClusterer_ The `MarkerClusterer` object with which this\r\n * cluster is associated.\r\n */\n function Cluster(markerClusterer_) {\n this.markerClusterer_ = markerClusterer_;\n this.map_ = this.markerClusterer_.getMap();\n this.minClusterSize_ = this.markerClusterer_.getMinimumClusterSize();\n this.averageCenter_ = this.markerClusterer_.getAverageCenter();\n this.markers_ = []; // TODO: type;\n\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, this.markerClusterer_.getStyles());\n }\n /**\r\n * Returns the number of markers managed by the cluster. You can call this from\r\n * a `click`, `mouseover`, or `mouseout` event handler for the `MarkerClusterer` object.\r\n *\r\n * @return The number of markers in the cluster.\r\n */\n\n\n Cluster.prototype.getSize = function () {\n return this.markers_.length;\n };\n /**\r\n * Returns the array of markers managed by the cluster. You can call this from\r\n * a `click`, `mouseover`, or `mouseout` event handler for the `MarkerClusterer` object.\r\n *\r\n * @return The array of markers in the cluster.\r\n */\n\n\n Cluster.prototype.getMarkers = function () {\n return this.markers_;\n };\n /**\r\n * Returns the center of the cluster. You can call this from\r\n * a `click`, `mouseover`, or `mouseout` event handler\r\n * for the `MarkerClusterer` object.\r\n *\r\n * @return The center of the cluster.\r\n */\n\n\n Cluster.prototype.getCenter = function () {\n return this.center_;\n };\n /**\r\n * Returns the map with which the cluster is associated.\r\n *\r\n * @return The map.\r\n * @ignore\r\n */\n\n\n Cluster.prototype.getMap = function () {\n return this.map_;\n };\n /**\r\n * Returns the `MarkerClusterer` object with which the cluster is associated.\r\n *\r\n * @return The associated marker clusterer.\r\n * @ignore\r\n */\n\n\n Cluster.prototype.getMarkerClusterer = function () {\n return this.markerClusterer_;\n };\n /**\r\n * Returns the bounds of the cluster.\r\n *\r\n * @return the cluster bounds.\r\n * @ignore\r\n */\n\n\n Cluster.prototype.getBounds = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n\n for (var i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n\n return bounds;\n };\n /**\r\n * Removes the cluster from the map.\r\n *\r\n * @ignore\r\n */\n\n\n Cluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n };\n /**\r\n * Adds a marker to the cluster.\r\n *\r\n * @param marker The marker to be added.\r\n * @return True if the marker was added.\r\n * @ignore\r\n */\n\n\n Cluster.prototype.addMarker = function (marker) {\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (var i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n return true;\n };\n /**\r\n * Determines if a marker lies within the cluster's bounds.\r\n *\r\n * @param marker The marker to check.\r\n * @return True if the marker lies in the bounds.\r\n * @ignore\r\n */\n\n\n Cluster.prototype.isMarkerInClusterBounds = function (marker) {\n return this.bounds_.contains(marker.getPosition());\n };\n /**\r\n * Calculates the extended bounds of the cluster with the grid.\r\n */\n\n\n Cluster.prototype.calculateBounds_ = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n };\n /**\r\n * Updates the cluster icon.\r\n */\n\n\n Cluster.prototype.updateIcon = function () {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n };\n /**\r\n * Determines if a marker has already been added to the cluster.\r\n *\r\n * @param marker The marker to check.\r\n * @return True if the marker has already been added.\r\n */\n\n\n Cluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) !== -1;\n } else {\n for (var i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n return Cluster;\n}();\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\n/**\r\n * @ignore\r\n */\n\n\nvar getOption = function getOption(options, prop, def) {\n if (options[prop] !== undefined) {\n return options[prop];\n } else {\n return def;\n }\n};\n\nvar MarkerClusterer =\n/** @class */\nfunction (_super) {\n __extends(MarkerClusterer, _super);\n /**\r\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\r\n * @param map The Google map to attach to.\r\n * @param markers The markers to be added to the cluster.\r\n * @param options The optional parameters.\r\n */\n\n\n function MarkerClusterer(map, markers, options) {\n if (markers === void 0) {\n markers = [];\n }\n\n if (options === void 0) {\n options = {};\n }\n\n var _this = _super.call(this) || this;\n\n _this.options = options;\n _this.markers_ = [];\n _this.clusters_ = [];\n _this.listeners_ = [];\n _this.activeMap_ = null;\n _this.ready_ = false;\n\n _this.ariaLabelFn = _this.options.ariaLabelFn || function () {\n return \"\";\n };\n\n _this.zIndex_ = _this.options.zIndex || google.maps.Marker.MAX_ZINDEX + 1;\n _this.gridSize_ = _this.options.gridSize || 60;\n _this.minClusterSize_ = _this.options.minimumClusterSize || 2;\n _this.maxZoom_ = _this.options.maxZoom || null;\n _this.styles_ = _this.options.styles || [];\n _this.title_ = _this.options.title || \"\";\n _this.zoomOnClick_ = getOption(_this.options, \"zoomOnClick\", true);\n _this.averageCenter_ = getOption(_this.options, \"averageCenter\", false);\n _this.ignoreHidden_ = getOption(_this.options, \"ignoreHidden\", false);\n _this.enableRetinaIcons_ = getOption(_this.options, \"enableRetinaIcons\", false);\n _this.imagePath_ = _this.options.imagePath || MarkerClusterer.IMAGE_PATH;\n _this.imageExtension_ = _this.options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n _this.imageSizes_ = _this.options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n _this.calculator_ = _this.options.calculator || MarkerClusterer.CALCULATOR;\n _this.batchSize_ = _this.options.batchSize || MarkerClusterer.BATCH_SIZE;\n _this.batchSizeIE_ = _this.options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n _this.clusterClass_ = _this.options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n _this.batchSize_ = _this.batchSizeIE_;\n }\n\n _this.setupStyles_();\n\n _this.addMarkers(markers, true);\n\n _this.setMap(map); // Note: this causes onAdd to be called\n\n\n return _this;\n }\n /**\r\n * Implementation of the onAdd interface method.\r\n * @ignore\r\n */\n\n\n MarkerClusterer.prototype.onAdd = function () {\n var _this = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n this.repaint();\n this.prevZoom_ = this.getMap().getZoom(); // Add the map event listeners\n\n this.listeners_ = [google.maps.event.addListener(this.getMap(), \"zoom_changed\", function () {\n var map = _this.getMap(); // eslint-disable-line @typescript-eslint/no-explicit-any\n // Fix for bug #407\n // Determines map type and prevents illegal zoom levels\n\n\n var minZoom = map.minZoom || 0;\n var maxZoom = Math.min(map.maxZoom || 100, map.mapTypes[map.getMapTypeId()].maxZoom);\n var zoom = Math.min(Math.max(_this.getMap().getZoom(), minZoom), maxZoom);\n\n if (_this.prevZoom_ != zoom) {\n _this.prevZoom_ = zoom;\n\n _this.resetViewport_(false);\n }\n }), google.maps.event.addListener(this.getMap(), \"idle\", function () {\n _this.redraw_();\n })];\n };\n /**\r\n * Implementation of the onRemove interface method.\r\n * Removes map event listeners and all cluster icons from the DOM.\r\n * All managed markers are also put back on the map.\r\n * @ignore\r\n */\n\n\n MarkerClusterer.prototype.onRemove = function () {\n // Put all the managed markers back on the map:\n for (var i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n } // Remove all clusters:\n\n\n for (var i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n\n this.clusters_ = []; // Remove map event listeners:\n\n for (var i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n };\n /**\r\n * Implementation of the draw interface method.\r\n * @ignore\r\n */\n\n\n MarkerClusterer.prototype.draw = function () {};\n /**\r\n * Sets up the styles object.\r\n */\n\n\n MarkerClusterer.prototype.setupStyles_ = function () {\n if (this.styles_.length > 0) {\n return;\n }\n\n for (var i = 0; i < this.imageSizes_.length; i++) {\n var size = this.imageSizes_[i];\n this.styles_.push(MarkerClusterer.withDefaultStyle({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n }));\n }\n };\n /**\r\n * Fits the map to the bounds of the markers managed by the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.fitMapToMarkers = function (padding) {\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n\n for (var i = 0; i < markers.length; i++) {\n // March 3, 2018: Bug fix -- honor the ignoreHidden property\n if (markers[i].getVisible() || !this.getIgnoreHidden()) {\n bounds.extend(markers[i].getPosition());\n }\n }\n\n this.getMap().fitBounds(bounds, padding);\n };\n /**\r\n * Returns the value of the `gridSize` property.\r\n *\r\n * @return The grid size.\r\n */\n\n\n MarkerClusterer.prototype.getGridSize = function () {\n return this.gridSize_;\n };\n /**\r\n * Sets the value of the `gridSize` property.\r\n *\r\n * @param gridSize The grid size.\r\n */\n\n\n MarkerClusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize_ = gridSize;\n };\n /**\r\n * Returns the value of the `minimumClusterSize` property.\r\n *\r\n * @return The minimum cluster size.\r\n */\n\n\n MarkerClusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize_;\n };\n /**\r\n * Sets the value of the `minimumClusterSize` property.\r\n *\r\n * @param minimumClusterSize The minimum cluster size.\r\n */\n\n\n MarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n };\n /**\r\n * Returns the value of the `maxZoom` property.\r\n *\r\n * @return The maximum zoom level.\r\n */\n\n\n MarkerClusterer.prototype.getMaxZoom = function () {\n return this.maxZoom_;\n };\n /**\r\n * Sets the value of the `maxZoom` property.\r\n *\r\n * @param maxZoom The maximum zoom level.\r\n */\n\n\n MarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom_ = maxZoom;\n };\n\n MarkerClusterer.prototype.getZIndex = function () {\n return this.zIndex_;\n };\n\n MarkerClusterer.prototype.setZIndex = function (zIndex) {\n this.zIndex_ = zIndex;\n };\n /**\r\n * Returns the value of the `styles` property.\r\n *\r\n * @return The array of styles defining the cluster markers to be used.\r\n */\n\n\n MarkerClusterer.prototype.getStyles = function () {\n return this.styles_;\n };\n /**\r\n * Sets the value of the `styles` property.\r\n *\r\n * @param styles The array of styles to use.\r\n */\n\n\n MarkerClusterer.prototype.setStyles = function (styles) {\n this.styles_ = styles;\n };\n /**\r\n * Returns the value of the `title` property.\r\n *\r\n * @return The content of the title text.\r\n */\n\n\n MarkerClusterer.prototype.getTitle = function () {\n return this.title_;\n };\n /**\r\n * Sets the value of the `title` property.\r\n *\r\n * @param title The value of the title property.\r\n */\n\n\n MarkerClusterer.prototype.setTitle = function (title) {\n this.title_ = title;\n };\n /**\r\n * Returns the value of the `zoomOnClick` property.\r\n *\r\n * @return True if zoomOnClick property is set.\r\n */\n\n\n MarkerClusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick_;\n };\n /**\r\n * Sets the value of the `zoomOnClick` property.\r\n *\r\n * @param zoomOnClick The value of the zoomOnClick property.\r\n */\n\n\n MarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n };\n /**\r\n * Returns the value of the `averageCenter` property.\r\n *\r\n * @return True if averageCenter property is set.\r\n */\n\n\n MarkerClusterer.prototype.getAverageCenter = function () {\n return this.averageCenter_;\n };\n /**\r\n * Sets the value of the `averageCenter` property.\r\n *\r\n * @param averageCenter The value of the averageCenter property.\r\n */\n\n\n MarkerClusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter_ = averageCenter;\n };\n /**\r\n * Returns the value of the `ignoreHidden` property.\r\n *\r\n * @return True if ignoreHidden property is set.\r\n */\n\n\n MarkerClusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden_;\n };\n /**\r\n * Sets the value of the `ignoreHidden` property.\r\n *\r\n * @param ignoreHidden The value of the ignoreHidden property.\r\n */\n\n\n MarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n };\n /**\r\n * Returns the value of the `enableRetinaIcons` property.\r\n *\r\n * @return True if enableRetinaIcons property is set.\r\n */\n\n\n MarkerClusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons_;\n };\n /**\r\n * Sets the value of the `enableRetinaIcons` property.\r\n *\r\n * @param enableRetinaIcons The value of the enableRetinaIcons property.\r\n */\n\n\n MarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n };\n /**\r\n * Returns the value of the `imageExtension` property.\r\n *\r\n * @return The value of the imageExtension property.\r\n */\n\n\n MarkerClusterer.prototype.getImageExtension = function () {\n return this.imageExtension_;\n };\n /**\r\n * Sets the value of the `imageExtension` property.\r\n *\r\n * @param imageExtension The value of the imageExtension property.\r\n */\n\n\n MarkerClusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension_ = imageExtension;\n };\n /**\r\n * Returns the value of the `imagePath` property.\r\n *\r\n * @return The value of the imagePath property.\r\n */\n\n\n MarkerClusterer.prototype.getImagePath = function () {\n return this.imagePath_;\n };\n /**\r\n * Sets the value of the `imagePath` property.\r\n *\r\n * @param imagePath The value of the imagePath property.\r\n */\n\n\n MarkerClusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath_ = imagePath;\n };\n /**\r\n * Returns the value of the `imageSizes` property.\r\n *\r\n * @return The value of the imageSizes property.\r\n */\n\n\n MarkerClusterer.prototype.getImageSizes = function () {\n return this.imageSizes_;\n };\n /**\r\n * Sets the value of the `imageSizes` property.\r\n *\r\n * @param imageSizes The value of the imageSizes property.\r\n */\n\n\n MarkerClusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes_ = imageSizes;\n };\n /**\r\n * Returns the value of the `calculator` property.\r\n *\r\n * @return the value of the calculator property.\r\n */\n\n\n MarkerClusterer.prototype.getCalculator = function () {\n return this.calculator_;\n };\n /**\r\n * Sets the value of the `calculator` property.\r\n *\r\n * @param calculator The value of the calculator property.\r\n */\n\n\n MarkerClusterer.prototype.setCalculator = function (calculator) {\n this.calculator_ = calculator;\n };\n /**\r\n * Returns the value of the `batchSizeIE` property.\r\n *\r\n * @return the value of the batchSizeIE property.\r\n */\n\n\n MarkerClusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE_;\n };\n /**\r\n * Sets the value of the `batchSizeIE` property.\r\n *\r\n * @param batchSizeIE The value of the batchSizeIE property.\r\n */\n\n\n MarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n };\n /**\r\n * Returns the value of the `clusterClass` property.\r\n *\r\n * @return the value of the clusterClass property.\r\n */\n\n\n MarkerClusterer.prototype.getClusterClass = function () {\n return this.clusterClass_;\n };\n /**\r\n * Sets the value of the `clusterClass` property.\r\n *\r\n * @param clusterClass The value of the clusterClass property.\r\n */\n\n\n MarkerClusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass_ = clusterClass;\n };\n /**\r\n * Returns the array of markers managed by the clusterer.\r\n *\r\n * @return The array of markers managed by the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.getMarkers = function () {\n return this.markers_;\n };\n /**\r\n * Returns the number of markers managed by the clusterer.\r\n *\r\n * @return The number of markers.\r\n */\n\n\n MarkerClusterer.prototype.getTotalMarkers = function () {\n return this.markers_.length;\n };\n /**\r\n * Returns the current array of clusters formed by the clusterer.\r\n *\r\n * @return The array of clusters formed by the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.getClusters = function () {\n return this.clusters_;\n };\n /**\r\n * Returns the number of clusters formed by the clusterer.\r\n *\r\n * @return The number of clusters formed by the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.getTotalClusters = function () {\n return this.clusters_.length;\n };\n /**\r\n * Adds a marker to the clusterer. The clusters are redrawn unless\r\n * `nodraw` is set to `true`.\r\n *\r\n * @param marker The marker to add.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n */\n\n\n MarkerClusterer.prototype.addMarker = function (marker, nodraw) {\n this.pushMarkerTo_(marker);\n\n if (!nodraw) {\n this.redraw_();\n }\n };\n /**\r\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\r\n * `nodraw` is set to `true`.\r\n *\r\n * @param markers The markers to add.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n */\n\n\n MarkerClusterer.prototype.addMarkers = function (markers, nodraw) {\n for (var key in markers) {\n if (Object.prototype.hasOwnProperty.call(markers, key)) {\n this.pushMarkerTo_(markers[key]);\n }\n }\n\n if (!nodraw) {\n this.redraw_();\n }\n };\n /**\r\n * Pushes a marker to the clusterer.\r\n *\r\n * @param marker The marker to add.\r\n */\n\n\n MarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\n var _this = this; // If the marker is draggable add a listener so we can update the clusters on the dragend:\n\n\n if (marker.getDraggable()) {\n google.maps.event.addListener(marker, \"dragend\", function () {\n if (_this.ready_) {\n marker.isAdded = false;\n\n _this.repaint();\n }\n });\n }\n\n marker.isAdded = false;\n this.markers_.push(marker);\n };\n /**\r\n * Removes a marker from the cluster. The clusters are redrawn unless\r\n * `nodraw` is set to `true`. Returns `true` if the\r\n * marker was removed from the clusterer.\r\n *\r\n * @param marker The marker to remove.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n * @return True if the marker was removed from the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.removeMarker = function (marker, nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n };\n /**\r\n * Removes an array of markers from the cluster. The clusters are redrawn unless\r\n * `nodraw` is set to `true`. Returns `true` if markers were removed from the clusterer.\r\n *\r\n * @param markers The markers to remove.\r\n * @param nodraw Set to `true` to prevent redrawing.\r\n * @return True if markers were removed from the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.removeMarkers = function (markers, nodraw) {\n var removed = false;\n\n for (var i = 0; i < markers.length; i++) {\n var r = this.removeMarker_(markers[i]);\n removed = removed || r;\n }\n\n if (!nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n };\n /**\r\n * Removes a marker and returns true if removed, false if not.\r\n *\r\n * @param marker The marker to remove\r\n * @return Whether the marker was removed or not\r\n */\n\n\n MarkerClusterer.prototype.removeMarker_ = function (marker) {\n var index = -1;\n\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (var i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n\n return true;\n };\n /**\r\n * Removes all clusters and markers from the map and also removes all markers\r\n * managed by the clusterer.\r\n */\n\n\n MarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = [];\n };\n /**\r\n * Recalculates and redraws all the marker clusters from scratch.\r\n * Call this after changing any properties.\r\n */\n\n\n MarkerClusterer.prototype.repaint = function () {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_(); // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n\n setTimeout(function () {\n for (var i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n };\n /**\r\n * Returns the current bounds extended by the grid size.\r\n *\r\n * @param bounds The bounds to extend.\r\n * @return The extended bounds.\r\n * @ignore\r\n */\n\n\n MarkerClusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection(); // Turn the bounds into latlng.\n\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()); // Convert the points to pixels and the extend out by the grid size.\n\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_; // Convert the pixel points back to LatLng\n\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix); // Extend the bounds to contain the new bounds.\n\n bounds.extend(ne);\n bounds.extend(sw);\n return bounds;\n };\n /**\r\n * Redraws all the clusters.\r\n */\n\n\n MarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n };\n /**\r\n * Removes all clusters from the map. The markers are also removed from the map\r\n * if `hide` is set to `true`.\r\n *\r\n * @param hide Set to `true` to also remove the markers from the map.\r\n */\n\n\n MarkerClusterer.prototype.resetViewport_ = function (hide) {\n // Remove all the clusters\n for (var i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n\n this.clusters_ = []; // Reset the markers to not be added and to be removed from the map.\n\n for (var i = 0; i < this.markers_.length; i++) {\n var marker = this.markers_[i];\n marker.isAdded = false;\n\n if (hide) {\n marker.setMap(null);\n }\n }\n };\n /**\r\n * Calculates the distance between two latlng locations in km.\r\n *\r\n * @param p1 The first lat lng point.\r\n * @param p2 The second lat lng point.\r\n * @return The distance between the two points in km.\r\n * @link http://www.movable-type.co.uk/scripts/latlong.html\r\n */\n\n\n MarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n };\n /**\r\n * Determines if a marker is contained in a bounds.\r\n *\r\n * @param marker The marker to check.\r\n * @param bounds The bounds to check against.\r\n * @return True if the marker is in the bounds.\r\n */\n\n\n MarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\n return bounds.contains(marker.getPosition());\n };\n /**\r\n * Adds a marker to a cluster, or creates a new cluster.\r\n *\r\n * @param marker The marker to add.\r\n */\n\n\n MarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var distance = 40000; // Some large number\n\n var clusterToAddTo = null;\n\n for (var i = 0; i < this.clusters_.length; i++) {\n var cluster = this.clusters_[i];\n var center = cluster.getCenter();\n\n if (center) {\n var d = this.distanceBetweenPoints_(center, marker.getPosition());\n\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n var cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n };\n /**\r\n * Creates the clusters. This is done in batches to avoid timeout errors\r\n * in some browsers when there is a huge number of markers.\r\n *\r\n * @param iFirst The index of the first marker in the batch of\r\n * markers to be added to clusters.\r\n */\n\n\n MarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var _this = this;\n\n if (!this.ready_) {\n return;\n } // Cancel previous batch processing if we're working on the first batch:\n\n\n if (iFirst === 0) {\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n } // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n\n\n var mapBounds;\n\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(), this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n\n var bounds = this.getExtendedBounds(mapBounds);\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (var i = iFirst; i < iLast; i++) {\n var marker = this.markers_[i];\n\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || this.ignoreHidden_ && marker.getVisible()) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = window.setTimeout(function () {\n _this.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n google.maps.event.trigger(this, \"clusteringend\", this);\n\n for (var i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].updateIcon();\n }\n }\n };\n /**\r\n * The default function for determining the label text and style\r\n * for a cluster icon.\r\n *\r\n * @param markers The array of markers represented by the cluster.\r\n * @param numStyles The number of marker styles available.\r\n * @return The information resource for the cluster.\r\n */\n\n\n MarkerClusterer.CALCULATOR = function (markers, numStyles) {\n var index = 0;\n var count = markers.length;\n var dv = count;\n\n while (dv !== 0) {\n dv = Math.floor(dv / 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count.toString(),\n index: index,\n title: \"\"\n };\n };\n /**\r\n * Generates default styles augmented with user passed values.\r\n * Useful when you want to override some default values but keep untouched\r\n *\r\n * @param overrides override default values\r\n */\n\n\n MarkerClusterer.withDefaultStyle = function (overrides) {\n return _assign({\n textColor: \"black\",\n textSize: 11,\n textDecoration: \"none\",\n textLineHeight: overrides.height,\n fontWeight: \"bold\",\n fontStyle: \"normal\",\n fontFamily: \"Arial,sans-serif\",\n backgroundPosition: \"0 0\"\n }, overrides);\n };\n /**\r\n * The number of markers to process in one batch.\r\n */\n\n\n MarkerClusterer.BATCH_SIZE = 2000;\n /**\r\n * The number of markers to process in one batch (IE only).\r\n */\n\n MarkerClusterer.BATCH_SIZE_IE = 500;\n /**\r\n * The default root name for the marker cluster images.\r\n */\n\n MarkerClusterer.IMAGE_PATH = \"../images/m\";\n /**\r\n * The default extension name for the marker cluster images.\r\n */\n\n MarkerClusterer.IMAGE_EXTENSION = \"png\";\n /**\r\n * The default array of sizes for the marker cluster images.\r\n */\n\n MarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n return MarkerClusterer;\n}(OverlayViewSafe);\n/**\r\n * Copyright 2019 Google LLC. All Rights Reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\n\n\n/* harmony default export */ var index_esm = (MarkerClusterer);\n;// CONCATENATED MODULE: ./src/js/_components/drivers/_map.google.marker.js\n\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\nvar Obj = {\n init: function init() {\n var GoogleMapsHtmlOverlay = /*#__PURE__*/function (_google$maps$OverlayV) {\n _inherits(GoogleMapsHtmlOverlay, _google$maps$OverlayV);\n\n var _super = _createSuper(GoogleMapsHtmlOverlay);\n\n function GoogleMapsHtmlOverlay(options) {\n var _this;\n\n _classCallCheck(this, GoogleMapsHtmlOverlay);\n\n _this = _super.call(this);\n\n var ui = _assertThisInitialized(_this);\n\n ui.ownerMap = options.map; //ui.setMap(options.map);\n\n ui.position = options.position;\n ui.html = options.html ? options.html : '<div class=\"mapboxgl-marker\"><i class=\"marker-icon fas fa-map-marker-alt\"></i></div>';\n ui.divClass = options.divClass;\n ui.align = options.align;\n ui.isDebugMode = options.debug;\n ui.onClick = options.onClick;\n ui.onMouseOver = options.onMouseOver;\n\n ui.isBoolean = function (arg) {\n if (typeof arg === 'boolean') {\n return true;\n } else {\n return false;\n }\n };\n\n ui.isNotUndefined = function (arg) {\n if (typeof arg !== 'undefined') {\n return true;\n } else {\n return false;\n }\n };\n\n ui.hasContent = function (arg) {\n if (arg.length > 0) {\n return true;\n } else {\n return false;\n }\n };\n\n ui.isString = function (arg) {\n if (typeof arg === 'string') {\n return true;\n } else {\n return false;\n }\n };\n\n ui.isFunction = function (arg) {\n if (typeof arg === 'function') {\n return true;\n } else {\n return false;\n }\n };\n\n return _this;\n }\n\n _createClass(GoogleMapsHtmlOverlay, [{\n key: \"onAdd\",\n value: function onAdd() {\n var ui = this; // Create div element.\n\n ui.div = document.createElement('div');\n ui.div.style.position = 'absolute'; // Validate and set custom div class\n\n if (ui.isNotUndefined(ui.divClass) && ui.hasContent(ui.divClass)) ui.div.className = ui.divClass; // Validate and set custom HTML\n\n if (ui.isNotUndefined(ui.html) && ui.hasContent(ui.html) && ui.isString(ui.html)) ui.div.innerHTML = ui.html; // If debug mode is enabled custom content will be replaced with debug content\n\n if (ui.isBoolean(ui.isDebugMode) && ui.isDebugMode) {\n ui.div.className = 'debug-mode';\n ui.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>';\n ui.div.setAttribute('style', 'position: absolute;' + 'border: 5px dashed red;' + 'height: 150px;' + 'width: 150px;' + 'display: flex;' + 'justify-content: center;' + 'align-items: center;');\n } // Add element to clickable layer\n\n\n ui.getPanes().overlayMouseTarget.appendChild(ui.div); // Add listeners to the element.\n\n google.maps.event.addDomListener(ui.div, 'click', function (event) {\n google.maps.event.trigger(ui, 'click');\n if (ui.isFunction(ui.onClick)) ui.onClick();\n event.stopPropagation();\n });\n google.maps.event.addDomListener(ui.div, 'mouseover', function (event) {\n google.maps.event.trigger(ui, 'mouseover');\n if (ui.isFunction(ui.onMouseOver)) ui.onMouseOver();\n event.stopPropagation();\n });\n }\n }, {\n key: \"draw\",\n value: function draw() {\n var ui = this;\n var $div = external_jQuery_default()(ui.div).find('.mapboxgl-marker,.marker-pin,.mapboxgl-popup,.popup');\n\n if (!$div.length) {\n $div = external_jQuery_default()(ui.div);\n } // Calculate position of div\n\n\n var projection = ui.getProjection();\n\n if (!projection) {\n console.log('GoogleMapsHtmlOverlay: current map is missing');\n return null;\n }\n\n var positionInPixels = projection.fromLatLngToDivPixel(ui.getPosition()); // Align HTML overlay relative to original position\n\n var offset = {\n y: undefined,\n x: undefined\n };\n var divWidth = $div.outerWidth();\n var divHeight = $div.outerHeight();\n\n switch (Array.isArray(ui.align) ? ui.align.join(' ') : '') {\n case 'left top':\n offset.y = divHeight;\n offset.x = divWidth;\n break;\n\n case 'left center':\n offset.y = divHeight / 2;\n offset.x = divWidth;\n break;\n\n case 'left bottom':\n offset.y = 0;\n offset.x = divWidth;\n break;\n\n case 'center top':\n offset.y = divHeight;\n offset.x = divWidth / 2;\n break;\n\n case 'center center':\n offset.y = divHeight / 2;\n offset.x = divWidth / 2;\n break;\n\n case 'center bottom':\n offset.y = 0;\n offset.x = divWidth / 2;\n break;\n\n case 'right top':\n offset.y = divHeight;\n offset.x = 0;\n break;\n\n case 'right center':\n offset.y = divHeight / 2;\n offset.x = 0;\n break;\n\n case 'right bottom':\n offset.y = 0;\n offset.x = 0;\n break;\n\n default:\n offset.y = divHeight / 2;\n offset.x = divWidth / 2;\n break;\n } // Set position\n\n\n ui.div.style.top = \"\".concat(positionInPixels.y - offset.y, \"px\");\n ui.div.style.left = \"\".concat(positionInPixels.x - offset.x, \"px\");\n }\n }, {\n key: \"getPosition\",\n value: function getPosition() {\n var ui = this;\n return new google.maps.LatLng(ui.position);\n }\n }, {\n key: \"getDiv\",\n value: function getDiv() {\n var ui = this;\n return ui.div;\n }\n }, {\n key: \"setPosition\",\n value: function setPosition(position, align) {\n var ui = this;\n ui.position = position;\n ui.align = align;\n ui.draw();\n }\n }, {\n key: \"remove\",\n value: function remove() {\n var ui = this;\n ui.setMap(null);\n ui.div.remove();\n } // emulate google.maps.Marker functionality for compatibility (for example with @googlemaps/markerclustererplus)\n\n }, {\n key: \"getDraggable\",\n value: function getDraggable() {\n return false;\n }\n }]);\n\n return GoogleMapsHtmlOverlay;\n }(google.maps.OverlayView);\n\n return GoogleMapsHtmlOverlay;\n }\n};\n/* harmony default export */ var _map_google_marker = (Obj);\n;// CONCATENATED MODULE: ./src/js/_components/drivers/_map.google.js\n\n\nfunction _map_google_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _map_google_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _map_google_createClass(Constructor, protoProps, staticProps) { if (protoProps) _map_google_defineProperties(Constructor.prototype, protoProps); if (staticProps) _map_google_defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\n\n\nvar GoogleMapsDriver = function ($) {\n var GoogleMapsDriver = /*#__PURE__*/function () {\n function GoogleMapsDriver() {\n _map_google_classCallCheck(this, GoogleMapsDriver);\n }\n\n _map_google_createClass(GoogleMapsDriver, [{\n key: \"getName\",\n value: function getName() {\n return 'GoogleMapsDriver';\n }\n }, {\n key: \"init\",\n value: function init($el) {\n var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var ui = this;\n var W = window;\n ui.$el = $el;\n ui.config = config;\n ui.markers = [];\n\n W[\"init\".concat(ui.getName())] = function () {\n ui.googleApiLoaded();\n };\n\n $('body').append(\"<script async defer src=\\\"https://maps.googleapis.com/maps/api/js?key=\".concat(config['key'], \"&callback=init\").concat(ui.getName(), \"\\\"></script>\"));\n }\n }, {\n key: \"googleApiLoaded\",\n value: function googleApiLoaded() {\n var ui = this;\n var $el = ui.$el;\n var config = ui.config;\n var $mapDiv = $el.find('.mapAPI-map');\n var zoom = config['mapZoom'] ? config['mapZoom'] : 10;\n var center = config['center'] ? {\n lat: config['center'][1],\n lng: config['center'][0]\n } : {\n lat: 0,\n lng: 0\n };\n var style = config['style'] ? config['style'] : null;\n console.log(\"\".concat(ui.getName(), \": API is loaded\")); // init fontawesome icons\n\n ui.MarkerUI = _map_google_marker.init($);\n ui.map = new google.maps.Map($mapDiv[0], {\n zoom: zoom,\n center: center,\n fullscreenControl: true,\n styles: style\n });\n ui.default_zoom = zoom;\n $mapDiv.addClass('mapboxgl-map');\n ui.popup = new ui.MarkerUI({\n map: ui.map,\n align: ['center', 'top'],\n divClass: 'mapboxgl-popup popup mapboxgl-popup-anchor-bottom d-none',\n html: '<div class=\"mapboxgl-popup-tip\"></div><div class=\"mapboxgl-popup-content\">' + '<div class=\"mapboxgl-popup-close-button\" type=\"button\" aria-label=\"Close popup\">×</div>' + '<div class=\"html\"></div>' + '</div>'\n });\n ui.popup.setMap(ui.map);\n ui.geocoder = new google.maps.Geocoder();\n ui.cluster = new index_esm(ui.map, null, {\n styles: [{\n width: 30,\n height: 30,\n className: 'mapboxgl-cluster'\n }]\n });\n $el.trigger(_events.MAPAPILOADED);\n }\n }, {\n key: \"addMarker\",\n value: function addMarker(crds, config) {\n var ui = this;\n var pos = {\n lat: crds[1],\n lng: crds[0]\n };\n var marker = new ui.MarkerUI({\n position: pos,\n map: ui.map,\n align: ['center', 'top'],\n html: \"<div class=\\\"mapboxgl-marker\\\"><div id=\\\"Marker\".concat(config['id'], \"\\\" data-id=\\\"\").concat(config['id'], \"\\\" class=\\\"marker\\\">\").concat(config['icon'], \"</div></div>\"),\n onClick: function onClick() {\n var $el = $(\"#Marker\".concat(config['id']));\n ui.showPopup(pos, config['content']);\n $el.trigger(_events.MAPMARKERCLICK);\n }\n });\n ui.markers.push(marker);\n ui.cluster.addMarker(marker);\n return marker;\n }\n }, {\n key: \"showPopup\",\n value: function showPopup(pos, content) {\n var ui = this;\n var $popup = $(ui.popup.getDiv());\n\n if (ui.config['flyToMarker']) {\n ui.map.setCenter(pos); // panTo\n\n if (!ui.config['noZoom']) {\n ui.map.setZoom(18);\n }\n } // keep it hidden to render content\n\n\n $popup.css({\n opacity: '0'\n });\n $popup.removeClass('d-none');\n $popup.find('.mapboxgl-popup-content .html').html(content);\n $popup.find('.mapboxgl-popup-close-button').on('click', function (e) {\n e.preventDefault();\n ui.hidePopup();\n }); // set position when content was rendered\n\n ui.popup.setPosition(pos, ['center', 'top']); // display popup\n\n $popup.css({\n 'margin-top': '-1rem',\n opacity: '1'\n });\n }\n }, {\n key: \"hidePopup\",\n value: function hidePopup() {\n var ui = this;\n var $popup = $(ui.popup.getDiv());\n $popup.addClass('d-none');\n\n if (!ui.config['noRestoreBounds'] || ui.config['flyToBounds']) {\n ui.restoreBounds();\n }\n\n ui.$el.trigger(_events.MAPPOPUPCLOSE);\n }\n }, {\n key: \"geocode\",\n value: function geocode(addr, callback) {\n var ui = this;\n ui.geocoder.geocode({\n address: addr\n }, function (results, status) {\n if (status === 'OK') {\n //results[0].geometry.location;\n if (typeof callback === 'function') {\n callback(results);\n }\n\n return results;\n } else {\n console.error(\"\".concat(ui.getName(), \": Geocode was not successful for the following reason: \").concat(status));\n }\n });\n }\n }, {\n key: \"reverseGeocode\",\n value: function reverseGeocode(latLng, callback) {\n var ui = this;\n ui.geocoder.geocode({\n location: latlng\n }, function (results, status) {\n if (status === 'OK') {\n //results[0].formatted_address;\n if (typeof callback === 'function') {\n callback(results);\n }\n\n return results;\n } else {\n console.error(\"\".concat(ui.getName(), \": Reverse Geocoding was not successful for the following reason: \").concat(status));\n }\n });\n }\n }, {\n key: \"addGeoJson\",\n value: function addGeoJson(config) {\n var ui = this;\n var firstMarker = config['geojson'].features[0].geometry.coordinates; //Map.setCenter(firstMarker);\n\n var bounds = new google.maps.LatLngBounds(); // add markers to map\n\n config['geojson'].features.forEach(function (marker) {\n var id = marker.id;\n var crds = marker.geometry.coordinates;\n var content = marker.properties.content;\n ui.addMarker(crds, {\n id: id,\n content: content,\n icon: marker.icon,\n flyToMarker: config['flyToMarker']\n });\n bounds.extend({\n lat: crds[1],\n lng: crds[0]\n });\n });\n\n if (ui.markers.length > 1) {\n ui.map.fitBounds(bounds, {\n padding: 30\n }); //panToBounds\n } else if (ui.markers[0]) {\n ui.map.setCenter(ui.markers[0].getPosition());\n }\n\n ui.default_bounds = bounds;\n ui.default_zoom = ui.map.getZoom();\n }\n }, {\n key: \"getMap\",\n value: function getMap() {\n var ui = this;\n return ui.map;\n }\n }, {\n key: \"getPopup\",\n value: function getPopup() {\n var ui = this;\n return ui.popup;\n }\n }, {\n key: \"restoreBounds\",\n value: function restoreBounds() {\n var ui = this;\n\n if (ui.default_bounds && ui.markers.length > 1) {\n ui.map.fitBounds(ui.default_bounds, {\n padding: 30\n }); //panToBounds\n } else {\n if (ui.markers[0]) {\n ui.map.setCenter(ui.markers[0].getPosition());\n }\n\n ui.restoreZoom();\n }\n }\n }, {\n key: \"restoreZoom\",\n value: function restoreZoom() {\n var ui = this;\n ui.map.setZoom(ui.default_zoom);\n }\n }]);\n\n return GoogleMapsDriver;\n }();\n\n return GoogleMapsDriver;\n}((external_jQuery_default()));\n\n/* harmony default export */ var _map_google = (GoogleMapsDriver);\n;// CONCATENATED MODULE: ./src/js/_consts.js\n/**\n * Add your global events here\n */\n //import MAP_DRIVER from './_components/drivers/_map.mapbox';\n\nvar CONSTS = {\n ENVS: ['xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl'],\n MAP_DRIVER: _map_google\n};\n/* harmony default export */ var _consts = (CONSTS);\n;// CONCATENATED MODULE: ./src/js/_components/_ui.map.api.js\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"jquery\");\n\n\nfunction _ui_map_api_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _ui_map_api_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _ui_map_api_createClass(Constructor, protoProps, staticProps) { if (protoProps) _ui_map_api_defineProperties(Constructor.prototype, protoProps); if (staticProps) _ui_map_api_defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\n\n\n\nvar MapAPI = function ($) {\n // Constants\n var NAME = 'jsMapAPI';\n var DATA_KEY = NAME;\n var $BODY = $('body');\n var MAP_DRIVER = _consts.MAP_DRIVER;\n var W = window;\n\n var MapAPI = /*#__PURE__*/function () {\n // Constructor\n function MapAPI(el) {\n _ui_map_api_classCallCheck(this, MapAPI);\n\n var ui = this;\n var Drv = new MAP_DRIVER();\n ui.$el = $(el);\n var $el = ui.$el;\n var config = $el.data();\n config['center'] = [config['lng'] ? config['lng'] : $BODY.data('default-lng'), config['lat'] ? config['lat'] : $BODY.data('default-lat')];\n config['style'] = config['style'] ? jQuery.parseJSON(config['style']) : null;\n config['font-family'] = $BODY.css('font-family');\n\n if (!config['icon']) {\n config['icon'] = '<i class=\"fas fa-map-marker-alt\"></i>';\n }\n\n console.log(\"\".concat(NAME, \": init \").concat(Drv.getName(), \"...\"));\n Drv.init($el, config);\n ui.drv = Drv;\n $el.on(_events.MAPAPILOADED, function (e) {\n ui.map = Drv.getMap();\n\n if (config['geojson']) {\n console.log(\"\".concat(NAME, \": setting up geocode data\"));\n Drv.addGeoJson(config);\n } else if (config['address']) {\n console.log(config['address']);\n console.log(\"\".concat(NAME, \": setting up address marker\"));\n Drv.geocode(config['address'], function (results) {\n console.log(results);\n var lat = results[0].geometry.location.lat();\n var lng = results[0].geometry.location.lng();\n console.log(\"\".concat(NAME, \": setting up single lat/lng marker lat: \").concat(lat, \" lng: \").concat(lng));\n Drv.addMarker([lng, lat], config);\n ui.map.setCenter({\n lat: lat,\n lng: lng\n });\n });\n } else if (config['lat'] && config['lng']) {\n var lat = config['lat'];\n var lng = config['lng'];\n console.log(\"\".concat(NAME, \": setting up single lat/lng marker lat: \").concat(lat, \" lng: \").concat(lng));\n Drv.addMarker([lng, lat], config);\n }\n\n $el.data(DATA_KEY, ui);\n $el.addClass(\"\".concat(NAME, \"-active\"));\n $el.trigger(_events.MAPLOADED);\n console.log(\"\".concat(NAME, \": Map is loaded\"));\n });\n } // Public methods\n\n\n _ui_map_api_createClass(MapAPI, [{\n key: \"getMap\",\n value: function getMap() {\n return ui.map;\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n var ui = this;\n ui.$el = null;\n $.removeData(ui.$el[0], DATA_KEY);\n ui.$el.removeClass(\"\".concat(NAME, \"-active\"));\n }\n }], [{\n key: \"_jQueryInterface\",\n value: function _jQueryInterface() {\n var _this = this;\n\n if (typeof W.localStorage !== 'undefined') {\n return this.each(function () {\n // attach functionality to el\n var $el = $(_this);\n var data = $el.data(DATA_KEY);\n\n if (!data) {\n data = new MapAPI(_this);\n $el.data(DATA_KEY, data);\n }\n });\n }\n }\n }]);\n\n return MapAPI;\n }(); // jQuery interface\n\n\n $.fn[NAME] = MapAPI._jQueryInterface;\n $.fn[NAME].Constructor = MapAPI;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return MapAPI._jQueryInterface;\n }; // auto-apply\n\n\n $(W).on(\"\".concat(_events.AJAX, \" \").concat(_events.LOADED), function () {\n $('.mapAPI-map-container').jsMapAPI();\n });\n return MapAPI;\n}((external_jQuery_default()));\n\n/* harmony default export */ var _ui_map_api = (MapAPI);\n;// CONCATENATED MODULE: ./src/js/types/SilverShop.Page.CheckoutPageController.js\n\n\n\n\n\n//# sourceURL=webpack://@a2nt/ss-bootstrap-ui-webpack-boilerplate/./src/js/types/SilverShop.Page.CheckoutPageController.js_+_7_modules?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "jquery":
|
||
/*!*************************!*\
|
||
!*** external "jQuery" ***!
|
||
\*************************/
|
||
/***/ (function(module) {
|
||
|
||
module.exports = jQuery;
|
||
|
||
/***/ })
|
||
|
||
/******/ });
|
||
/************************************************************************/
|
||
/******/ // The module cache
|
||
/******/ var __webpack_module_cache__ = {};
|
||
/******/
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
/******/ // Check if module is in cache
|
||
/******/ if(__webpack_module_cache__[moduleId]) {
|
||
/******/ return __webpack_module_cache__[moduleId].exports;
|
||
/******/ }
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||
/******/ // no module.id needed
|
||
/******/ // no module.loaded needed
|
||
/******/ exports: {}
|
||
/******/ };
|
||
/******/
|
||
/******/ // Execute the module function
|
||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||
/******/
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
/******/
|
||
/************************************************************************/
|
||
/******/ /* webpack/runtime/compat get default export */
|
||
/******/ !function() {
|
||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
/******/ __webpack_require__.n = function(module) {
|
||
/******/ var getter = module && module.__esModule ?
|
||
/******/ function() { return module['default']; } :
|
||
/******/ function() { return module; };
|
||
/******/ __webpack_require__.d(getter, { a: getter });
|
||
/******/ return getter;
|
||
/******/ };
|
||
/******/ }();
|
||
/******/
|
||
/******/ /* webpack/runtime/define property getters */
|
||
/******/ !function() {
|
||
/******/ // define getter functions for harmony exports
|
||
/******/ __webpack_require__.d = function(exports, definition) {
|
||
/******/ for(var key in definition) {
|
||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||
/******/ }
|
||
/******/ }
|
||
/******/ };
|
||
/******/ }();
|
||
/******/
|
||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||
/******/ !function() {
|
||
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
||
/******/ }();
|
||
/******/
|
||
/******/ /* webpack/runtime/make namespace object */
|
||
/******/ !function() {
|
||
/******/ // define __esModule on exports
|
||
/******/ __webpack_require__.r = function(exports) {
|
||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
/******/ }
|
||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
/******/ };
|
||
/******/ }();
|
||
/******/
|
||
/************************************************************************/
|
||
/******/ // startup
|
||
/******/ // Load entry module
|
||
/******/ __webpack_require__("./src/js/types/SilverShop.Page.CheckoutPageController.js");
|
||
/******/ // This entry module used 'exports' so it can't be inlined
|
||
/******/ })()
|
||
; |