{
  "version": 3,
  "sources": ["../src/index.ts", "../src/components/map.tsx", "../src/components/use-map.tsx", "../src/utils/transform.ts", "../src/mapbox/proxy-transform.ts", "../src/utils/style-utils.ts", "../src/utils/deep-equal.ts", "../src/mapbox/mapbox.ts", "../src/mapbox/create-ref.ts", "../src/utils/use-isomorphic-layout-effect.ts", "../src/utils/set-globals.ts", "../src/components/marker.ts", "../src/utils/apply-react-style.ts", "../src/utils/compare-class-names.ts", "../src/components/popup.ts", "../src/components/attribution-control.ts", "../src/components/use-control.ts", "../src/components/fullscreen-control.ts", "../src/components/geolocate-control.ts", "../src/components/navigation-control.ts", "../src/components/scale-control.ts", "../src/components/source.ts", "../src/utils/assert.ts", "../src/components/layer.ts"],
  "sourcesContent": ["import {Map} from './components/map';\nexport {Map};\nexport default Map;\n\nexport {Marker} from './components/marker';\nexport {Popup} from './components/popup';\nexport {AttributionControl} from './components/attribution-control';\nexport {FullscreenControl} from './components/fullscreen-control';\nexport {GeolocateControl} from './components/geolocate-control';\nexport {NavigationControl} from './components/navigation-control';\nexport {ScaleControl} from './components/scale-control';\nexport {Source} from './components/source';\nexport {Layer} from './components/layer';\nexport {useControl} from './components/use-control';\nexport {MapProvider, useMap} from './components/use-map';\n\nexport type {MapProps} from './components/map';\nexport type {MapRef} from './mapbox/create-ref';\nexport type {MarkerProps} from './components/marker';\nexport type {PopupProps} from './components/popup';\nexport type {AttributionControlProps} from './components/attribution-control';\nexport type {FullscreenControlProps} from './components/fullscreen-control';\nexport type {GeolocateControlProps} from './components/geolocate-control';\nexport type {NavigationControlProps} from './components/navigation-control';\nexport type {ScaleControlProps} from './components/scale-control';\nexport type {SourceProps} from './components/source';\nexport type {LayerProps} from './components/layer';\n\n// Types\nexport * from './types/common';\nexport * from './types/events';\nexport * from './types/lib';\nexport * from './types/style-spec';\n", "import * as React from 'react';\nimport {useState, useRef, useEffect, useContext, useMemo, useImperativeHandle} from 'react';\n\nimport {MountedMapsContext} from './use-map';\nimport Mapbox, {MapboxProps} from '../mapbox/mapbox';\nimport createRef, {MapRef} from '../mapbox/create-ref';\n\nimport type {CSSProperties} from 'react';\nimport useIsomorphicLayoutEffect from '../utils/use-isomorphic-layout-effect';\nimport setGlobals, {GlobalSettings} from '../utils/set-globals';\nimport type {MapLib, MapOptions} from '../types/lib';\n\nexport type MapContextValue = {\n  mapLib: MapLib;\n  map: MapRef;\n};\n\nexport const MapContext = React.createContext<MapContextValue>(null);\n\ntype MapInitOptions = Omit<\n  MapOptions,\n  'style' | 'container' | 'bounds' | 'fitBoundsOptions' | 'center'\n>;\n\nexport type MapProps = MapInitOptions &\n  MapboxProps &\n  GlobalSettings & {\n    mapLib?: MapLib | Promise<MapLib>;\n    reuseMaps?: boolean;\n    /** Map container id */\n    id?: string;\n    /** Map container CSS style */\n    style?: CSSProperties;\n    children?: any;\n  };\n\nfunction _Map(props: MapProps, ref: React.Ref<MapRef>) {\n  const mountedMapsContext = useContext(MountedMapsContext);\n  const [mapInstance, setMapInstance] = useState<Mapbox>(null);\n  const containerRef = useRef();\n\n  const {current: contextValue} = useRef<MapContextValue>({mapLib: null, map: null});\n\n  useEffect(() => {\n    const mapLib = props.mapLib;\n    let isMounted = true;\n    let mapbox: Mapbox;\n\n    Promise.resolve(mapLib || import('mapbox-gl'))\n      .then((module: MapLib | {default: MapLib}) => {\n        if (!isMounted) {\n          return;\n        }\n        if (!module) {\n          throw new Error('Invalid mapLib');\n        }\n        const mapboxgl = 'Map' in module ? module : module.default;\n        if (!mapboxgl.Map) {\n          throw new Error('Invalid mapLib');\n        }\n\n        setGlobals(mapboxgl, props);\n        if (props.reuseMaps) {\n          mapbox = Mapbox.reuse(props, containerRef.current);\n        }\n        if (!mapbox) {\n          mapbox = new Mapbox(mapboxgl.Map, props, containerRef.current);\n        }\n        contextValue.map = createRef(mapbox);\n        contextValue.mapLib = mapboxgl;\n\n        setMapInstance(mapbox);\n        mountedMapsContext?.onMapMount(contextValue.map, props.id);\n      })\n      .catch(error => {\n        const {onError} = props;\n        if (onError) {\n          onError({\n            type: 'error',\n            target: null,\n            error\n          });\n        } else {\n          console.error(error); // eslint-disable-line\n        }\n      });\n\n    return () => {\n      isMounted = false;\n      if (mapbox) {\n        mountedMapsContext?.onMapUnmount(props.id);\n        if (props.reuseMaps) {\n          mapbox.recycle();\n        } else {\n          mapbox.destroy();\n        }\n      }\n    };\n  }, []);\n\n  useIsomorphicLayoutEffect(() => {\n    if (mapInstance) {\n      mapInstance.setProps(props);\n    }\n  });\n\n  useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n\n  const style: CSSProperties = useMemo(\n    () => ({\n      position: 'relative',\n      width: '100%',\n      height: '100%',\n      ...props.style\n    }),\n    [props.style]\n  );\n\n  const CHILD_CONTAINER_STYLE = {\n    height: '100%'\n  };\n\n  return (\n    <div id={props.id} ref={containerRef} style={style}>\n      {mapInstance && (\n        <MapContext.Provider value={contextValue}>\n          <div mapboxgl-children=\"\" style={CHILD_CONTAINER_STYLE}>\n            {props.children}\n          </div>\n        </MapContext.Provider>\n      )}\n    </div>\n  );\n}\n\nexport const Map = React.forwardRef(_Map);\n", "import * as React from 'react';\nimport {useState, useCallback, useMemo, useContext} from 'react';\n\nimport {MapRef} from '../mapbox/create-ref';\nimport {MapContext} from './map';\n\ntype MountedMapsContextValue = {\n  maps: {[id: string]: MapRef};\n  onMapMount: (map: MapRef, id: string) => void;\n  onMapUnmount: (id: string) => void;\n};\n\nexport const MountedMapsContext = React.createContext<MountedMapsContextValue>(null);\n\nexport const MapProvider: React.FC<{children?: React.ReactNode}> = props => {\n  const [maps, setMaps] = useState<{[id: string]: MapRef}>({});\n\n  const onMapMount = useCallback((map: MapRef, id: string = 'default') => {\n    setMaps(currMaps => {\n      if (id === 'current') {\n        throw new Error(\"'current' cannot be used as map id\");\n      }\n      if (currMaps[id]) {\n        throw new Error(`Multiple maps with the same id: ${id}`);\n      }\n      return {...currMaps, [id]: map};\n    });\n  }, []);\n\n  const onMapUnmount = useCallback((id: string = 'default') => {\n    setMaps(currMaps => {\n      if (currMaps[id]) {\n        const nextMaps = {...currMaps};\n        delete nextMaps[id];\n        return nextMaps;\n      }\n      return currMaps;\n    });\n  }, []);\n\n  return (\n    <MountedMapsContext.Provider\n      value={{\n        maps,\n        onMapMount,\n        onMapUnmount\n      }}\n    >\n      {props.children}\n    </MountedMapsContext.Provider>\n  );\n};\n\nexport type MapCollection = {\n  [id: string]: MapRef | undefined;\n  current?: MapRef;\n};\n\nexport function useMap(): MapCollection {\n  const maps = useContext(MountedMapsContext)?.maps;\n  const currentMap = useContext(MapContext);\n\n  const mapsWithCurrent = useMemo(() => {\n    return {...maps, current: currentMap?.map};\n  }, [maps, currentMap]);\n\n  return mapsWithCurrent as MapCollection;\n}\n", "import type {ViewState} from '../types/common';\nimport type {Transform} from '../types/internal';\n\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr: Transform): ViewState {\n  return {\n    longitude: tr.center.lng,\n    latitude: tr.center.lat,\n    zoom: tr._seaLevelZoom ?? tr.zoom,\n    pitch: tr.pitch,\n    bearing: tr.bearing,\n    padding: tr.padding,\n    elevation: tr._centerAltitude\n  };\n}\n\n/** Returns `true` if the given props can potentially override view state updates */\nexport function isViewStateControlled(v: Partial<ViewState>): boolean {\n  return (\n    Number.isFinite(v.longitude) ||\n    Number.isFinite(v.latitude) ||\n    Number.isFinite(v.zoom) ||\n    Number.isFinite(v.pitch) ||\n    Number.isFinite(v.bearing)\n  );\n}\n\n/**\n * Returns `true` if transform needs to be updated to match view state\n */\nexport function compareViewStateWithTransform(tr: Transform, v: Partial<ViewState>): boolean {\n  if (Number.isFinite(v.longitude) && tr.center.lng !== v.longitude) {\n    return true;\n  }\n  if (Number.isFinite(v.latitude) && tr.center.lat !== v.latitude) {\n    return true;\n  }\n  if (Number.isFinite(v.bearing) && tr.bearing !== v.bearing) {\n    return true;\n  }\n  if (Number.isFinite(v.pitch) && tr.pitch !== v.pitch) {\n    return true;\n  }\n  if (Number.isFinite(v.zoom) && (tr._seaLevelZoom ?? tr.zoom) !== v.zoom) {\n    return true;\n  }\n  if (v.padding && !tr.isPaddingEqual(v.padding)) {\n    return true;\n  }\n  return false;\n}\n\nfunction noOp() {}\n\n/* eslint-disable complexity */\n/**\n * Mutate a transform to match the given view state. Should reverse `transformToViewState`\n * @param transform\n * @param viewState\n */\nexport function applyViewStateToTransform(tr: Transform, v: Partial<ViewState>) {\n  // prevent constrain from running until all properties are set\n  // eslint-disable-next-line @typescript-eslint/unbound-method\n  const constrain = tr._constrain;\n  // eslint-disable-next-line @typescript-eslint/unbound-method\n  const calcMatrices = tr._calcMatrices;\n  tr._constrain = noOp;\n  tr._calcMatrices = noOp;\n\n  if (Number.isFinite(v.bearing)) {\n    tr.bearing = v.bearing;\n  }\n  if (Number.isFinite(v.pitch)) {\n    tr.pitch = v.pitch;\n  }\n  if (v.padding && !tr.isPaddingEqual(v.padding)) {\n    tr.padding = v.padding;\n  }\n  if (Number.isFinite(v.longitude) || Number.isFinite(v.latitude)) {\n    const center = tr.center;\n    // @ts-expect-error LngLat constructor is not typed\n    tr._center = new center.constructor(v.longitude ?? center.lng, v.latitude ?? center.lat);\n  }\n  if (Number.isFinite(v.zoom)) {\n    tr._centerAltitude = v.elevation ?? 0;\n    if (tr.elevation) {\n      tr._seaLevelZoom = v.zoom;\n      const mercatorElevation = (tr.pixelsPerMeter / tr.worldSize) * tr._centerAltitude;\n      const altitude = tr._mercatorZfromZoom(v.zoom);\n      const minHeight = tr._mercatorZfromZoom(tr._maxZoom);\n      const height = Math.max(altitude - mercatorElevation, minHeight);\n      tr._setZoom(tr._zoomFromMercatorZ(height));\n    } else {\n      tr._seaLevelZoom = null;\n      tr.zoom = v.zoom;\n    }\n  }\n\n  // restore methods\n  tr._constrain = constrain;\n  tr._calcMatrices = calcMatrices;\n  if (!tr._unmodified) {\n    tr._constrain();\n    tr._calcMatrices();\n  }\n}\n", "import type {Transform} from '../types/internal';\nimport type {ViewState, LngLat} from '../types/common';\nimport {applyViewStateToTransform, isViewStateControlled} from '../utils/transform';\n\n/**\n * Mapbox map is stateful.\n * During method calls/user interactions, map.transform is mutated and deviate from user-supplied props.\n * In order to control the map reactively, we trap the transform mutations with a proxy,\n * which reflects the view state resolved from both user-supplied props and the underlying state\n */\nexport type ProxyTransform = Transform & {\n  $internalUpdate: boolean;\n  $proposedTransform: Transform | null;\n  $reactViewState: Partial<ViewState>;\n};\n\n// These are Transform class methods that:\n// + do not mutate any view state properties\n// + populate private members derived from view state properties\n// They should always reflect the state of their owning instance and NOT trigger any proxied getter/setter\nconst unproxiedMethods = new Set([\n  '_calcMatrices',\n  '_calcFogMatrices',\n  '_updateCameraState',\n  '_updateSeaLevelZoom'\n]);\n\nexport function createProxyTransform(tr: Transform): ProxyTransform {\n  let internalUpdate = false;\n  let reactViewState: Partial<ViewState> = {};\n  /**\n   * Reflects view state set by react props\n   * This is the transform seen by painter, style etc.\n   */\n  const controlledTransform: Transform = tr;\n  /** Populated during camera move (handler/easeTo) if there is a discrepency between react props and proposed view state\n   * This is the transform seen by Mapbox's input handlers\n   */\n  let proposedTransform: Transform | null = null;\n\n  const handlers: ProxyHandler<Transform> = {\n    get(target: Transform, prop: string) {\n      // Props added by us\n      if (prop === '$reactViewState') {\n        return reactViewState;\n      }\n      if (prop === '$proposedTransform') {\n        return proposedTransform;\n      }\n      if (prop === '$internalUpdate') {\n        return internalUpdate;\n      }\n\n      // Ugly - this method is called from HandlerManager bypassing zoom setter\n      if (prop === '_setZoom') {\n        return (z: number) => {\n          if (internalUpdate) {\n            proposedTransform?.[prop](z);\n          }\n          if (!Number.isFinite(reactViewState.zoom)) {\n            controlledTransform[prop](z);\n          }\n        };\n      }\n\n      // Ugly - this method is called from HandlerManager and mutates transform._camera\n      if (\n        internalUpdate &&\n        prop === '_translateCameraConstrained' &&\n        isViewStateControlled(reactViewState)\n      ) {\n        proposedTransform = proposedTransform || controlledTransform.clone();\n      }\n\n      if (unproxiedMethods.has(prop)) {\n        // When this function is executed, it updates both transforms respectively\n        return function (...parms: unknown[]) {\n          proposedTransform?.[prop](...parms);\n          controlledTransform[prop](...parms);\n        };\n      }\n\n      // Expose the proposed transform to input handlers\n      if (internalUpdate && proposedTransform) {\n        return proposedTransform[prop];\n      }\n\n      // Expose the controlled transform to renderer, markers, and event listeners\n      return controlledTransform[prop];\n    },\n\n    set(target: Transform, prop: string, value: unknown) {\n      // Props added by us\n      if (prop === '$reactViewState') {\n        reactViewState = value as Partial<ViewState>;\n        applyViewStateToTransform(controlledTransform, reactViewState);\n        return true;\n      }\n      if (prop === '$proposedTransform') {\n        proposedTransform = value as Transform;\n        return true;\n      }\n      if (prop === '$internalUpdate') {\n        internalUpdate = value as boolean;\n        return true;\n      }\n\n      // Controlled props\n      let controlledValue = value;\n      if (prop === 'center' || prop === '_center') {\n        if (Number.isFinite(reactViewState.longitude) || Number.isFinite(reactViewState.latitude)) {\n          // @ts-expect-error LngLat constructor is not typed\n          controlledValue = new value.constructor(\n            reactViewState.longitude ?? (value as LngLat).lng,\n            reactViewState.latitude ?? (value as LngLat).lat\n          );\n        }\n      } else if (prop === 'zoom' || prop === '_zoom' || prop === '_seaLevelZoom') {\n        if (Number.isFinite(reactViewState.zoom)) {\n          controlledValue = controlledTransform[prop];\n        }\n      } else if (prop === '_centerAltitude') {\n        if (Number.isFinite(reactViewState.elevation)) {\n          controlledValue = controlledTransform[prop];\n        }\n      } else if (prop === 'pitch' || prop === '_pitch') {\n        if (Number.isFinite(reactViewState.pitch)) {\n          controlledValue = controlledTransform[prop];\n        }\n      } else if (prop === 'bearing' || prop === 'rotation' || prop === 'angle') {\n        if (Number.isFinite(reactViewState.bearing)) {\n          controlledValue = controlledTransform[prop];\n        }\n      }\n\n      // During camera update, we save view states that are overriden by controlled values in proposedTransform\n      if (internalUpdate && controlledValue !== value) {\n        proposedTransform = proposedTransform || controlledTransform.clone();\n      }\n      if (internalUpdate && proposedTransform) {\n        proposedTransform[prop] = value;\n      }\n\n      // controlledTransform is not exposed to view state mutation\n      controlledTransform[prop] = controlledValue;\n      return true;\n    }\n  };\n  return new Proxy(tr, handlers) as ProxyTransform;\n}\n", "import {ImmutableLike} from '../types/common';\nimport {StyleSpecification} from '../types/style-spec';\n\nconst refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(\n  style: string | StyleSpecification | ImmutableLike<StyleSpecification>\n): string | StyleSpecification {\n  if (!style) {\n    return null;\n  }\n  if (typeof style === 'string') {\n    return style;\n  }\n  if ('toJS' in style) {\n    style = style.toJS();\n  }\n  if (!style.layers) {\n    return style;\n  }\n  const layerIndex = {};\n\n  for (const layer of style.layers) {\n    layerIndex[layer.id] = layer;\n  }\n\n  const layers = style.layers.map(layer => {\n    let normalizedLayer: typeof layer = null;\n\n    if ('interactive' in layer) {\n      normalizedLayer = Object.assign({}, layer);\n      // Breaks style diffing :(\n      // @ts-ignore legacy field not typed\n      delete normalizedLayer.interactive;\n    }\n\n    // Style diffing doesn't work with refs so expand them out manually before diffing.\n    // @ts-ignore legacy field not typed\n    const layerRef = layerIndex[layer.ref];\n    if (layerRef) {\n      normalizedLayer = normalizedLayer || Object.assign({}, layer);\n      // @ts-ignore\n      delete normalizedLayer.ref;\n      // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n      for (const propName of refProps) {\n        if (propName in layerRef) {\n          normalizedLayer[propName] = layerRef[propName];\n        }\n      }\n    }\n\n    return normalizedLayer || layer;\n  });\n\n  // Do not mutate the style object provided by the user\n  return {...style, layers};\n}\n", "import type {PointLike} from '../types/common';\n\n/**\n * Compare two points\n * @param a\n * @param b\n * @returns true if the points are equal\n */\nexport function arePointsEqual(a?: PointLike, b?: PointLike): boolean {\n  const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;\n  const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;\n  const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;\n  const by = Array.isArray(b) ? b[1] : b ? b.y : 0;\n  return ax === bx && ay === by;\n}\n\n/* eslint-disable complexity */\n/**\n * Compare any two objects\n * @param a\n * @param b\n * @returns true if the objects are deep equal\n */\nexport function deepEqual(a: any, b: any): boolean {\n  if (a === b) {\n    return true;\n  }\n  if (!a || !b) {\n    return false;\n  }\n  if (Array.isArray(a)) {\n    if (!Array.isArray(b) || a.length !== b.length) {\n      return false;\n    }\n    for (let i = 0; i < a.length; i++) {\n      if (!deepEqual(a[i], b[i])) {\n        return false;\n      }\n    }\n    return true;\n  } else if (Array.isArray(b)) {\n    return false;\n  }\n  if (typeof a === 'object' && typeof b === 'object') {\n    const aKeys = Object.keys(a);\n    const bKeys = Object.keys(b);\n    if (aKeys.length !== bKeys.length) {\n      return false;\n    }\n    for (const key of aKeys) {\n      if (!b.hasOwnProperty(key)) {\n        return false;\n      }\n      if (!deepEqual(a[key], b[key])) {\n        return false;\n      }\n    }\n    return true;\n  }\n  return false;\n}\n", "import {transformToViewState, compareViewStateWithTransform} from '../utils/transform';\nimport {ProxyTransform, createProxyTransform} from './proxy-transform';\nimport {normalizeStyle} from '../utils/style-utils';\nimport {deepEqual} from '../utils/deep-equal';\n\nimport type {\n  ViewState,\n  Point,\n  PointLike,\n  PaddingOptions,\n  ImmutableLike,\n  LngLatBoundsLike,\n  MapGeoJSONFeature\n} from '../types/common';\nimport type {\n  StyleSpecification,\n  LightSpecification,\n  TerrainSpecification,\n  FogSpecification,\n  ProjectionSpecification\n} from '../types/style-spec';\nimport type {MapInstance} from '../types/lib';\nimport type {Transform} from '../types/internal';\nimport type {\n  MapCallbacks,\n  ViewStateChangeEvent,\n  MapEvent,\n  ErrorEvent,\n  MapMouseEvent\n} from '../types/events';\n\nexport type MapboxProps = Partial<ViewState> &\n  MapCallbacks & {\n    // Init options\n    mapboxAccessToken?: string;\n\n    /** Camera options used when constructing the Map instance */\n    initialViewState?: Partial<ViewState> & {\n      /** The initial bounds of the map. If bounds is specified, it overrides longitude, latitude and zoom options. */\n      bounds?: LngLatBoundsLike;\n      /** A fitBounds options object to use only when setting the bounds option. */\n      fitBoundsOptions?: {\n        offset?: PointLike;\n        minZoom?: number;\n        maxZoom?: number;\n        padding?: number | PaddingOptions;\n      };\n    };\n\n    /** If provided, render into an external WebGL context */\n    gl?: WebGLRenderingContext;\n\n    /** For external controller to override the camera state */\n    viewState?: ViewState & {\n      width: number;\n      height: number;\n    };\n\n    // Styling\n\n    /** Mapbox style */\n    mapStyle?: string | StyleSpecification | ImmutableLike<StyleSpecification>;\n    /** Enable diffing when the map style changes\n     * @default true\n     */\n    styleDiffing?: boolean;\n    /** The projection property of the style. Must conform to the Projection Style Specification.\n     * @default 'mercator'\n     */\n    projection?: ProjectionSpecification | ProjectionSpecification['name'];\n    /** The fog property of the style. Must conform to the Fog Style Specification .\n     * If `undefined` is provided, removes the fog from the map. */\n    fog?: FogSpecification;\n    /** Light properties of the map. */\n    light?: LightSpecification;\n    /** Terrain property of the style. Must conform to the Terrain Style Specification .\n     * If `undefined` is provided, removes terrain from the map. */\n    terrain?: TerrainSpecification;\n\n    /** Default layers to query on pointer events */\n    interactiveLayerIds?: string[];\n    /** CSS cursor */\n    cursor?: string;\n  };\n\nconst DEFAULT_STYLE = {version: 8, sources: {}, layers: []} as StyleSpecification;\n\nconst DEFAULT_SETTINGS = {\n  minZoom: 0,\n  maxZoom: 22,\n  minPitch: 0,\n  maxPitch: 85,\n  maxBounds: [-180, -85.051129, 180, 85.051129],\n  projection: 'mercator',\n  renderWorldCopies: true\n};\n\nconst pointerEvents = {\n  mousedown: 'onMouseDown',\n  mouseup: 'onMouseUp',\n  mouseover: 'onMouseOver',\n  mousemove: 'onMouseMove',\n  click: 'onClick',\n  dblclick: 'onDblClick',\n  mouseenter: 'onMouseEnter',\n  mouseleave: 'onMouseLeave',\n  mouseout: 'onMouseOut',\n  contextmenu: 'onContextMenu',\n  touchstart: 'onTouchStart',\n  touchend: 'onTouchEnd',\n  touchmove: 'onTouchMove',\n  touchcancel: 'onTouchCancel'\n};\nconst cameraEvents = {\n  movestart: 'onMoveStart',\n  move: 'onMove',\n  moveend: 'onMoveEnd',\n  dragstart: 'onDragStart',\n  drag: 'onDrag',\n  dragend: 'onDragEnd',\n  zoomstart: 'onZoomStart',\n  zoom: 'onZoom',\n  zoomend: 'onZoomEnd',\n  rotatestart: 'onRotateStart',\n  rotate: 'onRotate',\n  rotateend: 'onRotateEnd',\n  pitchstart: 'onPitchStart',\n  pitch: 'onPitch',\n  pitchend: 'onPitchEnd'\n};\nconst otherEvents = {\n  wheel: 'onWheel',\n  boxzoomstart: 'onBoxZoomStart',\n  boxzoomend: 'onBoxZoomEnd',\n  boxzoomcancel: 'onBoxZoomCancel',\n  resize: 'onResize',\n  load: 'onLoad',\n  render: 'onRender',\n  idle: 'onIdle',\n  remove: 'onRemove',\n  data: 'onData',\n  styledata: 'onStyleData',\n  sourcedata: 'onSourceData',\n  error: 'onError'\n};\nconst settingNames = [\n  'minZoom',\n  'maxZoom',\n  'minPitch',\n  'maxPitch',\n  'maxBounds',\n  'projection',\n  'renderWorldCopies'\n];\nconst handlerNames = [\n  'scrollZoom',\n  'boxZoom',\n  'dragRotate',\n  'dragPan',\n  'keyboard',\n  'doubleClickZoom',\n  'touchZoomRotate',\n  'touchPitch'\n];\n\n/**\n * A wrapper for mapbox-gl's Map class\n */\nexport default class Mapbox {\n  private _MapClass: {new (options: any): MapInstance};\n  /** mapboxgl.Map instance */\n  private _map: MapInstance = null;\n  /** User-supplied props */\n  props: MapboxProps;\n\n  /** The transform that replaces native map.transform to resolve changes vs. React props\n   * See proxy-transform.ts\n   */\n  private _proxyTransform: ProxyTransform;\n\n  // Internal states\n  /** Making updates driven by React props. Do not trigger React callbacks to avoid infinite loop */\n  private _internalUpdate: boolean = false;\n  /** Map is currently rendering */\n  private _inRender: boolean = false;\n  /** Map features under the pointer */\n  private _hoveredFeatures: MapGeoJSONFeature[] = null;\n  /** View state changes driven by React props\n   * They still need to fire move/etc. events because controls such as marker/popup\n   * subscribe to the move event internally to update their position\n   * React callbacks like onMove are not called for these */\n  private _deferredEvents: {\n    move: boolean;\n    zoom: boolean;\n    pitch: boolean;\n    rotate: boolean;\n  } = {\n    move: false,\n    zoom: false,\n    pitch: false,\n    rotate: false\n  };\n\n  static savedMaps: Mapbox[] = [];\n\n  constructor(\n    MapClass: {new (options: any): MapInstance},\n    props: MapboxProps,\n    container: HTMLDivElement\n  ) {\n    this._MapClass = MapClass;\n    this.props = props;\n    this._initialize(container);\n  }\n\n  get map(): MapInstance {\n    return this._map;\n  }\n\n  get transform(): Transform {\n    return this._map.transform;\n  }\n\n  setProps(props: MapboxProps) {\n    const oldProps = this.props;\n    this.props = props;\n\n    const settingsChanged = this._updateSettings(props, oldProps);\n    const sizeChanged = this._updateSize(props);\n    const viewStateChanged = this._updateViewState(props, true);\n    this._updateStyle(props, oldProps);\n    this._updateStyleComponents(props, oldProps);\n    this._updateHandlers(props, oldProps);\n\n    // If 1) view state has changed to match props and\n    //    2) the props change is not triggered by map events,\n    // it's driven by an external state change. Redraw immediately\n    if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {\n      this.redraw();\n    }\n  }\n\n  static reuse(props: MapboxProps, container: HTMLDivElement): Mapbox {\n    const that = Mapbox.savedMaps.pop();\n    if (!that) {\n      return null;\n    }\n\n    const map = that.map;\n    // When reusing the saved map, we need to reparent the map(canvas) and other child nodes\n    // intoto the new container from the props.\n    // Step 1: reparenting child nodes from old container to new container\n    const oldContainer = map.getContainer();\n    container.className = oldContainer.className;\n    while (oldContainer.childNodes.length > 0) {\n      container.appendChild(oldContainer.childNodes[0]);\n    }\n    // Step 2: replace the internal container with new container from the react component\n    // @ts-ignore\n    map._container = container;\n\n    // Step 4: apply new props\n    that.setProps({...props, styleDiffing: false});\n    map.resize();\n    const {initialViewState} = props;\n    if (initialViewState) {\n      if (initialViewState.bounds) {\n        map.fitBounds(initialViewState.bounds, {...initialViewState.fitBoundsOptions, duration: 0});\n      } else {\n        that._updateViewState(initialViewState, false);\n      }\n    }\n\n    // Simulate load event\n    if (map.isStyleLoaded()) {\n      map.fire('load');\n    } else {\n      map.once('styledata', () => map.fire('load'));\n    }\n\n    // Force reload\n    // @ts-ignore\n    map._update();\n    return that;\n  }\n\n  /* eslint-disable complexity,max-statements */\n  _initialize(container: HTMLDivElement) {\n    const {props} = this;\n    const {mapStyle = DEFAULT_STYLE} = props;\n    const mapOptions = {\n      ...props,\n      ...props.initialViewState,\n      accessToken: props.mapboxAccessToken || getAccessTokenFromEnv() || null,\n      container,\n      style: normalizeStyle(mapStyle)\n    };\n\n    const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;\n    Object.assign(mapOptions, {\n      center: [viewState.longitude || 0, viewState.latitude || 0],\n      zoom: viewState.zoom || 0,\n      pitch: viewState.pitch || 0,\n      bearing: viewState.bearing || 0\n    });\n\n    if (props.gl) {\n      // eslint-disable-next-line\n      const getContext = HTMLCanvasElement.prototype.getContext;\n      // Hijack canvas.getContext to return our own WebGLContext\n      // This will be called inside the mapboxgl.Map constructor\n      // @ts-expect-error\n      HTMLCanvasElement.prototype.getContext = () => {\n        // Unhijack immediately\n        HTMLCanvasElement.prototype.getContext = getContext;\n        return props.gl;\n      };\n    }\n\n    const map = new this._MapClass(mapOptions);\n    // Props that are not part of constructor options\n    if (viewState.padding) {\n      map.setPadding(viewState.padding);\n    }\n    if (props.cursor) {\n      map.getCanvas().style.cursor = props.cursor;\n    }\n    this._createProxyTransform(map);\n\n    // Hack\n    // Insert code into map's render cycle\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const renderMap = map._render;\n    map._render = (arg: number) => {\n      // Hijacked to set this state flag\n      this._inRender = true;\n      renderMap.call(map, arg);\n      this._inRender = false;\n    };\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const runRenderTaskQueue = map._renderTaskQueue.run;\n    map._renderTaskQueue.run = (arg: number) => {\n      // This is where camera updates from input handler/animation happens\n      // And where all view state change events are fired\n      this._proxyTransform.$internalUpdate = true;\n      runRenderTaskQueue.call(map._renderTaskQueue, arg);\n      this._proxyTransform.$internalUpdate = false;\n      this._fireDefferedEvents();\n    };\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const jumpTo = map.jumpTo;\n    map.jumpTo = (...args: Parameters<MapInstance['jumpTo']>) => {\n      // This method will fire view state change events immediately\n      this._proxyTransform.$internalUpdate = true;\n      jumpTo.apply(map, args);\n      this._proxyTransform.$internalUpdate = false;\n      return map;\n    };\n    // Insert code into map's event pipeline\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    const fireEvent = map.fire;\n    map.fire = this._fireEvent.bind(this, fireEvent);\n\n    // add listeners\n    map.on('styledata', () => {\n      this._updateStyleComponents(this.props, {});\n    });\n    map.on('sourcedata', () => {\n      this._updateStyleComponents(this.props, {});\n    });\n    for (const eventName in pointerEvents) {\n      map.on(eventName, this._onPointerEvent);\n    }\n    for (const eventName in cameraEvents) {\n      map.on(eventName, this._onCameraEvent);\n    }\n    for (const eventName in otherEvents) {\n      map.on(eventName, this._onEvent);\n    }\n    this._map = map;\n  }\n  /* eslint-enable complexity,max-statements */\n\n  recycle() {\n    // Clean up unnecessary elements before storing for reuse.\n    const container = this.map.getContainer();\n    const children = container.querySelector('[mapboxgl-children]');\n    children?.remove();\n\n    Mapbox.savedMaps.push(this);\n  }\n\n  destroy() {\n    this._map.remove();\n  }\n\n  // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next\n  // render cycle, which is managed by Mapbox's animation loop.\n  // This removes the synchronization issue caused by requestAnimationFrame.\n  redraw() {\n    const map = this._map as any;\n    // map._render will throw error if style does not exist\n    // https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513\n    //   /src/ui/map.js#L1834\n    if (!this._inRender && map.style) {\n      // cancel the scheduled update\n      if (map._frame) {\n        map._frame.cancel();\n        map._frame = null;\n      }\n      // the order is important - render() may schedule another update\n      map._render();\n    }\n  }\n\n  _createProxyTransform(map: any) {\n    const proxyTransform = createProxyTransform(map.transform);\n    map.transform = proxyTransform;\n    map.painter.transform = proxyTransform;\n    this._proxyTransform = proxyTransform;\n  }\n\n  /* Trigger map resize if size is controlled\n     @param {object} nextProps\n     @returns {bool} true if size has changed\n   */\n  _updateSize(nextProps: MapboxProps): boolean {\n    // Check if size is controlled\n    const {viewState} = nextProps;\n    if (viewState) {\n      const map = this._map;\n      if (viewState.width !== map.transform.width || viewState.height !== map.transform.height) {\n        map.resize();\n        return true;\n      }\n    }\n    return false;\n  }\n\n  // Adapted from map.jumpTo\n  /* Update camera to match props\n     @param {object} nextProps\n     @param {bool} triggerEvents - should fire camera events\n     @returns {bool} true if anything is changed\n   */\n  _updateViewState(nextProps: MapboxProps, triggerEvents: boolean): boolean {\n    const viewState: Partial<ViewState> = nextProps.viewState || nextProps;\n    const tr = this._proxyTransform;\n    const {zoom, pitch, bearing} = tr;\n    const changed = compareViewStateWithTransform(this._proxyTransform, viewState);\n    tr.$reactViewState = viewState;\n\n    if (changed && triggerEvents) {\n      const deferredEvents = this._deferredEvents;\n      // Delay DOM control updates to the next render cycle\n      deferredEvents.move = true;\n      deferredEvents.zoom ||= zoom !== tr.zoom;\n      deferredEvents.rotate ||= bearing !== tr.bearing;\n      deferredEvents.pitch ||= pitch !== tr.pitch;\n    }\n\n    return changed;\n  }\n\n  /* Update camera constraints and projection settings to match props\n     @param {object} nextProps\n     @param {object} currProps\n     @returns {bool} true if anything is changed\n   */\n  _updateSettings(nextProps: MapboxProps, currProps: MapboxProps): boolean {\n    const map = this._map;\n    let changed = false;\n    for (const propName of settingNames) {\n      const propPresent = propName in nextProps || propName in currProps;\n\n      if (propPresent && !deepEqual(nextProps[propName], currProps[propName])) {\n        changed = true;\n        const nextValue = propName in nextProps ? nextProps[propName] : DEFAULT_SETTINGS[propName];\n        const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];\n        setter?.call(map, nextValue);\n      }\n    }\n    return changed;\n  }\n\n  /* Update map style to match props\n     @param {object} nextProps\n     @param {object} currProps\n     @returns {bool} true if style is changed\n   */\n  _updateStyle(nextProps: MapboxProps, currProps: MapboxProps): boolean {\n    if (nextProps.cursor !== currProps.cursor) {\n      this._map.getCanvas().style.cursor = nextProps.cursor || '';\n    }\n    if (nextProps.mapStyle !== currProps.mapStyle) {\n      const {mapStyle = DEFAULT_STYLE, styleDiffing = true} = nextProps;\n      const options: any = {\n        diff: styleDiffing\n      };\n      if ('localIdeographFontFamily' in nextProps) {\n        // @ts-ignore Mapbox specific prop\n        options.localIdeographFontFamily = nextProps.localIdeographFontFamily;\n      }\n      this._map.setStyle(normalizeStyle(mapStyle), options);\n      return true;\n    }\n    return false;\n  }\n\n  /* Update fog, light and terrain to match props\n     @param {object} nextProps\n     @param {object} currProps\n     @returns {bool} true if anything is changed\n   */\n  _updateStyleComponents(nextProps: MapboxProps, currProps: MapboxProps): boolean {\n    const map = this._map;\n    let changed = false;\n    if (map.isStyleLoaded()) {\n      if ('light' in nextProps && map.setLight && !deepEqual(nextProps.light, currProps.light)) {\n        changed = true;\n        map.setLight(nextProps.light);\n      }\n      if ('fog' in nextProps && map.setFog && !deepEqual(nextProps.fog, currProps.fog)) {\n        changed = true;\n        map.setFog(nextProps.fog);\n      }\n      if (\n        'terrain' in nextProps &&\n        map.setTerrain &&\n        !deepEqual(nextProps.terrain, currProps.terrain)\n      ) {\n        if (!nextProps.terrain || map.getSource(nextProps.terrain.source)) {\n          changed = true;\n          map.setTerrain(nextProps.terrain);\n        }\n      }\n    }\n    return changed;\n  }\n\n  /* Update interaction handlers to match props\n     @param {object} nextProps\n     @param {object} currProps\n     @returns {bool} true if anything is changed\n   */\n  _updateHandlers(nextProps: MapboxProps, currProps: MapboxProps): boolean {\n    const map = this._map;\n    let changed = false;\n    for (const propName of handlerNames) {\n      const newValue = nextProps[propName] ?? true;\n      const oldValue = currProps[propName] ?? true;\n      if (!deepEqual(newValue, oldValue)) {\n        changed = true;\n        if (newValue) {\n          map[propName].enable(newValue);\n        } else {\n          map[propName].disable();\n        }\n      }\n    }\n    return changed;\n  }\n\n  _onEvent = (e: MapEvent) => {\n    // @ts-ignore\n    const cb = this.props[otherEvents[e.type]];\n    if (cb) {\n      cb(e);\n    } else if (e.type === 'error') {\n      console.error((e as ErrorEvent).error); // eslint-disable-line\n    }\n  };\n\n  private _queryRenderedFeatures(point: Point) {\n    const map = this._map;\n    const {interactiveLayerIds = []} = this.props;\n    try {\n      return map.queryRenderedFeatures(point, {\n        layers: interactiveLayerIds.filter(map.getLayer.bind(map))\n      });\n    } catch {\n      // May fail if style is not loaded\n      return [];\n    }\n  }\n\n  _updateHover(e: MapMouseEvent) {\n    const {props} = this;\n    const shouldTrackHoveredFeatures =\n      props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);\n\n    if (shouldTrackHoveredFeatures) {\n      const eventType = e.type;\n      const wasHovering = this._hoveredFeatures?.length > 0;\n      const features = this._queryRenderedFeatures(e.point);\n      const isHovering = features.length > 0;\n\n      if (!isHovering && wasHovering) {\n        e.type = 'mouseleave';\n        this._onPointerEvent(e);\n      }\n      this._hoveredFeatures = features;\n      if (isHovering && !wasHovering) {\n        e.type = 'mouseenter';\n        this._onPointerEvent(e);\n      }\n      e.type = eventType;\n    } else {\n      this._hoveredFeatures = null;\n    }\n  }\n\n  _onPointerEvent = (e: MapMouseEvent) => {\n    if (e.type === 'mousemove' || e.type === 'mouseout') {\n      this._updateHover(e);\n    }\n\n    // @ts-ignore\n    const cb = this.props[pointerEvents[e.type]];\n    if (cb) {\n      if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {\n        e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);\n      }\n      cb(e);\n      delete e.features;\n    }\n  };\n\n  _onCameraEvent = (e: ViewStateChangeEvent) => {\n    if (!this._internalUpdate) {\n      // @ts-ignore\n      const cb = this.props[cameraEvents[e.type]];\n      const tr = this._proxyTransform;\n      if (cb) {\n        e.viewState = transformToViewState(tr.$proposedTransform ?? tr);\n        cb(e);\n      }\n      if (e.type === 'moveend') {\n        tr.$proposedTransform = null;\n      }\n    }\n    if (e.type in this._deferredEvents) {\n      this._deferredEvents[e.type] = false;\n    }\n  };\n\n  _fireEvent(baseFire: Function, event: string | MapEvent, properties?: object) {\n    const map = this._map;\n    const tr = this._proxyTransform;\n\n    // Always expose the controlled transform to controls/end user\n    const internal = tr.$internalUpdate;\n    try {\n      tr.$internalUpdate = false;\n      baseFire.call(map, event, properties);\n    } finally {\n      tr.$internalUpdate = internal;\n    }\n\n    return map;\n  }\n\n  // If there are camera changes driven by props, invoke camera events so that DOM controls are synced\n  _fireDefferedEvents() {\n    const map = this._map;\n    this._internalUpdate = true;\n    for (const eventType in this._deferredEvents) {\n      if (this._deferredEvents[eventType]) {\n        map.fire(eventType);\n      }\n    }\n    this._internalUpdate = false;\n  }\n}\n\n/**\n * Access token can be provided via one of:\n *   mapboxAccessToken prop\n *   access_token query parameter\n *   MapboxAccessToken environment variable\n *   REACT_APP_MAPBOX_ACCESS_TOKEN environment variable\n * @returns access token\n */\nfunction getAccessTokenFromEnv(): string {\n  let accessToken = null;\n\n  /* global location, process */\n  if (typeof location !== 'undefined') {\n    const match = /access_token=([^&\\/]*)/.exec(location.search);\n    accessToken = match && match[1];\n  }\n\n  // Note: This depends on bundler plugins (e.g. webpack) importing environment correctly\n  try {\n    // eslint-disable-next-line no-process-env\n    accessToken = accessToken || process.env.MapboxAccessToken;\n  } catch {\n    // ignore\n  }\n\n  try {\n    // eslint-disable-next-line no-process-env\n    accessToken = accessToken || process.env.REACT_APP_MAPBOX_ACCESS_TOKEN;\n  } catch {\n    // ignore\n  }\n\n  return accessToken;\n}\n", "import type {MapInstance} from '../types/lib';\nimport {LngLatLike, PointLike} from '../types/common';\n\nimport type Mapbox from './mapbox';\n\n/** These methods may break the react binding if called directly */\nconst skipMethods = [\n  'setMaxBounds',\n  'setMinZoom',\n  'setMaxZoom',\n  'setMinPitch',\n  'setMaxPitch',\n  'setRenderWorldCopies',\n  'setProjection',\n  'setStyle',\n  'addSource',\n  'removeSource',\n  'addLayer',\n  'removeLayer',\n  'setLayerZoomRange',\n  'setFilter',\n  'setPaintProperty',\n  'setLayoutProperty',\n  'setLight',\n  'setTerrain',\n  'setFog',\n  'remove'\n] as const;\n\nexport type MapRef = {\n  getMap(): MapInstance;\n} & Omit<MapInstance, (typeof skipMethods)[number]>;\n\nexport default function createRef(mapInstance: Mapbox): MapRef | null {\n  if (!mapInstance) {\n    return null;\n  }\n\n  const map = mapInstance.map;\n  const ref: any = {\n    getMap: () => map,\n\n    // Overwrite getters to use our shadow transform\n    getCenter: () => mapInstance.transform.center,\n    getZoom: () => mapInstance.transform.zoom,\n    getBearing: () => mapInstance.transform.bearing,\n    getPitch: () => mapInstance.transform.pitch,\n    getPadding: () => mapInstance.transform.padding,\n    getBounds: () => mapInstance.transform.getBounds(),\n    project: (lnglat: LngLatLike) => {\n      const tr = map.transform;\n      map.transform = mapInstance.transform;\n      const result = map.project(lnglat);\n      map.transform = tr;\n      return result;\n    },\n    unproject: (point: PointLike) => {\n      const tr = map.transform;\n      map.transform = mapInstance.transform;\n      const result = map.unproject(point);\n      map.transform = tr;\n      return result;\n    },\n    // options diverge between mapbox and maplibre\n    queryTerrainElevation: (lnglat: LngLatLike, options?: any) => {\n      const tr = map.transform;\n      map.transform = mapInstance.transform;\n      const result = map.queryTerrainElevation(lnglat, options);\n      map.transform = tr;\n      return result;\n    },\n    queryRenderedFeatures: (geometry?: any, options?: any) => {\n      const tr = map.transform;\n      map.transform = mapInstance.transform;\n      const result = map.queryRenderedFeatures(geometry, options);\n      map.transform = tr;\n      return result;\n    }\n  };\n\n  for (const key of getMethodNames(map)) {\n    // @ts-expect-error\n    if (!(key in ref) && !skipMethods.includes(key)) {\n      ref[key] = map[key].bind(map);\n    }\n  }\n\n  return ref;\n}\n\nfunction getMethodNames(obj: Object) {\n  const result = new Set<string>();\n\n  let proto = obj;\n  while (proto) {\n    for (const key of Object.getOwnPropertyNames(proto)) {\n      if (\n        key[0] !== '_' &&\n        typeof obj[key] === 'function' &&\n        key !== 'fire' &&\n        key !== 'setEventedParent'\n      ) {\n        result.add(key);\n      }\n    }\n    proto = Object.getPrototypeOf(proto);\n  }\n  return Array.from(result);\n}\n", "// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport {useEffect, useLayoutEffect} from 'react';\n\nconst useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport default useIsomorphicLayoutEffect;\n", "export type GlobalSettings = {\n  /** The map's default API URL for requesting tiles, styles, sprites, and glyphs. */\n  baseApiUrl?: string;\n  /** The maximum number of images (raster tiles, sprites, icons) to load in parallel.\n   * @default 16\n   */\n  maxParallelImageRequests?: number;\n  /** The map's RTL text plugin. Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.  */\n  RTLTextPlugin?: string | false;\n  /** Provides an interface for external module bundlers such as Webpack or Rollup to package mapbox-gl's WebWorker into a separate class and integrate it with the library.\nTakes precedence over `workerUrl`. */\n  workerClass?: any;\n  /** The number of web workers instantiated on a page with mapbox-gl maps.\n   * @default 2\n   */\n  workerCount?: number;\n  /** Provides an interface for loading mapbox-gl's WebWorker bundle from a self-hosted URL.\n   * This is useful if your site needs to operate in a strict CSP (Content Security Policy) environment\n   * wherein you are not allowed to load JavaScript code from a Blob URL, which is default behavior. */\n  workerUrl?: string;\n};\n\nconst globalSettings = [\n  'baseApiUrl',\n  'maxParallelImageRequests',\n  'workerClass',\n  'workerCount',\n  'workerUrl'\n] as const;\n\nexport default function setGlobals(mapLib: any, props: GlobalSettings) {\n  for (const key of globalSettings) {\n    if (key in props) {\n      mapLib[key] = props[key];\n    }\n  }\n\n  const {\n    RTLTextPlugin = 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js'\n  } = props;\n  if (\n    RTLTextPlugin &&\n    mapLib.getRTLTextPluginStatus &&\n    mapLib.getRTLTextPluginStatus() === 'unavailable'\n  ) {\n    mapLib.setRTLTextPlugin(\n      RTLTextPlugin,\n      (error?: Error) => {\n        if (error) {\n          // eslint-disable-next-line\n          console.error(error);\n        }\n      },\n      true\n    );\n  }\n}\n", "/* global document */\nimport * as React from 'react';\nimport {createPortal} from 'react-dom';\nimport {useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\n\nimport type {PopupInstance, MarkerInstance, MarkerOptions} from '../types/lib';\nimport type {MarkerEvent, MarkerDragEvent} from '../types/events';\n\nimport {MapContext} from './map';\nimport {arePointsEqual} from '../utils/deep-equal';\nimport {compareClassNames} from '../utils/compare-class-names';\n\nexport type MarkerProps = MarkerOptions & {\n  /** Longitude of the anchor location */\n  longitude: number;\n  /** Latitude of the anchor location */\n  latitude: number;\n\n  popup?: PopupInstance;\n\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n  onClick?: (e: MarkerEvent<MouseEvent>) => void;\n  onDragStart?: (e: MarkerDragEvent) => void;\n  onDrag?: (e: MarkerDragEvent) => void;\n  onDragEnd?: (e: MarkerDragEvent) => void;\n  children?: React.ReactNode;\n};\n\n/* eslint-disable complexity,max-statements */\nexport const Marker = memo(\n  forwardRef((props: MarkerProps, ref: React.Ref<MarkerInstance>) => {\n    const {map, mapLib} = useContext(MapContext);\n    const thisRef = useRef({props});\n\n    const marker: MarkerInstance = useMemo(() => {\n      let hasChildren = false;\n      React.Children.forEach(props.children, el => {\n        if (el) {\n          hasChildren = true;\n        }\n      });\n      const options = {\n        ...props,\n        element: hasChildren ? document.createElement('div') : null\n      };\n\n      const mk = new mapLib.Marker(options);\n      mk.setLngLat([props.longitude, props.latitude]);\n\n      mk.getElement().addEventListener('click', (e: MouseEvent) => {\n        thisRef.current.props.onClick?.({\n          type: 'click',\n          target: mk,\n          originalEvent: e\n        });\n      });\n\n      mk.on('dragstart', e => {\n        const evt = e as MarkerDragEvent;\n        evt.lngLat = marker.getLngLat();\n        thisRef.current.props.onDragStart?.(evt);\n      });\n      mk.on('drag', e => {\n        const evt = e as MarkerDragEvent;\n        evt.lngLat = marker.getLngLat();\n        thisRef.current.props.onDrag?.(evt);\n      });\n      mk.on('dragend', e => {\n        const evt = e as MarkerDragEvent;\n        evt.lngLat = marker.getLngLat();\n        thisRef.current.props.onDragEnd?.(evt);\n      });\n\n      return mk;\n    }, []);\n\n    useEffect(() => {\n      marker.addTo(map.getMap());\n\n      return () => {\n        marker.remove();\n      };\n    }, []);\n\n    const {\n      longitude,\n      latitude,\n      offset,\n      style,\n      draggable = false,\n      popup = null,\n      rotation = 0,\n      rotationAlignment = 'auto',\n      pitchAlignment = 'auto'\n    } = props;\n\n    useEffect(() => {\n      applyReactStyle(marker.getElement(), style);\n    }, [style]);\n\n    useImperativeHandle(ref, () => marker, []);\n\n    const oldProps = thisRef.current.props;\n    if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n      marker.setLngLat([longitude, latitude]);\n    }\n    if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n      marker.setOffset(offset);\n    }\n    if (marker.isDraggable() !== draggable) {\n      marker.setDraggable(draggable);\n    }\n    if (marker.getRotation() !== rotation) {\n      marker.setRotation(rotation);\n    }\n    if (marker.getRotationAlignment() !== rotationAlignment) {\n      marker.setRotationAlignment(rotationAlignment);\n    }\n    if (marker.getPitchAlignment() !== pitchAlignment) {\n      marker.setPitchAlignment(pitchAlignment);\n    }\n    if (marker.getPopup() !== popup) {\n      marker.setPopup(popup);\n    }\n    const classNameDiff = compareClassNames(oldProps.className, props.className);\n    if (classNameDiff) {\n      for (const c of classNameDiff) {\n        marker.toggleClassName(c);\n      }\n    }\n\n    thisRef.current.props = props;\n    return createPortal(props.children, marker.getElement());\n  })\n);\n", "import * as React from 'react';\n// This is a simplified version of\n// https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSPropertyOperations.js#L62\nconst unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;\n\nexport function applyReactStyle(element: HTMLElement, styles: React.CSSProperties) {\n  if (!element || !styles) {\n    return;\n  }\n  const style = element.style;\n\n  for (const key in styles) {\n    const value = styles[key];\n    if (Number.isFinite(value) && !unitlessNumber.test(key)) {\n      style[key] = `${value}px`;\n    } else {\n      style[key] = value;\n    }\n  }\n}\n", "/** Compare two classNames string and return the difference */\nexport function compareClassNames(\n  prevClassName: string | undefined,\n  nextClassName: string | undefined\n): string[] | null {\n  if (prevClassName === nextClassName) {\n    return null;\n  }\n\n  const prevClassList = getClassList(prevClassName);\n  const nextClassList = getClassList(nextClassName);\n  const diff: string[] = [];\n\n  for (const c of nextClassList) {\n    if (!prevClassList.has(c)) {\n      diff.push(c);\n    }\n  }\n  for (const c of prevClassList) {\n    if (!nextClassList.has(c)) {\n      diff.push(c);\n    }\n  }\n  return diff.length === 0 ? null : diff;\n}\n\nfunction getClassList(className: string | undefined) {\n  return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n", "/* global document */\nimport * as React from 'react';\nimport {createPortal} from 'react-dom';\nimport {useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\n\nimport type {PopupInstance, PopupOptions} from '../types/lib';\nimport type {PopupEvent} from '../types/events';\n\nimport {MapContext} from './map';\nimport {deepEqual} from '../utils/deep-equal';\nimport {compareClassNames} from '../utils/compare-class-names';\n\nexport type PopupProps = PopupOptions & {\n  /** Longitude of the anchor location */\n  longitude: number;\n  /** Latitude of the anchor location */\n  latitude: number;\n\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n\n  onOpen?: (e: PopupEvent) => void;\n  onClose?: (e: PopupEvent) => void;\n  children?: React.ReactNode;\n};\n\n/* eslint-disable complexity,max-statements */\nexport const Popup = memo(\n  forwardRef((props: PopupProps, ref: React.Ref<PopupInstance>) => {\n    const {map, mapLib} = useContext(MapContext);\n    const container = useMemo(() => {\n      return document.createElement('div');\n    }, []);\n    const thisRef = useRef({props});\n\n    const popup: PopupInstance = useMemo(() => {\n      const options = {...props};\n      const pp = new mapLib.Popup(options);\n      pp.setLngLat([props.longitude, props.latitude]);\n      pp.once('open', e => {\n        thisRef.current.props.onOpen?.(e as PopupEvent);\n      });\n      return pp;\n    }, []);\n\n    useEffect(() => {\n      const onClose = e => {\n        thisRef.current.props.onClose?.(e as PopupEvent);\n      };\n      popup.on('close', onClose);\n      popup.setDOMContent(container).addTo(map.getMap());\n\n      return () => {\n        // https://github.com/visgl/react-map-gl/issues/1825\n        // onClose should not be fired if the popup is removed by unmounting\n        // When using React strict mode, the component is mounted twice.\n        // Firing the onClose callback here would be a false signal to remove the component.\n        popup.off('close', onClose);\n        if (popup.isOpen()) {\n          popup.remove();\n        }\n      };\n    }, []);\n\n    useEffect(() => {\n      applyReactStyle(popup.getElement(), props.style);\n    }, [props.style]);\n\n    useImperativeHandle(ref, () => popup, []);\n\n    if (popup.isOpen()) {\n      const oldProps = thisRef.current.props;\n      if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) {\n        popup.setLngLat([props.longitude, props.latitude]);\n      }\n      if (props.offset && !deepEqual(oldProps.offset, props.offset)) {\n        popup.options.anchor = props.anchor;\n        popup.setOffset(props.offset);\n      }\n      if (oldProps.anchor !== props.anchor || oldProps.maxWidth !== props.maxWidth) {\n        popup.setMaxWidth(props.maxWidth);\n      }\n      const classNameDiff = compareClassNames(oldProps.className, props.className);\n      if (classNameDiff) {\n        for (const c of classNameDiff) {\n          popup.toggleClassName(c);\n        }\n      }\n      thisRef.current.props = props;\n    }\n\n    return createPortal(props.children, container);\n  })\n);\n", "import * as React from 'react';\nimport {useEffect, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\nimport {useControl} from './use-control';\n\nimport type {ControlPosition, AttributionControlOptions} from '../types/lib';\n\nexport type AttributionControlProps = AttributionControlOptions & {\n  /** Placement of the control relative to the map. */\n  position?: ControlPosition;\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n};\n\nfunction _AttributionControl(props: AttributionControlProps) {\n  const ctrl = useControl(({mapLib}) => new mapLib.AttributionControl(props), {\n    position: props.position\n  });\n\n  useEffect(() => {\n    applyReactStyle(ctrl._container, props.style);\n  }, [props.style]);\n\n  return null;\n}\n\nexport const AttributionControl = memo(_AttributionControl);\n", "import {useContext, useMemo, useEffect} from 'react';\nimport type {IControl, ControlPosition} from '../types/lib';\nimport {MapContext} from './map';\nimport type {MapContextValue} from './map';\n\ntype ControlOptions = {\n  position?: ControlPosition;\n};\n\nexport function useControl<T extends IControl>(\n  onCreate: (context: MapContextValue) => T,\n  opts?: ControlOptions\n): T;\n\nexport function useControl<T extends IControl>(\n  onCreate: (context: MapContextValue) => T,\n  onRemove: (context: MapContextValue) => void,\n  opts?: ControlOptions\n): T;\n\nexport function useControl<T extends IControl>(\n  onCreate: (context: MapContextValue) => T,\n  onAdd: (context: MapContextValue) => void,\n  onRemove: (context: MapContextValue) => void,\n  opts?: ControlOptions\n): T;\n\nexport function useControl<T extends IControl>(\n  onCreate: (context: MapContextValue) => T,\n  arg1?: ((context: MapContextValue) => void) | ControlOptions,\n  arg2?: ((context: MapContextValue) => void) | ControlOptions,\n  arg3?: ControlOptions\n): T {\n  const context = useContext(MapContext);\n  const ctrl = useMemo(() => onCreate(context), []);\n\n  useEffect(() => {\n    const opts = (arg3 || arg2 || arg1) as ControlOptions;\n    const onAdd = typeof arg1 === 'function' && typeof arg2 === 'function' ? arg1 : null;\n    const onRemove = typeof arg2 === 'function' ? arg2 : typeof arg1 === 'function' ? arg1 : null;\n\n    const {map} = context;\n    if (!map.hasControl(ctrl)) {\n      map.addControl(ctrl, opts?.position);\n      if (onAdd) {\n        onAdd(context);\n      }\n    }\n\n    return () => {\n      if (onRemove) {\n        onRemove(context);\n      }\n      // Map might have been removed (parent effects are destroyed before child ones)\n      if (map.hasControl(ctrl)) {\n        map.removeControl(ctrl);\n      }\n    };\n  }, []);\n\n  return ctrl;\n}\n", "/* global document */\nimport * as React from 'react';\nimport {useEffect, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\nimport {useControl} from './use-control';\n\nimport type {ControlPosition, FullscreenControlOptions} from '../types/lib';\n\nexport type FullscreenControlProps = Omit<FullscreenControlOptions, 'container'> & {\n  /** Id of the DOM element which should be made full screen. By default, the map container\n   * element will be made full screen. */\n  containerId?: string;\n  /** Placement of the control relative to the map. */\n  position?: ControlPosition;\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n};\n\nfunction _FullscreenControl(props: FullscreenControlProps) {\n  const ctrl = useControl(\n    ({mapLib}) =>\n      new mapLib.FullscreenControl({\n        container: props.containerId && document.getElementById(props.containerId)\n      }),\n    {position: props.position}\n  );\n\n  useEffect(() => {\n    applyReactStyle(ctrl._controlContainer, props.style);\n  }, [props.style]);\n\n  return null;\n}\n\nexport const FullscreenControl = memo(_FullscreenControl);\n", "import * as React from 'react';\nimport {useImperativeHandle, useRef, useEffect, forwardRef, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\nimport {useControl} from './use-control';\n\nimport type {\n  ControlPosition,\n  GeolocateControlInstance,\n  GeolocateControlOptions\n} from '../types/lib';\nimport type {GeolocateEvent, GeolocateResultEvent, GeolocateErrorEvent} from '../types/events';\n\nexport type GeolocateControlProps = GeolocateControlOptions & {\n  /** Placement of the control relative to the map. */\n  position?: ControlPosition;\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n\n  /** Called on each Geolocation API position update that returned as success. */\n  onGeolocate?: (e: GeolocateResultEvent) => void;\n  /** Called on each Geolocation API position update that returned as an error. */\n  onError?: (e: GeolocateErrorEvent) => void;\n  /** Called on each Geolocation API position update that returned as success but user position\n   * is out of map `maxBounds`. */\n  onOutOfMaxBounds?: (e: GeolocateResultEvent) => void;\n  /** Called when the GeolocateControl changes to the active lock state. */\n  onTrackUserLocationStart?: (e: GeolocateEvent) => void;\n  /** Called when the GeolocateControl changes to the background state. */\n  onTrackUserLocationEnd?: (e: GeolocateEvent) => void;\n};\n\nfunction _GeolocateControl(props: GeolocateControlProps, ref: React.Ref<GeolocateControlInstance>) {\n  const thisRef = useRef({props});\n\n  const ctrl = useControl(\n    ({mapLib}) => {\n      const gc = new mapLib.GeolocateControl(props);\n\n      // Hack: fix GeolocateControl reuse\n      // When using React strict mode, the component is mounted twice.\n      // GeolocateControl's UI creation is asynchronous. Removing and adding it back causes the UI to be initialized twice.\n      const setupUI = gc._setupUI.bind(gc);\n      gc._setupUI = args => {\n        if (!gc._container.hasChildNodes()) {\n          setupUI(args);\n        }\n      };\n\n      gc.on('geolocate', e => {\n        thisRef.current.props.onGeolocate?.(e as GeolocateResultEvent);\n      });\n      gc.on('error', e => {\n        thisRef.current.props.onError?.(e as GeolocateErrorEvent);\n      });\n      gc.on('outofmaxbounds', e => {\n        thisRef.current.props.onOutOfMaxBounds?.(e as GeolocateResultEvent);\n      });\n      gc.on('trackuserlocationstart', e => {\n        thisRef.current.props.onTrackUserLocationStart?.(e as GeolocateEvent);\n      });\n      gc.on('trackuserlocationend', e => {\n        thisRef.current.props.onTrackUserLocationEnd?.(e as GeolocateEvent);\n      });\n\n      return gc;\n    },\n    {position: props.position}\n  );\n\n  thisRef.current.props = props;\n\n  useImperativeHandle(ref, () => ctrl, []);\n\n  useEffect(() => {\n    applyReactStyle(ctrl._container, props.style);\n  }, [props.style]);\n\n  return null;\n}\n\nexport const GeolocateControl = memo(forwardRef(_GeolocateControl));\n", "import * as React from 'react';\nimport {useEffect, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\nimport {useControl} from './use-control';\n\nimport type {ControlPosition, NavigationControlOptions} from '../types/lib';\n\nexport type NavigationControlProps = NavigationControlOptions & {\n  /** Placement of the control relative to the map. */\n  position?: ControlPosition;\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n};\n\nfunction _NavigationControl(props: NavigationControlProps) {\n  const ctrl = useControl(({mapLib}) => new mapLib.NavigationControl(props), {\n    position: props.position\n  });\n\n  useEffect(() => {\n    applyReactStyle(ctrl._container, props.style);\n  }, [props.style]);\n\n  return null;\n}\n\nexport const NavigationControl = memo(_NavigationControl);\n", "import * as React from 'react';\nimport {useEffect, useRef, memo} from 'react';\nimport {applyReactStyle} from '../utils/apply-react-style';\nimport {useControl} from './use-control';\n\nimport type {ControlPosition, ScaleControlOptions} from '../types/lib';\n\nexport type ScaleControlProps = ScaleControlOptions & {\n  // These props will be further constraint by OptionsT\n  unit?: string;\n  maxWidth?: number;\n\n  /** Placement of the control relative to the map. */\n  position?: ControlPosition;\n  /** CSS style override, applied to the control's container */\n  style?: React.CSSProperties;\n};\n\nfunction _ScaleControl(props: ScaleControlProps) {\n  const ctrl = useControl(({mapLib}) => new mapLib.ScaleControl(props), {\n    position: props.position\n  });\n  const propsRef = useRef<ScaleControlProps>(props);\n\n  const prevProps = propsRef.current;\n  propsRef.current = props;\n\n  const {style} = props;\n\n  if (props.maxWidth !== undefined && props.maxWidth !== prevProps.maxWidth) {\n    ctrl.options.maxWidth = props.maxWidth;\n  }\n  if (props.unit !== undefined && props.unit !== prevProps.unit) {\n    ctrl.setUnit(props.unit);\n  }\n\n  useEffect(() => {\n    applyReactStyle(ctrl._container, style);\n  }, [style]);\n\n  return null;\n}\n\nexport const ScaleControl = memo(_ScaleControl);\n", "import * as React from 'react';\nimport {useContext, useEffect, useMemo, useState, useRef, cloneElement} from 'react';\nimport {MapContext} from './map';\nimport assert from '../utils/assert';\nimport {deepEqual} from '../utils/deep-equal';\n\nimport type {\n  SourceSpecification,\n  CanvasSourceSpecification,\n  ImageSourceSpecification,\n  VectorSourceSpecification\n} from '../types/style-spec';\nimport type {MapInstance} from '../types/lib';\nimport type {\n  GeoJSONSourceImplementation,\n  ImageSourceImplementation,\n  AnySourceImplementation\n} from '../types/internal';\n\nexport type SourceProps = (SourceSpecification | CanvasSourceSpecification) & {\n  id?: string;\n  children?: any;\n};\n\nlet sourceCounter = 0;\n\nfunction createSource(map: MapInstance, id: string, props: SourceProps) {\n  // @ts-ignore\n  if (map.style && map.style._loaded) {\n    const options = {...props};\n    delete options.id;\n    delete options.children;\n    // @ts-ignore\n    map.addSource(id, options);\n    return map.getSource(id);\n  }\n  return null;\n}\n\n/* eslint-disable complexity */\nfunction updateSource(source: AnySourceImplementation, props: SourceProps, prevProps: SourceProps) {\n  assert(props.id === prevProps.id, 'source id changed');\n  assert(props.type === prevProps.type, 'source type changed');\n\n  let changedKey = '';\n  let changedKeyCount = 0;\n\n  for (const key in props) {\n    if (key !== 'children' && key !== 'id' && !deepEqual(prevProps[key], props[key])) {\n      changedKey = key;\n      changedKeyCount++;\n    }\n  }\n\n  if (!changedKeyCount) {\n    return;\n  }\n\n  const type = props.type;\n\n  if (type === 'geojson') {\n    (source as GeoJSONSourceImplementation).setData(props.data);\n  } else if (type === 'image') {\n    (source as ImageSourceImplementation).updateImage({\n      url: props.url,\n      coordinates: props.coordinates\n    });\n  } else if ('setCoordinates' in source && changedKeyCount === 1 && changedKey === 'coordinates') {\n    source.setCoordinates((props as unknown as ImageSourceSpecification).coordinates);\n  } else if ('setUrl' in source && changedKey === 'url') {\n    source.setUrl((props as VectorSourceSpecification).url);\n  } else if ('setTiles' in source && changedKey === 'tiles') {\n    source.setTiles((props as VectorSourceSpecification).tiles);\n  } else {\n    // eslint-disable-next-line\n    console.warn(`Unable to update <Source> prop: ${changedKey}`);\n  }\n}\n/* eslint-enable complexity */\n\nexport function Source(props: SourceProps) {\n  const map = useContext(MapContext).map.getMap();\n  const propsRef = useRef(props);\n  const [, setStyleLoaded] = useState(0);\n\n  const id = useMemo(() => props.id || `jsx-source-${sourceCounter++}`, []);\n\n  useEffect(() => {\n    if (map) {\n      /* global setTimeout */\n      const forceUpdate = () => setTimeout(() => setStyleLoaded(version => version + 1), 0);\n      map.on('styledata', forceUpdate);\n      forceUpdate();\n\n      return () => {\n        map.off('styledata', forceUpdate);\n        // @ts-ignore\n        if (map.style && map.style._loaded && map.getSource(id)) {\n          // Parent effects are destroyed before child ones, see\n          // https://github.com/facebook/react/issues/16728\n          // Source can only be removed after all child layers are removed\n          const allLayers = map.getStyle()?.layers;\n          if (allLayers) {\n            for (const layer of allLayers) {\n              // @ts-ignore (2339) source does not exist on all layer types\n              if (layer.source === id) {\n                map.removeLayer(layer.id);\n              }\n            }\n          }\n          map.removeSource(id);\n        }\n      };\n    }\n    return undefined;\n  }, [map]);\n\n  // @ts-ignore\n  let source = map && map.style && map.getSource(id);\n  if (source) {\n    updateSource(source, props, propsRef.current);\n  } else {\n    source = createSource(map, id, props);\n  }\n  propsRef.current = props;\n\n  return (\n    (source &&\n      React.Children.map(\n        props.children,\n        child =>\n          child &&\n          cloneElement(child, {\n            source: id\n          })\n      )) ||\n    null\n  );\n}\n", "export default function assert(condition: any, message: string) {\n  if (!condition) {\n    throw new Error(message);\n  }\n}\n", "import {useContext, useEffect, useMemo, useState, useRef} from 'react';\nimport {MapContext} from './map';\nimport assert from '../utils/assert';\nimport {deepEqual} from '../utils/deep-equal';\n\nimport type {MapInstance, CustomLayerInterface} from '../types/lib';\nimport type {LayerSpecification} from '../types/style-spec';\n\n// Omiting property from a union type, see\n// https://github.com/microsoft/TypeScript/issues/39556#issuecomment-656925230\ntype OptionalId<T> = T extends {id: string} ? Omit<T, 'id'> & {id?: string} : T;\ntype OptionalSource<T> = T extends {source: string} ? Omit<T, 'source'> & {source?: string} : T;\n\nexport type LayerProps = (OptionalSource<OptionalId<LayerSpecification>> | CustomLayerInterface) & {\n  /** If set, the layer will be inserted before the specified layer */\n  beforeId?: string;\n};\n\n/* eslint-disable complexity, max-statements */\nfunction updateLayer(map: MapInstance, id: string, props: LayerProps, prevProps: LayerProps) {\n  assert(props.id === prevProps.id, 'layer id changed');\n  assert(props.type === prevProps.type, 'layer type changed');\n\n  if (props.type === 'custom' || prevProps.type === 'custom') {\n    return;\n  }\n\n  // @ts-ignore filter does not exist in some Layer types\n  const {layout = {}, paint = {}, filter, minzoom, maxzoom, beforeId} = props;\n\n  if (beforeId !== prevProps.beforeId) {\n    map.moveLayer(id, beforeId);\n  }\n  if (layout !== prevProps.layout) {\n    const prevLayout = prevProps.layout || {};\n    for (const key in layout) {\n      if (!deepEqual(layout[key], prevLayout[key])) {\n        map.setLayoutProperty(id, key as any, layout[key]);\n      }\n    }\n    for (const key in prevLayout) {\n      if (!layout.hasOwnProperty(key)) {\n        map.setLayoutProperty(id, key as any, undefined);\n      }\n    }\n  }\n  if (paint !== prevProps.paint) {\n    const prevPaint = prevProps.paint || {};\n    for (const key in paint) {\n      if (!deepEqual(paint[key], prevPaint[key])) {\n        map.setPaintProperty(id, key as any, paint[key]);\n      }\n    }\n    for (const key in prevPaint) {\n      if (!paint.hasOwnProperty(key)) {\n        map.setPaintProperty(id, key as any, undefined);\n      }\n    }\n  }\n\n  // @ts-ignore filter does not exist in some Layer types\n  if (!deepEqual(filter, prevProps.filter)) {\n    map.setFilter(id, filter);\n  }\n  if (minzoom !== prevProps.minzoom || maxzoom !== prevProps.maxzoom) {\n    map.setLayerZoomRange(id, minzoom, maxzoom);\n  }\n}\n\nfunction createLayer(map: MapInstance, id: string, props: LayerProps) {\n  // @ts-ignore\n  if (map.style && map.style._loaded && (!('source' in props) || map.getSource(props.source))) {\n    const options: LayerProps = {...props, id};\n    delete options.beforeId;\n\n    // @ts-ignore\n    map.addLayer(options, props.beforeId);\n  }\n}\n\n/* eslint-enable complexity, max-statements */\n\nlet layerCounter = 0;\n\nexport function Layer(props: LayerProps) {\n  const map = useContext(MapContext).map.getMap();\n  const propsRef = useRef(props);\n  const [, setStyleLoaded] = useState(0);\n\n  const id = useMemo(() => props.id || `jsx-layer-${layerCounter++}`, []);\n\n  useEffect(() => {\n    if (map) {\n      const forceUpdate = () => setStyleLoaded(version => version + 1);\n      map.on('styledata', forceUpdate);\n      forceUpdate();\n\n      return () => {\n        map.off('styledata', forceUpdate);\n        // @ts-ignore\n        if (map.style && map.style._loaded && map.getLayer(id)) {\n          map.removeLayer(id);\n        }\n      };\n    }\n    return undefined;\n  }, [map]);\n\n  // @ts-ignore\n  const layer = map && map.style && map.getLayer(id);\n  if (layer) {\n    try {\n      updateLayer(map, id, props, propsRef.current);\n    } catch (error) {\n      console.warn(error); // eslint-disable-line\n    }\n  } else {\n    createLayer(map, id, props);\n  }\n\n  // Store last rendered props\n  propsRef.current = props;\n\n  return null;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;ACAA,IAAAA,SAAuB;AACvB,IAAAC,gBAAoF;;;ACDpF,YAAuB;AACvB,mBAAyD;AAWlD,IAAM,qBAA2B,oBAAuC,IAAI;AAE5E,IAAM,cAAsD,WAAQ;AACzE,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAiC,CAAA,CAAE;AAE3D,QAAM,iBAAa,0BAAY,CAAC,KAAa,KAAa,cAAa;AACrE,YAAQ,cAAW;AACjB,UAAI,OAAO,WAAW;AACpB,cAAM,IAAI,MAAM,oCAAoC;MACtD;AACA,UAAI,SAAS,EAAE,GAAG;AAChB,cAAM,IAAI,MAAM,mCAAmC,IAAI;MACzD;AACA,aAAO,EAAC,GAAG,UAAU,CAAC,EAAE,GAAG,IAAG;IAChC,CAAC;EACH,GAAG,CAAA,CAAE;AAEL,QAAM,mBAAe,0BAAY,CAAC,KAAa,cAAa;AAC1D,YAAQ,cAAW;AACjB,UAAI,SAAS,EAAE,GAAG;AAChB,cAAM,WAAW,EAAC,GAAG,SAAQ;AAC7B,eAAO,SAAS,EAAE;AAClB,eAAO;MACT;AACA,aAAO;IACT,CAAC;EACH,GAAG,CAAA,CAAE;AAEL,SACE,oBAAC,mBAAmB,UAAQ,EAC1B,OAAO;IACL;IACA;IACA;IACD,GAEA,MAAM,QAAQ;AAGrB;AAOM,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MAAK;AACb,QAAI,KAAK;AACP,YAAM,cAAc,MAAM,eAAe,aAAW,UAAU,CAAC;AAC/D,UAAI,GAAG,aAAa,WAAW;AAC/B,kBAAW;AAEX,aAAO,MAAK;AACV,YAAI,IAAI,aAAa,WAAW;AAEhC,YAAI,IAAI,SAAS,IAAI,MAAM,WAAW,IAAI,SAAS,EAAE,GAAG;AACtD,cAAI,YAAY,EAAE;QACpB;MACF;IACF;AACA,WAAO;EACT,GAAG,CAAC,GAAG,CAAC;AAGR,QAAM,QAAQ,OAAO,IAAI,SAAS,IAAI,SAAS,EAAE;AACjD,MAAI,OAAO;AACT,QAAI;AACF,kBAAY,KAAK,IAAI,OAAO,SAAS,OAAO;IAC9C,SAAS,OAAP;AACA,cAAQ,KAAK,KAAK;IACpB;EACF,OAAO;AACL,gBAAY,KAAK,IAAI,KAAK;EAC5B;AAGA,WAAS,UAAU;AAEnB,SAAO;AACT;;;AvB1HA,IAAA,eAAe;",
  "names": ["React", "import_react", "import_react", "module", "React", "import_react", "import_react_dom", "import_react", "import_react", "import_react", "import_react", "import_react", "import_react", "import_react", "React", "import_react", "import_react"]
}
