{"version":3,"file":"index.modern-sxYcTDgg.js","sources":["../../../node_modules/fast-deep-equal/index.js","../../../node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs"],"sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","import React, { useMemo, useState, useReducer, useCallback, useEffect, useRef, useContext, useLayoutEffect, forwardRef, useImperativeHandle, Children } from 'react';\nimport { createPortal } from 'react-dom';\nimport isDeepEqual from 'fast-deep-equal';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\n\nconst APILoadingStatus = {\n NOT_LOADED: 'NOT_LOADED',\n LOADING: 'LOADING',\n LOADED: 'LOADED',\n FAILED: 'FAILED',\n AUTH_FAILURE: 'AUTH_FAILURE'\n};\n\nconst MAPS_API_BASE_URL = 'https://maps.googleapis.com/maps/api/js';\n/**\n * A GoogleMapsApiLoader to reliably load and unload the Google Maps JavaScript API.\n *\n * The actual loading and unloading is delayed into the microtask queue, to\n * allow using the API in an useEffect hook, without worrying about multiple API loads.\n */\nclass GoogleMapsApiLoader {\n /**\n * Loads the Maps JavaScript API with the specified parameters.\n * Since the Maps library can only be loaded once per page, this will\n * produce a warning when called multiple times with different\n * parameters.\n *\n * The returned promise resolves when loading completes\n * and rejects in case of an error or when the loading was aborted.\n */\n static async load(params, onLoadingStatusChange) {\n var _window$google;\n const libraries = params.libraries ? params.libraries.split(',') : [];\n const serializedParams = this.serializeParams(params);\n this.listeners.push(onLoadingStatusChange);\n // Note: if `google.maps.importLibrary` has been defined externally, we\n // assume that loading is complete and successful.\n // If it was defined by a previous call to this method, a warning\n // message is logged if there are differences in api-parameters used\n // for both calls.\n if ((_window$google = window.google) != null && (_window$google = _window$google.maps) != null && _window$google.importLibrary) {\n // no serialized parameters means it was loaded externally\n if (!this.serializedApiParams) {\n this.loadingStatus = APILoadingStatus.LOADED;\n }\n this.notifyLoadingStatusListeners();\n } else {\n this.serializedApiParams = serializedParams;\n this.initImportLibrary(params);\n }\n if (this.serializedApiParams && this.serializedApiParams !== serializedParams) {\n console.warn(`[google-maps-api-loader] The maps API has already been loaded ` + `with different parameters and will not be loaded again. Refresh the ` + `page for new values to have effect.`);\n }\n const librariesToLoad = ['maps', ...libraries];\n await Promise.all(librariesToLoad.map(name => google.maps.importLibrary(name)));\n }\n /**\n * Serialize the parameters used to load the library for easier comparison.\n */\n static serializeParams(params) {\n return [params.v, params.key, params.language, params.region, params.authReferrerPolicy, params.solutionChannel].join('/');\n }\n /**\n * Creates the global `google.maps.importLibrary` function for bootstrapping.\n * This is essentially a formatted version of the dynamic loading script\n * from the official documentation with some minor adjustments.\n *\n * The created importLibrary function will load the Google Maps JavaScript API,\n * which will then replace the `google.maps.importLibrary` function with the full\n * implementation.\n *\n * @see https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n */\n static initImportLibrary(params) {\n if (!window.google) window.google = {};\n if (!window.google.maps) window.google.maps = {};\n if (window.google.maps['importLibrary']) {\n console.error('[google-maps-api-loader-internal]: initImportLibrary must only be called once');\n return;\n }\n let apiPromise = null;\n const loadApi = () => {\n if (apiPromise) return apiPromise;\n apiPromise = new Promise((resolve, reject) => {\n var _document$querySelect;\n const scriptElement = document.createElement('script');\n const urlParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n const urlParamName = key.replace(/[A-Z]/g, t => '_' + t[0].toLowerCase());\n urlParams.set(urlParamName, String(value));\n }\n urlParams.set('loading', 'async');\n urlParams.set('callback', '__googleMapsCallback__');\n scriptElement.async = true;\n scriptElement.src = MAPS_API_BASE_URL + `?` + urlParams.toString();\n scriptElement.nonce = ((_document$querySelect = document.querySelector('script[nonce]')) == null ? void 0 : _document$querySelect.nonce) || '';\n scriptElement.onerror = () => {\n this.loadingStatus = APILoadingStatus.FAILED;\n this.notifyLoadingStatusListeners();\n reject(new Error('The Google Maps JavaScript API could not load.'));\n };\n window.__googleMapsCallback__ = () => {\n this.loadingStatus = APILoadingStatus.LOADED;\n this.notifyLoadingStatusListeners();\n resolve();\n };\n window.gm_authFailure = () => {\n this.loadingStatus = APILoadingStatus.AUTH_FAILURE;\n this.notifyLoadingStatusListeners();\n };\n this.loadingStatus = APILoadingStatus.LOADING;\n this.notifyLoadingStatusListeners();\n document.head.append(scriptElement);\n });\n return apiPromise;\n };\n // for the first load, we declare an importLibrary function that will\n // be overwritten once the api is loaded.\n google.maps.importLibrary = libraryName => loadApi().then(() => google.maps.importLibrary(libraryName));\n }\n /**\n * Calls all registered loadingStatusListeners after a status update.\n */\n static notifyLoadingStatusListeners() {\n for (const fn of this.listeners) {\n fn(this.loadingStatus);\n }\n }\n}\n/**\n * The current loadingStatus of the API.\n */\nGoogleMapsApiLoader.loadingStatus = APILoadingStatus.NOT_LOADED;\n/**\n * The parameters used for first loading the API.\n */\nGoogleMapsApiLoader.serializedApiParams = void 0;\n/**\n * A list of functions to be notified when the loading status changes.\n */\nGoogleMapsApiLoader.listeners = [];\n\nconst _excluded$3 = [\"onLoad\", \"onError\", \"apiKey\", \"version\", \"libraries\"],\n _excluded2$1 = [\"children\"];\nconst DEFAULT_SOLUTION_CHANNEL = 'GMP_visgl_rgmlibrary_v1_default';\nconst APIProviderContext = React.createContext(null);\n/**\n * local hook to set up the map-instance management context.\n */\nfunction useMapInstances() {\n const [mapInstances, setMapInstances] = useState({});\n const addMapInstance = (mapInstance, id = 'default') => {\n setMapInstances(instances => _extends({}, instances, {\n [id]: mapInstance\n }));\n };\n const removeMapInstance = (id = 'default') => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setMapInstances(_ref => {\n let remaining = _objectWithoutPropertiesLoose(_ref, [id].map(_toPropertyKey));\n return remaining;\n });\n };\n const clearMapInstances = () => {\n setMapInstances({});\n };\n return {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n };\n}\n/**\n * local hook to handle the loading of the maps API, returns the current loading status\n * @param props\n */\nfunction useGoogleMapsApiLoader(props) {\n const {\n onLoad,\n onError,\n apiKey,\n version,\n libraries = []\n } = props,\n otherApiParams = _objectWithoutPropertiesLoose(props, _excluded$3);\n const [status, setStatus] = useState(GoogleMapsApiLoader.loadingStatus);\n const [loadedLibraries, addLoadedLibrary] = useReducer((loadedLibraries, action) => {\n return loadedLibraries[action.name] ? loadedLibraries : _extends({}, loadedLibraries, {\n [action.name]: action.value\n });\n }, {});\n const librariesString = useMemo(() => libraries == null ? void 0 : libraries.join(','), [libraries]);\n const serializedParams = useMemo(() => JSON.stringify(_extends({\n apiKey,\n version\n }, otherApiParams)), [apiKey, version, otherApiParams]);\n const importLibrary = useCallback(async name => {\n var _google;\n if (loadedLibraries[name]) {\n return loadedLibraries[name];\n }\n if (!((_google = google) != null && (_google = _google.maps) != null && _google.importLibrary)) {\n throw new Error('[api-provider-internal] importLibrary was called before ' + 'google.maps.importLibrary was defined.');\n }\n const res = await window.google.maps.importLibrary(name);\n addLoadedLibrary({\n name,\n value: res\n });\n return res;\n }, [loadedLibraries]);\n useEffect(() => {\n (async () => {\n try {\n const params = _extends({\n key: apiKey\n }, otherApiParams);\n if (version) params.v = version;\n if ((librariesString == null ? void 0 : librariesString.length) > 0) params.libraries = librariesString;\n if (params.channel === undefined || params.channel < 0 || params.channel > 999) delete params.channel;\n if (params.solutionChannel === undefined) params.solutionChannel = DEFAULT_SOLUTION_CHANNEL;else if (params.solutionChannel === '') delete params.solutionChannel;\n await GoogleMapsApiLoader.load(params, status => setStatus(status));\n for (const name of ['core', 'maps', ...libraries]) {\n await importLibrary(name);\n }\n if (onLoad) {\n onLoad();\n }\n } catch (error) {\n if (onError) {\n onError(error);\n } else {\n console.error(' failed to load the Google Maps JavaScript API', error);\n }\n }\n })();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apiKey, librariesString, serializedParams]);\n return {\n status,\n loadedLibraries,\n importLibrary\n };\n}\n/**\n * Component to wrap the components from this library and load the Google Maps JavaScript API\n */\nconst APIProvider = props => {\n const {\n children\n } = props,\n loaderProps = _objectWithoutPropertiesLoose(props, _excluded2$1);\n const {\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances\n } = useMapInstances();\n const {\n status,\n loadedLibraries,\n importLibrary\n } = useGoogleMapsApiLoader(loaderProps);\n const contextValue = useMemo(() => ({\n mapInstances,\n addMapInstance,\n removeMapInstance,\n clearMapInstances,\n status,\n loadedLibraries,\n importLibrary\n }), [mapInstances, addMapInstance, removeMapInstance, clearMapInstances, status, loadedLibraries, importLibrary]);\n return /*#__PURE__*/React.createElement(APIProviderContext.Provider, {\n value: contextValue\n }, children);\n};\n\n/**\n * Sets up effects to bind event-handlers for all event-props in MapEventProps.\n * @internal\n */\nfunction useMapEvents(map, props) {\n // note: calling a useEffect hook from within a loop is prohibited by the\n // rules of hooks, but it's ok here since it's unconditional and the number\n // and order of iterations is always strictly the same.\n // (see https://legacy.reactjs.org/docs/hooks-rules.html)\n for (const propName of eventPropNames) {\n // fixme: this cast is essentially a 'trust me, bro' for typescript, but\n // a proper solution seems way too complicated right now\n const handler = props[propName];\n const eventType = propNameToEventType[propName];\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!map) return;\n if (!handler) return;\n const listener = google.maps.event.addListener(map, eventType, ev => {\n handler(createMapEvent(eventType, map, ev));\n });\n return () => listener.remove();\n }, [map, eventType, handler]);\n }\n}\n/**\n * Create the wrapped map-events used for the event-props.\n * @param type the event type as it is specified to the maps api\n * @param map the map instance the event originates from\n * @param srcEvent the source-event if there is one.\n */\nfunction createMapEvent(type, map, srcEvent) {\n const ev = {\n type,\n map,\n detail: {},\n stoppable: false,\n stop: () => {}\n };\n if (cameraEventTypes.includes(type)) {\n const camEvent = ev;\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[createEvent] at least one of the values from the map ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n camEvent.detail = {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt,\n bounds: (bounds == null ? void 0 : bounds.toJSON()) || {\n north: 90,\n east: 180,\n south: -90,\n west: -180\n }\n };\n return camEvent;\n } else if (mouseEventTypes.includes(type)) {\n var _srcEvent$latLng;\n if (!srcEvent) throw new Error('[createEvent] mouse events must provide a srcEvent');\n const mouseEvent = ev;\n mouseEvent.domEvent = srcEvent.domEvent;\n mouseEvent.stoppable = true;\n mouseEvent.stop = () => srcEvent.stop();\n mouseEvent.detail = {\n latLng: ((_srcEvent$latLng = srcEvent.latLng) == null ? void 0 : _srcEvent$latLng.toJSON()) || null,\n placeId: srcEvent.placeId\n };\n return mouseEvent;\n }\n return ev;\n}\n/**\n * maps the camelCased names of event-props to the corresponding event-types\n * used in the maps API.\n */\nconst propNameToEventType = {\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onContextmenu: 'contextmenu',\n onDblclick: 'dblclick',\n onDrag: 'drag',\n onDragend: 'dragend',\n onDragstart: 'dragstart',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onIsFractionalZoomEnabledChanged: 'isfractionalzoomenabled_changed',\n onMapCapabilitiesChanged: 'mapcapabilities_changed',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMousemove: 'mousemove',\n onMouseout: 'mouseout',\n onMouseover: 'mouseover',\n onProjectionChanged: 'projection_changed',\n onRenderingTypeChanged: 'renderingtype_changed',\n onTilesLoaded: 'tilesloaded',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed',\n // note: onCameraChanged is an alias for the bounds_changed event,\n // since that is going to be fired in every situation where the camera is\n // updated.\n onCameraChanged: 'bounds_changed'\n};\nconst cameraEventTypes = ['bounds_changed', 'center_changed', 'heading_changed', 'tilt_changed', 'zoom_changed'];\nconst mouseEventTypes = ['click', 'contextmenu', 'dblclick', 'mousemove', 'mouseout', 'mouseover'];\nconst eventPropNames = Object.keys(propNameToEventType);\n\nfunction useDeepCompareEffect(effect, deps) {\n const ref = useRef(undefined);\n if (!ref.current || !isDeepEqual(deps, ref.current)) {\n ref.current = deps;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, ref.current);\n}\n\nconst mapOptionKeys = new Set(['backgroundColor', 'clickableIcons', 'controlSize', 'disableDefaultUI', 'disableDoubleClickZoom', 'draggable', 'draggableCursor', 'draggingCursor', 'fullscreenControl', 'fullscreenControlOptions', 'gestureHandling', 'headingInteractionEnabled', 'isFractionalZoomEnabled', 'keyboardShortcuts', 'mapTypeControl', 'mapTypeControlOptions', 'mapTypeId', 'maxZoom', 'minZoom', 'noClear', 'panControl', 'panControlOptions', 'restriction', 'rotateControl', 'rotateControlOptions', 'scaleControl', 'scaleControlOptions', 'scrollwheel', 'streetView', 'streetViewControl', 'streetViewControlOptions', 'styles', 'tiltInteractionEnabled', 'zoomControl', 'zoomControlOptions']);\n/**\n * Internal hook to update the map-options when props are changed.\n *\n * @param map the map instance\n * @param mapProps the props to update the map-instance with\n * @internal\n */\nfunction useMapOptions(map, mapProps) {\n /* eslint-disable react-hooks/exhaustive-deps --\n *\n * The following effects aren't triggered when the map is changed.\n * In that case, the values will be or have been passed to the map\n * constructor via mapOptions.\n */\n const mapOptions = {};\n const keys = Object.keys(mapProps);\n for (const key of keys) {\n if (!mapOptionKeys.has(key)) continue;\n mapOptions[key] = mapProps[key];\n }\n // update the map options when mapOptions is changed\n // Note: due to the destructuring above, mapOptions will be seen as changed\n // with every re-render, so we're assuming the maps-api will properly\n // deal with unchanged option-values passed into setOptions.\n useDeepCompareEffect(() => {\n if (!map) return;\n map.setOptions(mapOptions);\n }, [mapOptions]);\n /* eslint-enable react-hooks/exhaustive-deps */\n}\n\nfunction useApiLoadingStatus() {\n var _useContext;\n return ((_useContext = useContext(APIProviderContext)) == null ? void 0 : _useContext.status) || APILoadingStatus.NOT_LOADED;\n}\n\n/**\n * Internal hook that updates the camera when deck.gl viewState changes.\n * @internal\n */\nfunction useDeckGLCameraUpdate(map, props) {\n const {\n viewport,\n viewState\n } = props;\n const isDeckGlControlled = !!viewport;\n useLayoutEffect(() => {\n if (!map || !viewState) return;\n const {\n latitude,\n longitude,\n bearing: heading,\n pitch: tilt,\n zoom\n } = viewState;\n map.moveCamera({\n center: {\n lat: latitude,\n lng: longitude\n },\n heading,\n tilt,\n zoom: zoom + 1\n });\n }, [map, viewState]);\n return isDeckGlControlled;\n}\n\nfunction isLatLngLiteral(obj) {\n if (!obj || typeof obj !== 'object') return false;\n if (!('lat' in obj && 'lng' in obj)) return false;\n return Number.isFinite(obj.lat) && Number.isFinite(obj.lng);\n}\nfunction latLngEquals(a, b) {\n if (!a || !b) return false;\n const A = toLatLngLiteral(a);\n const B = toLatLngLiteral(b);\n if (A.lat !== B.lat || A.lng !== B.lng) return false;\n return true;\n}\nfunction toLatLngLiteral(obj) {\n if (isLatLngLiteral(obj)) return obj;\n return obj.toJSON();\n}\n\nfunction useMapCameraParams(map, cameraStateRef, mapProps) {\n const center = mapProps.center ? toLatLngLiteral(mapProps.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const zoom = Number.isFinite(mapProps.zoom) ? mapProps.zoom : null;\n const heading = Number.isFinite(mapProps.heading) ? mapProps.heading : null;\n const tilt = Number.isFinite(mapProps.tilt) ? mapProps.tilt : null;\n // the following effect runs for every render of the map component and checks\n // if there are differences between the known state of the map instance\n // (cameraStateRef, which is updated by all bounds_changed events) and the\n // desired state in the props.\n useLayoutEffect(() => {\n if (!map) return;\n const nextCamera = {};\n let needsUpdate = false;\n if (lat !== null && lng !== null && (cameraStateRef.current.center.lat !== lat || cameraStateRef.current.center.lng !== lng)) {\n nextCamera.center = {\n lat,\n lng\n };\n needsUpdate = true;\n }\n if (zoom !== null && cameraStateRef.current.zoom !== zoom) {\n nextCamera.zoom = zoom;\n needsUpdate = true;\n }\n if (heading !== null && cameraStateRef.current.heading !== heading) {\n nextCamera.heading = heading;\n needsUpdate = true;\n }\n if (tilt !== null && cameraStateRef.current.tilt !== tilt) {\n nextCamera.tilt = tilt;\n needsUpdate = true;\n }\n if (needsUpdate) {\n map.moveCamera(nextCamera);\n }\n });\n}\n\nconst AuthFailureMessage = () => {\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: 999,\n display: 'flex',\n flexFlow: 'column nowrap',\n textAlign: 'center',\n justifyContent: 'center',\n fontSize: '.8rem',\n color: 'rgba(0,0,0,0.6)',\n background: '#dddddd',\n padding: '1rem 1.5rem'\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n style: style\n }, /*#__PURE__*/React.createElement(\"h2\", null, \"Error: AuthFailure\"), /*#__PURE__*/React.createElement(\"p\", null, \"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the \", /*#__PURE__*/React.createElement(\"code\", null, \"APIProvider.apiKey\"), \" prop is correct. Check the error-message in the console for further details.\"));\n};\n\nfunction useCallbackRef() {\n const [el, setEl] = useState(null);\n const ref = useCallback(value => setEl(value), [setEl]);\n return [el, ref];\n}\n\n/**\n * Hook to check if the Maps JavaScript API is loaded\n */\nfunction useApiIsLoaded() {\n const status = useApiLoadingStatus();\n return status === APILoadingStatus.LOADED;\n}\n\nfunction useForceUpdate() {\n const [, forceUpdate] = useReducer(x => x + 1, 0);\n return forceUpdate;\n}\n\nfunction handleBoundsChange(map, ref) {\n const center = map.getCenter();\n const zoom = map.getZoom();\n const heading = map.getHeading() || 0;\n const tilt = map.getTilt() || 0;\n const bounds = map.getBounds();\n if (!center || !bounds || !Number.isFinite(zoom)) {\n console.warn('[useTrackedCameraState] at least one of the values from the map ' + 'returned undefined. This is not expected to happen. Please ' + 'report an issue at https://github.com/visgl/react-google-maps/issues/new');\n }\n // fixme: do we need the `undefined` cases for the camera-params? When are they used in the maps API?\n Object.assign(ref.current, {\n center: (center == null ? void 0 : center.toJSON()) || {\n lat: 0,\n lng: 0\n },\n zoom: zoom || 0,\n heading: heading,\n tilt: tilt\n });\n}\n/**\n * Creates a mutable ref object to track the last known state of the map camera.\n * This is used in `useMapCameraParams` to reduce stuttering in normal operation\n * by avoiding updates of the map camera with values that have already been processed.\n */\nfunction useTrackedCameraStateRef(map) {\n const forceUpdate = useForceUpdate();\n const ref = useRef({\n center: {\n lat: 0,\n lng: 0\n },\n heading: 0,\n tilt: 0,\n zoom: 0\n });\n // Record camera state with every bounds_changed event dispatched by the map.\n // This data is used to prevent feeding these values back to the\n // map-instance when a typical \"controlled component\" setup (state variable is\n // fed into and updated by the map).\n useEffect(() => {\n if (!map) return;\n const listener = google.maps.event.addListener(map, 'bounds_changed', () => {\n handleBoundsChange(map, ref);\n // When an event is occured, we have to update during the next cycle.\n // The application could decide to ignore the event and not update any\n // camera props of the map, meaning that in that case we will have to\n // 'undo' the change to the camera.\n forceUpdate();\n });\n return () => listener.remove();\n }, [map, forceUpdate]);\n return ref;\n}\n\nconst _excluded$2 = [\"id\", \"defaultBounds\", \"defaultCenter\", \"defaultZoom\", \"defaultHeading\", \"defaultTilt\", \"reuseMaps\", \"renderingType\", \"colorScheme\"],\n _excluded2 = [\"padding\"];\n/**\n * Stores a stack of map-instances for each mapId. Whenever an\n * instance is used, it is removed from the stack while in use,\n * and returned to the stack when the component unmounts.\n * This allows us to correctly implement caching for multiple\n * maps om the same page, while reusing as much as possible.\n *\n * FIXME: while it should in theory be possible to reuse maps solely\n * based on the mapId (as all other parameters can be changed at\n * runtime), we don't yet have good enough tracking of options to\n * reliably unset all the options that have been set.\n */\nclass CachedMapStack {\n static has(key) {\n return this.entries[key] && this.entries[key].length > 0;\n }\n static pop(key) {\n if (!this.entries[key]) return null;\n return this.entries[key].pop() || null;\n }\n static push(key, value) {\n if (!this.entries[key]) this.entries[key] = [];\n this.entries[key].push(value);\n }\n}\n/**\n * The main hook takes care of creating map-instances and registering them in\n * the api-provider context.\n * @return a tuple of the map-instance created (or null) and the callback\n * ref that will be used to pass the map-container into this hook.\n * @internal\n */\nCachedMapStack.entries = {};\nfunction useMapInstance(props, context) {\n const apiIsLoaded = useApiIsLoaded();\n const [map, setMap] = useState(null);\n const [container, containerRef] = useCallbackRef();\n const cameraStateRef = useTrackedCameraStateRef(map);\n const {\n id,\n defaultBounds,\n defaultCenter,\n defaultZoom,\n defaultHeading,\n defaultTilt,\n reuseMaps,\n renderingType,\n colorScheme\n } = props,\n mapOptions = _objectWithoutPropertiesLoose(props, _excluded$2);\n const hasZoom = props.zoom !== undefined || props.defaultZoom !== undefined;\n const hasCenter = props.center !== undefined || props.defaultCenter !== undefined;\n if (!defaultBounds && (!hasZoom || !hasCenter)) {\n console.warn(' component is missing configuration. ' + 'You have to provide zoom and center (via the `zoom`/`defaultZoom` and ' + '`center`/`defaultCenter` props) or specify the region to show using ' + '`defaultBounds`. See ' + 'https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required');\n }\n // apply default camera props if available and not overwritten by controlled props\n if (!mapOptions.center && defaultCenter) mapOptions.center = defaultCenter;\n if (!mapOptions.zoom && Number.isFinite(defaultZoom)) mapOptions.zoom = defaultZoom;\n if (!mapOptions.heading && Number.isFinite(defaultHeading)) mapOptions.heading = defaultHeading;\n if (!mapOptions.tilt && Number.isFinite(defaultTilt)) mapOptions.tilt = defaultTilt;\n for (const key of Object.keys(mapOptions)) if (mapOptions[key] === undefined) delete mapOptions[key];\n const savedMapStateRef = useRef(undefined);\n // create the map instance and register it in the context\n useEffect(() => {\n if (!container || !apiIsLoaded) return;\n const {\n addMapInstance,\n removeMapInstance\n } = context;\n // note: colorScheme (upcoming feature) isn't yet in the typings, remove once that is fixed:\n const {\n mapId\n } = props;\n const cacheKey = `${mapId || 'default'}:${renderingType || 'default'}:${colorScheme || 'LIGHT'}`;\n let mapDiv;\n let map;\n if (reuseMaps && CachedMapStack.has(cacheKey)) {\n map = CachedMapStack.pop(cacheKey);\n mapDiv = map.getDiv();\n container.appendChild(mapDiv);\n map.setOptions(mapOptions);\n // detaching the element from the DOM lets the map fall back to its default\n // size, setting the center will trigger reloading the map.\n setTimeout(() => map.setCenter(map.getCenter()), 0);\n } else {\n mapDiv = document.createElement('div');\n mapDiv.style.height = '100%';\n container.appendChild(mapDiv);\n map = new google.maps.Map(mapDiv, _extends({}, mapOptions, renderingType ? {\n renderingType: renderingType\n } : {}, colorScheme ? {\n colorScheme: colorScheme\n } : {}));\n }\n setMap(map);\n addMapInstance(map, id);\n if (defaultBounds) {\n const {\n padding\n } = defaultBounds,\n defBounds = _objectWithoutPropertiesLoose(defaultBounds, _excluded2);\n map.fitBounds(defBounds, padding);\n }\n // prevent map not rendering due to missing configuration\n else if (!hasZoom || !hasCenter) {\n map.fitBounds({\n east: 180,\n west: -180,\n south: -90,\n north: 90\n });\n }\n // the savedMapState is used to restore the camera parameters when the mapId is changed\n if (savedMapStateRef.current) {\n const {\n mapId: savedMapId,\n cameraState: savedCameraState\n } = savedMapStateRef.current;\n if (savedMapId !== mapId) {\n map.setOptions(savedCameraState);\n }\n }\n return () => {\n savedMapStateRef.current = {\n mapId,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n cameraState: cameraStateRef.current\n };\n // detach the map-div from the dom\n mapDiv.remove();\n if (reuseMaps) {\n // push back on the stack\n CachedMapStack.push(cacheKey, map);\n } else {\n // remove all event-listeners to minimize the possibility of memory-leaks\n google.maps.event.clearInstanceListeners(map);\n }\n setMap(null);\n removeMapInstance(id);\n };\n },\n // some dependencies are ignored in the list below:\n // - defaultBounds and the default* camera props will only be used once, and\n // changes should be ignored\n // - mapOptions has special hooks that take care of updating the options\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [container, apiIsLoaded, id,\n // these props can't be changed after initialization and require a new\n // instance to be created\n props.mapId, props.renderingType, props.colorScheme]);\n return [map, containerRef, cameraStateRef];\n}\n\nconst GoogleMapsContext = React.createContext(null);\n// ColorScheme and RenderingType are redefined here to make them usable before the\n// maps API has been fully loaded.\nconst ColorScheme = {\n DARK: 'DARK',\n LIGHT: 'LIGHT',\n FOLLOW_SYSTEM: 'FOLLOW_SYSTEM'\n};\nconst RenderingType = {\n VECTOR: 'VECTOR',\n RASTER: 'RASTER',\n UNINITIALIZED: 'UNINITIALIZED'\n};\nconst Map = props => {\n const {\n children,\n id,\n className,\n style\n } = props;\n const context = useContext(APIProviderContext);\n const loadingStatus = useApiLoadingStatus();\n if (!context) {\n throw new Error(' can only be used inside an component.');\n }\n const [map, mapRef, cameraStateRef] = useMapInstance(props, context);\n useMapCameraParams(map, cameraStateRef, props);\n useMapEvents(map, props);\n useMapOptions(map, props);\n const isDeckGlControlled = useDeckGLCameraUpdate(map, props);\n const isControlledExternally = !!props.controlled;\n // disable interactions with the map for externally controlled maps\n useEffect(() => {\n if (!map) return;\n // fixme: this doesn't seem to belong here (and it's mostly there for convenience anyway).\n // The reasoning is that a deck.gl canvas will be put on top of the map, rendering\n // any default map controls pretty much useless\n if (isDeckGlControlled) {\n map.setOptions({\n disableDefaultUI: true\n });\n }\n // disable all control-inputs when the map is controlled externally\n if (isDeckGlControlled || isControlledExternally) {\n map.setOptions({\n gestureHandling: 'none',\n keyboardShortcuts: false\n });\n }\n return () => {\n map.setOptions({\n gestureHandling: props.gestureHandling,\n keyboardShortcuts: props.keyboardShortcuts\n });\n };\n }, [map, isDeckGlControlled, isControlledExternally, props.gestureHandling, props.keyboardShortcuts]);\n // setup a stable cameraOptions object that can be used as dependency\n const center = props.center ? toLatLngLiteral(props.center) : null;\n let lat = null;\n let lng = null;\n if (center && Number.isFinite(center.lat) && Number.isFinite(center.lng)) {\n lat = center.lat;\n lng = center.lng;\n }\n const cameraOptions = useMemo(() => {\n var _lat, _lng, _props$zoom, _props$heading, _props$tilt;\n return {\n center: {\n lat: (_lat = lat) != null ? _lat : 0,\n lng: (_lng = lng) != null ? _lng : 0\n },\n zoom: (_props$zoom = props.zoom) != null ? _props$zoom : 0,\n heading: (_props$heading = props.heading) != null ? _props$heading : 0,\n tilt: (_props$tilt = props.tilt) != null ? _props$tilt : 0\n };\n }, [lat, lng, props.zoom, props.heading, props.tilt]);\n // externally controlled mode: reject all camera changes that don't correspond to changes in props\n useLayoutEffect(() => {\n if (!map || !isControlledExternally) return;\n map.moveCamera(cameraOptions);\n const listener = map.addListener('bounds_changed', () => {\n map.moveCamera(cameraOptions);\n });\n return () => listener.remove();\n }, [map, isControlledExternally, cameraOptions]);\n const combinedStyle = useMemo(() => _extends({\n width: '100%',\n height: '100%',\n position: 'relative',\n // when using deckgl, the map should be sent to the back\n zIndex: isDeckGlControlled ? -1 : 0\n }, style), [style, isDeckGlControlled]);\n const contextValue = useMemo(() => ({\n map\n }), [map]);\n if (loadingStatus === APILoadingStatus.AUTH_FAILURE) {\n return /*#__PURE__*/React.createElement(\"div\", {\n style: _extends({\n position: 'relative'\n }, className ? {} : combinedStyle),\n className: className\n }, /*#__PURE__*/React.createElement(AuthFailureMessage, null));\n }\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: mapRef,\n \"data-testid\": 'map',\n style: className ? undefined : combinedStyle,\n className: className\n }, id ? {\n id\n } : {}), map ? /*#__PURE__*/React.createElement(GoogleMapsContext.Provider, {\n value: contextValue\n }, children) : null);\n};\n// The deckGLViewProps flag here indicates to deck.gl that the Map component is\n// able to handle viewProps from deck.gl when deck.gl is used to control the map.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMap.deckGLViewProps = true;\n\nconst shownMessages = new Set();\nfunction logErrorOnce(...args) {\n const key = JSON.stringify(args);\n if (!shownMessages.has(key)) {\n shownMessages.add(key);\n console.error(...args);\n }\n}\n\n/**\n * Retrieves a map-instance from the context. This is either an instance\n * identified by id or the parent map instance if no id is specified.\n * Returns null if neither can be found.\n */\nconst useMap = (id = null) => {\n const ctx = useContext(APIProviderContext);\n const {\n map\n } = useContext(GoogleMapsContext) || {};\n if (ctx === null) {\n logErrorOnce('useMap(): failed to retrieve APIProviderContext. ' + 'Make sure that the component exists and that the ' + 'component you are calling `useMap()` from is a sibling of the ' + '.');\n return null;\n }\n const {\n mapInstances\n } = ctx;\n // if an id is specified, the corresponding map or null is returned\n if (id !== null) return mapInstances[id] || null;\n // otherwise, return the closest ancestor\n if (map) return map;\n // finally, return the default map instance\n return mapInstances['default'] || null;\n};\n\nfunction useMapsLibrary(name) {\n const apiIsLoaded = useApiIsLoaded();\n const ctx = useContext(APIProviderContext);\n useEffect(() => {\n if (!apiIsLoaded || !ctx) return;\n // Trigger loading the libraries via our proxy-method.\n // The returned promise is ignored, since importLibrary will update loadedLibraries\n // list in the context, triggering a re-render.\n void ctx.importLibrary(name);\n }, [apiIsLoaded, ctx, name]);\n return (ctx == null ? void 0 : ctx.loadedLibraries[name]) || null;\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to Maps JavaScript API objects.\n * @internal\n */\nfunction useMapsEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n const listener = google.maps.event.addListener(target, name, callback);\n return () => listener.remove();\n }, [target, name, callback]);\n}\n\n/**\n * Internally used to copy values from props into API-Objects\n * whenever they change.\n *\n * @example\n * usePropBinding(marker, 'position', position);\n *\n * @internal\n */\nfunction usePropBinding(object, prop, value) {\n useEffect(() => {\n if (!object) return;\n object[prop] = value;\n }, [object, prop, value]);\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Internally used to bind events to DOM nodes.\n * @internal\n */\nfunction useDomEventListener(target, name, callback) {\n useEffect(() => {\n if (!target || !name || !callback) return;\n target.addEventListener(name, callback);\n return () => target.removeEventListener(name, callback);\n }, [target, name, callback]);\n}\n\n/* eslint-disable complexity */\nfunction isAdvancedMarker(marker) {\n return marker.content !== undefined;\n}\nfunction isElementNode(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Copy of the `google.maps.CollisionBehavior` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst CollisionBehavior = {\n REQUIRED: 'REQUIRED',\n REQUIRED_AND_HIDES_OPTIONAL: 'REQUIRED_AND_HIDES_OPTIONAL',\n OPTIONAL_AND_HIDES_LOWER_PRIORITY: 'OPTIONAL_AND_HIDES_LOWER_PRIORITY'\n};\nconst AdvancedMarkerContext = React.createContext(null);\n// [xPosition, yPosition] when the top left corner is [0, 0]\nconst AdvancedMarkerAnchorPoint = {\n TOP_LEFT: ['0%', '0%'],\n TOP_CENTER: ['50%', '0%'],\n TOP: ['50%', '0%'],\n TOP_RIGHT: ['100%', '0%'],\n LEFT_CENTER: ['0%', '50%'],\n LEFT_TOP: ['0%', '0%'],\n LEFT: ['0%', '50%'],\n LEFT_BOTTOM: ['0%', '100%'],\n RIGHT_TOP: ['100%', '0%'],\n RIGHT: ['100%', '50%'],\n RIGHT_CENTER: ['100%', '50%'],\n RIGHT_BOTTOM: ['100%', '100%'],\n BOTTOM_LEFT: ['0%', '100%'],\n BOTTOM_CENTER: ['50%', '100%'],\n BOTTOM: ['50%', '100%'],\n BOTTOM_RIGHT: ['100%', '100%'],\n CENTER: ['50%', '50%']\n};\nconst MarkerContent = ({\n children,\n styles,\n className,\n anchorPoint\n}) => {\n const [xTranslation, yTranslation] = anchorPoint != null ? anchorPoint : AdvancedMarkerAnchorPoint['BOTTOM'];\n // The \"translate(50%, 100%)\" is here to counter and reset the default anchoring of the advanced marker element\n // that comes from the api\n const transformStyle = `translate(50%, 100%) translate(-${xTranslation}, -${yTranslation})`;\n return (\n /*#__PURE__*/\n // anchoring container\n React.createElement(\"div\", {\n style: {\n transform: transformStyle\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: styles\n }, children))\n );\n};\nfunction useAdvancedMarker(props) {\n const [marker, setMarker] = useState(null);\n const [contentContainer, setContentContainer] = useState(null);\n const map = useMap();\n const markerLibrary = useMapsLibrary('marker');\n const {\n children,\n onClick,\n className,\n onMouseEnter,\n onMouseLeave,\n onDrag,\n onDragStart,\n onDragEnd,\n collisionBehavior,\n clickable,\n draggable,\n position,\n title,\n zIndex\n } = props;\n const numChildren = Children.count(children);\n // create an AdvancedMarkerElement instance and add it to the map once available\n useEffect(() => {\n if (!map || !markerLibrary) return;\n const newMarker = new markerLibrary.AdvancedMarkerElement();\n newMarker.map = map;\n setMarker(newMarker);\n // create the container for marker content if there are children\n let contentElement = null;\n if (numChildren > 0) {\n contentElement = document.createElement('div');\n // We need some kind of flag to identify the custom marker content\n // in the infowindow component. Choosing a custom property instead of a className\n // to not encourage users to style the marker content directly.\n contentElement.isCustomMarker = true;\n newMarker.content = contentElement;\n setContentContainer(contentElement);\n }\n return () => {\n var _contentElement;\n newMarker.map = null;\n (_contentElement = contentElement) == null || _contentElement.remove();\n setMarker(null);\n setContentContainer(null);\n };\n }, [map, markerLibrary, numChildren]);\n // When no children are present we don't have our own wrapper div\n // which usually gets the user provided className. In this case\n // we set the className directly on the marker.content element that comes\n // with the AdvancedMarker.\n useEffect(() => {\n if (!marker || !marker.content || numChildren > 0) return;\n marker.content.className = className || '';\n }, [marker, className, numChildren]);\n // copy other props\n usePropBinding(marker, 'position', position);\n usePropBinding(marker, 'title', title != null ? title : '');\n usePropBinding(marker, 'zIndex', zIndex);\n usePropBinding(marker, 'collisionBehavior', collisionBehavior);\n // set gmpDraggable from props (when unspecified, it's true if any drag-event\n // callbacks are specified)\n useEffect(() => {\n if (!marker) return;\n if (draggable !== undefined) marker.gmpDraggable = draggable;else if (onDrag || onDragStart || onDragEnd) marker.gmpDraggable = true;else marker.gmpDraggable = false;\n }, [marker, draggable, onDrag, onDragEnd, onDragStart]);\n // set gmpClickable from props (when unspecified, it's true if the onClick or one of\n // the hover events callbacks are specified)\n useEffect(() => {\n if (!marker) return;\n const gmpClickable = clickable !== undefined || Boolean(onClick) || Boolean(onMouseEnter) || Boolean(onMouseLeave);\n // gmpClickable is only available in beta version of the\n // maps api (as of 2024-10-10)\n marker.gmpClickable = gmpClickable;\n // enable pointer events for the markers with custom content\n if (gmpClickable && marker != null && marker.content && isElementNode(marker.content)) {\n marker.content.style.pointerEvents = 'none';\n if (marker.content.firstElementChild) {\n marker.content.firstElementChild.style.pointerEvents = 'all';\n }\n }\n }, [marker, clickable, onClick, onMouseEnter, onMouseLeave]);\n useMapsEventListener(marker, 'click', onClick);\n useMapsEventListener(marker, 'drag', onDrag);\n useMapsEventListener(marker, 'dragstart', onDragStart);\n useMapsEventListener(marker, 'dragend', onDragEnd);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseenter', onMouseEnter);\n useDomEventListener(marker == null ? void 0 : marker.element, 'mouseleave', onMouseLeave);\n return [marker, contentContainer];\n}\nconst AdvancedMarker = forwardRef((props, ref) => {\n const {\n children,\n style,\n className,\n anchorPoint\n } = props;\n const [marker, contentContainer] = useAdvancedMarker(props);\n const advancedMarkerContextValue = useMemo(() => marker ? {\n marker\n } : null, [marker]);\n useImperativeHandle(ref, () => marker, [marker]);\n if (!contentContainer) return null;\n return /*#__PURE__*/React.createElement(AdvancedMarkerContext.Provider, {\n value: advancedMarkerContextValue\n }, createPortal(/*#__PURE__*/React.createElement(MarkerContent, {\n anchorPoint: anchorPoint,\n styles: style,\n className: className\n }, children), contentContainer));\n});\nfunction useAdvancedMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\nfunction setValueForStyles(element, styles, prevStyles) {\n if (styles != null && typeof styles !== 'object') {\n throw new Error('The `style` prop expects a mapping from style properties to values, ' + \"not a string. For example, style={{marginRight: spacing + 'em'}} when \" + 'using JSX.');\n }\n const elementStyle = element.style;\n // without `prevStyles`, just set all values\n if (prevStyles == null) {\n if (styles == null) return;\n for (const styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) continue;\n setValueForStyle(elementStyle, styleName, styles[styleName]);\n }\n return;\n }\n // unset all styles in `prevStyles` that aren't in `styles`\n for (const styleName in prevStyles) {\n if (prevStyles.hasOwnProperty(styleName) && (styles == null || !styles.hasOwnProperty(styleName))) {\n // Clear style\n const isCustomProperty = styleName.indexOf('--') === 0;\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n }\n // only assign values from `styles` that are different from `prevStyles`\n if (styles == null) return;\n for (const styleName in styles) {\n const value = styles[styleName];\n if (styles.hasOwnProperty(styleName) && prevStyles[styleName] !== value) {\n setValueForStyle(elementStyle, styleName, value);\n }\n }\n}\nfunction setValueForStyle(elementStyle, styleName, value) {\n const isCustomProperty = styleName.indexOf('--') === 0;\n // falsy values will unset the style property\n if (value == null || typeof value === 'boolean' || value === '') {\n if (isCustomProperty) {\n elementStyle.setProperty(styleName, '');\n } else if (styleName === 'float') {\n elementStyle.cssFloat = '';\n } else {\n elementStyle[styleName] = '';\n }\n }\n // custom properties can't be directly assigned\n else if (isCustomProperty) {\n elementStyle.setProperty(styleName, value);\n }\n // numeric values are treated as 'px' unless the style property expects unitless numbers\n else if (typeof value === 'number' && value !== 0 && !isUnitlessNumber(styleName)) {\n elementStyle[styleName] = value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n // everything else can just be assigned\n else {\n if (styleName === 'float') {\n elementStyle.cssFloat = value;\n } else {\n elementStyle[styleName] = ('' + value).trim();\n }\n }\n}\n// CSS properties which accept numbers but are not in units of \"px\".\nconst unitlessNumbers = new Set(['animationIterationCount', 'aspectRatio', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'gridArea', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'fontWeight', 'lineClamp', 'lineHeight', 'opacity', 'order', 'orphans', 'scale', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity',\n// SVG-related properties\n'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth']);\nfunction isUnitlessNumber(name) {\n return unitlessNumbers.has(name);\n}\n\nconst _excluded$1 = [\"children\", \"headerContent\", \"style\", \"className\", \"pixelOffset\", \"anchor\", \"shouldFocus\", \"onClose\", \"onCloseClick\"];\n/**\n * Component to render an Info Window with the Maps JavaScript API\n */\nconst InfoWindow = props => {\n const {\n // content options\n children,\n headerContent,\n style,\n className,\n pixelOffset,\n // open options\n anchor,\n shouldFocus,\n // events\n onClose,\n onCloseClick\n // other options\n } = props,\n infoWindowOptions = _objectWithoutPropertiesLoose(props, _excluded$1);\n // ## create infowindow instance once the mapsLibrary is available.\n const mapsLibrary = useMapsLibrary('maps');\n const [infoWindow, setInfoWindow] = useState(null);\n const contentContainerRef = useRef(null);\n const headerContainerRef = useRef(null);\n useEffect(() => {\n if (!mapsLibrary) return;\n contentContainerRef.current = document.createElement('div');\n headerContainerRef.current = document.createElement('div');\n const opts = infoWindowOptions;\n if (pixelOffset) {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (headerContent) {\n // if headerContent is specified as string we can directly forward it,\n // otherwise we'll pass the element the portal will render into\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n // intentionally shadowing the state variables here\n const infoWindow = new google.maps.InfoWindow(infoWindowOptions);\n infoWindow.setContent(contentContainerRef.current);\n setInfoWindow(infoWindow);\n // unmount: remove infoWindow and content elements (note: close is called in a different effect-cleanup)\n return () => {\n var _contentContainerRef$, _headerContainerRef$c;\n infoWindow.setContent(null);\n (_contentContainerRef$ = contentContainerRef.current) == null || _contentContainerRef$.remove();\n (_headerContainerRef$c = headerContainerRef.current) == null || _headerContainerRef$c.remove();\n contentContainerRef.current = null;\n headerContainerRef.current = null;\n setInfoWindow(null);\n };\n },\n // `infoWindowOptions` and other props are missing from dependencies:\n //\n // We don't want to re-create the infowindow instance\n // when the options change.\n // Updating the options is handled in the useEffect below.\n //\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [mapsLibrary]);\n // ## update className and styles for `contentContainer`\n // stores previously applied style properties, so they can be removed when unset\n const prevStyleRef = useRef(null);\n useEffect(() => {\n if (!infoWindow || !contentContainerRef.current) return;\n setValueForStyles(contentContainerRef.current, style || null, prevStyleRef.current);\n prevStyleRef.current = style || null;\n if (className !== contentContainerRef.current.className) contentContainerRef.current.className = className || '';\n }, [infoWindow, className, style]);\n // ## update options\n useDeepCompareEffect(() => {\n if (!infoWindow) return;\n const opts = infoWindowOptions;\n if (!pixelOffset) {\n opts.pixelOffset = null;\n } else {\n opts.pixelOffset = new google.maps.Size(pixelOffset[0], pixelOffset[1]);\n }\n if (!headerContent) {\n opts.headerContent = null;\n } else {\n opts.headerContent = typeof headerContent === 'string' ? headerContent : headerContainerRef.current;\n }\n infoWindow.setOptions(infoWindowOptions);\n },\n // dependency `infoWindow` isn't needed since options are also passed\n // to the constructor when a new infoWindow is created.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [infoWindowOptions, pixelOffset, headerContent]);\n // ## bind event handlers\n useMapsEventListener(infoWindow, 'close', onClose);\n useMapsEventListener(infoWindow, 'closeclick', onCloseClick);\n // ## open info window when content and map are available\n const map = useMap();\n useDeepCompareEffect(() => {\n // `anchor === null` means an anchor is defined but not ready yet.\n if (!map || !infoWindow || anchor === null) return;\n const isOpenedWithAnchor = !!anchor;\n const openOptions = {\n map\n };\n if (anchor) {\n openOptions.anchor = anchor;\n // Only do the infowindow adjusting when dealing with an AdvancedMarker\n if (isAdvancedMarker(anchor) && anchor.content instanceof Element) {\n const wrapper = anchor.content;\n const wrapperBcr = wrapper == null ? void 0 : wrapper.getBoundingClientRect();\n // This checks whether or not the anchor has custom content with our own\n // div wrapper. If not, that means we have a regular AdvancedMarker without any children.\n // In that case we do not want to adjust the infowindow since it is all handled correctly\n // by the Google Maps API.\n if (wrapperBcr && wrapper != null && wrapper.isCustomMarker) {\n var _anchor$content$first;\n // We can safely typecast here since we control that element and we know that\n // it is a div\n const anchorDomContent = (_anchor$content$first = anchor.content.firstElementChild) == null ? void 0 : _anchor$content$first.firstElementChild;\n const contentBcr = anchorDomContent == null ? void 0 : anchorDomContent.getBoundingClientRect();\n // center infowindow above marker\n const anchorOffsetX = contentBcr.x - wrapperBcr.x + (contentBcr.width - wrapperBcr.width) / 2;\n const anchorOffsetY = contentBcr.y - wrapperBcr.y;\n const opts = infoWindowOptions;\n opts.pixelOffset = new google.maps.Size(pixelOffset ? pixelOffset[0] + anchorOffsetX : anchorOffsetX, pixelOffset ? pixelOffset[1] + anchorOffsetY : anchorOffsetY);\n infoWindow.setOptions(opts);\n }\n }\n }\n if (shouldFocus !== undefined) {\n openOptions.shouldFocus = shouldFocus;\n }\n infoWindow.open(openOptions);\n return () => {\n // Note: when the infowindow has an anchor, it will automatically show up again when the\n // anchor was removed from the map before infoWindow.close() is called but the it gets\n // added back to the map after that.\n // More information here: https://issuetracker.google.com/issues/343750849\n if (isOpenedWithAnchor) infoWindow.set('anchor', null);\n infoWindow.close();\n };\n }, [infoWindow, anchor, map, shouldFocus, infoWindowOptions, pixelOffset]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, contentContainerRef.current && createPortal(children, contentContainerRef.current), headerContainerRef.current !== null && createPortal(headerContent, headerContainerRef.current));\n};\n\n/**\n * Formats a location into a string representation suitable for Google Static Maps API.\n *\n * @param location - The location to format, can be either a string or an object with lat/lng properties\n * @returns A string representation of the location in the format \"lat,lng\" or the original string\n *\n * @example\n * // Returns \"40.714728,-73.998672\"\n * formatLocation({ lat: 40.714728, lng: -73.998672 })\n *\n * @example\n * // Returns \"New York, NY\"\n * formatLocation(\"New York, NY\")\n */\nfunction formatLocation(location) {\n return typeof location === 'string' ? location : `${location.lat},${location.lng}`;\n}\n// Used for removing the leading pipe from the param string\nfunction formatParam(string) {\n return string.slice(1);\n}\n\n/**\n * Assembles marker parameters for static maps.\n *\n * This function takes an array of markers and groups them by their style properties.\n * It then creates a string representation of these markers, including their styles and locations,\n * which can be used as parameters for static map APIs.\n *\n * @param {StaticMapsMarker[]} [markers=[]] - An array of markers to be processed. Each marker can have properties such as color, label, size, scale, icon, anchor, and location.\n * @returns {string[]} An array of strings, each representing a group of markers with their styles and locations.\n *\n * @example\n * const markers = [\n * { color: 'blue', label: 'A', size: 'mid', location: '40.714728,-73.998672' },\n * { color: 'blue', label: 'B', size: 'mid', location: '40.714728,-73.998672' },\n * { icon: 'http://example.com/icon.png', location: { lat: 40.714728, lng: -73.998672 } }\n * ];\n * const params = assembleMarkerParams(markers);\n * // Params will be an array of strings representing the marker parameters\n * Example output: [\n * \"color:blue|label:A|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"color:blue|label:B|size:mid|40.714728,-73.998672|40.714728,-73.998672\",\n * \"icon:http://example.com/icon.png|40.714728,-73.998672\"\n * ]\n */\nfunction assembleMarkerParams(markers = []) {\n const markerParams = [];\n // Group markers by style\n const markersByStyle = markers == null ? void 0 : markers.reduce((styles, marker) => {\n const {\n color = 'red',\n label,\n size,\n scale,\n icon,\n anchor\n } = marker;\n // Create a unique style key based on either icon properties or standard marker properties\n const relevantProps = icon ? [icon, anchor, scale] : [color, label, size];\n const key = relevantProps.filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(marker);\n return styles;\n }, {});\n Object.values(markersByStyle != null ? markersByStyle : {}).forEach(markers => {\n let markerParam = '';\n const {\n icon\n } = markers[0];\n // Create marker style from first marker in group since all markers share the same style.\n Object.entries(markers[0]).forEach(([key, value]) => {\n // Determine which properties to include based on whether marker uses custom icon\n const relevantKeys = icon ? ['icon', 'anchor', 'scale'] : ['color', 'label', 'size'];\n if (relevantKeys.includes(key)) {\n markerParam += `|${key}:${value}`;\n }\n });\n // Add location coordinates for each marker in the style group\n // Handles both string locations and lat/lng object formats.\n for (const marker of markers) {\n const location = typeof marker.location === 'string' ? marker.location : `${marker.location.lat},${marker.location.lng}`;\n markerParam += `|${location}`;\n }\n markerParams.push(markerParam);\n });\n return markerParams.map(formatParam);\n}\n\n/**\n * Assembles path parameters for the Static Maps Api from an array of paths.\n *\n * This function groups paths by their style properties (color, weight, fillcolor, geodesic)\n * and then constructs a string of path parameters for each group. Each path parameter string\n * includes the style properties and the coordinates of the paths.\n *\n * @param {Array} [paths=[]] - An array of paths to be assembled into path parameters.\n * @returns {Array} An array of path parameter strings.\n *\n * @example\n * const paths = [\n * {\n * color: 'red',\n * weight: 5,\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.718217, lng: -73.998284 }\n * ]\n * }\n * ];\n *\n * const pathParams = assemblePathParams(paths);\n * Output: [\n * 'color:red|weight:5|40.714728,-73.998672|40.718217,-73.998284'\n * ]\n */\nfunction assemblePathParams(paths = []) {\n const pathParams = [];\n // Group paths by their style properties (color, weight, fillcolor, geodesic)\n // to combine paths with identical styles into single parameter strings\n const pathsByStyle = paths == null ? void 0 : paths.reduce((styles, path) => {\n const {\n color = 'default',\n weight,\n fillcolor,\n geodesic\n } = path;\n // Create unique key for this style combination\n const key = [color, weight, fillcolor, geodesic].filter(Boolean).join('-');\n styles[key] = styles[key] || [];\n styles[key].push(path);\n return styles;\n }, {});\n // Process each group of paths with identical styles\n Object.values(pathsByStyle != null ? pathsByStyle : {}).forEach(paths => {\n let pathParam = '';\n // Build style parameter string using properties from first path in group\n // since all paths in this group share the same style\n Object.entries(paths[0]).forEach(([key, value]) => {\n if (['color', 'weight', 'fillcolor', 'geodesic'].includes(key)) {\n pathParam += `|${key}:${value}`;\n }\n });\n // Add location for all marker in style group\n for (const path of paths) {\n if (typeof path.coordinates === 'string') {\n pathParam += `|${decodeURIComponent(path.coordinates)}`;\n } else {\n for (const location of path.coordinates) {\n pathParam += `|${formatLocation(location)}`;\n }\n }\n }\n pathParams.push(pathParam);\n });\n return pathParams.map(formatParam);\n}\n\n/**\n * Converts an array of Google Maps style objects into an array of style strings\n * compatible with the Google Static Maps API.\n *\n * @param styles - An array of Google Maps MapTypeStyle objects that define the styling rules\n * @returns An array of formatted style strings ready to be used with the Static Maps API\n *\n * @example\n * const styles = [{\n * featureType: \"road\",\n * elementType: \"geometry\",\n * stylers: [{color: \"#ff0000\"}, {weight: 1}]\n * }];\n *\n * const styleStrings = assembleMapTypeStyles(styles);\n * // Returns: [\"|feature:road|element:geometry|color:0xff0000|weight:1\"]\n *\n * Each style string follows the format:\n * \"feature:{featureType}|element:{elementType}|{stylerName}:{stylerValue}\"\n *\n * Note: Color values with hexadecimal notation (#) are automatically converted\n * to the required 0x format for the Static Maps API.\n */\nfunction assembleMapTypeStyles(styles) {\n return styles.map(mapTypeStyle => {\n const {\n featureType,\n elementType,\n stylers = []\n } = mapTypeStyle;\n let styleString = '';\n if (featureType) {\n styleString += `|feature:${featureType}`;\n }\n if (elementType) {\n styleString += `|element:${elementType}`;\n }\n for (const styler of stylers) {\n Object.entries(styler).forEach(([name, value]) => {\n styleString += `|${name}:${String(value).replace('#', '0x')}`;\n });\n }\n return styleString;\n }).map(formatParam);\n}\n\nconst STATIC_MAPS_BASE = 'https://maps.googleapis.com/maps/api/staticmap';\n/**\n * Creates a URL for the Google Static Maps API with the specified parameters.\n *\n * @param {Object} options - The configuration options for the static map\n * @param {string} options.apiKey - Your Google Maps API key (required)\n * @param {number} options.width - The width of the map image in pixels (required)\n * @param {number} options.height - The height of the map image in pixels (required)\n * @param {StaticMapsLocation} [options.center] - The center point of the map (lat/lng or address).\n * Required if no markers or paths or \"visible locations\" are provided.\n * @param {number} [options.zoom] - The zoom level of the map. Required if no markers or paths or \"visible locations\" are provided.\n * @param {1|2|4} [options.scale] - The resolution of the map (1, 2, or 4)\n * @param {string} [options.format] - The image format (png, png8, png32, gif, jpg, jpg-baseline)\n * @param {string} [options.mapType] - The type of map (roadmap, satellite, terrain, hybrid)\n * @param {string} [options.language] - The language of the map labels\n * @param {string} [options.region] - The region code for the map\n * @param {string} [options.map_id] - The Cloud-based map style ID\n * @param {StaticMapsMarker[]} [options.markers=[]] - Array of markers to display on the map\n * @param {StaticMapsPath[]} [options.paths=[]] - Array of paths to display on the map\n * @param {StaticMapsLocation[]} [options.visible=[]] - Array of locations that should be visible on the map\n * @param {MapTypeStyle[]} [options.style=[]] - Array of style objects to customize the map appearance\n *\n * @returns {string} The complete Google Static Maps API URL\n *\n * @throws {Error} If API key is not provided\n * @throws {Error} If width or height is not provided\n *\n * @example\n * const url = createStaticMapsUrl({\n * apiKey: 'YOUR_API_KEY',\n * width: 600,\n * height: 400,\n * center: { lat: 40.714728, lng: -73.998672 },\n * zoom: 12,\n * markers: [\n * {\n * location: { lat: 40.714728, lng: -73.998672 },\n * color: 'red',\n * label: 'A'\n * }\n * ],\n * paths: [\n * {\n * coordinates: [\n * { lat: 40.714728, lng: -73.998672 },\n * { lat: 40.719728, lng: -73.991672 }\n * ],\n * color: '0x0000ff',\n * weight: 5\n * }\n * ],\n * style: [\n * {\n * featureType: 'road',\n * elementType: 'geometry',\n * stylers: [{color: '#00ff00'}]\n * }\n * ]\n * });\n *\n * // Results in URL similar to:\n * // https://maps.googleapis.com/maps/api/staticmap?key=YOUR_API_KEY\n * // &size=600x400\n * // ¢er=40.714728,-73.998672&zoom=12\n * // &markers=color:red|label:A|40.714728,-73.998672\n * // &path=color:0x0000ff|weight:5|40.714728,-73.998672|40.719728,-73.991672\n * // &style=feature:road|element:geometry|color:0x00ff00\n */\nfunction createStaticMapsUrl({\n apiKey,\n width,\n height,\n center,\n zoom,\n scale,\n format,\n mapType,\n language,\n region,\n mapId,\n markers = [],\n paths = [],\n visible = [],\n style = []\n}) {\n if (!apiKey) {\n console.warn('API key is required');\n }\n if (!width || !height) {\n console.warn('Width and height are required');\n }\n const params = _extends({\n key: apiKey,\n size: `${width}x${height}`\n }, center && {\n center: formatLocation(center)\n }, zoom && {\n zoom\n }, scale && {\n scale\n }, format && {\n format\n }, mapType && {\n maptype: mapType\n }, language && {\n language\n }, region && {\n region\n }, mapId && {\n map_id: mapId\n });\n const url = new URL(STATIC_MAPS_BASE);\n // Params that don't need special handling\n Object.entries(params).forEach(([key, value]) => {\n url.searchParams.append(key, String(value));\n });\n // Assemble Markers\n for (const markerParam of assembleMarkerParams(markers)) {\n url.searchParams.append('markers', markerParam);\n }\n // Assemble Paths\n for (const pathParam of assemblePathParams(paths)) {\n url.searchParams.append('path', pathParam);\n }\n // Assemble visible locations\n if (visible.length) {\n url.searchParams.append('visible', visible.map(location => formatLocation(location)).join('|'));\n }\n // Assemble Map Type Styles\n for (const styleString of assembleMapTypeStyles(style)) {\n url.searchParams.append('style', styleString);\n }\n return url.toString();\n}\n\nconst StaticMap = props => {\n const {\n url,\n className\n } = props;\n if (!url) throw new Error('URL is required');\n return /*#__PURE__*/React.createElement(\"img\", {\n className: className,\n src: url,\n width: \"100%\"\n });\n};\n\n/**\n * Copy of the `google.maps.ControlPosition` constants.\n * They have to be duplicated here since we can't wait for the maps API to load to be able to use them.\n */\nconst ControlPosition = {\n TOP_LEFT: 1,\n TOP_CENTER: 2,\n TOP: 2,\n TOP_RIGHT: 3,\n LEFT_CENTER: 4,\n LEFT_TOP: 5,\n LEFT: 5,\n LEFT_BOTTOM: 6,\n RIGHT_TOP: 7,\n RIGHT: 7,\n RIGHT_CENTER: 8,\n RIGHT_BOTTOM: 9,\n BOTTOM_LEFT: 10,\n BOTTOM_CENTER: 11,\n BOTTOM: 11,\n BOTTOM_RIGHT: 12,\n CENTER: 13,\n BLOCK_START_INLINE_START: 14,\n BLOCK_START_INLINE_CENTER: 15,\n BLOCK_START_INLINE_END: 16,\n INLINE_START_BLOCK_CENTER: 17,\n INLINE_START_BLOCK_START: 18,\n INLINE_START_BLOCK_END: 19,\n INLINE_END_BLOCK_START: 20,\n INLINE_END_BLOCK_CENTER: 21,\n INLINE_END_BLOCK_END: 22,\n BLOCK_END_INLINE_START: 23,\n BLOCK_END_INLINE_CENTER: 24,\n BLOCK_END_INLINE_END: 25\n};\nconst MapControl = ({\n children,\n position\n}) => {\n const controlContainer = useMemo(() => document.createElement('div'), []);\n const map = useMap();\n useEffect(() => {\n if (!map) return;\n const controls = map.controls[position];\n controls.push(controlContainer);\n return () => {\n const controlsArray = controls.getArray();\n // controlsArray could be undefined if the map is in an undefined state (e.g. invalid API-key, see #276\n if (!controlsArray) return;\n const index = controlsArray.indexOf(controlContainer);\n controls.removeAt(index);\n };\n }, [controlContainer, map, position]);\n return createPortal(children, controlContainer);\n};\n\nconst _excluded = [\"onClick\", \"onDrag\", \"onDragStart\", \"onDragEnd\", \"onMouseOver\", \"onMouseOut\"];\nfunction useMarker(props) {\n const [marker, setMarker] = useState(null);\n const map = useMap();\n const {\n onClick,\n onDrag,\n onDragStart,\n onDragEnd,\n onMouseOver,\n onMouseOut\n } = props,\n markerOptions = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n position,\n draggable\n } = markerOptions;\n // create marker instance and add to the map once the map is available\n useEffect(() => {\n if (!map) {\n if (map === undefined) console.error(' has to be inside a Map component.');\n return;\n }\n const newMarker = new google.maps.Marker(markerOptions);\n newMarker.setMap(map);\n setMarker(newMarker);\n return () => {\n newMarker.setMap(null);\n setMarker(null);\n };\n // We do not want to re-render the whole marker when the options change.\n // Marker options update is handled in a useEffect below.\n // Excluding markerOptions from dependency array on purpose here.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [map]);\n // attach and re-attach event-handlers when any of the properties change\n useEffect(() => {\n if (!marker) return;\n const m = marker;\n // Add event listeners\n const gme = google.maps.event;\n if (onClick) gme.addListener(m, 'click', onClick);\n if (onDrag) gme.addListener(m, 'drag', onDrag);\n if (onDragStart) gme.addListener(m, 'dragstart', onDragStart);\n if (onDragEnd) gme.addListener(m, 'dragend', onDragEnd);\n if (onMouseOver) gme.addListener(m, 'mouseover', onMouseOver);\n if (onMouseOut) gme.addListener(m, 'mouseout', onMouseOut);\n marker.setDraggable(Boolean(draggable));\n return () => {\n gme.clearInstanceListeners(m);\n };\n }, [marker, draggable, onClick, onDrag, onDragStart, onDragEnd, onMouseOver, onMouseOut]);\n // update markerOptions (note the dependencies aren't properly checked\n // here, we just assume that setOptions is smart enough to not waste a\n // lot of time updating values that didn't change)\n useEffect(() => {\n if (!marker) return;\n if (markerOptions) marker.setOptions(markerOptions);\n }, [marker, markerOptions]);\n // update position when changed\n useEffect(() => {\n // Should not update position when draggable\n if (draggable || !position || !marker) return;\n marker.setPosition(position);\n }, [draggable, position, marker]);\n return marker;\n}\n/**\n * Component to render a marker on a map\n */\nconst Marker = forwardRef((props, ref) => {\n const marker = useMarker(props);\n useImperativeHandle(ref, () => marker, [marker]);\n return /*#__PURE__*/React.createElement(React.Fragment, null);\n});\nfunction useMarkerRef() {\n const [marker, setMarker] = useState(null);\n const refCallback = useCallback(m => {\n setMarker(m);\n }, []);\n return [refCallback, marker];\n}\n\n/**\n * Component to configure the appearance of an AdvancedMarker\n */\nconst Pin = props => {\n var _useContext;\n const advancedMarker = (_useContext = useContext(AdvancedMarkerContext)) == null ? void 0 : _useContext.marker;\n const glyphContainer = useMemo(() => document.createElement('div'), []);\n // Create Pin View instance\n useEffect(() => {\n var _advancedMarker$conte;\n if (!advancedMarker) {\n if (advancedMarker === undefined) {\n console.error('The component can only be used inside .');\n }\n return;\n }\n if (props.glyph && props.children) {\n logErrorOnce('The component only uses children to render the glyph if both the glyph property and children are present.');\n }\n if (Children.count(props.children) > 1) {\n logErrorOnce('Passing multiple children to the component might lead to unexpected results.');\n }\n const pinViewOptions = _extends({}, props);\n const pinElement = new google.maps.marker.PinElement(pinViewOptions);\n // Set glyph to glyph container if children are present (rendered via portal).\n // If both props.glyph and props.children are present, props.children takes priority.\n if (props.children) {\n pinElement.glyph = glyphContainer;\n }\n // Set content of Advanced Marker View to the Pin View element\n // Here we are selecting the anchor container.\n // The hierarchy is as follows:\n // \"advancedMarker.content\" (from google) -> \"pointer events reset div\" -> \"anchor container\"\n const markerContent = (_advancedMarker$conte = advancedMarker.content) == null || (_advancedMarker$conte = _advancedMarker$conte.firstChild) == null ? void 0 : _advancedMarker$conte.firstChild;\n while (markerContent != null && markerContent.firstChild) {\n markerContent.removeChild(markerContent.firstChild);\n }\n if (markerContent) {\n markerContent.appendChild(pinElement.element);\n }\n }, [advancedMarker, glyphContainer, props]);\n return createPortal(props.children, glyphContainer);\n};\n\nconst mapLinear = (x, a1, a2, b1, b2) => b1 + (x - a1) * (b2 - b1) / (a2 - a1);\nconst getMapMaxTilt = zoom => {\n if (zoom <= 10) {\n return 30;\n }\n if (zoom >= 15.5) {\n return 67.5;\n }\n // range [10...14]\n if (zoom <= 14) {\n return mapLinear(zoom, 10, 14, 30, 45);\n }\n // range [14...15.5]\n return mapLinear(zoom, 14, 15.5, 45, 67.5);\n};\n/**\n * Function to limit the tilt range of the Google map when updating the view state\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst limitTiltRange = ({\n viewState\n}) => {\n const pitch = viewState.pitch;\n const gmZoom = viewState.zoom + 1;\n const maxTilt = getMapMaxTilt(gmZoom);\n return _extends({}, viewState, {\n fovy: 25,\n pitch: Math.min(maxTilt, pitch)\n });\n};\n\nexport { APILoadingStatus, APIProvider, APIProviderContext, AdvancedMarker, AdvancedMarkerAnchorPoint, AdvancedMarkerContext, CollisionBehavior, ColorScheme, ControlPosition, GoogleMapsContext, InfoWindow, Map, MapControl, Marker, Pin, RenderingType, StaticMap, createStaticMapsUrl, isAdvancedMarker, isLatLngLiteral, latLngEquals, limitTiltRange, toLatLngLiteral, useAdvancedMarkerRef, useApiIsLoaded, useApiLoadingStatus, useMap, useMapsLibrary, useMarkerRef };\n//# sourceMappingURL=index.modern.mjs.map\n"],"names":["fastDeepEqual","equal","a","b","length","i","keys","key","_extends","n","t","r","_objectWithoutPropertiesLoose","_toPrimitive","e","_toPropertyKey","APILoadingStatus","MAPS_API_BASE_URL","GoogleMapsApiLoader","params","onLoadingStatusChange","_window$google","libraries","serializedParams","librariesToLoad","name","apiPromise","loadApi","resolve","reject","_document$querySelect","scriptElement","urlParams","value","urlParamName","libraryName","fn","_excluded$3","_excluded2$1","DEFAULT_SOLUTION_CHANNEL","APIProviderContext","React","useMapInstances","mapInstances","setMapInstances","useState","mapInstance","id","instances","_ref","useGoogleMapsApiLoader","props","onLoad","onError","apiKey","version","otherApiParams","status","setStatus","loadedLibraries","addLoadedLibrary","useReducer","action","librariesString","useMemo","importLibrary","useCallback","_google","res","useEffect","error","APIProvider","children","loaderProps","addMapInstance","removeMapInstance","clearMapInstances","contextValue","useMapEvents","map","propName","eventPropNames","handler","eventType","propNameToEventType","listener","ev","createMapEvent","type","srcEvent","cameraEventTypes","camEvent","center","zoom","heading","tilt","bounds","mouseEventTypes","_srcEvent$latLng","mouseEvent","useDeepCompareEffect","effect","deps","ref","useRef","isDeepEqual","mapOptionKeys","useMapOptions","mapProps","mapOptions","useApiLoadingStatus","_useContext","useContext","useDeckGLCameraUpdate","viewport","viewState","isDeckGlControlled","useLayoutEffect","latitude","longitude","isLatLngLiteral","obj","toLatLngLiteral","useMapCameraParams","cameraStateRef","lat","lng","nextCamera","needsUpdate","AuthFailureMessage","style","useCallbackRef","el","setEl","useApiIsLoaded","useForceUpdate","forceUpdate","x","handleBoundsChange","useTrackedCameraStateRef","_excluded$2","_excluded2","CachedMapStack","useMapInstance","context","apiIsLoaded","setMap","container","containerRef","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme","hasZoom","hasCenter","savedMapStateRef","mapId","cacheKey","mapDiv","padding","defBounds","savedMapId","savedCameraState","GoogleMapsContext","Map","className","loadingStatus","mapRef","isControlledExternally","cameraOptions","_lat","_lng","_props$zoom","_props$heading","_props$tilt","combinedStyle","shownMessages","logErrorOnce","args","useMap","ctx","useMapsLibrary","useMapsEventListener","target","callback","usePropBinding","object","prop","useDomEventListener","isAdvancedMarker","marker","isElementNode","node","AdvancedMarkerContext","AdvancedMarkerAnchorPoint","MarkerContent","styles","anchorPoint","xTranslation","yTranslation","transformStyle","useAdvancedMarker","setMarker","contentContainer","setContentContainer","markerLibrary","onClick","onMouseEnter","onMouseLeave","onDrag","onDragStart","onDragEnd","collisionBehavior","clickable","draggable","position","title","zIndex","numChildren","Children","newMarker","contentElement","_contentElement","gmpClickable","AdvancedMarker","forwardRef","advancedMarkerContextValue","useImperativeHandle","createPortal","useAdvancedMarkerRef","m","setValueForStyles","element","prevStyles","elementStyle","styleName","setValueForStyle","isCustomProperty","isUnitlessNumber","unitlessNumbers","_excluded$1","InfoWindow","headerContent","pixelOffset","anchor","shouldFocus","onClose","onCloseClick","infoWindowOptions","mapsLibrary","infoWindow","setInfoWindow","contentContainerRef","headerContainerRef","opts","_contentContainerRef$","_headerContainerRef$c","prevStyleRef","isOpenedWithAnchor","openOptions","wrapper","wrapperBcr","_anchor$content$first","anchorDomContent","contentBcr","anchorOffsetX","anchorOffsetY","_excluded","useMarker","onMouseOver","onMouseOut","markerOptions","gme","Pin","advancedMarker","glyphContainer","_advancedMarker$conte","pinViewOptions","pinElement","markerContent"],"mappings":"oJAMA,IAAAA,GAAiB,SAASC,EAAMC,EAAGC,EAAG,CACpC,GAAID,IAAMC,EAAG,MAAO,GAEpB,GAAID,GAAKC,GAAK,OAAOD,GAAK,UAAY,OAAOC,GAAK,SAAU,CAC1D,GAAID,EAAE,cAAgBC,EAAE,YAAa,MAAO,GAE5C,IAAIC,EAAQC,EAAGC,EACf,GAAI,MAAM,QAAQJ,CAAC,EAAG,CAEpB,GADAE,EAASF,EAAE,OACPE,GAAUD,EAAE,OAAQ,MAAO,GAC/B,IAAKE,EAAID,EAAQC,MAAQ,GACvB,GAAI,CAACJ,EAAMC,EAAEG,CAAC,EAAGF,EAAEE,CAAC,CAAC,EAAG,MAAO,GACjC,MAAO,EACR,CAID,GAAIH,EAAE,cAAgB,OAAQ,OAAOA,EAAE,SAAWC,EAAE,QAAUD,EAAE,QAAUC,EAAE,MAC5E,GAAID,EAAE,UAAY,OAAO,UAAU,QAAS,OAAOA,EAAE,QAAO,IAAOC,EAAE,QAAO,EAC5E,GAAID,EAAE,WAAa,OAAO,UAAU,SAAU,OAAOA,EAAE,SAAQ,IAAOC,EAAE,SAAQ,EAIhF,GAFAG,EAAO,OAAO,KAAKJ,CAAC,EACpBE,EAASE,EA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