From 7ccf4fb931a1d6321cf6baf31eaffeba42eae733 Mon Sep 17 00:00:00 2001
From: Caden Buckhalt
Date: Thu, 19 Dec 2024 11:45:18 -0600
Subject: [PATCH 01/32] initial setup of geospatial interface config
---
.../NewStageScreen/interfaceOptions.js | 8 +++
src/components/StageEditor/Interfaces.js | 12 ++++
.../GeospatialPrompts/GeospatialPrompts.js | 30 ++++++++
.../GeospatialPrompts/PromptFields.js | 33 +++++++++
.../GeospatialPrompts/PromptPreview.js | 13 ++++
src/components/sections/MapOptions.js | 71 +++++++++++++++++++
src/components/sections/index.js | 2 +
7 files changed, 169 insertions(+)
create mode 100644 src/components/sections/GeospatialPrompts/GeospatialPrompts.js
create mode 100644 src/components/sections/GeospatialPrompts/PromptFields.js
create mode 100644 src/components/sections/GeospatialPrompts/PromptPreview.js
create mode 100644 src/components/sections/MapOptions.js
diff --git a/src/components/Screens/NewStageScreen/interfaceOptions.js b/src/components/Screens/NewStageScreen/interfaceOptions.js
index 105c3855f..b9928625e 100644
--- a/src/components/Screens/NewStageScreen/interfaceOptions.js
+++ b/src/components/Screens/NewStageScreen/interfaceOptions.js
@@ -110,6 +110,14 @@ export const INTERFACE_TYPES = [
title: 'Per Alter Form',
description: 'An interface that allows the participant to fill out a form for each alter in the interview network.',
},
+ {
+ category: CATEGORIES.INTERPRETERS,
+ tags: [TAGS.NODE_ATTRIBUTES],
+ keywords: 'alter attributes node interpreter map',
+ type: 'Geospatial',
+ title: 'Geospatial Interface',
+ description: 'An interface that captures geospatial data by allowing the user to select items on a map',
+ },
{
category: CATEGORIES.INTERPRETERS,
tags: [TAGS.EDGE_ATTRIBUTES],
diff --git a/src/components/StageEditor/Interfaces.js b/src/components/StageEditor/Interfaces.js
index f18af433f..7380828cf 100644
--- a/src/components/StageEditor/Interfaces.js
+++ b/src/components/StageEditor/Interfaces.js
@@ -27,6 +27,8 @@ import {
SkipLogic,
TieStrengthCensusPrompts,
Title,
+ MapOptions,
+ GeospatialPrompts,
} from '@components/sections';
import { FilteredNodeType } from '@components/sections/NodeType';
@@ -189,6 +191,15 @@ const TieStrengthCensus = {
documentation: 'https://documentation.networkcanvas.com/interface-documentation/tie-strength-census/',
};
+const Geospatial = {
+ sections: [
+ NodeType,
+ MapOptions,
+ GeospatialPrompts,
+ ],
+ documentation: 'https://documentation.networkcanvas.com/interface-documentation/tie-strength-census/', // TODO
+};
+
const interfaces = {
AlterEdgeForm,
AlterForm,
@@ -203,6 +214,7 @@ const interfaces = {
OrdinalBin,
Sociogram,
TieStrengthCensus,
+ Geospatial,
};
const emptyInterface = {
diff --git a/src/components/sections/GeospatialPrompts/GeospatialPrompts.js b/src/components/sections/GeospatialPrompts/GeospatialPrompts.js
new file mode 100644
index 000000000..9ffcfbaa6
--- /dev/null
+++ b/src/components/sections/GeospatialPrompts/GeospatialPrompts.js
@@ -0,0 +1,30 @@
+/* eslint-disable react/jsx-props-no-spreading */
+import React from 'react';
+import { compose } from 'recompose';
+import EditableList from '../../EditableList';
+import withSubject from '../../enhancers/withSubject';
+import withDisabledSubjectRequired from '../../enhancers/withDisabledSubjectRequired';
+import PromptPreview from './PromptPreview';
+import PromptFields from './PromptFields';
+
+// TODO no prop spreading
+const GeospatialPrompts = (props) => (
+
+ Add one or more prompts below to frame the task for the user.
+ You can reorder the prompts using the draggable handles on the left hand side.
+
+ )}
+ title="Edit Prompt"
+ previewComponent={PromptPreview}
+ editComponent={PromptFields}
+ {...props}
+ />
+);
+
+export default compose(
+ withSubject,
+ withDisabledSubjectRequired,
+)(GeospatialPrompts);
diff --git a/src/components/sections/GeospatialPrompts/PromptFields.js b/src/components/sections/GeospatialPrompts/PromptFields.js
new file mode 100644
index 000000000..24cc8e582
--- /dev/null
+++ b/src/components/sections/GeospatialPrompts/PromptFields.js
@@ -0,0 +1,33 @@
+import PromptText from '@components/sections/PromptText';
+import React from 'react';
+
+import { getFieldId } from '@app/utils/issues';
+import { ValidatedField } from '@components/Form';
+import { Section, Row } from '@components/EditorLayout';
+import VariablePicker from '../../Form/Fields/VariablePicker/VariablePicker';
+
+const PromptFields = ({ variable, entity, type }) => (
+ <>
+
+
+
+
+ Configure Map Layers
+
+
+ >
+);
+
+export default PromptFields;
diff --git a/src/components/sections/GeospatialPrompts/PromptPreview.js b/src/components/sections/GeospatialPrompts/PromptPreview.js
new file mode 100644
index 000000000..2f89214af
--- /dev/null
+++ b/src/components/sections/GeospatialPrompts/PromptPreview.js
@@ -0,0 +1,13 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { Markdown } from '@codaco/ui/lib/components/Fields';
+
+const PromptPreview = ({ text }) => (
+
+);
+
+PromptPreview.propTypes = {
+ text: PropTypes.string.isRequired,
+};
+
+export default PromptPreview;
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
new file mode 100644
index 000000000..35c7d5a35
--- /dev/null
+++ b/src/components/sections/MapOptions.js
@@ -0,0 +1,71 @@
+import React from 'react';
+import * as Fields from '@codaco/ui/lib/components/Fields';
+import { Section } from '../EditorLayout';
+import ValidatedField from '../Form/ValidatedField';
+import { getFieldId } from '../../utils/issues';
+
+// config map options
+
+/*
+ mapOptions: {
+ center: [-87.6298, 41.8781], -> string (should this be selectable on a map??)
+ token: 'asset3', -> needs to be uploaded
+ initialZoom: 12, -> int
+ },
+*/
+
+const MapOptions = () => (
+ <>
+
+ This interface requires an API key from Mapbox.
+ To get one, visit https://mapbox.com or read our documentation on the interface.
+
+ )}
+ >
+
+
+
+
+ Enter the center coordinates and initial zoom. Mapbox GL uses longitude,
+ latitude coordinate order
+
+ )}
+ >
+
+
+
+
+
+ parseInt(value, 10) || value}
+ validation={{ required: true, positiveNumber: true }}
+ />
+
+
+ >
+
+);
+
+export default MapOptions;
diff --git a/src/components/sections/index.js b/src/components/sections/index.js
index eaf808e92..32d71cec6 100644
--- a/src/components/sections/index.js
+++ b/src/components/sections/index.js
@@ -25,3 +25,5 @@ export { default as SortOptionsForExternalData } from './SortOptionsForExternalD
export { default as SkipLogic } from './SkipLogic';
export { default as Title } from './Title';
export { default as InterviewScript } from './InterviewScript';
+export { default as MapOptions } from './MapOptions';
+export { default as GeospatialPrompts } from './GeospatialPrompts/GeospatialPrompts';
From 6ef86c381bc4b38982c4e5b9f126665b2fe37625 Mon Sep 17 00:00:00 2001
From: Caden Buckhalt
Date: Thu, 19 Dec 2024 15:09:28 -0600
Subject: [PATCH 02/32] prompt fields section
---
.../GeospatialPrompts/PromptFields.js | 70 +++++++++++++------
1 file changed, 47 insertions(+), 23 deletions(-)
diff --git a/src/components/sections/GeospatialPrompts/PromptFields.js b/src/components/sections/GeospatialPrompts/PromptFields.js
index 24cc8e582..11b76f802 100644
--- a/src/components/sections/GeospatialPrompts/PromptFields.js
+++ b/src/components/sections/GeospatialPrompts/PromptFields.js
@@ -4,30 +4,54 @@ import React from 'react';
import { getFieldId } from '@app/utils/issues';
import { ValidatedField } from '@components/Form';
import { Section, Row } from '@components/EditorLayout';
+import NewVariableWindow, { useNewVariableWindowState } from '@components/NewVariableWindow';
import VariablePicker from '../../Form/Fields/VariablePicker/VariablePicker';
-const PromptFields = ({ variable, entity, type }) => (
- <>
-
-
-
-
- Configure Map Layers
-
-
- >
-);
+const PromptFields = ({
+ variable, entity, type, changeForm, form,
+}) => {
+ const newVariableWindowInitialProps = {
+ entity,
+ type,
+ initialValues: { name: null, type: 'text' },
+ };
+
+ const handleCreatedNewVariable = (id, { field }) => changeForm(form, field, id);
+
+ const [newVariableWindowProps, openNewVariableWindow] = useNewVariableWindowState(
+ newVariableWindowInitialProps,
+ handleCreatedNewVariable,
+ );
+ const handleNewVariable = (name) => {
+ openNewVariableWindow({ initialValues: { name, type: 'text' } }, { field: 'edgeVariable' });
+ };
+ return (
+ <>
+
+
+
+
+ Configure Map Layers
+
+
+
+ >
+ );
+};
export default PromptFields;
From 2179524c5107334b8e33e166cd927f4ff13c313b Mon Sep 17 00:00:00 2001
From: Caden Buckhalt
Date: Fri, 20 Dec 2024 14:50:23 -0600
Subject: [PATCH 03/32] basic section layout
---
.../GeospatialPrompts/GeospatialPrompts.js | 4 +-
.../GeospatialPrompts/PromptFields.js | 16 +-
src/components/sections/MapOptions.js | 143 ++++++++++++------
3 files changed, 105 insertions(+), 58 deletions(-)
diff --git a/src/components/sections/GeospatialPrompts/GeospatialPrompts.js b/src/components/sections/GeospatialPrompts/GeospatialPrompts.js
index 9ffcfbaa6..9977167ec 100644
--- a/src/components/sections/GeospatialPrompts/GeospatialPrompts.js
+++ b/src/components/sections/GeospatialPrompts/GeospatialPrompts.js
@@ -13,8 +13,8 @@ const GeospatialPrompts = (props) => (
sectionTitle="Prompts"
sectionSummary={(
- Add one or more prompts below to frame the task for the user.
- You can reorder the prompts using the draggable handles on the left hand side.
+ Add one or more prompts below to frame the task for the user. You can
+ reorder the prompts using the draggable handles on the left hand side.
)}
title="Edit Prompt"
diff --git a/src/components/sections/GeospatialPrompts/PromptFields.js b/src/components/sections/GeospatialPrompts/PromptFields.js
index 11b76f802..e9182e99b 100644
--- a/src/components/sections/GeospatialPrompts/PromptFields.js
+++ b/src/components/sections/GeospatialPrompts/PromptFields.js
@@ -4,7 +4,9 @@ import React from 'react';
import { getFieldId } from '@app/utils/issues';
import { ValidatedField } from '@components/Form';
import { Section, Row } from '@components/EditorLayout';
-import NewVariableWindow, { useNewVariableWindowState } from '@components/NewVariableWindow';
+import NewVariableWindow, {
+ useNewVariableWindowState,
+} from '@components/NewVariableWindow';
import VariablePicker from '../../Form/Fields/VariablePicker/VariablePicker';
const PromptFields = ({
@@ -23,7 +25,10 @@ const PromptFields = ({
handleCreatedNewVariable,
);
const handleNewVariable = (name) => {
- openNewVariableWindow({ initialValues: { name, type: 'text' } }, { field: 'edgeVariable' });
+ openNewVariableWindow(
+ { initialValues: { name, type: 'text' } },
+ { field: 'edgeVariable' },
+ );
};
return (
<>
@@ -41,13 +46,8 @@ const PromptFields = ({
/>
-
-
- Configure Map Layers
-
-
>
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 35c7d5a35..c97295e95 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -1,9 +1,13 @@
import React from 'react';
import * as Fields from '@codaco/ui/lib/components/Fields';
-import { Section } from '../EditorLayout';
+import { Section, Row } from '../EditorLayout';
import ValidatedField from '../Form/ValidatedField';
import { getFieldId } from '../../utils/issues';
+import ColorPicker from '../Form/Fields/ColorPicker';
+import getPalette from '../TypeEditor/getPalette';
+import DataSource from '../Form/Fields/DataSource';
+
// config map options
/*
@@ -14,58 +18,101 @@ import { getFieldId } from '../../utils/issues';
},
*/
-const MapOptions = () => (
- <>
-
- This interface requires an API key from Mapbox.
- To get one, visit https://mapbox.com or read our documentation on the interface.
-
+const MapOptions = ({ entity }) => {
+ const { name: paletteName, size: paletteSize } = getPalette(entity);
+
+ return (
+ <>
+
+ This interface requires an API key from Mapbox.
+ To get one, visit https://mapbox.com or read our documentation on the interface.
+
)}
- >
-
-
-
-
- Enter the center coordinates and initial zoom. Mapbox GL uses longitude,
- latitude coordinate order
-
+ >
+
+
+
+
+ This stage needs a geojson source for map layers. Select a geojson
+ file to use.
+
+ )}
+ >
+
+
+
+
+
+ This will be a checkbox group from the uploaded geojson file
+
+
+
+ Choose a color for the shape outlines and fill.
+
+ )}
+ >
+
+
+
+ Enter the center coordinates and initial zoom. Mapbox GL uses longitude,
+ latitude coordinate order
+
)}
- >
+ >
-
-
+
+
-
- parseInt(value, 10) || value}
- validation={{ required: true, positiveNumber: true }}
- />
+
+ parseInt(value, 10) || value}
+ validation={{ required: true, positiveNumber: true }}
+ />
-
- >
+
+ >
-);
+ );
+};
export default MapOptions;
From 61c0fa1425edea5c64b3102f95272290034b3436 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Tue, 7 Jan 2025 10:43:38 -0800
Subject: [PATCH 04/32] wip add geojson files
---
src/components/AssetBrowser/Asset.js | 1 +
src/components/AssetBrowser/Assets.js | 1 +
src/components/Form/Fields/GeoDataSource.js | 35 +++++++++++++++++++++
src/components/StageEditor/Interfaces.js | 2 +-
src/components/sections/MapOptions.js | 14 ++++-----
src/config/index.js | 1 +
src/utils/protocols/importAsset.js | 2 +-
7 files changed, 47 insertions(+), 9 deletions(-)
create mode 100644 src/components/Form/Fields/GeoDataSource.js
diff --git a/src/components/AssetBrowser/Asset.js b/src/components/AssetBrowser/Asset.js
index e9358e7a7..5ef996fbd 100644
--- a/src/components/AssetBrowser/Asset.js
+++ b/src/components/AssetBrowser/Asset.js
@@ -15,6 +15,7 @@ const ASSET_COMPONENTS = {
video: Thumbnails.Video,
audio: Thumbnails.Audio,
network: Thumbnails.Network,
+ geospatial: Thumbnails.Network, // TODO: Add geospatial thumbnail
};
const Asset = ({
diff --git a/src/components/AssetBrowser/Assets.js b/src/components/AssetBrowser/Assets.js
index 44bf5bee9..70ee6812b 100644
--- a/src/components/AssetBrowser/Assets.js
+++ b/src/components/AssetBrowser/Assets.js
@@ -11,6 +11,7 @@ const ASSET_TYPES = [
{ label: 'Video', value: 'video' },
{ label: 'Audio', value: 'audio' },
{ label: 'Network', value: 'network' },
+ { label: 'GeoJSON', value: 'geospatial' },
];
const Assets = ({
diff --git a/src/components/Form/Fields/GeoDataSource.js b/src/components/Form/Fields/GeoDataSource.js
new file mode 100644
index 000000000..a284b77dd
--- /dev/null
+++ b/src/components/Form/Fields/GeoDataSource.js
@@ -0,0 +1,35 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { withState } from 'recompose';
+import { fieldPropTypes } from 'redux-form';
+import NetworkThumbnail from '@components/Thumbnail/Network'; // TODO: replace
+import File from './File';
+
+const withSelectGeoAsset = withState('selectGeoAsset', 'setSelectGeoAsset', false);
+
+const GeoDataSource = (props) => {
+ const {
+ input,
+ } = props;
+ return (
+
+ { (id) => }
+
+ )
+};
+
+GeoDataSource.propTypes = {
+ ...fieldPropTypes,
+ canUseExisting: PropTypes.bool,
+};
+
+GeoDataSource.defaultProps = {
+ canUseExisting: false,
+};
+
+export default withSelectGeoAsset(GeoDataSource);
\ No newline at end of file
diff --git a/src/components/StageEditor/Interfaces.js b/src/components/StageEditor/Interfaces.js
index 7380828cf..5f3faed7b 100644
--- a/src/components/StageEditor/Interfaces.js
+++ b/src/components/StageEditor/Interfaces.js
@@ -195,7 +195,7 @@ const Geospatial = {
sections: [
NodeType,
MapOptions,
- GeospatialPrompts,
+ // GeospatialPrompts,
],
documentation: 'https://documentation.networkcanvas.com/interface-documentation/tie-strength-census/', // TODO
};
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index c97295e95..a702021c8 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -6,7 +6,7 @@ import { getFieldId } from '../../utils/issues';
import ColorPicker from '../Form/Fields/ColorPicker';
import getPalette from '../TypeEditor/getPalette';
-import DataSource from '../Form/Fields/DataSource';
+import GeoDataSource from '../Form/Fields/GeoDataSource';
// config map options
@@ -51,12 +51,12 @@ const MapOptions = ({ entity }) => {
)}
>
-
+
@@ -77,7 +77,7 @@ const MapOptions = ({ entity }) => {
name="color"
palette={paletteName}
paletteRange={paletteSize}
- validation={{ required: true }}
+ validation={{ required: false }}
/>
{
name="mapOptions.center"
component={Fields.Text}
label="Initial Center"
- validation={{ required: true }}
+ validation={{ required: false }}
placeholder="[Longitude, Latitude]"
/>
@@ -106,7 +106,7 @@ const MapOptions = ({ entity }) => {
label="Initial Map Zoom"
type="number"
normalize={(value) => parseInt(value, 10) || value}
- validation={{ required: true, positiveNumber: true }}
+ validation={{ required: false, positiveNumber: true }}
/>
diff --git a/src/config/index.js b/src/config/index.js
index 91b9d5249..578a774e2 100644
--- a/src/config/index.js
+++ b/src/config/index.js
@@ -30,4 +30,5 @@ export const SUPPORTED_EXTENSION_TYPE_MAP = {
image: ['.jpg', '.jpeg', '.gif', '.png'],
audio: ['.mp3', '.aiff', '.m4a'],
video: ['.mov', '.mp4'],
+ geospatial: ['.geojson'],
};
diff --git a/src/utils/protocols/importAsset.js b/src/utils/protocols/importAsset.js
index c579d982b..eef7d43bd 100644
--- a/src/utils/protocols/importAsset.js
+++ b/src/utils/protocols/importAsset.js
@@ -11,7 +11,7 @@ import { SUPPORTED_EXTENSION_TYPE_MAP } from '@app/config';
* Uses the mime type where possible, and falls back to the file extension.
*
* @param {string} asset - the filename of the asset
- * @return {string} Returns one of network, image, audio, video or returns false if type
+ * @return {string} Returns one of network, image, audio, video, geojson, or returns false if type
* is unsupported
*/
export const getSupportedAssetType = (filePath) => {
From c8362874cc12b4566b5c5cef38f6228a1d35cc22 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Tue, 7 Jan 2025 14:27:48 -0800
Subject: [PATCH 05/32] implement propToSelect using asset selectors to parse
geojson
---
src/components/Form/Fields/GeoDataSource.js | 18 ++++----
src/components/sections/MapOptions.js | 46 +++++++++++++++------
src/hooks/useVariablesFromExternalData.js | 13 +++---
src/selectors/assets.js | 15 ++++++-
src/utils/protocols/assetTools.js | 6 +++
5 files changed, 70 insertions(+), 28 deletions(-)
diff --git a/src/components/Form/Fields/GeoDataSource.js b/src/components/Form/Fields/GeoDataSource.js
index a284b77dd..68186320a 100644
--- a/src/components/Form/Fields/GeoDataSource.js
+++ b/src/components/Form/Fields/GeoDataSource.js
@@ -12,15 +12,15 @@ const GeoDataSource = (props) => {
input,
} = props;
return (
-
- { (id) => }
-
- )
+ {...props}
+ >
+ { (id) => }
+
+ );
};
GeoDataSource.propTypes = {
@@ -32,4 +32,4 @@ GeoDataSource.defaultProps = {
canUseExisting: false,
};
-export default withSelectGeoAsset(GeoDataSource);
\ No newline at end of file
+export default withSelectGeoAsset(GeoDataSource);
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index a702021c8..311f6efe1 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -1,5 +1,8 @@
import React from 'react';
+import { compose } from 'recompose';
+
import * as Fields from '@codaco/ui/lib/components/Fields';
+import withMapFormToProps from '@components/enhancers/withMapFormToProps';
import { Section, Row } from '../EditorLayout';
import ValidatedField from '../Form/ValidatedField';
import { getFieldId } from '../../utils/issues';
@@ -7,19 +10,26 @@ import { getFieldId } from '../../utils/issues';
import ColorPicker from '../Form/Fields/ColorPicker';
import getPalette from '../TypeEditor/getPalette';
import GeoDataSource from '../Form/Fields/GeoDataSource';
+import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
// config map options
/*
mapOptions: {
- center: [-87.6298, 41.8781], -> string (should this be selectable on a map??)
- token: 'asset3', -> needs to be uploaded
- initialZoom: 12, -> int
+ center: z.tuple([z.number(), z.number()]),
+ token: z.string(),
+ initialZoom: z.number().int(),
+ data: z.string(),
+ color: z.string(),
+ propToSelect: z.string(),
},
*/
-const MapOptions = ({ entity }) => {
- const { name: paletteName, size: paletteSize } = getPalette(entity);
+const MapOptions = (props) => {
+ const { mapOptions } = props;
+ // const { name: paletteName, size: paletteSize } = getPalette(mapOptions.entity);
+
+ const { variables: variableOptions } = useVariablesFromExternalData(mapOptions?.dataSource, true, 'geojson');
return (
<>
@@ -54,14 +64,22 @@ const MapOptions = ({ entity }) => {
-
- This will be a checkbox group from the uploaded geojson file
-
+ {variableOptions && variableOptions.length > 0 && (
+
+
+
+ )}
@@ -115,4 +133,6 @@ const MapOptions = ({ entity }) => {
);
};
-export default MapOptions;
+export default compose(
+ withMapFormToProps(['mapOptions']),
+)(MapOptions);
diff --git a/src/hooks/useVariablesFromExternalData.js b/src/hooks/useVariablesFromExternalData.js
index b148f3ace..8f4fba915 100644
--- a/src/hooks/useVariablesFromExternalData.js
+++ b/src/hooks/useVariablesFromExternalData.js
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useSelector } from 'react-redux';
-import { makeGetNetworkAssetVariables } from '@selectors/assets';
+import { makeGetNetworkAssetVariables, makeGetGeoJsonAssetVariables } from '@selectors/assets';
const initialState = {
isVariablesLoading: false,
@@ -8,17 +8,20 @@ const initialState = {
variablesError: null,
};
-const useVariablesFromExternalData = (dataSource, asOptions = false) => {
+const useVariablesFromExternalData = (dataSource, asOptions = false, type = 'network') => {
const [state, setState] = useState(initialState);
const getNetworkAssetVariables = useSelector(makeGetNetworkAssetVariables);
+ const getGeojsonAssetVariables = useSelector(makeGetGeoJsonAssetVariables);
useEffect(() => {
if (!dataSource) { return; }
- setState({ isVariableLoading: true, variables: [], variablesError: null });
+ setState({ isVariablesLoading: true, variables: [], variablesError: null });
- getNetworkAssetVariables(dataSource, asOptions)
+ const getVariables = type === 'geojson' ? getGeojsonAssetVariables : getNetworkAssetVariables;
+
+ getVariables(dataSource, asOptions)
.then((variables) => {
setState((s) => ({ ...s, isVariablesLoading: false, variables }));
})
@@ -29,7 +32,7 @@ const useVariablesFromExternalData = (dataSource, asOptions = false) => {
variablesError: e.toString(),
}));
});
- }, [dataSource]);
+ }, [dataSource, type]);
return state;
};
diff --git a/src/selectors/assets.js b/src/selectors/assets.js
index ad3ca354a..242132e3d 100644
--- a/src/selectors/assets.js
+++ b/src/selectors/assets.js
@@ -1,6 +1,6 @@
import path from 'path';
import { get } from 'lodash';
-import { getNetworkVariables } from '@app/utils/protocols/assetTools';
+import { getNetworkVariables, getGeoJsonVariables } from '@app/utils/protocols/assetTools';
import { getWorkingPath } from './session';
import { getAssetManifest } from './protocol';
@@ -42,3 +42,16 @@ export const makeGetNetworkAssetVariables = (state) => async (dataSource, asOpti
return variables;
};
+
+export const makeGetGeoJsonAssetVariables = (state) => async (dataSource) => {
+ const assetPath = getAssetPath(state, dataSource);
+
+ if (!assetPath) { return null; }
+
+ const variables = await getGeoJsonVariables(assetPath);
+
+ const variableOptions = variables
+ .map((attribute) => ({ label: attribute, value: attribute }));
+
+ return variableOptions;
+};
diff --git a/src/utils/protocols/assetTools.js b/src/utils/protocols/assetTools.js
index 1475a3f67..07b05e73a 100644
--- a/src/utils/protocols/assetTools.js
+++ b/src/utils/protocols/assetTools.js
@@ -101,3 +101,9 @@ export const validateAsset = async (filePath) => {
return true;
};
+
+export const getGeoJsonVariables = async (filePath) => {
+ // process GeoJSON
+ const geoJson = await fs.readJson(filePath);
+ return Object.keys(geoJson.features[0].properties);
+};
From 94fcfaaf585ef52a1fb05ad8e06462bd7d83ebd7 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Wed, 8 Jan 2025 09:32:31 -0800
Subject: [PATCH 06/32] implement color palette
---
src/components/sections/MapOptions.js | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 311f6efe1..6c8d49cf2 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -8,7 +8,6 @@ import ValidatedField from '../Form/ValidatedField';
import { getFieldId } from '../../utils/issues';
import ColorPicker from '../Form/Fields/ColorPicker';
-import getPalette from '../TypeEditor/getPalette';
import GeoDataSource from '../Form/Fields/GeoDataSource';
import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
@@ -27,10 +26,11 @@ import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalDa
const MapOptions = (props) => {
const { mapOptions } = props;
- // const { name: paletteName, size: paletteSize } = getPalette(mapOptions.entity);
const { variables: variableOptions } = useVariablesFromExternalData(mapOptions?.dataSource, true, 'geojson');
+ const { paletteName, paletteSize } = { paletteName: ['ord-color-seq'], paletteSize: 8 }; // TODO: what palette should this be?
+
return (
<>
Choose a color for the shape outlines and fill.
@@ -92,10 +91,10 @@ const MapOptions = (props) => {
>
Date: Wed, 8 Jan 2025 11:34:53 -0800
Subject: [PATCH 07/32] working prompt config
---
src/components/StageEditor/Interfaces.js | 2 +-
.../GeospatialPrompts/PromptFields.js | 20 ++++++++++++++-----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/components/StageEditor/Interfaces.js b/src/components/StageEditor/Interfaces.js
index 5f3faed7b..7380828cf 100644
--- a/src/components/StageEditor/Interfaces.js
+++ b/src/components/StageEditor/Interfaces.js
@@ -195,7 +195,7 @@ const Geospatial = {
sections: [
NodeType,
MapOptions,
- // GeospatialPrompts,
+ GeospatialPrompts,
],
documentation: 'https://documentation.networkcanvas.com/interface-documentation/tie-strength-census/', // TODO
};
diff --git a/src/components/sections/GeospatialPrompts/PromptFields.js b/src/components/sections/GeospatialPrompts/PromptFields.js
index e9182e99b..b82921c0b 100644
--- a/src/components/sections/GeospatialPrompts/PromptFields.js
+++ b/src/components/sections/GeospatialPrompts/PromptFields.js
@@ -1,16 +1,18 @@
import PromptText from '@components/sections/PromptText';
import React from 'react';
+import { compose } from 'recompose';
-import { getFieldId } from '@app/utils/issues';
import { ValidatedField } from '@components/Form';
import { Section, Row } from '@components/EditorLayout';
import NewVariableWindow, {
useNewVariableWindowState,
} from '@components/NewVariableWindow';
+import withVariableHandlers from '@components/sections/CategoricalBinPrompts/withVariableHandlers'; // TODO: should these be moved somewhere more general?
+import withVariableOptions from '@components/sections/CategoricalBinPrompts/withVariableOptions';
import VariablePicker from '../../Form/Fields/VariablePicker/VariablePicker';
const PromptFields = ({
- variable, entity, type, changeForm, form,
+ variable, variableOptions, entity, type, changeForm, form,
}) => {
const newVariableWindowInitialProps = {
entity,
@@ -27,19 +29,24 @@ const PromptFields = ({
const handleNewVariable = (name) => {
openNewVariableWindow(
{ initialValues: { name, type: 'text' } },
- { field: 'edgeVariable' },
+ { field: 'alterVariable' },
);
};
+
+ const geoVariableOptions = variableOptions
+ .filter(({ type: variableType }) => variableType === 'text');
+
return (
<>
-
+
Date: Wed, 8 Jan 2025 13:51:27 -0800
Subject: [PATCH 08/32] upload txt file for mapbox key
---
src/components/AssetBrowser/Asset.js | 1 +
src/components/AssetBrowser/Assets.js | 1 +
.../sections/GeospatialPrompts/PromptFields.js | 2 +-
src/components/sections/MapOptions.js | 14 +++++++-------
src/config/index.js | 1 +
src/utils/protocols/importAsset.js | 4 ++--
6 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/components/AssetBrowser/Asset.js b/src/components/AssetBrowser/Asset.js
index 5ef996fbd..73c80be6a 100644
--- a/src/components/AssetBrowser/Asset.js
+++ b/src/components/AssetBrowser/Asset.js
@@ -16,6 +16,7 @@ const ASSET_COMPONENTS = {
audio: Thumbnails.Audio,
network: Thumbnails.Network,
geospatial: Thumbnails.Network, // TODO: Add geospatial thumbnail
+ environment: Thumbnails.Network, // TODO: Add env thumbnail
};
const Asset = ({
diff --git a/src/components/AssetBrowser/Assets.js b/src/components/AssetBrowser/Assets.js
index 70ee6812b..095cb4eaf 100644
--- a/src/components/AssetBrowser/Assets.js
+++ b/src/components/AssetBrowser/Assets.js
@@ -12,6 +12,7 @@ const ASSET_TYPES = [
{ label: 'Audio', value: 'audio' },
{ label: 'Network', value: 'network' },
{ label: 'GeoJSON', value: 'geospatial' },
+ { label: 'Environment', value: 'env' },
];
const Assets = ({
diff --git a/src/components/sections/GeospatialPrompts/PromptFields.js b/src/components/sections/GeospatialPrompts/PromptFields.js
index b82921c0b..d69be7b76 100644
--- a/src/components/sections/GeospatialPrompts/PromptFields.js
+++ b/src/components/sections/GeospatialPrompts/PromptFields.js
@@ -29,7 +29,7 @@ const PromptFields = ({
const handleNewVariable = (name) => {
openNewVariableWindow(
{ initialValues: { name, type: 'text' } },
- { field: 'alterVariable' },
+ { field: 'variable' },
);
};
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 6c8d49cf2..5842873b7 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -5,10 +5,10 @@ import * as Fields from '@codaco/ui/lib/components/Fields';
import withMapFormToProps from '@components/enhancers/withMapFormToProps';
import { Section, Row } from '../EditorLayout';
import ValidatedField from '../Form/ValidatedField';
-import { getFieldId } from '../../utils/issues';
import ColorPicker from '../Form/Fields/ColorPicker';
import GeoDataSource from '../Form/Fields/GeoDataSource';
+import GeoAPIKey from '../Form/Fields/GeoAPIKey';
import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
// config map options
@@ -42,10 +42,10 @@ const MapOptions = (props) => {
)}
>
-
+
{
)}
>
-
+
{
{variableOptions && variableOptions.length > 0 && (
{
)}
>
-
+
{
placeholder="[Longitude, Latitude]"
/>
-
+
{
const extension = toLower(path.extname(filePath));
From 8a290113776b6b070275a59c5900b18eaf5cc634 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 9 Jan 2025 07:56:22 -0800
Subject: [PATCH 09/32] prop validation, add GeoAPIKey form field
---
src/components/Form/Fields/GeoAPIKey.js | 35 +++++++++++++++++++
.../GeospatialPrompts/PromptFields.js | 18 ++++++++++
src/components/sections/MapOptions.js | 22 ++++++++++++
3 files changed, 75 insertions(+)
create mode 100644 src/components/Form/Fields/GeoAPIKey.js
diff --git a/src/components/Form/Fields/GeoAPIKey.js b/src/components/Form/Fields/GeoAPIKey.js
new file mode 100644
index 000000000..8092ad559
--- /dev/null
+++ b/src/components/Form/Fields/GeoAPIKey.js
@@ -0,0 +1,35 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { withState } from 'recompose';
+import { fieldPropTypes } from 'redux-form';
+import NetworkThumbnail from '@components/Thumbnail/Network'; // TODO: replace
+import File from './File';
+
+const withSelectAPIKey = withState('selectAPIKey', 'setSelectAPIKey', false);
+
+const GeoAPIKey = (props) => {
+ const {
+ input,
+ } = props;
+ return (
+
+ { (id) => }
+
+ );
+};
+
+GeoAPIKey.propTypes = {
+ ...fieldPropTypes,
+ canUseExisting: PropTypes.bool,
+};
+
+GeoAPIKey.defaultProps = {
+ canUseExisting: false,
+};
+
+export default withSelectAPIKey(GeoAPIKey);
diff --git a/src/components/sections/GeospatialPrompts/PromptFields.js b/src/components/sections/GeospatialPrompts/PromptFields.js
index d69be7b76..b6b30f7f0 100644
--- a/src/components/sections/GeospatialPrompts/PromptFields.js
+++ b/src/components/sections/GeospatialPrompts/PromptFields.js
@@ -1,6 +1,7 @@
import PromptText from '@components/sections/PromptText';
import React from 'react';
import { compose } from 'recompose';
+import PropTypes from 'prop-types';
import { ValidatedField } from '@components/Form';
import { Section, Row } from '@components/EditorLayout';
@@ -60,6 +61,23 @@ const PromptFields = ({
>
);
};
+PromptFields.propTypes = {
+ variableOptions: PropTypes.arrayOf(PropTypes.shape({
+ type: PropTypes.string.isRequired,
+ })).isRequired,
+ variable: PropTypes.string,
+ entity: PropTypes.string,
+ type: PropTypes.string,
+ changeForm: PropTypes.func,
+ form: PropTypes.string.isRequired,
+};
+
+PromptFields.defaultProps = {
+ variable: '',
+ entity: '',
+ type: '',
+ changeForm: () => {},
+};
export default compose(
withVariableOptions,
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 5842873b7..6375e4e8d 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -1,4 +1,5 @@
import React from 'react';
+import PropTypes from 'prop-types';
import { compose } from 'recompose';
import * as Fields from '@codaco/ui/lib/components/Fields';
@@ -131,6 +132,27 @@ const MapOptions = (props) => {
);
};
+MapOptions.defaultProps = {
+ mapOptions: {
+ center: [0, 0],
+ token: '',
+ initialZoom: 0,
+ dataSource: '',
+ color: '',
+ propToSelect: '',
+ },
+};
+
+MapOptions.propTypes = {
+ mapOptions: PropTypes.shape({
+ center: PropTypes.arrayOf(PropTypes.number),
+ token: PropTypes.string,
+ initialZoom: PropTypes.number,
+ dataSource: PropTypes.string,
+ color: PropTypes.string,
+ propToSelect: PropTypes.string,
+ }),
+};
export default compose(
withMapFormToProps(['mapOptions']),
From bd4e44cf61b7e0f23224196959a681a53fc8b3c7 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 9 Jan 2025 08:40:01 -0800
Subject: [PATCH 10/32] improve instructions and validations
---
src/components/sections/MapOptions.js | 31 +++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 6375e4e8d..5978efd58 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -4,6 +4,7 @@ import { compose } from 'recompose';
import * as Fields from '@codaco/ui/lib/components/Fields';
import withMapFormToProps from '@components/enhancers/withMapFormToProps';
+import Tip from '@components/Tip';
import { Section, Row } from '../EditorLayout';
import ValidatedField from '../Form/ValidatedField';
@@ -56,7 +57,8 @@ const MapOptions = (props) => {
title="Data source for map layers"
summary={(
- This stage needs a geojson source for map layers. Select a geojson
+ This stage needs a GeoJSON source for map layers.
+ These provide selectable areas for prompts. Select a GeoJSON
file to use.
)}
@@ -86,7 +88,7 @@ const MapOptions = (props) => {
title="Color"
summary={(
- Choose a color for the shape outlines and fill.
+ Interviewer will render outlines and fills of map layers using the same color.
)}
>
@@ -96,18 +98,27 @@ const MapOptions = (props) => {
palette={paletteName}
paletteRange={paletteSize}
validation={{ required: true }}
+ label="Which color would you like to use for this stage's map?"
/>
- Enter the center coordinates and initial zoom. Mapbox GL uses longitude,
- latitude coordinate order
+ When the map is first loaded, it will be centered at the initial center and zoom level
+ configured here.
)}
>
+
+
+ The initial center is in longitude, latitude format.
+ We recommend using the longitude and latitude of the center of the area you
+ want to show, such as a city or region.
+
+
+
{
placeholder="[Longitude, Latitude]"
/>
+
+
+ The zoom level controls how much of the map is initially visible. Higher levels show
+ more detail, while lower levels show a broader area. The zoom level can be a number
+ between 0 and 22.
+
+
+
parseInt(value, 10) || value}
- validation={{ required: false, positiveNumber: true }}
+ validation={{ required: false, positiveNumber: true, maxValue: 22 }}
/>
-
>
From e29e07eda6fa2a37dfeff91917ee2b3838a577a5 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 9 Jan 2025 15:08:31 -0800
Subject: [PATCH 11/32] wip proof of concept mapbox key flow
user provides key value, value is saved to txt file in assets
---
.../AssetBrowser/withAssetActions.js | 1 +
src/components/Form/Fields/GeoAPIKey.js | 35 -----
.../Form/Fields/Geospatial/CreateKeyWindow.js | 146 ++++++++++++++++++
.../Form/Fields/Geospatial/GeoAPIKey.js | 58 +++++++
.../Fields/{ => Geospatial}/GeoDataSource.js | 2 +-
src/components/sections/MapOptions.js | 22 +--
src/ducks/modules/protocol/assetManifest.js | 2 +-
7 files changed, 211 insertions(+), 55 deletions(-)
delete mode 100644 src/components/Form/Fields/GeoAPIKey.js
create mode 100644 src/components/Form/Fields/Geospatial/CreateKeyWindow.js
create mode 100644 src/components/Form/Fields/Geospatial/GeoAPIKey.js
rename src/components/Form/Fields/{ => Geospatial}/GeoDataSource.js (96%)
diff --git a/src/components/AssetBrowser/withAssetActions.js b/src/components/AssetBrowser/withAssetActions.js
index 4a69bf118..a98a7d185 100644
--- a/src/components/AssetBrowser/withAssetActions.js
+++ b/src/components/AssetBrowser/withAssetActions.js
@@ -10,6 +10,7 @@ const connectActions = connect(
null,
{
deleteAsset: assetActions.deleteAsset,
+ importAsset: assetActions.importAsset,
openDialog: dialogActions.openDialog,
},
);
diff --git a/src/components/Form/Fields/GeoAPIKey.js b/src/components/Form/Fields/GeoAPIKey.js
deleted file mode 100644
index 8092ad559..000000000
--- a/src/components/Form/Fields/GeoAPIKey.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { withState } from 'recompose';
-import { fieldPropTypes } from 'redux-form';
-import NetworkThumbnail from '@components/Thumbnail/Network'; // TODO: replace
-import File from './File';
-
-const withSelectAPIKey = withState('selectAPIKey', 'setSelectAPIKey', false);
-
-const GeoAPIKey = (props) => {
- const {
- input,
- } = props;
- return (
-
- { (id) => }
-
- );
-};
-
-GeoAPIKey.propTypes = {
- ...fieldPropTypes,
- canUseExisting: PropTypes.bool,
-};
-
-GeoAPIKey.defaultProps = {
- canUseExisting: false,
-};
-
-export default withSelectAPIKey(GeoAPIKey);
diff --git a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
new file mode 100644
index 000000000..fd2e6d2f5
--- /dev/null
+++ b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
@@ -0,0 +1,146 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { AnimatePresence, motion } from 'framer-motion';
+import * as Fields from '@codaco/ui/lib/components/Fields';
+
+import { createPortal } from 'react-dom';
+import Button from '@codaco/ui/lib/components/Button';
+import { Layout, Section } from '@components/EditorLayout';
+import ControlBar from '@components/ControlBar';
+import Screen from '@components/Screen/Screen';
+import { screenVariants } from '@components/Screens/Screens';
+import ValidatedField from '@components/Form/ValidatedField';
+import { reduxForm } from 'redux-form';
+import withAssetActions from '@components/AssetBrowser/withAssetActions';
+import { compose } from 'recompose';
+import fs from 'fs'; // Node.js file system module
+import path from 'path'; // Node.js path module
+import { remote } from 'electron'; // Electron's remote module (if needed for paths)
+
+const CreateKeyWindow = ({
+ show,
+ close,
+ submitting,
+ handleSubmit,
+ importAsset,
+}) => {
+ const handleCreateFile = (values) => {
+ // TODO: implement editing the file
+ const fileContents = values.mapboxAPIKey;
+
+ const tempFilePath = path.join(remote.app.getPath('temp'), 'architect', 'mapbox.txt');
+
+ fs.writeFile(tempFilePath, fileContents, (err) => {
+ if (err) {
+ console.error('Error writing the file:', err);
+ return;
+ }
+ importAsset(tempFilePath);
+
+ close();
+ });
+ };
+
+ const cancelButton = (
+
+ Cancel
+
+ );
+
+ const saveButton = (
+
+ Finished Editing
+
+ );
+
+ if (!show) { return null; }
+
+ return createPortal(
+
+ { show && (
+
+
+
+ Create Mapbox API Key
+
+
+ )}
+ footer={(
+
+ )}
+ >
+
+
+ This interface requires a Mapbox API Key to render maps. To get one, visit
+ {' '}
+ mapbox.com
+ {' '}
+ or read our documentation on the interface.
+
+ )}
+ >
+
+
+
+
+
+
+
+ )}
+ ,
+ document.body,
+ );
+};
+
+CreateKeyWindow.propTypes = {
+ show: PropTypes.bool,
+ type: PropTypes.string,
+ selected: PropTypes.string,
+ onSelect: PropTypes.func,
+ onCancel: PropTypes.func,
+};
+
+CreateKeyWindow.defaultProps = {
+ show: true,
+ type: null,
+ selected: null,
+ onSelect: () => {},
+ onCancel: () => {},
+};
+
+export default compose(
+ withAssetActions,
+ reduxForm({
+ form: 'createApiKeyForm',
+ }),
+)(CreateKeyWindow);
diff --git a/src/components/Form/Fields/Geospatial/GeoAPIKey.js b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
new file mode 100644
index 000000000..ba34fa35a
--- /dev/null
+++ b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
@@ -0,0 +1,58 @@
+import React, { useEffect, useState } from 'react';
+import { withState, compose } from 'recompose';
+import { fieldPropTypes } from 'redux-form';
+import Button from '@codaco/ui/lib/components/Button';
+import withAssets from '@components/AssetBrowser/withAssets';
+import KeyIcon from '@material-ui/icons/VpnKey';
+import CreateKeyWindow from './CreateKeyWindow';
+
+const withSelectAPIKey = withState('selectAPIKey', 'setSelectAPIKey', false);
+
+const GeoAPIKey = (props) => {
+ const {
+ input,
+ assets,
+
+ } = props;
+ const existingAPIKeyFile = assets.find((asset) => asset.name === 'mapbox.txt');
+
+ const [showCreateKeyWindow, setShowCreateKeyWindow] = useState(false);
+
+ // initialize the data with the existing file if there's no input.value
+ useEffect(() => {
+ if (!input.value && existingAPIKeyFile) {
+ input.onChange(existingAPIKeyFile.id);
+ }
+ }, [input.value, existingAPIKeyFile]);
+
+ return (
+ <>
+ {existingAPIKeyFile && (
+
+
+ Using existing Mapbox API Key
+
+ )}
+ setShowCreateKeyWindow(true)}
+ color="primary"
+ size="small"
+ >
+ { !existingAPIKeyFile ? 'Create API Key' : 'Update API Key' }
+
+ setShowCreateKeyWindow(false)}
+ />
+ >
+ );
+};
+
+GeoAPIKey.propTypes = {
+ ...fieldPropTypes,
+};
+
+export default compose(
+ withSelectAPIKey,
+ withAssets,
+)(GeoAPIKey);
diff --git a/src/components/Form/Fields/GeoDataSource.js b/src/components/Form/Fields/Geospatial/GeoDataSource.js
similarity index 96%
rename from src/components/Form/Fields/GeoDataSource.js
rename to src/components/Form/Fields/Geospatial/GeoDataSource.js
index 68186320a..6b4052cbb 100644
--- a/src/components/Form/Fields/GeoDataSource.js
+++ b/src/components/Form/Fields/Geospatial/GeoDataSource.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { withState } from 'recompose';
import { fieldPropTypes } from 'redux-form';
import NetworkThumbnail from '@components/Thumbnail/Network'; // TODO: replace
-import File from './File';
+import File from '../File';
const withSelectGeoAsset = withState('selectGeoAsset', 'setSelectGeoAsset', false);
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 5978efd58..2933c0fa7 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -9,23 +9,10 @@ import { Section, Row } from '../EditorLayout';
import ValidatedField from '../Form/ValidatedField';
import ColorPicker from '../Form/Fields/ColorPicker';
-import GeoDataSource from '../Form/Fields/GeoDataSource';
-import GeoAPIKey from '../Form/Fields/GeoAPIKey';
+import GeoDataSource from '../Form/Fields/Geospatial/GeoDataSource';
+import GeoAPIKey from '../Form/Fields/Geospatial/GeoAPIKey';
import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
-// config map options
-
-/*
- mapOptions: {
- center: z.tuple([z.number(), z.number()]),
- token: z.string(),
- initialZoom: z.number().int(),
- data: z.string(),
- color: z.string(),
- propToSelect: z.string(),
- },
-*/
-
const MapOptions = (props) => {
const { mapOptions } = props;
@@ -48,16 +35,15 @@ const MapOptions = (props) => {
- This stage needs a GeoJSON source for map layers.
+ This interface requires a GeoJSON source for map layers.
These provide selectable areas for prompts. Select a GeoJSON
file to use.
diff --git a/src/ducks/modules/protocol/assetManifest.js b/src/ducks/modules/protocol/assetManifest.js
index d64f43815..d89b83580 100644
--- a/src/ducks/modules/protocol/assetManifest.js
+++ b/src/ducks/modules/protocol/assetManifest.js
@@ -32,7 +32,7 @@ const importAsset = (filename) => ({
* @param {string} filename - Name of file
* @param {string} fileType - File MIME type
*/
-const importAssetComplete = (filename, name, assetType) => ({
+export const importAssetComplete = (filename, name, assetType) => ({
id: uuid(),
type: IMPORT_ASSET_COMPLETE,
name,
From a73ff18fc918dbccff9f1692fca32b640ef647a9 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Fri, 10 Jan 2025 14:46:50 -0800
Subject: [PATCH 12/32] wip edit functionality
---
.../Form/Fields/Geospatial/CreateKeyWindow.js | 10 +++++-----
src/components/Form/Fields/Geospatial/GeoAPIKey.js | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
index fd2e6d2f5..002462953 100644
--- a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
+++ b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
@@ -13,9 +13,9 @@ import ValidatedField from '@components/Form/ValidatedField';
import { reduxForm } from 'redux-form';
import withAssetActions from '@components/AssetBrowser/withAssetActions';
import { compose } from 'recompose';
-import fs from 'fs'; // Node.js file system module
-import path from 'path'; // Node.js path module
-import { remote } from 'electron'; // Electron's remote module (if needed for paths)
+import fs from 'fs';
+import path from 'path';
+import { remote } from 'electron';
const CreateKeyWindow = ({
show,
@@ -23,6 +23,7 @@ const CreateKeyWindow = ({
submitting,
handleSubmit,
importAsset,
+ existingFile,
}) => {
const handleCreateFile = (values) => {
// TODO: implement editing the file
@@ -32,8 +33,7 @@ const CreateKeyWindow = ({
fs.writeFile(tempFilePath, fileContents, (err) => {
if (err) {
- console.error('Error writing the file:', err);
- return;
+ throw new Error(`Error writing file: ${err}`);
}
importAsset(tempFilePath);
diff --git a/src/components/Form/Fields/Geospatial/GeoAPIKey.js b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
index ba34fa35a..b11ecef79 100644
--- a/src/components/Form/Fields/Geospatial/GeoAPIKey.js
+++ b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
@@ -43,6 +43,7 @@ const GeoAPIKey = (props) => {
setShowCreateKeyWindow(false)}
+ existingFile={existingAPIKeyFile}
/>
>
);
From ce1a8aee07039d927f26501b315a769330eca865 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Mon, 13 Jan 2025 11:39:50 -0800
Subject: [PATCH 13/32] refactor create key form to use basicForm & handle
edits
---
.../Form/Fields/Geospatial/CreateKeyWindow.js | 119 ++++++++++--------
1 file changed, 68 insertions(+), 51 deletions(-)
diff --git a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
index 002462953..2a2f78566 100644
--- a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
+++ b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useMemo, useCallback } from 'react';
import PropTypes from 'prop-types';
import { AnimatePresence, motion } from 'framer-motion';
import * as Fields from '@codaco/ui/lib/components/Fields';
@@ -10,36 +10,50 @@ import ControlBar from '@components/ControlBar';
import Screen from '@components/Screen/Screen';
import { screenVariants } from '@components/Screens/Screens';
import ValidatedField from '@components/Form/ValidatedField';
-import { reduxForm } from 'redux-form';
import withAssetActions from '@components/AssetBrowser/withAssetActions';
import { compose } from 'recompose';
import fs from 'fs';
import path from 'path';
import { remote } from 'electron';
+import { getAssetPath } from '@selectors/assets';
+import { useSelector } from 'react-redux';
+import BasicForm from '../../../BasicForm';
const CreateKeyWindow = ({
show,
close,
submitting,
- handleSubmit,
importAsset,
+ deleteAsset,
existingFile,
}) => {
- const handleCreateFile = (values) => {
- // TODO: implement editing the file
- const fileContents = values.mapboxAPIKey;
+ const currentState = useSelector((state) => state);
- const tempFilePath = path.join(remote.app.getPath('temp'), 'architect', 'mapbox.txt');
+ const existingFileData = useMemo(() => {
+ if (existingFile) {
+ const assetPath = getAssetPath(currentState, existingFile.id);
+ const key = fs.readFileSync(assetPath, 'utf8');
+ return { existingKey: key, existingAssetPath: assetPath };
+ }
+ return { existingKey: '', existingAssetPath: '' };
+ }, [existingFile, currentState]);
- fs.writeFile(tempFilePath, fileContents, (err) => {
+ const handleCreateFile = useCallback((formValues) => {
+ const newFileContents = formValues.mapboxAPIKey;
+ const tempFilePath = path.join(remote.app.getPath('temp'), 'architect', 'mapbox.txt');
+ fs.writeFile(tempFilePath, newFileContents, (err) => {
if (err) {
throw new Error(`Error writing file: ${err}`);
}
importAsset(tempFilePath);
+ if (existingFileData) {
+ deleteAsset(existingFile.id);
+ }
+
close();
});
- };
+ }, [importAsset, close, existingFileData.existingAssetPath, existingFile, currentState]);
const cancelButton = (
Finished Editing
@@ -75,46 +89,52 @@ const CreateKeyWindow = ({
exit="hidden"
className="screens-container"
>
-
-
- Create Mapbox API Key
-
-
+
+
+
+ Create Mapbox API Key
+
+
)}
- footer={(
-
+ footer={(
+
)}
- >
-
-
- This interface requires a Mapbox API Key to render maps. To get one, visit
- {' '}
- mapbox.com
- {' '}
- or read our documentation on the interface.
-
- )}
- >
+ >
+
+
+ This interface requires a Mapbox API Key to render maps. To get one, visit
+ {' '}
+ mapbox.com
+ {' '}
+ or read our documentation on the interface.
+
+ )}
+ >
+
+
+
+
+
+
+
-
-
-
-
-
)}
,
@@ -140,7 +160,4 @@ CreateKeyWindow.defaultProps = {
export default compose(
withAssetActions,
- reduxForm({
- form: 'createApiKeyForm',
- }),
)(CreateKeyWindow);
From 2fb138e29ad28d37d506df62756e8668feacfd3d Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Mon, 13 Jan 2025 13:57:33 -0800
Subject: [PATCH 14/32] conditionally render saveButton only when form is dirty
---
.../Form/Fields/Geospatial/CreateKeyWindow.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
index 2a2f78566..98fec5828 100644
--- a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
+++ b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
@@ -17,16 +17,17 @@ import path from 'path';
import { remote } from 'electron';
import { getAssetPath } from '@selectors/assets';
import { useSelector } from 'react-redux';
+import { isDirty } from 'redux-form';
import BasicForm from '../../../BasicForm';
const CreateKeyWindow = ({
show,
close,
- submitting,
importAsset,
deleteAsset,
existingFile,
}) => {
+ const formName = 'create-mapbox-key';
const currentState = useSelector((state) => state);
const existingFileData = useMemo(() => {
@@ -71,12 +72,15 @@ const CreateKeyWindow = ({
type="submit"
iconPosition="right"
icon="arrow-right"
- disabled={submitting} // TODO: disable if no edits
>
Finished Editing
);
+ const controlButtons = isDirty(formName)(currentState)
+ ? [cancelButton, saveButton]
+ : [cancelButton];
+
if (!show) { return null; }
return createPortal(
@@ -90,7 +94,7 @@ const CreateKeyWindow = ({
className="screens-container"
>
@@ -104,7 +108,7 @@ const CreateKeyWindow = ({
)}
footer={(
)}
>
From 27c13753462cceeeef2cd1e14c08cc88d73a9ff8 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Tue, 14 Jan 2025 12:39:11 -0800
Subject: [PATCH 15/32] update prop names, native select for target feature
prop
---
src/components/sections/MapOptions.js | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 2933c0fa7..85d91c9ab 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { compose } from 'recompose';
import * as Fields from '@codaco/ui/lib/components/Fields';
+import NativeSelect from '@components/Form/Fields/NativeSelect';
+
import withMapFormToProps from '@components/enhancers/withMapFormToProps';
import Tip from '@components/Tip';
import { Section, Row } from '../EditorLayout';
@@ -16,7 +18,7 @@ import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalDa
const MapOptions = (props) => {
const { mapOptions } = props;
- const { variables: variableOptions } = useVariablesFromExternalData(mapOptions?.dataSource, true, 'geojson');
+ const { variables: variableOptions } = useVariablesFromExternalData(mapOptions?.dataSourceAssetId, true, 'geojson');
const { paletteName, paletteSize } = { paletteName: ['ord-color-seq'], paletteSize: 8 }; // TODO: what palette should this be?
@@ -53,8 +55,8 @@ const MapOptions = (props) => {
@@ -62,8 +64,8 @@ const MapOptions = (props) => {
@@ -84,7 +86,7 @@ const MapOptions = (props) => {
palette={paletteName}
paletteRange={paletteSize}
validation={{ required: true }}
- label="Which color would you like to use for this stage's map?"
+ label="Which color would you like to use for this stage's map outlines and selections?"
/>
Date: Tue, 14 Jan 2025 14:58:37 -0800
Subject: [PATCH 16/32] refactor: save api key directly to asset manifest
---
src/components/AssetBrowser/Asset.js | 2 +-
src/components/AssetBrowser/Assets.js | 2 +-
.../Form/Fields/Geospatial/CreateKeyWindow.js | 99 ++++++++-----------
.../Form/Fields/Geospatial/GeoAPIKey.js | 45 +++------
src/components/sections/MapOptions.js | 2 +-
src/ducks/modules/protocol/assetManifest.js | 25 +++++
6 files changed, 85 insertions(+), 90 deletions(-)
diff --git a/src/components/AssetBrowser/Asset.js b/src/components/AssetBrowser/Asset.js
index 73c80be6a..06d0d75fc 100644
--- a/src/components/AssetBrowser/Asset.js
+++ b/src/components/AssetBrowser/Asset.js
@@ -16,7 +16,7 @@ const ASSET_COMPONENTS = {
audio: Thumbnails.Audio,
network: Thumbnails.Network,
geospatial: Thumbnails.Network, // TODO: Add geospatial thumbnail
- environment: Thumbnails.Network, // TODO: Add env thumbnail
+ // apiKey: Thumbnails.Network, // TODO: Add apiKey thumbnail
};
const Asset = ({
diff --git a/src/components/AssetBrowser/Assets.js b/src/components/AssetBrowser/Assets.js
index 095cb4eaf..a3f9da9bc 100644
--- a/src/components/AssetBrowser/Assets.js
+++ b/src/components/AssetBrowser/Assets.js
@@ -12,7 +12,7 @@ const ASSET_TYPES = [
{ label: 'Audio', value: 'audio' },
{ label: 'Network', value: 'network' },
{ label: 'GeoJSON', value: 'geospatial' },
- { label: 'Environment', value: 'env' },
+ { label: 'API Key', value: 'apiKey' },
];
const Assets = ({
diff --git a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
index 98fec5828..0d745b8d8 100644
--- a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
+++ b/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
@@ -1,4 +1,4 @@
-import React, { useMemo, useCallback } from 'react';
+import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { AnimatePresence, motion } from 'framer-motion';
import * as Fields from '@codaco/ui/lib/components/Fields';
@@ -10,56 +10,35 @@ import ControlBar from '@components/ControlBar';
import Screen from '@components/Screen/Screen';
import { screenVariants } from '@components/Screens/Screens';
import ValidatedField from '@components/Form/ValidatedField';
-import withAssetActions from '@components/AssetBrowser/withAssetActions';
-import { compose } from 'recompose';
-import fs from 'fs';
-import path from 'path';
-import { remote } from 'electron';
-import { getAssetPath } from '@selectors/assets';
-import { useSelector } from 'react-redux';
+import Assets from '@components/AssetBrowser/Assets';
+
+import { useSelector, useDispatch } from 'react-redux';
import { isDirty } from 'redux-form';
import BasicForm from '../../../BasicForm';
+import { addApiKeyAsset } from '../../../../ducks/modules/protocol/assetManifest';
const CreateKeyWindow = ({
show,
close,
- importAsset,
- deleteAsset,
- existingFile,
+ onSelect,
+ selected,
}) => {
- const formName = 'create-mapbox-key';
+ const formName = 'create-api-key';
const currentState = useSelector((state) => state);
+ const dispatch = useDispatch();
- const existingFileData = useMemo(() => {
- if (existingFile) {
- const assetPath = getAssetPath(currentState, existingFile.id);
- const key = fs.readFileSync(assetPath, 'utf8');
- return { existingKey: key, existingAssetPath: assetPath };
- }
- return { existingKey: '', existingAssetPath: '' };
- }, [existingFile, currentState]);
-
- const handleCreateFile = useCallback((formValues) => {
- const newFileContents = formValues.mapboxAPIKey;
- const tempFilePath = path.join(remote.app.getPath('temp'), 'architect', 'mapbox.txt');
- fs.writeFile(tempFilePath, newFileContents, (err) => {
- if (err) {
- throw new Error(`Error writing file: ${err}`);
- }
- importAsset(tempFilePath);
-
- if (existingFileData) {
- deleteAsset(existingFile.id);
- }
-
- close();
- });
- }, [importAsset, close, existingFileData.existingAssetPath, existingFile, currentState]);
+ // handleSubmit should add the selected key to the asset manifest
+ // and close the window
+ const handleSubmit = useCallback((formValues) => {
+ const newKeyAsset = dispatch(addApiKeyAsset(formValues.keyName, formValues.keyValue));
+ onSelect(newKeyAsset.id);
+ close();
+ }, [close]);
const cancelButton = (
Cancel
@@ -95,14 +74,13 @@ const CreateKeyWindow = ({
>
- Create Mapbox API Key
+ API Key Browser
)}
@@ -114,25 +92,34 @@ const CreateKeyWindow = ({
>
- This interface requires a Mapbox API Key to render maps. To get one, visit
- {' '}
- mapbox.com
- {' '}
- or read our documentation on the interface.
-
- )}
+ title="Create New API Key"
>
-
+
+
+
+
+
@@ -162,6 +149,4 @@ CreateKeyWindow.defaultProps = {
onCancel: () => {},
};
-export default compose(
- withAssetActions,
-)(CreateKeyWindow);
+export default CreateKeyWindow;
diff --git a/src/components/Form/Fields/Geospatial/GeoAPIKey.js b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
index b11ecef79..edaae0e4a 100644
--- a/src/components/Form/Fields/Geospatial/GeoAPIKey.js
+++ b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
@@ -1,49 +1,37 @@
-import React, { useEffect, useState } from 'react';
-import { withState, compose } from 'recompose';
+import React, { useState } from 'react';
+import { compose } from 'recompose';
import { fieldPropTypes } from 'redux-form';
import Button from '@codaco/ui/lib/components/Button';
-import withAssets from '@components/AssetBrowser/withAssets';
-import KeyIcon from '@material-ui/icons/VpnKey';
import CreateKeyWindow from './CreateKeyWindow';
-const withSelectAPIKey = withState('selectAPIKey', 'setSelectAPIKey', false);
-
const GeoAPIKey = (props) => {
const {
- input,
- assets,
-
+ input: {
+ value,
+ onChange,
+ },
} = props;
- const existingAPIKeyFile = assets.find((asset) => asset.name === 'mapbox.txt');
const [showCreateKeyWindow, setShowCreateKeyWindow] = useState(false);
-
- // initialize the data with the existing file if there's no input.value
- useEffect(() => {
- if (!input.value && existingAPIKeyFile) {
- input.onChange(existingAPIKeyFile.id);
- }
- }, [input.value, existingAPIKeyFile]);
-
return (
<>
- {existingAPIKeyFile && (
-
-
- Using existing Mapbox API Key
-
- )}
+
+ {/* TODO: file preview here */}
+
+
setShowCreateKeyWindow(true)}
color="primary"
size="small"
>
- { !existingAPIKeyFile ? 'Create API Key' : 'Update API Key' }
+ { !value ? 'Select API Key' : 'Update API Key' }
setShowCreateKeyWindow(false)}
- existingFile={existingAPIKeyFile}
+ onSelect={(keyId) => {
+ onChange(keyId); // add the keyId as the value for mapOptions.tokenAssetId
+ }}
/>
>
);
@@ -53,7 +41,4 @@ GeoAPIKey.propTypes = {
...fieldPropTypes,
};
-export default compose(
- withSelectAPIKey,
- withAssets,
-)(GeoAPIKey);
+export default GeoAPIKey;
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 85d91c9ab..65d6112f1 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -35,7 +35,7 @@ const MapOptions = (props) => {
>
path.parse(filename).base;
@@ -87,6 +88,17 @@ const importAssetThunk = (filePath) => (dispatch, getState) => {
.catch((error) => dispatch(importAssetFailed(filePath, error)));
};
+/**
+ * @param {string} name - The name of the API key
+ * @param {string} value - The value of the API key
+ */
+export const addApiKeyAsset = (name, value) => ({
+ type: ADD_API_KEY_ASSET,
+ id: uuid(),
+ name,
+ value,
+});
+
const initialState = {};
export default function reducer(state = initialState, action = {}) {
@@ -105,6 +117,17 @@ export default function reducer(state = initialState, action = {}) {
// Don't delete from disk, this allows us to rollback the protocol.
// Disk changes should be commited on save.
return omit(state, action.id);
+ case ADD_API_KEY_ASSET:
+ return {
+ ...state,
+ [action.id]: {
+ id: action.id,
+ type: 'apiKey',
+ name: action.name,
+ value: action.value,
+ },
+ };
+
default:
return state;
}
@@ -113,6 +136,7 @@ export default function reducer(state = initialState, action = {}) {
const actionCreators = {
importAsset: importAssetThunk,
deleteAsset: saveableChange(deleteAsset),
+ addApiKeyAsset: saveableChange(addApiKeyAsset),
};
const actionTypes = {
@@ -120,6 +144,7 @@ const actionTypes = {
IMPORT_ASSET_COMPLETE,
IMPORT_ASSET_FAILED,
DELETE_ASSET,
+ ADD_API_KEY_ASSET,
};
const test = {
From 36cad69920c7a57af6b6eda573fdbe07d6e8bafb Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Wed, 15 Jan 2025 09:54:27 -0800
Subject: [PATCH 17/32] add geo/api thumbnails, api preview
---
src/components/AssetBrowser/Asset.js | 4 +--
src/components/AssetBrowser/Preview.js | 4 +++
src/components/Assets/APIKey.js | 21 ++++++++++++++
src/components/Assets/index.js | 1 +
.../Form/Fields/Geospatial/GeoAPIKey.js | 1 -
.../Form/Fields/Geospatial/GeoDataSource.js | 4 +--
src/components/Thumbnail/APIKey.js | 28 +++++++++++++++++++
src/components/Thumbnail/GeoJSON.js | 28 +++++++++++++++++++
src/components/Thumbnail/index.js | 2 ++
9 files changed, 88 insertions(+), 5 deletions(-)
create mode 100644 src/components/Assets/APIKey.js
create mode 100644 src/components/Thumbnail/APIKey.js
create mode 100644 src/components/Thumbnail/GeoJSON.js
diff --git a/src/components/AssetBrowser/Asset.js b/src/components/AssetBrowser/Asset.js
index 06d0d75fc..b23da4717 100644
--- a/src/components/AssetBrowser/Asset.js
+++ b/src/components/AssetBrowser/Asset.js
@@ -15,8 +15,8 @@ const ASSET_COMPONENTS = {
video: Thumbnails.Video,
audio: Thumbnails.Audio,
network: Thumbnails.Network,
- geospatial: Thumbnails.Network, // TODO: Add geospatial thumbnail
- // apiKey: Thumbnails.Network, // TODO: Add apiKey thumbnail
+ geospatial: Thumbnails.GeoJSON,
+ apiKey: Thumbnails.APIKey,
};
const Asset = ({
diff --git a/src/components/AssetBrowser/Preview.js b/src/components/AssetBrowser/Preview.js
index be1dc63bb..2a9831088 100644
--- a/src/components/AssetBrowser/Preview.js
+++ b/src/components/AssetBrowser/Preview.js
@@ -21,6 +21,10 @@ const getRenderer = (meta) => {
return ({ id }) => ;
case 'network':
return Assets.Network;
+ // case 'geospatial':
+ // return Assets.GeoJSON;
+ case 'apiKey':
+ return Assets.APIKey;
default:
return () => No preview available.
;
}
diff --git a/src/components/Assets/APIKey.js b/src/components/Assets/APIKey.js
new file mode 100644
index 000000000..33ce58bf3
--- /dev/null
+++ b/src/components/Assets/APIKey.js
@@ -0,0 +1,21 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import withAssetMeta from './withAssetMeta';
+
+const APIKey = ({ meta }) => (
+ // eslint-disable-next-line react/jsx-props-no-spreading
+ {meta.value}
+);
+
+APIKey.propTypes = {
+ // eslint-disable-next-line react/forbid-prop-types
+ meta: PropTypes.object,
+};
+
+APIKey.defaultProps = {
+ meta: {
+ value: '',
+ },
+};
+
+export default withAssetMeta(APIKey);
diff --git a/src/components/Assets/index.js b/src/components/Assets/index.js
index 98b0ca40e..c05ffe93e 100644
--- a/src/components/Assets/index.js
+++ b/src/components/Assets/index.js
@@ -3,3 +3,4 @@ export { default as BackgroundImage } from './BackgroundImage';
export { default as Audio } from './Audio';
export { default as Video } from './Video';
export { default as Network } from './Network';
+export { default as APIKey } from './APIKey';
diff --git a/src/components/Form/Fields/Geospatial/GeoAPIKey.js b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
index edaae0e4a..223d81b53 100644
--- a/src/components/Form/Fields/Geospatial/GeoAPIKey.js
+++ b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
@@ -1,5 +1,4 @@
import React, { useState } from 'react';
-import { compose } from 'recompose';
import { fieldPropTypes } from 'redux-form';
import Button from '@codaco/ui/lib/components/Button';
import CreateKeyWindow from './CreateKeyWindow';
diff --git a/src/components/Form/Fields/Geospatial/GeoDataSource.js b/src/components/Form/Fields/Geospatial/GeoDataSource.js
index 6b4052cbb..45719d263 100644
--- a/src/components/Form/Fields/Geospatial/GeoDataSource.js
+++ b/src/components/Form/Fields/Geospatial/GeoDataSource.js
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { withState } from 'recompose';
import { fieldPropTypes } from 'redux-form';
-import NetworkThumbnail from '@components/Thumbnail/Network'; // TODO: replace
+import GeoJSONThumbnail from '@components/Thumbnail/GeoJSON';
import File from '../File';
const withSelectGeoAsset = withState('selectGeoAsset', 'setSelectGeoAsset', false);
@@ -18,7 +18,7 @@ const GeoDataSource = (props) => {
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
- { (id) => }
+ { (id) => }
);
};
diff --git a/src/components/Thumbnail/APIKey.js b/src/components/Thumbnail/APIKey.js
new file mode 100644
index 000000000..31d55a047
--- /dev/null
+++ b/src/components/Thumbnail/APIKey.js
@@ -0,0 +1,28 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import cx from 'classnames';
+import Icon from '@codaco/ui/lib/components/Icon';
+import withAssetMeta from '@components/Assets/withAssetMeta';
+
+const APIKeyThumbnail = ({ id, meta }) => (
+
+);
+
+APIKeyThumbnail.propTypes = {
+ id: PropTypes.string.isRequired,
+ // eslint-disable-next-line react/forbid-prop-types
+ meta: PropTypes.object,
+};
+
+APIKeyThumbnail.defaultProps = {
+ meta: {
+ name: '',
+ },
+};
+
+export default withAssetMeta(APIKeyThumbnail);
diff --git a/src/components/Thumbnail/GeoJSON.js b/src/components/Thumbnail/GeoJSON.js
new file mode 100644
index 000000000..5cd4c42b4
--- /dev/null
+++ b/src/components/Thumbnail/GeoJSON.js
@@ -0,0 +1,28 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import cx from 'classnames';
+import withAssetMeta from '@components/Assets/withAssetMeta';
+import Icon from '@codaco/ui/lib/components/Icon';
+
+const GeoJSONThumbnail = ({ id, meta }) => (
+
+);
+
+GeoJSONThumbnail.propTypes = {
+ id: PropTypes.string.isRequired,
+ // eslint-disable-next-line react/forbid-prop-types
+ meta: PropTypes.object,
+};
+
+GeoJSONThumbnail.defaultProps = {
+ meta: {
+ name: '',
+ },
+};
+
+export default withAssetMeta(GeoJSONThumbnail);
diff --git a/src/components/Thumbnail/index.js b/src/components/Thumbnail/index.js
index 1ef709bc1..db0aa32dd 100644
--- a/src/components/Thumbnail/index.js
+++ b/src/components/Thumbnail/index.js
@@ -2,3 +2,5 @@ export { default as Image } from './Image';
export { default as Audio } from './Audio';
export { default as Video } from './Video';
export { default as Network } from './Network';
+export { default as APIKey } from './APIKey';
+export { default as GeoJSON } from './GeoJSON';
From 5a688f76d3bb0336570195c917ed308584f81580 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Wed, 15 Jan 2025 10:31:24 -0800
Subject: [PATCH 18/32] fix preview in field
---
.../{CreateKeyWindow.js => APIKeyBrowser.js} | 24 +++++++----
.../Form/Fields/Geospatial/GeoAPIKey.js | 40 ++++++++++++-------
2 files changed, 42 insertions(+), 22 deletions(-)
rename src/components/Form/Fields/Geospatial/{CreateKeyWindow.js => APIKeyBrowser.js} (88%)
diff --git a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js b/src/components/Form/Fields/Geospatial/APIKeyBrowser.js
similarity index 88%
rename from src/components/Form/Fields/Geospatial/CreateKeyWindow.js
rename to src/components/Form/Fields/Geospatial/APIKeyBrowser.js
index 0d745b8d8..249d6165a 100644
--- a/src/components/Form/Fields/Geospatial/CreateKeyWindow.js
+++ b/src/components/Form/Fields/Geospatial/APIKeyBrowser.js
@@ -11,13 +11,14 @@ import Screen from '@components/Screen/Screen';
import { screenVariants } from '@components/Screens/Screens';
import ValidatedField from '@components/Form/ValidatedField';
import Assets from '@components/AssetBrowser/Assets';
+import useExternalDataPreview from '@components/AssetBrowser/useExternalDataPreview';
import { useSelector, useDispatch } from 'react-redux';
import { isDirty } from 'redux-form';
import BasicForm from '../../../BasicForm';
import { addApiKeyAsset } from '../../../../ducks/modules/protocol/assetManifest';
-const CreateKeyWindow = ({
+const APIKeyBrowser = ({
show,
close,
onSelect,
@@ -26,13 +27,19 @@ const CreateKeyWindow = ({
const formName = 'create-api-key';
const currentState = useSelector((state) => state);
const dispatch = useDispatch();
+ const [preview, handleShowPreview] = useExternalDataPreview();
// handleSubmit should add the selected key to the asset manifest
// and close the window
+
+ const handleSelectAsset = useCallback((assetId) => {
+ onSelect(assetId);
+ close();
+ }, [onSelect]);
+
const handleSubmit = useCallback((formValues) => {
const newKeyAsset = dispatch(addApiKeyAsset(formValues.keyName, formValues.keyValue));
- onSelect(newKeyAsset.id);
- close();
+ handleSelectAsset(newKeyAsset.id);
}, [close]);
const cancelButton = (
@@ -94,7 +101,6 @@ const CreateKeyWindow = ({
+ { preview }
@@ -133,7 +141,7 @@ const CreateKeyWindow = ({
);
};
-CreateKeyWindow.propTypes = {
+APIKeyBrowser.propTypes = {
show: PropTypes.bool,
type: PropTypes.string,
selected: PropTypes.string,
@@ -141,7 +149,7 @@ CreateKeyWindow.propTypes = {
onCancel: PropTypes.func,
};
-CreateKeyWindow.defaultProps = {
+APIKeyBrowser.defaultProps = {
show: true,
type: null,
selected: null,
@@ -149,4 +157,4 @@ CreateKeyWindow.defaultProps = {
onCancel: () => {},
};
-export default CreateKeyWindow;
+export default APIKeyBrowser;
diff --git a/src/components/Form/Fields/Geospatial/GeoAPIKey.js b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
index 223d81b53..124d776c8 100644
--- a/src/components/Form/Fields/Geospatial/GeoAPIKey.js
+++ b/src/components/Form/Fields/Geospatial/GeoAPIKey.js
@@ -1,7 +1,9 @@
import React, { useState } from 'react';
import { fieldPropTypes } from 'redux-form';
import Button from '@codaco/ui/lib/components/Button';
-import CreateKeyWindow from './CreateKeyWindow';
+import APIKeyThumbnail from '@components/Thumbnail/APIKey';
+import cx from 'classnames';
+import APIKeyBrowser from './APIKeyBrowser';
const GeoAPIKey = (props) => {
const {
@@ -11,23 +13,33 @@ const GeoAPIKey = (props) => {
},
} = props;
- const [showCreateKeyWindow, setShowCreateKeyWindow] = useState(false);
+ const [showAPIKeyBrowser, setShowAPIKeyBrowser] = useState(false);
+ const fieldClasses = cx(
+ 'form-fields-file',
+ {
+ 'form-fields-file--replace': !!value,
+ },
+ );
return (
<>
-
- {/* TODO: file preview here */}
+
+
+
+ setShowAPIKeyBrowser(true)}
+ color="primary"
+ size="small"
+ >
+ { !value ? 'Select API Key' : 'Update API Key' }
+
+
-
setShowCreateKeyWindow(true)}
- color="primary"
- size="small"
- >
- { !value ? 'Select API Key' : 'Update API Key' }
-
-
setShowCreateKeyWindow(false)}
+ setShowAPIKeyBrowser(false)}
onSelect={(keyId) => {
onChange(keyId); // add the keyId as the value for mapOptions.tokenAssetId
}}
From 30ee676a959c65b36bc645a2411098d4ef058de0 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Wed, 15 Jan 2025 11:38:21 -0800
Subject: [PATCH 19/32] fix asset selected states
---
src/components/Assets/APIKey.js | 2 +-
.../Form/Fields/Geospatial/APIKeyBrowser.js | 40 ++++++++-----------
.../Form/Fields/Geospatial/GeoAPIKey.js | 1 +
src/selectors/indexes.js | 2 +
4 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/src/components/Assets/APIKey.js b/src/components/Assets/APIKey.js
index 33ce58bf3..4f1858c76 100644
--- a/src/components/Assets/APIKey.js
+++ b/src/components/Assets/APIKey.js
@@ -4,7 +4,7 @@ import withAssetMeta from './withAssetMeta';
const APIKey = ({ meta }) => (
// eslint-disable-next-line react/jsx-props-no-spreading
- {meta.value}
+ {meta.value}
);
APIKey.propTypes = {
diff --git a/src/components/Form/Fields/Geospatial/APIKeyBrowser.js b/src/components/Form/Fields/Geospatial/APIKeyBrowser.js
index 249d6165a..6d8363944 100644
--- a/src/components/Form/Fields/Geospatial/APIKeyBrowser.js
+++ b/src/components/Form/Fields/Geospatial/APIKeyBrowser.js
@@ -13,8 +13,8 @@ import ValidatedField from '@components/Form/ValidatedField';
import Assets from '@components/AssetBrowser/Assets';
import useExternalDataPreview from '@components/AssetBrowser/useExternalDataPreview';
-import { useSelector, useDispatch } from 'react-redux';
-import { isDirty } from 'redux-form';
+import { useDispatch } from 'react-redux';
+
import BasicForm from '../../../BasicForm';
import { addApiKeyAsset } from '../../../../ducks/modules/protocol/assetManifest';
@@ -25,21 +25,16 @@ const APIKeyBrowser = ({
selected,
}) => {
const formName = 'create-api-key';
- const currentState = useSelector((state) => state);
const dispatch = useDispatch();
const [preview, handleShowPreview] = useExternalDataPreview();
- // handleSubmit should add the selected key to the asset manifest
- // and close the window
-
const handleSelectAsset = useCallback((assetId) => {
onSelect(assetId);
close();
}, [onSelect]);
const handleSubmit = useCallback((formValues) => {
- const newKeyAsset = dispatch(addApiKeyAsset(formValues.keyName, formValues.keyValue));
- handleSelectAsset(newKeyAsset.id);
+ dispatch(addApiKeyAsset(formValues.keyName, formValues.keyValue));
}, [close]);
const cancelButton = (
@@ -52,21 +47,6 @@ const APIKeyBrowser = ({
);
- const saveButton = (
-
- Finished Editing
-
- );
-
- const controlButtons = isDirty(formName)(currentState)
- ? [cancelButton, saveButton]
- : [cancelButton];
-
if (!show) { return null; }
return createPortal(
@@ -93,7 +73,7 @@ const APIKeyBrowser = ({
)}
footer={(
)}
>
@@ -108,6 +88,7 @@ const APIKeyBrowser = ({
type="text"
placeholder="Name this key"
name="keyName"
+ validation={{ required: true }}
/>
+
+ Create Key
+
+
{
onSelect={(keyId) => {
onChange(keyId); // add the keyId as the value for mapOptions.tokenAssetId
}}
+ selected={value}
/>
>
);
diff --git a/src/selectors/indexes.js b/src/selectors/indexes.js
index f01ac9920..e77251af1 100644
--- a/src/selectors/indexes.js
+++ b/src/selectors/indexes.js
@@ -69,6 +69,8 @@ export const paths = {
'stages[].panels[].dataSource',
'stages[].dataSource',
'stages[].background.image',
+ 'stages[].mapOptions.tokenAssetId',
+ 'stages[].mapOptions.dataSourceAssetId',
['stages[].items[]', mapAssetItems],
],
};
From e45b48886ad2493f381a07e33096c7bc29d3c95c Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Wed, 15 Jan 2025 14:49:15 -0800
Subject: [PATCH 20/32] wip mapbox map for center, zoom selection
---
package-lock.json | 221 +++++++++++++++++-
package.json | 3 +
public/index.html | 2 +-
public/mapbox-gl-csp-worker.js | 2 +
src/components/Assets/APIKey.js | 7 +-
src/components/StageEditor/Interfaces.js | 2 +
.../enhancers/withDisabledAPIKeyRequired.js | 8 +
src/components/sections/MapOptions.js | 52 +----
src/components/sections/MapSelection.js | 133 +++++++++++
src/components/sections/index.js | 1 +
10 files changed, 372 insertions(+), 59 deletions(-)
create mode 100644 public/mapbox-gl-csp-worker.js
create mode 100644 src/components/enhancers/withDisabledAPIKeyRequired.js
create mode 100644 src/components/sections/MapSelection.js
diff --git a/package-lock.json b/package-lock.json
index c87b9acae..6e4ed4ab1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6,8 +6,11 @@
"packages": {
"": {
"name": "network-canvas-architect",
- "version": "6.5.2",
+ "version": "6.5.3",
"hasInstallScript": true,
+ "dependencies": {
+ "mapbox-gl": "^1.13.0"
+ },
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
@@ -3770,6 +3773,81 @@
"node": ">= 10.0.0"
}
},
+ "node_modules/@mapbox/geojson-rewind": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz",
+ "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==",
+ "dependencies": {
+ "get-stream": "^6.0.1",
+ "minimist": "^1.2.6"
+ },
+ "bin": {
+ "geojson-rewind": "geojson-rewind"
+ }
+ },
+ "node_modules/@mapbox/geojson-rewind/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@mapbox/geojson-types": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz",
+ "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw=="
+ },
+ "node_modules/@mapbox/jsonlint-lines-primitives": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
+ "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/@mapbox/mapbox-gl-supported": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz",
+ "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==",
+ "peerDependencies": {
+ "mapbox-gl": ">=0.32.1 <2.0.0"
+ }
+ },
+ "node_modules/@mapbox/point-geometry": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz",
+ "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
+ },
+ "node_modules/@mapbox/tiny-sdf": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz",
+ "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw=="
+ },
+ "node_modules/@mapbox/unitbezier": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
+ "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
+ },
+ "node_modules/@mapbox/vector-tile": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz",
+ "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==",
+ "dependencies": {
+ "@mapbox/point-geometry": "~0.1.0"
+ }
+ },
+ "node_modules/@mapbox/whoots-js": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz",
+ "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/@material-ui/core": {
"version": "4.11.3",
"integrity": "sha512-Adt40rGW6Uds+cAyk3pVgcErpzU/qxc7KBR94jFHBYretU4AtWZltYcNsbeMn9tXL86jjVL1kuGcIHsgLgFGRw==",
@@ -9565,6 +9643,11 @@
"node": ">=0.10.0"
}
},
+ "node_modules/csscolorparser": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz",
+ "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w=="
+ },
"node_modules/cssdb": {
"version": "7.7.1",
"resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.7.1.tgz",
@@ -11303,6 +11386,11 @@
"safe-buffer": "~5.1.0"
}
},
+ "node_modules/earcut": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
+ "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
+ },
"node_modules/ecc-jsbn": {
"version": "0.1.2",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
@@ -14601,6 +14689,11 @@
"node": ">=6.9.0"
}
},
+ "node_modules/geojson-vt": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz",
+ "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
+ },
"node_modules/get-caller-file": {
"version": "2.0.5",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
@@ -14671,6 +14764,11 @@
"assert-plus": "^1.0.0"
}
},
+ "node_modules/gl-matrix": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz",
+ "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA=="
+ },
"node_modules/glob": {
"version": "7.1.6",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
@@ -14955,6 +15053,11 @@
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
},
+ "node_modules/grid-index": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz",
+ "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA=="
+ },
"node_modules/growly": {
"version": "1.3.0",
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=",
@@ -16139,7 +16242,6 @@
"node_modules/ieee754": {
"version": "1.2.1",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
- "dev": true,
"funding": [
{
"type": "github",
@@ -19630,6 +19732,11 @@
"safe-buffer": "~5.1.0"
}
},
+ "node_modules/kdbush": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz",
+ "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
+ },
"node_modules/kew": {
"version": "0.7.0",
"integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=",
@@ -20419,6 +20526,39 @@
"node": ">=0.10.0"
}
},
+ "node_modules/mapbox-gl": {
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.0.tgz",
+ "integrity": "sha512-g8zlzuJxYJqbOPXT19/UBYpVrcefBQ06F/Cbj0fyEfFnFesDcU3cFTxd75/FZ6Upx2ZEjCsD61CHxrcxZidVpA==",
+ "dependencies": {
+ "@mapbox/geojson-rewind": "^0.5.0",
+ "@mapbox/geojson-types": "^1.0.2",
+ "@mapbox/jsonlint-lines-primitives": "^2.0.2",
+ "@mapbox/mapbox-gl-supported": "^1.5.0",
+ "@mapbox/point-geometry": "^0.1.0",
+ "@mapbox/tiny-sdf": "^1.1.1",
+ "@mapbox/unitbezier": "^0.0.0",
+ "@mapbox/vector-tile": "^1.3.1",
+ "@mapbox/whoots-js": "^3.1.0",
+ "csscolorparser": "~1.0.3",
+ "earcut": "^2.2.2",
+ "geojson-vt": "^3.2.1",
+ "gl-matrix": "^3.2.1",
+ "grid-index": "^1.1.0",
+ "minimist": "^1.2.5",
+ "murmurhash-js": "^1.0.0",
+ "pbf": "^3.2.1",
+ "potpack": "^1.0.1",
+ "quickselect": "^2.0.0",
+ "rw": "^1.3.3",
+ "supercluster": "^7.1.0",
+ "tinyqueue": "^2.0.3",
+ "vt-pbf": "^3.1.1"
+ },
+ "engines": {
+ "node": ">=6.4.0"
+ }
+ },
"node_modules/matcher": {
"version": "3.0.0",
"integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",
@@ -21088,9 +21228,12 @@
}
},
"node_modules/minimist": {
- "version": "1.2.5",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
- "dev": true
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/minimist-options": {
"version": "4.1.0",
@@ -21308,6 +21451,11 @@
"integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=",
"dev": true
},
+ "node_modules/murmurhash-js": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz",
+ "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw=="
+ },
"node_modules/nan": {
"version": "2.17.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
@@ -23024,6 +23172,18 @@
"node": ">=8"
}
},
+ "node_modules/pbf": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz",
+ "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==",
+ "dependencies": {
+ "ieee754": "^1.1.12",
+ "resolve-protobuf-schema": "^2.1.0"
+ },
+ "bin": {
+ "pbf": "bin/pbf"
+ }
+ },
"node_modules/pbkdf2": {
"version": "3.1.1",
"integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==",
@@ -27779,6 +27939,11 @@
"node": ">=6.14.4"
}
},
+ "node_modules/potpack": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz",
+ "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
+ },
"node_modules/prelude-ls": {
"version": "1.2.1",
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
@@ -27970,6 +28135,11 @@
"dev": true,
"optional": true
},
+ "node_modules/protocol-buffers-schema": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
+ "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw=="
+ },
"node_modules/proxy-addr": {
"version": "2.0.6",
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
@@ -28138,6 +28308,11 @@
"node": ">=8"
}
},
+ "node_modules/quickselect": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
+ "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
+ },
"node_modules/raf": {
"version": "3.4.1",
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
@@ -31877,6 +32052,14 @@
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==",
"dev": true
},
+ "node_modules/resolve-protobuf-schema": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
+ "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
+ "dependencies": {
+ "protocol-buffers-schema": "^3.3.1"
+ }
+ },
"node_modules/resolve-url": {
"version": "0.2.1",
"integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
@@ -32256,6 +32439,11 @@
"aproba": "^1.1.1"
}
},
+ "node_modules/rw": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
+ },
"node_modules/rxjs": {
"version": "6.6.7",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
@@ -34958,6 +35146,14 @@
"node": ">= 8.0"
}
},
+ "node_modules/supercluster": {
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz",
+ "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
+ "dependencies": {
+ "kdbush": "^3.0.0"
+ }
+ },
"node_modules/supports-color": {
"version": "2.0.0",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
@@ -35909,6 +36105,11 @@
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
"dev": true
},
+ "node_modules/tinyqueue": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz",
+ "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA=="
+ },
"node_modules/tippy.js": {
"version": "6.3.7",
"resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz",
@@ -37023,6 +37224,16 @@
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
"dev": true
},
+ "node_modules/vt-pbf": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz",
+ "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==",
+ "dependencies": {
+ "@mapbox/point-geometry": "0.1.0",
+ "@mapbox/vector-tile": "^1.3.1",
+ "pbf": "^3.2.1"
+ }
+ },
"node_modules/w3c-hr-time": {
"version": "1.0.2",
"integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==",
diff --git a/package.json b/package.json
index ffdcaa783..56b821c5d 100644
--- a/package.json
+++ b/package.json
@@ -269,5 +269,8 @@
"@utils/(.*)$": "/src/utils/$1",
"^react-native$": "react-native-web"
}
+ },
+ "dependencies": {
+ "mapbox-gl": "^1.13.0"
}
}
diff --git a/public/index.html b/public/index.html
index 4d9680ee2..be243d311 100644
--- a/public/index.html
+++ b/public/index.html
@@ -6,7 +6,7 @@
http-equiv="Content-Security-Policy"
content="
default-src 'self';
- connect-src 'self' https://api.github.com:* http://localhost:* https://localhost:* https://documentation.networkcanvas.com:* https://assets.networkcanvas.com:* %REACT_APP_CONNECT_SRC_CSP%;
+ connect-src 'self' https://api.github.com:* http://localhost:* https://localhost:* https://documentation.networkcanvas.com:* https://assets.networkcanvas.com:* https://api.mapbox.com:* https://events.mapbox.com:* ws://*:* wss://*:* %REACT_APP_CONNECT_SRC_CSP%;
script-src 'self' %REACT_APP_SCRIPT_SRC_CSP%;
style-src 'self' 'unsafe-inline';
media-src 'self' data: protocol: asset:;
diff --git a/public/mapbox-gl-csp-worker.js b/public/mapbox-gl-csp-worker.js
new file mode 100644
index 000000000..965a51997
--- /dev/null
+++ b/public/mapbox-gl-csp-worker.js
@@ -0,0 +1,2 @@
+var mapboxgl=function(){"use strict";var t=e;function e(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},e.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=n;function n(t,e){this.x=t,this.y=e}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var i="undefined"!=typeof self?self:{},o=Math.pow(2,53)-1;function a(t,e,r){return Math.min(r,Math.max(e,t))}function s(t){var e=[];for(var r in t)e.push(t[r]);return e}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function p(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function c(t,e){return-1!==t.indexOf(e,t.length-e.length)}function h(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function f(t){return Array.isArray(t)?t.map(f):"object"==typeof t&&t?h(t,f):t}var y={};function d(t){y[t]||("undefined"!=typeof console&&console.warn(t),y[t]=!0)}function m(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function v(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var b=null;function w(t){if(null==b){var e=t.navigator?t.navigator.userAgent:null;b=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return b}function _(t){try{var e=i[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var S=k;function k(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var o=0;o=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},k.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,o,a,s))return}},k.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},k.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},k.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),c=s.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=o(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),h];case"hsla":if(4!==c.length)return null;h=o(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=o(c[1]),d=o(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*a(v,m,f+1/3)),n(255*a(v,m,f)),n(255*a(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,z=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function M(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var N=[B,V,T,E,D,j,F,R(O),q];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=N;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function $(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof z)return!0;if(t instanceof Y)return!0;if(t instanceof K)return!0;if(t instanceof H)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in nt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=nt[s],n++}else o=O;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=R(o,a)}else r=nt[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ot=function(t){this.type=j,this.sections=t};ot.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,V)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,R(T))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,D)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l}else{var c=e.parse(t[o],1,O);if(!c)return null;var h=c.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null})}}return new ot(n)},ot.prototype.evaluate=function(t){return new K(this.sections.map((function(e){var r=e.content.evaluate(t);return Q(r)===q?new J("",r,null,null,null):new J(tt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ot.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},at.prototype.eachChild=function(t){t(this.input)},at.prototype.outputDefined=function(){return!1},at.prototype.serialize=function(){return["image",this.input.serialize()]};var st={"to-boolean":E,"to-color":D,"to-number":V,"to-string":T},ut=function(t,e){this.type=t,this.args=e};ut.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=st[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":W(e[0],e[1],e[2],e[3])))return new z(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new rt(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function dt(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function mt(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function vt(t,e){for(var r,n,i,o,a,s,u,l=!1,p=0,c=e.length;p0&&s<0||a<0&&s>0}function bt(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}ft(e,t)}function At(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Bt(t,e)&&(r=!1)})),r}Mt.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if($(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new rt("Input is not a number.");o=a-1}return 0}Tt.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Tt.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new it(e,[t]):"coerce"===r?new ut(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof et)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Vt)return t(e.boundExpression);if(e instanceof ct&&"error"===e.name)return!1;if(e instanceof ht)return!1;if(e instanceof Mt)return!1;var r=e instanceof ut||e instanceof it,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof et})),!!n&&Pt(e)&&Bt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new pt;try{o=new et(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Tt.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Tt(this.registry,n,e||null,i,this.errors)},Tt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new P(n,t))},Tt.prototype.checkSubtype=function(t,e){var r=Z(t,e);return r&&this.error(r),r};var Dt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new Dt(i,r,n)},Dt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Et(e,n)].evaluate(t)},Dt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ot=Object.freeze({__proto__:null,number:Ft,color:function(t,e,r){return new z(Ft(t.r,e.r,r),Ft(t.g,e.g,r),Ft(t.b,e.b,r),Ft(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ft(t,e[n],r)}))}}),Lt=6/29*3*(6/29),jt=Math.PI/180,qt=180/Math.PI;function Rt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Lt+4/29}function Ut(t){return t>6/29?t*t*t:Lt*(t-4/29)}function Nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gt(t){var e=Zt(t.r),r=Zt(t.g),n=Zt(t.b),i=Rt((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Rt((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Rt((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Xt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ut(e),r=.95047*Ut(r),n=1.08883*Ut(n),new z(Nt(3.2404542*r-1.5371385*e-.4985314*n),Nt(-.969266*r+1.8760108*e+.041556*n),Nt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Yt(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Jt={forward:Gt,reverse:Xt,interpolate:function(t,e,r){return{l:Ft(t.l,e.l,r),a:Ft(t.a,e.a,r),b:Ft(t.b,e.b,r),alpha:Ft(t.alpha,e.alpha,r)}}},Kt={forward:function(t){var e=Gt(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*qt;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*jt,r=t.c;return Xt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Yt(t.h,e.h,r),c:Ft(t.c,e.c,r),l:Ft(t.l,e.l,r),alpha:Ft(t.alpha,e.alpha,r)}}},Ht=Object.freeze({__proto__:null,lab:Jt,hcl:Kt}),Wt=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,V)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=D:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Wt(l,r,n,i,u):e.error("Type "+U(l)+" is not interpolatable.")},Wt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Et(e,n),a=Wt.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Ot[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?Kt.reverse(Kt.interpolate(Kt.forward(s),Kt.forward(u),a)):Jt.reverse(Jt.interpolate(Jt.forward(s),Jt.forward(u),a))},Wt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new rt("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new rt("Array index must be an integer, but found "+e+" instead.");return r[e]},ee.prototype.eachChild=function(t){t(this.index),t(this.input)},ee.prototype.outputDefined=function(){return!1},ee.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var re=function(t,e){this.type=E,this.needle=t,this.haystack=e};re.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,O);return r&&n?G(r.type,[E,T,V,B,O])?new re(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead"):null},re.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");return r.indexOf(e)>=0},re.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},re.prototype.outputDefined=function(){return!0},re.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ne=function(t,e,r){this.type=V,this.needle=t,this.haystack=e,this.fromIndex=r};ne.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,O);if(!r||!n)return null;if(!G(r.type,[E,T,V,B,O]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ne(r,n,i):null}return new ne(r,n)},ne.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},ne.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ne.prototype.outputDefined=function(){return!1},ne.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var ie=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};ie.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,Q(h)))return null}else r=Q(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var y=e.parse(t[1],1,O);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new ie(r,n,y,i,o,d):null},ie.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Q(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ie.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ie.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ie.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,V);if(!r||!n)return null;if(!G(r.type,[R(O),T,O]))return e.error("Expected first argument to be of type array or string, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ae(r.type,r,n,i):null}return new ae(r.type,r,n)},ae.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new rt("Expected first argument to be of type array or string, but found "+U(Q(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},ae.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},ae.prototype.outputDefined=function(){return!1},ae.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var pe=le("==",(function(t,e,r){return e===r}),ue),ce=le("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!ue(0,e,r,n)})),he=le("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),ye=le("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),de=le(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),me=function(t,e,r,n,i){this.type=T,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};me.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,V);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,T)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,T)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,V)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,V))?null:new me(r,i,o,a,s)},me.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},me.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},me.prototype.outputDefined=function(){return!1},me.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var ve=function(t){this.type=V,this.input=t};ve.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+U(r.type)+" instead."):new ve(r):null},ve.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new rt("Expected value to be of type string or array, but found "+U(Q(e))+" instead.")},ve.prototype.eachChild=function(t){t(this.input)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ge={"==":pe,"!=":ce,">":fe,"<":he,">=":de,"<=":ye,array:it,at:ee,boolean:it,case:oe,coalesce:Qt,collator:ht,format:ot,image:at,in:re,"index-of":ne,interpolate:Wt,"interpolate-hcl":Wt,"interpolate-lab":Wt,length:ve,let:te,literal:et,match:ie,number:it,"number-format":me,object:it,slice:ae,step:Dt,string:it,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,var:Vt,within:Mt};function xe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=W(r,n,i,a);if(s)throw new rt(s);return new z(r/255*a,n/255*a,i/255*a,a)}function be(t,e){return t in e}function we(t,e){var r=e[t];return void 0===r?null:r}function _e(t){return{type:t}}function Se(t){return{result:"success",value:t}}function ke(t){return{result:"error",value:t}}function Ie(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ae(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ze(t){return!!t.expression&&t.expression.interpolated}function Me(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Pe(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ce(t){return t}function Be(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ve(t,e,r,n,i){return Be(typeof r===i?n[r]:void 0,t.default,e.default)}function Te(t,e,r){if("number"!==Me(r))return Be(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Et(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Ee(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Me(r))return Be(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=Et(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Ot[e.type]||Ce;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ht[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function De(t,e,r){return"color"===e.type?r=z.parse(r):"formatted"===e.type?r=K.fromString(r.toString()):"resolvedImage"===e.type?r=H.fromString(r.toString()):Me(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Be(r,t.default,e.default)}ct.register(ge,{error:[{kind:"error"},[T],function(t,e){throw new rt(e[0].evaluate(t))}],typeof:[T,[O],function(t,e){return U(Q(e[0].evaluate(t)))}],"to-rgba":[R(V,4),[D],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[D,[V,V,V],xe],rgba:[D,[V,V,V,V],xe],has:{type:E,overloads:[[[T],function(t,e){return be(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return be(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:O,overloads:[[[T],function(t,e){return we(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return we(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[O,[T],function(t,e){return we(e[0].evaluate(t),t.featureState||{})}],properties:[F,[],function(t){return t.properties()}],"geometry-type":[T,[],function(t){return t.geometryType()}],id:[O,[],function(t){return t.id()}],zoom:[V,[],function(t){return t.globals.zoom}],"heatmap-density":[V,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[V,[],function(t){return t.globals.lineProgress||0}],accumulated:[O,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[V,_e(V),function(t,e){for(var r=0,n=0,i=e;n":[E,[T,O],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[E,[T,O],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[E,[T,O],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[E,[O],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[E,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[E,[R(T)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[E,[R(O)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[E,[T,R(O)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[E,[T,R(O)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:E,overloads:[[[E,E],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[_e(E),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in ge}function Le(t,e){var r=new Tt(ge,[],e?function(t){var e={color:D,string:T,number:V,enum:T,boolean:E,formatted:j,resolvedImage:q};return"array"===t.type?R(e[t.value]||O,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Se(new Fe(n,e)):ke(r.errors)}Fe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Fe.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new rt("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var je=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ct(e.expression)};je.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},je.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var qe=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ct(e.expression),this.interpolationType=n};function Re(t,e){if("error"===(t=Le(t,e)).result)return t;var r=t.value.expression,n=Pt(r);if(!n&&!Ie(e))return ke([new P("","data expressions not supported")]);var i=Bt(r,["zoom"]);if(!i&&!Ae(e))return ke([new P("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof te)r=t(e.result);else if(e instanceof Qt)for(var n=0,i=e.args;n=0)){var p=t[l];u[l]=Ge[s].shallow.indexOf(l)>=0?p:He(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function We(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Je(t)||Ke(t)||ArrayBuffer.isView(t)||t instanceof Ne)return t;if(Array.isArray(t))return t.map(We);if("object"==typeof t){var e=t.$name||"Object",r=Ge[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i=0?s:We(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var $e=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};$e.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},$e.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Qe=function(t,e,r){var n;this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},n=this,["receive","process"].forEach((function(t){n[t]&&(n[t]=n[t].bind(n))})),this.invoker=new $e(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=g()?t:i};Qe.prototype.send=function(t,e,r,n,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=w(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:He(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"",targetMapId:n,sourceMapId:o.mapId})}}},Qe.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else g()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Qe.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Qe.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(We(e.error)):n(null,We(e.data)))}else{var i=!1,o=w(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?He(e):null,data:He(n,o)},o)}:function(t){i=!0},s=null,u=We(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Qe.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var tr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},er=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function rr(t){var e=t.value;return e?[new er(t.key,e,"constants have been deprecated as of v8")]:[]}function nr(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ir(t){if(Array.isArray(t))return t.map(ir);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=ir(t[r]);return e}return nr(t)}function or(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Me(r);if("object"!==u)return[new er(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=Cr;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new er(e,r[l],'unknown property "'+l+'"'));continue}h=Cr}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new er(e,r,'missing required property "'+f+'"'));return s}function ar(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Cr;if("array"!==Me(e))return[new er(o,e,"array expected, "+Me(e)+" found")];if(r.length&&e.length!==r.length)return[new er(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.lengthn.maximum?[new er(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ur(t){var e,r,n,i=t.valueSpec,o=nr(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Me(t.value.stops)&&"array"===Me(t.value.stops[0])&&"object"===Me(t.value.stops[0][0]),p=or({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new er(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(ar({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Me(r)&&0===r.length&&e.push(new er(t.key,r,"array must have at least one stop")),e},default:function(t){return Cr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new er(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new er(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ze(t.valueSpec)&&p.push(new er(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Ie(t.valueSpec)?p.push(new er(t.key,t.value,"property functions not supported")):s&&!Ae(t.valueSpec)&&p.push(new er(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new er(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==Me(o))return[new er(s,o,"array expected, "+Me(o)+" found")];if(2!==o.length)return[new er(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Me(o[0]))return[new er(s,o,"object expected, "+Me(o[0])+" found")];if(void 0===o[0].zoom)return[new er(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new er(s,o,"object stop key must have value")];if(n&&n>nr(o[0].zoom))return[new er(s,o[0].zoom,"stop zoom values must appear in ascending order")];nr(o[0].zoom)!==n&&(n=nr(o[0].zoom),r=void 0,a={}),e=e.concat(or({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:sr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Oe(ir(o[1]))?e.concat([new er(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Cr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Me(t.value),u=nr(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new er(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new er(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return Ie(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new er(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function dr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?mr(t[1],t[2],"=="):"!="===r?xr(mr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?mr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dr))):"all"===r?["all"].concat(t.slice(1).map(dr)):"none"===r?["all"].concat(t.slice(1).map(dr).map(xr)):"in"===r?vr(t[1],t.slice(2)):"!in"===r?xr(vr(t[1],t.slice(2))):"has"===r?gr(t[1]):"!has"===r?xr(gr(t[1])):"within"!==r||t}function mr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function vr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(yr)]]:["filter-in-small",t,["literal",e]]}}function gr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function xr(t){return["!",t]}function br(t){return cr(ir(t.value))?lr(M({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Me(r))return[new er(n,r,"array expected, "+Me(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new er(n,r,"filter array must have at least 1 element")];switch(a=a.concat(pr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),nr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===nr(r[1])&&a.push(new er(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new er(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Me(r[1]))&&a.push(new er(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},jr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var qr=Vr,Rr=qr.paintProperty,Ur=qr.layoutProperty,Nr=function(){this.first=!0};Nr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=1536&&t<=1791},Gr=function(t){return t>=1872&&t<=1919},Xr=function(t){return t>=2208&&t<=2303},Yr=function(t){return t>=11904&&t<=12031},Jr=function(t){return t>=12032&&t<=12255},Kr=function(t){return t>=12272&&t<=12287},Hr=function(t){return t>=12288&&t<=12351},Wr=function(t){return t>=12352&&t<=12447},$r=function(t){return t>=12448&&t<=12543},Qr=function(t){return t>=12544&&t<=12591},tn=function(t){return t>=12704&&t<=12735},en=function(t){return t>=12736&&t<=12783},rn=function(t){return t>=12784&&t<=12799},nn=function(t){return t>=12800&&t<=13055},on=function(t){return t>=13056&&t<=13311},an=function(t){return t>=13312&&t<=19903},sn=function(t){return t>=19968&&t<=40959},un=function(t){return t>=40960&&t<=42127},ln=function(t){return t>=42128&&t<=42191},pn=function(t){return t>=63744&&t<=64255},cn=function(t){return t>=64336&&t<=65023},hn=function(t){return t>=65040&&t<=65055},fn=function(t){return t>=65072&&t<=65103},yn=function(t){return t>=65104&&t<=65135},dn=function(t){return t>=65136&&t<=65279},mn=function(t){return t>=65280&&t<=65519};function vn(t){for(var e=0,r=t;e=65097&&t<=65103)||pn(t)||on(t)||Yr(t)||en(t)||!(!Hr(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||an(t)||sn(t)||nn(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||function(t){return t>=44032&&t<=55215}(t)||Wr(t)||Kr(t)||function(t){return t>=12688&&t<=12703}(t)||Jr(t)||rn(t)||$r(t)&&12540!==t||!(!mn(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!yn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||hn(t)||function(t){return t>=19904&&t<=19967}(t)||un(t)||ln(t))))}function xn(t){return!(gn(t)||function(t){return!!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hr(t)||$r(t)||function(t){return t>=57344&&t<=63743}(t)||fn(t)||yn(t)||mn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function bn(t){return t>=1424&&t<=2303||cn(t)||dn(t)}function wn(t,e){return!(!e&&bn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function _n(t){for(var e=0,r=t;e=1&&i.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){d("Unable to write to LocalStorage")}},En.prototype.processRequests=function(t){},En.prototype.postEvent=function(t,e,r,n){var i=this;if(In.EVENTS_URL){var o=function(t){var e=t.match(Vn);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}(In.EVENTS_URL);o.params.push("access_token="+(n||In.ACCESS_TOKEN||""));var a,s,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:"01",userId:this.anonId},p=e?u(l,e):l,c={url:(a=o,s=a.params.length?"?"+a.params.join("&"):"",a.protocol+"://"+a.authority+a.path+s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=Gn(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},En.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Dn,Fn,On=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(In.EVENTS_URL&&n||In.ACCESS_TOKEN)&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),p(this.anonId)||(this.anonId=l()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(En),Ln=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){In.EVENTS_URL&&In.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return function(t){return 0===t.indexOf("mapbox:")}(t)||Bn(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Tn(In.ACCESS_TOKEN),n=r?r.u:In.ACCESS_TOKEN,i=n!==this.eventData.tokenU;p(this.anonId)||(this.anonId=l(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(En)),jn=(Ln.postTurnstileEvent.bind(Ln),new On);function qn(){i.caches&&!Dn&&(Dn=i.caches.open("mapbox-tiles"))}function Rn(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}jn.postMapLoadEvent.bind(jn),"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var Un=function(t){function e(e,r,n){401===r&&Bn(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Nn=g()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===i.location.protocol?i.parent:i).location.href};var Zn=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Nn())&&!/^\w+:/.test(r))){if(i.fetch&&i.Request&&i.AbortController&&i.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new i.AbortController,o=new i.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Nn(),signal:n.signal}),a=!1,s=!1,u=(r=o.url).indexOf("sku=")>0&&Bn(r);"json"===t.type&&o.headers.set("Accept","application/json");var l=function(r,n,a){if(!s){if(r&&"SecurityError"!==r.message&&d(r),n&&a)return p(n);var l=Date.now();i.fetch(o).then((function(r){if(r.ok){var n=u?r.clone():null;return p(r,n,l)}return e(new Un(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},p=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(qn(),Dn){var n={status:e.status,statusText:e.statusText,headers:new i.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var o=x(e.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&n.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Fn)try{new Response(new ReadableStream),Fn=!0}catch(t){Fn=!1}Fn?e(t.body):t.blob().then(e)}(e,(function(e){var r=new i.Response(e,n);qn(),Dn&&Dn.then((function(e){return e.put(Rn(t.url),r)})).catch((function(t){return d(t.message)}))})))}}(o,n,u),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(qn(),!Dn)return e(null);var r=Rn(t.url);Dn.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=x(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(o,l):l(null,null),{cancel:function(){s=!0,a||n.abort()}}}(t,e);if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new i.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new Un(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Gn=function(t,e){return Zn(u(t,{method:"POST"}),e)},Xn="unavailable",Yn=null,Jn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Xn||null!=Jn.applyArabicShaping},isLoading:function(){return"loading"===Xn},setState:function(t){Xn=t.pluginStatus,Yn=t.pluginURL},isParsed:function(){return null!=Jn.applyArabicShaping&&null!=Jn.processBidirectionalText&&null!=Jn.processStyledBidirectionalText},getPluginURL:function(){return Yn}},Kn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Nr,this.transition={})};Kn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Hn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Pe(t))return new Ue(t,e);if(Oe(t)){var r=Re(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=z.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Hn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Hn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Wn=function(t){this.property=t,this.value=new Hn(t,void 0)};Wn.prototype.transitioned=function(t,e){return new Qn(this.property,this.value,e,u({},t.transition,this.transition),t.now)},Wn.prototype.untransitioned=function(){return new Qn(this.property,this.value,null,{},0)};var $n=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};$n.prototype.getValue=function(t){return f(this._values[t].value.value)},$n.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].value=new Hn(this._values[t].property,null===e?void 0:f(e))},$n.prototype.getTransition=function(t){return f(this._values[t].transition)},$n.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].transition=f(e)||void 0},$n.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var ti=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ti.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ni(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(oi),si=function(t){this.specification=t};si.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Kn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Kn(Math.floor(e.zoom),e)),t.expression.evaluate(new Kn(Math.floor(e.zoom+1),e)),e)}},si.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},si.prototype.interpolate=function(t){return t};var ui=function(t){this.specification=t};ui.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},ui.prototype.interpolate=function(){return!1};var li=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Hn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Wn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Xe("DataDrivenProperty",oi),Xe("DataConstantProperty",ii),Xe("CrossFadedDataDrivenProperty",ai),Xe("CrossFadedProperty",si),Xe("ColorRampProperty",ui);var pi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ei(r.layout)),r.paint)){for(var n in this._transitionablePaint=new $n(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ni(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Ur,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return c(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Rr,"layers."+this.id+".paint."+t,t,e,r))return!1;if(c(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(this,t[i],i,t)&&(n[i]=t[i]);return n}(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&function(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;nthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},fi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(fi);mi.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",mi);var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(fi);vi.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",vi);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(fi);gi.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",gi);var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(fi);xi.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",xi);var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(fi);bi.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",bi);var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p){var c=10*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,this.uint16[c+8]=l,this.uint16[c+9]=p,t},e}(fi);wi.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",wi);var _i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,o,a,s,u,l,p,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=c,this.int16[f+11]=h,t},e}(fi);_i.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",_i);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(fi);Si.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",Si);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(fi);ki.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",ki);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var p=10*t,c=5*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[c+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,t},e}(fi);Ii.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",Ii);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(fi);Ai.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",Ai);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(fi);zi.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zi);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(fi);Mi.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",Mi);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(fi);Pi.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",Pi);var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=o,this.uint32[x+3]=a,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(fi);Ci.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ci);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z){var M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z,M){var P=34*t,C=17*t;return this.int16[P+0]=e,this.int16[P+1]=r,this.int16[P+2]=n,this.int16[P+3]=i,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=u,this.uint16[P+8]=l,this.uint16[P+9]=p,this.uint16[P+10]=c,this.uint16[P+11]=h,this.uint16[P+12]=f,this.uint16[P+13]=y,this.uint16[P+14]=d,this.uint16[P+15]=m,this.uint16[P+16]=v,this.uint16[P+17]=g,this.uint16[P+18]=x,this.uint16[P+19]=b,this.uint16[P+20]=w,this.uint16[P+21]=_,this.uint16[P+22]=S,this.uint32[C+12]=k,this.float32[C+13]=I,this.float32[C+14]=A,this.float32[C+15]=z,this.float32[C+16]=M,t},e}(fi);Bi.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",Bi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(fi);Vi.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",Vi);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(fi);Ti.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",Ti);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(fi);Ei.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Ei);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(fi);Di.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Di);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(fi);Fi.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Fi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(fi);Oi.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",Oi);var Li=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(hi);Li.prototype.size=20;var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Li(this,t)},e}(Ii);Xe("CollisionBoxArray",ji);var qi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(hi);qi.prototype.size=48;var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new qi(this,t)},e}(Ci);Xe("PlacedSymbolArray",Ri);var Ui=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(hi);Ui.prototype.size=68;var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ui(this,t)},e}(Bi);Xe("SymbolInstanceArray",Ni);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Vi);Xe("GlyphOffsetArray",Zi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ti);Xe("SymbolLineVertexArray",Gi);var Xi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(hi);Xi.prototype.size=8;var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Xi(this,t)},e}(Ei);Xe("FeatureIndexArray",Yi);var Ji=yi([{name:"a_pos",components:2,type:"Int16"}],4).members,Ki=function(t){void 0===t&&(t=[]),this.segments=t};function Hi(t,e){return 256*(t=a(Math.floor(t),0,255))+a(Math.floor(e),0,255)}Ki.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Ki.MAX_VERTEX_ARRAY_LENGTH&&d("Max vertices per segment is "+Ki.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ki.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Ki.prototype.get=function(){return this.segments},Ki.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Qi=I((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),to=$i,eo=Qi;to.murmur3=$i,to.murmur2=eo;var ro=function(){this.ids=[],this.positions=[],this.indexed=!1};ro.prototype.add=function(t,e,r,n){this.ids.push(io(t)),this.positions.push(e,r,n)},ro.prototype.getPositions=function(t){for(var e=io(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},ro.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;oo(e,a,s),oo(r,3*a,3*s),oo(r,3*a+1,3*s+1),oo(r,3*a+2,3*s+2)}s-ns.x+1||ls.y+1)&&d("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Io(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ko(t):[]}}function Ao(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var zo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new mi,this.indexArray=new Pi,this.segments=new Ki,this.programConfigurations=new xo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Mo(t,e){for(var r=0;r1){if(Vo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Fo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Oo(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Lo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=m(t,e,r[0]);return o!==m(t,e,r[1])||o!==m(t,e,r[2])||o!==m(t,e,r[3])}function jo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function qo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ro(t,e,n,i,o){if(!e[0]&&!e[1])return t;var a=r.convert(e)._mult(o);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;Ao(this.layoutVertexArray,l,p,-1,-1),Ao(this.layoutVertexArray,l,p,1,-1),Ao(this.layoutVertexArray,l,p,1,1),Ao(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Xe("CircleBucket",zo,{omit:["layers"]});var Uo=new li({"circle-sort-key":new oi(tr.layout_circle["circle-sort-key"])}),No={paint:new li({"circle-radius":new oi(tr.paint_circle["circle-radius"]),"circle-color":new oi(tr.paint_circle["circle-color"]),"circle-blur":new oi(tr.paint_circle["circle-blur"]),"circle-opacity":new oi(tr.paint_circle["circle-opacity"]),"circle-translate":new ii(tr.paint_circle["circle-translate"]),"circle-translate-anchor":new ii(tr.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ii(tr.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ii(tr.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new oi(tr.paint_circle["circle-stroke-width"]),"circle-stroke-color":new oi(tr.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new oi(tr.paint_circle["circle-stroke-opacity"])}),layout:Uo},Zo="undefined"!=typeof Float32Array?Float32Array:Array;function Go(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Xo(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),Yo=new Zo(4),Zo!=Float32Array&&(Yo[0]=0,Yo[1]=0,Yo[2]=0,Yo[3]=0);var Yo,Jo=function(t){function e(e){t.call(this,e,No)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new zo(t)},e.prototype.queryRadius=function(t){var e=t;return jo("circle-radius",this,e)+jo("circle-stroke-width",this,e)+qo(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=Ro(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return Ko(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;ft.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var y=r;yo&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return ha(h,f,r,n,i,l),f}function pa(t,e,r,n,i){var o,a;if(i===Ea(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ba(o,t[o],t[o+1],a);return a&&Ia(a,a.next)&&(Va(a),a=a.next),a}function ca(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ia(n,n.next)&&0!==ka(n.prev,n,n.next))n=n.next;else{if(Va(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ha(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ba(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ya(t,n,i,o):fa(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Va(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?ha(t=da(ca(t),e,r),e,r,n,i,o,2):2===a&&ma(t,e,r,n,i,o):ha(ca(t),e,r,n,i,o,1);break}}}function fa(t){var e=t.prev,r=t,n=t.next;if(ka(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_a(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ka(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ya(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ka(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=ba(i.x=l&&h&&h.z<=p;){if(c!==t.prev&&c!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&ka(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==t.prev&&h!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ka(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=l;){if(c!==t.prev&&c!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&ka(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=p;){if(h!==t.prev&&h!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ka(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function da(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ia(i,o)&&Aa(i,n,n.next,o)&&Pa(i,o)&&Pa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Va(n),Va(n.next),n=t=o),n=n.next}while(n!==t);return ca(n)}function ma(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Sa(a,s)){var u=Ca(a,s);return a=ca(a,a.next),u=ca(u,u.next),ha(a,e,r,n,i,o),void ha(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function va(t,e){return t.x-e.x}function ga(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=p&&i!==n.x&&_a(or.x||n.x===r.x&&xa(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ca(e,t);ca(e,e.next),ca(r,r.next)}}function xa(t,e){return ka(t.prev,t,e.prev)<0&&ka(e.next,t,t.next)<0}function ba(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wa(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Sa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Aa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Pa(t,e)&&Pa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ka(t.prev,t,e.prev)||ka(t,e.prev,e))||Ia(t,e)&&ka(t.prev,t,t.next)>0&&ka(e.prev,e,e.next)>0)}function ka(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ia(t,e){return t.x===e.x&&t.y===e.y}function Aa(t,e,r,n){var i=Ma(ka(t,e,r)),o=Ma(ka(t,e,n)),a=Ma(ka(r,n,t)),s=Ma(ka(r,n,e));return i!==o&&a!==s||!(0!==i||!za(t,r,e))||!(0!==o||!za(t,n,e))||!(0!==a||!za(r,t,n))||!(0!==s||!za(r,e,n))}function za(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ma(t){return t>0?1:t<0?-1:0}function Pa(t,e){return ka(t.prev,t,t.next)<0?ka(t,e,t.next)>=0&&ka(t,t.prev,e)>=0:ka(t,e,t.prev)<0||ka(t,t.next,e)<0}function Ca(t,e){var r=new Ta(t.i,t.x,t.y),n=new Ta(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ba(t,e,r,n){var i=new Ta(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Va(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ta(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ea(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+p)),Math.min(i,Math.floor(r+(a-s)*l/a+p)),o)}var c=e[r],h=n,f=i;for(Fa(e,n,r),o(e[i],c)>0&&Fa(e,n,i);h0;)f--}0===o(e[n],c)?Fa(e,n,f):Fa(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||Oa)}function Fa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Oa(t,e){return te?1:0}function La(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},sa.default=ua;var Ua=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new mi,this.indexArray=new Pi,this.indexArray2=new Di,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.segments2=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ua.prototype.populate=function(t,e,r){this.hasPattern=qa("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Ja.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},Ja.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Ja.types[this.type];function p(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function ts(t,e,r){if(3===t){var n=new Wa(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}$a.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ya(this._pbf,e,this.extent,this._keys,this._values)};var es={VectorTile:function(t,e){this.layers=t.readFields(ts,{},e)},VectorTileFeature:Ya,VectorTileLayer:Wa},rs=es.VectorTileFeature.types,ns=Math.pow(2,13);function is(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ns)+a,i*ns*2,o*ns*2,Math.round(s))}var os=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new gi,this.indexArray=new Pi,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function as(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}os.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=qa("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||V.every((function(t){return t.y<0}))||V.every((function(t){return t.y>8192}))))for(var d=0,m=0;m=1){var g=y[m-1];if(!as(v,g)){c.vertexLength+4>Ki.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var w=c.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+u>Ki.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===rs[t.type]){for(var _=[],S=[],k=c.vertexLength,I=0,A=s;I=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(S&&v>l){var I=p.dist(f);if(I>2*c){var A=p.sub(p.sub(f)._mult(c/I)._round());this.updateDistance(f,A),this.addCurrentVertex(A,d,0,0,h),f=A}}var z=f&&y,M=z?r:s?"butt":n;if(z&&"round"===M&&(wi&&(M="bevel"),"bevel"===M&&(w>2&&(M="flipbevel"),w100)g=m.mult(-1);else{var P=w*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(P*(k?-1:1))}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h)}else if("bevel"===M||"fakeround"===M){var C=-Math.sqrt(w*w-1),B=k?C:0,V=k?0:C;if(f&&this.addCurrentVertex(p,d,B,V,h),"fakeround"===M)for(var T=Math.round(180*_/Math.PI/20),E=1;E2*c){var q=p.add(y.sub(p)._mult(c/j)._round());this.updateDistance(p,q),this.addCurrentVertex(q,m,0,0,h),p=q}}}}},ms.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>ds/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},ms.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(ds-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},ms.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ms.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Xe("LineBucket",ms,{omit:["layers","patternFeatures"]});var vs=new li({"line-cap":new ii(tr.layout_line["line-cap"]),"line-join":new oi(tr.layout_line["line-join"]),"line-miter-limit":new ii(tr.layout_line["line-miter-limit"]),"line-round-limit":new ii(tr.layout_line["line-round-limit"]),"line-sort-key":new oi(tr.layout_line["line-sort-key"])}),gs={paint:new li({"line-opacity":new oi(tr.paint_line["line-opacity"]),"line-color":new oi(tr.paint_line["line-color"]),"line-translate":new ii(tr.paint_line["line-translate"]),"line-translate-anchor":new ii(tr.paint_line["line-translate-anchor"]),"line-width":new oi(tr.paint_line["line-width"]),"line-gap-width":new oi(tr.paint_line["line-gap-width"]),"line-offset":new oi(tr.paint_line["line-offset"]),"line-blur":new oi(tr.paint_line["line-blur"]),"line-dasharray":new si(tr.paint_line["line-dasharray"]),"line-pattern":new ai(tr.paint_line["line-pattern"]),"line-gradient":new ui(tr.paint_line["line-gradient"])}),layout:vs},xs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Kn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(oi))(gs.paint.properties["line-width"].specification);xs.useIntegerZoom=!0;var bs=function(t){function e(e){t.call(this,e,gs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Dt,this.gradientVersion=(this.gradientVersion+1)%o)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=xs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ms(t)},e.prototype.queryRadius=function(t){var e=t,r=ws(jo("line-width",this,e),jo("line-gap-width",this,e)),n=jo("line-offset",this,e);return r/2+Math.abs(n)+qo(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=Ro(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ws(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),p=this.paint.get("line-offset").evaluate(e,n);return p&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var _s=yi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ss=yi([{name:"a_projected_pos",components:3,type:"Float32"}],4),ks=(yi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),yi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Is=(yi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),yi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4));function As(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Jn.applyArabicShaping&&(t=Jn.applyArabicShaping(t)),t}(t.text,e,r)})),t}yi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),yi([{name:"triangle",components:3,type:"Uint16"}]),yi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),yi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),yi([{type:"Float32",name:"offsetX"}]),yi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var zs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ms=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Ps=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},Cs=Bs;function Bs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Bs.Varint=0,Bs.Fixed64=1,Bs.Bytes=2,Bs.Fixed32=5;var Vs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ts(t){return t.type===Bs.Bytes?t.readVarint()+t.pos:t.pos+1}function Es(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ds(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Fs(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ys(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Js(t){for(var e=0,r=0,n=0,i=t;n=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=a.pop();h>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Gs(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ys(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Gs(this.buf,this.pos)+4294967296*Gs(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Gs(this.buf,this.pos)+4294967296*Ys(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ms(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ms(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return Es(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return Es(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Vs?function(t,e,r){return Vs.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Bs.Bytes)return t.push(this.readVarint(e));var r=Ts(this);for(t=t||[];this.pos127;);else if(e===Bs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Bs.Fixed32)this.pos+=4;else{if(e!==Bs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ds(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ps(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ps(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Ds(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Bs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Fs,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Os,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,qs,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ls,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,js,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Us,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ns,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zs,e)},writeBytesField:function(t,e){this.writeTag(t,Bs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Bs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Bs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Bs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ks=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},Hs={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Hs.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Hs.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Hs.tlbr.get=function(){return this.tl.concat(this.br)},Hs.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ks.prototype,Hs);var Ws=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Js(i),a=new ea({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;ea.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var p in e){var c=e[p],h=n[p].paddedRect,f=h.x+1,y=h.y+1,d=c.data.width,m=c.data.height;ea.copy(c.data,a,{x:0,y:0},{x:f,y:y},c.data),ea.copy(c.data,a,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),ea.copy(c.data,a,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),ea.copy(c.data,a,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),ea.copy(c.data,a,{x:0,y:0},{x:f+d,y:y},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};Ws.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new Ks(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Ws.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Ws.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Xe("ImagePosition",Ks),Xe("ImageAtlas",Ws);var $s={horizontal:1,vertical:2,horizontalOnly:3},Qs=function(){this.scale=1,this.fontStack="",this.imageName=null};Qs.forText=function(t,e){var r=new Qs;return r.scale=t||1,r.fontStack=e,r},Qs.forImage=function(t){var e=new Qs;return e.imageName=t,e};var tu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function eu(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m,v=tu.fromFeature(t,i);c===$s.vertical&&v.verticalizePunctuation();var g=Jn.processBidirectionalText,x=Jn.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,w=g(v.toString(),uu(v,l,o,e,n,f,y));b0&&L>I&&(I=L)}else{var j=r[z.fontStack],q=j&&j[P];if(q&&q.rect)V=q.rect,B=q.metrics;else{var R=e[z.fontStack],U=R&&R[P];if(!U)continue;B=U.metrics}C=24*(w-z.scale)}D?(t.verticalizable=!0,k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=E*z.scale+l):(k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=B.advance*z.scale+l)}0!==k.length&&(y=Math.max(h-l,y),pu(k,0,k.length-1,m,I)),h=0;var N=o*w+I;S.lineOffset=Math.max(I,_),f+=N,d=Math.max(N,d),++v}else f+=o,++v}var Z,G=f- -17,X=lu(a),Y=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,p=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var c=0,h=t;c=0&&n>=t&&ru[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},tu.prototype.substring=function(t,e){var r=new tu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},tu.prototype.toString=function(){return this.text},tu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},tu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Qs.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var ru={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},nu={};function iu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function ou(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,c=0,h=0;h-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(c)}return!0}function du(t){for(var e=0,r=0;rl){var y=(l-u)/f,d=Ft(c.x,h.x,y),m=Ft(c.y,h.y,y),v=new hu(d,m,h.angleTo(c),p);return v._round(),!a||yu(t,v,s,a,e)?v:void 0}u+=f}}function xu(t,e,r,n,i,o,a,s,u){var l=mu(n,o,a),p=vu(n,i),c=p*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c=0&&w=0&&_=0&&f+p<=c){var S=new hu(w,_,x,d);S._round(),i&&!yu(e,S,a,i,o)||y.push(S)}}h+=g}return u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l)),y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}function bu(t,e,n,i){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=h.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,w=0,_=m,S=0,k=v,I=0,A=g;if(a.content&&i){var z=a.content;x=wu(h,0,z[0]),w=wu(f,0,z[1]),b=wu(h,z[0],z[2]),_=wu(f,z[1],z[3]),S=z[0]-x,I=z[1]-w,k=z[2]-z[0]-b,A=z[3]-z[1]-_}var M=function(i,o,u,l){var h=Su(i.stretch-x,b,p,t.left),f=ku(i.fixed-S,k,i.stretch,d),y=Su(o.stretch-w,_,c,t.top),v=ku(o.fixed-I,A,o.stretch,m),g=Su(u.stretch-x,b,p,t.left),z=ku(u.fixed-S,k,u.stretch,d),M=Su(l.stretch-w,_,c,t.top),P=ku(l.fixed-I,A,l.stretch,m),C=new r(h,y),B=new r(g,y),V=new r(g,M),T=new r(h,M),E=new r(f/s,v/s),D=new r(z/s,P/s),F=e*Math.PI/180;if(F){var O=Math.sin(F),L=Math.cos(F),j=[L,-O,O,L];C._matMult(j),B._matMult(j),T._matMult(j),V._matMult(j)}var q=i.stretch+i.fixed,R=o.stretch+o.fixed;return{tl:C,tr:B,bl:T,br:V,tex:{x:a.paddedRect.x+1+q,y:a.paddedRect.y+1+R,w:u.stretch+u.fixed-q,h:l.stretch+l.fixed-R},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:E,pixelOffsetBR:D,minFontScaleX:k/s/p,minFontScaleY:A/s/c,isSDF:n}};if(i&&(a.stretchX||a.stretchY))for(var P=_u(h,v,d),C=_u(f,g,m),B=0;B0&&(y=Math.max(10,y),this.circleDiameter=y)}else{var d=a.top*s-u,m=a.bottom*s+u,v=a.left*s-u,g=a.right*s+u,x=a.collisionPadding;if(x&&(v-=x[0]*s,d-=x[1]*s,g+=x[2]*s,m+=x[3]*s),p){var b=new r(v,d),w=new r(g,d),_=new r(v,m),S=new r(g,m),k=p*Math.PI/180;b._rotate(k),w._rotate(k),_._rotate(k),S._rotate(k),v=Math.min(b.x,w.x,_.x,S.x),g=Math.max(b.x,w.x,_.x,S.x),d=Math.min(b.y,w.y,_.y,S.y),m=Math.max(b.y,w.y,_.y,S.y)}t.emplaceBack(e.x,e.y,v,d,g,m,n,i,o)}this.boxEndIndex=t.length},Au=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=zu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function zu(t,e){return te?1:0}function Mu(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=Math.min(a-i,s-o),h=c/2,f=new Au([],Pu);if(0===c)return new r(i,o);for(var y=i;ym.d||!m.d)&&(m=g,n&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Cu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Cu(g.p.x+h,g.p.y-h,h,t)),f.push(new Cu(g.p.x-h,g.p.y+h,h,t)),f.push(new Cu(g.p.x+h,g.p.y+h,h,t)),v+=4)}return n&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Pu(t,e){return e.max-t.max}function Cu(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,Do(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}Au.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Au.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Au.prototype.peek=function(){return this.data[0]},Au.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},Au.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var Bu=Number.POSITIVE_INFINITY;function Vu(t,e,n,i,o,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Kn(c.minZoom),s),l["text-size"].possiblyEvaluate(new Kn(h),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,y=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Kn(f.minZoom),s),l["icon-size"].possiblyEvaluate(new Kn(y),s)]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Kn(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Kn(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new Kn(18));for(var m=24*u.get("text-line-height"),v="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),g=u.get("text-keep-upright"),x=u.get("text-size"),b=function(){var a,l,c=_[w],h=u.get("text-font").evaluate(c,{},s).join(","),f=x.evaluate(c,{},s),y=p.layoutTextSize.evaluate(c,{},s),b=p.layoutIconSize.evaluate(c,{},s),S={horizontal:{},vertical:void 0},k=c.text,I=[0,0];if(k){var A=k.toString(),z=24*u.get("text-letter-spacing").evaluate(c,{},s),M=function(t){for(var e=0,r=t;e=8192||u.y<0||u.y>=8192||function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,m,v,g,x,b,w,_,S,k,I){var A,z,M,P,C,B=t.addToLineVertexArray(e,r),V=0,T=0,E=0,D=0,F=-1,O=-1,L={},j=to(""),q=0,R=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(q=(A=s.layout.get("text-offset").evaluate(w,{},k).map((function(t){return 24*t})))[0],R=A[1]):(q=24*s.layout.get("text-radial-offset").evaluate(w,{},k),R=Bu),t.allowVerticalPlacement&&n.vertical){var U=s.layout.get("text-rotate").evaluate(w,{},k)+90;P=new Iu(u,e,l,p,c,n.vertical,h,f,y,U),a&&(C=new Iu(u,e,l,p,c,a,v,g,y,U))}if(i){var N=s.layout.get("icon-rotate").evaluate(w,{}),Z="none"!==s.layout.get("icon-text-fit"),G=bu(i,N,S,Z),X=a?bu(a,N,S,Z):void 0;M=new Iu(u,e,l,p,c,i,v,g,!1,N),V=4*G.length;var Y=t.iconSizeData,J=null;"source"===Y.kind?(J=[128*s.layout.get("icon-size").evaluate(w,{})])[0]>32640&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((J=[128*_.compositeIconSizes[0].evaluate(w,{},k),128*_.compositeIconSizes[1].evaluate(w,{},k)])[0]>32640||J[1]>32640)&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,J,b,x,w,!1,e,B.lineStartIndex,B.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1,X&&(T=4*X.length,t.addSymbols(t.icon,X,J,b,x,w,$s.vertical,e,B.lineStartIndex,B.lineLength,-1,k),O=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var H=n.horizontal[K];if(!z){j=to(H.text);var W=s.layout.get("text-rotate").evaluate(w,{},k);z=new Iu(u,e,l,p,c,H,h,f,y,W)}var $=1===H.positionedLines.length;if(E+=Eu(t,e,H,o,s,y,w,m,B,n.vertical?$s.horizontal:$s.horizontalOnly,$?Object.keys(n.horizontal):[K],L,F,_,k),$)break}n.vertical&&(D+=Eu(t,e,n.vertical,o,s,y,w,m,B,$s.vertical,["vertical"],L,O,_,k));var Q=z?z.boxStartIndex:t.collisionBoxArray.length,tt=z?z.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(z,st),st=ut(P,st),st=ut(M,st);var lt=(st=ut(C,st))>-1?1:0;lt&&(st*=I/24),t.glyphOffsetArray.length>=Zu.MAX_GLYPHS&&d("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,F,O,j,Q,tt,et,rt,nt,it,ot,at,l,E,D,V,T,lt,0,h,q,R,st)}(t,u,r,n,i,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,S,A,l,w,k,z,m,e,a,p,c,s)};if("line"===M)for(var V=0,T=function(t,e,n,i,o){for(var a=[],s=0;s=i&&h.x>=i||(c.x>=i?c=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=i&&(h=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round():h.y>=o&&(h=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round()),l&&c.equals(l[l.length-1])||a.push(l=[c]),l.push(h)))))}return a}(e.geometry,0,0,8192,8192);V1){var R=gu(q,I,n.vertical||v,i,24,b);R&&B(q,R)}}else if("Polygon"===e.type)for(var U=0,N=La(e.geometry,0);U32640&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((x=[128*y.compositeTextSizes[0].evaluate(s,{},m),128*y.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||x[1]>32640)&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,v,x,u,a,s,p,e,l.lineStartIndex,l.lineLength,f,m);for(var b=0,w=c;b=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=i.get("symbol-sort-key");if(this.features=[],u||l){for(var c=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,y=new Kn(this.zoom),d=0,m=t;d=0;for(var V=0,T=k.sections;V=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u0},Zu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Zu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Zu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Zu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Zu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",Zu,{omit:["layers","collisionBoxArray","features","compareText"]}),Zu.MAX_GLYPHS=65535,Zu.addDynamicAttributes=qu;var Gu=new li({"symbol-placement":new ii(tr.layout_symbol["symbol-placement"]),"symbol-spacing":new ii(tr.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ii(tr.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new oi(tr.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ii(tr.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ii(tr.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ii(tr.layout_symbol["icon-ignore-placement"]),"icon-optional":new ii(tr.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ii(tr.layout_symbol["icon-rotation-alignment"]),"icon-size":new oi(tr.layout_symbol["icon-size"]),"icon-text-fit":new ii(tr.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ii(tr.layout_symbol["icon-text-fit-padding"]),"icon-image":new oi(tr.layout_symbol["icon-image"]),"icon-rotate":new oi(tr.layout_symbol["icon-rotate"]),"icon-padding":new ii(tr.layout_symbol["icon-padding"]),"icon-keep-upright":new ii(tr.layout_symbol["icon-keep-upright"]),"icon-offset":new oi(tr.layout_symbol["icon-offset"]),"icon-anchor":new oi(tr.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ii(tr.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ii(tr.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ii(tr.layout_symbol["text-rotation-alignment"]),"text-field":new oi(tr.layout_symbol["text-field"]),"text-font":new oi(tr.layout_symbol["text-font"]),"text-size":new oi(tr.layout_symbol["text-size"]),"text-max-width":new oi(tr.layout_symbol["text-max-width"]),"text-line-height":new ii(tr.layout_symbol["text-line-height"]),"text-letter-spacing":new oi(tr.layout_symbol["text-letter-spacing"]),"text-justify":new oi(tr.layout_symbol["text-justify"]),"text-radial-offset":new oi(tr.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ii(tr.layout_symbol["text-variable-anchor"]),"text-anchor":new oi(tr.layout_symbol["text-anchor"]),"text-max-angle":new ii(tr.layout_symbol["text-max-angle"]),"text-writing-mode":new ii(tr.layout_symbol["text-writing-mode"]),"text-rotate":new oi(tr.layout_symbol["text-rotate"]),"text-padding":new ii(tr.layout_symbol["text-padding"]),"text-keep-upright":new ii(tr.layout_symbol["text-keep-upright"]),"text-transform":new oi(tr.layout_symbol["text-transform"]),"text-offset":new oi(tr.layout_symbol["text-offset"]),"text-allow-overlap":new ii(tr.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ii(tr.layout_symbol["text-ignore-placement"]),"text-optional":new ii(tr.layout_symbol["text-optional"])}),Xu={paint:new li({"icon-opacity":new oi(tr.paint_symbol["icon-opacity"]),"icon-color":new oi(tr.paint_symbol["icon-color"]),"icon-halo-color":new oi(tr.paint_symbol["icon-halo-color"]),"icon-halo-width":new oi(tr.paint_symbol["icon-halo-width"]),"icon-halo-blur":new oi(tr.paint_symbol["icon-halo-blur"]),"icon-translate":new ii(tr.paint_symbol["icon-translate"]),"icon-translate-anchor":new ii(tr.paint_symbol["icon-translate-anchor"]),"text-opacity":new oi(tr.paint_symbol["text-opacity"]),"text-color":new oi(tr.paint_symbol["text-color"],{runtimeType:D,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new oi(tr.paint_symbol["text-halo-color"]),"text-halo-width":new oi(tr.paint_symbol["text-halo-width"]),"text-halo-blur":new oi(tr.paint_symbol["text-halo-blur"]),"text-translate":new ii(tr.paint_symbol["text-translate"]),"text-translate-anchor":new ii(tr.paint_symbol["text-translate-anchor"])}),layout:Gu},Yu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:B,this.defaultValue=t};Yu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Yu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Yu.prototype.outputDefined=function(){return!1},Yu.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Yu,{omit:["defaultValue"]});var Ju=function(t){function e(e){t.call(this,e,Xu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;othis._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},pl.convert=function(t){return!t||t instanceof pl?t:new pl(t)};var cl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};cl.prototype.wrap=function(){return new cl(-180==(t=((this.lng- -180)%360+360)%360-180)?180:t,this.lat);var t},cl.prototype.toArray=function(){return[this.lng,this.lat]},cl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},cl.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},cl.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new pl(new cl(this.lng-r,this.lat-e),new cl(this.lng+r,this.lat+e))},cl.convert=function(t){if(t instanceof cl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new cl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new cl(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var hl=2*Math.PI*6371008.8;function fl(t){return hl*Math.cos(t*Math.PI/180)}function yl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var dl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};dl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=cl.convert(t);return new dl((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,function(t,e){return t/fl(e)}(e,r.lat))},dl.prototype.toLngLat=function(){return new cl(360*this.x-180,yl(this.y))},dl.prototype.toAltitude=function(){return this.z*fl(yl(this.y))},dl.prototype.meterInMercatorCoordinateUnits=function(){return 1/hl*(t=yl(this.y),1/Math.cos(t*Math.PI/180));var t};var ml=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=xl(0,t,t,e,r)};ml.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ml.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=ll(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=ll(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new gl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},gl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?xl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):xl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},gl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},gl.prototype.children=function(t){if(this.overscaledZ>=t)return[new gl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new gl(e,this.wrap,e,r,n),new gl(e,this.wrap,e,r+1,n),new gl(e,this.wrap,e,r,n+1),new gl(e,this.wrap,e,r+1,n+1)]},gl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},bl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new es.VectorTile(new Cs(this.rawTileData)).layers,this.sourceLayerCoder=new al(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},bl.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=fr(a.filter),l=t.queryGeometry,p=t.queryPadding*s,c=_l(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=_l(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-p,f.minY-p,f.maxX+p,f.maxY+p,(function(e,n,i,o){return function(t,e,n,i,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var p=0,c=l;p=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),y=this.vtLayers[f].feature(n);if(i.needGeometry){var d=Io(y,!0);if(!i.filter(new Kn(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!i.filter(new Kn(this.tileID.overscaledZ),y))return;for(var m=this.getId(y,f),v=0;v=M.maxzoom||"none"!==M.visibility&&(Al(z,this.zoom,r),(y[M.id]=M.createBucket({index:u.bucketLayerIDs.length,layers:z,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(w,m,this.tileID.canonical),u.bucketLayerIDs.push(z.map((function(t){return t.id}))))}}}var P=h(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?n.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){l||(l=t,p=e,V.call(o))})):p={};var C=Object.keys(m.iconDependencies);C.length?n.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){l||(l=t,c=e,V.call(o))})):c={};var B=Object.keys(m.patternDependencies);function V(){if(l)return i(l);if(p&&c&&f){var t=new kl(p),e=new Ws(c,f);for(var n in y){var o=y[n];o instanceof Zu?(Al(o.layers,this.zoom,r),Vu(o,p,t.positions,c,e.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):o.hasPattern&&(o instanceof ms||o instanceof Ua||o instanceof os)&&(Al(o.layers,this.zoom,r),o.addFeatures(m,this.tileID.canonical,e.patternPositions))}this.status="done",i(null,{buckets:s(y).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null})}}B.length?n.send("getImages",{icons:B,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){l||(l=t,f=e,V.call(o))})):f={},V.call(this)};var zl=i.performance,Ml=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},zl.mark(this._marks.start)};function Pl(t,e){var r=function(t,e){return Zn(u(t,{type:"arrayBuffer"}),e)}(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new es.VectorTile(new Cs(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Ml.prototype.finish=function(){zl.mark(this._marks.end);var t=zl.getEntriesByName(this._marks.measure);return 0===t.length&&(zl.measure(this._marks.measure,this._marks.start,this._marks.end),t=zl.getEntriesByName(this._marks.measure),zl.clearMarks(this._marks.start),zl.clearMarks(this._marks.end),zl.clearMeasures(this._marks.measure)),t};var Cl=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||Pl,this.loading={},this.loaded={}};Cl.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Ml(t.request),o=this.loading[n]=new Il(t);o.abort=this.loadVectorData(t,(function(t,a){if(delete r.loading[n],t||!a)return o.status="done",r.loaded[n]=o,e(t);var s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=a.vectorTile,o.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,u({rawTileData:s.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Cl.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},Cl.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},Cl.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Bl=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return d('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Bl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bl.prototype.getPixels=function(){return new ea({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bl.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l=0!=!!e&&t.reverse()}Tl.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=Vl&&i instanceof Vl?this.getImageData(i):i,a=new Bl(r,o,n);this.loaded=this.loaded||{},this.loaded[r]=a,e(null,a)},Tl.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var e=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new ea({width:e.width,height:e.height},e.data)},Tl.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Fl=es.VectorTileFeature.prototype.toGeoJSON,Ol=function(t){this._feature=t,this.extent=8192,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};Ol.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,n=this._feature.geometry;e>31}function Wl(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(s-p)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*p/s+c)),Math.min(o,Math.floor(n+(s-u)*p/s+c)),a)}var h=r[2*n+a],f=i,y=o;for(Ql(e,r,i,n),r[2*o+a]>h&&Ql(e,r,i,o);fh;)y--}r[2*i+a]===h?Ql(e,r,i,y):Ql(e,r,++y,o),y<=n&&(i=y+1),n<=y&&(o=y-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};ip.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],p=[];l.length;){var c=l.pop(),h=l.pop(),f=l.pop();if(h-f<=a)for(var y=f;y<=h;y++)u=e[2*y+1],(s=e[2*y])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[d]);var m=(c+1)%2;(0===c?r<=s:n<=u)&&(l.push(f),l.push(d-1),l.push(m)),(0===c?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(m))}}return p}(this.ids,this.coords,t,e,r,n,this.nodeSize)},ip.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),p=a.pop(),c=a.pop();if(p-c<=o)for(var h=c;h<=p;h++)ep(e[2*h],e[2*h+1],r,n)<=u&&s.push(t[h]);else{var f=Math.floor((c+p)/2),y=e[2*f],d=e[2*f+1];ep(y,d,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=y:n-i<=d)&&(a.push(c),a.push(f-1),a.push(m)),(0===l?r+i>=y:n+i>=d)&&(a.push(f+1),a.push(p),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var op={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},ap=function(t){this.options=fp(Object.create(op),t),this.trees=new Array(this.options.maxZoom+1)};function sp(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function up(t,e){var r=t.geometry.coordinates,n=r[1];return{x:cp(r[0]),y:hp(n),zoom:1/0,index:e,parentId:-1}}function lp(t){return{type:"Feature",id:t.id,properties:pp(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function pp(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return fp(fp({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function cp(t){return t/360+.5}function hp(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fp(t,e){for(var r in e)t[r]=e[r];return t}function yp(t){return t.x}function dp(t){return t.y}function mp(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function vp(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)gp(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var p=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],c=e[n],h=e[n+1],f=r+3;fa)o=f,a=y;else if(y===a){var d=Math.abs(f-s);di&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function _p(t,e,r,n){for(var i=0;i1?1:r}function Ip(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&y=n)){var d=[];if("Point"===h||"MultiPoint"===h)Ap(c,d,r,n,i);else if("LineString"===h)zp(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)Pp(c,d,r,n,i,!1);else if("Polygon"===h)Pp(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function zp(t,e,r,n,i,o,a){for(var s,u,l=Mp(t),p=0===i?Bp:Vp,c=t.start,h=0;hr&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!o&&b&&(a&&(l.end=c+s*u),e.push(l),l=Mp(t)),a&&(c+=s)}var w=t.length-3;f=t[w],y=t[w+1],d=t[w+2],(g=0===i?f:y)>=r&&g<=n&&Cp(l,f,y,d),w=l.length-3,o&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&Cp(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Mp(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Pp(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function Lp(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new ip(s,yp,dp,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},ap.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],p=0,c=u.range(cp(r),hp(o),cp(i),hp(n));pe&&(h+=d.numPoints||1)}if(h>=o){for(var m=u.x*c,v=u.y*c,g=i&&c>1?this._map(u,!0):null,x=(s<<5)+(e+1)+this.points.length,b=0,w=p;b1)for(var k=0,I=p;k>5},ap.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},ap.prototype._map=function(t,e){if(t.numPoints)return e?fp({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?fp({},n):n},qp.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},qp.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<1&&console.time("creation"),h=this.tiles[c]=Op(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===u.maxZoom||e===i)continue;var y=1<1&&console.time("clipping");var d,m,v,g,x,b,w=.5*u.buffer/u.extent,_=.5-w,S=.5+w,k=1+w;d=m=v=g=null,x=Ip(t,p,r-w,r+S,0,h.minX,h.maxX,u),b=Ip(t,p,r+_,r+k,0,h.minX,h.maxX,u),t=null,x&&(d=Ip(x,p,n-w,n+S,1,h.minY,h.maxY,u),m=Ip(x,p,n+_,n+k,1,h.minY,h.maxY,u),x=null),b&&(v=Ip(b,p,n-w,n+S,1,h.minY,h.maxY,u),g=Ip(b,p,n+_,n+k,1,h.minY,h.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},qp.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,c=r;!u&&l>0;)l--,p=Math.floor(p/2),c=Math.floor(c/2),u=this.tiles[Rp(l,p,c)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,p,c),o>1&&console.time("drilling down"),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Dp(this.tiles[s],i):null):null};var Np=function(t){function e(e,r,n,i){t.call(this,e,r,n,Up),i&&(this.loadGeoJSON=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},e.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new Ml(r.request);this.loadGeoJSON(r,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n (
- // eslint-disable-next-line react/jsx-props-no-spreading
{meta.value}
);
APIKey.propTypes = {
- // eslint-disable-next-line react/forbid-prop-types
- meta: PropTypes.object,
+ meta: PropTypes.shape({
+ value: PropTypes.string,
+ name: PropTypes.string,
+ }),
};
APIKey.defaultProps = {
diff --git a/src/components/StageEditor/Interfaces.js b/src/components/StageEditor/Interfaces.js
index 7380828cf..805c6ce05 100644
--- a/src/components/StageEditor/Interfaces.js
+++ b/src/components/StageEditor/Interfaces.js
@@ -28,6 +28,7 @@ import {
TieStrengthCensusPrompts,
Title,
MapOptions,
+ MapSelection,
GeospatialPrompts,
} from '@components/sections';
import { FilteredNodeType } from '@components/sections/NodeType';
@@ -195,6 +196,7 @@ const Geospatial = {
sections: [
NodeType,
MapOptions,
+ MapSelection,
GeospatialPrompts,
],
documentation: 'https://documentation.networkcanvas.com/interface-documentation/tie-strength-census/', // TODO
diff --git a/src/components/enhancers/withDisabledAPIKeyRequired.js b/src/components/enhancers/withDisabledAPIKeyRequired.js
new file mode 100644
index 000000000..72424f20a
--- /dev/null
+++ b/src/components/enhancers/withDisabledAPIKeyRequired.js
@@ -0,0 +1,8 @@
+import { withProps } from 'recompose';
+
+const withDisabledAPIKeyRequired = withProps(({ mapOptions }) => {
+ const tokenAssetId = mapOptions && mapOptions.tokenAssetId;
+ return { disabled: !tokenAssetId };
+});
+
+export default withDisabledAPIKeyRequired;
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 65d6112f1..0c4c2cb16 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -2,11 +2,9 @@ import React from 'react';
import PropTypes from 'prop-types';
import { compose } from 'recompose';
-import * as Fields from '@codaco/ui/lib/components/Fields';
import NativeSelect from '@components/Form/Fields/NativeSelect';
import withMapFormToProps from '@components/enhancers/withMapFormToProps';
-import Tip from '@components/Tip';
import { Section, Row } from '../EditorLayout';
import ValidatedField from '../Form/ValidatedField';
@@ -89,52 +87,6 @@ const MapOptions = (props) => {
label="Which color would you like to use for this stage's map outlines and selections?"
/>
-
- When the map is first loaded, it will be centered at the initial center and zoom level
- configured here.
-
- )}
- >
-
-
-
- The initial center is in longitude, latitude format.
- We recommend using the longitude and latitude of the center of the area you
- want to show, such as a city or region.
-
-
-
-
-
-
-
-
- The zoom level controls how much of the map is initially visible. Higher levels show
- more detail, while lower levels show a broader area. The zoom level can be a number
- between 0 and 22.
-
-
-
-
- parseInt(value, 10) || value}
- validation={{ required: false, positiveNumber: true, maxValue: 22 }}
- />
-
>
);
@@ -142,7 +94,7 @@ const MapOptions = (props) => {
MapOptions.defaultProps = {
mapOptions: {
center: [0, 0],
- token: '',
+ tokenAssetId: '',
initialZoom: 0,
dataSourceAssetId: '',
color: '',
@@ -153,7 +105,7 @@ MapOptions.defaultProps = {
MapOptions.propTypes = {
mapOptions: PropTypes.shape({
center: PropTypes.arrayOf(PropTypes.number),
- token: PropTypes.string,
+ tokenAssetId: PropTypes.string,
initialZoom: PropTypes.number,
dataSourceAssetId: PropTypes.string,
color: PropTypes.string,
diff --git a/src/components/sections/MapSelection.js b/src/components/sections/MapSelection.js
new file mode 100644
index 000000000..2d47a0c3c
--- /dev/null
+++ b/src/components/sections/MapSelection.js
@@ -0,0 +1,133 @@
+import React, { useEffect, useRef, useState } from 'react';
+import PropTypes from 'prop-types';
+import { compose } from 'recompose';
+import withDisabledAPIKeyRequired from '@components/enhancers/withDisabledAPIKeyRequired';
+import mapboxgl from 'mapbox-gl';
+import { useSelector, useDispatch } from 'react-redux';
+import { change } from 'redux-form';
+import { get } from 'lodash';
+import { getAssetManifest } from '@selectors/protocol';
+import { Section } from '../EditorLayout';
+import withMapFormToProps from '../enhancers/withMapFormToProps';
+import 'mapbox-gl/dist/mapbox-gl.css';
+
+const MapSelection = ({
+ mapOptions,
+ disabled,
+ form,
+}) => {
+ const { tokenAssetId } = mapOptions;
+ const assetManifest = useSelector(getAssetManifest);
+ const mapboxAPIKey = get(assetManifest, [tokenAssetId, 'value'], '');
+ const dispatch = useDispatch();
+
+ const mapRef = useRef(null);
+ const mapContainerRef = useRef(null);
+
+ const [center, setCenter] = useState(mapOptions.center || [0, 0]);
+ const [zoom, setZoom] = useState(mapOptions.initialZoom || 0);
+
+ // test dispatch
+
+ useEffect(() => {
+ // Set the worker URL for strict CSP environments
+ // https://docs.mapbox.com/mapbox-gl-js/guides/browsers-and-testing/#strict-csp-environments
+ // note: need the v1 version of the worker
+ mapboxgl.workerUrl = '/mapbox-gl-csp-worker.js';
+
+ if (!mapboxAPIKey) {
+ return;
+ }
+
+ // Initialize the Mapbox map
+ mapboxgl.accessToken = mapboxAPIKey;
+ mapRef.current = new mapboxgl.Map({
+ container: mapContainerRef.current,
+ style: 'mapbox://styles/mapbox/streets-v11',
+ center,
+ zoom,
+ });
+
+ mapRef.current.on('move', () => {
+ // get the current center coordinates and zoom level from the map
+ const mapCenter = mapRef.current.getCenter();
+ const mapZoom = mapRef.current.getZoom();
+
+ setCenter([mapCenter.lng, mapCenter.lat]);
+
+ setZoom(mapZoom);
+ });
+
+ // Cleanup the map on component unmount
+ return () => {
+ mapRef.current.remove();
+ };
+ }, [mapOptions]);
+
+ return (
+
+ When the map is first loaded, it will be centered at the initial center and zoom level
+ configured here. Resetting the map will return it to this view.
+
+ )}
+ disabled={disabled}
+ >
+
+ Longitude:
+ {' '}
+ {center[0].toFixed(4)}
+ {' '}
+ | Latitude:
+ {' '}
+ {center[1].toFixed(4)}
+ {' '}
+ | Zoom:
+ {' '}
+ {zoom.toFixed(2)}
+
+
+
+ );
+};
+
+MapSelection.defaultProps = {
+ mapOptions: {
+ center: [0, 0],
+ toketokenAssetIdn: '',
+ initialZoom: 0,
+ dataSourceAssetId: '',
+ color: '',
+ targetFeatureProperty: '',
+ },
+ meta: PropTypes.shape({
+ value: PropTypes.string,
+ name: PropTypes.string,
+ }),
+};
+
+MapSelection.propTypes = {
+ mapOptions: PropTypes.shape({
+ center: PropTypes.arrayOf(PropTypes.number),
+ initialZoom: PropTypes.number,
+ dataSourceAssetId: PropTypes.string,
+ color: PropTypes.string,
+ targetFeatureProperty: PropTypes.string,
+ tokenAssetId: PropTypes.string,
+ }),
+ disabled: PropTypes.bool.isRequired,
+ meta: PropTypes.shape({
+ value: PropTypes.string,
+ name: PropTypes.string,
+ }),
+};
+
+export default compose(
+ withMapFormToProps('mapOptions'),
+ withDisabledAPIKeyRequired,
+)(MapSelection);
diff --git a/src/components/sections/index.js b/src/components/sections/index.js
index 32d71cec6..b928765cc 100644
--- a/src/components/sections/index.js
+++ b/src/components/sections/index.js
@@ -26,4 +26,5 @@ export { default as SkipLogic } from './SkipLogic';
export { default as Title } from './Title';
export { default as InterviewScript } from './InterviewScript';
export { default as MapOptions } from './MapOptions';
+export { default as MapSelection } from './MapSelection';
export { default as GeospatialPrompts } from './GeospatialPrompts/GeospatialPrompts';
From 558ff601344bc48e90adb4b6a6016f21f9f75832 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Wed, 15 Jan 2025 15:08:10 -0800
Subject: [PATCH 21/32] fix connect-src, rm unused stuff
---
public/index.html | 2 +-
src/components/sections/MapSelection.js | 5 +----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/public/index.html b/public/index.html
index be243d311..95b4684cf 100644
--- a/public/index.html
+++ b/public/index.html
@@ -6,7 +6,7 @@
http-equiv="Content-Security-Policy"
content="
default-src 'self';
- connect-src 'self' https://api.github.com:* http://localhost:* https://localhost:* https://documentation.networkcanvas.com:* https://assets.networkcanvas.com:* https://api.mapbox.com:* https://events.mapbox.com:* ws://*:* wss://*:* %REACT_APP_CONNECT_SRC_CSP%;
+ connect-src 'self' https://api.github.com:* http://localhost:* https://localhost:* https://documentation.networkcanvas.com:* https://assets.networkcanvas.com:* https://api.mapbox.com:* https://events.mapbox.com:* ws://*:* %REACT_APP_CONNECT_SRC_CSP%;
script-src 'self' %REACT_APP_SCRIPT_SRC_CSP%;
style-src 'self' 'unsafe-inline';
media-src 'self' data: protocol: asset:;
diff --git a/src/components/sections/MapSelection.js b/src/components/sections/MapSelection.js
index 2d47a0c3c..dcb0d312f 100644
--- a/src/components/sections/MapSelection.js
+++ b/src/components/sections/MapSelection.js
@@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
import { compose } from 'recompose';
import withDisabledAPIKeyRequired from '@components/enhancers/withDisabledAPIKeyRequired';
import mapboxgl from 'mapbox-gl';
-import { useSelector, useDispatch } from 'react-redux';
-import { change } from 'redux-form';
+import { useSelector } from 'react-redux';
import { get } from 'lodash';
import { getAssetManifest } from '@selectors/protocol';
import { Section } from '../EditorLayout';
@@ -14,12 +13,10 @@ import 'mapbox-gl/dist/mapbox-gl.css';
const MapSelection = ({
mapOptions,
disabled,
- form,
}) => {
const { tokenAssetId } = mapOptions;
const assetManifest = useSelector(getAssetManifest);
const mapboxAPIKey = get(assetManifest, [tokenAssetId, 'value'], '');
- const dispatch = useDispatch();
const mapRef = useRef(null);
const mapContainerRef = useRef(null);
From 03e524e2efbec5a7bdd2f87dc52da3b510b5b9ca Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 07:21:39 -0800
Subject: [PATCH 22/32] fix csp to use simpler, not strict setup
---
public/index.html | 12 +++++++-----
public/mapbox-gl-csp-worker.js | 2 --
src/components/sections/MapSelection.js | 7 +------
3 files changed, 8 insertions(+), 13 deletions(-)
delete mode 100644 public/mapbox-gl-csp-worker.js
diff --git a/public/index.html b/public/index.html
index 95b4684cf..06c9e8886 100644
--- a/public/index.html
+++ b/public/index.html
@@ -6,11 +6,13 @@
http-equiv="Content-Security-Policy"
content="
default-src 'self';
- connect-src 'self' https://api.github.com:* http://localhost:* https://localhost:* https://documentation.networkcanvas.com:* https://assets.networkcanvas.com:* https://api.mapbox.com:* https://events.mapbox.com:* ws://*:* %REACT_APP_CONNECT_SRC_CSP%;
- script-src 'self' %REACT_APP_SCRIPT_SRC_CSP%;
- style-src 'self' 'unsafe-inline';
- media-src 'self' data: protocol: asset:;
- img-src 'self' data: protocol: asset:;
+ worker-src blob: ;
+ child-src blob: ;
+ connect-src 'self' https://api.github.com:* http://localhost:* https://localhost:* https://documentation.networkcanvas.com:* https://assets.networkcanvas.com:* https://*.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com %REACT_APP_CONNECT_SRC_CSP% ;
+ script-src 'self' %REACT_APP_SCRIPT_SRC_CSP% ;
+ style-src 'self' 'unsafe-inline' ;
+ media-src 'self' data: protocol: asset: ;
+ img-src 'self' data: blob: protocol: asset: ;
"
/>
diff --git a/public/mapbox-gl-csp-worker.js b/public/mapbox-gl-csp-worker.js
deleted file mode 100644
index 965a51997..000000000
--- a/public/mapbox-gl-csp-worker.js
+++ /dev/null
@@ -1,2 +0,0 @@
-var mapboxgl=function(){"use strict";var t=e;function e(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},e.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=n;function n(t,e){this.x=t,this.y=e}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var i="undefined"!=typeof self?self:{},o=Math.pow(2,53)-1;function a(t,e,r){return Math.min(r,Math.max(e,t))}function s(t){var e=[];for(var r in t)e.push(t[r]);return e}function u(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function p(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function c(t,e){return-1!==t.indexOf(e,t.length-e.length)}function h(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function f(t){return Array.isArray(t)?t.map(f):"object"==typeof t&&t?h(t,f):t}var y={};function d(t){y[t]||("undefined"!=typeof console&&console.warn(t),y[t]=!0)}function m(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function v(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var b=null;function w(t){if(null==b){var e=t.navigator?t.navigator.userAgent:null;b=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return b}function _(t){try{var e=i[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var S=k;function k(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(var o=0;o=p[f+0]&&n>=p[f+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},k.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,o,a,s))return}},k.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},k.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},k.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var p=s.substr(0,u),c=s.substr(u+1,l-(u+1)).split(","),h=1;switch(p){case"rgba":if(4!==c.length)return null;h=o(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),h];case"hsla":if(4!==c.length)return null;h=o(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=o(c[1]),d=o(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return[n(255*a(v,m,f+1/3)),n(255*a(v,m,f)),n(255*a(v,m,f-1/3)),h];default:return null}}return null}}catch(t){}})).parseCSSColor,z=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function M(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var N=[B,V,T,E,D,j,F,R(O),q];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=N;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function $(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof z)return!0;if(t instanceof Y)return!0;if(t instanceof K)return!0;if(t instanceof H)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in nt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=nt[s],n++}else o=O;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=R(o,a)}else r=nt[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ot=function(t){this.type=j,this.sections=t};ot.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,V)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,R(T))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,D)))return null;var p=n[n.length-1];p.scale=s,p.font=u,p.textColor=l}else{var c=e.parse(t[o],1,O);if(!c)return null;var h=c.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null})}}return new ot(n)},ot.prototype.evaluate=function(t){return new K(this.sections.map((function(e){var r=e.content.evaluate(t);return Q(r)===q?new J("",r,null,null,null):new J(tt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ot.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},at.prototype.eachChild=function(t){t(this.input)},at.prototype.outputDefined=function(){return!1},at.prototype.serialize=function(){return["image",this.input.serialize()]};var st={"to-boolean":E,"to-color":D,"to-number":V,"to-string":T},ut=function(t,e){this.type=t,this.args=e};ut.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=st[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":W(e[0],e[1],e[2],e[3])))return new z(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new rt(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function dt(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function mt(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function vt(t,e){for(var r,n,i,o,a,s,u,l=!1,p=0,c=e.length;p0&&s<0||a<0&&s>0}function bt(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}ft(e,t)}function At(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Bt(t,e)&&(r=!1)})),r}Mt.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if($(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new rt("Input is not a number.");o=a-1}return 0}Tt.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Tt.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new it(e,[t]):"coerce"===r?new ut(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof et)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Vt)return t(e.boundExpression);if(e instanceof ct&&"error"===e.name)return!1;if(e instanceof ht)return!1;if(e instanceof Mt)return!1;var r=e instanceof ut||e instanceof it,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof et})),!!n&&Pt(e)&&Bt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new pt;try{o=new et(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Tt.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Tt(this.registry,n,e||null,i,this.errors)},Tt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new P(n,t))},Tt.prototype.checkSubtype=function(t,e){var r=Z(t,e);return r&&this.error(r),r};var Dt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new Dt(i,r,n)},Dt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Et(e,n)].evaluate(t)},Dt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ot=Object.freeze({__proto__:null,number:Ft,color:function(t,e,r){return new z(Ft(t.r,e.r,r),Ft(t.g,e.g,r),Ft(t.b,e.b,r),Ft(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ft(t,e[n],r)}))}}),Lt=6/29*3*(6/29),jt=Math.PI/180,qt=180/Math.PI;function Rt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Lt+4/29}function Ut(t){return t>6/29?t*t*t:Lt*(t-4/29)}function Nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gt(t){var e=Zt(t.r),r=Zt(t.g),n=Zt(t.b),i=Rt((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Rt((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Rt((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function Xt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ut(e),r=.95047*Ut(r),n=1.08883*Ut(n),new z(Nt(3.2404542*r-1.5371385*e-.4985314*n),Nt(-.969266*r+1.8760108*e+.041556*n),Nt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Yt(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Jt={forward:Gt,reverse:Xt,interpolate:function(t,e,r){return{l:Ft(t.l,e.l,r),a:Ft(t.a,e.a,r),b:Ft(t.b,e.b,r),alpha:Ft(t.alpha,e.alpha,r)}}},Kt={forward:function(t){var e=Gt(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*qt;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*jt,r=t.c;return Xt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Yt(t.h,e.h,r),c:Ft(t.c,e.c,r),l:Ft(t.l,e.l,r),alpha:Ft(t.alpha,e.alpha,r)}}},Ht=Object.freeze({__proto__:null,lab:Jt,hcl:Kt}),Wt=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,V)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=D:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,l);if(!d)return null;l=l||d.type,u.push([c,d])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new Wt(l,r,n,i,u):e.error("Type "+U(l)+" is not interpolatable.")},Wt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Et(e,n),a=Wt.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Ot[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?Kt.reverse(Kt.interpolate(Kt.forward(s),Kt.forward(u),a)):Jt.reverse(Jt.interpolate(Jt.forward(s),Jt.forward(u),a))},Wt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new rt("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new rt("Array index must be an integer, but found "+e+" instead.");return r[e]},ee.prototype.eachChild=function(t){t(this.index),t(this.input)},ee.prototype.outputDefined=function(){return!1},ee.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var re=function(t,e){this.type=E,this.needle=t,this.haystack=e};re.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,O);return r&&n?G(r.type,[E,T,V,B,O])?new re(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead"):null},re.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");return r.indexOf(e)>=0},re.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},re.prototype.outputDefined=function(){return!0},re.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ne=function(t,e,r){this.type=V,this.needle=t,this.haystack=e,this.fromIndex=r};ne.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,O);if(!r||!n)return null;if(!G(r.type,[E,T,V,B,O]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ne(r,n,i):null}return new ne(r,n)},ne.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new rt("Expected first argument to be of type boolean, string, number or null, but found "+U(Q(e))+" instead.");if(!X(r,["string","array"]))throw new rt("Expected second argument to be of type array or string, but found "+U(Q(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},ne.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ne.prototype.outputDefined=function(){return!1},ne.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var ie=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};ie.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,Q(h)))return null}else r=Q(h);if(void 0!==i[String(h)])return l.error("Branch labels must be unique.");i[String(h)]=o.length}var f=e.parse(u,a,n);if(!f)return null;n=n||f.type,o.push(f)}var y=e.parse(t[1],1,O);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new ie(r,n,y,i,o,d):null},ie.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Q(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ie.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ie.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ie.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,O),n=e.parse(t[2],2,V);if(!r||!n)return null;if(!G(r.type,[R(O),T,O]))return e.error("Expected first argument to be of type array or string, but found "+U(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,V);return i?new ae(r.type,r,n,i):null}return new ae(r.type,r,n)},ae.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new rt("Expected first argument to be of type array or string, but found "+U(Q(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},ae.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},ae.prototype.outputDefined=function(){return!1},ae.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var pe=le("==",(function(t,e,r){return e===r}),ue),ce=le("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!ue(0,e,r,n)})),he=le("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),ye=le("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),de=le(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),me=function(t,e,r,n,i){this.type=T,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};me.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,V);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,T)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,T)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,V)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,V))?null:new me(r,i,o,a,s)},me.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},me.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},me.prototype.outputDefined=function(){return!1},me.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var ve=function(t){this.type=V,this.input=t};ve.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+U(r.type)+" instead."):new ve(r):null},ve.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new rt("Expected value to be of type string or array, but found "+U(Q(e))+" instead.")},ve.prototype.eachChild=function(t){t(this.input)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ge={"==":pe,"!=":ce,">":fe,"<":he,">=":de,"<=":ye,array:it,at:ee,boolean:it,case:oe,coalesce:Qt,collator:ht,format:ot,image:at,in:re,"index-of":ne,interpolate:Wt,"interpolate-hcl":Wt,"interpolate-lab":Wt,length:ve,let:te,literal:et,match:ie,number:it,"number-format":me,object:it,slice:ae,step:Dt,string:it,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,var:Vt,within:Mt};function xe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=W(r,n,i,a);if(s)throw new rt(s);return new z(r/255*a,n/255*a,i/255*a,a)}function be(t,e){return t in e}function we(t,e){var r=e[t];return void 0===r?null:r}function _e(t){return{type:t}}function Se(t){return{result:"success",value:t}}function ke(t){return{result:"error",value:t}}function Ie(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ae(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ze(t){return!!t.expression&&t.expression.interpolated}function Me(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Pe(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Ce(t){return t}function Be(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Ve(t,e,r,n,i){return Be(typeof r===i?n[r]:void 0,t.default,e.default)}function Te(t,e,r){if("number"!==Me(r))return Be(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Et(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Ee(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Me(r))return Be(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=Et(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=Ot[e.type]||Ce;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=Ht[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return l(r,n,a)}}:l(s,u,a)}function De(t,e,r){return"color"===e.type?r=z.parse(r):"formatted"===e.type?r=K.fromString(r.toString()):"resolvedImage"===e.type?r=H.fromString(r.toString()):Me(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Be(r,t.default,e.default)}ct.register(ge,{error:[{kind:"error"},[T],function(t,e){throw new rt(e[0].evaluate(t))}],typeof:[T,[O],function(t,e){return U(Q(e[0].evaluate(t)))}],"to-rgba":[R(V,4),[D],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[D,[V,V,V],xe],rgba:[D,[V,V,V,V],xe],has:{type:E,overloads:[[[T],function(t,e){return be(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return be(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:O,overloads:[[[T],function(t,e){return we(e[0].evaluate(t),t.properties())}],[[T,F],function(t,e){var r=e[1];return we(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[O,[T],function(t,e){return we(e[0].evaluate(t),t.featureState||{})}],properties:[F,[],function(t){return t.properties()}],"geometry-type":[T,[],function(t){return t.geometryType()}],id:[O,[],function(t){return t.id()}],zoom:[V,[],function(t){return t.globals.zoom}],"heatmap-density":[V,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[V,[],function(t){return t.globals.lineProgress||0}],accumulated:[O,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[V,_e(V),function(t,e){for(var r=0,n=0,i=e;n":[E,[T,O],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[E,[T,O],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[E,[T,O],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[E,[O],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[E,[O],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[E,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[E,[R(T)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[E,[R(O)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[E,[T,R(O)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[E,[T,R(O)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:E,overloads:[[[E,E],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[_e(E),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in ge}function Le(t,e){var r=new Tt(ge,[],e?function(t){var e={color:D,string:T,number:V,enum:T,boolean:E,formatted:j,resolvedImage:q};return"array"===t.type?R(e[t.value]||O,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Se(new Fe(n,e)):ke(r.errors)}Fe.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Fe.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new rt("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var je=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ct(e.expression)};je.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},je.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var qe=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ct(e.expression),this.interpolationType=n};function Re(t,e){if("error"===(t=Le(t,e)).result)return t;var r=t.value.expression,n=Pt(r);if(!n&&!Ie(e))return ke([new P("","data expressions not supported")]);var i=Bt(r,["zoom"]);if(!i&&!Ae(e))return ke([new P("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof te)r=t(e.result);else if(e instanceof Qt)for(var n=0,i=e.args;n=0)){var p=t[l];u[l]=Ge[s].shallow.indexOf(l)>=0?p:He(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function We(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Je(t)||Ke(t)||ArrayBuffer.isView(t)||t instanceof Ne)return t;if(Array.isArray(t))return t.map(We);if("object"==typeof t){var e=t.$name||"Object",r=Ge[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i=0?s:We(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var $e=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};$e.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},$e.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Qe=function(t,e,r){var n;this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},n=this,["receive","process"].forEach((function(t){n[t]&&(n[t]=n[t].bind(n))})),this.invoker=new $e(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=g()?t:i};Qe.prototype.send=function(t,e,r,n,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=w(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:He(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"",targetMapId:n,sourceMapId:o.mapId})}}},Qe.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else g()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Qe.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Qe.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(We(e.error)):n(null,We(e.data)))}else{var i=!1,o=w(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?He(e):null,data:He(n,o)},o)}:function(t){i=!0},s=null,u=We(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Qe.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var tr={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},er=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function rr(t){var e=t.value;return e?[new er(t.key,e,"constants have been deprecated as of v8")]:[]}function nr(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ir(t){if(Array.isArray(t))return t.map(ir);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=ir(t[r]);return e}return nr(t)}function or(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Me(r);if("object"!==u)return[new er(e,r,"object expected, "+u+" found")];for(var l in r){var p=l.split(".")[0],c=n[p]||n["*"],h=void 0;if(i[p])h=i[p];else if(n[p])h=Cr;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new er(e,r[l],'unknown property "'+l+'"'));continue}h=Cr}s=s.concat(h({key:(e?e+".":e)+l,value:r[l],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:l},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new er(e,r,'missing required property "'+f+'"'));return s}function ar(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Cr;if("array"!==Me(e))return[new er(o,e,"array expected, "+Me(e)+" found")];if(r.length&&e.length!==r.length)return[new er(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.lengthn.maximum?[new er(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function ur(t){var e,r,n,i=t.valueSpec,o=nr(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Me(t.value.stops)&&"array"===Me(t.value.stops[0])&&"object"===Me(t.value.stops[0][0]),p=or({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new er(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(ar({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Me(r)&&0===r.length&&e.push(new er(t.key,r,"array must have at least one stop")),e},default:function(t){return Cr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&p.push(new er(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||p.push(new er(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ze(t.valueSpec)&&p.push(new er(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Ie(t.valueSpec)?p.push(new er(t.key,t.value,"property functions not supported")):s&&!Ae(t.valueSpec)&&p.push(new er(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||p.push(new er(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],o=t.value,s=t.key;if("array"!==Me(o))return[new er(s,o,"array expected, "+Me(o)+" found")];if(2!==o.length)return[new er(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Me(o[0]))return[new er(s,o,"object expected, "+Me(o[0])+" found")];if(void 0===o[0].zoom)return[new er(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new er(s,o,"object stop key must have value")];if(n&&n>nr(o[0].zoom))return[new er(s,o[0].zoom,"stop zoom values must appear in ascending order")];nr(o[0].zoom)!==n&&(n=nr(o[0].zoom),r=void 0,a={}),e=e.concat(or({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:sr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Oe(ir(o[1]))?e.concat([new er(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(Cr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Me(t.value),u=nr(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return[new er(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new er(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var p="number expected, "+s+" found";return Ie(i)&&void 0===o&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new er(t.key,l,p)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function dr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?mr(t[1],t[2],"=="):"!="===r?xr(mr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?mr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dr))):"all"===r?["all"].concat(t.slice(1).map(dr)):"none"===r?["all"].concat(t.slice(1).map(dr).map(xr)):"in"===r?vr(t[1],t.slice(2)):"!in"===r?xr(vr(t[1],t.slice(2))):"has"===r?gr(t[1]):"!has"===r?xr(gr(t[1])):"within"!==r||t}function mr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function vr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(yr)]]:["filter-in-small",t,["literal",e]]}}function gr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function xr(t){return["!",t]}function br(t){return cr(ir(t.value))?lr(M({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Me(r))return[new er(n,r,"array expected, "+Me(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new er(n,r,"filter array must have at least 1 element")];switch(a=a.concat(pr({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),nr(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===nr(r[1])&&a.push(new er(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new er(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Me(r[1]))&&a.push(new er(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},jr.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var qr=Vr,Rr=qr.paintProperty,Ur=qr.layoutProperty,Nr=function(){this.first=!0};Nr.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=1536&&t<=1791},Gr=function(t){return t>=1872&&t<=1919},Xr=function(t){return t>=2208&&t<=2303},Yr=function(t){return t>=11904&&t<=12031},Jr=function(t){return t>=12032&&t<=12255},Kr=function(t){return t>=12272&&t<=12287},Hr=function(t){return t>=12288&&t<=12351},Wr=function(t){return t>=12352&&t<=12447},$r=function(t){return t>=12448&&t<=12543},Qr=function(t){return t>=12544&&t<=12591},tn=function(t){return t>=12704&&t<=12735},en=function(t){return t>=12736&&t<=12783},rn=function(t){return t>=12784&&t<=12799},nn=function(t){return t>=12800&&t<=13055},on=function(t){return t>=13056&&t<=13311},an=function(t){return t>=13312&&t<=19903},sn=function(t){return t>=19968&&t<=40959},un=function(t){return t>=40960&&t<=42127},ln=function(t){return t>=42128&&t<=42191},pn=function(t){return t>=63744&&t<=64255},cn=function(t){return t>=64336&&t<=65023},hn=function(t){return t>=65040&&t<=65055},fn=function(t){return t>=65072&&t<=65103},yn=function(t){return t>=65104&&t<=65135},dn=function(t){return t>=65136&&t<=65279},mn=function(t){return t>=65280&&t<=65519};function vn(t){for(var e=0,r=t;e=65097&&t<=65103)||pn(t)||on(t)||Yr(t)||en(t)||!(!Hr(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||an(t)||sn(t)||nn(t)||function(t){return t>=12592&&t<=12687}(t)||function(t){return t>=43360&&t<=43391}(t)||function(t){return t>=55216&&t<=55295}(t)||function(t){return t>=4352&&t<=4607}(t)||function(t){return t>=44032&&t<=55215}(t)||Wr(t)||Kr(t)||function(t){return t>=12688&&t<=12703}(t)||Jr(t)||rn(t)||$r(t)&&12540!==t||!(!mn(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!yn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||function(t){return t>=5120&&t<=5759}(t)||function(t){return t>=6320&&t<=6399}(t)||hn(t)||function(t){return t>=19904&&t<=19967}(t)||un(t)||ln(t))))}function xn(t){return!(gn(t)||function(t){return!!(function(t){return t>=128&&t<=255}(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||function(t){return t>=8192&&t<=8303}(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||function(t){return t>=8448&&t<=8527}(t)||function(t){return t>=8528&&t<=8591}(t)||function(t){return t>=8960&&t<=9215}(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||function(t){return t>=9216&&t<=9279}(t)&&9251!==t||function(t){return t>=9280&&t<=9311}(t)||function(t){return t>=9312&&t<=9471}(t)||function(t){return t>=9632&&t<=9727}(t)||function(t){return t>=9728&&t<=9983}(t)&&!(t>=9754&&t<=9759)||function(t){return t>=11008&&t<=11263}(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hr(t)||$r(t)||function(t){return t>=57344&&t<=63743}(t)||fn(t)||yn(t)||mn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function bn(t){return t>=1424&&t<=2303||cn(t)||dn(t)}function wn(t,e){return!(!e&&bn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||function(t){return t>=6016&&t<=6143}(t))}function _n(t){for(var e=0,r=t;e=1&&i.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){d("Unable to write to LocalStorage")}},En.prototype.processRequests=function(t){},En.prototype.postEvent=function(t,e,r,n){var i=this;if(In.EVENTS_URL){var o=function(t){var e=t.match(Vn);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}(In.EVENTS_URL);o.params.push("access_token="+(n||In.ACCESS_TOKEN||""));var a,s,l={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:"01",userId:this.anonId},p=e?u(l,e):l,c={url:(a=o,s=a.params.length?"?"+a.params.join("&"):"",a.protocol+"://"+a.authority+a.path+s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([p])};this.pendingRequest=Gn(c,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},En.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Dn,Fn,On=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(In.EVENTS_URL&&n||In.ACCESS_TOKEN)&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),p(this.anonId)||(this.anonId=l()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(En),Ln=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){In.EVENTS_URL&&In.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return function(t){return 0===t.indexOf("mapbox:")}(t)||Bn(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=Tn(In.ACCESS_TOKEN),n=r?r.u:In.ACCESS_TOKEN,i=n!==this.eventData.tokenU;p(this.anonId)||(this.anonId=l(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(En)),jn=(Ln.postTurnstileEvent.bind(Ln),new On);function qn(){i.caches&&!Dn&&(Dn=i.caches.open("mapbox-tiles"))}function Rn(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}jn.postMapLoadEvent.bind(jn),"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});var Un=function(t){function e(e,r,n){401===r&&Bn(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Nn=g()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===i.location.protocol?i.parent:i).location.href};var Zn=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Nn())&&!/^\w+:/.test(r))){if(i.fetch&&i.Request&&i.AbortController&&i.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new i.AbortController,o=new i.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Nn(),signal:n.signal}),a=!1,s=!1,u=(r=o.url).indexOf("sku=")>0&&Bn(r);"json"===t.type&&o.headers.set("Accept","application/json");var l=function(r,n,a){if(!s){if(r&&"SecurityError"!==r.message&&d(r),n&&a)return p(n);var l=Date.now();i.fetch(o).then((function(r){if(r.ok){var n=u?r.clone():null;return p(r,n,l)}return e(new Un(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},p=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(qn(),Dn){var n={status:e.status,statusText:e.statusText,headers:new i.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var o=x(e.headers.get("Cache-Control")||"");o["no-store"]||(o["max-age"]&&n.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Fn)try{new Response(new ReadableStream),Fn=!0}catch(t){Fn=!1}Fn?e(t.body):t.blob().then(e)}(e,(function(e){var r=new i.Response(e,n);qn(),Dn&&Dn.then((function(e){return e.put(Rn(t.url),r)})).catch((function(t){return d(t.message)}))})))}}(o,n,u),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(qn(),!Dn)return e(null);var r=Rn(t.url);Dn.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=x(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(o,l):l(null,null),{cancel:function(){s=!0,a||n.abort()}}}(t,e);if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new i.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new Un(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Gn=function(t,e){return Zn(u(t,{method:"POST"}),e)},Xn="unavailable",Yn=null,Jn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Xn||null!=Jn.applyArabicShaping},isLoading:function(){return"loading"===Xn},setState:function(t){Xn=t.pluginStatus,Yn=t.pluginURL},isParsed:function(){return null!=Jn.applyArabicShaping&&null!=Jn.processBidirectionalText&&null!=Jn.processStyledBidirectionalText},getPluginURL:function(){return Yn}},Kn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Nr,this.transition={})};Kn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Hn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Pe(t))return new Ue(t,e);if(Oe(t)){var r=Re(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=z.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Hn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Hn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Wn=function(t){this.property=t,this.value=new Hn(t,void 0)};Wn.prototype.transitioned=function(t,e){return new Qn(this.property,this.value,e,u({},t.transition,this.transition),t.now)},Wn.prototype.untransitioned=function(){return new Qn(this.property,this.value,null,{},0)};var $n=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};$n.prototype.getValue=function(t){return f(this._values[t].value.value)},$n.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].value=new Hn(this._values[t].property,null===e?void 0:f(e))},$n.prototype.getTransition=function(t){return f(this._values[t].transition)},$n.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].transition=f(e)||void 0},$n.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var ti=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};ti.prototype.possiblyEvaluate=function(t,e,r){for(var n=new ni(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(oi),si=function(t){this.specification=t};si.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Kn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Kn(Math.floor(e.zoom),e)),t.expression.evaluate(new Kn(Math.floor(e.zoom+1),e)),e)}},si.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},si.prototype.interpolate=function(t){return t};var ui=function(t){this.specification=t};ui.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},ui.prototype.interpolate=function(){return!1};var li=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Hn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Wn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Xe("DataDrivenProperty",oi),Xe("DataConstantProperty",ii),Xe("CrossFadedDataDrivenProperty",ai),Xe("CrossFadedProperty",si),Xe("ColorRampProperty",ui);var pi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new ei(r.layout)),r.paint)){for(var n in this._transitionablePaint=new $n(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ni(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Ur,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return c(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Rr,"layers."+this.id+".paint."+t,t,e,r))return!1;if(c(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),function(t,e,r){var n={};for(var i in t)e.call(this,t[i],i,t)&&(n[i]=t[i]);return n}(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&function(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;nthis.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},fi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(fi);mi.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",mi);var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(fi);vi.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",vi);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(fi);gi.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",gi);var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(fi);xi.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",xi);var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(fi);bi.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",bi);var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p){var c=10*t;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,this.uint16[c+8]=l,this.uint16[c+9]=p,t},e}(fi);wi.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",wi);var _i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,o,a,s,u,l,p,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=u,this.int16[f+8]=l,this.int16[f+9]=p,this.int16[f+10]=c,this.int16[f+11]=h,t},e}(fi);_i.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",_i);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(fi);Si.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",Si);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(fi);ki.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",ki);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l){var p=10*t,c=5*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.int16[p+4]=o,this.int16[p+5]=a,this.uint32[c+3]=s,this.uint16[p+8]=u,this.uint16[p+9]=l,t},e}(fi);Ii.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",Ii);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(fi);Ai.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",Ai);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(fi);zi.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",zi);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(fi);Mi.prototype.bytesPerElement=12,Xe("StructArrayLayout2ub2f12",Mi);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(fi);Pi.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",Pi);var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[x+2]=o,this.uint32[x+3]=a,this.uint32[x+4]=s,this.uint16[g+10]=u,this.uint16[g+11]=l,this.uint16[g+12]=p,this.float32[x+7]=c,this.float32[x+8]=h,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(fi);Ci.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ci);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z){var M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d,m,v,g,x,b,w,_,S,k,I,A,z,M){var P=34*t,C=17*t;return this.int16[P+0]=e,this.int16[P+1]=r,this.int16[P+2]=n,this.int16[P+3]=i,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=u,this.uint16[P+8]=l,this.uint16[P+9]=p,this.uint16[P+10]=c,this.uint16[P+11]=h,this.uint16[P+12]=f,this.uint16[P+13]=y,this.uint16[P+14]=d,this.uint16[P+15]=m,this.uint16[P+16]=v,this.uint16[P+17]=g,this.uint16[P+18]=x,this.uint16[P+19]=b,this.uint16[P+20]=w,this.uint16[P+21]=_,this.uint16[P+22]=S,this.uint32[C+12]=k,this.float32[C+13]=I,this.float32[C+14]=A,this.float32[C+15]=z,this.float32[C+16]=M,t},e}(fi);Bi.prototype.bytesPerElement=68,Xe("StructArrayLayout8i15ui1ul4f68",Bi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(fi);Vi.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",Vi);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(fi);Ti.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",Ti);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(fi);Ei.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Ei);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(fi);Di.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Di);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(fi);Fi.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",Fi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(fi);Oi.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",Oi);var Li=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(hi);Li.prototype.size=20;var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Li(this,t)},e}(Ii);Xe("CollisionBoxArray",ji);var qi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(hi);qi.prototype.size=48;var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new qi(this,t)},e}(Ci);Xe("PlacedSymbolArray",Ri);var Ui=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(hi);Ui.prototype.size=68;var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ui(this,t)},e}(Bi);Xe("SymbolInstanceArray",Ni);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Vi);Xe("GlyphOffsetArray",Zi);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Ti);Xe("SymbolLineVertexArray",Gi);var Xi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(hi);Xi.prototype.size=8;var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Xi(this,t)},e}(Ei);Xe("FeatureIndexArray",Yi);var Ji=yi([{name:"a_pos",components:2,type:"Int16"}],4).members,Ki=function(t){void 0===t&&(t=[]),this.segments=t};function Hi(t,e){return 256*(t=a(Math.floor(t),0,255))+a(Math.floor(e),0,255)}Ki.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Ki.MAX_VERTEX_ARRAY_LENGTH&&d("Max vertices per segment is "+Ki.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ki.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Ki.prototype.get=function(){return this.segments},Ki.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Qi=I((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),to=$i,eo=Qi;to.murmur3=$i,to.murmur2=eo;var ro=function(){this.ids=[],this.positions=[],this.indexed=!1};ro.prototype.add=function(t,e,r,n){this.ids.push(io(t)),this.positions.push(e,r,n)},ro.prototype.getPositions=function(t){for(var e=io(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},ro.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;oo(e,a,s),oo(r,3*a,3*s),oo(r,3*a+1,3*s+1),oo(r,3*a+2,3*s+2)}s-ns.x+1||ls.y+1)&&d("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Io(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ko(t):[]}}function Ao(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var zo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new mi,this.indexArray=new Pi,this.segments=new Ki,this.programConfigurations=new xo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Mo(t,e){for(var r=0;r1){if(Vo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Fo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Oo(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Lo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=m(t,e,r[0]);return o!==m(t,e,r[1])||o!==m(t,e,r[2])||o!==m(t,e,r[3])}function jo(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function qo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ro(t,e,n,i,o){if(!e[0]&&!e[1])return t;var a=r.convert(e)._mult(o);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u=8192||p<0||p>=8192)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=c.vertexLength;Ao(this.layoutVertexArray,l,p,-1,-1),Ao(this.layoutVertexArray,l,p,1,-1),Ao(this.layoutVertexArray,l,p,1,1),Ao(this.layoutVertexArray,l,p,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Xe("CircleBucket",zo,{omit:["layers"]});var Uo=new li({"circle-sort-key":new oi(tr.layout_circle["circle-sort-key"])}),No={paint:new li({"circle-radius":new oi(tr.paint_circle["circle-radius"]),"circle-color":new oi(tr.paint_circle["circle-color"]),"circle-blur":new oi(tr.paint_circle["circle-blur"]),"circle-opacity":new oi(tr.paint_circle["circle-opacity"]),"circle-translate":new ii(tr.paint_circle["circle-translate"]),"circle-translate-anchor":new ii(tr.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ii(tr.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ii(tr.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new oi(tr.paint_circle["circle-stroke-width"]),"circle-stroke-color":new oi(tr.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new oi(tr.paint_circle["circle-stroke-opacity"])}),layout:Uo},Zo="undefined"!=typeof Float32Array?Float32Array:Array;function Go(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Xo(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),Yo=new Zo(4),Zo!=Float32Array&&(Yo[0]=0,Yo[1]=0,Yo[2]=0,Yo[3]=0);var Yo,Jo=function(t){function e(e){t.call(this,e,No)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new zo(t)},e.prototype.queryRadius=function(t){var e=t;return jo("circle-radius",this,e)+jo("circle-stroke-width",this,e)+qo(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=Ro(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map((function(t){return Ko(t,e)}))}(u,s),h=p?l*a:l,f=0,y=n;ft.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var y=r;yo&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-n,a-i))?1/l:0}return ha(h,f,r,n,i,l),f}function pa(t,e,r,n,i){var o,a;if(i===Ea(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ba(o,t[o],t[o+1],a);return a&&Ia(a,a.next)&&(Va(a),a=a.next),a}function ca(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ia(n,n.next)&&0!==ka(n.prev,n,n.next))n=n.next;else{if(Va(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function ha(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ba(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,l=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,l*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ya(t,n,i,o):fa(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Va(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?ha(t=da(ca(t),e,r),e,r,n,i,o,2):2===a&&ma(t,e,r,n,i,o):ha(ca(t),e,r,n,i,o,1);break}}}function fa(t){var e=t.prev,r=t,n=t.next;if(ka(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_a(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ka(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ya(t,e,r,n){var i=t.prev,o=t,a=t.next;if(ka(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=ba(i.x=l&&h&&h.z<=p;){if(c!==t.prev&&c!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&ka(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==t.prev&&h!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ka(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=l;){if(c!==t.prev&&c!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,c.x,c.y)&&ka(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=p;){if(h!==t.prev&&h!==t.next&&_a(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ka(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function da(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ia(i,o)&&Aa(i,n,n.next,o)&&Pa(i,o)&&Pa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Va(n),Va(n.next),n=t=o),n=n.next}while(n!==t);return ca(n)}function ma(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Sa(a,s)){var u=Ca(a,s);return a=ca(a,a.next),u=ca(u,u.next),ha(a,e,r,n,i,o),void ha(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function va(t,e){return t.x-e.x}function ga(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=p&&i!==n.x&&_a(or.x||n.x===r.x&&xa(r,n)))&&(r=n,h=u)),n=n.next}while(n!==l);return r}(t,e)){var r=Ca(e,t);ca(e,e.next),ca(r,r.next)}}function xa(t,e){return ka(t.prev,t,e.prev)<0&&ka(e.next,t,t.next)<0}function ba(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wa(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Sa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Aa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Pa(t,e)&&Pa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ka(t.prev,t,e.prev)||ka(t,e.prev,e))||Ia(t,e)&&ka(t.prev,t,t.next)>0&&ka(e.prev,e,e.next)>0)}function ka(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ia(t,e){return t.x===e.x&&t.y===e.y}function Aa(t,e,r,n){var i=Ma(ka(t,e,r)),o=Ma(ka(t,e,n)),a=Ma(ka(r,n,t)),s=Ma(ka(r,n,e));return i!==o&&a!==s||!(0!==i||!za(t,r,e))||!(0!==o||!za(t,n,e))||!(0!==a||!za(r,t,n))||!(0!==s||!za(r,e,n))}function za(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ma(t){return t>0?1:t<0?-1:0}function Pa(t,e){return ka(t.prev,t,t.next)<0?ka(t,e,t.next)>=0&&ka(t,t.prev,e)>=0:ka(t,e,t.prev)<0||ka(t,t.next,e)<0}function Ca(t,e){var r=new Ta(t.i,t.x,t.y),n=new Ta(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ba(t,e,r,n){var i=new Ta(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Va(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ta(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ea(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*l/a+p)),Math.min(i,Math.floor(r+(a-s)*l/a+p)),o)}var c=e[r],h=n,f=i;for(Fa(e,n,r),o(e[i],c)>0&&Fa(e,n,i);h0;)f--}0===o(e[n],c)?Fa(e,n,f):Fa(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||Oa)}function Fa(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Oa(t,e){return te?1:0}function La(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},sa.default=ua;var Ua=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new mi,this.indexArray=new Pi,this.indexArray2=new Di,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.segments2=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ua.prototype.populate=function(t,e,r){this.hasPattern=qa("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},Ja.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())l&&(l=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},Ja.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Ja.types[this.type];function p(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function ts(t,e,r){if(3===t){var n=new Wa(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}$a.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ya(this._pbf,e,this.extent,this._keys,this._values)};var es={VectorTile:function(t,e){this.layers=t.readFields(ts,{},e)},VectorTileFeature:Ya,VectorTileLayer:Wa},rs=es.VectorTileFeature.types,ns=Math.pow(2,13);function is(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*ns)+a,i*ns*2,o*ns*2,Math.round(s))}var os=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new gi,this.indexArray=new Pi,this.programConfigurations=new xo(t.layers,t.zoom),this.segments=new Ki,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function as(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}os.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=qa("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||V.every((function(t){return t.y<0}))||V.every((function(t){return t.y>8192}))))for(var d=0,m=0;m=1){var g=y[m-1];if(!as(v,g)){c.vertexLength+4>Ki.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),is(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),is(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var w=c.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+u>Ki.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===rs[t.type]){for(var _=[],S=[],k=c.vertexLength,I=0,A=s;I=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l0;if(S&&v>l){var I=p.dist(f);if(I>2*c){var A=p.sub(p.sub(f)._mult(c/I)._round());this.updateDistance(f,A),this.addCurrentVertex(A,d,0,0,h),f=A}}var z=f&&y,M=z?r:s?"butt":n;if(z&&"round"===M&&(wi&&(M="bevel"),"bevel"===M&&(w>2&&(M="flipbevel"),w100)g=m.mult(-1);else{var P=w*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(P*(k?-1:1))}this.addCurrentVertex(p,g,0,0,h),this.addCurrentVertex(p,g.mult(-1),0,0,h)}else if("bevel"===M||"fakeround"===M){var C=-Math.sqrt(w*w-1),B=k?C:0,V=k?0:C;if(f&&this.addCurrentVertex(p,d,B,V,h),"fakeround"===M)for(var T=Math.round(180*_/Math.PI/20),E=1;E2*c){var q=p.add(y.sub(p)._mult(c/j)._round());this.updateDistance(p,q),this.addCurrentVertex(q,m,0,0,h),p=q}}}}},ms.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>ds/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},ms.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(ds-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},ms.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ms.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Xe("LineBucket",ms,{omit:["layers","patternFeatures"]});var vs=new li({"line-cap":new ii(tr.layout_line["line-cap"]),"line-join":new oi(tr.layout_line["line-join"]),"line-miter-limit":new ii(tr.layout_line["line-miter-limit"]),"line-round-limit":new ii(tr.layout_line["line-round-limit"]),"line-sort-key":new oi(tr.layout_line["line-sort-key"])}),gs={paint:new li({"line-opacity":new oi(tr.paint_line["line-opacity"]),"line-color":new oi(tr.paint_line["line-color"]),"line-translate":new ii(tr.paint_line["line-translate"]),"line-translate-anchor":new ii(tr.paint_line["line-translate-anchor"]),"line-width":new oi(tr.paint_line["line-width"]),"line-gap-width":new oi(tr.paint_line["line-gap-width"]),"line-offset":new oi(tr.paint_line["line-offset"]),"line-blur":new oi(tr.paint_line["line-blur"]),"line-dasharray":new si(tr.paint_line["line-dasharray"]),"line-pattern":new ai(tr.paint_line["line-pattern"]),"line-gradient":new ui(tr.paint_line["line-gradient"])}),layout:vs},xs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Kn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=u({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(oi))(gs.paint.properties["line-width"].specification);xs.useIntegerZoom=!0;var bs=function(t){function e(e){t.call(this,e,gs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Dt,this.gradientVersion=(this.gradientVersion+1)%o)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=xs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new ms(t)},e.prototype.queryRadius=function(t){var e=t,r=ws(jo("line-width",this,e),jo("line-gap-width",this,e)),n=jo("line-offset",this,e);return r/2+Math.abs(n)+qo(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,i,o,a,s){var u=Ro(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ws(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),p=this.paint.get("line-offset").evaluate(e,n);return p&&(i=function(t,e){for(var n=[],i=new r(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var _s=yi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ss=yi([{name:"a_projected_pos",components:3,type:"Float32"}],4),ks=(yi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),yi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Is=(yi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),yi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4));function As(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Jn.applyArabicShaping&&(t=Jn.applyArabicShaping(t)),t}(t.text,e,r)})),t}yi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),yi([{name:"triangle",components:3,type:"Uint16"}]),yi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),yi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),yi([{type:"Float32",name:"offsetX"}]),yi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var zs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ms=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,o=f&(1<<-p)-1,f>>=-p,p+=s;p>0;o=256*o+t[e+c],c+=h,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=256*a+t[e+c],c+=h,p-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},Ps=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,p=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=p?(s=0,a=p):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=y,a/=256,l-=8);t[r+f-y]|=128*d},Cs=Bs;function Bs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Bs.Varint=0,Bs.Fixed64=1,Bs.Bytes=2,Bs.Fixed32=5;var Vs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ts(t){return t.type===Bs.Bytes?t.readVarint()+t.pos:t.pos+1}function Es(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ds(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Fs(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ys(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Js(t){for(var e=0,r=0,n=0,i=t;n=0;h--){var f=a[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=a.pop();h>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Gs(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ys(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Gs(this.buf,this.pos)+4294967296*Gs(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Gs(this.buf,this.pos)+4294967296*Ys(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ms(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ms(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return Es(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return Es(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return Es(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Vs?function(t,e,r){return Vs.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:u>223?3:u>191?2:1;if(i+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===p?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Bs.Bytes)return t.push(this.readVarint(e));var r=Ts(this);for(t=t||[];this.pos127;);else if(e===Bs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Bs.Fixed32)this.pos+=4;else{if(e!==Bs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ds(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Ps(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ps(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&Ds(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Bs.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Fs,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Os,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,qs,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ls,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,js,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Us,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ns,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Zs,e)},writeBytesField:function(t,e){this.writeTag(t,Bs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Bs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Bs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Bs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Bs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Bs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ks=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},Hs={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Hs.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Hs.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Hs.tlbr.get=function(){return this.tl.concat(this.br)},Hs.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ks.prototype,Hs);var Ws=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Js(i),a=new ea({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=r[s].paddedRect;ea.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var p in e){var c=e[p],h=n[p].paddedRect,f=h.x+1,y=h.y+1,d=c.data.width,m=c.data.height;ea.copy(c.data,a,{x:0,y:0},{x:f,y:y},c.data),ea.copy(c.data,a,{x:0,y:m-1},{x:f,y:y-1},{width:d,height:1}),ea.copy(c.data,a,{x:0,y:0},{x:f,y:y+m},{width:d,height:1}),ea.copy(c.data,a,{x:d-1,y:0},{x:f-1,y:y},{width:1,height:m}),ea.copy(c.data,a,{x:0,y:0},{x:f+d,y:y},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};Ws.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new Ks(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Ws.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Ws.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Xe("ImagePosition",Ks),Xe("ImageAtlas",Ws);var $s={horizontal:1,vertical:2,horizontalOnly:3},Qs=function(){this.scale=1,this.fontStack="",this.imageName=null};Qs.forText=function(t,e){var r=new Qs;return r.scale=t||1,r.fontStack=e,r},Qs.forImage=function(t){var e=new Qs;return e.imageName=t,e};var tu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function eu(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,d){var m,v=tu.fromFeature(t,i);c===$s.vertical&&v.verticalizePunctuation();var g=Jn.processBidirectionalText,x=Jn.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,w=g(v.toString(),uu(v,l,o,e,n,f,y));b0&&L>I&&(I=L)}else{var j=r[z.fontStack],q=j&&j[P];if(q&&q.rect)V=q.rect,B=q.metrics;else{var R=e[z.fontStack],U=R&&R[P];if(!U)continue;B=U.metrics}C=24*(w-z.scale)}D?(t.verticalizable=!0,k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=E*z.scale+l):(k.push({glyph:P,imageName:T,x:h,y:f+C,vertical:D,scale:z.scale,fontStack:z.fontStack,sectionIndex:M,metrics:B,rect:V}),h+=B.advance*z.scale+l)}0!==k.length&&(y=Math.max(h-l,y),pu(k,0,k.length-1,m,I)),h=0;var N=o*w+I;S.lineOffset=Math.max(I,_),f+=N,d=Math.max(N,d),++v}else f+=o,++v}var Z,G=f- -17,X=lu(a),Y=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var l,p=(e-r)*i;l=o!==a?-s*n- -17:(-n*u+.5)*a;for(var c=0,h=t;c=0&&n>=t&&ru[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},tu.prototype.substring=function(t,e){var r=new tu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},tu.prototype.toString=function(){return this.text},tu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},tu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Qs.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var ru={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},nu={};function iu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function ou(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,c=0,h=0;h-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=p.dist(c)}return!0}function du(t){for(var e=0,r=0;rl){var y=(l-u)/f,d=Ft(c.x,h.x,y),m=Ft(c.y,h.y,y),v=new hu(d,m,h.angleTo(c),p);return v._round(),!a||yu(t,v,s,a,e)?v:void 0}u+=f}}function xu(t,e,r,n,i,o,a,s,u){var l=mu(n,o,a),p=vu(n,i),c=p*a,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c=0&&w=0&&_=0&&f+p<=c){var S=new hu(w,_,x,d);S._round(),i&&!yu(e,S,a,i,o)||y.push(S)}}h+=g}return u||y.length||s||(y=t(e,h/2,n,i,o,a,s,!0,l)),y}(t,h?e/2*s%e:(p/2+2*o)*a*s%e,e,l,r,c,h,!1,u)}function bu(t,e,n,i){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,p=t.right-t.left,c=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],y=function(t,e){return t+e[1]-e[0]},d=h.reduce(y,0),m=f.reduce(y,0),v=u-d,g=l-m,x=0,b=d,w=0,_=m,S=0,k=v,I=0,A=g;if(a.content&&i){var z=a.content;x=wu(h,0,z[0]),w=wu(f,0,z[1]),b=wu(h,z[0],z[2]),_=wu(f,z[1],z[3]),S=z[0]-x,I=z[1]-w,k=z[2]-z[0]-b,A=z[3]-z[1]-_}var M=function(i,o,u,l){var h=Su(i.stretch-x,b,p,t.left),f=ku(i.fixed-S,k,i.stretch,d),y=Su(o.stretch-w,_,c,t.top),v=ku(o.fixed-I,A,o.stretch,m),g=Su(u.stretch-x,b,p,t.left),z=ku(u.fixed-S,k,u.stretch,d),M=Su(l.stretch-w,_,c,t.top),P=ku(l.fixed-I,A,l.stretch,m),C=new r(h,y),B=new r(g,y),V=new r(g,M),T=new r(h,M),E=new r(f/s,v/s),D=new r(z/s,P/s),F=e*Math.PI/180;if(F){var O=Math.sin(F),L=Math.cos(F),j=[L,-O,O,L];C._matMult(j),B._matMult(j),T._matMult(j),V._matMult(j)}var q=i.stretch+i.fixed,R=o.stretch+o.fixed;return{tl:C,tr:B,bl:T,br:V,tex:{x:a.paddedRect.x+1+q,y:a.paddedRect.y+1+R,w:u.stretch+u.fixed-q,h:l.stretch+l.fixed-R},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:E,pixelOffsetBR:D,minFontScaleX:k/s/p,minFontScaleY:A/s/c,isSDF:n}};if(i&&(a.stretchX||a.stretchY))for(var P=_u(h,v,d),C=_u(f,g,m),B=0;B0&&(y=Math.max(10,y),this.circleDiameter=y)}else{var d=a.top*s-u,m=a.bottom*s+u,v=a.left*s-u,g=a.right*s+u,x=a.collisionPadding;if(x&&(v-=x[0]*s,d-=x[1]*s,g+=x[2]*s,m+=x[3]*s),p){var b=new r(v,d),w=new r(g,d),_=new r(v,m),S=new r(g,m),k=p*Math.PI/180;b._rotate(k),w._rotate(k),_._rotate(k),S._rotate(k),v=Math.min(b.x,w.x,_.x,S.x),g=Math.max(b.x,w.x,_.x,S.x),d=Math.min(b.y,w.y,_.y,S.y),m=Math.max(b.y,w.y,_.y,S.y)}t.emplaceBack(e.x,e.y,v,d,g,m,n,i,o)}this.boxEndIndex=t.length},Au=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=zu),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function zu(t,e){return te?1:0}function Mu(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;la)&&(a=p.x),(!l||p.y>s)&&(s=p.y)}var c=Math.min(a-i,s-o),h=c/2,f=new Au([],Pu);if(0===c)return new r(i,o);for(var y=i;ym.d||!m.d)&&(m=g,n&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Cu(g.p.x-(h=g.h/2),g.p.y-h,h,t)),f.push(new Cu(g.p.x+h,g.p.y-h,h,t)),f.push(new Cu(g.p.x-h,g.p.y+h,h,t)),f.push(new Cu(g.p.x+h,g.p.y+h,h,t)),v+=4)}return n&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function Pu(t,e){return e.max-t.max}function Cu(t,e,n,i){this.p=new r(t,e),this.h=n,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,Do(t,l,p))}return(r?1:-1)*Math.sqrt(n)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}Au.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Au.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},Au.prototype.peek=function(){return this.data[0]},Au.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},Au.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var Bu=Number.POSITIVE_INFINITY;function Vu(t,e,n,i,o,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;p.compositeTextSizes=[l["text-size"].possiblyEvaluate(new Kn(c.minZoom),s),l["text-size"].possiblyEvaluate(new Kn(h),s)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,y=f.maxZoom;p.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new Kn(f.minZoom),s),l["icon-size"].possiblyEvaluate(new Kn(y),s)]}p.layoutTextSize=l["text-size"].possiblyEvaluate(new Kn(t.zoom+1),s),p.layoutIconSize=l["icon-size"].possiblyEvaluate(new Kn(t.zoom+1),s),p.textMaxSize=l["text-size"].possiblyEvaluate(new Kn(18));for(var m=24*u.get("text-line-height"),v="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),g=u.get("text-keep-upright"),x=u.get("text-size"),b=function(){var a,l,c=_[w],h=u.get("text-font").evaluate(c,{},s).join(","),f=x.evaluate(c,{},s),y=p.layoutTextSize.evaluate(c,{},s),b=p.layoutIconSize.evaluate(c,{},s),S={horizontal:{},vertical:void 0},k=c.text,I=[0,0];if(k){var A=k.toString(),z=24*u.get("text-letter-spacing").evaluate(c,{},s),M=function(t){for(var e=0,r=t;e=8192||u.y<0||u.y>=8192||function(t,e,r,n,i,o,a,s,u,l,p,c,h,f,y,m,v,g,x,b,w,_,S,k,I){var A,z,M,P,C,B=t.addToLineVertexArray(e,r),V=0,T=0,E=0,D=0,F=-1,O=-1,L={},j=to(""),q=0,R=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(q=(A=s.layout.get("text-offset").evaluate(w,{},k).map((function(t){return 24*t})))[0],R=A[1]):(q=24*s.layout.get("text-radial-offset").evaluate(w,{},k),R=Bu),t.allowVerticalPlacement&&n.vertical){var U=s.layout.get("text-rotate").evaluate(w,{},k)+90;P=new Iu(u,e,l,p,c,n.vertical,h,f,y,U),a&&(C=new Iu(u,e,l,p,c,a,v,g,y,U))}if(i){var N=s.layout.get("icon-rotate").evaluate(w,{}),Z="none"!==s.layout.get("icon-text-fit"),G=bu(i,N,S,Z),X=a?bu(a,N,S,Z):void 0;M=new Iu(u,e,l,p,c,i,v,g,!1,N),V=4*G.length;var Y=t.iconSizeData,J=null;"source"===Y.kind?(J=[128*s.layout.get("icon-size").evaluate(w,{})])[0]>32640&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Y.kind&&((J=[128*_.compositeIconSizes[0].evaluate(w,{},k),128*_.compositeIconSizes[1].evaluate(w,{},k)])[0]>32640||J[1]>32640)&&d(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,G,J,b,x,w,!1,e,B.lineStartIndex,B.lineLength,-1,k),F=t.icon.placedSymbolArray.length-1,X&&(T=4*X.length,t.addSymbols(t.icon,X,J,b,x,w,$s.vertical,e,B.lineStartIndex,B.lineLength,-1,k),O=t.icon.placedSymbolArray.length-1)}for(var K in n.horizontal){var H=n.horizontal[K];if(!z){j=to(H.text);var W=s.layout.get("text-rotate").evaluate(w,{},k);z=new Iu(u,e,l,p,c,H,h,f,y,W)}var $=1===H.positionedLines.length;if(E+=Eu(t,e,H,o,s,y,w,m,B,n.vertical?$s.horizontal:$s.horizontalOnly,$?Object.keys(n.horizontal):[K],L,F,_,k),$)break}n.vertical&&(D+=Eu(t,e,n.vertical,o,s,y,w,m,B,$s.vertical,["vertical"],L,O,_,k));var Q=z?z.boxStartIndex:t.collisionBoxArray.length,tt=z?z.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,rt=P?P.boxEndIndex:t.collisionBoxArray.length,nt=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,ot=C?C.boxStartIndex:t.collisionBoxArray.length,at=C?C.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(z,st),st=ut(P,st),st=ut(M,st);var lt=(st=ut(C,st))>-1?1:0;lt&&(st*=I/24),t.glyphOffsetArray.length>=Zu.MAX_GLYPHS&&d("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,L.right>=0?L.right:-1,L.center>=0?L.center:-1,L.left>=0?L.left:-1,L.vertical||-1,F,O,j,Q,tt,et,rt,nt,it,ot,at,l,E,D,V,T,lt,0,h,q,R,st)}(t,u,r,n,i,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,x,S,A,l,w,k,z,m,e,a,p,c,s)};if("line"===M)for(var V=0,T=function(t,e,n,i,o){for(var a=[],s=0;s=i&&h.x>=i||(c.x>=i?c=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round():h.x>=i&&(h=new r(i,c.y+(i-c.x)/(h.x-c.x)*(h.y-c.y))._round()),c.y>=o&&h.y>=o||(c.y>=o?c=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round():h.y>=o&&(h=new r(c.x+(o-c.y)/(h.y-c.y)*(h.x-c.x),o)._round()),l&&c.equals(l[l.length-1])||a.push(l=[c]),l.push(h)))))}return a}(e.geometry,0,0,8192,8192);V1){var R=gu(q,I,n.vertical||v,i,24,b);R&&B(q,R)}}else if("Polygon"===e.type)for(var U=0,N=La(e.geometry,0);U32640&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((x=[128*y.compositeTextSizes[0].evaluate(s,{},m),128*y.compositeTextSizes[1].evaluate(s,{},m)])[0]>32640||x[1]>32640)&&d(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,v,x,u,a,s,p,e,l.lineStartIndex,l.lineLength,f,m);for(var b=0,w=c;b=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,p=i.get("symbol-sort-key");if(this.features=[],u||l){for(var c=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,y=new Kn(this.zoom),d=0,m=t;d=0;for(var V=0,T=k.sections;V=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u0},Zu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Zu.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Zu.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Zu.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Zu.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Xe("SymbolBucket",Zu,{omit:["layers","collisionBoxArray","features","compareText"]}),Zu.MAX_GLYPHS=65535,Zu.addDynamicAttributes=qu;var Gu=new li({"symbol-placement":new ii(tr.layout_symbol["symbol-placement"]),"symbol-spacing":new ii(tr.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ii(tr.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new oi(tr.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ii(tr.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ii(tr.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new ii(tr.layout_symbol["icon-ignore-placement"]),"icon-optional":new ii(tr.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ii(tr.layout_symbol["icon-rotation-alignment"]),"icon-size":new oi(tr.layout_symbol["icon-size"]),"icon-text-fit":new ii(tr.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ii(tr.layout_symbol["icon-text-fit-padding"]),"icon-image":new oi(tr.layout_symbol["icon-image"]),"icon-rotate":new oi(tr.layout_symbol["icon-rotate"]),"icon-padding":new ii(tr.layout_symbol["icon-padding"]),"icon-keep-upright":new ii(tr.layout_symbol["icon-keep-upright"]),"icon-offset":new oi(tr.layout_symbol["icon-offset"]),"icon-anchor":new oi(tr.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ii(tr.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ii(tr.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ii(tr.layout_symbol["text-rotation-alignment"]),"text-field":new oi(tr.layout_symbol["text-field"]),"text-font":new oi(tr.layout_symbol["text-font"]),"text-size":new oi(tr.layout_symbol["text-size"]),"text-max-width":new oi(tr.layout_symbol["text-max-width"]),"text-line-height":new ii(tr.layout_symbol["text-line-height"]),"text-letter-spacing":new oi(tr.layout_symbol["text-letter-spacing"]),"text-justify":new oi(tr.layout_symbol["text-justify"]),"text-radial-offset":new oi(tr.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ii(tr.layout_symbol["text-variable-anchor"]),"text-anchor":new oi(tr.layout_symbol["text-anchor"]),"text-max-angle":new ii(tr.layout_symbol["text-max-angle"]),"text-writing-mode":new ii(tr.layout_symbol["text-writing-mode"]),"text-rotate":new oi(tr.layout_symbol["text-rotate"]),"text-padding":new ii(tr.layout_symbol["text-padding"]),"text-keep-upright":new ii(tr.layout_symbol["text-keep-upright"]),"text-transform":new oi(tr.layout_symbol["text-transform"]),"text-offset":new oi(tr.layout_symbol["text-offset"]),"text-allow-overlap":new ii(tr.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new ii(tr.layout_symbol["text-ignore-placement"]),"text-optional":new ii(tr.layout_symbol["text-optional"])}),Xu={paint:new li({"icon-opacity":new oi(tr.paint_symbol["icon-opacity"]),"icon-color":new oi(tr.paint_symbol["icon-color"]),"icon-halo-color":new oi(tr.paint_symbol["icon-halo-color"]),"icon-halo-width":new oi(tr.paint_symbol["icon-halo-width"]),"icon-halo-blur":new oi(tr.paint_symbol["icon-halo-blur"]),"icon-translate":new ii(tr.paint_symbol["icon-translate"]),"icon-translate-anchor":new ii(tr.paint_symbol["icon-translate-anchor"]),"text-opacity":new oi(tr.paint_symbol["text-opacity"]),"text-color":new oi(tr.paint_symbol["text-color"],{runtimeType:D,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new oi(tr.paint_symbol["text-halo-color"]),"text-halo-width":new oi(tr.paint_symbol["text-halo-width"]),"text-halo-blur":new oi(tr.paint_symbol["text-halo-blur"]),"text-translate":new ii(tr.paint_symbol["text-translate"]),"text-translate-anchor":new ii(tr.paint_symbol["text-translate-anchor"])}),layout:Gu},Yu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:B,this.defaultValue=t};Yu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Yu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Yu.prototype.outputDefined=function(){return!1},Yu.prototype.serialize=function(){return null},Xe("FormatSectionOverride",Yu,{omit:["defaultValue"]});var Ju=function(t){function e(e){t.call(this,e,Xu)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;othis._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},pl.convert=function(t){return!t||t instanceof pl?t:new pl(t)};var cl=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};cl.prototype.wrap=function(){return new cl(-180==(t=((this.lng- -180)%360+360)%360-180)?180:t,this.lat);var t},cl.prototype.toArray=function(){return[this.lng,this.lat]},cl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},cl.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},cl.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new pl(new cl(this.lng-r,this.lat-e),new cl(this.lng+r,this.lat+e))},cl.convert=function(t){if(t instanceof cl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new cl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new cl(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var hl=2*Math.PI*6371008.8;function fl(t){return hl*Math.cos(t*Math.PI/180)}function yl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var dl=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};dl.fromLngLat=function(t,e){void 0===e&&(e=0);var r=cl.convert(t);return new dl((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,function(t,e){return t/fl(e)}(e,r.lat))},dl.prototype.toLngLat=function(){return new cl(360*this.x-180,yl(this.y))},dl.prototype.toAltitude=function(){return this.z*fl(yl(this.y))},dl.prototype.meterInMercatorCoordinateUnits=function(){return 1/hl*(t=yl(this.y),1/Math.cos(t*Math.PI/180));var t};var ml=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=xl(0,t,t,e,r)};ml.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},ml.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=ll(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=ll(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new gl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new gl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},gl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?xl(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):xl(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},gl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},gl.prototype.children=function(t){if(this.overscaledZ>=t)return[new gl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new gl(e,this.wrap,e,r,n),new gl(e,this.wrap,e,r+1,n),new gl(e,this.wrap,e,r,n+1),new gl(e,this.wrap,e,r+1,n+1)]},gl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=0&&p[3]>=0&&s.insert(a,p[0],p[1],p[2],p[3])}},bl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new es.VectorTile(new Cs(this.rawTileData)).layers,this.sourceLayerCoder=new al(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},bl.prototype.query=function(t,e,n,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=fr(a.filter),l=t.queryGeometry,p=t.queryPadding*s,c=_l(l),h=this.grid.query(c.minX-p,c.minY-p,c.maxX+p,c.maxY+p),f=_l(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-p,f.minY-p,f.maxX+p,f.maxY+p,(function(e,n,i,o){return function(t,e,n,i,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var l=[new r(e,n),new r(e,o),new r(i,o),new r(i,n)];if(t.length>2)for(var p=0,c=l;p=0)return!0;return!1}(o,h)){var f=this.sourceLayerCoder.decode(r),y=this.vtLayers[f].feature(n);if(i.needGeometry){var d=Io(y,!0);if(!i.filter(new Kn(this.tileID.overscaledZ),d,this.tileID.canonical))return}else if(!i.filter(new Kn(this.tileID.overscaledZ),y))return;for(var m=this.getId(y,f),v=0;v=M.maxzoom||"none"!==M.visibility&&(Al(z,this.zoom,r),(y[M.id]=M.createBucket({index:u.bucketLayerIDs.length,layers:z,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(w,m,this.tileID.canonical),u.bucketLayerIDs.push(z.map((function(t){return t.id}))))}}}var P=h(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?n.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){l||(l=t,p=e,V.call(o))})):p={};var C=Object.keys(m.iconDependencies);C.length?n.send("getImages",{icons:C,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){l||(l=t,c=e,V.call(o))})):c={};var B=Object.keys(m.patternDependencies);function V(){if(l)return i(l);if(p&&c&&f){var t=new kl(p),e=new Ws(c,f);for(var n in y){var o=y[n];o instanceof Zu?(Al(o.layers,this.zoom,r),Vu(o,p,t.positions,c,e.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):o.hasPattern&&(o instanceof ms||o instanceof Ua||o instanceof os)&&(Al(o.layers,this.zoom,r),o.addFeatures(m,this.tileID.canonical,e.patternPositions))}this.status="done",i(null,{buckets:s(y).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null})}}B.length?n.send("getImages",{icons:B,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){l||(l=t,f=e,V.call(o))})):f={},V.call(this)};var zl=i.performance,Ml=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},zl.mark(this._marks.start)};function Pl(t,e){var r=function(t,e){return Zn(u(t,{type:"arrayBuffer"}),e)}(t.request,(function(t,r,n,i){t?e(t):r&&e(null,{vectorTile:new es.VectorTile(new Cs(r)),rawData:r,cacheControl:n,expires:i})}));return function(){r.cancel(),e()}}Ml.prototype.finish=function(){zl.mark(this._marks.end);var t=zl.getEntriesByName(this._marks.measure);return 0===t.length&&(zl.measure(this._marks.measure,this._marks.start,this._marks.end),t=zl.getEntriesByName(this._marks.measure),zl.clearMarks(this._marks.start),zl.clearMarks(this._marks.end),zl.clearMeasures(this._marks.measure)),t};var Cl=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||Pl,this.loading={},this.loaded={}};Cl.prototype.loadTile=function(t,e){var r=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new Ml(t.request),o=this.loading[n]=new Il(t);o.abort=this.loadVectorData(t,(function(t,a){if(delete r.loading[n],t||!a)return o.status="done",r.loaded[n]=o,e(t);var s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl);var p={};if(i){var c=i.finish();c&&(p.resourceTiming=JSON.parse(JSON.stringify(c)))}o.vectorTile=a.vectorTile,o.parse(a.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(t,r){if(t||!r)return e(t);e(null,u({rawTileData:s.slice(0)},r,l,p))})),r.loaded=r.loaded||{},r.loaded[n]=o}))},Cl.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},Cl.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},Cl.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var Bl=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return d('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var i=0;i=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Bl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bl.prototype.getPixels=function(){return new ea({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bl.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l=0!=!!e&&t.reverse()}Tl.prototype.loadTile=function(t,e){var r=t.uid,n=t.encoding,i=t.rawImageData,o=Vl&&i instanceof Vl?this.getImageData(i):i,a=new Bl(r,o,n);this.loaded=this.loaded||{},this.loaded[r]=a,e(null,a)},Tl.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var e=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new ea({width:e.width,height:e.height},e.data)},Tl.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var Fl=es.VectorTileFeature.prototype.toGeoJSON,Ol=function(t){this._feature=t,this.extent=8192,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};Ol.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],e=0,n=this._feature.geometry;e>31}function Wl(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),p=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*p*(s-p)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*p/s+c)),Math.min(o,Math.floor(n+(s-u)*p/s+c)),a)}var h=r[2*n+a],f=i,y=o;for(Ql(e,r,i,n),r[2*o+a]>h&&Ql(e,r,i,o);fh;)y--}r[2*i+a]===h?Ql(e,r,i,y):Ql(e,r,++y,o),y<=n&&(i=y+1),n<=y&&(o=y-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};ip.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,l=[0,t.length-1,0],p=[];l.length;){var c=l.pop(),h=l.pop(),f=l.pop();if(h-f<=a)for(var y=f;y<=h;y++)u=e[2*y+1],(s=e[2*y])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[y]);else{var d=Math.floor((f+h)/2);u=e[2*d+1],(s=e[2*d])>=r&&s<=i&&u>=n&&u<=o&&p.push(t[d]);var m=(c+1)%2;(0===c?r<=s:n<=u)&&(l.push(f),l.push(d-1),l.push(m)),(0===c?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(m))}}return p}(this.ids,this.coords,t,e,r,n,this.nodeSize)},ip.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),p=a.pop(),c=a.pop();if(p-c<=o)for(var h=c;h<=p;h++)ep(e[2*h],e[2*h+1],r,n)<=u&&s.push(t[h]);else{var f=Math.floor((c+p)/2),y=e[2*f],d=e[2*f+1];ep(y,d,r,n)<=u&&s.push(t[f]);var m=(l+1)%2;(0===l?r-i<=y:n-i<=d)&&(a.push(c),a.push(f-1),a.push(m)),(0===l?r+i>=y:n+i>=d)&&(a.push(f+1),a.push(p),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var op={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},ap=function(t){this.options=fp(Object.create(op),t),this.trees=new Array(this.options.maxZoom+1)};function sp(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function up(t,e){var r=t.geometry.coordinates,n=r[1];return{x:cp(r[0]),y:hp(n),zoom:1/0,index:e,parentId:-1}}function lp(t){return{type:"Feature",id:t.id,properties:pp(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function pp(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return fp(fp({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function cp(t){return t/360+.5}function hp(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function fp(t,e){for(var r in e)t[r]=e[r];return t}function yp(t){return t.x}function dp(t){return t.y}function mp(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function vp(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)gp(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var p=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,l=e[r],p=e[r+1],c=e[n],h=e[n+1],f=r+3;fa)o=f,a=y;else if(y===a){var d=Math.abs(f-s);di&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function _p(t,e,r,n){for(var i=0;i1?1:r}function Ip(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],l=0;l=r&&y=n)){var d=[];if("Point"===h||"MultiPoint"===h)Ap(c,d,r,n,i);else if("LineString"===h)zp(c,d,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)Pp(c,d,r,n,i,!1);else if("Polygon"===h)Pp(c,d,r,n,i,!0);else if("MultiPolygon"===h)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function zp(t,e,r,n,i,o,a){for(var s,u,l=Mp(t),p=0===i?Bp:Vp,c=t.start,h=0;hr&&(u=p(l,f,y,m,v,r),a&&(l.start=c+s*u)):g>n?x=r&&(u=p(l,f,y,m,v,r),b=!0),x>n&&g<=n&&(u=p(l,f,y,m,v,n),b=!0),!o&&b&&(a&&(l.end=c+s*u),e.push(l),l=Mp(t)),a&&(c+=s)}var w=t.length-3;f=t[w],y=t[w+1],d=t[w+2],(g=0===i?f:y)>=r&&g<=n&&Cp(l,f,y,d),w=l.length-3,o&&w>=3&&(l[w]!==l[0]||l[w+1]!==l[1])&&Cp(l,l[0],l[1],l[2]),l.length&&e.push(l)}function Mp(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Pp(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=p),c>a.maxY&&(a.maxY=c)}return a}function Lp(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;l--){var p=+Date.now();s=this._cluster(s,l),this.trees[l]=new ip(s,yp,dp,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-p)}return r&&console.timeEnd("total time"),this},ap.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],p=0,c=u.range(cp(r),hp(o),cp(i),hp(n));pe&&(h+=d.numPoints||1)}if(h>=o){for(var m=u.x*c,v=u.y*c,g=i&&c>1?this._map(u,!0):null,x=(s<<5)+(e+1)+this.points.length,b=0,w=p;b1)for(var k=0,I=p;k>5},ap.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},ap.prototype._map=function(t,e){if(t.numPoints)return e?fp({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?fp({},n):n},qp.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},qp.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,l=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<1&&console.time("creation"),h=this.tiles[c]=Op(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===u.maxZoom||e===i)continue;var y=1<1&&console.time("clipping");var d,m,v,g,x,b,w=.5*u.buffer/u.extent,_=.5-w,S=.5+w,k=1+w;d=m=v=g=null,x=Ip(t,p,r-w,r+S,0,h.minX,h.maxX,u),b=Ip(t,p,r+_,r+k,0,h.minX,h.maxX,u),t=null,x&&(d=Ip(x,p,n-w,n+S,1,h.minY,h.maxY,u),m=Ip(x,p,n+_,n+k,1,h.minY,h.maxY,u),x=null),b&&(v=Ip(b,p,n-w,n+S,1,h.minY,h.maxY,u),g=Ip(b,p,n+_,n+k,1,h.minY,h.maxY,u),b=null),l>1&&console.timeEnd("clipping"),s.push(d||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(v||[],e+1,2*r+1,2*n),s.push(g||[],e+1,2*r+1,2*n+1)}}},qp.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,l=t,p=e,c=r;!u&&l>0;)l--,p=Math.floor(p/2),c=Math.floor(c/2),u=this.tiles[Rp(l,p,c)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,p,c),o>1&&console.time("drilling down"),this.splitTile(u.source,l,p,c,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Dp(this.tiles[s],i):null):null};var Np=function(t){function e(e,r,n,i){t.call(this,e,r,n,Up),i&&(this.loadGeoJSON=i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},e.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var e=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new Ml(r.request);this.loadGeoJSON(r,(function(i,o){if(i||!o)return e(i);if("object"!=typeof o)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n {
- // Set the worker URL for strict CSP environments
- // https://docs.mapbox.com/mapbox-gl-js/guides/browsers-and-testing/#strict-csp-environments
- // note: need the v1 version of the worker
- mapboxgl.workerUrl = '/mapbox-gl-csp-worker.js';
-
if (!mapboxAPIKey) {
return;
}
@@ -87,7 +82,7 @@ const MapSelection = ({
);
From 3a57fae84d60f5a1bb8ad8c71d61ddc157009645 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 07:30:15 -0800
Subject: [PATCH 23/32] update mapbox to v3
add early return in validate for testing feature before schema is brought over
---
package-lock.json | 199 +++++++++++++++++++---------------
package.json | 2 +-
src/utils/validateProtocol.js | 2 +
3 files changed, 113 insertions(+), 90 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 6e4ed4ab1..c1a6cd35d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,7 @@
"version": "6.5.3",
"hasInstallScript": true,
"dependencies": {
- "mapbox-gl": "^1.13.0"
+ "mapbox-gl": "^3.9.3"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
@@ -3773,34 +3773,6 @@
"node": ">= 10.0.0"
}
},
- "node_modules/@mapbox/geojson-rewind": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz",
- "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==",
- "dependencies": {
- "get-stream": "^6.0.1",
- "minimist": "^1.2.6"
- },
- "bin": {
- "geojson-rewind": "geojson-rewind"
- }
- },
- "node_modules/@mapbox/geojson-rewind/node_modules/get-stream": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
- "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/@mapbox/geojson-types": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz",
- "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw=="
- },
"node_modules/@mapbox/jsonlint-lines-primitives": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
@@ -3810,12 +3782,9 @@
}
},
"node_modules/@mapbox/mapbox-gl-supported": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz",
- "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==",
- "peerDependencies": {
- "mapbox-gl": ">=0.32.1 <2.0.0"
- }
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-3.0.0.tgz",
+ "integrity": "sha512-2XghOwu16ZwPJLOFVuIOaLbN0iKMn867evzXFyf0P22dqugezfJwLmdanAgU25ITvz1TvOfVP4jsDImlDJzcWg=="
},
"node_modules/@mapbox/point-geometry": {
"version": "0.1.0",
@@ -3823,14 +3792,14 @@
"integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
},
"node_modules/@mapbox/tiny-sdf": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz",
- "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw=="
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz",
+ "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA=="
},
"node_modules/@mapbox/unitbezier": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
- "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz",
+ "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw=="
},
"node_modules/@mapbox/vector-tile": {
"version": "1.3.1",
@@ -4776,6 +4745,19 @@
"@types/node": "*"
}
},
+ "node_modules/@types/geojson": {
+ "version": "7946.0.15",
+ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz",
+ "integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA=="
+ },
+ "node_modules/@types/geojson-vt": {
+ "version": "3.2.5",
+ "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz",
+ "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
"node_modules/@types/glob": {
"version": "7.1.3",
"integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
@@ -4858,6 +4840,21 @@
"integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==",
"dev": true
},
+ "node_modules/@types/mapbox__point-geometry": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz",
+ "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA=="
+ },
+ "node_modules/@types/mapbox__vector-tile": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz",
+ "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==",
+ "dependencies": {
+ "@types/geojson": "*",
+ "@types/mapbox__point-geometry": "*",
+ "@types/pbf": "*"
+ }
+ },
"node_modules/@types/mdast": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz",
@@ -4905,6 +4902,11 @@
"integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==",
"dev": true
},
+ "node_modules/@types/pbf": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz",
+ "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA=="
+ },
"node_modules/@types/plist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.2.tgz",
@@ -4983,6 +4985,14 @@
"integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==",
"dev": true
},
+ "node_modules/@types/supercluster": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
+ "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
"node_modules/@types/tapable": {
"version": "1.0.7",
"integrity": "sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ==",
@@ -8140,6 +8150,11 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/cheap-ruler": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/cheap-ruler/-/cheap-ruler-4.0.0.tgz",
+ "integrity": "sha512-0BJa8f4t141BYKQyn9NSQt1PguFQXMXwZiA5shfoaBYHAb2fFk2RAX+tiWMoQU+Agtzt3mdt0JtuyshAXqZ+Vw=="
+ },
"node_modules/check-types": {
"version": "11.1.2",
"integrity": "sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==",
@@ -11387,9 +11402,9 @@
}
},
"node_modules/earcut": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
- "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz",
+ "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw=="
},
"node_modules/ecc-jsbn": {
"version": "0.1.2",
@@ -14690,9 +14705,9 @@
}
},
"node_modules/geojson-vt": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz",
- "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz",
+ "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A=="
},
"node_modules/get-caller-file": {
"version": "2.0.5",
@@ -19733,9 +19748,9 @@
}
},
"node_modules/kdbush": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz",
- "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
+ "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA=="
},
"node_modules/kew": {
"version": "0.7.0",
@@ -20527,36 +20542,38 @@
}
},
"node_modules/mapbox-gl": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.0.tgz",
- "integrity": "sha512-g8zlzuJxYJqbOPXT19/UBYpVrcefBQ06F/Cbj0fyEfFnFesDcU3cFTxd75/FZ6Upx2ZEjCsD61CHxrcxZidVpA==",
+ "version": "3.9.3",
+ "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-3.9.3.tgz",
+ "integrity": "sha512-31mh95f35srpBMxAP32F9dKQXz7pT5VxQA5r6bFY6Aa5G6Z6NC/SVOTyWR+G/wY8wXWTHAnOaAAf5UkD5++/Kg==",
"dependencies": {
- "@mapbox/geojson-rewind": "^0.5.0",
- "@mapbox/geojson-types": "^1.0.2",
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
- "@mapbox/mapbox-gl-supported": "^1.5.0",
+ "@mapbox/mapbox-gl-supported": "^3.0.0",
"@mapbox/point-geometry": "^0.1.0",
- "@mapbox/tiny-sdf": "^1.1.1",
- "@mapbox/unitbezier": "^0.0.0",
+ "@mapbox/tiny-sdf": "^2.0.6",
+ "@mapbox/unitbezier": "^0.0.1",
"@mapbox/vector-tile": "^1.3.1",
"@mapbox/whoots-js": "^3.1.0",
+ "@types/geojson": "^7946.0.15",
+ "@types/geojson-vt": "^3.2.5",
+ "@types/mapbox__point-geometry": "^0.1.4",
+ "@types/mapbox__vector-tile": "^1.3.4",
+ "@types/pbf": "^3.0.5",
+ "@types/supercluster": "^7.1.3",
+ "cheap-ruler": "^4.0.0",
"csscolorparser": "~1.0.3",
- "earcut": "^2.2.2",
- "geojson-vt": "^3.2.1",
- "gl-matrix": "^3.2.1",
+ "earcut": "^3.0.0",
+ "geojson-vt": "^4.0.2",
+ "gl-matrix": "^3.4.3",
"grid-index": "^1.1.0",
- "minimist": "^1.2.5",
+ "kdbush": "^4.0.2",
"murmurhash-js": "^1.0.0",
"pbf": "^3.2.1",
- "potpack": "^1.0.1",
- "quickselect": "^2.0.0",
- "rw": "^1.3.3",
- "supercluster": "^7.1.0",
- "tinyqueue": "^2.0.3",
- "vt-pbf": "^3.1.1"
- },
- "engines": {
- "node": ">=6.4.0"
+ "potpack": "^2.0.0",
+ "quickselect": "^3.0.0",
+ "serialize-to-js": "^3.1.2",
+ "supercluster": "^8.0.1",
+ "tinyqueue": "^3.0.0",
+ "vt-pbf": "^3.1.3"
}
},
"node_modules/matcher": {
@@ -21231,6 +21248,7 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -27940,9 +27958,9 @@
}
},
"node_modules/potpack": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz",
- "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz",
+ "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw=="
},
"node_modules/prelude-ls": {
"version": "1.2.1",
@@ -28309,9 +28327,9 @@
}
},
"node_modules/quickselect": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
- "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
+ "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g=="
},
"node_modules/raf": {
"version": "3.4.1",
@@ -32439,11 +32457,6 @@
"aproba": "^1.1.1"
}
},
- "node_modules/rw": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
- "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
- },
"node_modules/rxjs": {
"version": "6.6.7",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
@@ -33005,6 +33018,14 @@
"randombytes": "^2.1.0"
}
},
+ "node_modules/serialize-to-js": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/serialize-to-js/-/serialize-to-js-3.1.2.tgz",
+ "integrity": "sha512-owllqNuDDEimQat7EPG0tH7JjO090xKNzUtYz6X+Sk2BXDnOCilDdNLwjWeFywG9xkJul1ULvtUQa9O4pUaY0w==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
"node_modules/serve-index": {
"version": "1.9.1",
"integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=",
@@ -35147,11 +35168,11 @@
}
},
"node_modules/supercluster": {
- "version": "7.1.5",
- "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz",
- "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz",
+ "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==",
"dependencies": {
- "kdbush": "^3.0.0"
+ "kdbush": "^4.0.2"
}
},
"node_modules/supports-color": {
@@ -36106,9 +36127,9 @@
"dev": true
},
"node_modules/tinyqueue": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz",
- "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA=="
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz",
+ "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g=="
},
"node_modules/tippy.js": {
"version": "6.3.7",
diff --git a/package.json b/package.json
index 56b821c5d..1bba765f4 100644
--- a/package.json
+++ b/package.json
@@ -271,6 +271,6 @@
}
},
"dependencies": {
- "mapbox-gl": "^1.13.0"
+ "mapbox-gl": "^3.9.3"
}
}
diff --git a/src/utils/validateProtocol.js b/src/utils/validateProtocol.js
index 85101c24a..c8cdc0ccd 100644
--- a/src/utils/validateProtocol.js
+++ b/src/utils/validateProtocol.js
@@ -23,6 +23,8 @@ const asyncValidateLogic = async (protocol) => new Promise((resolve, reject) =>
const validateProtocol = (protocol) => {
log.debug('validateProtocol()');
+ // TODO: REMOVE THIS when we bring over the new schema
+ return Promise.resolve(protocol);
return Promise.all([
asyncValidateLogic(protocol),
asyncValidateSchema(protocol),
From 652ca585297574ddcea334c910a4e181d3f4866a Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 11:40:41 -0800
Subject: [PATCH 24/32] working map as field to save center and zoom
---
package-lock.json | 199 ++++++++----------
package.json | 2 +-
.../Form/Fields/Geospatial/MapSelection.js | 51 +++++
.../Form/Fields/Geospatial/MapView.js | 164 +++++++++++++++
src/components/StageEditor/Interfaces.js | 2 -
src/components/sections/MapOptions.js | 24 ++-
src/components/sections/MapSelection.js | 125 -----------
src/components/sections/index.js | 1 -
8 files changed, 327 insertions(+), 241 deletions(-)
create mode 100644 src/components/Form/Fields/Geospatial/MapSelection.js
create mode 100644 src/components/Form/Fields/Geospatial/MapView.js
delete mode 100644 src/components/sections/MapSelection.js
diff --git a/package-lock.json b/package-lock.json
index c1a6cd35d..6e4ed4ab1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,7 @@
"version": "6.5.3",
"hasInstallScript": true,
"dependencies": {
- "mapbox-gl": "^3.9.3"
+ "mapbox-gl": "^1.13.0"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
@@ -3773,6 +3773,34 @@
"node": ">= 10.0.0"
}
},
+ "node_modules/@mapbox/geojson-rewind": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz",
+ "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==",
+ "dependencies": {
+ "get-stream": "^6.0.1",
+ "minimist": "^1.2.6"
+ },
+ "bin": {
+ "geojson-rewind": "geojson-rewind"
+ }
+ },
+ "node_modules/@mapbox/geojson-rewind/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@mapbox/geojson-types": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz",
+ "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw=="
+ },
"node_modules/@mapbox/jsonlint-lines-primitives": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
@@ -3782,9 +3810,12 @@
}
},
"node_modules/@mapbox/mapbox-gl-supported": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-3.0.0.tgz",
- "integrity": "sha512-2XghOwu16ZwPJLOFVuIOaLbN0iKMn867evzXFyf0P22dqugezfJwLmdanAgU25ITvz1TvOfVP4jsDImlDJzcWg=="
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz",
+ "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==",
+ "peerDependencies": {
+ "mapbox-gl": ">=0.32.1 <2.0.0"
+ }
},
"node_modules/@mapbox/point-geometry": {
"version": "0.1.0",
@@ -3792,14 +3823,14 @@
"integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
},
"node_modules/@mapbox/tiny-sdf": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz",
- "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA=="
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz",
+ "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw=="
},
"node_modules/@mapbox/unitbezier": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz",
- "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw=="
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
+ "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
},
"node_modules/@mapbox/vector-tile": {
"version": "1.3.1",
@@ -4745,19 +4776,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/geojson": {
- "version": "7946.0.15",
- "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz",
- "integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA=="
- },
- "node_modules/@types/geojson-vt": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz",
- "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==",
- "dependencies": {
- "@types/geojson": "*"
- }
- },
"node_modules/@types/glob": {
"version": "7.1.3",
"integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
@@ -4840,21 +4858,6 @@
"integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==",
"dev": true
},
- "node_modules/@types/mapbox__point-geometry": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz",
- "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA=="
- },
- "node_modules/@types/mapbox__vector-tile": {
- "version": "1.3.4",
- "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz",
- "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==",
- "dependencies": {
- "@types/geojson": "*",
- "@types/mapbox__point-geometry": "*",
- "@types/pbf": "*"
- }
- },
"node_modules/@types/mdast": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz",
@@ -4902,11 +4905,6 @@
"integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==",
"dev": true
},
- "node_modules/@types/pbf": {
- "version": "3.0.5",
- "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz",
- "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA=="
- },
"node_modules/@types/plist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.2.tgz",
@@ -4985,14 +4983,6 @@
"integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==",
"dev": true
},
- "node_modules/@types/supercluster": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
- "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
- "dependencies": {
- "@types/geojson": "*"
- }
- },
"node_modules/@types/tapable": {
"version": "1.0.7",
"integrity": "sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ==",
@@ -8150,11 +8140,6 @@
"url": "https://github.com/sponsors/wooorm"
}
},
- "node_modules/cheap-ruler": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/cheap-ruler/-/cheap-ruler-4.0.0.tgz",
- "integrity": "sha512-0BJa8f4t141BYKQyn9NSQt1PguFQXMXwZiA5shfoaBYHAb2fFk2RAX+tiWMoQU+Agtzt3mdt0JtuyshAXqZ+Vw=="
- },
"node_modules/check-types": {
"version": "11.1.2",
"integrity": "sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==",
@@ -11402,9 +11387,9 @@
}
},
"node_modules/earcut": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz",
- "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw=="
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
+ "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
},
"node_modules/ecc-jsbn": {
"version": "0.1.2",
@@ -14705,9 +14690,9 @@
}
},
"node_modules/geojson-vt": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz",
- "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A=="
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz",
+ "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
},
"node_modules/get-caller-file": {
"version": "2.0.5",
@@ -19748,9 +19733,9 @@
}
},
"node_modules/kdbush": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
- "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA=="
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz",
+ "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
},
"node_modules/kew": {
"version": "0.7.0",
@@ -20542,38 +20527,36 @@
}
},
"node_modules/mapbox-gl": {
- "version": "3.9.3",
- "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-3.9.3.tgz",
- "integrity": "sha512-31mh95f35srpBMxAP32F9dKQXz7pT5VxQA5r6bFY6Aa5G6Z6NC/SVOTyWR+G/wY8wXWTHAnOaAAf5UkD5++/Kg==",
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.0.tgz",
+ "integrity": "sha512-g8zlzuJxYJqbOPXT19/UBYpVrcefBQ06F/Cbj0fyEfFnFesDcU3cFTxd75/FZ6Upx2ZEjCsD61CHxrcxZidVpA==",
"dependencies": {
+ "@mapbox/geojson-rewind": "^0.5.0",
+ "@mapbox/geojson-types": "^1.0.2",
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
- "@mapbox/mapbox-gl-supported": "^3.0.0",
+ "@mapbox/mapbox-gl-supported": "^1.5.0",
"@mapbox/point-geometry": "^0.1.0",
- "@mapbox/tiny-sdf": "^2.0.6",
- "@mapbox/unitbezier": "^0.0.1",
+ "@mapbox/tiny-sdf": "^1.1.1",
+ "@mapbox/unitbezier": "^0.0.0",
"@mapbox/vector-tile": "^1.3.1",
"@mapbox/whoots-js": "^3.1.0",
- "@types/geojson": "^7946.0.15",
- "@types/geojson-vt": "^3.2.5",
- "@types/mapbox__point-geometry": "^0.1.4",
- "@types/mapbox__vector-tile": "^1.3.4",
- "@types/pbf": "^3.0.5",
- "@types/supercluster": "^7.1.3",
- "cheap-ruler": "^4.0.0",
"csscolorparser": "~1.0.3",
- "earcut": "^3.0.0",
- "geojson-vt": "^4.0.2",
- "gl-matrix": "^3.4.3",
+ "earcut": "^2.2.2",
+ "geojson-vt": "^3.2.1",
+ "gl-matrix": "^3.2.1",
"grid-index": "^1.1.0",
- "kdbush": "^4.0.2",
+ "minimist": "^1.2.5",
"murmurhash-js": "^1.0.0",
"pbf": "^3.2.1",
- "potpack": "^2.0.0",
- "quickselect": "^3.0.0",
- "serialize-to-js": "^3.1.2",
- "supercluster": "^8.0.1",
- "tinyqueue": "^3.0.0",
- "vt-pbf": "^3.1.3"
+ "potpack": "^1.0.1",
+ "quickselect": "^2.0.0",
+ "rw": "^1.3.3",
+ "supercluster": "^7.1.0",
+ "tinyqueue": "^2.0.3",
+ "vt-pbf": "^3.1.1"
+ },
+ "engines": {
+ "node": ">=6.4.0"
}
},
"node_modules/matcher": {
@@ -21248,7 +21231,6 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
- "dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -27958,9 +27940,9 @@
}
},
"node_modules/potpack": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz",
- "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw=="
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz",
+ "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
},
"node_modules/prelude-ls": {
"version": "1.2.1",
@@ -28327,9 +28309,9 @@
}
},
"node_modules/quickselect": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
- "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g=="
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
+ "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
},
"node_modules/raf": {
"version": "3.4.1",
@@ -32457,6 +32439,11 @@
"aproba": "^1.1.1"
}
},
+ "node_modules/rw": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
+ },
"node_modules/rxjs": {
"version": "6.6.7",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
@@ -33018,14 +33005,6 @@
"randombytes": "^2.1.0"
}
},
- "node_modules/serialize-to-js": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/serialize-to-js/-/serialize-to-js-3.1.2.tgz",
- "integrity": "sha512-owllqNuDDEimQat7EPG0tH7JjO090xKNzUtYz6X+Sk2BXDnOCilDdNLwjWeFywG9xkJul1ULvtUQa9O4pUaY0w==",
- "engines": {
- "node": ">=4.0.0"
- }
- },
"node_modules/serve-index": {
"version": "1.9.1",
"integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=",
@@ -35168,11 +35147,11 @@
}
},
"node_modules/supercluster": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz",
- "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==",
+ "version": "7.1.5",
+ "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz",
+ "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
"dependencies": {
- "kdbush": "^4.0.2"
+ "kdbush": "^3.0.0"
}
},
"node_modules/supports-color": {
@@ -36127,9 +36106,9 @@
"dev": true
},
"node_modules/tinyqueue": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz",
- "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g=="
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz",
+ "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA=="
},
"node_modules/tippy.js": {
"version": "6.3.7",
diff --git a/package.json b/package.json
index 1bba765f4..56b821c5d 100644
--- a/package.json
+++ b/package.json
@@ -271,6 +271,6 @@
}
},
"dependencies": {
- "mapbox-gl": "^3.9.3"
+ "mapbox-gl": "^1.13.0"
}
}
diff --git a/src/components/Form/Fields/Geospatial/MapSelection.js b/src/components/Form/Fields/Geospatial/MapSelection.js
new file mode 100644
index 000000000..1df71a33e
--- /dev/null
+++ b/src/components/Form/Fields/Geospatial/MapSelection.js
@@ -0,0 +1,51 @@
+import React, { useState } from 'react';
+import PropTypes from 'prop-types';
+import { createPortal } from 'react-dom';
+import Button from '@codaco/ui/lib/components/Button';
+
+import MapView from './MapView';
+
+const MapSelection = ({
+ input: {
+ value,
+ onChange,
+ },
+}) => {
+ const [showMap, setShowMap] = useState(false);
+
+ return (
+ <>
+ setShowMap(true)}
+ color="primary"
+ size="small"
+ >
+ Open Map
+
+
+ {showMap && createPortal(
+ setShowMap(false)}
+ />,
+ document.body,
+ )}
+ >
+ );
+};
+MapSelection.propTypes = {
+ input: PropTypes.shape({
+ value: PropTypes.shape({
+ center: PropTypes.arrayOf(PropTypes.number),
+ tokenAssetId: PropTypes.string,
+ initialZoom: PropTypes.number,
+ dataSourceAssetId: PropTypes.string,
+ color: PropTypes.string,
+ targetFeatureProperty: PropTypes.string,
+ }),
+ onChange: PropTypes.func.isRequired,
+ }).isRequired,
+};
+
+export default MapSelection;
diff --git a/src/components/Form/Fields/Geospatial/MapView.js b/src/components/Form/Fields/Geospatial/MapView.js
new file mode 100644
index 000000000..613b404f1
--- /dev/null
+++ b/src/components/Form/Fields/Geospatial/MapView.js
@@ -0,0 +1,164 @@
+import React, { useEffect, useRef, useState } from 'react';
+import PropTypes from 'prop-types';
+import mapboxgl from 'mapbox-gl';
+import { useSelector } from 'react-redux';
+import { Layout, Section } from '@components/EditorLayout';
+import { AnimatePresence, motion } from 'framer-motion';
+import ControlBar from '@components/ControlBar';
+import Screen from '@components/Screen/Screen';
+import Button from '@codaco/ui/lib/components/Button';
+import { screenVariants } from '@components/Screens/Screens';
+import { get } from 'lodash';
+import { getAssetManifest } from '@selectors/protocol';
+import 'mapbox-gl/dist/mapbox-gl.css';
+
+const MapView = ({ mapOptions, onChange, close }) => {
+ const { tokenAssetId } = mapOptions;
+ const assetManifest = useSelector(getAssetManifest);
+ const mapboxAPIKey = get(assetManifest, [tokenAssetId, 'value'], '');
+
+ const mapRef = useRef(null);
+ const mapContainerRef = useRef(null);
+
+ const [center, setCenter] = useState(mapOptions.center || [0, 0]);
+ const [zoom, setZoom] = useState(mapOptions.initialZoom || 0);
+
+ const saveMapSelection = (newCenter, newZoom) => {
+ onChange({
+ ...mapOptions,
+ center: newCenter,
+ initialZoom: newZoom,
+ });
+ };
+
+ const cancelButton = (
+ close()}
+ key="cancel"
+ >
+ Cancel
+
+ );
+
+ const saveButton = (
+ {
+ saveMapSelection(center, zoom);
+ close();
+ }}
+ key="save"
+ iconPosition="right"
+ icon="arrow-right"
+ >
+ Finished Editing
+
+ );
+ useEffect(() => {
+ if (!mapboxAPIKey || !mapContainerRef.current) {
+ console.error('Mapbox API key is missing or container is not available');
+ return;
+ }
+
+ mapboxgl.accessToken = mapboxAPIKey;
+
+ const initializeMap = () => {
+ if (mapContainerRef.current && !mapRef.current) {
+ mapRef.current = new mapboxgl.Map({
+ container: mapContainerRef.current,
+ style: 'mapbox://styles/mapbox/streets-v11',
+ center,
+ zoom,
+ });
+
+ mapRef.current.on('move', () => {
+ const mapCenter = mapRef.current.getCenter();
+ const mapZoom = mapRef.current.getZoom();
+
+ setCenter([mapCenter.lng, mapCenter.lat]);
+ setZoom(mapZoom);
+ });
+ }
+ };
+
+ initializeMap();
+
+ return () => {
+ if (mapRef.current) {
+ mapRef.current.remove();
+ mapRef.current = null;
+ }
+ };
+ }, [mapOptions, mapboxAPIKey]);
+
+ return (
+
+
+
+
+ Initial Map View
+
+
+ )}
+ footer={(
+
+ )}
+ >
+
+
+
+ Longitude:
+ {' '}
+ {center[0].toFixed(4)}
+ {' '}
+ | Latitude:
+ {' '}
+ {center[1].toFixed(4)}
+ {' '}
+ | Zoom:
+ {' '}
+ {zoom.toFixed(2)}
+
+
+
+
+
+
+
+ );
+};
+
+MapView.defaultProps = {
+ mapOptions: {
+ center: [0, 0],
+ tokenAssetId: '',
+ initialZoom: 0,
+ dataSourceAssetId: '',
+ color: '',
+ targetFeatureProperty: '',
+ },
+};
+
+MapView.propTypes = {
+ mapOptions: PropTypes.shape({
+ center: PropTypes.arrayOf(PropTypes.number),
+ tokenAssetId: PropTypes.string,
+ initialZoom: PropTypes.number,
+ dataSourceAssetId: PropTypes.string,
+ color: PropTypes.string,
+ targetFeatureProperty: PropTypes.string,
+ }),
+};
+
+export default MapView;
diff --git a/src/components/StageEditor/Interfaces.js b/src/components/StageEditor/Interfaces.js
index 805c6ce05..7380828cf 100644
--- a/src/components/StageEditor/Interfaces.js
+++ b/src/components/StageEditor/Interfaces.js
@@ -28,7 +28,6 @@ import {
TieStrengthCensusPrompts,
Title,
MapOptions,
- MapSelection,
GeospatialPrompts,
} from '@components/sections';
import { FilteredNodeType } from '@components/sections/NodeType';
@@ -196,7 +195,6 @@ const Geospatial = {
sections: [
NodeType,
MapOptions,
- MapSelection,
GeospatialPrompts,
],
documentation: 'https://documentation.networkcanvas.com/interface-documentation/tie-strength-census/', // TODO
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 0c4c2cb16..7bab8a32a 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { compose } from 'recompose';
-
+import withDisabledAPIKeyRequired from '@components/enhancers/withDisabledAPIKeyRequired';
import NativeSelect from '@components/Form/Fields/NativeSelect';
import withMapFormToProps from '@components/enhancers/withMapFormToProps';
@@ -11,10 +11,11 @@ import ValidatedField from '../Form/ValidatedField';
import ColorPicker from '../Form/Fields/ColorPicker';
import GeoDataSource from '../Form/Fields/Geospatial/GeoDataSource';
import GeoAPIKey from '../Form/Fields/Geospatial/GeoAPIKey';
+import MapSelection from '../Form/Fields/Geospatial/MapSelection';
import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
const MapOptions = (props) => {
- const { mapOptions } = props;
+ const { mapOptions, disabled } = props;
const { variables: variableOptions } = useVariablesFromExternalData(mapOptions?.dataSourceAssetId, true, 'geojson');
@@ -87,6 +88,23 @@ const MapOptions = (props) => {
label="Which color would you like to use for this stage's map outlines and selections?"
/>
+
+ When the map is first loaded, it will be centered at the initial center and zoom level
+ configured here. Resetting the map will return it to this view.
+
+ )}
+ disabled={disabled}
+ >
+
+
>
);
@@ -111,8 +129,10 @@ MapOptions.propTypes = {
color: PropTypes.string,
targetFeatureProperty: PropTypes.string,
}),
+ disabled: PropTypes.bool.isRequired,
};
export default compose(
withMapFormToProps(['mapOptions']),
+ withDisabledAPIKeyRequired,
)(MapOptions);
diff --git a/src/components/sections/MapSelection.js b/src/components/sections/MapSelection.js
deleted file mode 100644
index 25fa1628b..000000000
--- a/src/components/sections/MapSelection.js
+++ /dev/null
@@ -1,125 +0,0 @@
-import React, { useEffect, useRef, useState } from 'react';
-import PropTypes from 'prop-types';
-import { compose } from 'recompose';
-import withDisabledAPIKeyRequired from '@components/enhancers/withDisabledAPIKeyRequired';
-import mapboxgl from 'mapbox-gl';
-import { useSelector } from 'react-redux';
-import { get } from 'lodash';
-import { getAssetManifest } from '@selectors/protocol';
-import { Section } from '../EditorLayout';
-import withMapFormToProps from '../enhancers/withMapFormToProps';
-import 'mapbox-gl/dist/mapbox-gl.css';
-
-const MapSelection = ({
- mapOptions,
- disabled,
-}) => {
- const { tokenAssetId } = mapOptions;
- const assetManifest = useSelector(getAssetManifest);
- const mapboxAPIKey = get(assetManifest, [tokenAssetId, 'value'], '');
-
- const mapRef = useRef(null);
- const mapContainerRef = useRef(null);
-
- const [center, setCenter] = useState(mapOptions.center || [0, 0]);
- const [zoom, setZoom] = useState(mapOptions.initialZoom || 0);
-
- // test dispatch
-
- useEffect(() => {
- if (!mapboxAPIKey) {
- return;
- }
-
- // Initialize the Mapbox map
- mapboxgl.accessToken = mapboxAPIKey;
- mapRef.current = new mapboxgl.Map({
- container: mapContainerRef.current,
- style: 'mapbox://styles/mapbox/streets-v11',
- center,
- zoom,
- });
-
- mapRef.current.on('move', () => {
- // get the current center coordinates and zoom level from the map
- const mapCenter = mapRef.current.getCenter();
- const mapZoom = mapRef.current.getZoom();
-
- setCenter([mapCenter.lng, mapCenter.lat]);
-
- setZoom(mapZoom);
- });
-
- // Cleanup the map on component unmount
- return () => {
- mapRef.current.remove();
- };
- }, [mapOptions]);
-
- return (
-
- When the map is first loaded, it will be centered at the initial center and zoom level
- configured here. Resetting the map will return it to this view.
-
- )}
- disabled={disabled}
- >
-
- Longitude:
- {' '}
- {center[0].toFixed(4)}
- {' '}
- | Latitude:
- {' '}
- {center[1].toFixed(4)}
- {' '}
- | Zoom:
- {' '}
- {zoom.toFixed(2)}
-
-
-
- );
-};
-
-MapSelection.defaultProps = {
- mapOptions: {
- center: [0, 0],
- toketokenAssetIdn: '',
- initialZoom: 0,
- dataSourceAssetId: '',
- color: '',
- targetFeatureProperty: '',
- },
- meta: PropTypes.shape({
- value: PropTypes.string,
- name: PropTypes.string,
- }),
-};
-
-MapSelection.propTypes = {
- mapOptions: PropTypes.shape({
- center: PropTypes.arrayOf(PropTypes.number),
- initialZoom: PropTypes.number,
- dataSourceAssetId: PropTypes.string,
- color: PropTypes.string,
- targetFeatureProperty: PropTypes.string,
- tokenAssetId: PropTypes.string,
- }),
- disabled: PropTypes.bool.isRequired,
- meta: PropTypes.shape({
- value: PropTypes.string,
- name: PropTypes.string,
- }),
-};
-
-export default compose(
- withMapFormToProps('mapOptions'),
- withDisabledAPIKeyRequired,
-)(MapSelection);
diff --git a/src/components/sections/index.js b/src/components/sections/index.js
index b928765cc..32d71cec6 100644
--- a/src/components/sections/index.js
+++ b/src/components/sections/index.js
@@ -26,5 +26,4 @@ export { default as SkipLogic } from './SkipLogic';
export { default as Title } from './Title';
export { default as InterviewScript } from './InterviewScript';
export { default as MapOptions } from './MapOptions';
-export { default as MapSelection } from './MapSelection';
export { default as GeospatialPrompts } from './GeospatialPrompts/GeospatialPrompts';
From eb73e50903a783d431885abc8b127af78f8402be Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 12:03:43 -0800
Subject: [PATCH 25/32] implement selecting style, conditionally render save
button
---
.../Form/Fields/Geospatial/MapSelection.js | 3 +-
.../Form/Fields/Geospatial/MapView.js | 47 ++++++++++-------
src/components/sections/MapOptions.js | 52 ++++++++++++++-----
3 files changed, 67 insertions(+), 35 deletions(-)
diff --git a/src/components/Form/Fields/Geospatial/MapSelection.js b/src/components/Form/Fields/Geospatial/MapSelection.js
index 1df71a33e..caf04083b 100644
--- a/src/components/Form/Fields/Geospatial/MapSelection.js
+++ b/src/components/Form/Fields/Geospatial/MapSelection.js
@@ -20,7 +20,7 @@ const MapSelection = ({
color="primary"
size="small"
>
- Open Map
+ Edit Map View
{showMap && createPortal(
@@ -43,6 +43,7 @@ MapSelection.propTypes = {
dataSourceAssetId: PropTypes.string,
color: PropTypes.string,
targetFeatureProperty: PropTypes.string,
+ style: PropTypes.string,
}),
onChange: PropTypes.func.isRequired,
}).isRequired,
diff --git a/src/components/Form/Fields/Geospatial/MapView.js b/src/components/Form/Fields/Geospatial/MapView.js
index 613b404f1..d624aca46 100644
--- a/src/components/Form/Fields/Geospatial/MapView.js
+++ b/src/components/Form/Fields/Geospatial/MapView.js
@@ -13,7 +13,7 @@ import { getAssetManifest } from '@selectors/protocol';
import 'mapbox-gl/dist/mapbox-gl.css';
const MapView = ({ mapOptions, onChange, close }) => {
- const { tokenAssetId } = mapOptions;
+ const { tokenAssetId, style } = mapOptions;
const assetManifest = useSelector(getAssetManifest);
const mapboxAPIKey = get(assetManifest, [tokenAssetId, 'value'], '');
@@ -52,12 +52,19 @@ const MapView = ({ mapOptions, onChange, close }) => {
iconPosition="right"
icon="arrow-right"
>
- Finished Editing
+ Save Changes
);
+
+ const isMapChanged = center !== mapOptions.center || zoom !== mapOptions.initialZoom;
+
+ const controlButtons = [
+ cancelButton,
+ ...(isMapChanged ? [saveButton] : []),
+ ];
+
useEffect(() => {
if (!mapboxAPIKey || !mapContainerRef.current) {
- console.error('Mapbox API key is missing or container is not available');
return;
}
@@ -67,7 +74,7 @@ const MapView = ({ mapOptions, onChange, close }) => {
if (mapContainerRef.current && !mapRef.current) {
mapRef.current = new mapboxgl.Map({
container: mapContainerRef.current,
- style: 'mapbox://styles/mapbox/streets-v11',
+ style: style || 'mapbox://styles/mapbox/streets-v12',
center,
zoom,
});
@@ -111,26 +118,22 @@ const MapView = ({ mapOptions, onChange, close }) => {
)}
footer={(
)}
>
-
-
- Longitude:
- {' '}
- {center[0].toFixed(4)}
- {' '}
- | Latitude:
- {' '}
- {center[1].toFixed(4)}
- {' '}
- | Zoom:
- {' '}
- {zoom.toFixed(2)}
-
-
+
+ When the map is first loaded, it will be centered at the
+ initial center and zoom level configured on this map.
+ Resetting the map will return it to this view.
+
+ )}
+ >
+
@@ -147,6 +150,7 @@ MapView.defaultProps = {
dataSourceAssetId: '',
color: '',
targetFeatureProperty: '',
+ style: '',
},
};
@@ -158,7 +162,10 @@ MapView.propTypes = {
dataSourceAssetId: PropTypes.string,
color: PropTypes.string,
targetFeatureProperty: PropTypes.string,
+ style: PropTypes.string,
}),
+ onChange: PropTypes.func.isRequired,
+ close: PropTypes.func.isRequired,
};
export default MapView;
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 7bab8a32a..16fb895ba 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -14,6 +14,19 @@ import GeoAPIKey from '../Form/Fields/Geospatial/GeoAPIKey';
import MapSelection from '../Form/Fields/Geospatial/MapSelection';
import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
+const mapboxStyleOptions = [
+ { label: 'Standard', value: 'mapbox://styles/mapbox/standard' },
+ { label: 'Standard Satellite', value: 'mapbox://styles/mapbox/standard-satellite' },
+ { label: 'Streets', value: 'mapbox://styles/mapbox/streets-v12' },
+ { label: 'Outdoors', value: 'mapbox://styles/mapbox/outdoors-v12' },
+ { label: 'Light', value: 'mapbox://styles/mapbox/light-v11' },
+ { label: 'Dark', value: 'mapbox://styles/mapbox/dark-v11' },
+ { label: 'Satellite', value: 'mapbox://styles/mapbox/satellite-v9' },
+ { label: 'Satellite Streets', value: 'mapbox://styles/mapbox/satellite-streets-v12' },
+ { label: 'Navigation Day', value: 'mapbox://styles/mapbox/navigation-day-v1' },
+ { label: 'Navigation Night', value: 'mapbox://styles/mapbox/navigation-night-v1' },
+];
+
const MapOptions = (props) => {
const { mapOptions, disabled } = props;
@@ -72,21 +85,30 @@ const MapOptions = (props) => {
)}
- Interviewer will render outlines and fills of map layers using the same color.
-
- )}
+ title="Map Style"
>
-
+
+
+
+
+
+
+
+
Date: Thu, 16 Jan 2025 12:54:29 -0800
Subject: [PATCH 26/32] update mapbox to v3, use es6 import and target
unminified code
---
package-lock.json | 199 ++++++++++--------
package.json | 2 +-
.../Form/Fields/Geospatial/MapView.js | 2 +-
3 files changed, 112 insertions(+), 91 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 6e4ed4ab1..c1a6cd35d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,7 @@
"version": "6.5.3",
"hasInstallScript": true,
"dependencies": {
- "mapbox-gl": "^1.13.0"
+ "mapbox-gl": "^3.9.3"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
@@ -3773,34 +3773,6 @@
"node": ">= 10.0.0"
}
},
- "node_modules/@mapbox/geojson-rewind": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz",
- "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==",
- "dependencies": {
- "get-stream": "^6.0.1",
- "minimist": "^1.2.6"
- },
- "bin": {
- "geojson-rewind": "geojson-rewind"
- }
- },
- "node_modules/@mapbox/geojson-rewind/node_modules/get-stream": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
- "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/@mapbox/geojson-types": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz",
- "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw=="
- },
"node_modules/@mapbox/jsonlint-lines-primitives": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
@@ -3810,12 +3782,9 @@
}
},
"node_modules/@mapbox/mapbox-gl-supported": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz",
- "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==",
- "peerDependencies": {
- "mapbox-gl": ">=0.32.1 <2.0.0"
- }
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-3.0.0.tgz",
+ "integrity": "sha512-2XghOwu16ZwPJLOFVuIOaLbN0iKMn867evzXFyf0P22dqugezfJwLmdanAgU25ITvz1TvOfVP4jsDImlDJzcWg=="
},
"node_modules/@mapbox/point-geometry": {
"version": "0.1.0",
@@ -3823,14 +3792,14 @@
"integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ=="
},
"node_modules/@mapbox/tiny-sdf": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz",
- "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw=="
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz",
+ "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA=="
},
"node_modules/@mapbox/unitbezier": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz",
- "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA=="
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz",
+ "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw=="
},
"node_modules/@mapbox/vector-tile": {
"version": "1.3.1",
@@ -4776,6 +4745,19 @@
"@types/node": "*"
}
},
+ "node_modules/@types/geojson": {
+ "version": "7946.0.15",
+ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz",
+ "integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA=="
+ },
+ "node_modules/@types/geojson-vt": {
+ "version": "3.2.5",
+ "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz",
+ "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
"node_modules/@types/glob": {
"version": "7.1.3",
"integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
@@ -4858,6 +4840,21 @@
"integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==",
"dev": true
},
+ "node_modules/@types/mapbox__point-geometry": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz",
+ "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA=="
+ },
+ "node_modules/@types/mapbox__vector-tile": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz",
+ "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==",
+ "dependencies": {
+ "@types/geojson": "*",
+ "@types/mapbox__point-geometry": "*",
+ "@types/pbf": "*"
+ }
+ },
"node_modules/@types/mdast": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz",
@@ -4905,6 +4902,11 @@
"integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==",
"dev": true
},
+ "node_modules/@types/pbf": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz",
+ "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA=="
+ },
"node_modules/@types/plist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.2.tgz",
@@ -4983,6 +4985,14 @@
"integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==",
"dev": true
},
+ "node_modules/@types/supercluster": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
+ "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
+ "dependencies": {
+ "@types/geojson": "*"
+ }
+ },
"node_modules/@types/tapable": {
"version": "1.0.7",
"integrity": "sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ==",
@@ -8140,6 +8150,11 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/cheap-ruler": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/cheap-ruler/-/cheap-ruler-4.0.0.tgz",
+ "integrity": "sha512-0BJa8f4t141BYKQyn9NSQt1PguFQXMXwZiA5shfoaBYHAb2fFk2RAX+tiWMoQU+Agtzt3mdt0JtuyshAXqZ+Vw=="
+ },
"node_modules/check-types": {
"version": "11.1.2",
"integrity": "sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==",
@@ -11387,9 +11402,9 @@
}
},
"node_modules/earcut": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
- "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ=="
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz",
+ "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw=="
},
"node_modules/ecc-jsbn": {
"version": "0.1.2",
@@ -14690,9 +14705,9 @@
}
},
"node_modules/geojson-vt": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz",
- "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg=="
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz",
+ "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A=="
},
"node_modules/get-caller-file": {
"version": "2.0.5",
@@ -19733,9 +19748,9 @@
}
},
"node_modules/kdbush": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz",
- "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew=="
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
+ "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA=="
},
"node_modules/kew": {
"version": "0.7.0",
@@ -20527,36 +20542,38 @@
}
},
"node_modules/mapbox-gl": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.0.tgz",
- "integrity": "sha512-g8zlzuJxYJqbOPXT19/UBYpVrcefBQ06F/Cbj0fyEfFnFesDcU3cFTxd75/FZ6Upx2ZEjCsD61CHxrcxZidVpA==",
+ "version": "3.9.3",
+ "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-3.9.3.tgz",
+ "integrity": "sha512-31mh95f35srpBMxAP32F9dKQXz7pT5VxQA5r6bFY6Aa5G6Z6NC/SVOTyWR+G/wY8wXWTHAnOaAAf5UkD5++/Kg==",
"dependencies": {
- "@mapbox/geojson-rewind": "^0.5.0",
- "@mapbox/geojson-types": "^1.0.2",
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
- "@mapbox/mapbox-gl-supported": "^1.5.0",
+ "@mapbox/mapbox-gl-supported": "^3.0.0",
"@mapbox/point-geometry": "^0.1.0",
- "@mapbox/tiny-sdf": "^1.1.1",
- "@mapbox/unitbezier": "^0.0.0",
+ "@mapbox/tiny-sdf": "^2.0.6",
+ "@mapbox/unitbezier": "^0.0.1",
"@mapbox/vector-tile": "^1.3.1",
"@mapbox/whoots-js": "^3.1.0",
+ "@types/geojson": "^7946.0.15",
+ "@types/geojson-vt": "^3.2.5",
+ "@types/mapbox__point-geometry": "^0.1.4",
+ "@types/mapbox__vector-tile": "^1.3.4",
+ "@types/pbf": "^3.0.5",
+ "@types/supercluster": "^7.1.3",
+ "cheap-ruler": "^4.0.0",
"csscolorparser": "~1.0.3",
- "earcut": "^2.2.2",
- "geojson-vt": "^3.2.1",
- "gl-matrix": "^3.2.1",
+ "earcut": "^3.0.0",
+ "geojson-vt": "^4.0.2",
+ "gl-matrix": "^3.4.3",
"grid-index": "^1.1.0",
- "minimist": "^1.2.5",
+ "kdbush": "^4.0.2",
"murmurhash-js": "^1.0.0",
"pbf": "^3.2.1",
- "potpack": "^1.0.1",
- "quickselect": "^2.0.0",
- "rw": "^1.3.3",
- "supercluster": "^7.1.0",
- "tinyqueue": "^2.0.3",
- "vt-pbf": "^3.1.1"
- },
- "engines": {
- "node": ">=6.4.0"
+ "potpack": "^2.0.0",
+ "quickselect": "^3.0.0",
+ "serialize-to-js": "^3.1.2",
+ "supercluster": "^8.0.1",
+ "tinyqueue": "^3.0.0",
+ "vt-pbf": "^3.1.3"
}
},
"node_modules/matcher": {
@@ -21231,6 +21248,7 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -27940,9 +27958,9 @@
}
},
"node_modules/potpack": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz",
- "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz",
+ "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw=="
},
"node_modules/prelude-ls": {
"version": "1.2.1",
@@ -28309,9 +28327,9 @@
}
},
"node_modules/quickselect": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
- "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
+ "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g=="
},
"node_modules/raf": {
"version": "3.4.1",
@@ -32439,11 +32457,6 @@
"aproba": "^1.1.1"
}
},
- "node_modules/rw": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
- "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
- },
"node_modules/rxjs": {
"version": "6.6.7",
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
@@ -33005,6 +33018,14 @@
"randombytes": "^2.1.0"
}
},
+ "node_modules/serialize-to-js": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/serialize-to-js/-/serialize-to-js-3.1.2.tgz",
+ "integrity": "sha512-owllqNuDDEimQat7EPG0tH7JjO090xKNzUtYz6X+Sk2BXDnOCilDdNLwjWeFywG9xkJul1ULvtUQa9O4pUaY0w==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
"node_modules/serve-index": {
"version": "1.9.1",
"integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=",
@@ -35147,11 +35168,11 @@
}
},
"node_modules/supercluster": {
- "version": "7.1.5",
- "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz",
- "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==",
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz",
+ "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==",
"dependencies": {
- "kdbush": "^3.0.0"
+ "kdbush": "^4.0.2"
}
},
"node_modules/supports-color": {
@@ -36106,9 +36127,9 @@
"dev": true
},
"node_modules/tinyqueue": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz",
- "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA=="
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz",
+ "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g=="
},
"node_modules/tippy.js": {
"version": "6.3.7",
diff --git a/package.json b/package.json
index 56b821c5d..1bba765f4 100644
--- a/package.json
+++ b/package.json
@@ -271,6 +271,6 @@
}
},
"dependencies": {
- "mapbox-gl": "^1.13.0"
+ "mapbox-gl": "^3.9.3"
}
}
diff --git a/src/components/Form/Fields/Geospatial/MapView.js b/src/components/Form/Fields/Geospatial/MapView.js
index d624aca46..37eb2aab8 100644
--- a/src/components/Form/Fields/Geospatial/MapView.js
+++ b/src/components/Form/Fields/Geospatial/MapView.js
@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
-import mapboxgl from 'mapbox-gl';
+import mapboxgl from 'mapbox-gl/dist/mapbox-gl-unminified';
import { useSelector } from 'react-redux';
import { Layout, Section } from '@components/EditorLayout';
import { AnimatePresence, motion } from 'framer-motion';
From 2cf85f9355067db2d770658604e0406d4a91da2d Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 13:22:13 -0800
Subject: [PATCH 27/32] small fixes
---
src/components/Assets/APIKey.js | 4 +++-
src/components/Form/Fields/Geospatial/MapSelection.js | 2 +-
src/components/Form/Fields/Geospatial/MapView.js | 4 +++-
src/components/sections/MapOptions.js | 4 ++--
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/components/Assets/APIKey.js b/src/components/Assets/APIKey.js
index 68ac560c8..3e061c9bf 100644
--- a/src/components/Assets/APIKey.js
+++ b/src/components/Assets/APIKey.js
@@ -3,7 +3,9 @@ import PropTypes from 'prop-types';
import withAssetMeta from './withAssetMeta';
const APIKey = ({ meta }) => (
- {meta.value}
+
+ {meta.value}
+
);
APIKey.propTypes = {
diff --git a/src/components/Form/Fields/Geospatial/MapSelection.js b/src/components/Form/Fields/Geospatial/MapSelection.js
index caf04083b..d0e999654 100644
--- a/src/components/Form/Fields/Geospatial/MapSelection.js
+++ b/src/components/Form/Fields/Geospatial/MapSelection.js
@@ -20,7 +20,7 @@ const MapSelection = ({
color="primary"
size="small"
>
- Edit Map View
+ {value.center ? 'Edit Map View' : 'Set Map View'}
{showMap && createPortal(
diff --git a/src/components/Form/Fields/Geospatial/MapView.js b/src/components/Form/Fields/Geospatial/MapView.js
index 37eb2aab8..e694ac6a7 100644
--- a/src/components/Form/Fields/Geospatial/MapView.js
+++ b/src/components/Form/Fields/Geospatial/MapView.js
@@ -127,8 +127,10 @@ const MapView = ({ mapOptions, onChange, close }) => {
title="Set Initial Map View"
summary={(
+ Pan and zoom the map below to configure the initial view.
+
When the map is first loaded, it will be centered at the
- initial center and zoom level configured on this map.
+ initial center and zoom level as it appears here.
Resetting the map will return it to this view.
)}
diff --git a/src/components/sections/MapOptions.js b/src/components/sections/MapOptions.js
index 16fb895ba..149a8147a 100644
--- a/src/components/sections/MapOptions.js
+++ b/src/components/sections/MapOptions.js
@@ -14,6 +14,7 @@ import GeoAPIKey from '../Form/Fields/Geospatial/GeoAPIKey';
import MapSelection from '../Form/Fields/Geospatial/MapSelection';
import useVariablesFromExternalData from '../../hooks/useVariablesFromExternalData';
+// TODO: move this to a shared location -- protocol-consts?
const mapboxStyleOptions = [
{ label: 'Standard', value: 'mapbox://styles/mapbox/standard' },
{ label: 'Standard Satellite', value: 'mapbox://styles/mapbox/standard-satellite' },
@@ -114,8 +115,7 @@ const MapOptions = (props) => {
title="Initial Map View"
summary={(
- When the map is first loaded, it will be centered at the initial center and zoom level
- configured here. Resetting the map will return it to this view.
+ Configure the initial map view to adjust where it will be centered and zoomed to.
)}
disabled={disabled}
From d598829a2e7c69616ba5ca5d6d5b9bf9678155cd Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 14:06:21 -0800
Subject: [PATCH 28/32] geojson preview using reusable Table component, make
network use table too
---
src/components/AssetBrowser/Asset.js | 1 +
src/components/AssetBrowser/Preview.js | 4 +-
src/components/Assets/GeoJSON.js | 58 +++++++++++++++++++++
src/components/Assets/Network.js | 60 +--------------------
src/components/Assets/Table.js | 72 ++++++++++++++++++++++++++
src/components/Assets/index.js | 1 +
6 files changed, 136 insertions(+), 60 deletions(-)
create mode 100644 src/components/Assets/GeoJSON.js
create mode 100644 src/components/Assets/Table.js
diff --git a/src/components/AssetBrowser/Asset.js b/src/components/AssetBrowser/Asset.js
index b23da4717..aeae3fd41 100644
--- a/src/components/AssetBrowser/Asset.js
+++ b/src/components/AssetBrowser/Asset.js
@@ -17,6 +17,7 @@ const ASSET_COMPONENTS = {
network: Thumbnails.Network,
geospatial: Thumbnails.GeoJSON,
apiKey: Thumbnails.APIKey,
+ geojson: Thumbnails.GeoJSON,
};
const Asset = ({
diff --git a/src/components/AssetBrowser/Preview.js b/src/components/AssetBrowser/Preview.js
index 2a9831088..1978a14c8 100644
--- a/src/components/AssetBrowser/Preview.js
+++ b/src/components/AssetBrowser/Preview.js
@@ -21,8 +21,8 @@ const getRenderer = (meta) => {
return ({ id }) => ;
case 'network':
return Assets.Network;
- // case 'geospatial':
- // return Assets.GeoJSON;
+ case 'geospatial':
+ return Assets.GeoJSON;
case 'apiKey':
return Assets.APIKey;
default:
diff --git a/src/components/Assets/GeoJSON.js b/src/components/Assets/GeoJSON.js
new file mode 100644
index 000000000..ee28bcfc6
--- /dev/null
+++ b/src/components/Assets/GeoJSON.js
@@ -0,0 +1,58 @@
+import React, { useState, useEffect, useMemo } from 'react';
+import PropTypes from 'prop-types';
+
+import { get } from 'lodash';
+import fs from 'fs-extra';
+import Table from './Table';
+import withAssetPath from './withAssetPath';
+
+const initialContent = {
+ geojson: { features: [] },
+ columns: [],
+};
+
+const getGeoJSON = (assetPath) => fs.readJson(assetPath);
+
+const getRows = (geojson) => get(geojson, ['features'], []).map(
+ ({ properties }) => properties,
+);
+
+const getColumns = (geojson) => {
+ const properties = get(geojson, ['features'], []).map(
+ (feature) => feature.properties,
+ );
+
+ const columnNames = Array.from(
+ new Set(properties.flatMap(Object.keys)),
+ );
+
+ return columnNames.map((col) => ({
+ Header: col,
+ accessor: col,
+ }));
+};
+
+const GeoJSONTable = ({ assetPath }) => {
+ const [content, setContent] = useState({ ...initialContent });
+
+ useEffect(() => {
+ if (!assetPath) {
+ setContent({ ...initialContent });
+ return;
+ }
+
+ getGeoJSON(assetPath)
+ .then(setContent);
+ }, [assetPath]);
+
+ const data = useMemo(() => getRows(content), [content]);
+ const columns = useMemo(() => getColumns(content), [content]);
+
+ return ;
+};
+
+GeoJSONTable.propTypes = {
+ assetPath: PropTypes.string.isRequired,
+};
+
+export default withAssetPath(GeoJSONTable);
diff --git a/src/components/Assets/Network.js b/src/components/Assets/Network.js
index adf22b626..fc14fe3b9 100644
--- a/src/components/Assets/Network.js
+++ b/src/components/Assets/Network.js
@@ -3,12 +3,10 @@ import React, { useState, useEffect, useMemo } from 'react';
import { compose } from 'redux';
import PropTypes from 'prop-types';
import { get } from 'lodash';
-import { useTable, useSortBy } from 'react-table';
-import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
-import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp';
import { getVariableNamesFromNetwork } from '@app/protocol-validation/validation/validateExternalData';
import withAssetPath from './withAssetPath';
import { networkReader } from '../../utils/protocols/assetTools';
+import Table from './Table';
const initialContent = {
network: { nodes: [] },
@@ -26,15 +24,6 @@ const getColumns = (network) => getVariableNamesFromNetwork(network).map(
}),
);
-const getSortIcon = (column) => {
- if (!column.isSorted) { return null; }
- return (
- column.isSortedDesc
- ?
- :
- );
-};
-
const Network = ({ assetPath }) => {
const [content, setContent] = useState({ ...initialContent });
@@ -51,51 +40,8 @@ const Network = ({ assetPath }) => {
const data = useMemo(() => getRows(content), [content]);
const columns = useMemo(() => getColumns(content), [content]);
- const {
- getTableProps,
- getTableBodyProps,
- headerGroups,
- rows,
- prepareRow,
- } = useTable(
- { data, columns },
- useSortBy,
- );
-
return (
-
-
- {headerGroups.map((headerGroup) => (
-
- {headerGroup.headers.map((column) => (
-
- {column.render('Header')}
- {getSortIcon(column)}
-
- ))}
-
- ))}
-
-
- {rows.map((row) => {
- prepareRow(row);
-
- return (
-
- {row.cells.map((cell) => (
-
- {cell.render('Cell')}
-
- ))}
-
- );
- })}
-
-
+
);
};
@@ -103,8 +49,6 @@ Network.propTypes = {
assetPath: PropTypes.string.isRequired,
};
-export { Network };
-
export default compose(
withAssetPath,
)(Network);
diff --git a/src/components/Assets/Table.js b/src/components/Assets/Table.js
new file mode 100644
index 000000000..b99a2f3a4
--- /dev/null
+++ b/src/components/Assets/Table.js
@@ -0,0 +1,72 @@
+/* eslint-disable react/forbid-prop-types */
+/* eslint-disable react/jsx-props-no-spreading */
+import React from 'react';
+import PropTypes from 'prop-types';
+import { useTable, useSortBy } from 'react-table';
+import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
+import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp';
+
+const getSortIcon = (column) => {
+ if (!column.isSorted) { return null; }
+ return (
+ column.isSortedDesc
+ ?
+ :
+ );
+};
+
+const Table = ({ data, columns }) => {
+ const {
+ getTableProps,
+ getTableBodyProps,
+ headerGroups,
+ rows,
+ prepareRow,
+ } = useTable(
+ { data, columns },
+ useSortBy,
+ );
+
+ return (
+
+
+ {headerGroups.map((headerGroup) => (
+
+ {headerGroup.headers.map((column) => (
+
+ {column.render('Header')}
+ {getSortIcon(column)}
+
+ ))}
+
+ ))}
+
+
+ {rows.map((row) => {
+ prepareRow(row);
+
+ return (
+
+ {row.cells.map((cell) => (
+
+ {cell.render('Cell')}
+
+ ))}
+
+ );
+ })}
+
+
+ );
+};
+
+Table.propTypes = {
+ data: PropTypes.array.isRequired,
+ columns: PropTypes.array.isRequired,
+};
+
+export default Table;
diff --git a/src/components/Assets/index.js b/src/components/Assets/index.js
index c05ffe93e..bbf170fde 100644
--- a/src/components/Assets/index.js
+++ b/src/components/Assets/index.js
@@ -4,3 +4,4 @@ export { default as Audio } from './Audio';
export { default as Video } from './Video';
export { default as Network } from './Network';
export { default as APIKey } from './APIKey';
+export { default as GeoJSON } from './GeoJSON';
From d06143028794c41d30ff53bde8b7ea622c0cc8cf Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 14:23:20 -0800
Subject: [PATCH 29/32] disable download, implement copy for api keys
---
src/components/AssetBrowser/Assets.js | 35 +++++++++++++++-----------
src/components/AssetBrowser/Preview.js | 18 ++++++++++++-
2 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/src/components/AssetBrowser/Assets.js b/src/components/AssetBrowser/Assets.js
index a3f9da9bc..65290a1e1 100644
--- a/src/components/AssetBrowser/Assets.js
+++ b/src/components/AssetBrowser/Assets.js
@@ -34,21 +34,26 @@ const Assets = ({
source,
type: thumbnailType,
isUsed,
- }) => (
-
- ));
+ }) => {
+ // disable download for apiKey type
+ const handleDownload = (thumbnailType === 'apiKey') ? null : onDownload;
+
+ return (
+
+ );
+ });
return (
diff --git a/src/components/AssetBrowser/Preview.js b/src/components/AssetBrowser/Preview.js
index 1978a14c8..7dc9d8ad3 100644
--- a/src/components/AssetBrowser/Preview.js
+++ b/src/components/AssetBrowser/Preview.js
@@ -4,6 +4,7 @@ import { compose } from 'redux';
import cx from 'classnames';
import { Button } from '@codaco/ui';
import Window from '@components/Window';
+import ContentCopyIcon from '@material-ui/icons/FileCopy';
import DownloadIcon from '@material-ui/icons/GetApp';
import withAssetMeta from '@components/Assets/withAssetMeta';
import withAssetPath from '@components/Assets/withAssetPath';
@@ -43,6 +44,12 @@ const Preview = ({
onDownload(assetPath, meta);
}, [onDownload, assetPath, meta]);
+ const handleCopyKey = useCallback(() => {
+ if (meta.value) {
+ navigator.clipboard.writeText(meta.value);
+ }
+ }, []);
+
const primaryButtons = [
,
];
- const secondaryButtons = [
+ // API keys are copied instead of downloaded
+ const secondaryButtons = meta.type !== 'apiKey' ? [
}
@@ -61,6 +69,14 @@ const Preview = ({
>
Download asset
,
+ ] : [
+
}
+ key="copy"
+ >
+ Copy API Key
+ ,
];
const className = cx(
From 995825af24176cbbeacbe70b003ac4ed43110bc0 Mon Sep 17 00:00:00 2001
From: buckhalt
Date: Thu, 16 Jan 2025 14:31:52 -0800
Subject: [PATCH 30/32] add geospatial timeline image
---
src/images/timeline/index.js | 2 ++
src/images/timeline/stage--Geospatial.png | Bin 0 -> 917835 bytes
2 files changed, 2 insertions(+)
create mode 100644 src/images/timeline/stage--Geospatial.png
diff --git a/src/images/timeline/index.js b/src/images/timeline/index.js
index 680fb5cde..0e6214ed4 100644
--- a/src/images/timeline/index.js
+++ b/src/images/timeline/index.js
@@ -11,6 +11,7 @@ import Information from './stage--Information.png';
import AlterForm from './stage--AlterForm.png';
import AlterEdgeForm from './stage--AlterEdgeForm.png';
import EgoForm from './stage--EgoForm.png';
+import Geospatial from './stage--Geospatial.png';
import Default from './stage--Default.png';
export default {
@@ -27,5 +28,6 @@ export default {
AlterForm,
AlterEdgeForm,
EgoForm,
+ Geospatial,
Default,
};
diff --git a/src/images/timeline/stage--Geospatial.png b/src/images/timeline/stage--Geospatial.png
new file mode 100644
index 0000000000000000000000000000000000000000..14dc33a3fea4924527ce7b00374a29cafc050fdd
GIT binary patch
literal 917835
zcmZU419T<9*6xWlaV9n=woh!^p4d3ClgR`V+qP|EV%z4#cJk)l```cG_g=46t9RE{
z*RJaBU0+p)DauPA!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