@evergis/react 3.1.2 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/components/{Map/components/Layer → Layer}/index.d.ts +1 -0
  2. package/dist/components/{Map/components/Layer → Layer}/types.d.ts +1 -1
  3. package/dist/components/{Map/components/Layer → Layer}/utils/getClientStyleItemPrefixSuffix.d.ts +1 -1
  4. package/dist/components/Map/index.d.ts +0 -1
  5. package/dist/components/index.d.ts +1 -3
  6. package/dist/contexts/MapContext/types.d.ts +31 -0
  7. package/dist/contexts/index.d.ts +2 -0
  8. package/dist/core/classification/parseClientStyle.d.ts +1 -1
  9. package/dist/core/feature/convertSpToTurfFeature.d.ts +2 -2
  10. package/dist/core/index.d.ts +0 -3
  11. package/dist/hooks/index.d.ts +2 -1
  12. package/dist/hooks/map/index.d.ts +1 -18
  13. package/dist/hooks/map/useMapContext.d.ts +1 -1
  14. package/dist/hooks/map/useMapDraw/customModes.d.ts +6 -1
  15. package/dist/hooks/map/useZoomToFeatures.d.ts +2 -2
  16. package/dist/hooks/serverNotifications/index.d.ts +0 -1
  17. package/dist/hooks/serverNotifications/useServerNotificationsContext.d.ts +1 -1
  18. package/dist/hooks/useDebouncedCallback.d.ts +1 -0
  19. package/dist/hooks/useWindowResize.d.ts +1 -0
  20. package/dist/index.d.ts +3 -0
  21. package/dist/react.cjs.development.js +630 -524
  22. package/dist/react.cjs.development.js.map +1 -1
  23. package/dist/react.cjs.production.min.js +1 -1
  24. package/dist/react.cjs.production.min.js.map +1 -1
  25. package/dist/react.esm.js +617 -506
  26. package/dist/react.esm.js.map +1 -1
  27. package/dist/types/index.d.ts +2 -0
  28. package/dist/utils/debounce.d.ts +1 -0
  29. package/dist/utils/index.d.ts +1 -1
  30. package/package.json +3 -3
  31. package/dist/components/Map/components/BuildingsLayer/BuildingsLayer.d.ts +0 -3
  32. package/dist/components/Map/components/BuildingsLayer/index.d.ts +0 -2
  33. package/dist/components/Map/components/BuildingsLayer/types.d.ts +0 -4
  34. package/dist/components/Map/components/index.d.ts +0 -2
  35. package/dist/components/MapContext/types.d.ts +0 -138
  36. package/dist/components/ResizablePanel/ResizablePanel.d.ts +0 -3
  37. package/dist/components/ResizablePanel/index.d.ts +0 -2
  38. package/dist/components/ResizablePanel/styled.d.ts +0 -11
  39. package/dist/components/ResizablePanel/types.d.ts +0 -14
  40. package/dist/core/attributes/index.d.ts +0 -1
  41. package/dist/core/geometrySelection/drawModeToGeometrySelectionType.d.ts +0 -3
  42. package/dist/core/geometrySelection/getGeometrySelectionTurfFeature.d.ts +0 -3
  43. package/dist/core/geometrySelection/index.d.ts +0 -2
  44. package/dist/core/types/index.d.ts +0 -2
  45. package/dist/core/types/map.d.ts +0 -5
  46. package/dist/hooks/map/useCurrentSelectedFeature.d.ts +0 -2
  47. package/dist/hooks/map/useEditingFeature.d.ts +0 -1
  48. package/dist/hooks/map/useEwktGeometry.d.ts +0 -1
  49. package/dist/hooks/map/useGeometryEditor.d.ts +0 -2
  50. package/dist/hooks/map/useGeometrySelection.d.ts +0 -2
  51. package/dist/hooks/map/useGeometrySelectionBuffer.d.ts +0 -1
  52. package/dist/hooks/map/useSelectFeaturesCount.d.ts +0 -1
  53. package/dist/hooks/map/useSelectFeaturesCurrentIndex.d.ts +0 -1
  54. package/dist/hooks/map/useSelectFeaturesGeometryMasking.d.ts +0 -1
  55. package/dist/hooks/map/useSelectFeaturesInitialized.d.ts +0 -1
  56. package/dist/hooks/map/useSelectFeaturesLayerName.d.ts +0 -1
  57. package/dist/hooks/map/useSelectFeaturesPagination.d.ts +0 -4
  58. package/dist/hooks/map/useSelectFeaturesStatisticsActive.d.ts +0 -1
  59. package/dist/hooks/map/useSelectFeaturesTotalCounts.d.ts +0 -1
  60. package/dist/hooks/map/useSelectedFeatures.d.ts +0 -2
  61. package/dist/hooks/map/useUpdateCurrentFeature.d.ts +0 -2
  62. package/dist/hooks/map/useZoomToLayer.d.ts +0 -7
  63. package/dist/hooks/useResizer.d.ts +0 -28
  64. package/dist/utils/geometryToWkt.d.ts +0 -2
  65. /package/dist/components/{Map/components/Layer → Layer}/Layer.d.ts +0 -0
  66. /package/dist/components/{Map/components/Layer → Layer}/RasterLayer.d.ts +0 -0
  67. /package/dist/components/{Map/components/Layer → Layer}/VectorLayer.d.ts +0 -0
  68. /package/dist/components/{Map/components/Layer → Layer}/constants.d.ts +0 -0
  69. /package/dist/{components → contexts}/MapContext/MapContext.d.ts +0 -0
  70. /package/dist/{components → contexts}/MapContext/MapProvider.d.ts +0 -0
  71. /package/dist/{components → contexts}/MapContext/index.d.ts +0 -0
  72. /package/dist/{components → contexts}/ServerNotificationsContext/ServerNotificationsContext.d.ts +0 -0
  73. /package/dist/{components → contexts}/ServerNotificationsContext/ServerNotificationsProvider.d.ts +0 -0
  74. /package/dist/{hooks/serverNotifications → contexts/ServerNotificationsContext/hooks}/useServerNotifications.d.ts +0 -0
  75. /package/dist/{components → contexts}/ServerNotificationsContext/index.d.ts +0 -0
  76. /package/dist/{components → contexts}/ServerNotificationsContext/types.d.ts +0 -0
  77. /package/dist/{core/attributes/types.d.ts → types/attribute.d.ts} +0 -0
  78. /package/dist/{core/types → types}/styling.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"react.cjs.production.min.js","sources":["../src/core/classification/findAttributeInExpression.ts","../src/core/feature/convertSpToTurfFeature.ts","../src/hooks/map/useMapContext.ts","../src/hooks/map/useCurrentSelectedFeature.ts","../src/components/MapContext/MapContext.ts","../src/components/MapContext/types.ts","../src/hooks/map/useGeometryEditor.ts","../src/hooks/map/useGeometrySelection.ts","../src/utils/date.ts","../src/utils/geometryToWkt.ts","../src/hooks/map/useMapDraw/customModes.ts","../src/hooks/map/useMapDraw/index.ts","../src/hooks/map/useMapDraw/customStyles.ts","../src/components/ServerNotificationsContext/ServerNotificationsContext.ts","../src/hooks/useResizer.ts","../src/core/geometrySelection/drawModeToGeometrySelectionType.ts","../src/core/classification/getActualExtrusionHeight.ts","../src/core/geometrySelection/getGeometrySelectionTurfFeature.ts","../src/utils/isNumeric.ts","../src/utils/isObject.ts","../src/core/classification/parseClientStyle.ts","../src/hooks/map/useEditingFeature.ts","../src/hooks/map/useEwktGeometry.ts","../src/hooks/map/useGeometrySelectionBuffer.ts","../src/hooks/map/useRedrawLayer.ts","../src/hooks/map/useSelectFeaturesCount.ts","../src/hooks/map/useSelectFeaturesCurrentIndex.ts","../src/hooks/map/useSelectFeaturesGeometryMasking.ts","../src/hooks/map/useSelectFeaturesInitialized.ts","../src/hooks/map/useSelectFeaturesLayerName.ts","../src/hooks/map/useSelectFeaturesPagination.ts","../src/hooks/map/useSelectFeaturesStatisticsActive.ts","../src/hooks/map/useSelectFeaturesTotalCounts.ts","../src/hooks/map/useSelectedFeatures.ts","../src/hooks/serverNotifications/useServerNotifications.ts","../src/hooks/serverNotifications/useServerNotificationsContext.ts","../src/hooks/useToggle.ts","../src/hooks/map/useUpdateCurrentFeature.ts","../src/hooks/map/useZoomToFeatures.ts","../src/hooks/map/useZoomToLayer.ts","../src/hooks/map/useZoomToPoint.ts"],"sourcesContent":["import { ExpressionSpecification } from \"mapbox-gl\";\n\nexport const findAttributeInExpression = (expression: ExpressionSpecification): string[] => {\n if (Array.isArray(expression) && expression.length === 2 && expression[0] === \"get\") {\n return [expression[1]];\n }\n\n return expression.reduce((acc: string[], curr) => {\n if (!Array.isArray(curr)) {\n return acc;\n }\n\n if (curr[0] === \"get\") {\n return [...new Set([...acc, curr[1]])];\n }\n\n return [...new Set([...acc, ...findAttributeInExpression(curr as ExpressionSpecification)])];\n }, []);\n};\n","import { GeometryType } from \"@evergis/api\";\nimport { multiLineString, multiPoint, point, polygon } from \"@turf/turf\";\nimport { Feature } from \"geojson\";\n\nimport { FeaturedDcExtendedGeometry } from \"../../components\";\n\nexport const convertSpToTurfFeature = (geometry?: FeaturedDcExtendedGeometry): Feature<any> | undefined => {\n if (!geometry) {\n return;\n }\n\n switch (geometry.type) {\n case GeometryType.Point:\n return point(geometry.coordinates);\n case GeometryType.Multipoint:\n return multiPoint(geometry.coordinates);\n case GeometryType.Polyline:\n return multiLineString(geometry.coordinates);\n case GeometryType.Polygon:\n case GeometryType.Envelope:\n return polygon(geometry.coordinates);\n default:\n }\n};\n","import { useContext } from \"react\";\n\nimport { MapContext } from \"../../components\";\n\nexport const useMapContext = () => {\n return useContext(MapContext);\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components/MapContext\";\n\nexport const useCurrentSelectedFeature = (): SelectedFeature => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.find(item => item.id === selectFeatures.currentId);\n }, [selectFeatures]);\n};\n","import { createContext } from \"react\";\n\nimport { MapContextProps } from \"./types\";\n\nexport const MapContext = createContext<MapContextProps>({});\n","import { Dispatch, MutableRefObject, PropsWithChildren, SetStateAction } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\nimport { FeatureDc, LayerDefinitionDc, GeometryType } from \"@evergis/api\";\nimport { Feature } from \"geojson\";\n\nexport enum BaseMapTheme {\n Light = \"light\",\n Dark = \"dark\",\n}\n\nexport interface BaseMapItem {\n name: string;\n source: string;\n preview?: string;\n imgSrc?: string;\n title: string;\n theme?: BaseMapTheme;\n opacity?: number;\n color?: string;\n}\n\nexport enum GeometrySelectionTypes {\n Point = \"select_point\",\n Line = \"select_line\",\n Circle = \"select_circle\",\n Rect = \"select_rect\",\n Polygon = \"select_polygon\",\n Zones = \"zones_selection\",\n Coordinates = \"xy\",\n Route = \"selection_route\",\n}\n\nexport enum GeometrySelectionToolTypes {\n Replace = \"Replace\",\n Unite = \"Unite\",\n Crop = \"Crop\",\n Edit = \"Edit\",\n}\n\nexport type SelectionHistoryFeature = Feature;\n\nexport interface SelectionHistory {\n features: Array<SelectionHistoryFeature[]>;\n zones?: Array<Array<Feature[]>>;\n step: number;\n}\n\nexport enum GeometrySelectionZoneTypes {\n Walking = \"Walking\",\n Car = \"Car\",\n}\n\nexport enum GeometrySelectionRouteTypes {\n Walking = \"Walking\",\n Car = \"Car\",\n}\n\nexport interface GeometrySelectionSettings {\n zoneDuration?: number;\n zoneType?: GeometrySelectionZoneTypes;\n routeType?: GeometrySelectionRouteTypes;\n bufferRadius?: string;\n bufferMultiplier?: string;\n bufferInclude?: boolean;\n selectOutside?: boolean;\n}\n\nexport interface GeometrySelection {\n active?: boolean;\n loading?: boolean;\n type?: GeometrySelectionTypes;\n currentTool?: GeometrySelectionToolTypes;\n history?: SelectionHistory;\n editHistory?: SelectionHistory;\n isBuffer?: boolean;\n settings?: GeometrySelectionSettings;\n}\n\nexport enum GeometryEditorMode {\n Create,\n Edit,\n Transform,\n Expand,\n Unite,\n Subtract,\n}\n\nexport type Coordinates = [number, number];\n\nexport type Positions = Coordinates | Coordinates[] | Coordinates[][];\n\nexport interface GeometryEditor {\n active: boolean;\n geometryType?: GeometryType;\n layerName?: string;\n geometry?: Positions;\n mode?: GeometryEditorMode;\n}\n\nexport interface FeaturedDcExtendedGeometry extends Omit<FeatureDc[\"geometry\"], \"coordinates\"> {\n coordinates?: any;\n}\n\nexport interface FeatureDcExtended extends Omit<FeatureDc, \"geometry\"> {\n geometry: FeaturedDcExtendedGeometry;\n layer: string;\n}\n\nexport interface SelectedFeature extends FeatureDcExtended {\n layerDefinition: LayerDefinitionDc;\n}\n\nexport interface SelectFeatures {\n initialized?: boolean;\n layerName?: string;\n currentId: string | null;\n selectionOffset?: number;\n features: Record<string, SelectedFeature[]>;\n totalCounts: Record<string, number>;\n statisticsActive?: boolean;\n geometryMasking?: boolean;\n}\n\nexport interface MapContextProps {\n map?: MutableRefObject<MapboxGLMap>;\n draw?: MutableRefObject<Omit<MapboxDraw, \"getDefaultPosition\">>;\n loaded?: boolean;\n setLoaded?: Dispatch<SetStateAction<boolean>>;\n basemapItems?: BaseMapItem[];\n basemapName?: string;\n setBasemapName?: Dispatch<SetStateAction<string>>;\n defaultBasemap?: string;\n globeProjection?: boolean;\n setGlobeProjection?: Dispatch<SetStateAction<boolean>>;\n geometrySelection?: GeometrySelection;\n setGeometrySelection?: Dispatch<SetStateAction<GeometrySelection>>;\n resetGeometrySelection?: VoidFunction;\n geometryEditor?: GeometryEditor;\n setGeometryEditor?: Dispatch<SetStateAction<GeometryEditor>>;\n resetGeometryEditor?: VoidFunction;\n selectFeatures?: SelectFeatures;\n setNextFeature?: VoidFunction;\n setPrevFeature?: VoidFunction;\n setSelectedFeatures?: (payload?: SelectFeatures[\"features\"], currentId?: any, offset?: number) => void;\n setSelectedFeaturesTotalCounts?: Dispatch<SetStateAction<SelectFeatures[\"totalCounts\"]>>;\n setSelectFeaturesInitialized?: Dispatch<SetStateAction<boolean>>;\n setSelectFeaturesLayerName?: Dispatch<SetStateAction<string>>;\n setSelectFeaturesStatisticsActive?: Dispatch<SetStateAction<boolean>>;\n setSelectFeaturesGeometryMasking?: Dispatch<SetStateAction<boolean>>;\n updateCurrentFeature?: Dispatch<SetStateAction<Partial<SelectedFeature>>>;\n resetSelectedFeatures?: VoidFunction;\n}\n\nexport interface MapProviderProps extends PropsWithChildren {\n basemapItems: BaseMapItem[];\n defaultBasemap: string;\n}\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { GeometryEditor } from \"../../components\";\n\nexport const useGeometryEditor = (): [GeometryEditor, (state: Partial<GeometryEditor>) => void] => {\n const { geometryEditor, setGeometryEditor } = useMapContext();\n\n const update = useCallback(\n (newState: Partial<GeometryEditor>) => {\n setGeometryEditor(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n [setGeometryEditor],\n );\n\n return [geometryEditor, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { GeometrySelection } from \"../../components\";\n\nexport const useGeometrySelection = (): [GeometrySelection, (state: Partial<GeometrySelection>) => void] => {\n const { geometrySelection, setGeometrySelection } = useMapContext();\n\n const updateGeometrySelection = useCallback(\n (newState: Partial<GeometrySelection>) => {\n setGeometrySelection(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n [setGeometrySelection],\n );\n\n return [geometrySelection, updateGeometrySelection];\n};\n","import { parseJSON, parseISO, isValid, format, toDate } from \"date-fns\";\n\nexport const NO_CONTENT_VALUE = \"—\";\n\nexport type DateType = number | Date;\nexport type RawDateType = string | DateType;\n\nexport enum DateFormat {\n ClientDefaultFormat = \"dd.MM.yyyy HH:mm\",\n DateTime = \"dd.MM.yyyy HH:mm:ss\",\n UTC = \"yyyy-MM-dd'T'HH:mm:ss.sssxxx\",\n AxisTooltip = \"d MMMM yyyy\",\n}\n\ninterface FormatDateOptions {\n dateFormat?: DateFormat;\n defaultValue?: RawDateType;\n}\n\nconst stringDateParsers: ((date: string) => DateType)[] = [parseJSON, parseISO, rawDate => new Date(rawDate)];\n\nexport const getDate = (rawDate?: RawDateType | null): Date | null => {\n if (!rawDate) return null;\n\n if (typeof rawDate === \"string\") {\n for (const parser of stringDateParsers) {\n const date = parser(rawDate);\n\n if (isValid(date)) {\n return toDate(date);\n }\n }\n\n return null;\n }\n\n const parsedDate = toDate(rawDate);\n\n return isValid(parsedDate) ? parsedDate : null;\n};\n\nexport const formatDate = (\n date?: RawDateType,\n { dateFormat = DateFormat.ClientDefaultFormat, defaultValue = NO_CONTENT_VALUE }: FormatDateOptions = {},\n): string => {\n const dateValue = date ? getDate(date) : null;\n\n if (isValid(dateValue)) {\n return format(dateValue as Date, dateFormat);\n }\n\n return defaultValue.toString();\n};\n","import { stringify } from \"wkt\";\n\nimport { SelectionHistoryFeature } from \"../components\";\n\nexport const geometryToWkt = (features: SelectionHistoryFeature[] = []): string => {\n if (features.length === 0) {\n return \"\";\n }\n\n return stringify(features[0]);\n};\n","import MapboxDraw, { DrawCustomMode } from \"@mapbox/mapbox-gl-draw\";\n\nimport { ExtendedMapboxDrawModes } from \"../../../core\";\n\nexport const customModes = MapboxDraw.modes as ExtendedMapboxDrawModes;\n\nconst StaticMode = {} as DrawCustomMode;\n\nStaticMode.onSetup = function () {\n this.setActionableState(undefined);\n\n return {};\n};\n\nStaticMode.toDisplayFeatures = function (state, geojson, display) {\n display(geojson);\n};\n\ncustomModes.static = StaticMode;\n","import { useEffect } from \"react\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { customModes } from \"./customModes\";\nimport { customStyles } from \"./customStyles\";\n\nimport { useMapContext } from \"../useMapContext\";\n\nconst draw = new MapboxDraw({\n displayControlsDefault: false,\n styles: customStyles,\n modes: customModes,\n defaultMode: \"draw_point\",\n controls: {\n trash: true,\n },\n});\n\nexport const useMapDraw = (triggerDeps: Array<unknown> = []) => {\n const { map, draw: drawContext, loaded, basemapName } = useMapContext();\n\n useEffect(() => {\n if (!loaded || !map.current) {\n return;\n }\n\n drawContext.current = draw;\n map.current.addControl(drawContext.current);\n }, [loaded]); // eslint-disable-line\n\n useEffect(() => {\n if (map.current && map.current.hasControl(drawContext.current)) {\n map.current.removeControl(drawContext.current);\n map.current.addControl(drawContext.current);\n }\n }, [basemapName, ...triggerDeps]); // eslint-disable-line\n};\n","export const customStyles = [\n {\n id: \"gl-draw-point\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-inactive-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"false\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-active-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"true\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-fill-static\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-line\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"LineString\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-fill\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-polygon-midpoint\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"midpoint\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-stroke-active\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-and-line-vertex-active\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"meta\", \"vertex\"], [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n];\n","import { createContext } from \"react\";\n\nimport { ServerNotificationsContextProps } from \"./types\";\n\nexport const ServerNotificationsContext = createContext<ServerNotificationsContextProps>({});\n","import { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { isNil } from \"lodash\";\n\nexport enum VerticalPosition {\n Top = \"top\",\n Bottom = \"bottom\",\n}\n\nexport enum HorizontalPosition {\n Left = \"left\",\n Right = \"right\",\n}\n\nexport interface ResizerOptions {\n handleVerticalPosition?: VerticalPosition;\n handleHorizontalPosition?: HorizontalPosition;\n minWidth?: number;\n maxWidth?: number;\n minHeight?: number;\n maxHeight?: number;\n horizontal?: boolean;\n vertical?: boolean;\n useResize?: boolean;\n onResize?: (width: number, height: number) => void;\n onResizeEnd?: (width: number, height: number) => void;\n onResizeStart?: (width: number, height: number) => void;\n}\n\nexport const useResizer = ({\n handleVerticalPosition,\n handleHorizontalPosition,\n minWidth = Number.MIN_SAFE_INTEGER,\n maxWidth = Number.MAX_SAFE_INTEGER,\n horizontal = true,\n minHeight = Number.MIN_SAFE_INTEGER,\n maxHeight = Number.MAX_SAFE_INTEGER,\n vertical = true,\n useResize = false,\n onResize,\n onResizeEnd,\n onResizeStart,\n}: ResizerOptions) => {\n const containerRef = useRef<HTMLDivElement>();\n const verticalHandleRef = useRef<HTMLDivElement>();\n const horizontalHandleRef = useRef<HTMLDivElement>();\n\n const updateSizes = useCallback(\n (width: number, height: number) => {\n let newWidth = width;\n let newHeight = height;\n\n if (horizontal && newWidth < minWidth) {\n newWidth = minWidth;\n }\n\n if (horizontal && newWidth > Math.min(window.innerWidth - horizontalHandleRef.current?.clientWidth, maxWidth)) {\n newWidth = maxWidth;\n }\n\n if (vertical && newHeight < minHeight) {\n newHeight = minHeight;\n }\n\n if (vertical && newHeight > Math.min(window.innerHeight - verticalHandleRef.current?.clientHeight, maxHeight)) {\n newHeight = maxHeight;\n }\n\n if (horizontal) {\n requestAnimationFrame(() => {\n if (!isNil(containerRef.current)) {\n containerRef.current.style.width = `${newWidth}px`;\n }\n });\n }\n\n if (vertical) {\n requestAnimationFrame(() => {\n if (!isNil(containerRef.current)) {\n containerRef.current.style.height = `${newHeight}px`;\n }\n });\n }\n\n onResize?.(newWidth, newHeight);\n },\n [minWidth, maxWidth, minHeight, maxHeight, horizontal, vertical], // eslint-disable-line\n );\n\n const onPointerMove = useCallback(\n (pointerMoveEvent: PointerEvent) => {\n const { x, y } = containerRef.current?.getBoundingClientRect();\n const reverseHorizontal = handleHorizontalPosition === HorizontalPosition.Right;\n const reverseVertical = handleVerticalPosition === VerticalPosition.Bottom;\n\n const newWidth = reverseHorizontal\n ? pointerMoveEvent.pageX - x\n : containerRef.current?.offsetWidth + x - pointerMoveEvent.pageX;\n const newHeight = reverseVertical\n ? pointerMoveEvent.pageY - y\n : containerRef.current?.offsetHeight + y - pointerMoveEvent.pageY;\n\n document.body.style.userSelect = \"none\";\n\n updateSizes(newWidth, newHeight);\n },\n [updateSizes],\n );\n\n const onPointerDown = useCallback(() => {\n const onPointerUp = () => {\n document.body.style.userSelect = \"initial\";\n document.body.removeEventListener(\"pointermove\", onPointerMove);\n\n if (!isNil(containerRef.current)) {\n onResizeEnd?.(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n };\n\n if (!isNil(containerRef.current)) {\n onResizeStart?.(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n\n document.body.addEventListener(\"pointermove\", onPointerMove);\n document.body.addEventListener(\"pointerup\", onPointerUp, { once: true });\n }, [onPointerMove]); // eslint-disable-line\n\n useLayoutEffect(() => {\n if (useResize && !isNil(containerRef.current)) {\n updateSizes(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n }, [updateSizes, useResize]);\n\n return {\n containerRef,\n verticalHandleRef,\n horizontalHandleRef,\n onPointerDown,\n };\n};\n","import { DrawMode } from \"@mapbox/mapbox-gl-draw\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const drawModeToGeometrySelectionType = (mode: DrawMode | string): GeometrySelectionTypes => {\n switch (mode) {\n case \"draw_point\":\n return GeometrySelectionTypes.Point;\n case \"draw_polygon\":\n return GeometrySelectionTypes.Polygon;\n case \"draw_line_string\":\n return GeometrySelectionTypes.Line;\n default:\n return GeometrySelectionTypes.Point;\n }\n};\n","import { AnyPaint } from \"mapbox-gl\";\n\nexport const getActualExtrusionHeight = (paint: AnyPaint) => {\n return Array.isArray(paint?.[\"fill-extrusion-height\"]) && paint?.[\"fill-extrusion-height\"][0] === \"+\"\n ? paint?.[\"fill-extrusion-height\"][1]\n : paint?.[\"fill-extrusion-height\"];\n};\n","import { toMercator, toWgs84, point, polygon, lineString } from \"@turf/turf\";\nimport { Feature, LineString, Point, Polygon, Position } from \"geojson\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const getGeometrySelectionTurfFeature = (\n coordinates: Position | Position[] | Position[][] | Position[][][],\n selectionType: GeometrySelectionTypes,\n toWgs?: boolean,\n): Feature<Point | LineString | Polygon> => {\n if (toWgs) {\n switch (selectionType) {\n case GeometrySelectionTypes.Point:\n return toWgs84(point(coordinates as Position));\n case GeometrySelectionTypes.Polygon:\n return toWgs84(polygon(coordinates as Position[][]));\n case GeometrySelectionTypes.Line:\n return toWgs84(lineString(coordinates as Position[]));\n default:\n }\n }\n\n switch (selectionType) {\n case GeometrySelectionTypes.Point:\n return toMercator(point(coordinates as Position));\n case GeometrySelectionTypes.Polygon:\n return toMercator(polygon(coordinates as Position[][]));\n case GeometrySelectionTypes.Line:\n return toMercator(lineString(coordinates as Position[]));\n default:\n }\n};\n","export const isNumeric = (number: string | number): boolean =>\n !isNaN(parseFloat(number as string)) && isFinite(number as number);\n","export function isObject<T>(value: T | object): value is object {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { isEmpty } from \"lodash\";\nimport { ExpressionSpecification } from \"mapbox-gl\";\n\nimport { findAttributeInExpression } from \"./findAttributeInExpression\";\n\nimport { ClientStyle } from \"../types\";\n\nexport const parseClientStyle = (style?: ClientStyle): string[] => {\n if (!style) {\n return [];\n }\n\n return style?.items?.reduce((acc: string[], curr) => {\n if (!curr.paint || isEmpty(curr.paint)) {\n return acc;\n }\n\n return Object.entries(curr.paint)?.reduce((paintAcc: string[], [, value]) => {\n if (!Array.isArray(value)) {\n return paintAcc;\n }\n\n return [...new Set([...paintAcc, ...findAttributeInExpression(value as ExpressionSpecification)])];\n }, []);\n }, []);\n};\n","import { useMemo } from \"react\";\n\nimport { GeometryEditorMode } from \"../../components/MapContext\";\n\nimport { useGeometryEditor } from \"./useGeometryEditor\";\nimport { useCurrentSelectedFeature } from \"./useCurrentSelectedFeature\";\n\nexport const useEditingFeature = (): boolean => {\n const [{ layerName, active, mode }] = useGeometryEditor();\n const currentSelectedFeature = useCurrentSelectedFeature();\n\n return useMemo(() => {\n return (\n active &&\n ((mode === GeometryEditorMode.Edit && layerName === currentSelectedFeature?.layer) ||\n mode === GeometryEditorMode.Create)\n );\n }, [active, currentSelectedFeature, layerName, mode]);\n};\n","import { useMemo } from \"react\";\nimport { isEmpty } from \"lodash\";\n\nimport { useGeometrySelection } from \"./useGeometrySelection\";\nimport { geometryToWkt } from \"../../utils\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const useEwktGeometry = () => {\n const [{ history, type }] = useGeometrySelection();\n\n return useMemo(() => {\n if (history.step === -1) {\n return \"\";\n }\n\n return type === GeometrySelectionTypes.Zones\n ? !isEmpty(history.zones[history.step]?.[0])\n ? `SRID=3857;${geometryToWkt(history.zones[history.step]?.[0])}`\n : `SRID=3857;${geometryToWkt(history.features[history.step])}`\n : `SRID=3857;${geometryToWkt(history.features[history.step])}`;\n }, [history.features, history.step, history.zones, type]);\n};\n","import { useMemo } from \"react\";\n\nimport { useGeometrySelection } from \"./useGeometrySelection\";\n\nexport const useGeometrySelectionBuffer = (): string | undefined => {\n const [\n {\n settings: { bufferRadius, bufferMultiplier },\n isBuffer,\n },\n ] = useGeometrySelection();\n\n return useMemo((): string | undefined => {\n if (!isBuffer || !bufferRadius) {\n return undefined;\n }\n\n return Number((+bufferRadius || 0) * +bufferMultiplier).toFixed(2);\n }, [isBuffer, bufferRadius, bufferMultiplier]);\n};\n","import { useCallback } from \"react\";\nimport { VectorSourceImpl } from \"mapbox-gl\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useRedrawLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (layerName: string) => {\n const layerTileSource: VectorSourceImpl = map.current.getSource(layerName);\n\n layerTileSource.setTiles(layerTileSource.tiles);\n },\n [map],\n );\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesCount = (): number => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.length ?? 0;\n }, [selectFeatures]);\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesCurrentIndex = (): number => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.length\n ? selectFeatures.features?.[selectFeatures.layerName]?.findIndex(\n feature => feature.id === selectFeatures.currentId,\n )\n : -1;\n }, [selectFeatures]);\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesGeometryMasking = (): [boolean, (state: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesGeometryMasking } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesGeometryMasking(state);\n },\n [setSelectFeaturesGeometryMasking],\n );\n\n return [selectFeatures.geometryMasking, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesInitialized = (): [boolean, (value: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesInitialized } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesInitialized(state);\n },\n [setSelectFeaturesInitialized],\n );\n\n return [selectFeatures.initialized, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesLayerName = (): [string, (name?: string) => void] => {\n const { selectFeatures, setSelectFeaturesLayerName } = useMapContext();\n\n const update = useCallback(\n (name: string) => {\n setSelectFeaturesLayerName(name);\n },\n [setSelectFeaturesLayerName],\n );\n\n return [selectFeatures.layerName, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesPagination = () => {\n const { setNextFeature, setPrevFeature } = useMapContext();\n\n const onNext = useCallback(() => {\n setNextFeature();\n }, [setNextFeature]);\n\n const onPrev = useCallback(() => {\n setPrevFeature();\n }, [setPrevFeature]);\n\n return { onNext, onPrev } as const;\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesStatisticsActive = (): [boolean, (state: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesStatisticsActive } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesStatisticsActive(state);\n },\n [setSelectFeaturesStatisticsActive],\n );\n\n return [selectFeatures.statisticsActive, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesTotalCounts = (): [\n Record<string, number>,\n (totalCounts: Record<string, number>) => void,\n] => {\n const { selectFeatures, setSelectedFeaturesTotalCounts } = useMapContext();\n\n const update = useCallback(\n (totalCounts: Record<string, number>) => {\n setSelectedFeaturesTotalCounts(totalCounts);\n },\n [setSelectedFeaturesTotalCounts],\n );\n\n return [selectFeatures.totalCounts ?? {}, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components\";\n\nexport const useSelectedFeatures = (): [\n Record<string, SelectedFeature[]>,\n (features: Record<string, SelectedFeature[]>) => void,\n] => {\n const { selectFeatures, setSelectedFeatures } = useMapContext();\n\n const updatSelectedFeatures = useCallback(\n (features: Record<string, SelectedFeature[]>) => {\n setSelectedFeatures(features);\n },\n [setSelectedFeatures],\n );\n\n return [selectFeatures.features ?? ({} as Record<string, SelectedFeature[]>), updatSelectedFeatures];\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport { HubConnection, HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\n\nexport const useServerNotifications = (url: string, initialized: boolean): HubConnection | null => {\n const hubConnection = useRef<HubConnection | null>(null);\n const [connection, setConnection] = useState<HubConnection | null>(null);\n\n useEffect(() => {\n if (!initialized) {\n return;\n }\n\n hubConnection.current = new HubConnectionBuilder()\n .withUrl(url, {\n withCredentials: true,\n })\n .configureLogging(LogLevel.Information)\n .build();\n\n hubConnection.current\n .start()\n .then(() => console.info(\"Серверные нотификации подключены\"))\n .catch(err => console.info(\"Ошибка:\", err))\n .finally(() => setConnection(hubConnection.current));\n }, [initialized]); // eslint-disable-line\n\n useEffect(() => {\n if (!connection || connection.state !== \"Connected\") {\n return;\n }\n\n connection\n .invoke(\"SubscribeNotifications\", [])\n .then(() => console.info(\"Подписка `SubscribeNotifications` оформлена\"))\n .catch(err => console.info(\"Ошибка подписки `SubscribeNotifications`:\", err));\n }, [connection]);\n\n return connection;\n};\n","import { useContext } from \"react\";\n\nimport { ServerNotificationsContext } from \"../../components/ServerNotificationsContext/ServerNotificationsContext\";\n\nexport const useServerNotificationsContext = () => {\n return useContext(ServerNotificationsContext);\n};\n","import { useCallback, useState } from \"react\";\n\nexport const useToggle = (initial?: boolean): [boolean, VoidFunction, (value: boolean) => void] => {\n const [state, setState] = useState(initial !== undefined ? initial : false);\n\n const toggle = useCallback(() => setState(!state), [state]);\n\n return [state, toggle, setState];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components\";\n\nexport const useUpdateCurrentFeature = () => {\n const { updateCurrentFeature } = useMapContext();\n\n return useCallback(\n (values: Partial<SelectedFeature>) => {\n updateCurrentFeature(values);\n },\n [updateCurrentFeature],\n );\n};\n","import { useCallback } from \"react\";\nimport { bbox } from \"@turf/turf\";\n\nimport { useMapContext } from \"./useMapContext\";\nimport { convertSpToTurfFeature } from \"../../core\";\n\nimport { FeatureDcExtended } from \"../../components\";\n\nexport const useZoomToFeatures = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (features?: FeatureDcExtended[], padding?: number) => {\n if (!features) {\n return;\n }\n\n const currentFeatureCenter = bbox({\n type: \"FeatureCollection\",\n features: features.map(feature => convertSpToTurfFeature(feature.geometry)),\n });\n\n map.current.fitBounds(currentFeatureCenter as [number, number, number, number], { padding: padding ?? 150 });\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\nimport { BulkExtentsDc } from \"@evergis/api\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nconst DEFAULT_PADDING = 50;\n\ninterface ZoomToLayerOptions {\n discardFilters?: boolean;\n padding?: number;\n}\n\nexport const useZoomToLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n async (bulkExtent: BulkExtentsDc, options?: ZoomToLayerOptions) => {\n if (!bulkExtent || !bulkExtent.overall) {\n return;\n }\n\n map.current.fitBounds(\n [...bulkExtent.overall.coordinates[0], ...bulkExtent.overall.coordinates[1]] as [\n number,\n number,\n number,\n number,\n ],\n { padding: options?.padding ?? DEFAULT_PADDING },\n );\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useZoomToPoint = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (options, callback?: VoidFunction) => {\n if (map.current) {\n if (callback) {\n map.current.once(\"moveend\", () => {\n callback();\n });\n }\n\n map.current.flyTo(options);\n } else {\n callback?.();\n }\n },\n [map],\n );\n};\n"],"names":["findAttributeInExpression","expression","Array","isArray","length","reduce","acc","curr","Set","convertSpToTurfFeature","geometry","type","GeometryType","Point","point","coordinates","Multipoint","multiPoint","Polyline","multiLineString","Polygon","Envelope","polygon","useMapContext","useContext","MapContext","useCurrentSelectedFeature","selectFeatures","useMemo","features","_selectFeatures$featu","layerName","find","item","id","currentId","createContext","BaseMapTheme","GeometrySelectionTypes","GeometrySelectionToolTypes","GeometrySelectionZoneTypes","GeometrySelectionRouteTypes","GeometryEditorMode","useGeometryEditor","geometryEditor","setGeometryEditor","useCallback","newState","prevState","useGeometrySelection","geometrySelection","setGeometrySelection","NO_CONTENT_VALUE","DateFormat","stringDateParsers","parseJSON","parseISO","rawDate","Date","getDate","parser","date","isValid","toDate","parsedDate","geometryToWkt","stringify","customModes","MapboxDraw","modes","static","StaticMode","setActionableState","undefined","state","geojson","display","draw","displayControlsDefault","styles","filter","paint","layout","defaultMode","controls","trash","ServerNotificationsContext","VerticalPosition","HorizontalPosition","mode","Line","dateFormat","ClientDefaultFormat","defaultValue","dateValue","format","toString","selectionType","toWgs","toWgs84","lineString","toMercator","number","isNaN","parseFloat","isFinite","value","style","items","_style$items","isEmpty","Object","entries","_Object$entries","paintAcc","active","currentSelectedFeature","Edit","layer","Create","history","step","Zones","zones","_history$zones$histor","_history$zones$histor2","settings","bufferRadius","bufferMultiplier","isBuffer","Number","toFixed","triggerDeps","map","drawContext","loaded","basemapName","useEffect","current","addControl","hasControl","removeControl","layerTileSource","getSource","setTiles","tiles","handleVerticalPosition","handleHorizontalPosition","minWidth","MIN_SAFE_INTEGER","maxWidth","MAX_SAFE_INTEGER","horizontal","minHeight","maxHeight","vertical","useResize","onResize","onResizeEnd","onResizeStart","containerRef","useRef","verticalHandleRef","horizontalHandleRef","updateSizes","width","height","newWidth","newHeight","Math","min","window","innerWidth","_horizontalHandleRef$","clientWidth","innerHeight","_verticalHandleRef$cu","clientHeight","requestAnimationFrame","isNil","onPointerMove","pointerMoveEvent","x","y","_containerRef$current","getBoundingClientRect","reverseHorizontal","Right","reverseVertical","Bottom","pageX","offsetWidth","pageY","offsetHeight","document","body","userSelect","onPointerDown","addEventListener","removeEventListener","once","useLayoutEffect","_selectFeatures$featu2","findIndex","feature","setSelectFeaturesGeometryMasking","update","geometryMasking","setSelectFeaturesInitialized","initialized","setSelectFeaturesLayerName","name","setNextFeature","setPrevFeature","onNext","onPrev","setSelectFeaturesStatisticsActive","statisticsActive","setSelectedFeaturesTotalCounts","totalCounts","setSelectedFeatures","updatSelectedFeatures","url","hubConnection","connection","setConnection","useState","HubConnectionBuilder","withUrl","withCredentials","configureLogging","LogLevel","Information","build","start","then","console","info","catch","err","finally","invoke","initial","setState","toggle","updateCurrentFeature","values","padding","currentFeatureCenter","bbox","fitBounds","async","bulkExtent","options","overall","callback","flyTo"],"mappings":"shBAEaA,EAA6BC,GACpCC,MAAMC,QAAQF,IAAqC,IAAtBA,EAAWG,QAAkC,QAAlBH,EAAW,GAC9D,CAACA,EAAW,IAGdA,EAAWI,OAAO,CAACC,EAAeC,IAClCL,MAAMC,QAAQI,GAIH,QAAZA,EAAK,GACA,IAAI,IAAIC,IAAI,IAAIF,EAAKC,EAAK,MAG5B,IAAI,IAAIC,IAAI,IAAIF,KAAQN,EAA0BO,MAPhDD,EAQR,ICXQG,EAA0BC,OAChCA,SAIGA,EAASC,WACVC,eAAaC,aACTC,QAAMJ,EAASK,kBACnBH,eAAaI,kBACTC,aAAWP,EAASK,kBACxBH,eAAaM,gBACTC,kBAAgBT,EAASK,kBAC7BH,eAAaQ,aACbR,eAAaS,gBACTC,UAAQZ,EAASK,oOChBjBQ,EAAgB,IACpBC,aAAWC,GCCPC,EAA4B,WACjCC,eAAEA,GAAmBJ,WAEpBK,UAAQ,2BACND,EAAeE,oBAAfC,EAA0BH,EAAeI,mBAAzCD,EAAqDE,KAAKC,GAAQA,EAAKC,KAAOP,EAAeQ,YACnG,CAACR,KC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
