@deatog/react-google-maps-api
Version:
React.js Google Maps API integration
1 lines • 144 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).reactGoogleMapsApi={},e.ReactJSXRuntime,e.React,e.ReactDOM)}(this,(function(e,t,s,n){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var o,i,a=r(n);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,t||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}function u(e,t,s){return(t=c(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h=p(function(){if(i)return o;i=1;var e=process.env.NODE_ENV;return o=function(t,s,n,r,o,i,a,l){if("production"!==e&&void 0===s)throw new Error("invariant requires an error message argument");if(!t){var c;if(void 0===s)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,l],p=0;(c=new Error(s.replace(/%s/g,(function(){return u[p++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}}()),d=s.createContext(null);function g(){h(!!s.useContext,"useGoogleMap is React hook and requires React version 16.8+");var e=s.useContext(d);return h(!!e,"useGoogleMap needs a GoogleMap available up in the tree"),e}function m(e,t,s,n){var r,o,i={};return r=e,o=(e,r)=>{var o=s[r];o!==t[r]&&(i[r]=o,e(n,o))},Object.keys(r).forEach((e=>o(r[e],e))),i}function f(e,t,s){var n,r,o,i=(n=s,r=function(s,n,r){return"function"==typeof e[r]&&s.push(google.maps.event.addListener(t,n,e[r])),s},o=[],Object.keys(n).reduce((function(e,t){return r(e,n[t],t)}),o));return i}function v(e){google.maps.event.removeListener(e)}function y(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(v)}function b(e){var{updaterMap:t,eventMap:s,prevProps:n,nextProps:r,instance:o}=e,i=f(r,o,s);return m(t,n,r,o),i}var C={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},E={extraMapTypes(e,t){t.forEach((function(t,s){e.mapTypes.set(String(s),t)}))},center(e,t){e.setCenter(t)},clickableIcons(e,t){e.setClickableIcons(t)},heading(e,t){e.setHeading(t)},mapTypeId(e,t){e.setMapTypeId(t)},options(e,t){e.setOptions(t)},streetView(e,t){e.setStreetView(t)},tilt(e,t){e.setTilt(t)},zoom(e,t){e.setZoom(t)}};s.memo((function(e){var{children:n,options:r,id:o,mapContainerStyle:i,mapContainerClassName:a,center:l,onClick:c,onDblClick:u,onDrag:p,onDragEnd:h,onDragStart:g,onMouseMove:m,onMouseOut:f,onMouseOver:v,onMouseDown:y,onMouseUp:b,onRightClick:C,onCenterChanged:E,onLoad:M,onUnmount:w}=e,[x,L]=s.useState(null),P=s.useRef(null);return s.useEffect((()=>{r&&null!==x&&x.setOptions(r)}),[x,r]),s.useEffect((()=>{null!==x&&void 0!==l&&x.setCenter(l)}),[x,l]),s.useEffect((()=>{if(x&&u){var e=google.maps.event.addListener(x,"dblclick",u);return()=>{e.remove()}}}),[x,u]),s.useEffect((()=>{if(x&&h){var e=google.maps.event.addListener(x,"dragend",h);return()=>{e.remove()}}}),[x,h]),s.useEffect((()=>{if(x&&g){var e=google.maps.event.addListener(x,"dragstart",g);return()=>{e.remove()}}}),[x,g]),s.useEffect((()=>{if(x&&y){var e=google.maps.event.addListener(x,"mousedown",y);return()=>{e.remove()}}}),[x,y]),s.useEffect((()=>{if(x&&m){var e=google.maps.event.addListener(x,"mousemove",m);return()=>{e.remove()}}}),[x,m]),s.useEffect((()=>{if(x&&f){var e=google.maps.event.addListener(x,"mouseout",f);return()=>{e.remove()}}}),[x,f]),s.useEffect((()=>{if(x&&v){var e=google.maps.event.addListener(x,"mouseover",v);return()=>{e.remove()}}}),[x,v]),s.useEffect((()=>{if(x&&b){var e=google.maps.event.addListener(x,"mouseup",b);return()=>{e.remove()}}}),[x,b]),s.useEffect((()=>{if(x&&C){var e=google.maps.event.addListener(x,"rightclick",C);return()=>{e.remove()}}}),[x,C]),s.useEffect((()=>{if(x&&c){var e=google.maps.event.addListener(x,"click",c);return()=>{e.remove()}}}),[x,c]),s.useEffect((()=>{if(x&&p){var e=google.maps.event.addListener(x,"drag",p);return()=>{e.remove()}}}),[x,p]),s.useEffect((()=>{if(x&&E){var e=google.maps.event.addListener(x,"center_changed",E);return()=>{e.remove()}}}),[c]),s.useEffect((()=>{x&&M&&M(x)}),[x,M]),s.useEffect((()=>{if(x&&w)return()=>{w(x)}}),[x,w]),s.useEffect((()=>{var e=null===P.current?null:new google.maps.Map(P.current,r);L(e)}),[]),t.jsx("div",{id:o,ref:P,style:i,className:a,children:t.jsx(d.Provider,{value:x,children:null!==x?n:null})})}));class M extends s.PureComponent{constructor(){super(...arguments),u(this,"state",{map:null}),u(this,"registeredEvents",[]),u(this,"mapRef",null),u(this,"getInstance",(()=>null===this.mapRef?null:new google.maps.Map(this.mapRef,this.props.options))),u(this,"panTo",(e=>{var t=this.getInstance();t&&t.panTo(e)})),u(this,"setMapCallback",(()=>{null!==this.state.map&&this.props.onLoad&&this.props.onLoad(this.state.map)})),u(this,"getRef",(e=>{this.mapRef=e}))}componentDidMount(){var e=this.getInstance();this.registeredEvents=b({updaterMap:E,eventMap:C,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{map:e}}),this.setMapCallback)}componentDidUpdate(e){null!==this.state.map&&(y(this.registeredEvents),this.registeredEvents=b({updaterMap:E,eventMap:C,prevProps:e,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),y(this.registeredEvents))}render(){return t.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:t.jsx(d.Provider,{value:this.state.map,children:null!==this.state.map?this.props.children:null})})}}function w(e,t,s,n,r,o,i){try{var a=e[o](i),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function x(e){return function(){var t=this,s=arguments;return new Promise((function(n,r){var o=e.apply(t,s);function i(e){w(o,n,r,i,a,"next",e)}function a(e){w(o,n,r,i,a,"throw",e)}i(void 0)}))}}function L(e){var{googleMapsApiKey:t,googleMapsClientId:s,version:n="weekly",language:r,region:o,libraries:i,channel:a,mapIds:l,authReferrerPolicy:c,apiUrl:u="https://maps.googleapis.com"}=e,p=[];return h(t&&s||!(t&&s),"You need to specify either googleMapsApiKey or googleMapsClientId for @deatog/react-google-maps-api load script to work. You cannot use both at the same time."),t?p.push("key=".concat(t)):s&&p.push("client=".concat(s)),n&&p.push("v=".concat(n)),r&&p.push("language=".concat(r)),o&&p.push("region=".concat(o)),i&&i.length&&p.push("libraries=".concat(i.sort().join(","))),a&&p.push("channel=".concat(a)),l&&l.length&&p.push("map_ids=".concat(l.join(","))),c&&p.push("auth_referrer_policy=".concat(c)),p.push("loading=async"),p.push("callback=initMap"),"".concat(u,"/maps/api/js?").concat(p.join("&"))}var P="undefined"!=typeof document;function k(e){var{url:t,id:s,nonce:n}=e;return P?new Promise((function(e,r){var o=document.getElementById(s),i=window;if(o){var a=o.getAttribute("data-state");if(o.src===t&&"error"!==a){if("ready"===a)return e(s);var l=i.initMap,c=o.onerror;return i.initMap=function(){l&&l(),e(s)},void(o.onerror=function(e){c&&c(e),r(e)})}o.remove()}var u=document.createElement("script");u.type="text/javascript",u.src=t,u.id=s,u.async=!0,u.nonce=n||"",u.onerror=function(e){u.setAttribute("data-state","error"),r(e)},i.initMap=function(){u.setAttribute("data-state","ready"),e(s)},document.head.appendChild(u)})).catch((e=>{throw console.error("injectScript error: ",e),e})):Promise.reject(new Error("document is undefined"))}function O(e){var t=e.href;return!(!t||0!==t.indexOf("https://fonts.googleapis.com/css?family=Roboto")&&0!==t.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text"))||("style"===e.tagName.toLowerCase()&&e.styleSheet&&e.styleSheet.cssText&&0===e.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(e.styleSheet.cssText="",!0):"style"===e.tagName.toLowerCase()&&e.innerHTML&&0===e.innerHTML.replace("\r\n","").indexOf(".gm-style")?(e.innerHTML="",!0):"style"===e.tagName.toLowerCase()&&!e.styleSheet&&!e.innerHTML)}function S(){var e=document.getElementsByTagName("head")[0];if(e){var t=e.insertBefore.bind(e);e.insertBefore=function(s,n){return O(s)||Reflect.apply(t,e,[s,n]),s};var s=e.appendChild.bind(e);e.appendChild=function(t){return O(t)||Reflect.apply(s,e,[t]),t}}}var D=!1;function j(){return t.jsx("div",{children:"Loading..."})}var I,B={id:"script-loader",version:"weekly"};class T extends s.PureComponent{constructor(){super(...arguments),u(this,"check",null),u(this,"state",{loaded:!1}),u(this,"cleanupCallback",(()=>{delete window.google.maps,this.injectScript()})),u(this,"isCleaningUp",x((function*(){return new Promise((function(e){if(D){if(P)var t=window.setInterval((function(){D||(window.clearInterval(t),e())}),1)}else e()}))}))),u(this,"cleanup",(()=>{D=!0;var e=document.getElementById(this.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(e){return"string"==typeof e.src&&e.src.includes("maps.googleapis")})).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(e){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===e.href})).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(e){return void 0!==e.innerText&&e.innerText.length>0&&e.innerText.includes(".gm-")})).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))})),u(this,"injectScript",(()=>{this.props.preventGoogleFontsLoading&&S(),h(!!this.props.id,'LoadScript requires "id" prop to be a string: %s',this.props.id),k({id:this.props.id,nonce:this.props.nonce,url:L(this.props)}).then((()=>{this.props.onLoad&&this.props.onLoad(),this.setState((function(){return{loaded:!0}}))})).catch((e=>{this.props.onError&&this.props.onError(e),console.error("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (".concat(this.props.googleMapsApiKey||"-",") or Client ID (").concat(this.props.googleMapsClientId||"-",") to <LoadScript />\n Otherwise it is a Network issue.\n "))}))})),u(this,"getRef",(e=>{this.check=e}))}componentDidMount(){if(P){if(window.google&&window.google.maps&&!D)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(e){console.error("Error at injecting script after cleaning up: ",e)}))}}componentDidUpdate(e){this.props.libraries!==e.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),P&&e.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))}componentWillUnmount(){if(P){this.cleanup();window.setTimeout((()=>{this.check||(delete window.google,D=!1)}),1),this.props.onUnmount&&this.props.onUnmount()}}render(){return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:this.getRef}),this.state.loaded?this.props.children:this.props.loadingElement||t.jsx(j,{})]})}}function R(e,t){if(null==e)return{};var s,n,r=function(e,t){if(null==e)return{};var s={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;s[n]=e[n]}return s}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)s=o[n],-1===t.indexOf(s)&&{}.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function U(e){var{id:t=B.id,version:n=B.version,nonce:r,googleMapsApiKey:o,googleMapsClientId:i,language:a,region:l,libraries:c,preventGoogleFontsLoading:u,channel:p,mapIds:d,authReferrerPolicy:g,apiUrl:m="https://maps.googleapis.com"}=e,f=s.useRef(!1),[v,y]=s.useState(!1),[b,C]=s.useState(void 0);s.useEffect((function(){return f.current=!0,()=>{f.current=!1}}),[]),s.useEffect((function(){P&&u&&S()}),[u]),s.useEffect((function(){v&&h(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")}),[v]);var E=L({version:n,googleMapsApiKey:o,googleMapsClientId:i,language:a,region:l,libraries:c,channel:p,mapIds:d,authReferrerPolicy:g,apiUrl:m});s.useEffect((function(){function e(){f.current&&(y(!0),I=E)}P&&(window.google&&window.google.maps&&I===E?e():k({id:t,url:E,nonce:r}).then(e).catch((function(e){f.current&&C(e),console.warn("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (".concat(o||"-",") or Client ID (").concat(i||"-",")\n Otherwise it is a Network issue.\n ")),console.error(e)})))}),[t,E,r]);var M=s.useRef(void 0);return s.useEffect((function(){M.current&&c!==M.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),M.current=c}),[c]),{isLoaded:v,loadError:b,url:E}}u(T,"defaultProps",B);var A=["loadingElement","onLoad","onError","onUnmount","children"],_=t.jsx(j,{});var z=s.memo((function(e){var{loadingElement:t,onLoad:n,onError:r,onUnmount:o,children:i}=e,a=R(e,A),{isLoaded:l,loadError:c}=U(a);return s.useEffect((function(){l&&"function"==typeof n&&n()}),[l,n]),s.useEffect((function(){c&&"function"==typeof r&&r(c)}),[c,r]),s.useEffect((function(){return()=>{o&&o()}}),[o]),l?i:t||_}));function Z(e,t,s,n){return new(s||(s=Promise))((function(t,r){function o(e){try{a(n.next(e))}catch(e){r(e)}}function i(e){try{a(n.throw(e))}catch(e){r(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof s?n:new s((function(e){e(n)}))).then(o,i)}a((n=n.apply(e,[])).next())}))}function V(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var W,N=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var n,r,o;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(r=n;0!=r--;)if(!e(t[r],s[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=n;0!=r--;){var i=o[r];if(!e(t[i],s[i]))return!1}return!0}return t!=t&&s!=s},H=V(N),F="__googleMapsScriptId";!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(W||(W={}));class G{constructor(e){var{apiKey:t,authReferrerPolicy:s,channel:n,client:r,id:o=F,language:i,libraries:a=[],mapIds:l,nonce:c,region:u,retries:p=3,url:h="https://maps.googleapis.com/maps/api/js",version:d}=e;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=t,this.authReferrerPolicy=s,this.channel=n,this.client=r,this.id=o||F,this.language=i,this.libraries=a,this.mapIds=l,this.nonce=c,this.region=u,this.retries=p,this.url=h,this.version=d,G.instance){if(!H(this.options,G.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(G.instance.options)));return G.instance}G.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?W.FAILURE:this.done?W.SUCCESS:this.loading?W.LOADING:W.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){var e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+="&key=".concat(this.apiKey)),this.channel&&(e+="&channel=".concat(this.channel)),this.client&&(e+="&client=".concat(this.client)),this.libraries.length>0&&(e+="&libraries=".concat(this.libraries.join(","))),this.language&&(e+="&language=".concat(this.language)),this.region&&(e+="®ion=".concat(this.region)),this.version&&(e+="&v=".concat(this.version)),this.mapIds&&(e+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(e+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),e}deleteScript(){var e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise(((e,t)=>{this.loadCallback((s=>{s?t(s.error):e(window.google)}))}))}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id))this.callback();else{var s={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(s).forEach((e=>!s[e]&&delete s[e])),(null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.importLibrary)||(e=>{var t,s,n,r="The Google Maps JavaScript API",o="google",i="importLibrary",a="__ib__",l=document,c=window,u=(c=c[o]||(c[o]={})).maps||(c.maps={}),p=new Set,h=new URLSearchParams,d=()=>t||(t=new Promise(((i,c)=>Z(this,0,void 0,(function*(){var d;for(n in yield s=l.createElement("script"),s.id=this.id,h.set("libraries",[...p]+""),e)h.set(n.replace(/[A-Z]/g,(e=>"_"+e[0].toLowerCase())),e[n]);h.set("callback",o+".maps."+a),s.src=this.url+"?"+h,u[a]=i,s.onerror=()=>t=c(Error(r+" could not load.")),s.nonce=this.nonce||(null===(d=l.querySelector("script[nonce]"))||void 0===d?void 0:d.nonce)||"",l.head.append(s)})))));u[i]?console.warn(r+" only loads once. Ignoring:",e):u[i]=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return p.add(e)&&d().then((()=>u[i](e,...s)))}})(s);var n=this.libraries.map((e=>this.importLibrary(e)));n.length||n.push(this.importLibrary("core")),Promise.all(n).then((()=>this.callback()),(e=>{var t=new ErrorEvent("error",{error:e});this.loadErrorCallback(t)}))}}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){var t=this.errors.length*Math.pow(2,this.errors.length);console.error("Failed to load Google Maps script, retrying in ".concat(t," ms.")),setTimeout((()=>{this.deleteScript(),this.setScript()}),t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach((e=>{e(this.onerrorEvent)})),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return 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."),void this.callback();this.loading=!0,this.setScript()}}}var K=["maps"];function Y(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function q(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(s),!0).forEach((function(t){u(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Y(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var J={},X={options(e,t){e.setOptions(t)}};var $=s.memo((function(e){var{options:t,onLoad:n,onUnmount:r}=e,o=s.useContext(d),[i,a]=s.useState(null);return s.useEffect((()=>{null!==i&&i.setMap(o)}),[o]),s.useEffect((()=>{t&&null!==i&&i.setOptions(t)}),[i,t]),s.useEffect((()=>{var e=new google.maps.TrafficLayer(q(q({},t),{},{map:o}));return a(e),n&&n(e),()=>{null!==i&&(r&&r(i),i.setMap(null))}}),[]),null}));class Q extends s.PureComponent{constructor(){super(...arguments),u(this,"state",{trafficLayer:null}),u(this,"setTrafficLayerCallback",(()=>{null!==this.state.trafficLayer&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)})),u(this,"registeredEvents",[])}componentDidMount(){var e=new google.maps.TrafficLayer(q(q({},this.props.options),{},{map:this.context}));this.registeredEvents=b({updaterMap:X,eventMap:J,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{trafficLayer:e}}),this.setTrafficLayerCallback)}componentDidUpdate(e){null!==this.state.trafficLayer&&(y(this.registeredEvents),this.registeredEvents=b({updaterMap:X,eventMap:J,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),y(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}u(Q,"contextType",d);var ee=s.memo((function(e){var{onLoad:t,onUnmount:n}=e,r=s.useContext(d),[o,i]=s.useState(null);return s.useEffect((()=>{null!==o&&o.setMap(r)}),[r]),s.useEffect((()=>{var e=new google.maps.BicyclingLayer;return i(e),e.setMap(r),t&&t(e),()=>{null!==e&&(n&&n(e),e.setMap(null))}}),[]),null}));class te extends s.PureComponent{constructor(){super(...arguments),u(this,"state",{bicyclingLayer:null}),u(this,"setBicyclingLayerCallback",(()=>{null!==this.state.bicyclingLayer&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))}))}componentDidMount(){var e=new google.maps.BicyclingLayer;this.setState((()=>({bicyclingLayer:e})),this.setBicyclingLayerCallback)}componentWillUnmount(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}u(te,"contextType",d);var se=s.memo((function(e){var{onLoad:t,onUnmount:n}=e,r=s.useContext(d),[o,i]=s.useState(null);return s.useEffect((()=>{null!==o&&o.setMap(r)}),[r]),s.useEffect((()=>{var e=new google.maps.TransitLayer;return i(e),e.setMap(r),t&&t(e),()=>{null!==o&&(n&&n(o),o.setMap(null))}}),[]),null}));class ne extends s.PureComponent{constructor(){super(...arguments),u(this,"state",{transitLayer:null}),u(this,"setTransitLayerCallback",(()=>{null!==this.state.transitLayer&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))}))}componentDidMount(){var e=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:e}}),this.setTransitLayerCallback)}componentWillUnmount(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}function re(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function oe(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?re(Object(s),!0).forEach((function(t){u(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):re(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}u(ne,"contextType",d);var ie={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},ae={drawingMode(e,t){e.setDrawingMode(t)},options(e,t){e.setOptions(t)}};var le=s.memo((function(e){var{options:t,drawingMode:n,onCircleComplete:r,onMarkerComplete:o,onOverlayComplete:i,onPolygonComplete:a,onPolylineComplete:l,onRectangleComplete:c,onLoad:u,onUnmount:p}=e,g=s.useContext(d),m=s.useMemo((()=>(h(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),new google.maps.drawing.DrawingManager(oe(oe({},t),{},{map:g})))),[]);return s.useEffect((()=>{if(g)return m.setMap(g),()=>{m.setMap(null)}}),[m,g]),s.useEffect((()=>{t&&m.setOptions(t)}),[m,t]),s.useEffect((()=>{m.setDrawingMode(null!=n?n:null)}),[m,n]),s.useEffect((()=>{if(r){var e=google.maps.event.addListener(m,"circlecomplete",r);return()=>{e.remove()}}}),[m,r]),s.useEffect((()=>{if(o){var e=google.maps.event.addListener(m,"markercomplete",o);return()=>{e.remove()}}}),[m,o]),s.useEffect((()=>{if(i){var e=google.maps.event.addListener(m,"overlaycomplete",i);return()=>{e.remove()}}}),[m,i]),s.useEffect((()=>{if(a){var e=google.maps.event.addListener(m,"polygoncomplete",a);return()=>{e.remove()}}}),[m,a]),s.useEffect((()=>{if(l){var e=google.maps.event.addListener(m,"polylinecomplete",l);return()=>{e.remove()}}}),[m,l]),s.useEffect((()=>{if(c){var e=google.maps.event.addListener(m,"rectanglecomplete",c);return()=>{e.remove()}}}),[m,c]),s.useEffect((()=>{u&&u(m)}),[m,u]),s.useEffect((()=>{if(p)return()=>{p(m)}}),[m,p]),null}));class ce extends s.PureComponent{constructor(e){super(e),u(this,"registeredEvents",[]),u(this,"state",{drawingManager:null}),u(this,"setDrawingManagerCallback",(()=>{null!==this.state.drawingManager&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)})),h(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing)}componentDidMount(){var e=new google.maps.drawing.DrawingManager(oe(oe({},this.props.options),{},{map:this.context}));this.registeredEvents=b({updaterMap:ae,eventMap:ie,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{drawingManager:e}}),this.setDrawingManagerCallback)}componentDidUpdate(e){null!==this.state.drawingManager&&(y(this.registeredEvents),this.registeredEvents=b({updaterMap:ae,eventMap:ie,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),y(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return null}}function ue(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function pe(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(s),!0).forEach((function(t){u(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ue(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}u(ce,"contextType",d);var he={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},de={animation(e,t){e.setAnimation(t)},clickable(e,t){e.setClickable(t)},cursor(e,t){e.setCursor(t)},draggable(e,t){e.setDraggable(t)},icon(e,t){e.setIcon(t)},label(e,t){e.setLabel(t)},map(e,t){e.setMap(t)},opacity(e,t){e.setOpacity(t)},options(e,t){e.setOptions(t)},position(e,t){e.setPosition(t)},shape(e,t){e.setShape(t)},title(e,t){e.setTitle(t)},visible(e,t){e.setVisible(t)},zIndex(e,t){e.setZIndex(t)}},ge={};var me=s.memo((function(e){var{position:n,options:r,clusterer:o,noClustererRedraw:i,children:a,draggable:l,visible:c,animation:u,clickable:p,cursor:h,icon:g,label:m,opacity:f,shape:v,title:y,zIndex:b,onClick:C,onDblClick:E,onDrag:M,onDragEnd:w,onDragStart:x,onMouseOut:L,onMouseOver:P,onMouseUp:k,onMouseDown:O,onRightClick:S,onClickableChanged:D,onCursorChanged:j,onAnimationChanged:I,onDraggableChanged:B,onFlatChanged:T,onIconChanged:R,onPositionChanged:U,onShapeChanged:A,onTitleChanged:_,onVisibleChanged:z,onZindexChanged:Z,onLoad:V,onUnmount:W}=e,N=s.useContext(d),H=s.useMemo((()=>{var e=pe(pe(pe({},r||ge),o?ge:{map:N}),{},{position:n});return new google.maps.Marker(e)}),[]);s.useEffect((()=>{r&&H.setOptions(r)}),[H,r]),s.useEffect((()=>{void 0!==l&&H.setDraggable(l)}),[H,l]),s.useEffect((()=>{n&&H.setPosition(n)}),[H,n]),s.useEffect((()=>{void 0!==c&&H.setVisible(c)}),[H,c]),s.useEffect((()=>{H.setAnimation(u)}),[H,u]),s.useEffect((()=>{void 0!==p&&H.setClickable(p)}),[H,p]),s.useEffect((()=>{void 0!==h&&H.setCursor(h)}),[H,h]),s.useEffect((()=>{void 0!==g&&H.setIcon(g)}),[H,g]),s.useEffect((()=>{void 0!==m&&H.setLabel(m)}),[H,m]),s.useEffect((()=>{void 0!==f&&H.setOpacity(f)}),[H,f]),s.useEffect((()=>{void 0!==v&&H.setShape(v)}),[H,v]),s.useEffect((()=>{void 0!==y&&H.setTitle(y)}),[H,y]),s.useEffect((()=>{void 0!==b&&H.setZIndex(b)}),[H,b]),s.useEffect((()=>{if(E){var e=google.maps.event.addListener(H,"dblclick",E);return()=>{e.remove()}}}),[H,E]),s.useEffect((()=>{if(w){var e=google.maps.event.addListener(H,"dragend",w);return()=>{e.remove()}}}),[H,w]),s.useEffect((()=>{if(x){var e=google.maps.event.addListener(H,"dragstart",x);return()=>{e.remove()}}}),[H,x]),s.useEffect((()=>{if(O){var e=google.maps.event.addListener(H,"mousedown",O);return()=>{e.remove()}}}),[H,O]),s.useEffect((()=>{if(L){var e=google.maps.event.addListener(H,"mouseout",L);return()=>{e.remove()}}}),[H,L]),s.useEffect((()=>{if(P){var e=google.maps.event.addListener(H,"mouseover",P);return()=>{e.remove()}}}),[H,P]),s.useEffect((()=>{if(k){var e=google.maps.event.addListener(H,"mouseup",k);return()=>{e.remove()}}}),[H,k]),s.useEffect((()=>{if(S){var e=google.maps.event.addListener(H,"rightclick",S);return()=>{e.remove()}}}),[H,S]),s.useEffect((()=>{if(C){var e=google.maps.event.addListener(H,"click",C);return()=>{e.remove()}}}),[H,C]),s.useEffect((()=>{if(M){var e=google.maps.event.addListener(H,"drag",M);return()=>{e.remove()}}}),[H,M]),s.useEffect((()=>{if(D){var e=google.maps.event.addListener(H,"clickable_changed",D);return()=>{e.remove()}}}),[H,D]),s.useEffect((()=>{if(j){var e=google.maps.event.addListener(H,"cursor_changed",j);return()=>{e.remove()}}}),[H,j]),s.useEffect((()=>{if(I){var e=google.maps.event.addListener(H,"animation_changed",I);return()=>{e.remove()}}}),[H,I]),s.useEffect((()=>{if(B){var e=google.maps.event.addListener(H,"draggable_changed",B);return()=>{e.remove()}}}),[H,B]),s.useEffect((()=>{if(T){var e=google.maps.event.addListener(H,"flat_changed",T);return()=>{e.remove()}}}),[H,T]),s.useEffect((()=>{if(R){var e=google.maps.event.addListener(H,"icon_changed",R);return()=>{e.remove()}}}),[H,R]),s.useEffect((()=>{if(U){var e=google.maps.event.addListener(H,"position_changed",U);return()=>{e.remove()}}}),[H,U]),s.useEffect((()=>{if(A){var e=google.maps.event.addListener(H,"shape_changed",A);return()=>{e.remove()}}}),[H,A]),s.useEffect((()=>{if(_){var e=google.maps.event.addListener(H,"title_changed",_);return()=>{e.remove()}}}),[H,_]),s.useEffect((()=>{if(z){var e=google.maps.event.addListener(H,"visible_changed",z);return()=>{e.remove()}}}),[H,z]),s.useEffect((()=>{if(Z){var e=google.maps.event.addListener(H,"zindex_changed",Z);return()=>{e.remove()}}}),[H,Z]),s.useEffect((()=>(o?o.addMarker(H,!!i):H.setMap(N),()=>{o?o.removeMarker(H,!!i):H.setMap(null)})),[H,N,o,i]),s.useEffect((()=>{V&&V(H)}),[H,V]),s.useEffect((()=>{W&&W(H)}),[H,W]);var F=s.useMemo((()=>a?s.Children.map(a,(e=>{if(!s.isValidElement(e))return e;var t=e;return s.cloneElement(t,{anchor:H})})):null),[a,H]);return t.jsx(t.Fragment,{children:F})||null}));class fe extends s.PureComponent{constructor(){super(...arguments),u(this,"registeredEvents",[])}componentDidMount(){var e=this;return x((function*(){var t=pe(pe(pe({},e.props.options||ge),e.props.clusterer?ge:{map:e.context}),{},{position:e.props.position});e.marker=new google.maps.Marker(t),e.props.clusterer?e.props.clusterer.addMarker(e.marker,!!e.props.noClustererRedraw):e.marker.setMap(e.context),e.registeredEvents=b({updaterMap:de,eventMap:he,prevProps:{},nextProps:e.props,instance:e.marker}),e.props.onLoad&&e.props.onLoad(e.marker)}))()}componentDidUpdate(e){this.marker&&(y(this.registeredEvents),this.registeredEvents=b({updaterMap:de,eventMap:he,prevProps:e,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),y(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){return(this.props.children?s.Children.map(this.props.children,(e=>{if(!s.isValidElement(e))return e;var t=e;return s.cloneElement(t,{anchor:this.marker})})):null)||null}}u(fe,"contextType",d);var ve=function(){function e(t,s){t.getClusterer().extend(e,google.maps.OverlayView),this.cluster=t,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=s,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(t.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return e.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},e.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},e.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var t=this.cluster.getClusterer();if(google.maps.event.trigger(t,"click",this.cluster),google.maps.event.trigger(t,"clusterclick",this.cluster),t.getZoomOnClick()){var s=t.getMaxZoom(),n=this.cluster.getBounds(),r=t.getMap();null!==r&&"fitBounds"in r&&r.fitBounds(n),this.timeOut=window.setTimeout((function(){var e=t.getMap();if(null!==e){"fitBounds"in e&&e.fitBounds(n);var r=e.getZoom()||0;null!==s&&r>s&&e.setZoom(s+1)}}),100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},e.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},e.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},e.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),null===(e=this.getPanes())||void 0===e||e.overlayMouseTarget.appendChild(this.div);var t=this.getMap();null!==t&&(this.boundsChangedListener=google.maps.event.addListener(t,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},e.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),null!==this.boundsChangedListener&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),null!==this.timeOut&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},e.prototype.draw=function(){if(this.visible&&null!==this.div&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=null!==e?"".concat(e.y,"px"):"0",this.div.style.left=null!==e?"".concat(e.x,"px"):"0"}},e.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},e.prototype.show=function(){var e,t,s,n,r,o;if(this.div&&this.center){var i=null===this.sums||void 0===this.sums.title||""===this.sums.title?this.cluster.getClusterer().getTitle():this.sums.title,a=this.backgroundPosition.split(" "),l=parseInt((null===(e=a[0])||void 0===e?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),c=parseInt((null===(t=a[1])||void 0===t?void 0:t.replace(/^\s+|\s+$/g,""))||"0",10),u=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(null!==u?"".concat(u.y,"px"):"0","; left: ").concat(null!==u?"".concat(u.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var p=document.createElement("img");p.alt=i,p.src=this.url,p.width=this.width,p.height=this.height,p.setAttribute("style","position: absolute; top: ".concat(c,"px; left: ").concat(l,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(c,"px, -").concat(l+this.width,"px, -").concat(c+this.height,", -").concat(l,")"));var h=document.createElement("div");h.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),(null===(s=this.sums)||void 0===s?void 0:s.text)&&(h.innerText="".concat(null===(n=this.sums)||void 0===n?void 0:n.text)),(null===(r=this.sums)||void 0===r?void 0:r.html)&&(h.innerHTML="".concat(null===(o=this.sums)||void 0===o?void 0:o.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(h),this.div.title=i,this.div.style.display=""}this.visible=!0},e.prototype.useStyle=function(e){this.sums=e;var t=this.cluster.getClusterer().getStyles(),s=t[Math.min(t.length-1,Math.max(0,e.index-1))];s&&(this.url=s.url,this.height=s.height,this.width=s.width,s.className&&(this.className="".concat(this.clusterClassName," ").concat(s.className)),this.anchorText=s.anchorText||[0,0],this.anchorIcon=s.anchorIcon||[this.height/2,this.width/2],this.textColor=s.textColor||"black",this.textSize=s.textSize||11,this.textDecoration=s.textDecoration||"none",this.fontWeight=s.fontWeight||"bold",this.fontStyle=s.fontStyle||"normal",this.fontFamily=s.fontFamily||"Arial,sans-serif",this.backgroundPosition=s.backgroundPosition||"0 0")},e.prototype.setCenter=function(e){this.center=e},e.prototype.getPosFromLatLng=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return null!==t&&(t.x-=this.anchorIcon[1],t.y-=this.anchorIcon[0]),t},e}(),ye=function(){function e(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new ve(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return e.prototype.getSize=function(){return this.markers.length},e.prototype.getMarkers=function(){return this.markers},e.prototype.getCenter=function(){return this.center},e.prototype.getMap=function(){return this.map},e.prototype.getClusterer=function(){return this.markerClusterer},e.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),t=0,s=this.getMarkers();t<s.length;t++){var n=s[t].getPosition();n&&e.extend(n)}return e},e.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},e.prototype.addMarker=function(e){var t,s;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter&&(s=e.getPosition())){var n=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(n-1)+s.lat())/n,(this.center.lng()*(n-1)+s.lng())/n),this.calculateBounds()}}else(s=e.getPosition())&&(this.center=s,this.calculateBounds());e.isAdded=!0,this.markers.push(e);var r=this.markers.length,o=this.markerClusterer.getMaxZoom(),i=null===(t=this.map)||void 0===t?void 0:t.getZoom();if(null!==o&&void 0!==i&&i>o)e.getMap()!==this.map&&e.setMap(this.map);else if(r<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(r===this.minClusterSize)for(var a=0,l=this.markers;a<l.length;a++){l[a].setMap(null)}else e.setMap(null);return!0},e.prototype.isMarkerInClusterBounds=function(e){if(null!==this.bounds){var t=e.getPosition();if(t)return this.bounds.contains(t)}return!1},e.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},e.prototype.updateIcon=function(){var e,t=this.markers.length,s=this.markerClusterer.getMaxZoom(),n=null===(e=this.map)||void 0===e?void 0:e.getZoom();null!==s&&void 0!==n&&n>s||t<this.minClusterSize?this.clusterIcon.hide():(this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show())},e.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var t=0;t<this.markers.length;t++)if(e===this.markers[t])return!0;return!1},e}();function be(e,t){var s=e.length,n=s.toString().length,r=Math.min(n,t);return{text:s.toString(),index:r,title:""}}var Ce=[53,56,66,78,90],Ee=function(){function e(t,s,n){void 0===s&&(s=[]),void 0===n&&(n={}),this.getMinimumClusterSize=this.getMinimumClusterSize.bind(this),this.setMinimumClusterSize=this.setMinimumClusterSize.bind(this),this.getEnableRetinaIcons=this.getEnableRetinaIcons.bind(this),this.setEnableRetinaIcons=this.setEnableRetinaIcons.bind(this),this.addToClosestCluster=this.addToClosestCluster.bind(this),this.getImageExtension=this.getImageExtension.bind(this),this.setImageExtension=this.setImageExtension.bind(this),this.getExtendedBounds=this.getExtendedBounds.bind(this),this.getAverageCenter=this.getAverageCenter.bind(this),this.setAverageCenter=this.setAverageCenter.bind(this),this.getTotalClusters=this.getTotalClusters.bind(this),this.fitMapToMarkers=this.fitMapToMarkers.bind(this),this.getIgnoreHidden=this.getIgnoreHidden.bind(this),this.setIgnoreHidden=this.setIgnoreHidden.bind(this),this.getClusterClass=this.getClusterClass.bind(this),this.setClusterClass=this.setClusterClass.bind(this),this.getTotalMarkers=this.getTotalMarkers.bind(this),this.getZoomOnClick=this.getZoomOnClick.bind(this),this.setZoomOnClick=this.setZoomOnClick.bind(this),this.getBatchSizeIE=this.getBatchSizeIE.bind(this),this.setBatchSizeIE=this.setBatchSizeIE.bind(this),this.createClusters=this.createClusters.bind(this),this.onZoomChanged=this.onZoomChanged.bind(this),this.getImageSizes=this.getImageSizes.bind(this),this.setImageSizes=this.setImageSizes.bind(this),this.getCalculator=this.getCalculator.bind(this),this.setCalculator=this.setCalculator.bind(this),this.removeMarkers=this.removeMarkers.bind(this),this.resetViewport=this.resetViewport.bind(this),this.getImagePath=this.getImagePath.bind(this),this.setImagePath=this.setImagePath.bind(this),this.pushMarkerTo=this.pushMarkerTo.bind(this),this.removeMarker=this.removeMarker.bind(this),this.clearMarkers=this.clearMarkers.bind(this),this.setupStyles=this.setupStyles.bind(this),this.getGridSize=this.getGridSize.bind(this),this.setGridSize=this.setGridSize.bind(this),this.getClusters=this.getClusters.bind(this),this.getMaxZoom=this.getMaxZoom.bind(this),this.setMaxZoom=this.setMaxZoom.bind(this),this.getMarkers=this.getMarkers.bind(this),this.addMarkers=this.addMarkers.bind(this),this.getStyles=this.getStyles.bind(this),this.setStyles=this.setStyles.bind(this),this.addMarker=this.addMarker.bind(this),this.onRemove=this.onRemove.bind(this),this.getTitle=this.getTitle.bind(this),this.setTitle=this.setTitle.bind(this),this.repaint=this.repaint.bind(this),this.onIdle=this.onIdle.bind(this),this.redraw=this.redraw.bind(this),this.onAdd=this.onAdd.bind(this),this.draw=this.draw.bind(this),this.extend=this.extend.bind(this),this.extend(e,google.maps.OverlayView),this.markers=new Set,this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=n.gridSize||60,this.minClusterSize=n.minimumClusterSize||2,this.maxZoom=n.maxZoom||null,this.styles=n.styles||[],this.title=n.title||"",this.zoomOnClick=!0,void 0!==n.zoomOnClick&&(this.zoomOnClick=n.zoomOnClick),this.averageCenter=!1,void 0!==n.averageCenter&&(this.averageCenter=n.averageCenter),this.ignoreHidden=!1,void 0!==n.ignoreHidden&&(this.ignoreHidden=n.ignoreHidden),this.enableRetinaIcons=!1,void 0!==n.enableRetinaIcons&&(this.enableRetinaIcons=n.enableRetinaIcons),this.imagePath=n.imagePath||"https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",this.imageExtension=n.imageExtension||"png",this.imageSizes=n.imageSizes||Ce,this.calculator=n.calculator||be,this.batchSize=n.batchSize||2e3,this.batchSizeIE=n.batchSizeIE||500,this.clusterClass=n.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(s,!0),this.setMap(t)}return e.prototype.onZoomChanged=function(){var e,t;this.resetViewport(!1),(null===(e=this.getMap())||void 0===e?void 0:e.getZoom())!==(this.get("minZoom")||0)&&(null===(t=this.getMap())||void 0===t?void 0:t.getZoom())!==this.get("maxZoom")||google.maps.event.trigger(this,"idle")},e.prototype.onIdle=function(){this.redraw()},e.prototype.onAdd=function(){var e=this.getMap();this.activeMap=e,this.ready=!0,this.repaint(),null!==e&&(this.listeners=[google.maps.event.addListener(e,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(e,"idle",this.onIdle)])},e.prototype.onRemove=function(){for(var e=this.markers.values(),t=e.next();!t.done;){var s=t.value;s.getMap()!==this.activeMap&&s.setMap(this.activeMap),t=e.next()}for(var n=0,r=this.clusters;n<r.length;n++){r[n].remove()}this.clusters=[];for(var o=0,i=this.listeners;o<i.length;o++){var a=i[o];google.maps.event.removeListener(a)}this.listeners=[],this.activeMap=null,this.ready=!1},e.prototype.draw=function(){},e.prototype.getMap=function(){return null},e.prototype.getPanes=function(){return null},e.prototype.getProjection=function(){return{fromContainerPixelToLatLng:function(){return null},fromDivPixelToLatLng:function(){return null},fromLatLngToContainerPixel:function(){return null},fromLatLngToDivPixel:function(){return null},getVisibleRegion:function(){return null},getWorldWidth:f