(self.webpackChunkgms_ui=self.webpackChunkgms_ui||[]).push([[986],{75550:function(ne){"use strict";ne.exports=H;function H(s,f){this.x=s,this.y=f}H.prototype={clone:function(){return new H(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,f){return this.clone()._rotateAround(s,f)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var f=s.x-this.x,A=s.y-this.y;return f*f+A*A},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,f){return Math.atan2(this.x*f-this.y*s,this.x*s+this.y*f)},_matMult:function(s){var f=s[0]*this.x+s[1]*this.y,A=s[2]*this.x+s[3]*this.y;return this.x=f,this.y=A,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var f=Math.cos(s),A=Math.sin(s),u=f*this.x-A*this.y,T=A*this.x+f*this.y;return this.x=u,this.y=T,this},_rotateAround:function(s,f){var A=Math.cos(s),u=Math.sin(s),T=f.x+A*(this.x-f.x)-u*(this.y-f.y),O=f.y+u*(this.x-f.x)+A*(this.y-f.y);return this.x=T,this.y=O,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},H.convert=function(s){return s instanceof H?s:Array.isArray(s)?new H(s[0],s[1]):s}},26729:function(ne){"use strict";var H=Object.prototype.hasOwnProperty,s="~";function f(){}Object.create&&(f.prototype=Object.create(null),new f().__proto__||(s=!1));function A(L,y,v){this.fn=L,this.context=y,this.once=v||!1}function u(L,y,v,_,x){if(typeof v!="function")throw new TypeError("The listener must be a function");var k=new A(v,_||L,x),C=s?s+y:y;return L._events[C]?L._events[C].fn?L._events[C]=[L._events[C],k]:L._events[C].push(k):(L._events[C]=k,L._eventsCount++),L}function T(L,y){--L._eventsCount==0?L._events=new f:delete L._events[y]}function O(){this._events=new f,this._eventsCount=0}O.prototype.eventNames=function(){var y=[],v,_;if(this._eventsCount===0)return y;for(_ in v=this._events)H.call(v,_)&&y.push(s?_.slice(1):_);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(v)):y},O.prototype.listeners=function(y){var v=s?s+y:y,_=this._events[v];if(!_)return[];if(_.fn)return[_.fn];for(var x=0,k=_.length,C=new Array(k);x=this.retries+1}createUrl(){let n=this.url;return n+=`?callback=${this.CALLBACK}`,this.apiKey&&(n+=`&key=${this.apiKey}`),this.channel&&(n+=`&channel=${this.channel}`),this.client&&(n+=`&client=${this.client}`),this.libraries.length>0&&(n+=`&libraries=${this.libraries.join(",")}`),this.language&&(n+=`&language=${this.language}`),this.region&&(n+=`®ion=${this.region}`),this.version&&(n+=`&v=${this.version}`),this.mapIds&&(n+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(n+=`&auth_referrer_policy=${this.authReferrerPolicy}`),n}deleteScript(){const n=document.getElementById(this.id);n&&n.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((n,o)=>{this.loadCallback(t=>{t?o(t.error):n(window.google)})})}loadCallback(n){this.callbacks.push(n),this.execute()}setScript(){if(document.getElementById(this.id)){this.callback();return}const n=this.createUrl(),o=document.createElement("script");o.id=this.id,o.type="text/javascript",o.src=n,o.onerror=this.loadErrorCallback.bind(this),o.defer=!0,o.async=!0,this.nonce&&(o.nonce=this.nonce),document.head.appendChild(o)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(n){if(this.errors.push(n),this.errors.length<=this.retries){const o=this.errors.length*Math.pow(2,this.errors.length);console.log(`Failed to load Google Maps script, retrying in ${o} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},o)}else this.onerrorEvent=n,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(n=>{n(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}var k=s(75550),C=s.n(k);function M(){return(M=Object.assign||function(r){for(var n=1;n=0||(m[l]=i[l]);return m}(r,["key"]);return he||(he=new x(M({apiKey:e||""},a,{libraries:o}))),q=he.load().then(function(){return pe(window.google.maps),window.google.maps}),pe(q),q};function xe(r,n,o){var t=o-n;return r===o?r:((r-n)%t+t)%t+n}var W=function(){function r(n,o){if(isNaN(n)||isNaN(o))throw new Error("Invalid LatLng object: ("+n+", "+o+")");this.lat=+n,this.lng=+o}return r.prototype.wrap=function(){return new r(this.lat,xe(this.lng,-180,180))},r}();W.convert=function(r){return r instanceof W?r:Array.isArray(r)?new W(r[0],r[1]):"lng"in r&&"lat"in r?new W(r.lat,r.lng):r};var Ke=function(){function r(t,e,a){this.tileSize=t||512,this._minZoom=e||0,this._maxZoom=a||52,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new W(0,0),this.angle=0}var n,o=r.prototype;return o.zoomScale=function(t){return Math.pow(2,t)},o.scaleZoom=function(t){return Math.log(t)/Math.LN2},o.project=function(t,e){return new(C())(this.lngX(t.lng,e),this.latY(t.lat,e))},o.unproject=function(t,e){return new W(this.yLat(t.y,e),this.xLng(t.x,e))},o.lngX=function(t,e){return(180+t)*(e||this.worldSize)/360},o.latY=function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},o.xLng=function(t,e){return 360*t/(e||this.worldSize)-180},o.yLat=function(t,e){return 360/Math.PI*Math.atan(Math.exp((180-360*t/(e||this.worldSize))*Math.PI/180))-90},o.locationPoint=function(t){var e=this.project(t);return this.centerPoint._sub(this.point._sub(e)._rotate(this.angle))},o.pointLocation=function(t){var e=this.centerPoint._sub(t)._rotate(-this.angle);return this.unproject(this.point.sub(e))},(n=[{key:"minZoom",get:function(){return this._minZoom},set:function(t){this._minZoom=t,this.zoom=Math.max(this.zoom,t)}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(t){this._maxZoom=t,this.zoom=Math.min(this.zoom,t)}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerPoint",get:function(){return new(C())(0,0)}},{key:"size",get:function(){return new(C())(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(t){this.angle=-xe(t,-180,180)*Math.PI/180}},{key:"zoom",get:function(){return this._zoom},set:function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}},{key:"x",get:function(){return this.lngX(this.center.lng)}},{key:"y",get:function(){return this.latY(this.center.lat)}},{key:"point",get:function(){return new(C())(this.x,this.y)}}])&&function(t,e){for(var a=0;a0&&this.getHeight()-e-i>0){var l=this.transform_.pointLocation(C().convert({x:c-this.getWidth()/2,y:e-this.getHeight()/2})),d=this.transform_.pointLocation(C().convert({x:this.getWidth()/2-a,y:this.getHeight()/2-i})),m=[l.lat,l.lng,d.lat,d.lng,d.lat,l.lng,l.lat,d.lng];return t&&(m=m.map(function(h){return Math.round(h*t)/t})),m}return[0,0,0,0]},r}();function De(r){if(window.requestAnimationFrame)return window.requestAnimationFrame(r);var n=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return n?n(r):window.setTimeout(r,1e3/60)}var ce=Math.log2?Math.log2:function(r){return Math.log(r)/Math.LN2};function Oe(r,n){return Object.keys(r).reduce(function(o,t){return n(r[t])&&(o[t]=r[t]),o},{})}var G=function(r){if(r!==null&&typeof r=="object"){if(Object.keys(r).length===0)return!0}else if(r==null||r==="")return!0;return!1},Fe=Object.prototype.toString;function ie(r){return typeof r=="number"||function(n){return!!n&&typeof n=="object"}(r)&&Fe.call(r)==="[object Number]"}var re=null;function Se(){if(re)return re;if(typeof navigator!="undefined"){var r=navigator.userAgent.indexOf("MSIE")>-1,n=navigator.userAgent.indexOf("Firefox")>-1,o=navigator.userAgent.toLowerCase().indexOf("op")>-1,t=navigator.userAgent.indexOf("Chrome")>-1,e=navigator.userAgent.indexOf("Safari")>-1;return t&&e&&(e=!1),t&&o&&(t=!1),re={isExplorer:r,isFirefox:n,isOpera:o,isChrome:t,isSafari:e}}return re={isChrome:!0,isExplorer:!1,isFirefox:!1,isOpera:!1,isSafari:!1}}var ke=function(r){return Function.prototype.toString.call(r)};function Y(r){if(!r||typeof r!="object")return!1;var n=typeof r.constructor=="function"?Object.getPrototypeOf(r):Object.prototype;if(n===null)return!0;var o=n.constructor;return typeof o=="function"&&o instanceof o&&ke(o)===ke(Object)}function X(r,n,o,t){r.addEventListener(n,o,function(){var e=!1;try{var a=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",a,a),window.removeEventListener("test",a,a)}catch(i){e=!1}return e}()?{capture:t,passive:!0}:t)}var K,de=!(typeof window=="undefined"||!window.document||!window.document.createElement);K=de?window:typeof self!="undefined"?self:void 0;var Ee,fe=typeof document!="undefined"&&document.attachEvent,ze=!1;if(de&&!fe){var Ge=function(){var r=K.requestAnimationFrame||K.mozRequestAnimationFrame||K.webkitRequestAnimationFrame||function(n){return K.setTimeout(n,20)};return function(n){return r(n)}}(),$e=(Ee=K.cancelAnimationFrame||K.mozCancelAnimationFrame||K.webkitCancelAnimationFrame||K.clearTimeout,function(r){return Ee(r)}),ge=function(r){var n=r.__resizeTriggers__,o=n.firstElementChild,t=n.lastElementChild,e=o.firstElementChild;t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight,e.style.width=o.offsetWidth+1+"px",e.style.height=o.offsetHeight+1+"px",o.scrollLeft=o.scrollWidth,o.scrollTop=o.scrollHeight},Te=function(r){var n=this;ge(this),this.__resizeRAF__&&$e(this.__resizeRAF__),this.__resizeRAF__=Ge(function(){(function(o){return o.offsetWidth!=o.__resizeLast__.width||o.offsetHeight!=o.__resizeLast__.height})(n)&&(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(o){o.call(n,r)}))})},me=!1,_e="",ve="animationstart",ye="Webkit Moz O ms".split(" "),Ve="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");if(de){var Pe=document.createElement("fakeelement");if(Pe.style.animationName!==void 0&&(me=!0),me===!1){for(var J=0;J0||e.geoService_.getHeight()>0){var i=Math.ceil(e.geoService_.getWidth()/256)+2,c=Math.ceil(e.geoService_.getHeight()/256)+2,l=Math.max(i,c);return Math.ceil(ce(l))}return 3},e._computeMinZoom=function(i){return G(i)?e._getMinZoom():i},e._mapDomResizeCallback=function(){if(e.resetSizeOnIdle_=!0,e.maps_){var i=e.props.center||e.props.defaultCenter,c=e.map_.getCenter();e.maps_.event.trigger(e.map_,"resize"),e.map_.setCenter(e.props.resetBoundsOnResize?i:c)}},e._setLayers=function(i){i.forEach(function(c){e.layers_[c]=new e.maps_[c],e.layers_[c].setMap(e.map_)})},e._renderPortal=function(){return f.createElement(oe,{experimental:e.props.experimental,onChildClick:e._onChildClick,onChildMouseDown:e._onChildMouseDown,onChildMouseEnter:e._onChildMouseEnter,onChildMouseLeave:e._onChildMouseLeave,geoService:e.geoService_,insideMapPanes:!0,distanceToMouse:e.props.distanceToMouse,getHoverDistance:e._getHoverDistance,dispatcher:e.markersDispatcher_})},e._initMap=function(){if(!e.initialized_){e.initialized_=!0;var i=ae(e.props.center||e.props.defaultCenter);e.geoService_.setView(i,e.props.zoom||e.props.defaultZoom,0),e._onBoundsChanged();var c=M({},e.props.apiKey&&{key:e.props.apiKey},e.props.bootstrapURLKeys);e.props.googleMapLoader(c,e.props.heatmapLibrary).then(function(l){if(e.mounted_){var d,m,h=e.geoService_.getCenter(),S={zoom:e.props.zoom||e.props.defaultZoom,center:new l.LatLng(h.lat,h.lng)};e.props.heatmap.positions&&(Object.assign(N(e),{heatmap:(d=l,m=e.props.heatmap,new d.visualization.HeatmapLayer({data:m.positions.reduce(function(z,$){var P=$.weight,F=P===void 0?1:P;return z.push({location:new d.LatLng($.lat,$.lng),weight:F}),z},[])}))}),function(z,$){var P=$.options,F=P===void 0?{}:P;Object.keys(F).map(function(te){return z.set(te,F[te])})}(e.heatmap,e.props.heatmap));var b=Oe(l,Y),E=typeof e.props.options=="function"?e.props.options(b):e.props.options,I=!G(e.props.draggable)&&{draggable:e.props.draggable},R=e._computeMinZoom(E.minZoom);e.minZoom_=R;var U=M({},{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}],minZoom:3},{minZoom:R},E,S);e.defaultDraggableOption_=G(U.draggable)?e.defaultDraggableOption_:U.draggable;var V=M({},U,I);V.minZoom=Ie(V.minZoom,R);var w=new l.Map(T.findDOMNode(e.googleMapDom_),V);e.map_=w,e.maps_=l,e._setLayers(e.props.layerTypes);var ee=l.version.match(/^3\.(\d+)\./),et=ee&&Number(ee[1]),p=N(e),we=Object.assign(new l.OverlayView,{onAdd:function(){var z=typeof screen!="undefined"?screen.width+"px":"2000px",$=typeof screen!="undefined"?screen.height+"px":"2000px",P=document.createElement("div");if(P.style.backgroundColor="transparent",P.style.position="absolute",P.style.left="0px",P.style.top="0px",P.style.width=z,P.style.height=$,p.props.overlayViewDivStyle){var F=p.props.overlayViewDivStyle;typeof F=="object"&&Object.keys(F).forEach(function(te){P.style[te]=F[te]})}this.getPanes().overlayMouseTarget.appendChild(P),p.geoService_.setMapCanvasProjection(l,we.getProjection()),se?p.setState({overlay:P}):Ae(p,p._renderPortal(),P,function(){return p.setState({overlay:P})})},onRemove:function(){var z=p.state.overlay;z&&!se&&T.unmountComponentAtNode(z),p.setState({overlay:null})},draw:function(){if(p.updateCounter_++,p._onBoundsChanged(w,l,!p.props.debounced),p.googleApiLoadedCalled_||(p._onGoogleApiLoaded({map:w,maps:l,ref:p.googleMapDom_}),p.googleApiLoadedCalled_=!0),p.mouse_){var z=p.geoService_.fromContainerPixelToLatLng(p.mouse_);p.mouse_.lat=z.lat,p.mouse_.lng=z.lng}p._onChildMouseMove(),p.markersDispatcher_&&(p.markersDispatcher_.emit("kON_CHANGE"),p.fireMouseEventOnIdle_&&p.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE"))}});e.overlay_=we,we.setMap(w),e.props.heatmap.positions&&e.heatmap.setMap(w),e.props.onTilesLoaded&&l.event.addListener(w,"tilesloaded",function(){p._onTilesLoaded()}),l.event.addListener(w,"zoom_changed",function(){p.geoService_.getZoom()!==w.getZoom()&&(p.zoomAnimationInProgress_||(p.zoomAnimationInProgress_=!0,p._onZoomAnimationStart(w.zoom)),et<32)&&(new Date().getTime()-e.zoomControlClickTime_<300?De(function(){return De(function(){p.updateCounter_++,p._onBoundsChanged(w,l)})}):(p.updateCounter_++,p._onBoundsChanged(w,l)))}),l.event.addListener(w,"idle",function(){if(e.resetSizeOnIdle_){e._setViewSize();var z=e._computeMinZoom(E.minZoom);z!==e.minZoom_&&(e.minZoom_=z,w.setOptions({minZoom:z})),e.resetSizeOnIdle_=!1}p.zoomAnimationInProgress_&&(p.zoomAnimationInProgress_=!1,p._onZoomAnimationEnd(w.zoom)),p.updateCounter_++,p._onBoundsChanged(w,l),p.dragTime_=0,p.markersDispatcher_&&p.markersDispatcher_.emit("kON_CHANGE")}),l.event.addListener(w,"mouseover",function(){p.mouseInMap_=!0}),l.event.addListener(w,"click",function(){p.mouseInMap_=!0}),l.event.addListener(w,"mouseout",function(){p.mouseInMap_=!1,p.mouse_=null,p.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE")}),l.event.addListener(w,"drag",function(){p.dragTime_=new Date().getTime(),p._onDrag(w)}),l.event.addListener(w,"dragend",function(){var z=l.event.addListener(w,"idle",function(){l.event.removeListener(z),p._onDragEnd(w)})}),l.event.addListener(w,"maptypeid_changed",function(){p._onMapTypeIdChange(w.getMapTypeId())})}}).catch(function(l){throw e._onGoogleApiLoaded({map:null,maps:null,ref:e.googleMapDom_}),console.error(l),l})}},e._onGoogleApiLoaded=function(){var i;e.props.onGoogleApiLoaded&&(i=e.props).onGoogleApiLoaded.apply(i,arguments)},e._getHoverDistance=function(){return e.props.hoverDistance},e._onDrag=function(){var i;return e.props.onDrag&&(i=e.props).onDrag.apply(i,arguments)},e._onDragEnd=function(){var i;return e.props.onDragEnd&&(i=e.props).onDragEnd.apply(i,arguments)},e._onMapTypeIdChange=function(){var i;return e.props.onMapTypeIdChange&&(i=e.props).onMapTypeIdChange.apply(i,arguments)},e._onZoomAnimationStart=function(){var i;return e.props.onZoomAnimationStart&&(i=e.props).onZoomAnimationStart.apply(i,arguments)},e._onZoomAnimationEnd=function(){var i;return e.props.onZoomAnimationEnd&&(i=e.props).onZoomAnimationEnd.apply(i,arguments)},e._onTilesLoaded=function(){return e.props.onTilesLoaded&&e.props.onTilesLoaded()},e._onChildClick=function(){var i;if(e.props.onChildClick)return(i=e.props).onChildClick.apply(i,arguments)},e._onChildMouseDown=function(i,c){e.childMouseDownArgs_=[i,c],e.props.onChildMouseDown&&e.props.onChildMouseDown(i,c,M({},e.mouse_))},e._onChildMouseUp=function(){var i;e.childMouseDownArgs_&&(e.props.onChildMouseUp&&(i=e.props).onChildMouseUp.apply(i,e.childMouseDownArgs_.concat([M({},e.mouse_)])),e.childMouseDownArgs_=null,e.childMouseUpTime_=new Date().getTime())},e._onChildMouseMove=function(){var i;e.childMouseDownArgs_&&e.props.onChildMouseMove&&(i=e.props).onChildMouseMove.apply(i,e.childMouseDownArgs_.concat([M({},e.mouse_)]))},e._onChildMouseEnter=function(){var i;if(e.props.onChildMouseEnter)return(i=e.props).onChildMouseEnter.apply(i,arguments)},e._onChildMouseLeave=function(){var i;if(e.props.onChildMouseLeave)return(i=e.props).onChildMouseLeave.apply(i,arguments)},e._setViewSize=function(){if(e.mounted_){if(document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)e.geoService_.setViewSize(window.innerWidth,window.innerHeight);else{var i=T.findDOMNode(e.googleMapDom_);e.geoService_.setViewSize(i.clientWidth,i.clientHeight)}e._onBoundsChanged()}},e._onWindowResize=function(){e.resetSizeOnIdle_=!0},e._onMapMouseMove=function(i){if(e.mouseInMap_){var c=new Date().getTime();c-e.mouseMoveTime_>50&&(e.boundingRect_=i.currentTarget.getBoundingClientRect()),e.mouseMoveTime_=c;var l=i.clientX-e.boundingRect_.left,d=i.clientY-e.boundingRect_.top;e.mouse_||(e.mouse_={x:0,y:0,lat:0,lng:0}),e.mouse_.x=l,e.mouse_.y=d;var m=e.geoService_.fromContainerPixelToLatLng(e.mouse_);e.mouse_.lat=m.lat,e.mouse_.lng=m.lng,e._onChildMouseMove(),c-e.dragTime_<100?e.fireMouseEventOnIdle_=!0:(e.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE"),e.fireMouseEventOnIdle_=!1)}},e._onClick=function(){var i;return e.props.onClick&&!e.childMouseDownArgs_&&new Date().getTime()-e.childMouseUpTime_>300&&e.dragTime_===0&&(i=e.props).onClick.apply(i,arguments)},e._onMapClick=function(i){e.markersDispatcher_&&(e._onMapMouseMove(i),new Date().getTime()-e.dragTime_>100&&(e.mouse_&&e._onClick(M({},e.mouse_,{event:i})),e.markersDispatcher_.emit("kON_CLICK",i)))},e._onMapMouseDownNative=function(i){e.mouseInMap_&&e._onMapMouseDown(i)},e._onMapMouseDown=function(i){e.markersDispatcher_&&new Date().getTime()-e.dragTime_>100&&(e._onMapMouseMove(i),e.markersDispatcher_.emit("kON_MDOWN",i))},e._onMapMouseDownCapture=function(){Se().isChrome&&(e.zoomControlClickTime_=new Date().getTime())},e._onKeyDownCapture=function(){Se().isChrome&&(e.zoomControlClickTime_=new Date().getTime())},e._isCenterDefined=function(i){return i&&(Y(i)&&ie(i.lat)&&ie(i.lng)||i.length===2&&ie(i[0])&&ie(i[1]))},e._onBoundsChanged=function(i,c,l){if(i){var d=i.getCenter();e.geoService_.setView([d.lat(),d.lng()],i.getZoom(),0)}if((e.props.onChange||e.props.onBoundsChange)&&e.geoService_.canProject()){var m=e.geoService_.getZoom(),h=e.geoService_.getBounds(),S=e.geoService_.getCenter();if(!function(E,I,R){if(E&&I){for(var U=0;U!==E.length;++U)if(Math.abs(E[U]-I[U])>1e-5)return!1;return!0}return!1}(h,e.prevBounds_)&&l!==!1){var b=e.geoService_.getBounds(e.props.margin);e.props.onBoundsChange&&e.props.onBoundsChange(e.centerIsObject_?M({},S):[S.lat,S.lng],m,h,b),e.props.onChange&&e.props.onChange({center:M({},S),zoom:m,bounds:{nw:{lat:h[0],lng:h[1]},se:{lat:h[2],lng:h[3]},sw:{lat:h[4],lng:h[5]},ne:{lat:h[6],lng:h[7]}},marginBounds:{nw:{lat:b[0],lng:b[1]},se:{lat:b[2],lng:b[3]},sw:{lat:b[4],lng:b[5]},ne:{lat:b[6],lng:b[7]}},size:e.geoService_.hasSize()?{width:e.geoService_.getWidth(),height:e.geoService_.getHeight()}:{width:0,height:0}}),e.prevBounds_=h}}},e._registerChild=function(i){e.googleMapDom_=i},e.mounted_=!1,e.initialized_=!1,e.googleApiLoadedCalled_=!1,e.map_=null,e.maps_=null,e.prevBounds_=null,e.heatmap=null,e.layers_={},e.mouse_=null,e.mouseMoveTime_=0,e.boundingRect_=null,e.mouseInMap_=!0,e.dragTime_=0,e.fireMouseEventOnIdle_=!1,e.updateCounter_=0,e.markersDispatcher_=new ue(N(e)),e.geoService_=new We(256),e.centerIsObject_=Y(e.props.center),e.minZoom_=3,e.defaultDraggableOption_=!0,e.zoomControlClickTime_=0,e.childMouseDownArgs_=null,e.childMouseUpTime_=0,e.googleMapDom_=null,e._isCenterDefined(e.props.center||e.props.defaultCenter)){var a=ae(e.props.center||e.props.defaultCenter);e.geoService_.setView(a,e.props.zoom||e.props.defaultZoom,0)}return e.zoomAnimationInProgress_=!1,e.state={overlay:null},e}g(n,r);var o=n.prototype;return o.componentDidMount=function(){var t=this;this.mounted_=!0,X(window,"resize",this._onWindowResize,!1),X(window,"keydown",this._onKeyDownCapture,!0);var e=T.findDOMNode(this.googleMapDom_);e&&X(e,"mousedown",this._onMapMouseDownNative,!0),X(window,"mouseup",this._onChildMouseUp,!1);var a=M({},this.props.apiKey&&{key:this.props.apiKey},this.props.bootstrapURLKeys);this.props.googleMapLoader(a,this.props.heatmapLibrary),setTimeout(function(){t._setViewSize(),t._isCenterDefined(t.props.center||t.props.defaultCenter)&&t._initMap()},0,this),this.props.resetBoundsOnResize&&function(i,c){if(i.parentNode===void 0){var l=document.createElement("div");i.parentNode=l}i=i.parentNode,fe?i.attachEvent("onresize",c):(i.__resizeTriggers__||(getComputedStyle(i).position=="static"&&(i.style.position="relative"),function(){if(!ze){var d=(qe||"")+".resize-triggers { "+(Ye||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',m=document.head||document.getElementsByTagName("head")[0],h=document.createElement("style");h.type="text/css",h.styleSheet?h.styleSheet.cssText=d:h.appendChild(document.createTextNode(d)),m.appendChild(h),ze=!0}}(),i.__resizeLast__={},i.__resizeListeners__=[],(i.__resizeTriggers__=document.createElement("div")).className="resize-triggers",i.__resizeTriggers__.innerHTML='
',i.appendChild(i.__resizeTriggers__),ge(i),X(i,"scroll",Te,!0),ve&&i.__resizeTriggers__.addEventListener(ve,function(d){d.animationName==Me&&ge(i)})),i.__resizeListeners__.push(c))}(e,this._mapDomResizeCallback)},o.shouldComponentUpdate=function(t,e){return!j(Z(this.props,["draggable"]),Z(t,["draggable"]))||!j(this.state,e)},o.componentDidUpdate=function(t){var e=this;if(!this._isCenterDefined(t.center)&&this._isCenterDefined(this.props.center)&&setTimeout(function(){return e._initMap()},0),this.map_){var a=this.geoService_.getCenter();if(this._isCenterDefined(this.props.center)){var i=ae(this.props.center),c=this._isCenterDefined(t.center)?ae(t.center):null;(!c||Math.abs(i.lat-c.lat)+Math.abs(i.lng-c.lng)>1e-5)&&Math.abs(i.lat-a.lat)+Math.abs(i.lng-a.lng)>1e-5&&this.map_.panTo({lat:i.lat,lng:i.lng})}if(G(this.props.zoom)||Math.abs(this.props.zoom-t.zoom)>0&&this.map_.setZoom(this.props.zoom),!G(t.draggable)&&G(this.props.draggable)?this.map_.setOptions({draggable:this.defaultDraggableOption_}):j(t.draggable,this.props.draggable)||this.map_.setOptions({draggable:this.props.draggable}),!G(this.props.options)&&!j(t.options,this.props.options)){var l=Oe(this.maps_,Y),d=typeof this.props.options=="function"?this.props.options(l):this.props.options;if("minZoom"in(d=Z(d,["zoom","center","draggable"]))){var m=this._computeMinZoom(d.minZoom);d.minZoom=Ie(d.minZoom,m)}this.map_.setOptions(d)}j(this.props.layerTypes,t.layerTypes)||(Object.keys(this.layers_).forEach(function(h){e.layers_[h].setMap(null),delete e.layers_[h]}),this._setLayers(this.props.layerTypes)),this.heatmap&&!j(this.props.heatmap.positions,t.heatmap.positions)&&this.heatmap.setData(this.props.heatmap.positions.map(function(h){return{location:new e.maps_.LatLng(h.lat,h.lng),weight:h.weight}})),this.heatmap&&!j(this.props.heatmap.options,t.heatmap.options)&&Object.keys(this.props.heatmap.options).forEach(function(h){e.heatmap.set(h,e.props.heatmap.options[h])})}this.markersDispatcher_.emit("kON_CHANGE"),j(this.props.hoverDistance,t.hoverDistance)||this.markersDispatcher_.emit("kON_MOUSE_POSITION_CHANGE")},o.componentWillUnmount=function(){this.mounted_=!1;var t,e,a=T.findDOMNode(this.googleMapDom_);a&&a.removeEventListener("mousedown",this._onMapMouseDownNative,!0),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("keydown",this._onKeyDownCapture),window.removeEventListener("mouseup",this._onChildMouseUp,!1),this.props.resetBoundsOnResize&&(e=this._mapDomResizeCallback,t=(t=a).parentNode,fe?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",Te),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))),this.overlay_&&this.overlay_.setMap(null),this.maps_&&this.map_&&this.props.shouldUnregisterMapOnUnmount&&(this.map_.setOptions({scrollwheel:!1}),this.maps_.event.clearInstanceListeners(this.map_)),this.props.shouldUnregisterMapOnUnmount&&(this.map_=null,this.maps_=null),this.markersDispatcher_.dispose(),this.resetSizeOnIdle_=!1,this.props.shouldUnregisterMapOnUnmount&&(delete this.map_,delete this.markersDispatcher_)},o.render=function(){var t=this.state.overlay,e=t?null:f.createElement(Re,{experimental:this.props.experimental,onChildClick:this._onChildClick,onChildMouseDown:this._onChildMouseDown,onChildMouseEnter:this._onChildMouseEnter,onChildMouseLeave:this._onChildMouseLeave,geoService:this.geoService_,insideMapPanes:!1,distanceToMouse:this.props.distanceToMouse,getHoverDistance:this._getHoverDistance,dispatcher:this.markersDispatcher_});return f.createElement("div",{style:this.props.style,onMouseMove:this._onMapMouseMove,onMouseDownCapture:this._onMapMouseDownCapture,onClick:this._onMapClick},f.createElement(D,{registerChild:this._registerChild}),se&&t&&Ae(this._renderPortal(),t),e)},n}(f.Component);function Q(r){var n=r.lng,o=Math.sin(r.lat*Math.PI/180),t=n/360+.5,e=.5-.25*Math.log((1+o)/(1-o))/Math.PI;return{x:t,y:e=e<0?0:e>1?1:e}}function Ce(r){var n=r.x,o=Math.PI-2*Math.PI*r.y;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o))),lng:360*n-180}}function Ne(r,n,o,t){var e=Q(r),a=Q(n),i=e.x0?.5*(e.x+a.x-1):.5*(1+e.x+a.x),y:.5*(e.y+a.y)},S=Math.pow(2,m),b=o/S/256/2,E=t/S/256/2,I=Ce({x:h.x-b,y:h.y-E}),R=Ce({x:h.x+b,y:h.y+E});return{center:Ce(h),zoom:m,newBounds:{nw:I,se:R}}}function Xe(r){var n=r.ne,o=r.sw;return{nw:{lat:n.lat,lng:o.lng},se:{lat:o.lat,lng:n.lng}}}function Je(r){var n=r.nw,o=r.se;return{ne:{lat:n.lat,lng:o.lng},sw:{lat:o.lat,lng:n.lng}}}function tt(r,n){var o,t=r.nw,e=r.se,a=r.ne,i=r.sw,c=n.width,l=n.height;if(t&&e)o=Ne(t,e,c,l);else{var d=Xe({ne:a,sw:i});o=Ne(d.nw,d.se,c,l)}return M({},o,{newBounds:M({},o.newBounds,Je(o.newBounds))})}function nt(r,n,o){var t=function(c,l){var d=function(b,E){var I,R=E.lat,U=E.lng,V=(I=R*Math.PI/180,{metersPerLatDegree:111132.92-559.82*Math.cos(2*I)+1.175*Math.cos(4*I)-.0023*Math.cos(6*I),metersPerLngDegree:111412.84*Math.cos(I)-93.5*Math.cos(3*I)+.118*Math.cos(5*I)}),w=.5*b/V.metersPerLatDegree,ee=.5*b/V.metersPerLngDegree;return{nw:{lat:R-w,lng:U-ee},se:{lat:R+w,lng:U+ee}}}(c,{lat:l.lat,lng:l.lng}),m=d.se,h=Q(d.nw),S=Q(m);return{w:Math.abs(S.x-h.x),h:Math.abs(S.y-h.y)}}(r,{lat:n.lat,lng:n.lng}),e=t.w,a=t.h,i=Math.pow(2,o);return{w:e*i*256,h:a*i*256}}function ot(r,n){var o=r.x,t=Math.PI-2*Math.PI*r.y/Math.pow(2,n);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(t)-Math.exp(-t))),lng:o/Math.pow(2,n)*360-180}}function it(r,n){var o=Q({lat:r.lat,lng:r.lng}),t=Math.pow(2,n);return{x:Math.floor(o.x*t),y:Math.floor(o.y*t)}}function rt(r,n){for(var o=r.from,t=r.to,e=Math.pow(2,n),a=[],i=o.x;i!==(t.x+1)%e;i=(i+1)%e)for(var c=o.y;c!==(t.y+1)%e;c=(c+1)%e)a.push([n,i,c]);return a}le.propTypes={apiKey:u().string,bootstrapURLKeys:u().any,defaultCenter:u().oneOfType([u().array,u().shape({lat:u().number,lng:u().number})]),center:u().oneOfType([u().array,u().shape({lat:u().number,lng:u().number})]),defaultZoom:u().number,zoom:u().number,onBoundsChange:u().func,onChange:u().func,onClick:u().func,onChildClick:u().func,onChildMouseDown:u().func,onChildMouseUp:u().func,onChildMouseMove:u().func,onChildMouseEnter:u().func,onChildMouseLeave:u().func,onZoomAnimationStart:u().func,onZoomAnimationEnd:u().func,onDrag:u().func,onDragEnd:u().func,onMapTypeIdChange:u().func,onTilesLoaded:u().func,options:u().any,distanceToMouse:u().func,hoverDistance:u().number,debounced:u().bool,margin:u().array,googleMapLoader:u().any,onGoogleApiLoaded:u().func,yesIWantToUseGoogleMapApiInternals:u().bool,draggable:u().bool,style:u().any,resetBoundsOnResize:u().bool,layerTypes:u().arrayOf(u().string),shouldUnregisterMapOnUnmount:u().bool},le.defaultProps={distanceToMouse:function(r,n){return Math.sqrt((r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y))},hoverDistance:30,debounced:!0,options:function(){return{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}],minZoom:3}},googleMapLoader:be,yesIWantToUseGoogleMapApiInternals:!1,style:{width:"100%",height:"100%",margin:0,padding:0,position:"relative"},layerTypes:[],heatmap:{},heatmapLibrary:!1,shouldUnregisterMapOnUnmount:!0},le.googleMapLoader=be;var Qe=le}}]);