1
+ {"version":3,"file":"react.cjs.production.min.js","sources":["../src/components/ErrorBoundary/styled.ts","../src/components/ErrorBoundary/index.tsx","../src/components/Layer/constants.ts","../src/components/Layer/RasterLayer.tsx","../src/core/classification/findAttributeInExpression.ts","../src/core/classification/getActualExtrusionHeight.ts","../src/core/feature/convertSpToTurfFeature.ts","../src/components/Layer/VectorLayer.tsx","../src/components/Layer/utils/getClientStyleItemPrefixSuffix.ts","../src/components/Map/styled.ts","../src/hooks/map/useMapDraw/customModes.ts","../src/contexts/MapContext/MapContext.ts","../src/contexts/MapContext/types.ts","../src/contexts/ServerNotificationsContext/ServerNotificationsContext.ts","../src/hooks/map/useMapContext.ts","../src/hooks/map/useMapDraw/index.ts","../src/hooks/map/useMapDraw/customStyles.ts","../src/utils/date.ts","../src/utils/debounce.ts","../src/components/Layer/Layer.tsx","../src/components/Map/Map.tsx","../src/contexts/MapContext/MapProvider.tsx","../src/contexts/ServerNotificationsContext/ServerNotificationsProvider.tsx","../src/contexts/ServerNotificationsContext/hooks/useServerNotifications.ts","../src/utils/isNumeric.ts","../src/utils/isObject.ts","../src/core/classification/parseClientStyle.ts","../src/hooks/useDebouncedCallback.ts","../src/hooks/map/useRedrawLayer.ts","../src/hooks/serverNotifications/useServerNotificationsContext.ts","../src/hooks/useToggle.ts","../src/hooks/useWindowResize.ts","../src/hooks/map/useZoomToFeatures.ts","../src/hooks/map/useZoomToPoint.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const ErrorBoundaryContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n`;\n","import React, { Component } from \"react\";\n\nimport { ErrorBoundaryContainer } from \"./styled\";\n\nimport { ErrorBoundaryProps, ErrorBoundaryState } from \"./types\";\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state = { hasError: false };\n\n public static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n public render() {\n const { children, errorContents } = this.props;\n const { hasError } = this.state;\n\n return !hasError ? (\n <>{children}</>\n ) : (\n <ErrorBoundaryContainer>\n {errorContents}\n </ErrorBoundaryContainer>\n );\n }\n}\n","import { CirclePaint, FillPaint, FillExtrusionPaint, LinePaint } from \"mapbox-gl\";\n\nconst DEFAULT_COLOR = \"#00ffff\";\nconst DEFAULT_OPACITY = 0.5;\nconst DEFAULT_SIZE = 4;\nconst DEFAULT_LINE_WIDTH = 1;\n\nexport const DEFAULT_CIRCLE_PAINT = {\n \"circle-radius\": DEFAULT_SIZE,\n \"circle-color\": DEFAULT_COLOR,\n \"circle-opacity\": DEFAULT_OPACITY,\n \"circle-stroke-width\": 0,\n \"circle-stroke-color\": DEFAULT_COLOR,\n \"circle-stroke-opacity\": DEFAULT_OPACITY,\n} as CirclePaint;\n\nexport const DEFAULT_FILL_PAINT = {\n \"fill-color\": DEFAULT_COLOR,\n \"fill-opacity\": DEFAULT_OPACITY,\n} as FillPaint;\n\nexport const DEFAULT_FILL_EXTRUSION_PAINT = {\n \"fill-extrusion-base\": 0,\n \"fill-extrusion-vertical-gradient\": true,\n \"fill-extrusion-color\": DEFAULT_COLOR,\n \"fill-extrusion-opacity\": DEFAULT_OPACITY,\n \"fill-extrusion-height\": 0,\n} as FillExtrusionPaint;\n\nexport const DEFAULT_LINE_PAINT = {\n \"line-color\": DEFAULT_COLOR,\n \"line-width\": DEFAULT_LINE_WIDTH,\n \"line-opacity\": DEFAULT_OPACITY,\n} as LinePaint;\n","import React, { FC } from \"react\";\nimport { Source, Layer as MapboxLayer } from \"react-map-gl/mapbox\";\n\nimport { LayerProps } from \"./types\";\n\nexport const RasterLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n}) => {\n if (!layer) {\n return null;\n }\n\n return (\n <Source id={layer.name} type=\"raster\" tiles={[tileUrl]}>\n <MapboxLayer\n id={layer.name}\n type=\"raster\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{ visibility: visible ? \"visible\" : \"none\" }}\n />\n </Source>\n );\n};\n","import { ExpressionSpecification } from \"mapbox-gl\";\n\nexport const findAttributeInExpression = (expression: ExpressionSpecification): string[] => {\n if (Array.isArray(expression) && expression.length === 2 && expression[0] === \"get\") {\n return [expression[1]];\n }\n\n return expression.reduce((acc: string[], curr) => {\n if (!Array.isArray(curr)) {\n return acc;\n }\n\n if (curr[0] === \"get\") {\n return [...new Set([...acc, curr[1]])];\n }\n\n return [...new Set([...acc, ...findAttributeInExpression(curr as ExpressionSpecification)])];\n }, []);\n};\n","import { AnyPaint } from \"mapbox-gl\";\n\nexport const getActualExtrusionHeight = (paint: AnyPaint) => {\n return Array.isArray(paint?.[\"fill-extrusion-height\"]) && paint?.[\"fill-extrusion-height\"][0] === \"+\"\n ? paint?.[\"fill-extrusion-height\"][1]\n : paint?.[\"fill-extrusion-height\"];\n};\n","import { FeatureDc, GeometryType, PositionDc } from \"@evergis/api\";\nimport { multiLineString, multiPoint, point, polygon } from \"@turf/turf\";\nimport { Feature } from \"geojson\";\n\nexport const convertSpToTurfFeature = (geometry?: FeatureDc[\"geometry\"]): Feature<any> | undefined => {\n if (!geometry) {\n return;\n }\n\n switch (geometry.type) {\n case GeometryType.Point:\n return point(geometry.coordinates as PositionDc);\n case GeometryType.Multipoint:\n return multiPoint(geometry.coordinates as PositionDc[]);\n case GeometryType.Polyline:\n return multiLineString(geometry.coordinates as PositionDc[][]);\n case GeometryType.Polygon:\n case GeometryType.Envelope:\n return polygon(geometry.coordinates as PositionDc[][]);\n default:\n }\n};\n","import React, { FC, useCallback, useEffect } from \"react\";\nimport { Layer as MapboxLayer, Source } from \"react-map-gl/mapbox\";\nimport { FeatureLayerServiceInfoDc, GeometryType, QueryLayerServiceConfigurationDc } from \"@evergis/api\";\nimport { AnyPaint, CirclePaint, FillExtrusionPaint, FillPaint, LinePaint } from \"mapbox-gl\";\n\nimport {\n DEFAULT_CIRCLE_PAINT,\n DEFAULT_FILL_EXTRUSION_PAINT,\n DEFAULT_FILL_PAINT,\n DEFAULT_LINE_PAINT,\n} from \"./constants\";\n\nimport { getClientStyleItemPrefixSuffix } from \"./utils/getClientStyleItemPrefixSuffix\";\nimport { getActualExtrusionHeight } from \"../../core\";\n\nimport { LayerProps } from \"./types\";\nimport { ClientStyle } from \"../../types\";\n\nexport const VectorLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n getLayerTempStyle,\n onMount = () => null,\n}) => {\n const clientStyle = (layer?.configuration as QueryLayerServiceConfigurationDc)?.clientStyle as ClientStyle;\n const { idAttribute, geometryType } = (layer as FeatureLayerServiceInfoDc).layerDefinition || {};\n\n const renderLayerByGeometryType = useCallback(() => {\n const visibility = visible ? \"visible\" : \"none\";\n\n switch (geometryType) {\n case GeometryType.Point:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"circle\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"circle\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_CIRCLE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"circle\")?.paint as CirclePaint),\n }}\n />\n );\n case GeometryType.Polygon:\n return [\n <MapboxLayer\n key={`polygon-layer-${layer.name}`}\n id={layer.name}\n type=\"fill\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_FILL_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill\")?.paint as FillPaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-stroke-layer-${layer.name}`}\n id={`${layer.name}-stroke`}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-extrusion-layer-${layer.name}`}\n id={`${layer.name}-extrusion`}\n type=\"fill-extrusion\"\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={0}\n maxzoom={23}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }}\n />,\n ];\n case GeometryType.Polyline:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />\n );\n default:\n return null;\n }\n }, [geometryType, layer, beforeId, getLayerTempStyle, visible]);\n\n const renderClientStyle = useCallback(() => {\n return clientStyle.items.map(mockItem => {\n const prefixSuffix = getClientStyleItemPrefixSuffix(geometryType, mockItem.type);\n const isExtrusionItem = mockItem.type === \"fill-extrusion\";\n const isPolygonPart =\n clientStyle.items.some(item => item.type === \"fill-extrusion\") &&\n (mockItem.type === \"fill\" || mockItem.type === \"line\");\n const fillExtrusionPaint =\n isPolygonPart || isExtrusionItem\n ? {\n ...clientStyle.items?.find(item => item.type === \"fill-extrusion\")?.paint,\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint,\n }\n : undefined;\n const currentSettings = {\n ...clientStyle?.settings,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.settings,\n };\n const processedExtrusionHeight = getActualExtrusionHeight(fillExtrusionPaint);\n const hasExtrusion = Boolean(processedExtrusionHeight);\n const visibility =\n visible &&\n ((isExtrusionItem && hasExtrusion) ||\n (!isPolygonPart && !isExtrusionItem) ||\n (isPolygonPart && (!hasExtrusion || (currentSettings?.fill?.showBottomSurface ?? true))))\n ? \"visible\"\n : \"none\";\n\n return (\n <MapboxLayer\n key={`${prefixSuffix[0]}${layer.name}`}\n id={`${layer.name}${prefixSuffix[1]}`}\n type={mockItem.type}\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={clientStyle?.minzoom ?? 0}\n maxzoom={clientStyle?.maxzoom ?? 23}\n layout={{\n ...mockItem.layout,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.layout,\n visibility,\n }}\n paint={\n {\n ...mockItem.paint,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.paint,\n } as AnyPaint\n }\n />\n );\n });\n }, [beforeId, clientStyle, geometryType, layer.name, visible, getLayerTempStyle]);\n\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n return (\n <Source\n promoteId={idAttribute}\n id={layer.name}\n type=\"vector\"\n tiles={[tileUrl]}\n >\n {clientStyle?.items ? renderClientStyle() : renderLayerByGeometryType()}\n </Source>\n );\n};\n","import { GeometryType } from \"@evergis/api\";\n\nimport { ClientStyleItem } from \"../../../types\";\n\nexport const getClientStyleItemPrefixSuffix = (\n geometryType: GeometryType,\n type: ClientStyleItem[\"type\"],\n): [string, string] => {\n switch (geometryType) {\n case GeometryType.Point:\n return [\"point-layer-\", \"\"];\n case GeometryType.Polyline:\n return [\"polyline-layer-\", \"\"];\n case GeometryType.Polygon:\n switch (type) {\n case \"line\":\n return [\"polygon-stroke-layer-\", \"-stroke\"];\n case \"fill-extrusion\":\n return [\"polygon-extrusion-layer-\", \"-extrusion\"];\n default:\n return [\"polygon-layer-\", \"\"];\n }\n default:\n return [\"\", \"\"];\n }\n};\n","import { CSSProperties } from \"react\";\nimport styled from \"styled-components\";\n\nexport const MapWrapper = styled.div<{ $zIndex?: CSSProperties[\"zIndex\"] }>`\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ${({ $zIndex }) => $zIndex ?? 1};\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n`;\n","import MapboxDraw, { DrawCustomMode } from \"@mapbox/mapbox-gl-draw\";\n\ninterface ExtendedMapboxDrawModes extends MapboxDraw.Modes {\n [key: string]: DrawCustomMode;\n static: DrawCustomMode;\n}\n\nexport const customModes = MapboxDraw.modes as ExtendedMapboxDrawModes;\n\nconst StaticMode = {} as DrawCustomMode;\n\nStaticMode.onSetup = function () {\n this.setActionableState(undefined);\n\n return {};\n};\n\nStaticMode.toDisplayFeatures = function (state, geojson, display) {\n display(geojson);\n};\n\ncustomModes.static = StaticMode;\n","import { createContext } from \"react\";\n\nimport { MapContextProps } from \"./types\";\n\nexport const MapContext = createContext<MapContextProps>({});\n","import { Dispatch, MutableRefObject, PropsWithChildren, SetStateAction } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nexport enum BaseMapTheme {\n Light = \"light\",\n Dark = \"dark\",\n}\n\nexport interface BaseMapItem {\n name: string;\n source: string;\n preview?: string;\n imgSrc?: string;\n title: string;\n theme?: BaseMapTheme;\n opacity?: number;\n color?: string;\n}\n\nexport interface MapContextProps {\n map?: MutableRefObject<MapboxGLMap>;\n draw?: MutableRefObject<Omit<MapboxDraw, \"getDefaultPosition\">>;\n loaded?: boolean;\n setLoaded?: Dispatch<SetStateAction<boolean>>;\n basemapItems?: BaseMapItem[];\n basemapName?: string;\n setBasemapName?: Dispatch<SetStateAction<string>>;\n defaultBasemap?: string;\n}\n\nexport interface MapProviderProps extends PropsWithChildren {\n basemapItems: BaseMapItem[];\n defaultBasemap: string;\n}\n","import { createContext } from \"react\";\n\nimport { ServerNotificationsContextProps } from \"./types\";\n\nexport const ServerNotificationsContext = createContext<ServerNotificationsContextProps>({});\n","import { useContext } from \"react\";\n\nimport { MapContext } from \"../../contexts\";\n\nexport const useMapContext = () => {\n return useContext(MapContext);\n};\n","import { useEffect } from \"react\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { customModes } from \"./customModes\";\nimport { customStyles } from \"./customStyles\";\n\nimport { useMapContext } from \"../useMapContext\";\n\nconst draw = new MapboxDraw({\n displayControlsDefault: false,\n styles: customStyles,\n modes: customModes,\n defaultMode: \"draw_point\",\n controls: {\n trash: true,\n },\n});\n\nexport const useMapDraw = (triggerDeps: Array<unknown> = []) => {\n const { map, draw: drawContext, loaded, basemapName } = useMapContext();\n\n useEffect(() => {\n if (!loaded || !map.current) {\n return;\n }\n\n drawContext.current = draw;\n map.current.addControl(drawContext.current);\n }, [loaded]); // eslint-disable-line\n\n useEffect(() => {\n if (map.current && map.current.hasControl(drawContext.current)) {\n map.current.removeControl(drawContext.current);\n map.current.addControl(drawContext.current);\n }\n }, [basemapName, ...triggerDeps]); // eslint-disable-line\n};\n","export const customStyles = [\n {\n id: \"gl-draw-point\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-inactive-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"false\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-active-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"true\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-fill-static\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-line\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"LineString\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-fill\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-polygon-midpoint\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"midpoint\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-stroke-active\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-and-line-vertex-active\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"meta\", \"vertex\"], [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n];\n","import { parseJSON, parseISO, isValid, format, toDate } from \"date-fns\";\n\nexport const NO_CONTENT_VALUE = \"—\";\n\nexport type DateType = number | Date;\nexport type RawDateType = string | DateType;\n\nexport enum DateFormat {\n ClientDefaultFormat = \"dd.MM.yyyy HH:mm\",\n DateTime = \"dd.MM.yyyy HH:mm:ss\",\n UTC = \"yyyy-MM-dd'T'HH:mm:ss.sssxxx\",\n AxisTooltip = \"d MMMM yyyy\",\n}\n\ninterface FormatDateOptions {\n dateFormat?: DateFormat;\n defaultValue?: RawDateType;\n}\n\nconst stringDateParsers: ((date: string) => DateType)[] = [parseJSON, parseISO, rawDate => new Date(rawDate)];\n\nexport const getDate = (rawDate?: RawDateType | null): Date | null => {\n if (!rawDate) return null;\n\n if (typeof rawDate === \"string\") {\n for (const parser of stringDateParsers) {\n const date = parser(rawDate);\n\n if (isValid(date)) {\n return toDate(date);\n }\n }\n\n return null;\n }\n\n const parsedDate = toDate(rawDate);\n\n return isValid(parsedDate) ? parsedDate : null;\n};\n\nexport const formatDate = (\n date?: RawDateType,\n { dateFormat = DateFormat.ClientDefaultFormat, defaultValue = NO_CONTENT_VALUE }: FormatDateOptions = {},\n): string => {\n const dateValue = date ? getDate(date) : null;\n\n if (isValid(dateValue)) {\n return format(dateValue as Date, dateFormat);\n }\n\n return defaultValue.toString();\n};\n","export const debounce = (callback: any, delay: number): ((...args) => void) => {\n let timeId: number;\n\n return (...args) => {\n if (timeId) {\n window.clearTimeout(timeId);\n }\n\n timeId = window.setTimeout(() => {\n callback(...args);\n }, delay);\n };\n};\n","import React, { FC, useEffect } from \"react\";\n\nimport { RasterLayer } from \"./RasterLayer\";\nimport { VectorLayer } from \"./VectorLayer\";\n\nimport { LayerProps } from \"./types\";\n\nexport const Layer: FC<LayerProps> = ({\n layer,\n layerType,\n visible,\n beforeId,\n tileUrl,\n onMount = () => null,\n}) => {\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n if (layerType === \"RasterTileLayer\") {\n return (\n <RasterLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n }\n\n return (\n <VectorLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n};\n","import React, { FC } from \"react\";\nimport { default as MapGL } from \"react-map-gl/mapbox\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport \"@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css\";\n\nimport { MapWrapper } from \"./styled\";\n\nimport { useMapContext } from \"../../hooks\";\n\nimport { MapProps } from \"./types\";\n\nimport \"mapbox-gl/dist/mapbox-gl.css\";\n\nexport const Map: FC<MapProps> = ({\n zIndex,\n lowerSiblings,\n upperSiblings,\n drawTriggerDeps,\n onError,\n children,\n ...rest\n}) => {\n const { map, setLoaded } = useMapContext();\n\n return (\n <MapWrapper $zIndex={zIndex}>\n {lowerSiblings}\n <MapGL\n {...rest}\n renderWorldCopies\n antialias\n doubleClickZoom={false}\n cursor=\"default\"\n onLoad={e => {\n map.current = e.target as MapboxGLMap;\n\n map.current.on(\"error\", onError);\n\n setLoaded(true);\n }}\n >\n {children}\n </MapGL>\n {upperSiblings}\n </MapWrapper>\n );\n};\n","import React, { FC, useRef, useState } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { MapContext } from \"./MapContext\";\n\nimport { MapProviderProps } from \"./types\";\n\nexport const MapProvider: FC<MapProviderProps> = ({ basemapItems, defaultBasemap, children }) => {\n const map = useRef<MapboxGLMap | undefined>();\n const draw = useRef<MapboxDraw | undefined>();\n const [loaded, setLoaded] = useState<boolean>(false);\n const [basemapName, setBasemapName] = useState(defaultBasemap);\n\n return (\n <MapContext.Provider\n value={{\n map,\n draw,\n loaded,\n setLoaded,\n basemapItems,\n basemapName,\n setBasemapName,\n defaultBasemap,\n }}\n >\n {children}\n </MapContext.Provider>\n );\n};\n","import React, { FC, useCallback } from \"react\";\n\nimport { ServerNotificationsContext } from \"./ServerNotificationsContext\";\n\nimport { useServerNotifications } from \"./hooks/useServerNotifications\";\n\nimport { ServerNotificationsProviderProps } from \"./types\";\n\nexport const ServerNotificationsProvider: FC<ServerNotificationsProviderProps> = ({ url, initialized, children }) => {\n const connection = useServerNotifications(url, initialized);\n\n const addSubscription = useCallback(\n async (payload?: any): Promise<string | null> => {\n if (!connection || connection.state !== \"Connected\" || !payload) {\n return;\n }\n\n try {\n const id = await connection.invoke(\"AddSubscription\", payload);\n\n console.info(\"Подписка добавлена, id:\", id);\n\n return id;\n } catch (err) {\n console.info(\"Ошибка добавления подписки:\", err);\n\n return Promise.resolve(null);\n }\n },\n [connection],\n );\n\n const updateSubscription = useCallback(\n async (id: string | null, payload?: any): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id || !payload) {\n return;\n }\n\n try {\n await connection.invoke(\"UpdateSubscription\", id, payload);\n } catch (err) {\n console.info(`Ошибка обновления подписки ${id}:`, err);\n }\n },\n [connection],\n );\n\n const unsubscribeById = useCallback(\n async (id: string | null): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id) {\n return;\n }\n\n try {\n await connection.invoke(\"Unsubscribe\", [id]);\n } catch (err) {\n console.info(`Ошибка отписки по ${id}:`, err);\n }\n },\n [connection],\n );\n\n return (\n <ServerNotificationsContext.Provider value={{ connection, addSubscription, updateSubscription, unsubscribeById }}>\n {children}\n </ServerNotificationsContext.Provider>\n );\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport { HubConnection, HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\n\nexport const useServerNotifications = (url: string, initialized: boolean): HubConnection | null => {\n const hubConnection = useRef<HubConnection | null>(null);\n const [connection, setConnection] = useState<HubConnection | null>(null);\n\n useEffect(() => {\n if (!initialized) {\n return;\n }\n\n hubConnection.current = new HubConnectionBuilder()\n .withUrl(url, {\n withCredentials: true,\n })\n .configureLogging(LogLevel.Information)\n .build();\n\n hubConnection.current\n .start()\n .then(() => console.info(\"Серверные нотификации подключены\"))\n .catch(err => console.info(\"Ошибка:\", err))\n .finally(() => setConnection(hubConnection.current));\n }, [initialized]); // eslint-disable-line\n\n useEffect(() => {\n if (!connection || connection.state !== \"Connected\") {\n return;\n }\n\n connection\n .invoke(\"SubscribeNotifications\", [])\n .then(() => console.info(\"Подписка `SubscribeNotifications` оформлена\"))\n .catch(err => console.info(\"Ошибка подписки `SubscribeNotifications`:\", err));\n }, [connection]);\n\n return connection;\n};\n","export const isNumeric = (number: string | number): boolean =>\n !isNaN(parseFloat(number as string)) && isFinite(number as number);\n","export function isObject<T>(value: T | object): value is object {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { isEmpty } from \"lodash\";\nimport { ExpressionSpecification } from \"mapbox-gl\";\n\nimport { findAttributeInExpression } from \"./findAttributeInExpression\";\n\nimport { ClientStyle } from \"../../types\";\n\nexport const parseClientStyle = (style?: ClientStyle): string[] => {\n if (!style) {\n return [];\n }\n\n return style?.items?.reduce((acc: string[], curr) => {\n if (!curr.paint || isEmpty(curr.paint)) {\n return acc;\n }\n\n return Object.entries(curr.paint)?.reduce((paintAcc: string[], [, value]) => {\n if (!Array.isArray(value)) {\n return paintAcc;\n }\n\n return [...new Set([...paintAcc, ...findAttributeInExpression(value as ExpressionSpecification)])];\n }, []);\n }, []);\n};\n","import { useMemo } from \"react\";\n\nimport { debounce } from \"../utils\";\n\nexport const useDebouncedCallback = <CallbackFn extends () => void>(interval: number): ((cb: CallbackFn) => void) => {\n return useMemo(\n () =>\n debounce((cb: CallbackFn) => {\n cb();\n }, interval),\n [interval],\n );\n};\n","import { useCallback } from \"react\";\nimport { VectorSourceImpl } from \"mapbox-gl\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useRedrawLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (layerName: string) => {\n const layerTileSource: VectorSourceImpl = map.current.getSource(layerName);\n\n layerTileSource.setTiles(layerTileSource.tiles);\n },\n [map],\n );\n};\n","import { useContext } from \"react\";\n\nimport { ServerNotificationsContext } from \"../../contexts\";\n\nexport const useServerNotificationsContext = () => {\n return useContext(ServerNotificationsContext);\n};\n","import { useCallback, useState } from \"react\";\n\nexport const useToggle = (initial?: boolean): [boolean, VoidFunction, (value: boolean) => void] => {\n const [state, setState] = useState(initial !== undefined ? initial : false);\n\n const toggle = useCallback(() => setState(!state), [state]);\n\n return [state, toggle, setState];\n};\n","import { useEffect, useMemo } from \"react\";\n\nimport { debounce } from \"../utils\";\n\nconst DEBOUNCE_DELAY = 144;\n\nexport const useWindowResize = (callback?: (...args: any) => any, delay?: number) => {\n const debounceCallback = useMemo(() => {\n return callback ? debounce(callback, delay || DEBOUNCE_DELAY) : undefined;\n }, [callback, delay]);\n\n useEffect(() => {\n debounceCallback && window.addEventListener(\"resize\", debounceCallback);\n\n return () => debounceCallback && window.removeEventListener(\"resize\", debounceCallback);\n }, [debounceCallback]);\n};\n","import { useCallback } from \"react\";\nimport { bbox } from \"@turf/turf\";\nimport { FeatureDc } from \"@evergis/api\";\n\nimport { useMapContext } from \"./useMapContext\";\nimport { convertSpToTurfFeature } from \"../../core\";\n\nexport const useZoomToFeatures = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (features?: FeatureDc[], padding?: number) => {\n if (!features) {\n return;\n }\n\n const currentFeatureCenter = bbox({\n type: \"FeatureCollection\",\n features: features.map(feature => convertSpToTurfFeature(feature.geometry)),\n });\n\n map.current.fitBounds(currentFeatureCenter as [number, number, number, number], { padding: padding ?? 150 });\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useZoomToPoint = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (options, callback?: VoidFunction) => {\n if (map.current) {\n if (callback) {\n map.current.once(\"moveend\", () => {\n callback();\n });\n }\n\n map.current.flyTo(options);\n } else {\n callback?.();\n }\n },\n [map],\n );\n};\n"],"names":["ErrorBoundaryContainer","styled","div","ErrorBoundary","hasError","Component","error","console","children","errorContents","this","props","state","React","DEFAULT_CIRCLE_PAINT","DEFAULT_FILL_PAINT","DEFAULT_FILL_EXTRUSION_PAINT","DEFAULT_LINE_PAINT","RasterLayer","layer","tileUrl","visible","beforeId","Source","id","name","type","tiles","MapboxLayer","layout","visibility","findAttributeInExpression","expression","Array","isArray","length","reduce","acc","curr","Set","getActualExtrusionHeight","paint","convertSpToTurfFeature","geometry","GeometryType","Point","point","coordinates","Multipoint","multiPoint","Polyline","multiLineString","Polygon","Envelope","polygon","VectorLayer","getLayerTempStyle","onMount","clientStyle","configuration","_layer$configuration","idAttribute","geometryType","layerDefinition","renderLayerByGeometryType","useCallback","_getLayerTempStyle","_getLayerTempStyle2","key","_getLayerTempStyle3","settings","fill","showBottomSurface","Boolean","_getLayerTempStyle5","_getLayerTempStyle6","_getLayerTempStyle7","_getLayerTempStyle9","_getLayerTempStyle10","minzoom","maxzoom","_getLayerTempStyle11","_getLayerTempStyle12","_getLayerTempStyle13","_getLayerTempStyle14","renderClientStyle","items","map","mockItem","prefixSuffix","getClientStyleItemPrefixSuffix","isExtrusionItem","isPolygonPart","some","item","fillExtrusionPaint","_clientStyle$items","find","_getLayerTempStyle15","undefined","currentSettings","_getLayerTempStyle16","processedExtrusionHeight","hasExtrusion","_currentSettings$fill2","_getLayerTempStyle17","_getLayerTempStyle18","useEffect","promoteId","MapWrapper","$zIndex","customModes","MapboxDraw","modes","static","StaticMode","setActionableState","geojson","display","MapContext","createContext","BaseMapTheme","ServerNotificationsContext","useMapContext","useContext","draw","displayControlsDefault","styles","filter","defaultMode","controls","trash","NO_CONTENT_VALUE","DateFormat","stringDateParsers","parseJSON","parseISO","rawDate","Date","getDate","parser","date","isValid","toDate","parsedDate","debounce","callback","delay","timeId","args","window","clearTimeout","setTimeout","layerType","zIndex","lowerSiblings","upperSiblings","onError","rest","setLoaded","MapGL","renderWorldCopies","antialias","doubleClickZoom","cursor","onLoad","e","current","target","on","basemapItems","defaultBasemap","useRef","loaded","useState","basemapName","setBasemapName","Provider","value","url","initialized","connection","hubConnection","setConnection","HubConnectionBuilder","withUrl","withCredentials","configureLogging","LogLevel","Information","build","start","then","info","catch","err","finally","invoke","useServerNotifications","addSubscription","async","payload","Promise","resolve","updateSubscription","unsubscribeById","dateFormat","ClientDefaultFormat","defaultValue","dateValue","format","toString","number","isNaN","parseFloat","isFinite","style","_style$items","isEmpty","Object","entries","_Object$entries","paintAcc","interval","useMemo","cb","triggerDeps","drawContext","addControl","hasControl","removeControl","layerName","layerTileSource","getSource","setTiles","initial","setState","toggle","debounceCallback","addEventListener","removeEventListener","features","padding","currentFeatureCenter","bbox","feature","fitBounds","options","once","flyTo"],"mappings":"guCAEO,MAAMA,EAAyBC,EAAOC,koBCIhCC,gFACI,CAAEC,UAAU,iPADMC,0DAG1B,iBACE,CAAED,UAAU,yCAGd,SAAkBE,GAEvBC,QAAQD,MAAMA,yBAGT,iBACCE,SAAEA,EAAFC,cAAYA,GAAkBC,KAAKC,OACnCP,SAAEA,GAAaM,KAAKE,aAElBR,EAGNS,gBAACb,OACES,GAHHI,gCAAGL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