silverstripe-webpack/app/client/dist/js/app_Site.Controllers.MapEle...

2 lines
49 KiB
JavaScript

/*! For license information please see app_Site.Controllers.MapElementController.js.LICENSE.txt */
!function(){var t={4283:function(t){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function DBSCAN(t,r,o,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,r,o,i)}DBSCAN.prototype.run=function(t,r,o,i){this._init(t,r,o,i);for(var a=0;a<this._datasetLength;a++)if(1!==this._visited[a]){this._visited[a]=1;var u=this._regionQuery(a);if(u.length<this.minPts)this.noise.push(a);else{var l=this.clusters.length;this.clusters.push([]),this._addToCluster(a,l),this._expandCluster(l,u)}}return this.clusters},DBSCAN.prototype._init=function(t,r,o,i){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+_typeof(t)+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}r&&(this.epsilon=r),o&&(this.minPts=o),i&&(this.distance=i)},DBSCAN.prototype._expandCluster=function(t,r){for(var o=0;o<r.length;o++){var i=r[o];if(1!==this._visited[i]){this._visited[i]=1;var a=this._regionQuery(i);a.length>=this.minPts&&(r=this._mergeArrays(r,a))}1!==this._assigned[i]&&this._addToCluster(i,t)}},DBSCAN.prototype._addToCluster=function(t,r){this.clusters[r].push(t),this._assigned[t]=1},DBSCAN.prototype._regionQuery=function(t){for(var r=[],o=0;o<this._datasetLength;o++){this.distance(this.dataset[t],this.dataset[o])<this.epsilon&&r.push(o)}return r},DBSCAN.prototype._mergeArrays=function(t,r){for(var o=r.length,i=0;i<o;i++){var a=r[i];t.indexOf(a)<0&&t.push(a)}return t},DBSCAN.prototype._euclideanDistance=function(t,r){for(var o=0,i=Math.min(t.length,r.length);i--;)o+=(t[i]-r[i])*(t[i]-r[i]);return Math.sqrt(o)},t.exports&&(t.exports=DBSCAN)},5021:function(t){function KMEANS(t,r,o){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,r,o)}KMEANS.prototype.init=function(t,r,o){this.assignments=[],this.centroids=[],"undefined"!==typeof t&&(this.dataset=t),"undefined"!==typeof r&&(this.k=r),"undefined"!==typeof o&&(this.distance=o)},KMEANS.prototype.run=function(t,r){this.init(t,r);for(var o=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var u=0;u<this.k;u++){for(var l=new Array(d),c=0,p=0;p<d;p++)l[p]=0;for(var h=0;h<o;h++){var d=this.dataset[h].length;if(u===this.assignments[h]){for(p=0;p<d;p++)l[p]+=this.dataset[h][p];c++}}if(c>0){for(p=0;p<d;p++)l[p]/=c;this.centroids[u]=l}else this.centroids[u]=this.randomCentroid(),a=!0}}return this.getClusters()},KMEANS.prototype.randomCentroid=function(){var t,r,o=this.dataset.length-1;do{r=Math.round(Math.random()*o),t=this.dataset[r]}while(this.centroids.indexOf(t)>=0);return t},KMEANS.prototype.assign=function(){for(var t,r=!1,o=this.dataset.length,i=0;i<o;i++)(t=this.argmin(this.dataset[i],this.centroids,this.distance))!=this.assignments[i]&&(this.assignments[i]=t,r=!0);return r},KMEANS.prototype.getClusters=function(){for(var t,r=new Array(this.k),o=0;o<this.assignments.length;o++)"undefined"===typeof r[t=this.assignments[o]]&&(r[t]=[]),r[t].push(o);return r},KMEANS.prototype.argmin=function(t,r,o){for(var i,a=Number.MAX_VALUE,u=0,l=r.length,c=0;c<l;c++)(i=o(t,r[c]))<a&&(a=i,u=c);return u},KMEANS.prototype.distance=function(t,r){for(var o=0,i=Math.min(t.length,r.length);i--;){var a=t[i]-r[i];o+=a*a}return Math.sqrt(o)},t.exports&&(t.exports=KMEANS)},9134:function(t,r,o){function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}if(t.exports)var i=o(9250);function OPTICS(t,r,o,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,r,o,i)}OPTICS.prototype.run=function(t,r,o,a){this._init(t,r,o,a);for(var u=0,l=this.dataset.length;u<l;u++)if(1!==this._processed[u]){this._processed[u]=1,this.clusters.push([u]);var c=this.clusters.length-1;this._orderedList.push(u);var p=new i(null,null,"asc"),h=this._regionQuery(u);void 0!==this._distanceToCore(u)&&(this._updateQueue(u,h,p),this._expandCluster(c,p))}return this.clusters},OPTICS.prototype.getReachabilityPlot=function(){for(var t=[],r=0,o=this._orderedList.length;r<o;r++){var i=this._orderedList[r],a=this._reachability[i];t.push([i,a])}return t},OPTICS.prototype._init=function(t,r,o,i){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+_typeof(t)+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}r&&(this.epsilon=r),o&&(this.minPts=o),i&&(this.distance=i)},OPTICS.prototype._updateQueue=function(t,r,o){var i=this;this._coreDistance=this._distanceToCore(t),r.forEach((function(r){if(void 0===i._processed[r]){var a=i.distance(i.dataset[t],i.dataset[r]),u=Math.max(i._coreDistance,a);void 0===i._reachability[r]?(i._reachability[r]=u,o.insert(r,u)):u<i._reachability[r]&&(i._reachability[r]=u,o.remove(r),o.insert(r,u))}}))},OPTICS.prototype._expandCluster=function(t,r){for(var o=r.getElements(),i=0,a=o.length;i<a;i++){var u=o[i];if(void 0===this._processed[u]){var l=this._regionQuery(u);this._processed[u]=1,this.clusters[t].push(u),this._orderedList.push(u),void 0!==this._distanceToCore(u)&&(this._updateQueue(u,l,r),this._expandCluster(t,r))}}},OPTICS.prototype._distanceToCore=function(t){for(var r=this.epsilon,o=0;o<r;o++){if(this._regionQuery(t,o).length>=this.minPts)return o}},OPTICS.prototype._regionQuery=function(t,r){r=r||this.epsilon;for(var o=[],i=0,a=this.dataset.length;i<a;i++)this.distance(this.dataset[t],this.dataset[i])<r&&o.push(i);return o},OPTICS.prototype._euclideanDistance=function(t,r){for(var o=0,i=Math.min(t.length,r.length);i--;)o+=(t[i]-r[i])*(t[i]-r[i]);return Math.sqrt(o)},t.exports&&(t.exports=OPTICS)},9250:function(t){function PriorityQueue(t,r,o){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,r,o)}PriorityQueue.prototype.insert=function(t,r){for(var o=this._queue.length,i=o;i--;){var a=this._priorities[i];"desc"===this._sorting?r>a&&(o=i):r<a&&(o=i)}this._insertAt(t,r,o)},PriorityQueue.prototype.remove=function(t){for(var r=this._queue.length;r--;){if(t===this._queue[r]){this._queue.splice(r,1),this._priorities.splice(r,1);break}}},PriorityQueue.prototype.forEach=function(t){this._queue.forEach(t)},PriorityQueue.prototype.getElements=function(){return this._queue},PriorityQueue.prototype.getElementPriority=function(t){return this._priorities[t]},PriorityQueue.prototype.getPriorities=function(){return this._priorities},PriorityQueue.prototype.getElementsWithPriorities=function(){for(var t=[],r=0,o=this._queue.length;r<o;r++)t.push([this._queue[r],this._priorities[r]]);return t},PriorityQueue.prototype._init=function(t,r,o){if(t&&r){if(this._queue=[],this._priorities=[],t.length!==r.length)throw new Error("Arrays must have the same length");for(var i=0;i<t.length;i++)this.insert(t[i],r[i])}o&&(this._sorting=o)},PriorityQueue.prototype._insertAt=function(t,r,o){this._queue.length===o?(this._queue.push(t),this._priorities.push(r)):(this._queue.splice(o,0,t),this._priorities.splice(o,0,r))},t.exports&&(t.exports=PriorityQueue)},7485:function(t,r,o){t.exports&&(t.exports={DBSCAN:o(4283),KMEANS:o(5021),OPTICS:o(9134),PriorityQueue:o(9250)})},3564:function(t){"use strict";function _createForOfIteratorHelper(t,r){var o="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"===typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"===typeof t.length){o&&(t=o);var i=0,a=function F(){};return{s:a,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,c=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return l=t.done,t},e:function e(t){c=!0,u=t},f:function f(){try{l||null==o.return||o.return()}finally{if(c)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);o<r;o++)i[o]=t[o];return i}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}t.exports=function equal(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var o,i,a;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(i=o;0!==i--;)if(!equal(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;var u,l=_createForOfIteratorHelper(t.entries());try{for(l.s();!(u=l.n()).done;)if(i=u.value,!r.has(i[0]))return!1}catch(g){l.e(g)}finally{l.f()}var c,p=_createForOfIteratorHelper(t.entries());try{for(p.s();!(c=p.n()).done;)if(!equal((i=c.value)[1],r.get(i[0])))return!1}catch(g){p.e(g)}finally{p.f()}return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;var h,d=_createForOfIteratorHelper(t.entries());try{for(d.s();!(h=d.n()).done;)if(i=h.value,!r.has(i[0]))return!1}catch(g){d.e(g)}finally{d.f()}return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((o=t.length)!=r.length)return!1;for(i=o;0!==i--;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=o;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=o;0!==i--;){var m=a[i];if(!equal(t[m],r[m]))return!1}return!0}return t!==t&&r!==r}},5361:function(t){"use strict";t.exports={eudist:function eudist(t,r){for(var o=t.length,i=0,a=0;a<o;a++){var u=(t[a]||0)-(r[a]||0);i+=u*u}return i},mandist:function mandist(t,r){for(var o=t.length,i=0,a=0,u=0;u<o;u++)i+=(a=(t[u]||0)-(r[u]||0))>=0?a:-a;return i},dist:function dist(t,r,o){var i=Math.abs(t-r);return o?i:i*i}}},9:function(t,r,o){"use strict";var i=o(5361),a=i.eudist,u=i.dist;t.exports={kmrand:function kmrand(t,r){for(var o={},i=[],a=r<<2,u=t.length,l=t[0].length>0;i.length<r&&a-- >0;){var c=t[Math.floor(Math.random()*u)],p=l?c.join("_"):"".concat(c);o[p]||(o[p]=!0,i.push(c))}if(i.length<r)throw new Error("Error initializating clusters");return i},kmpp:function kmpp(t,r,o){var i=o||(t[0].length?a:u),l=[],c=t.length,p=t[0].length>0,h=t[Math.floor(Math.random()*c)];p?h.join("_"):"".concat(h);for(l.push(h);l.length<r;){for(var d=[],m=l.length,g=0,y=[],_=0;_<c;_++){for(var v=1/0,b=0;b<m;b++){var k=i(t[_],l[b]);k<=v&&(v=k)}d[_]=v}for(var C=0;C<c;C++)g+=d[C];for(var x=0;x<c;x++)y[x]={i:x,v:t[x],pr:d[x]/g,cs:0};y.sort((function(t,r){return t.pr-r.pr})),y[0].cs=y[0].pr;for(var w=1;w<c;w++)y[w].cs=y[w-1].cs+y[w].pr;for(var P=Math.random(),M=0;M<c-1&&y[M++].cs<P;);l.push(y[M-1].v)}return l}}},4250:function(t,r,o){"use strict";var i=o(5361),a=o(9),u=i.eudist,l=(i.mandist,i.dist,a.kmrand),c=a.kmpp;function init(t,r,o){o=o||[];for(var i=0;i<t;i++)o[i]=r;return o}function test(t,r){for(var o=Array.isArray(t),i=this.centroids,a=i.length,l=1/0,c=0,p=0;p<a;p++){var h=r?r(t,i[p]):o?u(t,i[p]):Math.abs(t-i[p]);h<=l&&(l=h,c=p)}return{idx:c,centroid:i[c]}}t.exports=function skmeans(t,r,o,i,a){var p=[],h=[],d=[],m=[],g=!1,y=i||1e4,_=t.length,v=t[0].length,b=v>0,k=[];if(o)p="kmrand"==o?l(t,r):"kmpp"==o?c(t,r,a):o;else for(var C={},x=0;p.length<r;){var w=Math.floor(Math.random()*_);C[w]||(C[w]=!0,p[x++]=t[w])}do{init(r,0,k);for(var P=0;P<_;P++){for(var M=1/0,O=0,S=0;S<r;S++){(m=a?a(t[P],p[S]):b?u(t[P],p[S]):Math.abs(t[P]-p[S]))<=M&&(M=m,O=S)}d[P]=O,k[O]++}var A=[];h=[];if(b)for(var I=0;I<r;I++)A[I]=init(v,0,A[I]),h[I]=p[I];else for(var E=0;E<r;E++)A[E]=0,h[E]=p[E];if(b){for(var T=0;T<r;T++)p[T]=[];for(var L=0;L<_;L++)for(var j=A[d[L]],D=t[L],N=0;N<v;N++)j[N]+=D[N];g=!0;for(var q=0;q<r;q++){for(var R=p[q],Z=A[q],z=h[q],B=k[q],G=0;G<v;G++)R[G]=Z[G]/B||0;if(g)for(var H=0;H<v;H++)if(z[H]!=R[H]){g=!1;break}}}else{for(var K=0;K<_;K++){A[d[K]]+=t[K]}for(var Q=0;Q<r;Q++)p[Q]=A[Q]/k[Q]||0;g=!0;for(var U=0;U<r;U++)if(h[U]!=p[U]){g=!1;break}}g=g||--y<=0}while(!g);return{it:(i||1e4)-y,k:r,idxs:d,centroids:p,test:test}}}},r={};function __webpack_require__(o){var i=r[o];if(void 0!==i)return i.exports;var a=r[o]={exports:{}};return t[o](a,a.exports,__webpack_require__),a.exports}__webpack_require__.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=function(t,r){for(var o in r)__webpack_require__.o(r,o)&&!__webpack_require__.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},__webpack_require__.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},function(){"use strict";var t="ajax-load",r="load-ready",o="map-loaded",i="map-api-loaded",a="map-marker-click",u="map-popup-close";__webpack_require__(4250);__webpack_require__(7485);function sortKD(t,r,o,i,a,u){if(!(a-i<=o)){var l=i+a>>1;sort_select(t,r,l,i,a,u%2),sortKD(t,r,o,i,l-1,u+1),sortKD(t,r,o,l+1,a,u+1)}}function sort_select(t,r,o,i,a,u){for(;a>i;){if(a-i>600){var l=a-i+1,c=o-i+1,p=Math.log(l),h=.5*Math.exp(2*p/3),d=.5*Math.sqrt(p*h*(l-h)/l)*(c-l/2<0?-1:1);sort_select(t,r,o,Math.max(i,Math.floor(o-c*h/l+d)),Math.min(a,Math.floor(o+(l-c)*h/l+d)),u)}var m=r[2*o+u],g=i,y=a;for(swapItem(t,r,i,o),r[2*a+u]>m&&swapItem(t,r,i,a);g<y;){for(swapItem(t,r,g,y),g++,y--;r[2*g+u]<m;)g++;for(;r[2*y+u]>m;)y--}r[2*i+u]===m?swapItem(t,r,i,y):swapItem(t,r,++y,a),y<=o&&(i=y+1),o<=y&&(a=y-1)}}function swapItem(t,r,o,i){swap(t,o,i),swap(r,2*o,2*i),swap(r,2*o+1,2*i+1)}function swap(t,r,o){var i=t[r];t[r]=t[o],t[o]=i}function sqDist(t,r,o,i){var a=t-o,u=r-i;return a*a+u*u}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var i=r[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var l=function defaultGetX(t){return t[0]},c=function defaultGetY(t){return t[1]},p=function(){function KDBush(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;_classCallCheck(this,KDBush),this.nodeSize=i,this.points=t;for(var u=t.length<65536?Uint16Array:Uint32Array,p=this.ids=new u(t.length),h=this.coords=new a(2*t.length),d=0;d<t.length;d++)p[d]=d,h[2*d]=r(t[d]),h[2*d+1]=o(t[d]);sortKD(p,h,i,0,p.length-1,0)}return function _createClass(t,r,o){return r&&_defineProperties(t.prototype,r),o&&_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(KDBush,[{key:"range",value:function range(t,r,o,i){return function range_range(t,r,o,i,a,u,l){for(var c,p,h=[0,t.length-1,0],d=[];h.length;){var m=h.pop(),g=h.pop(),y=h.pop();if(g-y<=l)for(var _=y;_<=g;_++)c=r[2*_],p=r[2*_+1],c>=o&&c<=a&&p>=i&&p<=u&&d.push(t[_]);else{var v=Math.floor((y+g)/2);c=r[2*v],p=r[2*v+1],c>=o&&c<=a&&p>=i&&p<=u&&d.push(t[v]);var b=(m+1)%2;(0===m?o<=c:i<=p)&&(h.push(y),h.push(v-1),h.push(b)),(0===m?a>=c:u>=p)&&(h.push(v+1),h.push(g),h.push(b))}}return d}(this.ids,this.coords,t,r,o,i,this.nodeSize)}},{key:"within",value:function within(t,r,o){return function within_within(t,r,o,i,a,u){for(var l=[0,t.length-1,0],c=[],p=a*a;l.length;){var h=l.pop(),d=l.pop(),m=l.pop();if(d-m<=u)for(var g=m;g<=d;g++)sqDist(r[2*g],r[2*g+1],o,i)<=p&&c.push(t[g]);else{var y=Math.floor((m+d)/2),_=r[2*y],v=r[2*y+1];sqDist(_,v,o,i)<=p&&c.push(t[y]);var b=(h+1)%2;(0===h?o-a<=_:i-a<=v)&&(l.push(m),l.push(y-1),l.push(b)),(0===h?o+a>=_:i+a>=v)&&(l.push(y+1),l.push(d),l.push(b))}}return c}(this.ids,this.coords,t,r,o,this.nodeSize)}}]),KDBush}();function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var i,a,u=[],l=!0,c=!1;try{for(o=o.call(t);!(l=(i=o.next()).done)&&(u.push(i.value),!r||u.length!==r);l=!0);}catch(p){c=!0,a=p}finally{try{l||null==o.return||o.return()}finally{if(c)throw a}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"===typeof t.length){o&&(t=o);var i=0,a=function F(){};return{s:a,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,l=!0,c=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();return l=t.done,t},e:function e(t){c=!0,u=t},f:function f(){try{l||null==o.return||o.return()}finally{if(c)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"===typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);o<r;o++)i[o]=t[o];return i}function supercluster_defineProperties(t,r){for(var o=0;o<r.length;o++){var i=r[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var h,d={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function map(t){return t}},m=Math.fround||(h=new Float32Array(1),function(t){return h[0]=+t,h[0]}),g=function(){function Supercluster(t){!function supercluster_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Supercluster),this.options=extend(Object.create(d),t),this.trees=new Array(this.options.maxZoom+1)}return function supercluster_createClass(t,r,o){return r&&supercluster_defineProperties(t.prototype,r),o&&supercluster_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(Supercluster,[{key:"load",value:function load(t){var r=this.options,o=r.log,i=r.minZoom,a=r.maxZoom,u=r.nodeSize;o&&console.time("total time");var l="prepare ".concat(t.length," points");o&&console.time(l),this.points=t;for(var c,h,d,g,y,_=[],v=0;v<t.length;v++)t[v].geometry&&_.push((c=t[v],h=v,d=void 0,g=void 0,y=void 0,d=_slicedToArray(c.geometry.coordinates,2),g=d[0],y=d[1],{x:m(lngX(g)),y:m(latY(y)),zoom:1/0,index:h,parentId:-1}));this.trees[a+1]=new p(_,getX,getY,u,Float32Array),o&&console.timeEnd(l);for(var b=a;b>=i;b--){var k=+Date.now();_=this._cluster(_,b),this.trees[b]=new p(_,getX,getY,u,Float32Array),o&&console.log("z%d: %d clusters in %dms",b,_.length,+Date.now()-k)}return o&&console.timeEnd("total time"),this}},{key:"getClusters",value:function getClusters(t,r){var o=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,u=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)o=-180,a=180;else if(o>a){var l=this.getClusters([o,i,180,u],r),c=this.getClusters([-180,i,a,u],r);return l.concat(c)}var p,h=this.trees[this._limitZoom(r)],d=[],m=_createForOfIteratorHelper(h.range(lngX(o),latY(u),lngX(a),latY(i)));try{for(m.s();!(p=m.n()).done;){var g=p.value,y=h.points[g];d.push(y.numPoints?getClusterJSON(y):this.points[y.index])}}catch(_){m.e(_)}finally{m.f()}return d}},{key:"getChildren",value:function getChildren(t){var r=this._getOriginId(t),o=this._getOriginZoom(t),i="No cluster with the specified id.",a=this.trees[o];if(!a)throw new Error(i);var u=a.points[r];if(!u)throw new Error(i);var l,c=this.options.radius/(this.options.extent*Math.pow(2,o-1)),p=[],h=_createForOfIteratorHelper(a.within(u.x,u.y,c));try{for(h.s();!(l=h.n()).done;){var d=l.value,m=a.points[d];m.parentId===t&&p.push(m.numPoints?getClusterJSON(m):this.points[m.index])}}catch(g){h.e(g)}finally{h.f()}if(0===p.length)throw new Error(i);return p}},{key:"getLeaves",value:function getLeaves(t,r,o){r=r||10,o=o||0;var i=[];return this._appendLeaves(i,t,r,o,0),i}},{key:"getTile",value:function getTile(t,r,o){var i=this.trees[this._limitZoom(t)],a=Math.pow(2,t),u=this.options,l=u.extent,c=u.radius/l,p=(o-c)/a,h=(o+1+c)/a,d={features:[]};return this._addTileFeatures(i.range((r-c)/a,p,(r+1+c)/a,h),i.points,r,o,a,d),0===r&&this._addTileFeatures(i.range(1-c/a,p,1,h),i.points,a,o,a,d),r===a-1&&this._addTileFeatures(i.range(0,p,c/a,h),i.points,-1,o,a,d),d.features.length?d:null}},{key:"getClusterExpansionZoom",value:function getClusterExpansionZoom(t){for(var r=this._getOriginZoom(t)-1;r<=this.options.maxZoom;){var o=this.getChildren(t);if(r++,1!==o.length)break;t=o[0].properties.cluster_id}return r}},{key:"_appendLeaves",value:function _appendLeaves(t,r,o,i,a){var u,l=_createForOfIteratorHelper(this.getChildren(r));try{for(l.s();!(u=l.n()).done;){var c=u.value,p=c.properties;if(p&&p.cluster?a+p.point_count<=i?a+=p.point_count:a=this._appendLeaves(t,p.cluster_id,o,i,a):a<i?a++:t.push(c),t.length===o)break}}catch(h){l.e(h)}finally{l.f()}return a}},{key:"_addTileFeatures",value:function _addTileFeatures(t,r,o,i,a,u){var l,c=_createForOfIteratorHelper(t);try{for(c.s();!(l=c.n()).done;){var p=r[l.value],h=p.numPoints,d=void 0,m=void 0,g=void 0;if(h)d=getClusterProperties(p),m=p.x,g=p.y;else{var y=this.points[p.index];d=y.properties,m=lngX(y.geometry.coordinates[0]),g=latY(y.geometry.coordinates[1])}var _={type:1,geometry:[[Math.round(this.options.extent*(m*a-o)),Math.round(this.options.extent*(g*a-i))]],tags:d},v=void 0;h?v=p.id:this.options.generateId?v=p.index:this.points[p.index].id&&(v=this.points[p.index].id),void 0!==v&&(_.id=v),u.features.push(_)}}catch(b){c.e(b)}finally{c.f()}}},{key:"_limitZoom",value:function _limitZoom(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))}},{key:"_cluster",value:function _cluster(t,r){for(var o=[],i=this.options,a=i.radius,u=i.extent,l=i.reduce,c=i.minPoints,p=a/(u*Math.pow(2,r)),h=0;h<t.length;h++){var d=t[h];if(!(d.zoom<=r)){d.zoom=r;var m,g=this.trees[r+1],y=g.within(d.x,d.y,p),_=d.numPoints||1,v=_,b=_createForOfIteratorHelper(y);try{for(b.s();!(m=b.n()).done;){var k=m.value,C=g.points[k];C.zoom>r&&(v+=C.numPoints||1)}}catch(N){b.e(N)}finally{b.f()}if(v>_&&v>=c){var x,w=d.x*_,P=d.y*_,M=l&&_>1?this._map(d,!0):null,O=(h<<5)+(r+1)+this.points.length,S=_createForOfIteratorHelper(y);try{for(S.s();!(x=S.n()).done;){var A=x.value,I=g.points[A];if(!(I.zoom<=r)){I.zoom=r;var E=I.numPoints||1;w+=I.x*E,P+=I.y*E,I.parentId=O,l&&(M||(M=this._map(d,!0)),l(M,this._map(I)))}}}catch(N){S.e(N)}finally{S.f()}d.parentId=O,o.push(createCluster(w/v,P/v,O,v,M))}else if(o.push(d),v>1){var T,L=_createForOfIteratorHelper(y);try{for(L.s();!(T=L.n()).done;){var j=T.value,D=g.points[j];D.zoom<=r||(D.zoom=r,o.push(D))}}catch(N){L.e(N)}finally{L.f()}}}}return o}},{key:"_getOriginId",value:function _getOriginId(t){return t-this.points.length>>5}},{key:"_getOriginZoom",value:function _getOriginZoom(t){return(t-this.points.length)%32}},{key:"_map",value:function _map(t,r){if(t.numPoints)return r?extend({},t.properties):t.properties;var o=this.points[t.index].properties,i=this.options.map(o);return r&&i===o?extend({},i):i}}]),Supercluster}();function createCluster(t,r,o,i,a){return{x:m(t),y:m(r),zoom:1/0,id:o,parentId:-1,numPoints:i,properties:a}}function getClusterJSON(t){return{type:"Feature",id:t.id,properties:getClusterProperties(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(r=t.y,o=(180-360*r)*Math.PI/180,360*Math.atan(Math.exp(o))/Math.PI-90)]}};var r,o,i}function getClusterProperties(t){var r=t.numPoints,o=r>=1e4?"".concat(Math.round(r/1e3),"k"):r>=1e3?"".concat(Math.round(r/100)/10,"k"):r;return extend(extend({},t.properties),{cluster:!0,cluster_id:t.id,point_count:r,point_count_abbreviated:o})}function lngX(t){return t/360+.5}function latY(t){var r=Math.sin(t*Math.PI/180),o=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return o<0?0:o>1?1:o}function extend(t,r){for(var o in r)t[o]=r[o];return t}function getX(t){return t.x}function getY(t){return t.y}var y=__webpack_require__(3564),_=__webpack_require__.n(y);function index_esm_typeof(t){return index_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},index_esm_typeof(t)}function index_esm_slicedToArray(t,r){return function index_esm_arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function index_esm_iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var i,a,u=[],l=!0,c=!1;try{for(o=o.call(t);!(l=(i=o.next()).done)&&(u.push(i.value),!r||u.length!==r);l=!0);}catch(p){c=!0,a=p}finally{try{l||null==o.return||o.return()}finally{if(c)throw a}}return u}(t,r)||index_esm_unsupportedIterableToArray(t,r)||function index_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return index_esm_arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||index_esm_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function index_esm_unsupportedIterableToArray(t,r){if(t){if("string"===typeof t)return index_esm_arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?index_esm_arrayLikeToArray(t,r):void 0}}function index_esm_arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,i=new Array(r);o<r;o++)i[o]=t[o];return i}function _inherits(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){return t.__proto__=r,t},_setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function _createSuperInternal(){var o,i=_getPrototypeOf(t);if(r){var a=_getPrototypeOf(this).constructor;o=Reflect.construct(i,arguments,a)}else o=i.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===index_esm_typeof(r)||"function"===typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function index_esm_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function index_esm_defineProperties(t,r){for(var o=0;o<r.length;o++){var i=r[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function index_esm_createClass(t,r,o){return r&&index_esm_defineProperties(t.prototype,r),o&&index_esm_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function __rest(t,r){var o={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(o[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(o[i[a]]=t[i[a]])}return o}var v=function(){function Cluster(t){var r=t.markers,o=t.position;index_esm_classCallCheck(this,Cluster),this.markers=r,o&&(o instanceof google.maps.LatLng?this._position=o:this._position=new google.maps.LatLng(o))}return index_esm_createClass(Cluster,[{key:"bounds",get:function get(){if(0!==this.markers.length||this._position)return this.markers.reduce((function(t,r){return t.extend(r.getPosition())}),new google.maps.LatLngBounds(this._position,this._position))}},{key:"position",get:function get(){return this._position||this.bounds.getCenter()}},{key:"count",get:function get(){return this.markers.filter((function(t){return t.getVisible()})).length}},{key:"push",value:function push(t){this.markers.push(t)}},{key:"delete",value:function _delete(){this.marker&&(this.marker.setMap(null),delete this.marker),this.markers.length=0}}]),Cluster}(),b=function(){function AbstractAlgorithm(t){var r=t.maxZoom,o=void 0===r?16:r;index_esm_classCallCheck(this,AbstractAlgorithm),this.maxZoom=o}return index_esm_createClass(AbstractAlgorithm,[{key:"noop",value:function noop(t){var r=t.markers;return k(r)}}]),AbstractAlgorithm}(),k=function _noop(t){return t.map((function(t){return new v({position:t.getPosition(),markers:[t]})}))},C=function(t){_inherits(SuperClusterAlgorithm,t);var r=_createSuper(SuperClusterAlgorithm);function SuperClusterAlgorithm(t){var o;index_esm_classCallCheck(this,SuperClusterAlgorithm);var i=t.maxZoom,a=t.radius,u=void 0===a?60:a,l=__rest(t,["maxZoom","radius"]);return(o=r.call(this,{maxZoom:i})).superCluster=new g(Object.assign({maxZoom:o.maxZoom,radius:u},l)),o.state={zoom:null},o}return index_esm_createClass(SuperClusterAlgorithm,[{key:"calculate",value:function calculate(t){var r=!1;if(!_()(t.markers,this.markers)){r=!0,this.markers=_toConsumableArray(t.markers);var o=this.markers.map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:[t.getPosition().lng(),t.getPosition().lat()]},properties:{marker:t}}}));this.superCluster.load(o)}var i={zoom:t.map.getZoom()};return r||this.state.zoom>this.maxZoom&&i.zoom>this.maxZoom||(r=r||!_()(this.state,i)),this.state=i,r&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:r}}},{key:"cluster",value:function cluster(t){var r=t.map;return this.superCluster.getClusters([-180,-90,180,90],Math.round(r.getZoom())).map(this.transformCluster.bind(this))}},{key:"transformCluster",value:function transformCluster(t){var r=index_esm_slicedToArray(t.geometry.coordinates,2),o=r[0],i=r[1],a=t.properties;if(a.cluster)return new v({markers:this.superCluster.getLeaves(a.cluster_id,1/0).map((function(t){return t.properties.marker})),position:new google.maps.LatLng({lat:i,lng:o})});var u=a.marker;return new v({markers:[u],position:u.getPosition()})}}]),SuperClusterAlgorithm}(b),x=index_esm_createClass((function ClusterStats(t,r){index_esm_classCallCheck(this,ClusterStats),this.markers={sum:t.length};var o=r.map((function(t){return t.count})),i=o.reduce((function(t,r){return t+r}),0);this.clusters={count:r.length,markers:{mean:i/r.length,sum:i,min:Math.min.apply(Math,_toConsumableArray(o)),max:Math.max.apply(Math,_toConsumableArray(o))}}})),w=function(){function DefaultRenderer(){index_esm_classCallCheck(this,DefaultRenderer)}return index_esm_createClass(DefaultRenderer,[{key:"render",value:function render(t,r){var o=t.count,i=t.position,a=o>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff",u=window.btoa('\n <svg fill="'.concat(a,'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">\n <circle cx="120" cy="120" opacity=".6" r="70" />\n <circle cx="120" cy="120" opacity=".3" r="90" />\n <circle cx="120" cy="120" opacity=".2" r="110" />\n </svg>'));return new google.maps.Marker({position:i,icon:{url:"data:image/svg+xml;base64,".concat(u),scaledSize:new google.maps.Size(45,45)},label:{text:String(o),color:"rgba(255,255,255,0.9)",fontSize:"12px"},title:"Cluster of ".concat(o," markers"),zIndex:Number(google.maps.Marker.MAX_ZINDEX)+o})}}]),DefaultRenderer}();var P,M=index_esm_createClass((function OverlayViewSafe(){index_esm_classCallCheck(this,OverlayViewSafe),function index_esm_extend(t,r){for(var o in r.prototype)t.prototype[o]=r.prototype[o]}(OverlayViewSafe,google.maps.OverlayView)}));!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"}(P||(P={}));var O=function defaultOnClusterClickHandler(t,r,o){o.fitBounds(r.bounds)},S=function(t){_inherits(MarkerClusterer,t);var r=_createSuper(MarkerClusterer);function MarkerClusterer(t){var o,i=t.map,a=t.markers,u=void 0===a?[]:a,l=t.algorithm,c=void 0===l?new C({}):l,p=t.renderer,h=void 0===p?new w:p,d=t.onClusterClick,m=void 0===d?O:d;return index_esm_classCallCheck(this,MarkerClusterer),(o=r.call(this)).markers=_toConsumableArray(u),o.clusters=[],o.algorithm=c,o.renderer=h,o.onClusterClick=m,i&&o.setMap(i),o}return index_esm_createClass(MarkerClusterer,[{key:"addMarker",value:function addMarker(t,r){this.markers.includes(t)||(this.markers.push(t),r||this.render())}},{key:"addMarkers",value:function addMarkers(t,r){var o=this;t.forEach((function(t){o.addMarker(t,!0)})),r||this.render()}},{key:"removeMarker",value:function removeMarker(t,r){var o=this.markers.indexOf(t);return-1!==o&&(t.setMap(null),this.markers.splice(o,1),r||this.render(),!0)}},{key:"removeMarkers",value:function removeMarkers(t,r){var o=this,i=!1;return t.forEach((function(t){i=o.removeMarker(t,!0)||i})),i&&!r&&this.render(),i}},{key:"clearMarkers",value:function clearMarkers(t){this.markers.length=0,t||this.render()}},{key:"render",value:function render(){var t=this.getMap();if(t instanceof google.maps.Map&&this.getProjection()){google.maps.event.trigger(this,P.CLUSTERING_BEGIN,this);var r=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()}),o=r.clusters,i=r.changed;(i||void 0==i)&&(this.reset(),this.clusters=o,this.renderClusters()),google.maps.event.trigger(this,P.CLUSTERING_END,this)}}},{key:"onAdd",value:function onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}},{key:"onRemove",value:function onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}},{key:"reset",value:function reset(){this.markers.forEach((function(t){return t.setMap(null)})),this.clusters.forEach((function(t){return t.delete()})),this.clusters=[]}},{key:"renderClusters",value:function renderClusters(){var t=this,r=new x(this.markers,this.clusters),o=this.getMap();this.clusters.forEach((function(i){1===i.markers.length?i.marker=i.markers[0]:(i.marker=t.renderer.render(i,r),t.onClusterClick&&i.marker.addListener("click",(function(r){google.maps.event.trigger(t,P.CLUSTER_CLICK,i),t.onClusterClick(r,i,o)}))),i.marker.setMap(o)}))}}]),MarkerClusterer}(M);function map_google_marker_typeof(t){return map_google_marker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},map_google_marker_typeof(t)}function map_google_marker_defineProperties(t,r){for(var o=0;o<r.length;o++){var i=r[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function map_google_marker_setPrototypeOf(t,r){return map_google_marker_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){return t.__proto__=r,t},map_google_marker_setPrototypeOf(t,r)}function map_google_marker_createSuper(t){var r=function map_google_marker_isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function _createSuperInternal(){var o,i=map_google_marker_getPrototypeOf(t);if(r){var a=map_google_marker_getPrototypeOf(this).constructor;o=Reflect.construct(i,arguments,a)}else o=i.apply(this,arguments);return map_google_marker_possibleConstructorReturn(this,o)}}function map_google_marker_possibleConstructorReturn(t,r){if(r&&("object"===map_google_marker_typeof(r)||"function"===typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return map_google_marker_assertThisInitialized(t)}function map_google_marker_assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function map_google_marker_getPrototypeOf(t){return map_google_marker_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)},map_google_marker_getPrototypeOf(t)}var A={init:function init(){return function(t){!function map_google_marker_inherits(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&map_google_marker_setPrototypeOf(t,r)}(GoogleMapsHtmlOverlay,google.maps.OverlayView);var r=map_google_marker_createSuper(GoogleMapsHtmlOverlay);function GoogleMapsHtmlOverlay(t){var o;!function map_google_marker_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,GoogleMapsHtmlOverlay);var i=map_google_marker_assertThisInitialized(o=r.call(this));return i.ownerMap=t.map,i.position=t.position,i.html=t.html?t.html:'<div class="mapboxgl-marker"><i class="marker-icon fas fa-map-marker-alt"></i></div>',i.divClass=t.divClass,i.align=t.align,i.isDebugMode=t.debug,i.onClick=t.onClick,i.onMouseOver=t.onMouseOver,i.isBoolean=function(t){return"boolean"===typeof t},i.isNotUndefined=function(t){return"undefined"!==typeof t},i.hasContent=function(t){return t.length>0},i.isString=function(t){return"string"===typeof t},i.isFunction=function(t){return"function"===typeof t},o}return function map_google_marker_createClass(t,r,o){return r&&map_google_marker_defineProperties(t.prototype,r),o&&map_google_marker_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(GoogleMapsHtmlOverlay,[{key:"onAdd",value:function onAdd(){var t=this;t.div=document.createElement("div"),t.div.style.position="absolute",t.isNotUndefined(t.divClass)&&t.hasContent(t.divClass)&&(t.div.className=t.divClass),t.isNotUndefined(t.html)&&t.hasContent(t.html)&&t.isString(t.html)&&(t.div.innerHTML=t.html),t.isBoolean(t.isDebugMode)&&t.isDebugMode&&(t.div.className="debug-mode",t.div.innerHTML='<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(r){google.maps.event.trigger(t,"click"),t.isFunction(t.onClick)&&t.onClick(),r.stopPropagation()})),google.maps.event.addDomListener(t.div,"mouseover",(function(r){google.maps.event.trigger(t,"mouseover"),t.isFunction(t.onMouseOver)&&t.onMouseOver(),r.stopPropagation()}))}},{key:"draw",value:function draw(){var t=this,r=document.querySelector(".popup");r.length||(r=t.div);var o=t.getProjection();if(!o)return console.log("GoogleMapsHtmlOverlay: current map is missing"),null;var i=o.fromLatLngToDivPixel(t.getPosition()),a={y:void 0,x:void 0},u=r.offsetWidth,l=r.offsetHeight;switch(Array.isArray(t.align)?t.align.join(" "):""){case"left top":a.y=l,a.x=u;break;case"left center":a.y=l/2,a.x=u;break;case"left bottom":a.y=0,a.x=u;break;case"center top":a.y=l,a.x=u/2;break;case"center center":default:a.y=l/2,a.x=u/2;break;case"center bottom":a.y=0,a.x=u/2;break;case"right top":a.y=l,a.x=0;break;case"right center":a.y=l/2,a.x=0;break;case"right bottom":a.y=0,a.x=0}t.div.style.top="".concat(i.y-a.y,"px"),t.div.style.left="".concat(i.x-a.x,"px")}},{key:"getPosition",value:function getPosition(){return new google.maps.LatLng(this.position)}},{key:"getDiv",value:function getDiv(){return this.div}},{key:"setPosition",value:function setPosition(t,r){var o=this;o.position=t,o.align=r,o.draw()}},{key:"remove",value:function remove(){this.setMap(null),this.div.remove()}},{key:"getDraggable",value:function getDraggable(){return!1}}]),GoogleMapsHtmlOverlay}()}};function map_google_defineProperties(t,r){for(var o=0;o<r.length;o++){var i=r[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var I=function(t){var r=function(){function GoogleMapsDriver(){!function map_google_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,GoogleMapsDriver)}return function map_google_createClass(t,r,o){return r&&map_google_defineProperties(t.prototype,r),o&&map_google_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(GoogleMapsDriver,[{key:"getName",value:function getName(){return"GoogleMapsDriver"}},{key:"init",value:function init(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=this;i.el=r,i.config=o,i.markers=[],t["init".concat(i.getName())]=function(){i.googleApiLoaded()};var a=document.createElement("script");a.src="https://maps.googleapis.com/maps/api/js?key=".concat(o.key,"&callback=init").concat(i.getName()),a.async=!0,a.defer=!0,document.head.appendChild(a)}},{key:"googleApiLoaded",value:function googleApiLoaded(){var t=this,r=t.el,o=t.config,a=r.querySelector(".mapAPI-map"),u=o.mapZoom&&"0"!==o.mapZoom?parseInt(o.mapZoom):10,l=o.center&&","!==o.center?{lat:o.center[1],lng:o.center[0]}:{lat:0,lng:0},c=o.style?o.style:null;console.log("".concat(t.getName(),": API is loaded")),t.MarkerUI=A.init(),t.map=new google.maps.Map(a,{zoom:u,center:l,fullscreenControl:!0,styles:c}),t.default_zoom=u,a.classList.add("mapboxgl-map"),t.popup=new t.MarkerUI({map:t.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>'}),t.popup.setMap(t.map),t.geocoder=new google.maps.Geocoder,t.cluster=new S(t.map,null,{styles:[{width:30,height:30,className:"mapboxgl-cluster"}]}),r.dispatchEvent(new Event(i))}},{key:"addMarker",value:function addMarker(t,r){var o=this,i={lat:t[1],lng:t[0]},u=new o.MarkerUI({position:i,map:o.map,align:["center","top"],html:'<div class="mapboxgl-marker"><div id="Marker'.concat(r.id,'" data-id="').concat(r.id,'" class="marker">').concat(r.icon,"</div></div>"),onClick:function onClick(){var t=document.querySelector("#Marker".concat(r.id));o.showPopup(i,r.content),t.dispatchEvent(new Event(a))}});return o.markers.push(u),o.cluster.addMarker(u),u}},{key:"showPopup",value:function showPopup(t,r){var o=this,i=o.popup.getDiv();o.config.flyToMarker&&(o.map.setCenter(t),o.config.noZoom||o.map.setZoom(18)),i.style.opacity="0",i.classList.remove("d-none"),i.querySelector(".mapboxgl-popup-content .html").innerHTML=r,i.querySelector(".mapboxgl-popup-close-button").addEventListener("click",(function(t){t.preventDefault(),o.hidePopup()})),o.popup.setPosition(t,["center","top"]),i.style.opacity="1",i.style["margin-top"]="-1rem"}},{key:"hidePopup",value:function hidePopup(){var t=this;t.popup.getDiv().classList.add("d-none"),t.config.noRestoreBounds&&!t.config.flyToBounds||t.restoreBounds(),t.el.dispatchEvent(new Event(u))}},{key:"geocode",value:function geocode(t,r){var o=this;o.geocoder.geocode({address:t},(function(t,i){if("OK"===i)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Geocode was not successful for the following reason: ").concat(i))}))}},{key:"reverseGeocode",value:function reverseGeocode(t,r){var o=this;o.geocoder.geocode({location:latlng},(function(t,i){if("OK"===i)return"function"===typeof r&&r(t),t;console.error("".concat(o.getName(),": Reverse Geocoding was not successful for the following reason: ").concat(i))}))}},{key:"addGeoJson",value:function addGeoJson(t){var r=this,o=JSON.parse(t.geojson),i=(o.features[0].geometry.coordinates,new google.maps.LatLngBounds);o.features.forEach((function(o){var a=o.id,u=o.geometry.coordinates,l=o.properties.content;r.addMarker(u,{id:a,content:l,icon:o.icon,flyToMarker:t.flyToMarker}),i.extend({lat:u[1],lng:u[0]})})),r.markers.length>1?r.map.fitBounds(i,{padding:30}):r.markers[0]&&r.map.setCenter(r.markers[0].getPosition()),r.default_bounds=i,r.default_zoom=r.map.getZoom()}},{key:"getMap",value:function getMap(){return this.map}},{key:"getPopup",value:function getPopup(){return this.popup}},{key:"restoreBounds",value:function restoreBounds(){var t=this;t.default_bounds&&t.markers.length>1?t.map.fitBounds(t.default_bounds,{padding:30}):(t.markers[0]&&t.map.setCenter(t.markers[0].getPosition()),t.restoreZoom())}},{key:"restoreZoom",value:function restoreZoom(){this.map.setZoom(this.default_zoom)}}]),GoogleMapsDriver}();return r}(window),E={ENVS:["xs","sm","md","lg","xl","xxl","xxxl"],MAP_DRIVER:I};function map_api_defineProperties(t,r){for(var o=0;o<r.length;o++){var i=r[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}!function(a){var u="js-mapapi",l=E.MAP_DRIVER,c=function(){function MapAPI(t){!function map_api_classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MapAPI);var r=this,o=new l,a=document.querySelector("body"),c=t.dataset;c.center=[c.lng?c.lng:a.dataset["default-lng"],c.lat?c.lat:a.dataset["default-lat"]],c.icon||(c.icon='<i class="fas fa-map-marker-alt"></i>'),console.log("".concat(u,": init ").concat(o.getName(),"...")),r.drv=o,r.el=t,r.config=c,o.init(t,c),t.addEventListener(i,(function(){r.addMarkers()}))}return function map_api_createClass(t,r,o){return r&&map_api_defineProperties(t.prototype,r),o&&map_api_defineProperties(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}(MapAPI,[{key:"getMap",value:function getMap(){return ui.map}},{key:"dispose",value:function dispose(){this.el=null,this.el.classList.remove("".concat(u,"-active"))}},{key:"addMarkers",value:function addMarkers(){console.log("".concat(u,": addMarkers"));var t=this,r=t.el,i=t.drv,a=t.config;if(t.map=i.getMap(),a.geojson)console.log("".concat(u,": setting up geocode data")),i.addGeoJson(a);else if(a.address)console.log(a.address),console.log("".concat(u,": setting up address marker")),i.geocode(a.address,(function(r){console.log(r);var o=r[0].geometry.location.lat(),l=r[0].geometry.location.lng();console.log("".concat(u,": setting up single lat/lng marker lat: ").concat(o," lng: ").concat(l)),i.addMarker([l,o],a),t.map.setCenter({lat:o,lng:l})}));else if(a.lat&&a.lng){var l=a.lat,c=a.lng;console.log("".concat(u,": setting up single lat/lng marker lat: ").concat(l," lng: ").concat(c)),i.addMarker([c,l],a)}r.classList.add("".concat(u,"-active")),r.dispatchEvent(new Event(o)),console.log("".concat(u,": Map is loaded"))}}]),MapAPI}(),p=function init(){console.log("".concat(u,": init")),document.querySelectorAll(".".concat(u)).forEach((function(t,r){new c(t)}))};a.addEventListener("".concat(r),p),a.addEventListener("".concat(t),p)}(window)}()}();