diff --git a/package.json b/package.json index 545746c7..48f6e083 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "lodash.max": "^4.0.1", "lodash.merge": "^4.6.1", "lodash.mergewith": "^4.6.2", - "lodash.min": "^4.0.1", "lodash.orderby": "^4.6.0", "lodash.tonumber": "^4.0.3", "lodash.uniqueid": "^4.0.1", diff --git a/src/common/_utils/WebMapService.ts b/src/common/_utils/WebMapService.ts deleted file mode 100644 index f5b8f640..00000000 --- a/src/common/_utils/WebMapService.ts +++ /dev/null @@ -1,1292 +0,0 @@ -import { Events } from 'vue-iclient/src/common/_types/event/Events'; -import { isXField, isYField, urlAppend, numberEqual } from 'vue-iclient/src/common/_utils/util'; -import { statisticsFeatures } from 'vue-iclient/src/common/_utils/statistics'; -import * as convert from 'xml-js'; -import max from 'lodash.max'; -import min from 'lodash.min'; - -const DEFAULT_WELLKNOWNSCALESET = [ - 'GoogleCRS84Quad', - 'GoogleMapsCompatible', - 'urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible', - 'urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad' -]; -const MB_SCALEDENOMINATOR_3857 = [ - 559082264.0287178, 279541132.0143589, 139770566.00717944, 69885283.00358972, 34942641.50179486, 17471320.75089743, - 8735660.375448715, 4367830.1877243575, 2183915.0938621787, 1091957.5469310894, 545978.7734655447, 272989.38673277234, - 136494.69336638617, 68247.34668319309, 34123.67334159654, 17061.83667079827, 8530.918335399136, 4265.459167699568, - 2132.729583849784, 1066.364791924892, 533.182395962446, 266.591197981223, 133.2955989906115 -]; -const MB_SCALEDENOMINATOR_4326 = [ - 559082264.0287176, 279541132.0143588, 139770566.0071794, 69885283.0035897, 34942641.50179485, 17471320.750897426, - 8735660.375448713, 4367830.187724357, 2183915.0938621783, 1091957.5469310891, 545978.7734655446, 272989.3867327723, - 136494.69336638614, 68247.34668319307, 34123.673341596535, 17061.836670798268, 8530.918335399134, 4265.459167699567, - 2132.7295838497835, 1066.3647919248917, 533.1823959624459, 266.59119798122293, 133.29559899061147 -]; - -interface webMapOptions { - serverUrl?: string; - accessToken?: string; - accessKey?: string; - tiandituKey?: string; - withCredentials?: boolean; - excludePortalProxyUrl?: boolean; - proxy?: boolean | string; - iportalServiceProxyUrlPrefix?: string; -} - -export default class WebMapService extends Events { - mapId: string | number; - - mapInfo: any; - - serverUrl: string; - - accessToken: string; - - accessKey: string; - - tiandituKey: string; - - withCredentials: boolean; - - target: string; - - excludePortalProxyUrl: boolean; - - isSuperMapOnline: boolean; - - proxy: boolean | string; - - iportalServiceProxyUrl: string; - - proxyOptions: Object = { - data: 'apps/viewer/getUrlResource.json?url=', - image: 'apps/viewer/getUrlResource.png?url=' - }; - - constructor(mapId: string | number | Object, options: webMapOptions = {}) { - super(); - if (typeof mapId === 'string' || typeof mapId === 'number') { - this.mapId = mapId; - } else if (mapId !== null && typeof mapId === 'object') { - this.mapInfo = mapId; - } - this.serverUrl = options.serverUrl || 'https://www.supermapol.com'; - this.accessToken = options.accessToken; - this.accessKey = options.accessKey; - this.tiandituKey = options.tiandituKey || ''; - this.withCredentials = options.withCredentials || false; - this.excludePortalProxyUrl = options.excludePortalProxyUrl; - this.iportalServiceProxyUrl = options.iportalServiceProxyUrlPrefix; - this.proxy = options.proxy; - } - - public setMapId(mapId: string | number | Object): void { - if (typeof mapId === 'string' || typeof mapId === 'number') { - this.mapId = mapId; - this.mapInfo = null; - } else if (mapId !== null && typeof mapId === 'object') { - this.mapInfo = mapId; - this.mapId = ''; - } - } - - public setServerUrl(serverUrl: string): void { - this.serverUrl = serverUrl; - } - - public setWithCredentials(withCredentials) { - this.withCredentials = withCredentials; - } - - public setProxy(proxy) { - this.proxy = proxy; - } - - public handleServerUrl(serverUrl) { - let urlArr: string[] = serverUrl.split(''); - if (urlArr[urlArr.length - 1] !== '/') { - serverUrl += '/'; - } - this.serverUrl = serverUrl; - return serverUrl; - } - - public getMapInfo() { - if (!this.mapId && this.mapInfo) { - return new Promise(resolve => { - resolve(this.mapInfo); - }); - } - let mapUrl = this._handleMapUrl(); - return new Promise(async (resolve, reject) => { - try { - await this.getiPortalServiceProxy(); - SuperMap.FetchRequest.get(mapUrl, null, { - withCredentials: this.withCredentials - }) - .then(response => { - return response.json(); - }) - .then(mapInfo => { - if (mapInfo && mapInfo.succeed === false) { - let error = { message: mapInfo && mapInfo.error && mapInfo.error.errorMsg }; - reject(error); - return; - } - - mapInfo.mapParams = { - title: mapInfo.title, - description: mapInfo.description - }; - resolve(mapInfo); - }) - .catch(error => { - reject(error); - }); - } catch (err) { - reject(err); - } - }); - } - - public getiPortalServiceProxy() { - return new Promise((resolve, reject) => { - SuperMap.FetchRequest.get(`${this.serverUrl}web/config/portal.json`, { scope: ['serviceProxy'] }) - .then(response => { - return response.json(); - }) - .then(serviceProxyInfo => { - if (!serviceProxyInfo || !serviceProxyInfo.serviceProxy) { - reject('serviceProxyFailed'); - return; - } - const serviceProxy = serviceProxyInfo.serviceProxy; - if (serviceProxy.enable) { - if (serviceProxy.proxyServerRootUrl) { - this.iportalServiceProxyUrl = serviceProxy.proxyServerRootUrl; - } else if (serviceProxy.port && serviceProxy.rootUrlPostfix) { - this.iportalServiceProxyUrl = `${serviceProxy.port}/${serviceProxy.rootUrlPostfix}`; - } - if (this.serverUrl.indexOf(this.iportalServiceProxyUrl) > -1) { - this.iportalServiceProxyUrl = ''; - } - } - resolve(serviceProxy); - }) - .catch(error => { - reject(error); - }); - }); - } - - public getLayerFeatures(type, layer, baseProjection?) { - let pro; - switch (type) { - case 'hosted': - // 数据存储到iportal上了 - pro = this._getFeaturesFromHosted(layer, baseProjection); - break; - case 'rest_data': - pro = this._getFeaturesFromRestData(layer, baseProjection); - break; - case 'rest_map': - pro = this._getFeaturesFromRestMap(layer); - break; - case 'dataflow': - pro = this._getFeaturesFromDataflow(layer); - break; - case 'user_data': - pro = this._getFeaturesFromUserData(layer); - break; - } - return pro; - } - - public getWmsInfo(layerInfo) { - return new Promise(resolve => { - const proxy = this.handleProxy(); - const serviceUrl = SuperMap.Util.urlAppend(layerInfo.url, 'REQUEST=GetCapabilities&SERVICE=WMS'); - SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, layerInfo.url, false), - withoutFormatSuffix: true, - proxy - }) - .then(response => { - return response.text(); - }) - .then(capabilitiesText => { - let converts = convert || window.convert; - const capabilities = JSON.parse( - converts.xml2json(capabilitiesText, { - compact: true, - spaces: 4 - }) - ); - const wmsCapabilities = capabilities.WMT_MS_Capabilities || capabilities.WMS_Capabilities; - resolve({ version: wmsCapabilities['_attributes']['version'] }); - }); - }); - } - - public getMapBoxStyle(styleURL) { - return new Promise((resolve, reject) => { - SuperMap.FetchRequest.get(styleURL) - .then(response => { - return response.json(); - }) - .then(styleJSON => { - resolve(styleJSON); - }) - .catch(error => { - reject(error); - }); - }); - } - - public getWmtsInfo(layerInfo, mapCRS) { - return new Promise((resolve, reject) => { - let isMatched = false; - let matchMaxZoom = 22; - let matchMinZoom = 0; - let style = ''; - let bounds; - let restResourceURL = ''; - let kvpResourceUrl = ''; - const proxy = this.handleProxy(); - let serviceUrl = SuperMap.Util.urlAppend(layerInfo.url, 'REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0'); - serviceUrl = this.handleParentRes(serviceUrl); - SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, layerInfo.url, false), - withoutFormatSuffix: true, - proxy - }) - .then(response => { - return response.text(); - }) - .then(capabilitiesText => { - let converts = convert || window.convert; - const capabilities = JSON.parse( - converts.xml2json(capabilitiesText, { - compact: true, - spaces: 4, - // 用于决定哪些字段必须返回数组格式 - alwaysArray: ['Layer', 'TileMatrixSet', 'ows:Operation', 'ows:Get', 'ResourceURL', 'Style'] - }) - ).Capabilities; - const content = capabilities.Contents; - const metaData = capabilities['ows:OperationsMetadata']; - if (metaData) { - let operations = metaData['ows:Operation']; - if (!Array.isArray(operations)) { - operations = [operations]; - } - const operation = operations.find(item => { - return item._attributes.name === 'GetTile'; - }); - if (operation) { - let getConstraints = operation['ows:DCP']['ows:HTTP']['ows:Get']; - if (!Array.isArray(getConstraints)) { - getConstraints = [getConstraints]; - } - const getConstraint = getConstraints.find(item => { - return item['ows:Constraint']['ows:AllowedValues']['ows:Value']['_text'] === 'KVP'; - }); - if (getConstraint) { - kvpResourceUrl = getConstraint['_attributes']['xlink:href']; - } - } - } - let tileMatrixSet = content.TileMatrixSet; - for (let i = 0; i < tileMatrixSet.length; i++) { - if ( - tileMatrixSet[i]['ows:Identifier'] && - tileMatrixSet[i]['ows:Identifier']['_text'] === layerInfo.tileMatrixSet - ) { - if ( - tileMatrixSet[i]['WellKnownScaleSet'] && - DEFAULT_WELLKNOWNSCALESET.includes(tileMatrixSet[i]['WellKnownScaleSet']['_text']) - ) { - isMatched = true; - } else { - let matchedScaleDenominator = {}; - // 坐标系判断 - let defaultCRSScaleDenominators = - // @ts-ignore -------- crs 为 enhance 新加属性 - mapCRS === 'EPSG:3857' ? MB_SCALEDENOMINATOR_3857 : MB_SCALEDENOMINATOR_4326; - let defaultCRSTopLeftCorner = - // @ts-ignore -------- crs 为 enhance 新加属性 - mapCRS === 'EPSG:3857' ? [-2.0037508342789248e7, 2.0037508342789087e7] : [-180, 90]; - for (let j = 0; j < tileMatrixSet[i].TileMatrix.length; j++) { - const tileMatrix = tileMatrixSet[i].TileMatrix[j]; - const identifier = tileMatrix['ows:Identifier']['_text']; - const topLeftCorner = [...tileMatrix['TopLeftCorner']['_text'].split(' ')]; - if ( - (!numberEqual(topLeftCorner[0], defaultCRSTopLeftCorner[0]) || - !numberEqual(topLeftCorner[1], defaultCRSTopLeftCorner[1])) && - (!numberEqual(topLeftCorner[0], defaultCRSTopLeftCorner[1]) || - !numberEqual(topLeftCorner[1], defaultCRSTopLeftCorner[0])) - ) { - break; - } - const defaultScaleDenominator = defaultCRSScaleDenominators[+identifier]; - if (!defaultScaleDenominator) { - break; - } - const scaleDenominator = parseFloat(tileMatrixSet[i].TileMatrix[j]['ScaleDenominator']['_text']); - if (numberEqual(defaultScaleDenominator, scaleDenominator)) { - matchedScaleDenominator[+identifier] = scaleDenominator; - } else { - if (Object.keys(matchedScaleDenominator).length > 0) { - break; - } else { - continue; - } - } - } - const zooms = Object.keys(matchedScaleDenominator).map(element => { - return +element; - }); - matchMaxZoom = max(zooms); - matchMinZoom = min(zooms); - if (zooms.length !== 0) { - isMatched = true; - } else { - throw Error('TileMatrixSetNotSuppport'); - } - } - break; - } - } - const layer = content.Layer.find(item => { - return item['ows:Identifier']['_text'] === layerInfo.layer; - }); - if (layer) { - let styles = layer.Style; - if (Array.isArray(layer.Style)) { - style = styles[0]['ows:Identifier'] ? styles[0]['ows:Identifier']['_text'] : ''; - } else { - style = styles['ows:Identifier'] ? styles['ows:Identifier']['_text'] : ''; - } - if (layer['ows:WGS84BoundingBox']) { - const lowerCorner = layer['ows:WGS84BoundingBox']['ows:LowerCorner']['_text'].split(' '); - const upperCorner = layer['ows:WGS84BoundingBox']['ows:UpperCorner']['_text'].split(' '); - bounds = [ - parseFloat(lowerCorner[0]), - parseFloat(lowerCorner[1]), - parseFloat(upperCorner[0]), - parseFloat(upperCorner[1]) - ]; - } - let resourceUrls = layer.ResourceURL; - if (!Array.isArray(resourceUrls)) { - resourceUrls = [resourceUrls]; - } - const resourceUrl = resourceUrls.find(item => { - return item._attributes.resourceType === 'tile'; - }); - if (resourceUrl) { - restResourceURL = resourceUrl._attributes.template; - } - } - resolve({ isMatched, matchMaxZoom, matchMinZoom, style, bounds, restResourceURL, kvpResourceUrl }); - }) - .catch(error => { - reject(error); - }); - }); - } - - private _getFeaturesFromHosted(layer, baseProjection?) { - let { dataSource, layerType } = layer; - let serverId = dataSource ? dataSource.serverId : layer.serverId; - - if (!serverId) { - return new Promise(resolve => { - resolve({ type: 'noServerId' }); - }); - } - let getDataFromIportal = - layerType === 'MARKER' || (dataSource && (!dataSource.accessType || dataSource.accessType === 'DIRECT')); - - if (getDataFromIportal) { - return this._getDataFromIportal(serverId, layer); - } else { - return this._getDataFromHosted({ layer, serverId, baseProjection }); - } - } - - private _getFeaturesFromRestData(layer, baseProjection?) { - // 从restData获取数据 - let features; - let dataSource = layer.dataSource; - return new Promise((resolve, reject) => { - this._getFeatureBySQL( - dataSource.url, - [decodeURIComponent(dataSource.dataSourceName) || layer.name], - result => { - features = this.parseGeoJsonData2Feature({ - allDatas: { - features: result.result.features.features - } - }); - resolve({ type: 'feature', features }); - }, - err => { - reject(err); - }, - baseProjection - ); - }); - } - - private _getFeaturesFromRestMap(layer) { - return new Promise((resolve, reject) => { - this._queryFeatureBySQL( - layer.dataSource.url, - layer.dataSource.layerName, - result => { - let recordsets = result && result.result.recordsets; - let recordset = recordsets && recordsets[0]; - let attributes = recordset.fields; - if (recordset && attributes) { - let fileterAttrs: string[] = []; - for (let i in attributes) { - let value = attributes[i]; - if (value.indexOf('Sm') !== 0 || value === 'SmID') { - fileterAttrs.push(value); - } - } - this._getFeatures( - fileterAttrs, - layer, - features => { - resolve({ type: 'feature', features }); - }, - err => { - reject(err); - } - ); - } - }, - err => { - reject(err); - }, - 'smid=1' - ); - }); - } - - private _getFeaturesFromUserData(layer) { - let dataSource = layer.dataSource; - return new Promise((resolve, reject) => { - const proxy = this.handleProxy(); - let serviceUrl = this.handleParentRes(dataSource.url); - SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials), - proxy, - withoutFormatSuffix: true - }) - .then(response => { - return response.json(); - }) - .then(data => { - let features; - if (data && data instanceof Object && data.type === 'FeatureCollection') { - features = data.features; - } else { - features = data; - } - features = this.parseGeoJsonData2Feature({ - allDatas: { - features - } - }); - resolve({ type: 'feature', features }); - }) - .catch(err => { - reject(err); - }); - }); - } - - private _queryFeatureBySQL( - url: string, - layerName: string, - processCompleted: Function, - processFaild: Function, - attributeFilter?: string, - fields?: Array, - epsgCode?: string, - startRecord?, - recordLength?, - onlyAttribute? - ): void { - let queryBySQLParams = this._getQueryFeaturesParam( - layerName, - attributeFilter, - fields, - epsgCode, - startRecord, - recordLength, - onlyAttribute - ); - const proxy = this.handleProxy(); - let serviceUrl = this.handleParentRes(url); - // @ts-ignore - let queryBySQLService = new SuperMap.QueryBySQLService(serviceUrl, { - proxy, - withCredentials: this.handleWithCredentials(proxy, url, false), - eventListeners: { - processCompleted: data => { - processCompleted && processCompleted(data); - }, - processFailed: data => { - processFaild && processFaild(data); - } - } - }); - queryBySQLService.processAsync(queryBySQLParams); - } - - private _getFeatures(fields: string[], layerInfo: any, resolve: Function, reject: Function): void { - let source = layerInfo.dataSource; - // 示例数据 - this._queryFeatureBySQL( - source.url, - source.layerName, - result => { - let recordsets = result.result.recordsets[0]; - let features = recordsets.features.features; - - let featuresObj = this.parseGeoJsonData2Feature({ - allDatas: { features } - }); - resolve(featuresObj); - }, - err => { - reject(err); - }, - null, - fields - ); - } - - private _getQueryFeaturesParam( - layerName: string, - attributeFilter?: string, - fields?: Array, - epsgCode?: string, - startRecord?, - recordLength?, - onlyAttribute? - ) { - let queryParam = new SuperMap.FilterParameter({ - name: layerName, - attributeFilter: attributeFilter - }); - - if (fields) { - queryParam.fields = fields; - } - - let params: any = { - queryParams: [queryParam] - }; - - if (onlyAttribute) { - params.queryOption = SuperMap.QueryOption.ATTRIBUTE; - } - - startRecord && (params.startRecord = startRecord); - recordLength && (params.expectCount = recordLength); - - if (epsgCode) { - params.prjCoordSys = { - epsgCode: epsgCode - }; - } - - let queryBySQLParams = new SuperMap.QueryBySQLParameters(params); - - return queryBySQLParams; - } - - private _getFeaturesFromDataflow(layer) { - return new Promise((resolve, reject) => { - this._getDataflowInfo( - layer, - () => { - resolve({ type: 'dataflow' }); - }, - e => { - reject(e); - } - ); - }); - } - - private _getDataflowInfo(layerInfo, success, faild?) { - let url = layerInfo.url; - let token; - let requestUrl = `${url}.json`; - if (layerInfo.credential && layerInfo.credential.token) { - token = layerInfo.credential.token; - requestUrl += `?token=${token}`; - } - const proxy = this.handleProxy(); - requestUrl = this.handleParentRes(requestUrl); - SuperMap.FetchRequest.get(requestUrl, null, { - proxy, - withCredentials: this.handleWithCredentials(proxy, requestUrl, false) - }) - .then(function (response) { - return response.json(); - }) - .then(function (result) { - if (!result) { - faild(); - return; - } - if (result.featureMetaData) { - layerInfo.featureType = result.featureMetaData.featureType.toUpperCase(); - layerInfo.dataSource = { dataTypes: {} }; - if (result.featureMetaData.fieldInfos && result.featureMetaData.fieldInfos.length > 0) { - result.featureMetaData.fieldInfos.forEach(function (data) { - let name = data.name.trim(); - if (data.type === 'TEXT') { - layerInfo.dataSource.dataTypes[name] = 'STRING'; - } else if (['DOUBLE', 'INT', 'FLOAT', 'LONG', 'SHORT'].includes(data.type)) { - layerInfo.dataSource.dataTypes[name] = 'NUMBER'; - } else { - layerInfo.dataSource.dataTypes[name] = 'UNKNOWN'; - } - }); - } - } - layerInfo.wsUrl = result.urls[0].url; - layerInfo.name = result.urls[0].url.split('iserver/services/')[1].split('/dataflow')[0]; - success(); - }) - .catch(function () { - faild(); - }); - } - - public getDatasourceType(layer) { - let { dataSource, layerType } = layer; - if (dataSource && dataSource.type === 'SAMPLE_DATA') { - return dataSource.type; - } - let type; - let isHosted = (dataSource && dataSource.serverId) || layerType === 'MARKER' || layerType === 'HOSTED_TILE'; - let isTile = - layerType === 'SUPERMAP_REST' || - layerType === 'TILE' || - layerType === 'WMS' || - layerType === 'WMTS' || - layerType === 'MAPBOXSTYLE'; - if (isHosted) { - type = 'hosted'; - } else if (isTile) { - type = 'tile'; - } else if (dataSource && dataSource.type === 'REST_DATA') { - type = 'rest_data'; - } else if (dataSource && dataSource.type === 'REST_MAP' && dataSource.url) { - type = 'rest_map'; - } else if (layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT') { - type = 'dataflow'; - } else if (dataSource && dataSource.type === 'USER_DATA') { - type = 'user_data'; - } - return type; - } - - public getFeatureProperties(features) { - let properties = []; - if (features && features.length) { - features.forEach(feature => { - let property = feature.properties; - property && properties.push(property); - }); - } - return properties; - } - - public parseGeoJsonData2Feature(metaData: any) { - let allFeatures = metaData.allDatas.features; - let features = []; - for (let i = 0, len = allFeatures.length; i < len; i++) { - let feature = allFeatures[i]; - let coordinate = feature.geometry.coordinates; - if (allFeatures[i].geometry.type === 'Point') { - // 标注图层 还没有属性值时候不加 - if (allFeatures[i].properties) { - allFeatures[i].properties.lon = coordinate[0]; - allFeatures[i].properties.lat = coordinate[1]; - } - } - feature.properties['index'] = i + ''; - features.push(feature); - } - return features; - } - - private _getDataFromIportal(serverId, layerInfo) { - let features; - // 原来二进制文件 - let url = `${this.serverUrl}web/datas/${serverId}/content.json?pageSize=9999999¤tPage=1`; - if (this.accessToken) { - url = `${url}&${this.accessKey}=${this.accessToken}`; - } - return new Promise((resolve, reject) => { - url = this.handleParentRes(url); - const proxy = this.handleProxy(); - SuperMap.FetchRequest.get(url, null, { - withCredentials: this.handleWithCredentials(proxy, url, this.withCredentials), - proxy - }) - .then(response => { - return response.json(); - }) - .then(async data => { - if (data.succeed === false) { - reject(data.error); - } - if (data && data.type) { - if (data.type === 'JSON' || data.type === 'GEOJSON') { - data.content = JSON.parse(data.content.trim()); - features = this._formatGeoJSON(data.content); - } else if (data.type === 'EXCEL' || data.type === 'CSV') { - if (layerInfo.dataSource && layerInfo.dataSource.administrativeInfo) { - // 行政规划信息 - data.content.rows.unshift(data.content.colTitles); - const { divisionType, divisionField } = layerInfo.dataSource.administrativeInfo; - const geojson = await this._excelData2FeatureByDivision(data.content, divisionType, divisionField); - features = this._formatGeoJSON(geojson); - } else { - features = this._excelData2Feature(data.content, (layerInfo && layerInfo.xyField) || {}); - } - } else if (data.type === 'SHP') { - data.content = JSON.parse(data.content.trim()); - features = this._formatGeoJSON(data.content.layers[0]); - } - resolve({ type: 'feature', features }); - } - }) - .catch(error => { - reject(error); - }); - }); - } - - private _getDataFromHosted({ layer, serverId, baseProjection }) { - // 关系型文件 - let isMapService = layer.layerType === 'HOSTED_TILE'; - return new Promise((resolve, reject) => { - this._checkUploadToRelationship(serverId) - .then(result => { - if (result && result.length > 0) { - let datasetName = result[0].name; - let featureType = result[0].type.toUpperCase(); - this._getDataService(serverId, datasetName).then(data => { - let dataItemServices = data.dataItemServices; - if (dataItemServices.length === 0) { - reject('noDataServices'); - } - let param = { layer, dataItemServices, datasetName, featureType, resolve, reject, baseProjection }; - if (isMapService) { - let dataService = dataItemServices.filter(info => { - return info && info.serviceType === 'RESTDATA'; - })[0]; - this._isMvt(dataService.address, datasetName, baseProjection) - .then(info => { - this._getServiceInfoFromLayer(param, info); - }) - .catch(() => { - // 判断失败就走之前逻辑,>数据量用tile - this._getServiceInfoFromLayer(param); - }); - } else { - this._getServiceInfoFromLayer(param); - } - }); - } else { - reject('resultIsEmpty'); - } - }) - .catch(error => { - reject(error); - }); - }); - } - - private _isMvt(serviceUrl, datasetName, baseProjection) { - return this._getDatasetsInfo(serviceUrl, datasetName).then(info => { - // 判断是否和底图坐标系一直 - /* eslint-disable */ - if (info.epsgCode == baseProjection.split('EPSG:')[1]) { - return SuperMap.FetchRequest.get(`${info.url}/tilefeature.mvt`) - .then(function (response) { - return response.json(); - }) - .then(function (result) { - info.isMvt = result.error && result.error.code === 400; - return info; - }) - .catch(() => { - return info; - }); - } - return info; - }); - } - - private _getServiceInfoFromLayer( - { layer, dataItemServices, datasetName, featureType, resolve, reject, baseProjection }, - info?: any - ) { - let isMapService = info ? !info.isMvt : layer.layerType === 'HOSTED_TILE'; - let isAdded = false; - dataItemServices.forEach(service => { - if (isAdded) { - return; - } - // TODO 对接 MVT - // 有服务了,就不需要循环 - if (service && isMapService && service.serviceType === 'RESTMAP') { - isAdded = true; - // 地图服务,判断使用mvt还是tile - this._getTileLayerInfo(service.address, baseProjection).then(restMaps => { - resolve({ type: 'restMap', restMaps }); - }); - } else if (service && !isMapService && service.serviceType === 'RESTDATA') { - if (info && info.isMvt) { - // this._addVectorLayer(info, layer, featureType); - resolve({ type: 'mvt', info, featureType }); - } else { - // 数据服务 - isAdded = true; - // 关系型文件发布的数据服务 - this._getDatasources(service.address).then( - datasourceName => { - layer.dataSource.dataSourceName = datasourceName + ':' + datasetName; - layer.dataSource.url = `${service.address}/data`; - this._getFeatureBySQL( - layer.dataSource.url, - [layer.dataSource.dataSourceName || layer.name], - result => { - let features = this.parseGeoJsonData2Feature({ - allDatas: { - features: result.result.features.features - } - }); - resolve({ type: 'feature', features }); - }, - err => { - reject(err); - } - ); - }, - err => { - reject(err); - } - ); - } - } - }, this); - if (!isAdded) { - // 循环完成了,也没有找到合适的服务。有可能服务被删除 - reject('noService'); - } - } - - private _getDatasetsInfo(serviceUrl, datasetName) { - return this._getDatasources(serviceUrl).then(datasourceName => { - // 判断mvt服务是否可用 - let url = `${serviceUrl}/data/datasources/${datasourceName}/datasets/${datasetName}`; - const proxy = this.handleProxy(); - url = this.handleParentRes(url); - return SuperMap.FetchRequest.get(url, null, { - withCredentials: this.handleWithCredentials(proxy, url, false), - proxy - }) - .then(response => { - return response.json(); - }) - .then(datasetsInfo => { - return { - epsgCode: datasetsInfo.datasetInfo.prjCoordSys.epsgCode, - bounds: datasetsInfo.datasetInfo.bounds, - datasourceName, - datasetName, - url // 返回的是原始url,没有代理。因为用于请求mvt - }; - }); - }); - } - - private _getDatasources(url) { - const proxy = this.handleProxy(); - let serviceUrl = `${url}/data/datasources.json`; - serviceUrl = this.handleParentRes(serviceUrl); - return SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, serviceUrl, false), - proxy - }) - .then(response => { - return response.json(); - }) - .then(datasource => { - if (datasource.code === 401) { - throw Error(datasource.errorMsg); - } - let datasourceNames = datasource.datasourceNames; - return datasourceNames[0]; - }); - } - - private _getDataService(fileId, datasetName) { - const proxy = this.handleProxy(); - let serviceUrl = `${this.serverUrl}web/datas/${fileId}.json`; - serviceUrl = this.handleParentRes(serviceUrl); - return SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials), - proxy - }) - .then(response => { - return response.json(); - }) - .then(result => { - result.fileId = fileId; - result.datasetName = datasetName; - return result; - }); - } - - private _checkUploadToRelationship(fileId) { - const proxy = this.handleProxy(); - let serviceUrl = `${this.serverUrl}web/datas/${fileId}/datasets.json`; - serviceUrl = this.handleParentRes(serviceUrl); - return SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials), - proxy - }) - .then(response => { - return response.json(); - }) - .then(result => { - return result; - }); - } - - private _handleMapUrl() { - let mapUrl = this.serverUrl + 'web/maps/' + this.mapId + '/map'; - if (this.accessToken || this.accessKey) { - mapUrl += '?' + (this.accessToken && !this.accessKey) ? 'token=' + this.accessToken : 'key=' + this.accessKey; - } - let filter = 'getUrlResource.json?url='; - if (this.excludePortalProxyUrl && this.serverUrl.indexOf(filter) > -1) { - // 大屏需求,或者有加上代理的 - let urlArray = this.serverUrl.split(filter); - if (urlArray.length > 1) { - mapUrl = urlArray[0] + filter + this.serverUrl + 'web/maps/' + this.mapId + '/map.json'; - } - } - mapUrl = mapUrl.indexOf('.json') === -1 ? `${mapUrl}.json` : mapUrl; - return mapUrl; - } - - public handleProxy(type?: string): string { - if (!this.proxy) { - return null; - } - const proxySuffix: string = this.proxyOptions[type || 'data']; - let proxy: string = this.serverUrl + proxySuffix; - if (typeof this.proxy === 'string') { - proxy = this.proxy; - } - return proxy; - } - - public handleWithCredentials(proxyUrl?: string, serviceUrl?: string, defaultValue = this.withCredentials): boolean | string { - if (serviceUrl?.includes('https://www.supermapol.com')) { - return ''; - } - if (proxyUrl && proxyUrl.startsWith(this.serverUrl) && (!serviceUrl || serviceUrl.startsWith(proxyUrl))) { - return true; - } - if (serviceUrl && this.iportalServiceProxyUrl && serviceUrl.indexOf(this.iportalServiceProxyUrl) >= 0) { - return true; - } - - return defaultValue; - } - - public isIportalResourceUrl(serviceUrl) { - return ( - serviceUrl.startsWith(this.serverUrl) || - (this.iportalServiceProxyUrl && serviceUrl.indexOf(this.iportalServiceProxyUrl) >= 0) - ); - } - - public handleParentRes(url, parentResId = this.mapId, parentResType = 'MAP'): string { - if (!this.isIportalResourceUrl(url)) { - return url; - } - return urlAppend(url, `parentResType=${parentResType}&parentResId=${parentResId}`); - } - - private _formatGeoJSON(data): any { - let features = data.features; - features.forEach((row, index) => { - row.properties['index'] = index; - }); - return features; - } - - private _excelData2Feature(dataContent: any, xyField: any = {}): any { - let fieldCaptions = dataContent.colTitles; - // 位置属性处理 - let xfieldIndex = fieldCaptions.indexOf(xyField.xField); - let yfieldIndex = fieldCaptions.indexOf(xyField.yField); - if (yfieldIndex < 0 || xfieldIndex < 0) { - for (let i = 0, len = fieldCaptions.length; i < len; i++) { - if (isXField(fieldCaptions[i])) { - xfieldIndex = i; - } - if (isYField(fieldCaptions[i])) { - yfieldIndex = i; - } - } - } - - // feature 构建后期支持坐标系 4326/3857 - let features = []; - - for (let i = 0, len = dataContent.rows.length; i < len; i++) { - let row = dataContent.rows[i]; - - let x = Number(row[xfieldIndex]); - let y = Number(row[yfieldIndex]); - - if (isNaN(x) || isNaN(y)) { - continue; - } - - // 属性信息 - let attributes = {}; - for (let index = 0; index < dataContent.colTitles.length; index++) { - const element = dataContent.colTitles[index].trim(); - attributes[element] = dataContent.rows[i][index]; - } - attributes['index'] = i + ''; - // 目前csv 只支持处理点,所以先生成点类型的 geojson - let feature = { - type: 'Feature', - geometry: { - type: 'Point', - coordinates: [x, y] - }, - properties: attributes - }; - features.push(feature); - } - return features; - } - - private _excelData2FeatureByDivision(content: any, divisionType: string, divisionField: string): Promise { - const dataName = ['城市', 'City'].includes(divisionType) ? 'MunicipalData' : 'ProvinceData'; - if (window[dataName] && window[dataName].features) { - return new Promise(resolve => { - resolve(this._combineFeature(content, window[dataName], divisionField)); - }); - } - const dataFileName = ['城市', 'City'].includes(divisionType) ? 'MunicipalData.js' : 'ProvincialData.js'; - const proxy = this.handleProxy(); - const dataUrl = `${this.serverUrl}apps/dataviz/libs/administrative_data/${dataFileName}`; - return SuperMap.FetchRequest.get(dataUrl, null, { - withCredentials: false, - proxy, - withoutFormatSuffix: true - }) - .then(response => { - return response.text(); - }) - .then(result => { - new Function(result)(); - return this._combineFeature(content, window[dataName], divisionField); - }); - } - - private _combineFeature( - properties: any, - geoData: GeoJSON.FeatureCollection, - divisionField: string - ): GeoJSON.FeatureCollection { - let geojson: GeoJSON.FeatureCollection = { - type: 'FeatureCollection', - features: [] - }; - if (properties.length < 2) { - return geojson; - } // 只有一行数据时为标题 - let titles = properties.colTitles; - let rows = properties.rows; - let fieldIndex = titles.findIndex(title => title === divisionField); - rows.forEach(row => { - let feature = geoData.features.find(item => { - return this._isMatchAdministrativeName(item.properties.Name, row[fieldIndex]); - }); - // todo 需提示忽略无效数据 - if (feature) { - const province = feature.properties.Province; - const combineFeature: GeoJSON.Feature = { properties: {}, geometry: feature.geometry, type: 'Feature' }; - row.forEach((item, idx) => { - combineFeature.properties[titles[idx]] = item; - }); - if (province) { - combineFeature.properties.Province = province; - } - geojson.features.push(combineFeature); - } - }); - return geojson; - } - - /** - * @description 行政区划原始数据和当前数据是否匹配 - */ - private _isMatchAdministrativeName(featureName: string, fieldName: string): boolean { - if (featureName && typeof fieldName === 'string' && fieldName.constructor === String) { - let shortName = featureName.trim().substr(0, 2); - // 张家口市和张家界市 - if (shortName === '张家') { - shortName = featureName.trim().substr(0, 3); - } - // 阿拉善盟 阿拉尔市 - if (shortName === '阿拉') { - shortName = featureName.trim().substr(0, 3); - } - return !!fieldName.match(new RegExp(shortName)); - } - return false; - } - - private _getTileLayerInfo(url, baseProjection) { - const proxy = this.handleProxy(); - let epsgCode = baseProjection.split('EPSG:')[1]; - let serviceUrl = `${url}/maps.json`; - serviceUrl = this.handleParentRes(serviceUrl); - return SuperMap.FetchRequest.get(serviceUrl, null, { - withCredentials: this.handleWithCredentials(proxy, serviceUrl, this.withCredentials), - proxy - }) - .then(response => { - return response.json(); - }) - .then(mapInfo => { - let promises = []; - if (mapInfo) { - mapInfo.forEach(info => { - let promise = SuperMap.FetchRequest.get( - `${info.path}.json?prjCoordSys=${JSON.stringify({ epsgCode: epsgCode })}`, - null, - { - withCredentials: this.withCredentials, - proxy - } - ) - .then(response => { - return response.json(); - }) - .then(restMapInfo => { - restMapInfo.url = info.path; - return restMapInfo; - }); - promises.push(promise); - }); - } - return Promise.all(promises).then(allRestMaps => { - return allRestMaps; - }); - }); - } - - private _getFeatureBySQL( - url: string, - datasetNames: Array, - processCompleted: Function, - processFaild: Function, - baseProjection? - ): void { - let getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams; - getFeatureParam = new SuperMap.FilterParameter({ - name: datasetNames.join().replace(':', '@'), - attributeFilter: null - }); - getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({ - queryParameter: getFeatureParam, - datasetNames: datasetNames, - fromIndex: 0, - toIndex: -1, - maxFeatures: -1, - returnContent: true - }); - if (baseProjection) { - if (baseProjection === 'EPSG:3857' || baseProjection === 'EPSG:-1000') { - getFeatureBySQLParams.targetEpsgCode = 4326; - } else { - getFeatureBySQLParams.targetEpsgCode = +baseProjection.split(':')[1]; - } - } - const proxy = this.handleProxy(); - let options = { - proxy, - withCredentials: this.handleWithCredentials(proxy, url, false), - eventListeners: { - processCompleted: getFeaturesEventArgs => { - let result = getFeaturesEventArgs.result; - if(result && result.datasetInfos) { - let fields = []; let fieldCaptions = []; let fieldTypes = []; - const fieldInfos = result.datasetInfos[0].fieldInfos; - fieldInfos.forEach(fieldInfo => { - if(fieldInfo.name) { - fields.push(fieldInfo.name.toUpperCase()); - fieldCaptions.push(fieldInfo.caption.toUpperCase()); - fieldTypes.push(fieldInfo.type); - } - }); - let data = statisticsFeatures(result.features.features, fields, fieldCaptions, fieldTypes); - getFeaturesEventArgs.result.features.features = data.features; - } - processCompleted && processCompleted(getFeaturesEventArgs); - }, - processFailed: e => { - processFaild && processFaild(e); - } - } - }; - const serviceUrl = this.handleParentRes(url); - getFeatureBySQLService = new SuperMap.GetFeaturesBySQLService(serviceUrl, options); - getFeatureBySQLService.processAsync(getFeatureBySQLParams); - } - - public async getEpsgCodeInfo(epsgCode, iPortalUrl) { - const url = iPortalUrl.slice(-1) === '/' ? iPortalUrl : `${iPortalUrl}/`; - let codeUrl = `${url}epsgcodes/${epsgCode}.json`; - const wkt = await SuperMap.FetchRequest.get(codeUrl, null) - .then(response => { - return response.json(); - }) - .then(epsgcodeInfo => { - return epsgcodeInfo.wkt; - }) - .catch(err => { - console.error(err); - return undefined; - }); - return wkt; - } -} diff --git a/src/common/_utils/__tests__/WebMapBase.spec.js b/src/common/_utils/__tests__/WebMapBase.spec.js deleted file mode 100644 index c32b233b..00000000 --- a/src/common/_utils/__tests__/WebMapBase.spec.js +++ /dev/null @@ -1,1381 +0,0 @@ -import WebMapBase from '../../../common/web-map/WebMapBase.ts'; -import cloneDeep from 'lodash.clonedeep'; -import flushPromises from 'flush-promises'; - -const SuperMap = require('../../../../test/unit/mocks/supermap'); -window.canvg = jest.fn(); -const id = 123; -const options = { - accessKey: undefined, - accessToken: undefined, - excludePortalProxyUrl: undefined, - iportalServiceProxyUrlPrefix: undefined, - isSuperMapOnline: undefined, - proxy: undefined, - serverUrl: '123', - target: 'map', - tiandituKey: undefined, - withCredentials: false -}; -const mapOptions = { - style: { - layers: [], - sources: {}, - version: 8 - } -}; -const WebMapBaseObj = new WebMapBase(id, options, mapOptions); -WebMapBaseObj.map = { - getZoom: () => 2, - setZoom: jest.fn(), - setMaxBounds: jest.fn(), - setMinZoom: jest.fn(), - setMaxZoom: jest.fn(), - getSource: () => { - return { - _data: { - features: [ - { - geometry: {} - } - ] - } - }; - } -}; -describe('WebMapBase.spec', () => { - it('echartslayer', () => { - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.echartslayer = [ - { - chart: { - resize: jest.fn() - } - } - ]; - newWebMapBaseObj.echartsLayerResize(); - }); - - it('setMapId mapId is number', async done => { - const mapId = 123; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj._initWebMap = jest.fn(); - await newWebMapBaseObj.setMapId(mapId); - setTimeout(() => { - done(); - }); - }); - - it('setMapId mapId is obj', async done => { - const mapId = { - value: 123 - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj._initWebMap = jest.fn(); - await newWebMapBaseObj.setMapId(mapId); - setTimeout(() => { - done(); - }); - }); - - it('setServerUrl', () => { - const serverUrl = '123'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setServerUrl(serverUrl); - expect(newWebMapBaseObj.serverUrl).toBe('123'); - }); - - it('setWithCredentials', () => { - const withCredentials = true; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setWithCredentials(withCredentials); - expect(newWebMapBaseObj.withCredentials).toBe(true); - }); - - it('setProxy', () => { - const proxy = 'http://test'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setProxy(proxy); - expect(newWebMapBaseObj.proxy).toBe(proxy); - }); - - it('setZoom', () => { - const zoom = 2; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setZoom(zoom); - expect(newWebMapBaseObj.mapOptions.zoom).toBe(zoom); - }); - - //maxBounds真实值??? - it('setMaxBounds', () => { - const maxBounds = 10; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setMaxBounds(maxBounds); - expect(newWebMapBaseObj.mapOptions.maxBounds).toBe(maxBounds); - }); - - it('setMinZoom', () => { - const minZoom = 1; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setMinZoom(minZoom); - expect(newWebMapBaseObj.mapOptions.minZoom).toBe(minZoom); - }); - - it('setMinZoom minZoom is undefined', () => { - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setMinZoom(); - expect(newWebMapBaseObj.mapOptions.minZoom).toBe(undefined); - }); - - it('setMaxZoom', () => { - const maxZoom = 19; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setMaxZoom(maxZoom); - expect(newWebMapBaseObj.mapOptions.maxZoom).toBe(maxZoom); - }); - - it('setMaxZoom maxZoom is undefined', () => { - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.setMaxZoom(); - expect(newWebMapBaseObj.mapOptions.maxZoom).toBe(undefined); - }); - - it('initWebMap', () => { - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.clean = jest.fn(); - newWebMapBaseObj._getMapInfo = jest.fn(); - newWebMapBaseObj.initWebMap(); - expect(newWebMapBaseObj.serverUrl).toBe('123/'); - }); - - it('getBaseLayerType layerType is TIANDITU', () => { - const layerInfo = { - layerType: 'TIANDITU_TER' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.getBaseLayerType(layerInfo); - // expect(newWebMapBaseObj.serverUrl).toBe('maxZoom'); - // expect(newWebMapBaseObj._taskID).toBe('maxZoom'); - }); - - it('getBaseLayerType layerType is TILE', () => { - const layerInfo = { - layerType: 'TILE' - }; - const layerInfo1 = { - layerType: 'SUPERMAP_REST' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo)).toBe('TILE'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo1)).toBe('TILE'); - }); - - it('getBaseLayerType layerType is CLOUD', () => { - const layerInfo = { - layerType: 'CLOUD' - }; - const layerInfo1 = { - layerType: 'CLOUD_BLACK' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo)).toBe('CLOUD'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo1)).toBe('CLOUD'); - }); - - it('getBaseLayerType layerType is XYZ', () => { - const layerInfo = { - layerType: 'OSM' - }; - const layerInfo1 = { - layerType: 'JAPAN_ORT' - }; - const layerInfo2 = { - layerType: 'JAPAN_RELIEF' - }; - const layerInfo3 = { - layerType: 'JAPAN_PALE' - }; - const layerInfo4 = { - layerType: 'JAPAN_STD' - }; - const layerInfo5 = { - layerType: 'GOOGLE_CN' - }; - const layerInfo6 = { - layerType: 'GOOGLE' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo)).toBe('XYZ'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo1)).toBe('XYZ'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo2)).toBe('XYZ'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo3)).toBe('XYZ'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo4)).toBe('XYZ'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo5)).toBe('XYZ'); - expect(newWebMapBaseObj.getBaseLayerType(layerInfo6)).toBe('XYZ'); - }); - - it('getMapurls is default', () => { - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getMapurls().CLOUD).toBe( - 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}' - ); - expect(newWebMapBaseObj.getMapurls().CLOUD_BLACK).toBe('http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}'); - }); - - it('getLayerFeatures 没覆盖完', done => { - const layer = { - dataSource: { accessType: 'DIRECT', type: 'PORTAL_DATA', serverId: '366831804' }, - enableFields: ['SmID', '标准名称', '起点x', '起点y', '终点x', '终点y'], - featureType: 'LINE', - layerID: '北京市轨道交通线路', - layerType: 'UNIQUE', - name: '北京市轨道交通线路', - projection: 'EPSG:4326', - style: { strokeWidth: 6, lineDash: 'solid', strokeColor: '#3288bd', type: 'LINE', strokeOpacity: 1 }, - themeSetting: { themeField: 'SmID', customSettings: {}, colors: [] }, - visible: true - }; - const _taskID = '123'; - const type = 'hosted'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj.getLayerFeatures(layer, _taskID, type); - setTimeout(() => { - done(); - }); - }); - - it('setFeatureInfo feature comes from dataViz', () => { - const feature = { - dv_v5_markerInfo: { - dataViz_title: 'jiuzhaigou', - title: '老虎海', - subtitle: '树正沟景点-老虎海' - }, - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.setFeatureInfo(feature)).toBe(feature.dv_v5_markerInfo); - }); - - it('setFeatureInfo', () => { - const feature = { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.setFeatureInfo(feature)).toBe(undefined); - }); - - it('getRankStyleGroup', () => { - const themeField = 'description'; - const parameters = { - style: { color: '#FFFFFF', fillColor: '#000' }, - themeSetting: { - segmentMethod: '', - segmentCount: [], - customSettings: {}, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '', - index: 1 - }, - type: 'Feature' - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getRankStyleGroup(themeField, features, parameters).length).toBe(6); - expect(newWebMapBaseObj.getRankStyleGroup(themeField, features, parameters)[0].color).toBe('#d53e4f'); - }); - - it('getRankStyleGroup filter fieldValue is ""', () => { - const themeField = 'description'; - const parameters = { - style: { color: '#FFFFFF', fillColor: '#000' }, - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getRankStyleGroup(themeField, features, parameters)[0].color).toBe('#d53e4f'); - }); - - it('createRankStyleSource', () => { - const parameters = { - style: { color: '#FFFFFF', fillColor: '#000' }, - themeSetting: { - segmentMethod: '', - segmentCount: '', - customSettings: '', - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - themeField: 'title', - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.createRankStyleSource(parameters, features).parameters.properties.description).toBe( - '老虎海海拔2298米' - ); - }); - - it('isMatchAdministrativeName fieldName is string', () => { - const featureName = '张家界市'; - const fieldName = 'address'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.isMatchAdministrativeName(featureName, fieldName)).toBe(false); - }); - - it('isMatchAdministrativeName fieldName is not string', () => { - const featureName = '张家界市'; - const fieldName = undefined; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.isMatchAdministrativeName(featureName, fieldName)).toBe(false); - }); - - it('getRestMapLayerInfo', () => { - const restMapInfo = { - bounds: { - left: 10, - top: 10, - bottom: 10, - right: 10 - }, - coordUnit: 'm', - visibleScales: 18, - url: 'http://test' - }; - const layer = { - layerType: '', - orginEpsgCode: '', - units: '', - extent: '', - visibleScales: '', - url: '', - sourceType: '' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getRestMapLayerInfo(restMapInfo, layer).layerType).toBe('TILE'); - }); - - it('handleLayerFeatures', () => { - const layerInfo = { - layerType: 'TIANDITU_TER', - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - filterCondition: 'true' - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.handleLayerFeatures(features, layerInfo)[0].geometry).toEqual({ - coordinates: [0, 1], - type: 'Point' - }); - }); - - it('mergeFeatures', () => { - const layerId = 1; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.mergeFeatures(layerId, features)[0].geometry).toEqual({ - coordinates: [0, 1], - type: 'Point' - }); - }); - - it('getEchartsLayerOptions', () => { - const layerInfo = { - layerType: 'TIANDITU_TER', - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - filterCondition: 'true', - from: { - type: 'XY_FIELD', - xField: 'title', - yField: 'num' - }, - to: { - type: 'XY_FIELD', - xField: 'title', - yField: 'num' - }, - labelSetting: { - show: true - }, - animationSetting: { - show: true, - constantSpeed: 300, - symbol: 'marker', - symbolSize: 2 - }, - lineSetting: { - color: '#000', - type: 'solid', - width: 0.5, - opacity: 1, - curveness: '' - } - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: [ - { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1, - from: { - type: 'XY_FIELD', - xField: 'title', - yField: 'num' - }, - to: { - type: 'XY_FIELD', - xField: 'title', - yField: 'num' - } - } - ], - type: 'Feature' - } - ]; - const coordinateSystem = {}; // 不知道 - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect( - newWebMapBaseObj.getEchartsLayerOptions(layerInfo, features, coordinateSystem).series[0].effect.constantSpeed - ).toBe(300); - }); - - it('getEchartsLayerOptions', () => { - const layerInfo = { - layerType: 'TIANDITU_TER', - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - filterCondition: 'true', - from: { - type: 'XY_FIELD', - xField: 'title', - yField: 'subtitle' - }, - to: { - type: 'XY_FIELD', - xField: 'title', - yField: 'subtitle' - }, - labelSetting: { - show: true - }, - animationSetting: { - show: true, - constantSpeed: 300, - symbol: 'marker', - symbolSize: 2 - }, - lineSetting: { - color: '#000', - type: 'solid', - width: 0.5, - opacity: 1, - curveness: '' - } - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: [ - { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - } - ], - type: 'Feature' - } - ]; - const coordinateSystem = {}; // 不知道 - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect( - newWebMapBaseObj.getEchartsLayerOptions(layerInfo, features, coordinateSystem).series[0].effect.constantSpeed - ).toBe(300); - }); - - it('getDashStyle str is solid', () => { - const str = 'solid'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([]); - }); - - it('getDashStyle str is dot', () => { - const str = 'dot'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([1, 8]); - }); - - it('getDashStyle str is dash', () => { - const str = 'dash'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([8, 8]); - }); - - it('getDashStyle str is dashrailway', () => { - const str = 'dashrailway'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([16, 24]); - }); - - it('getDashStyle str is dashdot', () => { - const str = 'dashdot'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([8, 8, 2, 8]); - }); - - it('getDashStyle str is longdash', () => { - const str = 'longdash'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([16, 8]); - }); - - it('getDashStyle str is longdashdot', () => { - const str = 'longdashdot'; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual([16, 8, 1, 8]); - }); - - it('getDashStyle no params', () => { - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle()).toEqual([]); - }); - - it('getDashStyle params str is Array', () => { - const str = ['longdashdot']; - const strokeWidth = 2; - const type = 'array'; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getDashStyle(str, strokeWidth, type)).toEqual(['longdashdot']); - }); - - it('getCanvasFromSVG', async (done) => { - window.canvg = { - default: { - from: (ctx, url, callback) => Promise.resolve({ stop: jest.fn(), start: jest.fn() }) - } - }; - const svgUrl = 'http://testsvg'; - const divDom = { - appendChild: jest.fn() - }; - const callBack = function () {}; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getCanvasFromSVG(svgUrl, divDom, callBack)).toBe(undefined); - await flushPromises(); - done(); - }); - - it('getRangeStyleGroup', () => { - const layerInfo = { - layerType: 'TIANDITU_TER', - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'], - themeField: 'title' - }, - style: { color: '#000' } - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getRangeStyleGroup(layerInfo, features)[0].color).toBe('#d53e4f'); - }); - - it('getUniqueStyleGroup', () => { - const parameters = { - layerType: 'TIANDITU_TER', - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'], - themeField: 'title' - }, - style: { color: '#000' } - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getUniqueStyleGroup(parameters, features)[0].value).toBe('老虎海'); - }); - - it('getUniqueStyleGroup when custom line color', () => { - const parameters = { - layerType: 'UNIQUE', - themeSetting: { - "themeField": "SmID", - "customSettings": { - "1": { - "strokeWidth": 2, - "lineDash": "solid", - "strokeColor": "#ffffff", - "type": "LINE", - "strokeOpacity": 1 - }, - "2": { - "strokeWidth": 2, - "lineDash": "solid", - "strokeColor": "#dddddd", - "type": "LINE", - "strokeOpacity": 1 - }, - "3": { - "strokeWidth": 2, - "lineDash": "solid", - "strokeColor": "#eeeeee", - "type": "LINE", - "strokeOpacity": 1 - } - }, - "colors": [ - "#D53E4F", - "#FC8D59", - "#FEE08B", - "#FFFFBF", - "#E6F598", - "#99D594", - "#3288BD" - ] - }, - style: { color: '#000' } - }; - const features = [ - { - geometry: { type: 'Point', coordinates: [0, 1] }, - properties: { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - SmID: 1 - }, - type: 'Feature' - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.getUniqueStyleGroup(parameters, features)[0].color).toBe('#ffffff'); - }); - - it('handleSvgColor', () => { - const style = { - fillColor: '#000', - fillOpacity: 1, - strokeOpacity: 1, - strokeWidth: 2 - }; - const canvas = { - getContext: () => { - return { - fill: jest.fn(), - stroke: jest.fn() - }; - } - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj.handleSvgColor(style, canvas)).toBe(undefined); - }); - - it('_createLinesData', () => { - const layerInfo = { - layerType: 'TIANDITU_TER', - themeSetting: { - segmentMethod: '', - segmentCount: 2, - customSettings: { - 0: { - segment: { - start: 0, - end: 10 - } - }, - 1: { - segment: { - start: 0, - end: 10 - } - } - }, - minRadius: 1, - maxRadius: 1, - colors: ['#000', '#FFF'] - }, - filterCondition: 'true', - from: { - type: 'PLACE_FIELD', - field: 'title' - }, - to: { - type: 'PLACE_FIELD', - field: 'title' - }, - labelSetting: { - show: true - }, - animationSetting: { - show: true, - constantSpeed: 300, - symbol: 'marker', - symbolSize: 2 - }, - lineSetting: { - color: '#000', - type: 'solid', - width: 0.5, - opacity: 1, - curveness: '' - } - }; - const properties = [ - { - title: '老虎海', - subtitle: '树正沟景点-老虎海', - imgUrl: './laohuhai.png', - description: '老虎海海拔2298米', - index: 1, - from: { - type: 'XY_FIELD', - xField: 'title', - yField: 'num' - }, - to: { - type: 'XY_FIELD', - xField: 'title', - yField: 'num' - } - } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj._createLinesData(layerInfo, properties)).toEqual([]); - }); - - it('_createPointsData', () => { - const lineData = [ - { - coords: [ - [1.295350519989875e7, 4851338.019912067], - [1.295350519989875e7, 4851338.019912067] - ] - } - ]; - const layerInfo = { - animationSetting: { - symbol: 'pin', - symbolSize: 15, - show: true, - constantSpeed: 40 - }, - dataSource: { accessType: 'DIRECT', type: 'PORTAL_DATA', serverId: '1249258329' }, - enableFields: ['SmID', 'SmX', 'SmY', 'SmLibTileID', 'SmUserID', 'SmGeometrySize', 'SmGeoPosition', '标准名称'], - featureType: 'POINT', - from: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - labelSetting: { - fontFamily: '黑体', - color: '#62AD16', - show: true - }, - layerID: '北京市轨道交通站点', - layerType: 'MIGRATION', - lineSetting: { - curveness: 0.2, - color: '#792b1b', - width: 1, - type: 'solid', - opacity: 0.6 - }, - name: '北京市轨道交通站点', - projection: 'EPSG:4326', - to: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - visible: 'visible' - }; - const properties = [ - { - SmGeoPosition: '393216', - SmGeometrySize: '20', - SmID: '1', - SmLibTileID: '1', - SmUserID: '0', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - index: 0, - 标准名称: '长椿街站' - } - ]; - const result = [ - { name: undefined, value: [12953505.19989875, 4851338.019912067] }, - { name: undefined, value: [12953505.19989875, 4851338.019912067] } - ]; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj._createPointsData(lineData, layerInfo, properties)).toEqual(result); - }); - - it('_createOptions open animation', () => { - const lineData = [ - { - coords: [ - [1.295350519989875e7, 4851338.019912067], - [1.295350519989875e7, 4851338.019912067] - ] - } - ]; - const layerInfo = { - animationSetting: { - symbol: 'pin', - symbolSize: 15, - show: true, - constantSpeed: 40 - }, - dataSource: { accessType: 'DIRECT', type: 'PORTAL_DATA', serverId: '1249258329' }, - enableFields: ['SmID', 'SmX', 'SmY', 'SmLibTileID', 'SmUserID', 'SmGeometrySize', 'SmGeoPosition', '标准名称'], - featureType: 'POINT', - from: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - labelSetting: { - fontFamily: '黑体', - color: '#62AD16', - show: true - }, - layerID: '北京市轨道交通站点', - layerType: 'MIGRATION', - lineSetting: { - curveness: 0.2, - color: '#792b1b', - width: 1, - type: 'solid', - opacity: 0.6 - }, - name: '北京市轨道交通站点', - projection: 'EPSG:4326', - to: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - visible: 'visible' - }; - const properties = [ - { - SmGeoPosition: '393216', - SmGeometrySize: '20', - SmID: '1', - SmLibTileID: '1', - SmUserID: '0', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - index: 0, - 标准名称: '长椿街站' - } - ]; - const pointData = [1.295350519989875e7, 4851338.019912067]; - const coordinateSystem = 'GLMap'; - const result = { - series: [ - { - coordinateSystem: 'GLMap', - data: [ - { - coords: [ - [12953505.19989875, 4851338.019912067], - [12953505.19989875, 4851338.019912067] - ] - } - ], - effect: { constantSpeed: 40, show: true, symbol: 'pin', symbolSize: 15, trailLength: 0 }, - lineStyle: { normal: { color: '#792b1b', curveness: 0.2, opacity: 0.6, type: 'solid', width: 1 } }, - name: 'line-series', - type: 'lines', - zlevel: 1 - }, - { - coordinateSystem: 'GLMap', - data: [12953505.19989875, 4851338.019912067], - itemStyle: { normal: { color: '#792b1b' } }, - label: { - normal: { color: '#62AD16', fontFamily: '黑体', formatter: '{b}', position: 'right', show: true } - }, - name: 'point-series', - type: 'effectScatter', - rippleEffect: { - brushType: 'stroke' - }, - zlevel: 2 - } - ] - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj._createOptions(layerInfo, lineData, pointData, coordinateSystem)).toEqual(result); - }); - - it('_createOptions close animation', () => { - const lineData = [ - { - coords: [ - [1.295350519989875e7, 4851338.019912067], - [1.295350519989875e7, 4851338.019912067] - ] - } - ]; - const layerInfo = { - animationSetting: { - symbol: 'pin', - symbolSize: 15, - show: false, - constantSpeed: 40 - }, - dataSource: { accessType: 'DIRECT', type: 'PORTAL_DATA', serverId: '1249258329' }, - enableFields: ['SmID', 'SmX', 'SmY', 'SmLibTileID', 'SmUserID', 'SmGeometrySize', 'SmGeoPosition', '标准名称'], - featureType: 'POINT', - from: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - labelSetting: { - fontFamily: '黑体', - color: '#62AD16', - show: true - }, - layerID: '北京市轨道交通站点', - layerType: 'MIGRATION', - lineSetting: { - curveness: 0.2, - color: '#792b1b', - width: 1, - type: 'solid', - opacity: 0.6 - }, - name: '北京市轨道交通站点', - projection: 'EPSG:4326', - to: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - visible: 'visible' - }; - const pointData = [1.295350519989875e7, 4851338.019912067]; - const coordinateSystem = 'GLMap'; - const result = { - series: [ - { - coordinateSystem: 'GLMap', - data: [ - { - coords: [ - [12953505.19989875, 4851338.019912067], - [12953505.19989875, 4851338.019912067] - ] - } - ], - effect: { constantSpeed: 40, show: false, symbol: 'pin', symbolSize: 15, trailLength: 0 }, - lineStyle: { normal: { color: '#792b1b', curveness: 0.2, opacity: 0.6, type: 'solid', width: 1 } }, - name: 'line-series', - type: 'lines', - zlevel: 1 - }, - { - coordinateSystem: 'GLMap', - data: [12953505.19989875, 4851338.019912067], - itemStyle: { normal: { color: '#792b1b' } }, - label: { - normal: { color: '#62AD16', fontFamily: '黑体', formatter: '{b}', position: 'right', show: true } - }, - name: 'point-series', - type: 'scatter', - zlevel: 2 - } - ] - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - expect(newWebMapBaseObj._createOptions(layerInfo, lineData, pointData, coordinateSystem)).toEqual(result); - }); - - it('_getLayerFeaturesSucceeded', () => { - const result = { - features: [ - { - geometry: { type: 'Point', coordinates: [] }, - properties: { - SmID: '1', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - SmLibTileID: '1', - SmUserID: '0' - }, - type: 'Feature' - } - ], - type: 'feature' - }; - const result1 = { - features: [ - { - geometry: { type: 'Point', coordinates: [] }, - properties: { - SmID: '1', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - SmLibTileID: '1', - SmUserID: '0' - }, - type: 'Feature' - } - ], - type: 'restMap' - }; - const result2 = { - features: [ - { - geometry: { type: 'Point', coordinates: [] }, - properties: { - SmID: '1', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - SmLibTileID: '1', - SmUserID: '0' - }, - type: 'Feature' - } - ], - type: 'mvt' - }; - const result3 = { - features: [ - { - geometry: { type: 'Point', coordinates: [] }, - properties: { - SmID: '1', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - SmLibTileID: '1', - SmUserID: '0' - }, - type: 'feature' - } - ], - type: 'dataflow' - }; - const result4 = { - features: [ - { - geometry: { type: 'Point', coordinates: [] }, - properties: { - SmID: '1', - SmX: '1.295350519989875E7', - SmY: '4851338.019912067', - SmLibTileID: '1', - SmUserID: '0' - }, - type: 'feature' - } - ], - type: 'noServerId' - }; - const layer = { - animationSetting: { - symbol: 'pin', - symbolSize: 15, - show: false, - constantSpeed: 40 - }, - dataSource: { accessType: 'DIRECT', type: 'PORTAL_DATA', serverId: '1249258329' }, - enableFields: ['SmID', 'SmX', 'SmY', 'SmLibTileID', 'SmUserID', 'SmGeometrySize', 'SmGeoPosition', '标准名称'], - featureType: 'POINT', - from: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - labelSetting: { - fontFamily: '黑体', - color: '#62AD16', - show: true - }, - layerID: '北京市轨道交通站点', - layerType: 'MIGRATION', - lineSetting: { - curveness: 0.2, - color: '#792b1b', - width: 1, - type: 'solid', - opacity: 0.6 - }, - name: '北京市轨道交通站点', - projection: 'EPSG:4326', - to: { - xField: 'SmX', - yField: 'SmY', - type: 'XY_FIELD' - }, - visible: 'visible' - }; - const newWebMapBaseObj = cloneDeep(WebMapBaseObj); - newWebMapBaseObj._initOverlayLayer = jest.fn(); - expect(newWebMapBaseObj._getLayerFeaturesSucceeded(result, layer)).toEqual(undefined); - expect(newWebMapBaseObj._getLayerFeaturesSucceeded(result1, layer)).toEqual(undefined); - expect(newWebMapBaseObj._getLayerFeaturesSucceeded(result2, layer)).toEqual(undefined); - expect(newWebMapBaseObj._getLayerFeaturesSucceeded(result3, layer)).toEqual(undefined); - expect(newWebMapBaseObj._getLayerFeaturesSucceeded(result4, layer)).toEqual(undefined); - }); -}); diff --git a/src/common/_utils/__tests__/WebMapService.spec.js b/src/common/_utils/__tests__/WebMapService.spec.js deleted file mode 100644 index 95884eee..00000000 --- a/src/common/_utils/__tests__/WebMapService.spec.js +++ /dev/null @@ -1,785 +0,0 @@ -import WebMapService from '../WebMapService.ts'; -import flushPromises from 'flush-promises'; -import iportal_serviceProxy from '../../../../test/unit/mocks/data/iportal_serviceProxy.json'; -import layerData from '../../../../test/unit/mocks/data/layerData.json'; -import uniqueLayer_polygon from '../../../../test/unit/mocks/data/WebMap/uniqueLayer_polygon.json'; -import epsgCode_wkt from '../../../../test/unit/mocks/data/epsgCode_wkt.json'; -import { wmsCapabilitiesText, wmtsCapabilitiesText, wmtsCapabilitiesTextWithSingleProperty, wmtsCapabilitiesOthertileMatrixSet } from 'vue-iclient/test/unit/mocks/data/CapabilitiesText.js'; -import mockFetch from 'vue-iclient/test/unit/mocks/FetchRequest'; - -const SuperMap = require('../../../../test/unit/mocks/supermap'); - -const mapId = 123; -const options = { - accessKey: undefined, - accessToken: undefined, - excludePortalProxyUrl: undefined, - iportalServiceProxyUrlPrefix: undefined, - isSuperMapOnline: undefined, - proxy: undefined, - serverUrl: 'https://fakeiportal.supermap.io/iportal', - target: 'map', - tiandituKey: undefined, - withCredentials: false -}; - -describe('WebMapService.spec', () => { - afterEach(() => { - jest.restoreAllMocks(); - jest.resetAllMocks(); - }); - // public Fun - it('setMapId if typeof MapId is num', () => { - const service = new WebMapService(mapId); - service.setMapId(mapId); - expect(service.mapId).toBe(mapId); - expect(service.mapInfo).toBe(null); - }); - - it('setMapId if typeof MapId is object', () => { - const mapId = uniqueLayer_polygon; - const service = new WebMapService(mapId, options); - service.setMapId(mapId); - expect(service.mapId).toBe(''); - expect(service.mapInfo).toBe(mapId); - }); - - it('setServerUrl', () => { - const serverUrl = 'https://fakeiportal.supermap.io'; - const service = new WebMapService(mapId, options); - expect(service.serverUrl).toBe('https://fakeiportal.supermap.io/iportal'); - service.setServerUrl(serverUrl); - expect(service.serverUrl).toBe(serverUrl); - }); - - it('setWithCredentials', () => { - const withCredentials = true; - const service = new WebMapService(mapId, options); - expect(service.withCredentials).toBe(false); - service.setWithCredentials(withCredentials); - expect(service.withCredentials).toBe(true); - }); - - it('setProxy', () => { - const proxy = 'https://fakeiportal.supermap.io/iportal'; - const service = new WebMapService(mapId, options); - expect(service.proxy).toBe(undefined); - service.setProxy(proxy); - expect(service.proxy).toBe(proxy); - }); - - it('ServerUrl has "/" at the end', () => { - const serverUrl = 'https://fakeiportal.supermap.io/iportal'; - const service = new WebMapService(mapId, options); - service.handleServerUrl(serverUrl); - expect(service.serverUrl).toBe('https://fakeiportal.supermap.io/iportal/'); - }); - - it('get MapInfo by mapId', async done => { - const newOptions = { - ...options, - serverUrl: 'https://fakeiportal.supermap.io/iportal/8095/portalproxy/' // 没有通过处理在末尾加 '/',在此处理 - }; - const newIportal_serviceProxy = { - serviceProxy: { - ...iportal_serviceProxy.serviceProxy, - proxyServerRootUrl: undefined - } - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/8095/portalproxy/web/config/portal.json': newIportal_serviceProxy, - 'https://fakeiportal.supermap.io/iportal/8095/portalproxy/web/maps/123/map.json': uniqueLayer_polygon - }; - const newUniqueLayer_polygon = { - ...uniqueLayer_polygon, - mapParams: { - title: uniqueLayer_polygon.title, - description: uniqueLayer_polygon.description - } - }; - mockFetch(fetchResource); - const service = new WebMapService(mapId, newOptions); - await flushPromises(); - expect.assertions(1); - return service.getMapInfo().then(mapInfo => { - expect(mapInfo).toStrictEqual(newUniqueLayer_polygon); - done(); - }); - }); - - it('fail to get MapInfo by mapId', async done => { - const options = { - ...options, - serverUrl: 'https://fakeiportal.supermap.io/iportal/' // 没有通过处理在末尾加 '/',在此处理 - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/web/config/portal.json': iportal_serviceProxy - }; - mockFetch(fetchResource); - const service = new WebMapService(mapId, options); - await flushPromises(); - expect.assertions(1); - return service.getMapInfo().catch(error => { - expect(error).toBe('未匹配到https://fakeiportal.supermap.io/iportal/web/maps/123/map.json'); - done(); - }); - }); - - it('get the wrong iPortal service proxy', async () => { - const options = { - ...options, - serverUrl: 'https://fakeiportal.supermap.io/iportal/' - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/web/config/portal.json': {} - }; - mockFetch(fetchResource); - const service = new WebMapService(mapId, options); - await flushPromises(); - expect.assertions(1); - await expect(service.getMapInfo()).rejects.toBe('serviceProxyFailed'); - }); - - it('fail to get iPortal service proxy', async done => { - const newOptions = { - ...options, - serverUrl: 'https://fakeiportal.supermap.io/iportal/' // 没有通过处理在末尾加 '/',在此处理 - }; - const fetchResource = {}; - mockFetch(fetchResource); - const service = new WebMapService(mapId, newOptions); - await flushPromises(); - expect.assertions(1); - return service.getMapInfo().catch(error => { - expect(error).toBe('未匹配到https://fakeiportal.supermap.io/iportal/web/config/portal.json'); - done(); - }); - }); - - it('get Layer Features from GeoJson Data', async done => { - const newOptions = { - ...options, - iportalServiceProxyUrlPrefix: 'https://fakeiportal.supermap.io/', - proxy: 'https://fakeiportal.supermap.io/iportal', - serverUrl: 'https://fakeiportal.supermap.io/iportal/' // 没有通过处理在末尾加 '/',在此处理 - }; - const JsonData = { - content: JSON.stringify({ - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - icon: 'theatre1' - }, - geometry: { - type: 'Point', - coordinates: [-77.038659, 38.931567] - } - } - ] - }), - fileName: '北京市.geojson', - lineNumber: null, - type: 'GEOJSON' - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/web/datas/123/content.json?pageSize=9999999¤tPage=1&parentResType=MAP&parentResId=123': JsonData - }; - mockFetch(fetchResource); - const type = 'hosted'; - const layer = { - dataSource: { - serverId: '123', - accessType: 'DIRECT' - } - }; - const baseProjection = 'EPSG:3857'; - const service = new WebMapService(mapId, newOptions); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data.features.length).toBe(1); - done(); - }); - }); - - it('get Layer Features from CSV', async done => { - const newOptions = { - ...options, - proxy: 'https://fakeiportal.supermap.io/iportal/', - serverUrl: 'https://fakeiportal.supermap.io/iportal/' // 没有通过处理在末尾加 '/',在此处理 - }; - const administrative_data = `window.ProvinceData = { - features: [{ - geometry: { - coordinates: [[[[113.5872766800001, 22.16493972869857], [113.5980630750001, 22.13509586869991]]],[[[113.5511133950001, 22.21679186869615], [113.5623058550001, 22.1994578386969]]]], - type: 'MultiPolygon' - }, - properties: {Name: '张家界', UserID: 0, Province: '湖南}, - type: 'Feature' - }], - type: 'FeatureCollection' - }`; - window.MunicipalData = { - features: [{ - geometry: { - coordinates: [[[[113.5872766800001, 22.16493972869857], [113.5980630750001, 22.13509586869991]]], [[[113.5511133950001, 22.21679186869615], [113.5623058550001, 22.1994578386969]]]], - type: 'MultiPolygon' - }, - properties: { Name: '张家界', UserID: 0 }, - type: 'Feature' - }] - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/web/datas/123/content.json?pageSize=9999999¤tPage=1&parentResType=MAP&parentResId=123': layerData, - 'https://fakeiportal.supermap.io/iportal/apps/dataviz/libs/administrative_data/MunicipalData.js': administrative_data - }; - mockFetch(fetchResource); - const type = 'hosted'; - const layer = { - dataSource: { - serverId: '123', - administrativeInfo: { - divisionType: 'City', - divisionField: '张家界' - } - } - }; - const baseProjection = 'EPSG:3857'; - const service = new WebMapService(mapId, newOptions); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data.features.length).toBe(1); - done(); - }); - }); - - it('get Layer Features from shp Data', async done => { - const newOptions = { - ...options, - proxy: 'https://fakeiportal.supermap.io/iportal/', - serverUrl: 'https://fakeiportal.supermap.io/iportal/' // 没有通过处理在末尾加 '/',在此处理 - }; - const ShpData = { - content: JSON.stringify({ - layers: [{ - type: 'FeatureCollection', - features: [ - { - type: 'Feature', - properties: { - icon: 'theatre1' - }, - geometry: { - type: 'Point', - coordinates: [-77.038659, 38.931567] - } - } - ] - }] - }), - fileName: '北京市.shp', - lineNumber: null, - type: 'SHP' - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/web/datas/123/content.json?pageSize=9999999¤tPage=1&parentResType=MAP&parentResId=123': ShpData - }; - mockFetch(fetchResource); - const type = 'hosted'; - const layer = { - dataSource: { - serverId: '123', - accessType: 'DIRECT' - } - }; - const baseProjection = 'EPSG:3857'; - const service = new WebMapService(mapId, newOptions); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data.features.length).toBe(1); - done(); - }); - }); - - it('get Layer Features from mvt', async done => { - const newOptions = { - ...options, - proxy: 'https://fakeiportal.supermap.io/iportal/', - serverUrl: 'https://fakeiportal.supermap.io/iportal/' // 没有通过处理在末尾加 '/',在此处理 - }; - const result = [ - { - name: 'test', - type: 'FeatureCollection', - - } - ]; - const result1 = { - fileId: 'test', - datasetName: 'test', - dataItemServices: [{ - serviceType: 'RESTDATA', - address: 'https://fakeiportal.supermap.io/iportal/' - }] - } - const datasource = { - code: 200, - datasourceNames: ['captial'] - }; - const datasetsInfo = { - datasetInfo: { - prjCoordSys: { - epsgCode: '3857' - }, - bounds: [0, 1, 0, 1] - } - }; - const result2 = { - error: { - code: 400 - } - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/web/datas/123/datasets.json?parentResType=MAP&parentResId=123': result, - 'https://fakeiportal.supermap.io/iportal/web/datas/123.json?parentResType=MAP&parentResId=123': result1, - 'https://fakeiportal.supermap.io/iportal//data/datasources.json?parentResType=MAP&parentResId=123': datasource, - 'https://fakeiportal.supermap.io/iportal//data/datasources/captial/datasets/test?parentResType=MAP&parentResId=123': datasetsInfo, - 'https://fakeiportal.supermap.io/iportal//data/datasources/captial/datasets/test?parentResType=MAP&parentResId=123/tilefeature.mvt': result2, - }; - mockFetch(fetchResource); - const type = 'hosted'; - const layer = { - serverId: '123', - layerType: 'HOSTED_TILE' - }; - const baseProjection = 'EPSG:3857'; - const service = new WebMapService(mapId, newOptions); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data.type).toBe('mvt'); - done(); - }); - }); - - it('get Layer Features if LayerInfo from rest_data success', async done => { - const type = 'rest_data'; - const layer = { - dataSource: { - url: 'https://fakeiportal.supermap.io/iportal/processCompleted' - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:3857'; - const result = { - features: [ - { - geometry: { coordinates: [101.84004968, 26.0859968692659], type: 'Point' }, - properties: { NAME: '四川省', SMID: '1', index: '0', lat: 26.0859968692659, lon: 101.84004968 }, - type: 'Feature' - } - ], - type: 'feature' - }; - const service = new WebMapService(mapId, options); - expect.assertions(1); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data.features[0].geometry).toStrictEqual(result.features[0].geometry); - done(); - }); - }); - - it('features will apply caption field when with caption config', async done => { - const type = 'rest_data'; - const layer = { - dataSource: { - url: 'https://fakeiportal.supermap.io/iportal/processCompleted' - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:3857'; - const result = { - features: [ - { - geometry: { coordinates: [101.84004968, 26.0859968692659], type: 'Point' }, - properties: { NAME: '四川省', SMID: '1', index: '0', lat: 26.0859968692659, lon: 101.84004968 }, - type: 'Feature' - } - ], - type: 'feature' - }; - const service = new WebMapService(mapId, options); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data.features[0].properties['名称']).toBe('四川省'); - done(); - }); - }); - - it('get layer features if layerInfo from rest_data fail', done => { - const type = 'rest_data'; - const layer = { - dataSource: { - url: 'https://fakeiportal.supermap.io/iportal/processFailed' - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:4326'; - const service = new WebMapService(mapId, options); - expect.assertions(1); - expect(service.getLayerFeatures(type, layer, baseProjection)).rejects.toBe('get features faild'); - done(); - }); - - it('get Layer Features if LayerInfo from rest_map success', async done => { - const type = 'rest_map'; - const layer = { - dataSource: { - url: 'https://fakeiportal.supermap.io/iportal/processCompleted' - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:3857'; - const result = { - features: [ - { - geometry: { coordinates: [101.84004968, 26.0859968692659], type: 'Point' }, - properties: { NAME: '四川省', SMID: '1', index: '0', lat: 26.0859968692659, lon: 101.84004968 }, - type: 'Feature' - } - ], - type: 'feature' - }; - const service = new WebMapService(mapId, options); - expect.assertions(1); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data).toStrictEqual(result); - done(); - }); - }); - - it('get layer features if layerInfo from rest_map fail', async () => { - const type = 'rest_map'; - const layer = { - dataSource: { - url: 'https://fakeiportal.supermap.io/iportal/processFailed' - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:4326'; - const service = new WebMapService(mapId, options); - expect.assertions(1); - await expect(service.getLayerFeatures(type, layer, baseProjection)).rejects.toBe('get features faild'); - }); - - it('get layer features if LayerInfo from dataflow success', async done => { - const retrun = { - featureMetaData: { - featureType: 'Point', - fieldInfos: [ - { - name: 'text', - type: 'TEXT' - }, - { - name: 'long', - type: 'LONG' - }, - { - name: 'numberw', - type: 'Number' - } - ] - }, - urls: [ - { - url: 'https://fakeiportal.supermap.io/iserver/services/dataflow' - } - ] - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/processCompleted.json?token=123&parentResType=MAP&parentResId=123': retrun - }; - mockFetch(fetchResource); - const type = 'dataflow'; - const layer = { - dataSource: { - dataTypes: {} - }, - url: 'https://fakeiportal.supermap.io/iportal/processCompleted', - credential: { - token: '123' - } - }; - const baseProjection = 'EPSG:1000'; - const result = { type: 'dataflow' }; - const service = new WebMapService(mapId, options); - expect.assertions(1); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data).toStrictEqual(result); - done(); - }); - }); - - it('get layer features if LayerInfo from dataflow fail', async () => { - const fetchResource = {}; - mockFetch(fetchResource); - const type = 'dataflow'; - const layer = { - dataSource: { - dataTypes: {} - }, - url: 'https://fakeiportal.supermap.io/iportal/processFailed', - credential: { - token: '123' - } - }; - const baseProjection = 'EPSG:1000'; - const service = new WebMapService(mapId, options); - await flushPromises(); - expect.assertions(1); - await expect(service.getLayerFeatures(type, layer, baseProjection)).rejects.toBe(undefined); - }); - - it('get layer features if LayerInfo from user_data success', async done => { - const returnData = { - features: [ - { - geometry: { coordinates: [101.84004968, 26.0859968692659], type: 'Point' }, - properties: { NAME: '四川省', SMID: '1', index: '0', lat: 26.0859968692659, lon: 101.84004968 }, - type: 'Feature' - } - ], - type: 'FeatureCollection' - }; - const result = { type: 'feature', features: returnData.features }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal?parentResType=MAP&parentResId=123': returnData - }; - mockFetch(fetchResource); - const type = 'user_data'; - const layer = { - dataSource: { - url: 'https://fakeiportal.supermap.io/iportal' - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:3857'; - const service = new WebMapService(mapId, options); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(data).toStrictEqual(result); - done(); - }); - }); - - it('success to get epsgCode info', async done => { - const epsgcodeInfo = { - wkt: epsgCode_wkt - }; - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal/epsgcodes/EPSG:4326.json': epsgcodeInfo - }; - mockFetch(fetchResource); - const epsgCode = 'EPSG:4326'; - const iPortalUrl = 'https://fakeiportal.supermap.io/iportal'; - const service = new WebMapService(mapId, options); - await flushPromises(); - expect.assertions(1); - return service.getEpsgCodeInfo(epsgCode, iPortalUrl).then(data => { - expect(data).toStrictEqual(epsgCode_wkt); - done(); - }); - }); - - it('getWmsInfo', async done => { - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal?REQUEST=GetCapabilities&SERVICE=WMS': wmsCapabilitiesText - }; - mockFetch(fetchResource); - const layerInfo = { - layerID: 'China', - layerType: 'WMS', - layers: ['0'], - name: 'China', - url: 'https://fakeiportal.supermap.io/iportal?', - visible: true - }; - const service = new WebMapService(mapId, options); - expect.assertions(1); - return service.getWmsInfo(layerInfo).then(data => { - expect(data).toStrictEqual({ version: '1.1.1' }); - done(); - }); - }); - it('getWmtsInfo', async done => { - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal?REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0&parentResType=MAP&parentResId=123': wmtsCapabilitiesText - }; - mockFetch(fetchResource); - const layerInfo = { - layer: 'ChinaDark', - layerID: 'China', - layerType: 'WMS', - layers: ['0'], - name: 'China', - url: 'https://fakeiportal.supermap.io/iportal?', - visible: true - }; - const mapCRS = {}; - const service = new WebMapService(mapId, options); - expect.assertions(1); - const data = await service.getWmtsInfo(layerInfo, mapCRS); - expect(data.kvpResourceUrl).toBe('http://fakeiserver.supermap.io/iserver/services/map-china400/wmts-china?'); - done(); - }); - it('getWmtsInfo someTileMatrixOK', async done => { - const fetchResource = { - 'http://fake:8090/wmts?REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0': wmtsCapabilitiesOthertileMatrixSet - }; - mockFetch(fetchResource); - const layerInfo = { - dpi: 90.7142857142857, - layer: 'images_2022_0.5', - layerType: 'WMTS', - name: 'images_2022_0.5', - requestEncoding: 'KVP', - tileMatrixSet: 'tianditu', - url: 'http://fake:8090/wmts', - visible: true - }; - const mapCRS = {}; - const service = new WebMapService(mapId, options); - const data = await service.getWmtsInfo(layerInfo, mapCRS); - expect(data.matchMaxZoom).toBe(22); - expect(data.matchMinZoom).toBe(1); - done(); - }); - it('getWmtsInfo someTileMatrixOK2', async done => { - const fetchResource = { - 'http://fake:8090/wmts?REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0': wmtsCapabilitiesOthertileMatrixSet - }; - mockFetch(fetchResource); - const layerInfo = { - dpi: 90.7142857142857, - layer: 'images_2022_0.5', - layerType: 'WMTS', - name: 'images_2022_0.5', - requestEncoding: 'KVP', - tileMatrixSet: 'tianditu1', - url: 'http://fake:8090/wmts', - visible: true - }; - const mapCRS = {}; - const service = new WebMapService(mapId, options); - const data = await service.getWmtsInfo(layerInfo, mapCRS); - expect(data.matchMaxZoom).toBe(7); - expect(data.matchMinZoom).toBe(1); - done(); - }); - it('getWmtsInfo noTileMatrixOK', async done => { - const fetchResource = { - 'http://fake:8090/wmts?REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0': wmtsCapabilitiesOthertileMatrixSet - }; - mockFetch(fetchResource); - const layerInfo = { - dpi: 90.7142857142857, - layer: 'images_2022_0.5', - layerType: 'WMTS', - name: 'images_2022_0.5', - requestEncoding: 'KVP', - tileMatrixSet: 'default028mm', - url: 'http://fake:8090/wmts', - visible: true - }; - const mapCRS = {}; - const service = new WebMapService(mapId, options); - try { - await service.getWmtsInfo(layerInfo, mapCRS); - } catch (error) { - expect(error.message).toBe('TileMatrixSetNotSuppport'); - done(); - } - }); - - it('getWmtsInfo_single_property', async done => { - const fetchResource = { - 'https://fakeiportal.supermap.io/iportal?REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0&parentResType=MAP&parentResId=123': wmtsCapabilitiesTextWithSingleProperty - }; - mockFetch(fetchResource); - const layerInfo = { - layer: 'ChinaDark', - layerID: 'China', - layerType: 'WMS', - layers: ['0'], - name: 'China', - url: 'https://fakeiportal.supermap.io/iportal?', - visible: true - }; - const mapCRS = {}; - const service = new WebMapService(mapId, options); - expect.assertions(1); - const data = await service.getWmtsInfo(layerInfo, mapCRS); - expect(data.kvpResourceUrl).toBe('http://fakeiserver.supermap.io/iserver/services/map-china400/wmts-china?'); - done(); - }); - - it('get datasource on rest_data type', () => { - const layer = { - dataSource: { accessType: 'DIRECT', type: 'REST_DATA' } - }; - const service = new WebMapService(mapId, options); - expect(service.getDatasourceType(layer)).toBe('rest_data'); - }); - - it('get datasource on rest_map type', () => { - const layer = { - dataSource: { accessType: 'DIRECT', type: 'REST_MAP', url: '123' } - }; - const service = new WebMapService(mapId, options); - expect(service.getDatasourceType(layer)).toBe('rest_map'); - }); - - it('get datasource on dataflow type', () => { - const layer = { - layerType: 'DATAFLOW_HEAT' - }; - const service = new WebMapService(mapId, options); - expect(service.getDatasourceType(layer)).toBe('dataflow'); - }); - - it('get datasource on user_data type', () => { - const layer = { - dataSource: { type: 'USER_DATA' } - }; - const service = new WebMapService(mapId, options); - expect(service.getDatasourceType(layer)).toBe('user_data'); - }); - - it('get Layer Features from rest_data and dataSource is Chinese', async done => { - const type = 'rest_data'; - const layer = { - dataSource: { - "type": "REST_DATA", - "url": "https://fakeiportal.supermap.io/iportal/portalproxy/98587ae90bec41bd/iserver/services/data-ZhongGuoDiTu/rest/data", - "dataSourceName": "%E4%B8%AD%E5%9B%BD%E7%9F%A2%E9%87%8F%E6%95%B0%E6%8D%AE:飞机场" - }, - enableFields: ['latitude'] - }; - const baseProjection = 'EPSG:3857'; - const service = new WebMapService(mapId, options); - const spy = jest.spyOn(service, '_getFeatureBySQL'); - expect.assertions(1); - return service.getLayerFeatures(type, layer, baseProjection).then(data => { - expect(spy).toBeCalledWith(expect.anything(), ["中国矢量数据:飞机场"], expect.anything(), expect.anything(), expect.anything()); - done(); - }); - }); - - it('handleWithCredentials', () => { - const mapId = uniqueLayer_polygon; - const service = new WebMapService(mapId, { ...options, iportalServiceProxyUrlPrefix: 'https://fakeiportal.supermap.io/portalproxy' }); - expect(service.handleWithCredentials(null, 'https://www.supermapol.com/url', true)).toBe(''); - const url = 'http://fakeurl'; - expect(service.handleWithCredentials('https://fakeiportal.supermap.io/iportal/proxy', null, false)).toBeTruthy(); - expect(service.handleWithCredentials('https://fakeiportal.supermap.io/iportal/proxy', 'https://fakeiportal.supermap.io/iportal/proxy/url', false)).toBeTruthy(); - expect(service.handleWithCredentials('https://fakeiportal/proxy', null, true)).toBeTruthy(); - expect(service.handleWithCredentials(null, 'https://fakeiportal.supermap.io/portalproxy/url', false)).toBeTruthy(); - expect(service.handleWithCredentials(null, url, true)).toBeTruthy(); - expect(service.handleWithCredentials(null, url)).toBeFalsy(); - }); -}); diff --git a/src/common/web-map/WebMapBase.ts b/src/common/web-map/WebMapBase.ts deleted file mode 100644 index e4c3f503..00000000 --- a/src/common/web-map/WebMapBase.ts +++ /dev/null @@ -1,1178 +0,0 @@ -import { Events } from 'vue-iclient/src/common/_types/event/Events'; -import municipalCenterData from './config/MunicipalCenter.json'; -import provincialCenterData from './config/ProvinceCenter.json'; -import 'vue-iclient/static/libs/geostats/geostats'; -import 'vue-iclient/static/libs/json-sql/jsonsql'; -import isNumber from 'lodash.isnumber'; -import Canvg from 'canvg'; -import WebMapService from '../_utils/WebMapService'; -import { getColorWithOpacity } from '../_utils/util'; -import { getProjection, registerProjection } from '../../common/_utils/epsg-define'; -import { coordEach } from '@turf/meta'; -import difference from 'lodash.difference'; - -// 迁徙图最大支持要素数量 -const MAX_MIGRATION_ANIMATION_COUNT = 1000; -export default abstract class WebMapBase extends Events { - map: any; - - mapId: string | number | Object; - - webMapInfo: any; - - mapOptions: any; - - serverUrl: string; - - accessToken: string; - - accessKey: string; - - tiandituKey: string; - - bingMapsKey: string; - - googleMapsAPIKey: string; - - googleMapsLanguage: string; - - withCredentials: boolean; - - proxy: string | boolean; - - target: string; - - excludePortalProxyUrl: boolean; - - isSuperMapOnline: boolean; - - zoom: number; - - mapParams: { title?: string; description?: string }; - - baseProjection: string; - - ignoreBaseProjection: boolean; - - on: any; - - echartslayer: any = []; - - eventTypes: any; - - triggerEvent: any; - - protected webMapService: WebMapService; - - protected _layers: any = []; - - protected _svgDiv: HTMLElement; - - protected _taskID: Date; - - protected layerAdded: number; - - protected expectLayerLen: number; - - protected canvgsV: any = []; - - constructor(id, options?, mapOptions?) { - super(); - this.serverUrl = options.serverUrl || 'https://www.supermapol.com'; - this.accessToken = options.accessToken; - this.accessKey = options.accessKey; - this.tiandituKey = options.tiandituKey || ''; - this.googleMapsAPIKey = options.googleMapsAPIKey || ''; - this.bingMapsKey = options.bingMapsKey || ''; - this.googleMapsLanguage = options.googleMapsLanguage || 'zh-CN'; - this.withCredentials = options.withCredentials || false; - this.proxy = options.proxy; - this.target = options.target || 'map'; - this.excludePortalProxyUrl = options.excludePortalProxyUrl; - this.isSuperMapOnline = options.isSuperMapOnline; - this.ignoreBaseProjection = options.ignoreBaseProjection; - this.echartslayer = []; - this.webMapService = new WebMapService(id, options); - this.mapOptions = mapOptions; - this.eventTypes = [ - 'getmapinfofailed', - 'crsnotsupport', - 'getlayerdatasourcefailed', - 'addlayerssucceeded', - 'notsupportmvt', - 'notsupportbaidumap', - 'projectionIsNotMatch', - 'beforeremovemap', - 'mapinitialized' - ]; - this.mapId = id; - } - - abstract _initWebMap(): void; - abstract _getMapInfo(data, _taskID?); - abstract _createMap(); - // TODO 重构子类 webmap layer 添加逻辑,只重写具体添加某个layer的方法,基类实现 initxxxx - abstract _initBaseLayer(mapInfo); - abstract _initOverlayLayer(layer, features?); - - abstract _addLayerSucceeded(); - abstract _unproject(point: [number, number]): [number, number]; - abstract clean(); - - public echartsLayerResize(): void { - this.echartslayer.forEach(echartslayer => { - echartslayer.chart.resize(); - }); - } - - public setMapId(mapId: string | number): void { - if (typeof mapId === 'string' || typeof mapId === 'number') { - this.mapId = mapId; - this.webMapInfo = null; - } else if (mapId !== null && typeof mapId === 'object') { - this.webMapInfo = mapId; - } - this.webMapService.setMapId(mapId); - if (!mapId) { - return; - } - setTimeout(() => { - this._initWebMap(); - }, 0); - } - - public setServerUrl(serverUrl: string): void { - this.serverUrl = serverUrl; - this.webMapService.setServerUrl(serverUrl); - } - - public setWithCredentials(withCredentials) { - this.withCredentials = withCredentials; - this.webMapService.setWithCredentials(withCredentials); - } - - public setProxy(proxy) { - this.proxy = proxy; - this.webMapService.setProxy(proxy); - } - - public setZoom(zoom) { - if (this.map) { - this.mapOptions.zoom = zoom; - if (zoom !== +this.map.getZoom().toFixed(2)) { - (zoom || zoom === 0) && this.map.setZoom(zoom, { from: 'setZoom' }); - } - } - } - - public setMaxBounds(maxBounds): void { - if (this.map) { - this.mapOptions.maxBounds = maxBounds; - maxBounds && this.map.setMaxBounds(maxBounds); - } - } - - public setMinZoom(minZoom): void { - if (this.map) { - this.mapOptions.minZoom = minZoom; - (minZoom || minZoom === 0) && this.map.setMinZoom(minZoom); - } - } - - public setMaxZoom(maxZoom): void { - if (this.map) { - this.mapOptions.maxZoom = maxZoom; - (maxZoom || maxZoom === 0) && this.map.setMaxZoom(maxZoom); - } - } - - protected initWebMap() { - this.clean(); - this.serverUrl = this.serverUrl && this.webMapService.handleServerUrl(this.serverUrl); - if (this.webMapInfo) { - // 传入是webmap对象 - const mapInfo = this.webMapInfo; - mapInfo.mapParams = { - title: this.webMapInfo.title, - description: this.webMapInfo.description - }; - this.mapParams = mapInfo.mapParams; - this._getMapInfo(mapInfo); - return; - } else if (!this.mapId || !this.serverUrl) { - this._createMap(); - return; - } - this._taskID = new Date(); - this.getMapInfo(this._taskID); - } - - protected getMapInfo(_taskID) { - this.serverUrl = this.serverUrl && this.webMapService.handleServerUrl(this.serverUrl); - this.webMapService - .getMapInfo() - .then( - (mapInfo: any) => { - if (this._taskID !== _taskID) { - return; - } - // 存储地图的名称以及描述等信息,返回给用户 - this.mapParams = mapInfo.mapParams; - this._getMapInfo(mapInfo, _taskID); - }, - error => { - throw error; - } - ) - .catch(error => { - this.triggerEvent('getmapinfofailed', { error }); - console.log(error); - }); - } - - protected getBaseLayerType(layerInfo) { - let layerType = layerInfo.layerType; // 底图和rest地图兼容 - - if ( - layerType.indexOf('TIANDITU_VEC') > -1 || - layerType.indexOf('TIANDITU_IMG') > -1 || - layerType.indexOf('TIANDITU_TER') > -1 - ) { - layerType = 'TIANDITU'; - } - - switch (layerType) { - case 'TILE': - case 'SUPERMAP_REST': - return 'TILE'; - case 'CLOUD': - case 'CLOUD_BLACK': - return 'CLOUD'; - case 'OSM': - case 'JAPAN_ORT': - case 'JAPAN_RELIEF': - case 'JAPAN_PALE': - case 'JAPAN_STD': - case 'GOOGLE_CN': - case 'GOOGLE': - return 'XYZ'; - default: - return layerType; - } - } - - protected getMapurls(mapurl: { CLOUD?: string; CLOUD_BLACK?: string; OSM?: string } = {}) { - const mapUrls = { - CLOUD: mapurl.CLOUD || 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}', - CLOUD_BLACK: mapurl.CLOUD_BLACK || 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}', - OSM: mapurl.OSM || 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png', - GOOGLE: - 'https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s{googleMapsLanguage}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key={googleMapsAPIKey}', - GOOGLE_CN: 'https://mt{0-3}.google.com/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}', - JAPAN_STD: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', - JAPAN_PALE: 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png', - JAPAN_RELIEF: 'https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png', - JAPAN_ORT: 'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg' - }; - - return mapUrls; - } - - protected getLayerFeatures(layer, _taskID, type) { - const getLayerFunc = this.webMapService.getLayerFeatures(type, layer, this.baseProjection); - getLayerFunc && - getLayerFunc - .then( - async result => { - if (this.mapId && this._taskID !== _taskID) { - return; - } - if (result && layer.projection) { - if (!getProjection(layer.projection)) { - const epsgWKT = await this.webMapService.getEpsgCodeInfo( - layer.projection.split(':')[1], - this.serverUrl - ); - if (epsgWKT) { - registerProjection(layer.projection, epsgWKT); - } - } - } - - this._getLayerFeaturesSucceeded(result, layer); - }, - error => { - throw new Error(error); - } - ) - .catch(error => { - this._addLayerSucceeded(); - this.triggerEvent('getlayerdatasourcefailed', { error, layer, map: this.map }); - console.log(error); - }); - } - - protected setFeatureInfo(feature: any): any { - let featureInfo; - const info = feature.dv_v5_markerInfo; - if (info && info.dataViz_title) { - // 有featureInfo信息就不需要再添加 - featureInfo = info; - } else { - // featureInfo = this.getDefaultAttribute(); - return info; - } - const properties = feature.properties; - for (const key in featureInfo) { - if (properties[key]) { - featureInfo[key] = properties[key]; - delete properties[key]; - } - } - return featureInfo; - } - - protected getRankStyleGroup(themeField, features, parameters) { - // 找出所有的单值 - const values = []; - let segements = []; - const style = parameters.style; - const themeSetting = parameters.themeSetting; - const segmentMethod = themeSetting.segmentMethod; - const segmentCount = themeSetting.segmentCount; - const customSettings = themeSetting.customSettings; - const minR = parameters.themeSetting.minRadius; - const maxR = parameters.themeSetting.maxRadius; - const colors = themeSetting.colors; - const fillColor = style.fillColor; - features.forEach(feature => { - const properties = feature.properties; - const value = properties[themeField]; - // 过滤掉空值和非数值 - if (value == null || value === '' || !isNumber(+value)) { - return; - } - values.push(Number(value)); - }); - try { - segements = SuperMap.ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount); - } catch (error) { - console.log(error); - } - - // 处理自定义 分段 - for (let i = 0; i < segmentCount; i++) { - if (i in customSettings) { - const startValue = customSettings[i].segment.start; - const endValue = customSettings[i].segment.end; - startValue != null && (segements[i] = startValue); - endValue != null && (segements[i + 1] = endValue); - } - } - - // 生成styleGroup - const styleGroup = []; - if (segements && segements.length) { - const len = segements.length; - const incrementR = (maxR - minR) / (len - 1); // 半径增量 - let start; - let end; - let radius = Number(((maxR + minR) / 2).toFixed(2)); - let color = ''; - const rangeColors = colors ? SuperMap.ColorsPickerUtil.getGradientColors(colors, len, 'RANGE') : []; - for (let i = 0; i < len - 1; i++) { - // 处理radius - start = Number(segements[i].toFixed(2)); - end = Number(segements[i + 1].toFixed(2)); - // 这里特殊处理以下分段值相同的情况(即所有字段值相同) - radius = start === end ? radius : minR + Math.round(incrementR * i); - // 最后一个分段时将end+0.01,避免取不到最大值 - end = i === len - 2 ? end + 0.01 : end; - // 处理自定义 半径 - radius = customSettings[i] && customSettings[i].radius ? customSettings[i].radius : radius; - style.radius = radius; - // 处理颜色 - if (colors && colors.length > 0) { - color = customSettings[i] && customSettings[i].color ? customSettings[i].color : rangeColors[i] || fillColor; - style.fillColor = color; - } - styleGroup.push({ radius, color, start, end, style }); - } - return styleGroup; - } else { - return false; - } - } - - protected createRankStyleSource(parameters, features) { - const themeSetting = parameters.themeSetting; - const themeField = themeSetting.themeField; - const styleGroups = this.getRankStyleGroup(themeField, features, parameters); - // @ts-ignore - return styleGroups ? { parameters, styleGroups } : false; - } - - protected isMatchAdministrativeName(featureName, fieldName) { - const isString = typeof fieldName === 'string' && fieldName.constructor === String; - if (isString) { - let shortName = featureName.substr(0, 2); - // 张家口市和张家界市 特殊处理 - if (shortName === '张家') { - shortName = featureName.substr(0, 3); - } - return !!fieldName.match(new RegExp(shortName)); - } - return false; - } - - protected getRestMapLayerInfo(restMapInfo, layer) { - const { bounds, coordUnit, visibleScales, url } = restMapInfo; - layer.layerType = 'TILE'; - layer.orginEpsgCode = this.baseProjection; - layer.units = coordUnit && coordUnit.toLowerCase(); - layer.extent = [bounds.left, bounds.bottom, bounds.right, bounds.top]; - layer.visibleScales = visibleScales; - layer.url = url; - layer.sourceType = 'TILE'; - return layer; - } - - protected handleLayerFeatures(features, layerInfo) { - const { layerType, style, themeSetting, filterCondition } = layerInfo; - if ((style || themeSetting) && filterCondition) { - // 将 feature 根据过滤条件进行过滤, 分段专题图和单值专题图因为要计算 styleGroup 所以暂时不过滤 - if (layerType !== 'RANGE' && layerType !== 'UNIQUE' && layerType !== 'RANK_SYMBOL') { - features = this.getFilterFeatures(filterCondition, features); - } - } - - return features; - } - - protected mergeFeatures(layerId: string, features: any, mergeByField?: string): any { - if (!(features instanceof Array)) { - return features; - } - features = features.map((feature: any, index: any) => { - if (!Object.prototype.hasOwnProperty.call(feature.properties, 'index')) { - feature.properties.index = index; - } - return feature; - }); - if (!features.length || !mergeByField && features[0].geometry) { - return features; - } - const source = this.map.getSource(layerId); - if ((!source || !source._data.features) && features[0].geometry) { - return features; - } - const prevFeatures = source && source._data && source._data.features; - const nextFeatures = []; - if (!mergeByField && prevFeatures) { - return prevFeatures; - } - features.forEach((feature: any) => { - const prevFeature = prevFeatures.find((item: any) => { - if (isNaN(+item.properties[mergeByField]) && isNaN(+feature.properties[mergeByField])) { - return ( - JSON.stringify(item.properties[mergeByField] || '') === - JSON.stringify(feature.properties[mergeByField] || '') - ); - } else { - return +item.properties[mergeByField] === +feature.properties[mergeByField]; - } - }); - if (prevFeature) { - nextFeatures.push({ - ...prevFeature, - ...feature - }); - } else if (feature.geometry) { - nextFeatures.push(feature); - } - }); - return nextFeatures; - } - - protected getFilterFeatures(filterCondition: string, allFeatures): any { - if (!filterCondition) { - return allFeatures; - } - let condition = this.replaceFilterCharacter(filterCondition); - const filterFeatures = []; - for (let i = 0; i < allFeatures.length; i++) { - const feature = allFeatures[i]; - let filterResult: any; - const properties = feature.properties; - try { - condition = this.parseCondition(condition, Object.keys(properties)); - const filterFeature = this.parseConditionFeature(properties); - const sql = 'select * from json where (' + condition + ')'; - filterResult = window.jsonsql.query(sql, { attributes: filterFeature }); - } catch (err) { - // 必须把要过滤得内容封装成一个对象,主要是处理jsonsql(line : 62)中由于with语句遍历对象造成的问题 - continue; - } - if (filterResult && filterResult.length > 0) { - // afterFilterFeatureIdx.push(i); - filterFeatures.push(feature); - } - } - return filterFeatures; - } - - protected replaceFilterCharacter(filterString: string): string { - filterString = filterString - .replace(/=/g, '==') - .replace(/AND|and/g, '&&') - .replace(/or|OR/g, '||') - .replace(/<==/g, '<=') - .replace(/>==/g, '>='); - return filterString; - } - - protected getParseSpecialCharacter() { - // 特殊字符字典 - const directory = ['(', ')', '(', ')', ',', ',']; - const res = {}; - directory.forEach((item, index) => { - res[item] = `$${index}`; - }); - return res; - } - - protected parseSpecialCharacter(str) { - const directory = this.getParseSpecialCharacter(); - for (let key in directory) { - const replaceValue = directory[key]; - const pattern = new RegExp(`\\${key}`, 'g'); - // eslint-disable-next-line - while (pattern.test(str)) { - str = str.replace(pattern, replaceValue); - } - } - return str; - } - - protected parseCondition(filterCondition, keys) { - const str = filterCondition.replace(/&|\||>|<|=|!/g, ' '); - const arr = str.split(' ').filter((item) => item); - let result = filterCondition; - arr.forEach((item) => { - const key = keys.find((val) => val === item); - if (this.startsWithNumber(item) && key) { - result = result.replace(key, '$' + key); - } - if (key) { - const res = this.parseSpecialCharacter(key); - result = result.replace(key, res); - } - }); - return result; - } - - // 处理jsonsqlfeature, 加前缀 - protected parseConditionFeature(feature) { - let copyValue = {}; - for (let key in feature) { - let copyKey = key; - if (this.startsWithNumber(key)) { - copyKey = '$' + key; - } - copyKey = this.parseSpecialCharacter(copyKey); - copyValue[copyKey] = feature[key]; - } - return copyValue; - } - - protected startsWithNumber(str) { - return /^\d/.test(str); - } - - protected getEchartsLayerOptions(layerInfo, features, coordinateSystem) { - const properties = this.webMapService.getFeatureProperties(features); - const lineData = this._createLinesData(layerInfo, properties); - const pointData = this._createPointsData(lineData, layerInfo, properties); - const options = this._createOptions(layerInfo, lineData, pointData, coordinateSystem); - return options; - } - - protected getDashStyle(str, strokeWidth = 1, type = 'array') { - if (!str) { - return type === 'array' ? [] : ''; - } - - const w = strokeWidth; - let dashArr; - switch (str) { - case 'solid': - dashArr = []; - break; - case 'dot': - dashArr = [1, 4 * w]; - break; - case 'dash': - dashArr = [4 * w, 4 * w]; - break; - case 'dashrailway': - dashArr = [8 * w, 12 * w]; - break; - case 'dashdot': - dashArr = [4 * w, 4 * w, 1 * w, 4 * w]; - break; - case 'longdash': - dashArr = [8 * w, 4 * w]; - break; - case 'longdashdot': - dashArr = [8 * w, 4 * w, 1, 4 * w]; - break; - default: - if (SuperMap.Util.isArray(str)) { - dashArr = str; - } - str = SuperMap.String.trim(str).replace(/\s+/g, ','); - dashArr = str.replace(/\[|\]/gi, '').split(','); - break; - } - dashArr = type === 'array' ? dashArr : dashArr.join(','); - return dashArr; - } - - protected getCanvasFromSVG(svgUrl: string, divDom: HTMLElement, callBack: Function): void { - const canvas = document.createElement('canvas'); - canvas.id = `dataviz-canvas-${new Date().getTime()}`; - canvas.style.display = 'none'; - divDom.appendChild(canvas); - if (svgUrl) { - const canvgs = window.canvg?.default ? window.canvg.default : Canvg; - const ctx = canvas.getContext('2d'); - canvgs.from(ctx, svgUrl, { - ignoreMouse: true, - ignoreAnimation: true, - forceRedraw: () => false - }).then(v => { - v.start(); - this.canvgsV.push(v); - if (canvas.width > 300 || canvas.height > 300) { - return; - } - callBack(canvas); - }); - } else { - callBack(canvas); - } - } - - protected stopCanvg() { - this.canvgsV.forEach(v => v.stop()); - this.canvgsV = []; - } - - protected getRangeStyleGroup(layerInfo: any, features: any): Array | void { - const { featureType, style, themeSetting } = layerInfo; - const { customSettings, themeField, segmentCount, segmentMethod, colors } = themeSetting; - - // 找出分段值 - const values = []; - let attributes; - - features.forEach(feature => { - attributes = feature.properties; - if (attributes) { - // 过滤掉非数值的数据 - const val = attributes[themeField]; - (val || val === 0) && isNumber(+val) && values.push(parseFloat(val)); - } - }, this); - - let segements = - values && values.length && SuperMap.ArrayStatistic.getArraySegments(values, segmentMethod, segmentCount); - if (segements) { - let itemNum = segmentCount; - if (attributes && segements[0] === segements[attributes.length - 1]) { - itemNum = 1; - segements.length = 2; - } - - // 保留两位有效数 - for (let i = 0; i < segements.length; i++) { - let value = segements[i]; - value = i === 0 ? Math.floor(value * 100) / 100 : Math.ceil(value * 100) / 100 + 0.1; // 加0.1 解决最大值没有样式问题 - segements[i] = Number(value.toFixed(2)); - } - - // 获取一定量的颜色 - let curentColors = colors; - curentColors = SuperMap.ColorsPickerUtil.getGradientColors(curentColors, itemNum, 'RANGE'); - for (let index = 0; index < itemNum; index++) { - if (index in customSettings) { - if (customSettings[index].segment.start) { - segements[index] = customSettings[index].segment.start; - } - if (customSettings[index].segment.end) { - segements[index + 1] = customSettings[index].segment.end; - } - } - } - // 生成styleGroup - const styleGroups = []; - for (let i = 0; i < itemNum; i++) { - let color = curentColors[i]; - if (i in customSettings) { - if (customSettings[i].color) { - color = customSettings[i].color; - } - } - if (featureType === 'LINE') { - style.strokeColor = color; - } else { - style.fillColor = color; - } - - const start = segements[i]; - const end = segements[i + 1]; - const styleObj = JSON.parse(JSON.stringify(style)); - styleGroups.push({ - style: styleObj, - color: color, - start: start, - end: end - }); - } - return styleGroups; - } - } - - protected getCustomSettingColors(customSettings, featureType) { - const keys = Object.keys(customSettings); - const colors = []; - keys.forEach(key => { - if (featureType === 'LINE') { - colors.push(customSettings[key].strokeColor); - } else { - colors.push(customSettings[key].fillColor); - } - }); - return colors; - } - - protected getUniqueStyleGroup(parameters: any, features: any) { - const { featureType, style, themeSetting } = parameters; - const { colors, customSettings } = themeSetting; - let themeField = themeSetting.themeField; - // 找出所有的单值 - const featurePropertie = (features && features[0] && features[0].properties) || {}; - Object.keys(featurePropertie).forEach(key => { - key.toLocaleUpperCase() === themeField.toLocaleUpperCase() && (themeField = key); - }); - const names = []; - for (const i in features) { - const properties = features[i].properties; - const name = properties[themeField]; - let isSaved = false; - for (const j in names) { - if (names[j] === name) { - isSaved = true; - break; - } - } - if (!isSaved) { - names.push(name); - } - } - - // 获取一定量的颜色 - let curentColors = colors; - curentColors = SuperMap.ColorsPickerUtil.getGradientColors(curentColors, names.length); - const usedColors = this.getCustomSettingColors(customSettings, featureType).map(item => item && item.toLowerCase()); - const allColors = SuperMap.ColorsPickerUtil.getGradientColors(colors, names.length + Object.keys(customSettings).length).map(item => item.toLowerCase()); - const newColors = difference(allColors, usedColors); - const styleGroup = []; - names.forEach((name, index) => { - let color = curentColors[index]; - let itemStyle = { ...style }; - const customStyle = customSettings[name]; - if (typeof customStyle === 'object') { - itemStyle = Object.assign(itemStyle, customStyle); - color = itemStyle.fillColor || itemStyle.strokeColor; - } else { - if (typeof customStyle === 'string') { - color = customSettings[name]; - } - if (!customStyle) { - color = newColors.shift(); - } - if (featureType === 'LINE') { - itemStyle.strokeColor = color; - } else { - itemStyle.fillColor = color; - } - } - - styleGroup.push({ - color: color, - style: itemStyle, - value: name, - themeField: themeField - }); - }, this); - - return styleGroup; - } - - protected transformFeatures(features) { - features && - features.forEach((feature, index) => { - let coordinates = feature.geometry && feature.geometry.coordinates; - if (!coordinates || coordinates.length === 0) { - return; - } - coordEach(feature, (coordinates) => { - // @ts-ignore - let transCoordinates = this._unproject(coordinates); - coordinates[0] = transCoordinates[0]; - coordinates[1] = transCoordinates[1]; - }); - features[index] = feature; - }); - - return features; - } - - private _drawTextRectAndGetSize({ context, style, textArray, lineHeight, doublePadding, canvas }) { - let backgroundFill = style.backgroundFill; - const maxWidth = style.maxWidth - doublePadding; - let width = 0; - let height = 0; - let lineCount = 0; - let lineWidths = []; - // 100的宽度,去掉左右两边3padding - textArray.forEach((arrText: string) => { - let line = ''; - let isOverMax = false; - lineCount++; - for (let n = 0; n < arrText.length; n++) { - let textLine = line + arrText[n]; - let metrics = context.measureText(textLine); - let textWidth = metrics.width; - if ((textWidth > maxWidth && n > 0) || arrText[n] === '\n') { - line = arrText[n]; - lineCount++; - // 有换行,记录当前换行的width - isOverMax = true; - } else { - line = textLine; - width = textWidth; - } - } - if(isOverMax) { - lineWidths.push(maxWidth); - } else { - lineWidths.push(width); - } - }, this); - for (let i = 0; i < lineWidths.length; i++) { - let lineW = lineWidths[i]; - if(lineW >= maxWidth) { - // 有任何一行超过最大高度,就用最大高度 - width = maxWidth; - break; - } else if(lineW > width) { - // 自己换行,就要比较每行的最大宽度 - width = lineW; - } - } - width += doublePadding; - // -6 是为了去掉canvas下方多余空白,让文本垂直居中 - height = lineCount * lineHeight + doublePadding - 6; - canvas.width = width; - canvas.height = height; - context.fillStyle = backgroundFill; - context.fillRect(0, 0, width, height); - context.lineWidth = style.borderWidth; - context.strokeStyle = style.borderColor; - context.strokeRect(0, 0, width, height); - return { - width: width, - height: height - }; - } - - private _drawTextWithCanvas({ context, canvas, style }) { - const padding = 8; - const doublePadding = padding * 2; - const lineHeight = Number(style.font.replace(/[^0-9]/ig, '')) + 3; - const textArray = style.text.split('\r\n'); - context.font = style.font; - const size = this._drawTextRectAndGetSize({ context, style, textArray, lineHeight, doublePadding, canvas }); - let positionY = padding; - textArray.forEach((text: string, i: number) => { - if(i !== 0) { - positionY = positionY + lineHeight; - } - context.font = style.font; - let textAlign = style.textAlign; - let x: number; - const width = size.width - doublePadding; // 减去padding - switch (textAlign) { - case 'center': - x = width / 2; - break; - case 'right': - x = width; - break; - default: - x = 8; - break; - } - // 字符分隔为数组 - const arrText = text.split(''); - let line = ''; - const fillColor = style.fillColor; - // 每一行限制的高度 - let maxWidth = style.maxWidth - doublePadding; - for (let n = 0; n < arrText.length; n++) { - let testLine = line + arrText[n]; - let metrics = context.measureText(testLine); - let testWidth = metrics.width; - if ((testWidth > maxWidth && n > 0) || arrText[n] === '\n') { - context.fillStyle = fillColor; - context.textAlign = textAlign; - context.textBaseline = 'top'; - context.fillText(line, x, positionY); - line = arrText[n]; - positionY += lineHeight; - } else { - line = testLine; - } - } - context.fillStyle = fillColor; - context.textAlign = textAlign; - context.textBaseline = 'top'; - context.fillText(line, x, positionY); - }, this); - } - - protected handleSvgColor(style, canvas) { - const { fillColor, fillOpacity, strokeColor, strokeOpacity, strokeWidth } = style; - const context = canvas.getContext('2d'); - if (style.text) { - this._drawTextWithCanvas({ context, canvas, style }); - return; - } - if (fillColor) { - context.fillStyle = getColorWithOpacity(fillColor, fillOpacity); - context.fill(); - } - - if (strokeColor || strokeWidth) { - context.strokeStyle = getColorWithOpacity(strokeColor, strokeOpacity); - context.lineWidth = strokeWidth; - context.stroke(); - } - } - - private _createLinesData(layerInfo, properties) { - const data = []; - if (properties && properties.length) { - // 重新获取数据 - const from = layerInfo.from; - const to = layerInfo.to; - let fromCoord; - let toCoord; - if (from.type === 'XY_FIELD' && from.xField && from.yField && to.xField && to.yField) { - properties.forEach(property => { - const fromX = property[from.xField]; - const fromY = property[from.yField]; - const toX = property[to.xField]; - const toY = property[to.yField]; - if (!fromX || !fromY || !toX || !toY) { - return; - } - - fromCoord = [property[from.xField], property[from.yField]]; - toCoord = [property[to.xField], property[to.yField]]; - data.push({ - coords: [fromCoord, toCoord] - }); - }); - } else if (from.type === 'PLACE_FIELD' && from.field && to.field) { - const centerDatas = provincialCenterData.concat(municipalCenterData); - - properties.forEach(property => { - const fromField = property[from.field]; - const toField = property[to.field]; - fromCoord = centerDatas.find(item => { - return this.isMatchAdministrativeName(item.name, fromField); - }); - toCoord = centerDatas.find(item => { - return this.isMatchAdministrativeName(item.name, toField); - }); - if (!fromCoord || !toCoord) { - return; - } - data.push({ - coords: [fromCoord.coord, toCoord.coord] - }); - }); - } - } - return data; - } - - private _createPointsData(lineData, layerInfo, properties) { - let data = []; - const labelSetting = layerInfo.labelSetting; - // 标签隐藏则直接返回 - if (!labelSetting.show || !lineData.length) { - return data; - } - const fromData = []; - const toData = []; - lineData.forEach((item, idx) => { - const coords = item.coords; - const fromCoord = coords[0]; - const toCoord = coords[1]; - const fromProperty = properties[idx][labelSetting.from]; - const toProperty = properties[idx][labelSetting.to]; - // 起始字段去重 - const f = fromData.find(d => { - return d.value[0] === fromCoord[0] && d.value[1] === fromCoord[1]; - }); - !f && - fromData.push({ - name: fromProperty, - value: fromCoord - }); - // 终点字段去重 - const t = toData.find(d => { - return d.value[0] === toCoord[0] && d.value[1] === toCoord[1]; - }); - !t && - toData.push({ - name: toProperty, - value: toCoord - }); - }); - data = fromData.concat(toData); - return data; - } - - private _createOptions(layerInfo, lineData, pointData, coordinateSystem) { - let series; - const lineSeries = this._createLineSeries(layerInfo, lineData, coordinateSystem); - if (pointData && pointData.length) { - const pointSeries: any = this._createPointSeries(layerInfo, pointData, coordinateSystem); - series = lineSeries.concat(pointSeries); - } else { - series = lineSeries.slice(); - } - return { series }; - } - - private _createPointSeries(layerInfo, pointData, coordinateSystem) { - const lineSetting = layerInfo.lineSetting; - const animationSetting = layerInfo.animationSetting; - const labelSetting = layerInfo.labelSetting; - const pointSeries = [ - { - name: 'point-series', - coordinateSystem: coordinateSystem, - zlevel: 2, - label: { - normal: { - show: labelSetting.show, - position: 'right', - formatter: '{b}', - color: labelSetting.color, - fontFamily: labelSetting.fontFamily - } - }, - itemStyle: { - normal: { - color: lineSetting.color || labelSetting.color - } - }, - data: pointData - } - ]; - - if (animationSetting.show) { - // 开启动画 - // @ts-ignore - pointSeries[0].type = 'effectScatter'; - // @ts-ignore - pointSeries[0].rippleEffect = { - brushType: 'stroke' - }; - } else { - // 关闭动画 - // @ts-ignore - pointSeries[0].type = 'scatter'; - } - - return pointSeries; - } - - private _createLineSeries(layerInfo, lineData, coordinateSystem) { - const lineSetting = layerInfo.lineSetting; - const animationSetting = layerInfo.animationSetting; - const linesSeries = [ - // 轨迹线样式 - { - name: 'line-series', - coordinateSystem: coordinateSystem, - type: 'lines', - zlevel: 1, - effect: { - show: animationSetting.show, - constantSpeed: animationSetting.constantSpeed, - trailLength: 0, - symbol: animationSetting.symbol, - symbolSize: animationSetting.symbolSize - }, - lineStyle: { - normal: { - color: lineSetting.color, - type: lineSetting.type, - width: lineSetting.width, - opacity: lineSetting.opacity, - curveness: lineSetting.curveness - } - }, - data: lineData - } - ]; - - if (lineData.length >= MAX_MIGRATION_ANIMATION_COUNT) { - // @ts-ignore - linesSeries[0].large = true; - // @ts-ignore - linesSeries[0].largeThreshold = 100; - // @ts-ignore - linesSeries[0].blendMode = 'lighter'; - } - - return linesSeries; - } - - private _getLayerFeaturesSucceeded(result, layer) { - switch (result.type) { - case 'feature': - this._initOverlayLayer(layer, result.features); - break; - case 'restMap': - layer.layerType = 'restMap'; - this._initOverlayLayer(layer, result.restMaps); - break; - case 'mvt': - layer.layerType = 'mvt'; - this._initOverlayLayer(layer, result); - break; - case 'dataflow': - case 'noServerId': - this._initOverlayLayer(layer); - break; - } - } -} diff --git a/src/common/web-map/config/MunicipalCenter.json b/src/common/web-map/config/MunicipalCenter.json deleted file mode 100644 index d182ca14..00000000 --- a/src/common/web-map/config/MunicipalCenter.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"克拉玛依市","coord":[85.01486759299489,45.406422237230046]},{"name":"昌吉回族自治州","coord":[88.7154624754753,44.26991024636568]},{"name":"石河子市","coord":[86.0208600035924,44.239045558096805]},{"name":"霍林郭勒市","coord":[114.73479243733115,44.16058374713977]},{"name":"本溪市","coord":[124.64357865201586,41.177197783134275]},{"name":"嘉峪关市","coord":[98.16891560537093,39.76279786284264]},{"name":"莱芜市","coord":[117.65723565456207,36.27916499211527]},{"name":"神农架林区","coord":[110.48296222218153,31.581260143666697]},{"name":"天门市","coord":[113.00615321481195,30.64105781887143]},{"name":"鄂州市","coord":[114.94764081970385,30.325634953844585]},{"name":"潜江市","coord":[112.70703817700621,30.349210666019893]},{"name":"仙桃市","coord":[113.34688900729822,30.315951161935402]},{"name":"萍乡市","coord":[113.88072263074415,27.47193090553213]},{"name":"台湾省","coord":[120.14338943402045,23.596002465926095]},{"name":"东莞市","coord":[113.89443658529342,22.897826158636448]},{"name":"中山市","coord":[113.37118387764659,22.501478858616522]},{"name":"珠海市","coord":[113.21799258934986,22.23782602992192]},{"name":"北海市","coord":[109.18248083043899,21.695773689750148]},{"name":"香港","coord":[114.20689279508653,22.36016760139811]},{"name":"舟山市","coord":[122.22514712841459,30.338633120695956]},{"name":"克孜勒苏柯尔克孜","coord":[74.62910472637343,39.59886016069875]},{"name":"喀什地区","coord":[77.19899922143753,37.85462871211595]},{"name":"阿克苏地区","coord":[81.43930290016381,41.067304799230456]},{"name":"和田地区","coord":[80.69780509160952,36.95287032287055]},{"name":"阿里地区","coord":[82.536487505389,32.69566569631762]},{"name":"日喀则地区","coord":[86.5996831353606,29.54861754814263]},{"name":"那曲地区","coord":[88.32523292667608,33.20600450932715]},{"name":"玉树藏族自治州","coord":[95.2107128446203,33.90320387919257]},{"name":"迪庆藏族自治州","coord":[99.42465312188943,28.052797714348895]},{"name":"怒江傈傈族自治州","coord":[98.85737910439825,26.98345757528851]},{"name":"大理白族自治州","coord":[99.93934374816013,25.684737357453045]},{"name":"德宏傣族景颇族自","coord":[98.13830877778075,24.593421919561205]},{"name":"保山市","coord":[99.19031013453166,24.979380341662]},{"name":"临沧市","coord":[99.62483778975081,24.058807858948214]},{"name":"普洱市","coord":[100.94440267992684,23.44121660743221]},{"name":"西双版纳傣族自治","coord":[100.86105801845994,21.882475641324206]},{"name":"拉萨市","coord":[91.3684790613129,30.14176592960237]},{"name":"山南地区","coord":[92.11665242621062,28.33000201578789]},{"name":"林芝地区","coord":[94.9307847458166,29.125110156601963]},{"name":"昌都地区","coord":[97.33912235873476,30.48520825551814]},{"name":"丽江市","coord":[100.65713436205135,26.96190318191959]},{"name":"攀枝花市","coord":[101.73355913301131,26.714486678752795]},{"name":"凉山彝族自治州","coord":[102.08678551422615,27.683020519860396]},{"name":"楚雄彝族自治州","coord":[101.68264761198458,25.369603845264024]},{"name":"红河哈尼族彝族自","coord":[102.95101719613119,23.624860095239875]},{"name":"文山壮族苗族自治","coord":[104.8708359910614,23.579587266862504]},{"name":"百色市","coord":[106.69546907589859,23.98220841166522]},{"name":"崇左市","coord":[107.3277087317123,22.49769755349952]},{"name":"防城港市","coord":[107.88939931155171,21.94550204069006]},{"name":"南宁市","coord":[108.67078983716917,23.12207641861882]},{"name":"钦州市","coord":[108.8532307305186,22.157690108421384]},{"name":"玉林市","coord":[110.26918466489103,22.391823643610415]},{"name":"湛江市","coord":[109.93033457863683,21.086751055633457]},{"name":"茂名市","coord":[110.80336192333934,22.069184739040775]},{"name":"阳江市","coord":[111.70471342186183,22.108751366417575]},{"name":"江门市","coord":[112.53715618649149,22.297368082806777]},{"name":"广州市","coord":[113.4949302208309,23.28359314707863]},{"name":"清远市","coord":[113.10957368131268,24.334444053233856]},{"name":"肇庆市","coord":[112.11117530204233,23.60241158796112]},{"name":"梧州市","coord":[111.01709510772797,23.518132876753846]},{"name":"贺州市","coord":[111.50423061842756,24.4095096817199]},{"name":"桂林市","coord":[110.44046163393094,25.353966673735407]},{"name":"柳州市","coord":[109.34854449214147,24.972408051485047]},{"name":"河池市","coord":[107.81191841865586,24.649291651298164]},{"name":"黔东南苗族侗族自","coord":[108.39952601614591,26.429286420465576]},{"name":"贵阳市","coord":[106.59784062851153,26.797907456479816]},{"name":"安顺市","coord":[105.76161265300635,25.988644902171018]},{"name":"黔西南布依族苗族","coord":[105.5954078788574,25.404850939549405]},{"name":"曲靖市","coord":[103.9164335632742,25.697243690315265]},{"name":"六盘水市","coord":[104.77723228072432,26.15402255629164]},{"name":"毕节地区","coord":[105.03867422931839,27.077913968069666]},{"name":"昭通市","coord":[104.29730513046874,27.62418247971078]},{"name":"宜宾市","coord":[104.76748901448207,28.553501804266475]},{"name":"乐山市","coord":[103.56027669102787,29.160754519210577]},{"name":"自贡市","coord":[104.63272827056402,29.273152614922402]},{"name":"内江市","coord":[104.82644562304716,29.61272653799929]},{"name":"遵义市","coord":[106.82413636302059,28.191847588570702]},{"name":"达州市","coord":[107.59704170009518,31.32138258839703]},{"name":"遂宁市","coord":[105.48979445433736,30.677687821242678]},{"name":"广安市","coord":[106.56708164098042,30.43500706741521]},{"name":"泸州市","coord":[105.42591761727707,28.50277238478137]},{"name":"资阳市","coord":[104.97995126874034,30.154251886139654]},{"name":"雅安市","coord":[102.69931299964517,29.892630706195035]},{"name":"眉山市","coord":[104.07052881858888,29.894202166560405]},{"name":"甘孜藏族自治州","coord":[100.50721042614238,30.975216556269658]},{"name":"果洛藏族自治州","coord":[99.30775565051923,34.03539865224808]},{"name":"海南藏族自治州","coord":[100.39969108016373,35.90048272566899]},{"name":"黄南藏族自治州","coord":[101.5360706381689,35.10286360841902]},{"name":"赣南藏族自治州","coord":[102.97083885806067,34.326752803339026]},{"name":"陇南市","coord":[105.24780098912132,33.57031117443431]},{"name":"天水市","coord":[105.53503634660417,34.62320421368087]},{"name":"定西市","coord":[104.58787768541339,35.08900966621695]},{"name":"临夏回族自治州","coord":[103.2612870434902,35.591577124455235]},{"name":"西宁市","coord":[101.57680657999033,36.84800271717157]},{"name":"海东地区","coord":[102.30909850729282,36.287400615025646]},{"name":"海北藏族自治州","coord":[100.27122484450717,37.892557516083826]},{"name":"金昌市","coord":[102.02244049169511,38.497330414886164]},{"name":"酒泉市","coord":[95.94486678270127,40.56891536586272]},{"name":"海西蒙古族藏族自","coord":[94.67143298050689,36.022725148503724]},{"name":"巴音郭楞蒙古自治","coord":[88.18116214759745,39.556478810319916]},{"name":"哈密地区","coord":[93.84302392518026,42.95015211178875]},{"name":"叶鲁番地区","coord":[89.82035217277885,42.399368632283505]},{"name":"乌鲁木齐市","coord":[88.00048109561487,43.549986370786]},{"name":"阿勒泰地区","coord":[88.11213933257655,47.05593413019629]},{"name":"博尔塔拉蒙古自治","coord":[82.26402238163408,44.671135542630864]},{"name":"伊犁哈萨克自治州","coord":[82.80778717477179,43.53783381365267]},{"name":"阿拉善盟","coord":[103.29923966842289,40.10955801781495]},{"name":"武威市","coord":[102.73362058791429,37.94211141321436]},{"name":"兰州市","coord":[103.73793563506032,36.27379827886003]},{"name":"中卫市","coord":[105.6943786030716,37.20654236148948]},{"name":"银川市","coord":[106.20022174140034,38.52103167597483]},{"name":"石嘴山市","coord":[106.41544011793628,38.84054137571417]},{"name":"乌海市","coord":[106.8984175998405,39.54616572239788]},{"name":"鄂尔多斯市","coord":[108.43285571424619,39.24036799350715]},{"name":"巴彦淖尔市","coord":[107.45840392808307,41.30159860424196]},{"name":"包头市","coord":[110.46472193224272,41.48017783644221]},{"name":"呼和浩特市","coord":[111.48365173603975,40.498363056149884]},{"name":"乌兰察布市","coord":[112.61568977597707,41.75789561273154]},{"name":"大同市","coord":[113.7107192749083,39.898956799744184]},{"name":"朔州市","coord":[112.65428748167508,39.681772914701924]},{"name":"忻州市","coord":[112.36127575589583,38.88990233614568]},{"name":"榆林市","coord":[109.68473112169593,38.19921027134876]},{"name":"延安市","coord":[109.52425222161318,36.406522726136814]},{"name":"庆阳市","coord":[107.73052193155061,36.183821532624464]},{"name":"固原市","coord":[106.20191575442442,36.11634909496382]},{"name":"白银市","coord":[104.68634478137065,36.51582865625868]},{"name":"宝鸡市","coord":[107.33534779230747,34.3387216485855]},{"name":"汉中市","coord":[107.03534754266246,33.00142998064871]},{"name":"广元市","coord":[105.92928137563939,32.21872447205537]},{"name":"巴中市","coord":[107.03422410306194,31.99874720836291]},{"name":"南充市","coord":[106.32964805032347,31.156657700184095]},{"name":"绵阳市","coord":[104.58949560201106,31.88628780630976]},{"name":"德阳市","coord":[104.41542984932845,31.110558133718676]},{"name":"成都市","coord":[103.8852290010473,30.777258040348634]},{"name":"阿坝藏族羌族自治","coord":[102.26209319552814,32.45725845387284]},{"name":"安康市","coord":[109.14236501848015,32.77467694678074]},{"name":"十堰市","coord":[110.39934083416314,32.376209039347906]},{"name":"襄阳市","coord":[111.97539147094662,31.93399822417465]},{"name":"宜昌市","coord":[111.22204852395754,30.772457669035354]},{"name":"恩施市","coord":[109.42158366502872,30.260366574390105]},{"name":"张家界市","coord":[110.59760006538717,29.330107409240718]},{"name":"吉首市","coord":[109.72176899848378,28.681903937242495]},{"name":"铜仁地区","coord":[108.54247523485463,28.11736237519646]},{"name":"重庆市","coord":[107.86007108564992,30.186253395053196]},{"name":"怀化市","coord":[109.94325166787243,27.43919084801186]},{"name":"益阳市","coord":[112.43060358108062,28.75127294553697]},{"name":"娄底市","coord":[111.41891416951897,27.696312460064604]},{"name":"常德市","coord":[111.72571610131646,29.27189463838195]},{"name":"荆州市","coord":[112.65896596965268,30.05161542755362]},{"name":"荆门市","coord":[112.6586855902184,31.01267124474617]},{"name":"岳阳市","coord":[113.2595036144316,29.106247116930163]},{"name":"长沙市","coord":[113.15415586456598,28.222934680488425]},{"name":"湘潭市","coord":[112.51092596317824,27.69881544105668]},{"name":"株州市","coord":[113.49665538546823,27.03993794610501]},{"name":"衡阳市","coord":[112.48849636578527,26.783613569970782]},{"name":"邵阳市","coord":[110.6723832117475,26.81652287086792]},{"name":"永州市","coord":[111.8565364154186,25.768488267811968]},{"name":"韶关市","coord":[113.53420325850979,24.69848878771937]},{"name":"惠州市","coord":[114.32029589634925,23.25504544231892]},{"name":"佛山市","coord":[112.95925897403649,23.10116677189257]},{"name":"云浮市","coord":[111.78042514904234,22.840400494105687]},{"name":"深圳市","coord":[114.13138648919008,22.649563063468342]},{"name":"汕尾市","coord":[115.57412892884373,23.06989642104901]},{"name":"河源市","coord":[114.89746229844398,23.97971937124767]},{"name":"揭阳市","coord":[116.04290004239446,23.304802704715357]},{"name":"汕头市","coord":[116.7008461897183,23.35898625947344]},{"name":"潮州市","coord":[116.75405548481658,23.854381508863064]},{"name":"梅州市","coord":[116.13719397345734,24.15633544812716]},{"name":"漳州市","coord":[117.38279760543345,24.41111215459575]},{"name":"厦门市","coord":[118.04275971554665,24.675908246507944]},{"name":"龙岩市","coord":[116.69341144552507,25.20284542644492]},{"name":"泉州市","coord":[118.12035864630246,25.22984144365049]},{"name":"莆田市","coord":[118.82439690138142,25.439653480972687]},{"name":"福州市","coord":[119.1608285845262,25.99117532466728]},{"name":"三明市","coord":[117.51188176216434,26.318292906961602]},{"name":"南平市","coord":[118.16153136678187,27.306303151805437]},{"name":"抚州市","coord":[116.3455359885574,27.487043655935366]},{"name":"鹰潭市","coord":[117.01082360702333,28.241253742969946]},{"name":"吉安市","coord":[114.91377151807418,26.957486660664525]},{"name":"赣州市","coord":[115.046455717572,25.81565075681663]},{"name":"郴州市","coord":[113.1544526703492,25.871927095452524]},{"name":"新余市","coord":[114.94161795877827,27.79044654578371]},{"name":"宜春市","coord":[115.04574494880995,28.306428044943356]},{"name":"南昌市","coord":[115.9963824234495,28.664803351584705]},{"name":"九江市","coord":[115.53225905704193,29.362905920276297]},{"name":"上饶市","coord":[117.8595355766598,28.765755150094634]},{"name":"景德镇市","coord":[117.25387030721845,29.33426823662448]},{"name":"黄山市","coord":[117.85476357809696,29.969632034273722]},{"name":"池州市","coord":[117.34517113140791,30.208089337922335]},{"name":"铜陵市","coord":[117.93160431300694,30.926442655001676]},{"name":"安庆市","coord":[116.54307680610799,30.524265461641296]},{"name":"黄石市","coord":[115.02354597728443,29.924060229331015]},{"name":"咸宁市","coord":[114.26967602231792,29.652174021136048]},{"name":"黄冈市","coord":[115.2859016705373,30.65856897065683]},{"name":"武汉市","coord":[114.34552076948799,30.68836237966767]},{"name":"随州市","coord":[113.3850627838818,31.87891659924412]},{"name":"信阳市","coord":[114.81374730587638,32.0309685135914]},{"name":"驻马店市","coord":[114.07756451509235,32.896720987266114]},{"name":"商洛市","coord":[109.82044421310393,33.77403373563189]},{"name":"西安市","coord":[109.11839808451401,34.225257215515896]},{"name":"渭南市","coord":[109.75732444226935,35.025913644359306]},{"name":"铜川市","coord":[108.98695328111377,35.19235092947735]},{"name":"咸阳市","coord":[108.36398776446165,34.84311348287181]},{"name":"三门峡市","coord":[110.80049688104964,34.31818709571671]},{"name":"运城市","coord":[111.1736679525165,35.19010372283576]},{"name":"洛阳市","coord":[111.87577573098216,34.33379926109848]},{"name":"平顶山市","coord":[112.80931281928427,33.759895800153096]},{"name":"漯河市","coord":[113.83505724178012,33.70034266174508]},{"name":"许昌市","coord":[113.78762484088509,34.051835688452435]},{"name":"郑州市","coord":[113.49619951867594,34.61181797865449]},{"name":"焦作市","coord":[113.13404280173008,35.134167097471625]},{"name":"晋城市","coord":[112.7495732073233,35.63186423091449]},{"name":"长治市","coord":[112.85900842873183,36.45872910742828]},{"name":"临汾市","coord":[111.49379787924448,36.22810800777857]},{"name":"太原市","coord":[112.15628804033796,37.91704444063036]},{"name":"吕梁市","coord":[111.31901105774872,37.712740463356496]},{"name":"晋中市","coord":[113.08199599739676,37.36532613794343]},{"name":"邯郸市","coord":[114.41824047234618,36.530119932543315]},{"name":"安阳市","coord":[113.88883283163116,35.7797611183252]},{"name":"鹤壁市","coord":[114.3654094911545,35.75770487428472]},{"name":"新乡市","coord":[113.9184107718167,35.348471214026716]},{"name":"开封市","coord":[114.52801677500626,34.61371216679872]},{"name":"周口市","coord":[114.88509782391864,33.69999759722657]},{"name":"阜阳市","coord":[115.44595951398213,32.98060371610532]},{"name":"淮南市","coord":[116.68941991880993,32.79972275772595]},{"name":"蚌埠市","coord":[117.38594715783302,33.106729536033896]},{"name":"淮北市","coord":[116.69651711889378,33.69527529383458]},{"name":"宿州市","coord":[117.30175405886838,33.943330421260015]},{"name":"亳州市","coord":[116.12410804185097,33.46769392946132]},{"name":"商丘市","coord":[115.59575176872548,34.28339840831147]},{"name":"菏泽市","coord":[115.53631974831816,35.197319393220624]},{"name":"濮阳市","coord":[115.3070485514902,35.775883510964334]},{"name":"聊城市","coord":[115.8870069012884,36.40529594548765]},{"name":"邢台市","coord":[114.74259008644859,37.251396750084155]},{"name":"石家庄市","coord":[114.56923838363613,38.13141710980106]},{"name":"阳泉市","coord":[113.39216149668508,38.09075470547468]},{"name":"保定市","coord":[115.261524468934,39.09118520781398]},{"name":"衡水市","coord":[115.8182936677897,37.715661598187154]},{"name":"德州市","coord":[116.4582273790399,37.19372347888644]},{"name":"沧州市","coord":[116.76192710911863,38.20240042039232]},{"name":"廊坊市","coord":[116.50410772133856,39.27896741763884]},{"name":"天津市","coord":[117.31988934444873,39.37154482470619]},{"name":"北京市","coord":[116.59734730757869,40.237112944270976]},{"name":"张家口市","coord":[115.1823606483226,40.83732566607167]},{"name":"唐山市","coord":[117.8693184261954,39.71862889477249]},{"name":"秦皇岛市","coord":[119.30467355367742,39.990574652162564]},{"name":"承德市","coord":[117.16275671911026,41.36623845548547]},{"name":"葫芦岛市","coord":[119.9342336210531,40.5628822626519]},{"name":"朝阳市","coord":[120.11853493535794,41.471852354885755]},{"name":"赤峰市","coord":[118.50943546234379,43.25452976059767]},{"name":"锦州市","coord":[121.5167549323861,41.45933087433065]},{"name":"营口市","coord":[122.58571915054674,40.42093503997384]},{"name":"丹东市","coord":[124.33549382902183,40.46369290272115]},{"name":"辽阳市","coord":[123.34064798039414,41.152331397771356]},{"name":"盘锦市","coord":[122.06718005354679,41.05573599862555]},{"name":"阜新市","coord":[121.93889757908204,42.27641773244204]},{"name":"鞍山市","coord":[122.78904432242356,40.77781183142038]},{"name":"沈阳市","coord":[122.99508899709724,42.1162195010079]},{"name":"铁岭市","coord":[124.23100515588399,42.72666083611828]},{"name":"扶顺市","coord":[124.46027188217573,41.82955407638859]},{"name":"通辽市","coord":[122.0729370657937,43.90889130864869]},{"name":"兴安盟","coord":[120.79456431092532,45.92003249442161]},{"name":"白城市","coord":[123.10619907715235,45.25475749267784]},{"name":"齐齐哈尔市","coord":[124.5462214659102,47.55395009317394]},{"name":"大兴安岭地区","coord":[124.50992855161529,52.18438447846694]},{"name":"黑河市","coord":[127.14721400335922,49.25080134026901]},{"name":"大庆市","coord":[124.40329830095243,46.401048760966745]},{"name":"绥化市","coord":[126.5214484055605,46.76992452194825]},{"name":"松原市","coord":[124.21244334807682,44.75779381338502]},{"name":"四平市","coord":[124.27839350328821,43.52139065090318]},{"name":"通化市","coord":[125.67392830706305,41.91771808663852]},{"name":"辽源市","coord":[125.33529527643432,42.758340204944986]},{"name":"吉林市","coord":[126.83350281902375,43.60730120049175]},{"name":"长春市","coord":[125.53597875970374,44.24624314701737]},{"name":"白山市","coord":[127.16780160322108,42.093893880305075]},{"name":"哈尔滨市","coord":[127.39125008786029,45.36200668820575]},{"name":"鹤岗市","coord":[130.4703811258197,47.66520688940109]},{"name":"伊春市","coord":[128.91240831703635,47.93833794565277]},{"name":"七台河市","coord":[131.2677920224311,45.945099776108584]},{"name":"鸡西市","coord":[132.38059153660274,45.722934218318535]},{"name":"双鸭山市","coord":[132.3184817002743,46.65813679030265]},{"name":"佳木斯市","coord":[132.26174446608726,47.17569713691394]},{"name":"呼伦贝尔市","coord":[122.3210739998419,50.18176996070858]},{"name":"孝感市","coord":[113.83749892135485,31.11757234692128]},{"name":"贵港市","coord":[110.07354588052804,23.380735604767374]},{"name":"黔南布依族苗族自","coord":[107.30931767543106,26.2976919432269]},{"name":"宁德市","coord":[119.52482556634342,27.013151692716413]},{"name":"温州市","coord":[120.30037042732202,27.8699145504001]},{"name":"台州市","coord":[120.88886782713843,28.670799172772313]},{"name":"丽水市","coord":[119.56796851966463,28.170268394477755]},{"name":"衢州市","coord":[118.79479802644406,28.865874397158763]},{"name":"金华市","coord":[119.99381920686633,29.093455548185744]},{"name":"绍兴市","coord":[120.46546691682343,29.69382513836818]},{"name":"宁波市","coord":[121.42142987830871,29.70001162878972]},{"name":"杭州市","coord":[119.4405685790891,29.87218307296989]},{"name":"宣城市","coord":[118.68748382914703,30.628143499626418]},{"name":"湖州市","coord":[119.98261306633574,30.7945175862809]},{"name":"嘉兴市","coord":[120.83889215988998,30.67538495499343]},{"name":"上海市","coord":[121.37534147322967,31.25628247908459]},{"name":"苏州市","coord":[120.6906182622391,31.381280695137775]},{"name":"无锡市","coord":[120.32182300914366,31.54113306724517]},{"name":"常州市","coord":[119.61953292830165,31.611878565375576]},{"name":"南京市","coord":[118.71890548838064,31.910863187910323]},{"name":"镇江市","coord":[119.42349332902813,31.97942313430778]},{"name":"合肥市","coord":[117.30651975617157,31.79407863049138]},{"name":"六安市","coord":[116.24668220575353,31.820846193819513]},{"name":"滁州市","coord":[117.88422385307969,32.51792621904418]},{"name":"泰州市","coord":[120.03124303305091,32.56503102346783]},{"name":"南通市","coord":[120.85599446760912,32.18496706099728]},{"name":"盐城市","coord":[120.01812490612667,33.54219948734023]},{"name":"淮安市","coord":[119.0749424205415,33.39203631772854]},{"name":"宿迁市","coord":[118.45404943216346,33.666258719120265]},{"name":"徐州市","coord":[117.77482249295966,34.30847766157078]},{"name":"济宁市","coord":[116.74147276546373,35.27488504351119]},{"name":"枣庄市","coord":[117.43359942491492,34.884162021736]},{"name":"连云港市","coord":[119.01553213785074,34.54316517587849]},{"name":"临沂市","coord":[118.31478835349617,35.28173079028279]},{"name":"日照市","coord":[119.14265350444272,35.54479073199592]},{"name":"青岛市","coord":[120.27779044405756,36.3464117375903]},{"name":"威海市","coord":[122.12963327195605,37.13879077904251]},{"name":"烟台市","coord":[120.7689567423966,37.19772002195597]},{"name":"潍坊市","coord":[119.02178548592039,36.49292234053931]},{"name":"淄博市","coord":[117.92936024367185,36.60871347163638]},{"name":"泰安市","coord":[116.93810893944303,36.0423330118612]},{"name":"济南市","coord":[117.34560282551296,36.769574973846304]},{"name":"东营市","coord":[118.4915054457184,37.52194690335787]},{"name":"滨州市","coord":[117.67610299757533,37.4439597758601]},{"name":"昆明市","coord":[102.93100245594789,25.481300763922075]},{"name":"玉溪市","coord":[102.23080854291823,24.156168324611663]},{"name":"塔城地区","coord":[83.60908162840168,45.3721852373893]},{"name":"张掖市","coord":[100.47710030600572,38.704239320458385]},{"name":"南阳市","coord":[112.1400670951149,33.03033276715801]},{"name":"扬州市","coord":[119.48949608990988,32.80956776339646]},{"name":"延边朝鲜族自治州","coord":[129.3577692895626,43.24968794080283]},{"name":"牡丹江市","coord":[129.87240796405672,44.7073040108322]},{"name":"澳门","coord":[113.56289691515346,22.14602596262204]},{"name":"吴忠市","coord":[106.76894508116403,37.72566765880316]},{"name":"来宾市","coord":[109.25592217010114,23.86346274681084]},{"name":"平凉市","coord":[107.0708132782897,35.30329631658711]},{"name":"马鞍山市","coord":[118.27245878467022,31.657727937739004]},{"name":"芜湖市","coord":[118.32992684415504,31.081688223101658]},{"name":"澄迈县","coord":[110.04198076060266,19.694955078668105]},{"name":"保亭黎族苗族自治","coord":[109.6055304964257,18.6101488675304]},{"name":"乐东黎族自治县","coord":[109.04051999525574,18.643137437909203]},{"name":"儋州市","coord":[109.3431358337404,19.550974957403195]},{"name":"定安县","coord":[110.38744429685676,19.47557074114284]},{"name":"屯昌县","coord":[110.00574767630334,19.367175093044388]},{"name":"白沙黎族自治县","coord":[109.36860737761768,19.214416393082217]},{"name":"琼中黎族苗族自治","coord":[109.86691465937548,19.073671135862682]},{"name":"东方市","coord":[108.86903802405428,19.017352815445214]},{"name":"昌江黎族自治县","coord":[108.9686431884767,19.182594167127824]},{"name":"海口市","coord":[110.420654296875,19.806565564640795]},{"name":"济源市","coord":[112.38051465474433,35.07958362422394]},{"name":"五指山市","coord":[109.53595187364496,18.832908264613966]},{"name":"大连市","coord":[121.96662235866603,39.444150542439914]},{"name":"文昌市三沙市","coord":[110.81828537536748,19.756501444162936]},{"name":"三亚市","coord":[109.38424600793707,18.39186315877128]},{"name":"万宁市","coord":[110.28485046979574,18.860240588635115]},{"name":"陵水黎族自治县","coord":[109.95577603229562,18.594712684620465]},{"name":"临高县","coord":[109.71915395436967,19.79420403032508]},{"name":"琼海市","coord":[110.41650700703043,19.22315873149372]}] \ No newline at end of file diff --git a/src/common/web-map/config/ProvinceCenter.json b/src/common/web-map/config/ProvinceCenter.json deleted file mode 100644 index 5b960513..00000000 --- a/src/common/web-map/config/ProvinceCenter.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"黑龙江省","coord":[127.64559817675396,48.48668098449708]},{"name":"内蒙古自治区","coord":[118.34519572208615,45.370218276977525]},{"name":"新疆维吾尔自治区","coord":[87.13479065593184,41.75497055053711]},{"name":"吉林省","coord":[126.12985278813787,43.57983207702637]},{"name":"辽宁省","coord":[124.02494773936439,41.105743408203125]},{"name":"甘肃省","coord":[102.87785725633012,37.69582366943361]},{"name":"河北省","coord":[115.66327227481898,39.33383178710938]},{"name":"北京市","coord":[116.62199343603638,40.25053787231445]},{"name":"山西省","coord":[112.45180235808988,37.666561126708984]},{"name":"天津市","coord":[117.35711842642581,39.406789779663086]},{"name":"陕西省","coord":[109.56294003056632,35.64754199981689]},{"name":"宁夏回族自治区","coord":[105.96110877640074,37.3081169128418]},{"name":"青海省","coord":[96.07301048277901,35.44417190551758]},{"name":"山东省","coord":[118.03833752951093,36.29800605773925]},{"name":"西藏自治区","coord":[87.47361520439412,31.6703872680664]},{"name":"河南省","coord":[113.07832397097275,33.87751102447509]},{"name":"江苏省","coord":[119.93926538201052,32.945452690124505]},{"name":"安徽省","coord":[117.15146765881019,32.024482727050774]},{"name":"四川省","coord":[102.28998890142759,30.182161331176758]},{"name":"湖北省","coord":[112.87798261431585,31.157071113586426]},{"name":"重庆市","coord":[107.870126637831,30.188085556030266]},{"name":"上海市","coord":[121.42561166015514,31.276043891906745]},{"name":"浙江省","coord":[119.75337092707514,29.175934791564945]},{"name":"湖南省","coord":[111.52770282777405,27.38110256195069]},{"name":"江西省","coord":[115.51091280655628,27.283511161804206]},{"name":"云南省","coord":[101.27053825991308,25.19783210754396]},{"name":"贵州省","coord":[106.49672346773299,26.92267990112305]},{"name":"福建省","coord":[117.9976766946587,25.939599990844727]},{"name":"广西壮族自治区","coord":[108.98706831086302,23.891559600830078]},{"name":"台湾省","coord":[120.82468432537434,23.602651596069336]},{"name":"香港特别行政区","coord":[114.21036850371561,22.374858856201172]},{"name":"海南省","coord":[109.62792940960824,19.163116455078125]},{"name":"广东省","coord":[113.32127888266032,22.873867034912106]},{"name":"澳门特别行政区","coord":[113.56819996291901,22.160347992976]}] \ No newline at end of file diff --git a/src/leaflet/entrys.json b/src/leaflet/entrys.json index f0b20375..21b1d1b7 100644 --- a/src/leaflet/entrys.json +++ b/src/leaflet/entrys.json @@ -59,7 +59,6 @@ "_mixin/ThirdService": "vue-iclient/src/common/_mixin/ThirdService.ts", "_mixin/Timer": "vue-iclient/src/common/_mixin/Timer.ts", "_mixin/VmUpdater": "vue-iclient/src/common/_mixin/VmUpdater.ts", - "_mixin/WebMapBase": "vue-iclient/src/common/web-map/WebMapBase.ts", "_mixin/GridLayer": "vue-iclient/src/leaflet/_mixin/GridLayer.js", "_mixin/Layer": "vue-iclient/src/leaflet/_mixin/Layer.js", "_mixin/map-getter": "vue-iclient/src/leaflet/_mixin/map-getter.ts", @@ -93,7 +92,6 @@ "_utils/RestService": "vue-iclient/src/common/_utils/RestService.js", "_utils/statistics": "vue-iclient/src/common/_utils/statistics.js", "_utils/util": "vue-iclient/src/common/_utils/util.js", - "_utils/WebMapService": "vue-iclient/src/common/_utils/WebMapService.ts", "_utils/vue-types/index": "vue-iclient/src/common/_utils/vue-types/index.js", "_utils/vue-types/utils": "vue-iclient/src/common/_utils/vue-types/utils.js", "_utils/style/theme/chart": "vue-iclient/src/common/_utils/style/theme/chart.js", diff --git a/src/leaflet/package.json b/src/leaflet/package.json index 8077c3ef..d754c5fe 100644 --- a/src/leaflet/package.json +++ b/src/leaflet/package.json @@ -13,7 +13,6 @@ "@turf/length": "^6.0.2", "@turf/rhumb-bearing": "^6.0.1", "@turf/transform-scale": "^5.1.5", - "@turf/meta": "^6.5.0", "@types/geojson": "^7946.0.7", "@types/leaflet": "^1.5.5", "@types/node": "^12.0.3", @@ -40,7 +39,6 @@ "lodash.isnumber": "^3.0.3", "lodash.isplainobject": "^4.0.6", "lodash.max": "^4.0.1", - "lodash.min": "^4.0.1", "lodash.merge": "^4.6.1", "lodash.orderby": "^4.6.0", "lodash.tonumber": "^4.0.3", diff --git a/src/leaflet/web-map/WebMapViewModel.ts b/src/leaflet/web-map/WebMapViewModel.ts index d07dd799..e0b723ca 100644 --- a/src/leaflet/web-map/WebMapViewModel.ts +++ b/src/leaflet/web-map/WebMapViewModel.ts @@ -1,12 +1,12 @@ import L from '../leaflet-wrapper'; +import { Events } from 'vue-iclient/src/common/_types/event/Events'; import 'vue-iclient/static/libs/iclient-leaflet/iclient-leaflet.min'; // import echarts from 'echarts'; // TODO iclient 拿不到 echarts ??? import 'vue-iclient/static/libs/geostats/geostats'; import getCenter from '@turf/center'; -import WebMapBase from 'vue-iclient/src/common/web-map/WebMapBase'; import { toEpsgCode, getProjection } from 'vue-iclient/src/common/_utils/epsg-define'; -interface webMapOptions { +interface WebMapOptions { target?: string; serverUrl?: string; accessToken?: string; @@ -17,7 +17,7 @@ interface webMapOptions { isSuperMapOnline?: boolean; } -interface mapOptions { +interface MapOptions { center?: [number, number] | L.LatLng; zoom?: number; maxBounds?: [[number, number], [number, number]] | L.Bounds; @@ -27,18 +27,41 @@ interface mapOptions { preferCanvas?: boolean; } +// @ts-ignore +const WebMapBase: InstanceType = L.supermap.createWebMapBaseExtending(Events, 'triggerEvent'); + // TODO 坐标系 / noWrap export default class WebMapViewModel extends WebMapBase { map: L.Map; + mapOptions: MapOptions; + + serverUrl: string; + center: [number, number] | L.LatLng; + zoom: number; + + target: string; + mapParams: { title?: string; description?: string }; layers: any = {}; crs: L.CRS; + baseProjection: string; + + triggerEvent: any; + + eventTypes: string[]; + + protected _layers: any = []; + + protected layerAdded: number; + + protected expectLayerLen: number; + private _dataFlowLayer: any; private _dataflowFeatureCache: any; @@ -53,10 +76,21 @@ export default class WebMapViewModel extends WebMapBase { private _unprojectCrs; - constructor(id, options: webMapOptions = {}, mapOptions: mapOptions = {}) { + constructor(id, options: WebMapOptions = {}, mapOptions: MapOptions = {}) { super(id, options, mapOptions); this.center = mapOptions.center; this.zoom = mapOptions.zoom; + this.eventTypes = [ + 'getmapinfofailed', + 'crsnotsupport', + 'getlayerdatasourcefailed', + 'addlayerssucceeded', + 'notsupportmvt', + 'notsupportbaidumap', + 'projectionisnotmatch', + 'beforeremovemap', + 'mapinitialized' + ]; this._initWebMap(); } @@ -684,9 +718,10 @@ export default class WebMapViewModel extends WebMapBase { private _createMigrationLayer(layerInfo, features) { // window['echarts'] = echarts; - let options = this.getEchartsLayerOptions(layerInfo, features, 'leaflet'); + const options = this.getEchartsLayerOptions(layerInfo, features, 'leaflet'); + options.GLMap = { roam: true }; // @ts-ignore - let layer = L.supermap.echartsLayer(options); + const layer = L.supermap.echartsLayer(options); this.echartslayer.push(layer); return layer; } @@ -1091,7 +1126,7 @@ export default class WebMapViewModel extends WebMapBase { this.stopCanvg(); this.center = null; this.zoom = null; - this._dataFlowLayer.off('dataupdated', this._updateDataFlowFeaturesCallback); + this._dataFlowLayer?.off('dataupdated', this._updateDataFlowFeaturesCallback); this._unprojectCrs = null; } } diff --git a/src/mapboxgl/_types/map-event.js b/src/mapboxgl/_types/map-event.js index 7cd7b500..273131b1 100644 --- a/src/mapboxgl/_types/map-event.js +++ b/src/mapboxgl/_types/map-event.js @@ -60,7 +60,7 @@ export default new Vue({ const webmaps = webMapCombinations.map(item => item[1]); const argumentsList = arguments; webmaps.forEach(webmap => { - webmap[propKey].apply(webmap, argumentsList); + webmap[propKey]?.apply(webmap, argumentsList); }); }; } diff --git a/src/mapboxgl/ncp-map/NcpMapViewModel.ts b/src/mapboxgl/ncp-map/NcpMapViewModel.ts index 1fcf94b7..18a440fe 100644 --- a/src/mapboxgl/ncp-map/NcpMapViewModel.ts +++ b/src/mapboxgl/ncp-map/NcpMapViewModel.ts @@ -1,5 +1,4 @@ import mapboxgl from 'vue-iclient/static/libs/mapboxgl/mapbox-gl-enhance'; -import SourceListModel from '../web-map/SourceListModel'; import { handleMultyPolygon } from 'vue-iclient/src/mapboxgl/_utils/geometry-util'; import labelPoints from './config/label-points.json'; import 'vue-iclient/static/libs/iclient-mapboxgl/iclient-mapboxgl.min'; @@ -82,9 +81,8 @@ export default class NcpMapViewModel extends mapboxgl.Evented { on: any; bounds: mapboxglTypes.LngLatBoundsLike; private _layers: any[] = []; - private _appreciableLayers: any[] = []; - private _sourceListModel: SourceListModel; + private _sourceListModel: InstanceType; private _legendList: any[] = []; constructor(target: string, dataOptions: dataOptions = {}, mapOptions?: mapOptions) { @@ -347,7 +345,7 @@ export default class NcpMapViewModel extends mapboxgl.Evented { } private _sendMapToUser(): void { - this._sourceListModel = new SourceListModel({ + this._sourceListModel = new mapboxgl.supermap.SourceListModel({ map: this.map, layers: this._layers }); diff --git a/src/mapboxgl/package.json b/src/mapboxgl/package.json index e794ed3f..e1145030 100644 --- a/src/mapboxgl/package.json +++ b/src/mapboxgl/package.json @@ -42,7 +42,6 @@ "lodash.isnumber": "^3.0.3", "lodash.isplainobject": "^4.0.6", "lodash.max": "^4.0.1", - "lodash.min": "^4.0.1", "lodash.merge": "^4.6.1", "lodash.mergewith": "^4.6.2", "lodash.orderby": "^4.6.0", diff --git a/src/mapboxgl/web-map/MapStyle.ts b/src/mapboxgl/web-map/MapStyle.ts deleted file mode 100644 index 0c91bf0c..00000000 --- a/src/mapboxgl/web-map/MapStyle.ts +++ /dev/null @@ -1,217 +0,0 @@ -import { Events } from 'vue-iclient/src/common/_types/event/Events'; -import mapboxgl from 'vue-iclient/static/libs/mapboxgl/mapbox-gl-enhance'; -import 'vue-iclient/static/libs/iclient-mapboxgl/iclient-mapboxgl.min'; -import SourceListModel from 'vue-iclient/src/mapboxgl/web-map/SourceListModel'; -import WebMapService from '../../common/_utils/WebMapService'; -import cloneDeep from 'lodash.clonedeep'; - -interface webMapOptions { - target?: string; - serverUrl?: string; - accessToken?: string; - accessKey?: string; - tiandituKey?: string; - googleMapsAPIKey?: string; - googleMapsLanguage?: string; - withCredentials?: boolean; - excludePortalProxyUrl?: boolean; - isSuperMapOnline?: boolean; - center?: number[]; - zoom?: number; - proxy?: boolean | string; - iportalServiceProxyUrlPrefix?: string; - checkSameLayer?: boolean; -} - -interface mapOptions { - name?: string; - center?: [number, number] | mapboxglTypes.LngLatLike | { lon: number; lat: number } | number[]; - zoom?: number; - bounds?: mapboxglTypes.LngLatBoundsLike; - maxBounds?: [[number, number], [number, number]] | mapboxglTypes.LngLatBoundsLike; - minZoom?: number; - maxZoom?: number; - renderWorldCopies?: boolean; - bearing?: number; - pitch?: number; - style?: any; - rasterTileSize?: number; - container?: string; - crs?: string | { epsgCode: string; WKT: string; extent: any; unit: string }; - transformRequest?: (url: string, resourceType: string) => void; - fadeDuration?: number; -} - -export default class MapStyle extends Events { - options: webMapOptions; - mapOptions: mapOptions; - target: string; - proxy: string | boolean; - map: mapboxglTypes.Map; - layerFilter: Function; - withCredentials: boolean; - eventTypes: string[]; - private _sourceListModel: InstanceType; - protected webMapService: InstanceType; - _layerIdRenameMapList: any[] = []; - _appendLayers = false; - - triggerEvent: (name: string, ...rest: any) => any; - - on: (data: Record) => void; - - constructor( - id: string | number | Object, - options: webMapOptions, - mapOptions: mapOptions, - layerFilter: Function - ) { - super(); - this.target = options.target || 'map'; - this.options = options; - this.proxy = options.proxy; - this.withCredentials = options.withCredentials || false; - this.mapOptions = cloneDeep(mapOptions); - this.webMapService = new WebMapService(id, options); - this.layerFilter = layerFilter; - this.eventTypes = ['addlayerssucceeded', 'mapinitialized']; - } - - initializeMap(_: Record, map?: mapboxglTypes.Map) { - if (map) { - this._appendLayers = true; - this.map = map; - this._addLayersToMap(); - return; - } - this.mapOptions.container = this.target; - if (typeof this.mapOptions.crs === 'object' && this.mapOptions.crs.epsgCode) { - this.mapOptions.crs = new mapboxgl.CRS( - this.mapOptions.crs.epsgCode, - this.mapOptions.crs.WKT, - this.mapOptions.crs.extent, - this.mapOptions.crs.unit - ); - } - if (!this.mapOptions.transformRequest) { - this.mapOptions.transformRequest = (url: string, resourceType: string) => { - let proxy = ''; - if (typeof this.proxy === 'string') { - let proxyType = 'data'; - if (resourceType === 'Tile') { - proxyType = 'image'; - } - proxy = this.webMapService.handleProxy(proxyType); - } - return { - url: proxy ? `${proxy}${encodeURIComponent(url)}` : url, - credentials: this.webMapService.handleWithCredentials(proxy, url, this.withCredentials || false) - ? 'include' - : undefined - }; - }; - } - this.mapOptions.center = this.mapOptions.center ?? [0, 0]; - this.mapOptions.zoom = this.mapOptions.zoom ?? 0; - let fadeDuration = 0; - if (Object.prototype.hasOwnProperty.call(this.mapOptions, 'fadeDuration')) { - fadeDuration = this.mapOptions.fadeDuration; - } - this.map = new mapboxgl.Map({ ...this.mapOptions, fadeDuration }); - this.triggerEvent('mapinitialized', { map: this.map }); - this.map.on('load', () => { - this._sendMapToUser(); - }); - } - - _addLayersToMap() { - const { sources, layers, layerIdMapList } = this._setUniqueId(this.mapOptions.style); - layers.forEach(layer => { - layer.source && !this.map.getSource(layer.source) && this.map.addSource(layer.source, sources[layer.source]); - this.map.addLayer(layer); - }); - this._layerIdRenameMapList = layerIdMapList; - this._sendMapToUser(); - } - - _setUniqueId(style: Record) { - const layersToMap = JSON.parse(JSON.stringify(style.layers)); - const nextSources = {}; - const layerIdToChange = []; - const timestamp = `_${+new Date()}`; - for (const sourceId in style.sources) { - let nextSourceId = sourceId; - if (this.map.getSource(sourceId)) { - nextSourceId = sourceId + timestamp; - } - nextSources[nextSourceId] = style.sources[sourceId]; - for (const layer of layersToMap) { - if (layer.source === sourceId) { - layer.source = nextSourceId; - } - } - } - for (const layer of layersToMap) { - const originId = layer.id; - if (this.map.getLayer(layer.id)) { - const layerId = layer.id + timestamp; - layer.id = layerId; - } - layerIdToChange.push({ originId: originId, renderId: layer.id }); - } - return { - sources: nextSources, - layers: layersToMap, - layerIdMapList: layerIdToChange - }; - } - - _generateAppreciableLayers() { - const layers = this.mapOptions.style.layers.map((layer: Record) => { - const matchLayer = this._layerIdRenameMapList.find(item => item.originId === layer.id) || { renderId: layer.id }; - const overlayLayers = { - id: matchLayer.renderId, - name: layer.id - }; - return overlayLayers; - }); - return layers; - } - - _sendMapToUser() { - const appreciableLayers = this._generateAppreciableLayers(); - this._sourceListModel = new SourceListModel({ - map: this.map, - layers: appreciableLayers, - appendLayers: this._appendLayers - }); - const matchLayers = this.getAppreciableLayers().filter((item: Record) => - appreciableLayers.some((layer: Record) => layer.id === item.id) - ); - this.triggerEvent('addlayerssucceeded', { - map: this.map, - mapparams: { title: this.mapOptions.name, description: '' }, - layers: matchLayers - }); - } - - clean() { - if (this.map) { - this.map.remove(); - this.map = null; - this._sourceListModel = null; - } - } - - getLayerCatalog() { - return this._sourceListModel?.getSourceList() ?? []; - } - - getLegendInfo() { - return []; - } - - getAppreciableLayers() { - return this._sourceListModel?.getLayers() ?? []; - } -} diff --git a/src/mapboxgl/web-map/SourceListModel.js b/src/mapboxgl/web-map/SourceListModel.js deleted file mode 100644 index 9fb927b0..00000000 --- a/src/mapboxgl/web-map/SourceListModel.js +++ /dev/null @@ -1,139 +0,0 @@ -import SourceModel from 'vue-iclient/src/mapboxgl/web-map/SourceModel'; - -class SourceListModel { - constructor(options) { - this.map = options.map; - this.layers = options.layers || []; - this.appendLayers = options.appendLayers || false; - this.excludeSourceNames = ['tdt-search-', 'tdt-route-', 'smmeasure', 'mapbox-gl-draw', /tracklayer-\d+-line/]; - } - - getLayers() { - const detailLayers = this._initLayers(); - return this._initAppreciableLayers(detailLayers); - } - - getSourceList() { - const appreciableLayers = this.getLayers(); - return this._initSource(appreciableLayers); - } - - excludeSource(key) { - for (let i = 0; i < this.excludeSourceNames.length; i++) { - if (key && key.match(this.excludeSourceNames[i])) { - return false; - } - } - return true; - } - - _initLayers() { - const layersOnMap = this.map.getStyle().layers.map(layer => this.map.getLayer(layer.id)); - const overlayLayers = Object.values(this.map.overlayLayersManager).reduce((layers, overlayLayer) => { - if (overlayLayer.id && !layers.some(item => item.id === overlayLayer.id)) { - const visibility = - overlayLayer.visibility === 'visible' || - overlayLayer.visibility || - overlayLayer.visible || - (!('visible' in overlayLayer) && !('visibility' in overlayLayer)) - ? 'visible' - : 'none'; - let source = overlayLayer.source || overlayLayer.sourceId; - if (typeof source === 'object') { - source = overlayLayer.id; - } - layers.push({ - id: overlayLayer.id, - visibility, - source, - type: overlayLayer.type - }); - } - return layers; - }, []); - const renderLayers = layersOnMap - .concat(overlayLayers) - .filter(layer => !this.appendLayers || this.layers.some(item => layer.id === item.id)); - const nextLayers = renderLayers - .filter(layer => this.excludeSource(layer.source)) - .filter(layer => !layer.id.includes('-SM-')); - const selfLayers = []; - const selfLayerIds = []; - // 排序 - this.layers.forEach(item => { - const matchLayer = nextLayers.find(layer => layer.id === item.id); - if (matchLayer) { - selfLayers.push(matchLayer); - selfLayerIds.push(matchLayer.id); - } - }); - const otherLayers = nextLayers.filter(item => !selfLayerIds.includes(item.id)); - return selfLayers.concat(otherLayers); - } - - _initSource(detailLayers) { - const datas = detailLayers.reduce((sourceList, layer) => { - let matchItem = sourceList.find(item => { - const sourceId = layer.renderSource.id || layer.id; - return item.id === sourceId; - }); - if (!matchItem) { - const sourceListItem = new SourceModel(layer); - sourceList.push(sourceListItem); - matchItem = sourceListItem; - } - matchItem.addLayer(layer); - return sourceList; - }, []); - datas.reverse(); - return datas; - } - - _initAppreciableLayers(detailLayers) { - // dv 没有关联一个可感知图层对应对个渲染图层的关系,默认相同source的layer就是渲染图层 - return detailLayers.reduce((layers, layer) => { - let matchLayer = layers.find(item => { - const layerId = layer.sourceLayer || layer.source || layer.id; - return item.id === layerId; - }); - if (!matchLayer) { - matchLayer = this._createCommonFields(layer); - layers.push(matchLayer); - } - matchLayer.renderLayers.push(layer.id); - return layers; - }, []); - } - - _createCommonFields(layer) { - const layerInfo = this.layers.find(layerItem => layer.id === layerItem.id) || {}; - // type: background overlaymanager layers 只有 id - const layerId = layer.sourceLayer || layer.source || layer.id; - const { - dataSource, - themeSetting = {}, - name = layerId, - visible = layer.visibility ? layer.visibility === 'visible' : true, - serverId - } = layerInfo; - const sourceOnMap = this.map.getSource(layer.source); - const fields = { - id: layerId, - title: name, - type: layer.type, - visible, - renderSource: { - id: layer.source, - type: sourceOnMap && sourceOnMap.type - }, - renderLayers: [], - dataSource: dataSource || (serverId ? { serverId } : {}), - themeSetting - }; - if (layer.sourceLayer) { - fields.renderSource.sourceLayer = layer.sourceLayer; - } - return fields; - } -} -export default SourceListModel; diff --git a/src/mapboxgl/web-map/SourceModel.js b/src/mapboxgl/web-map/SourceModel.js deleted file mode 100644 index 8ef93ca4..00000000 --- a/src/mapboxgl/web-map/SourceModel.js +++ /dev/null @@ -1,31 +0,0 @@ -class SourceModel { - constructor(options) { - this.dataSource = options.dataSource; - this.id = options.renderSource.id || options.id; - this.title = options.title; - this.renderSource = options.renderSource; - this.renderLayers = []; - this.type = options.type; - this.themeSetting = options.themeSetting; - this.visible = options.visible; - } - - addLayer(layer) { - if (layer.renderSource.sourceLayer) { - if (!this.children) { - this.children = []; - this.type = 'group'; - this.renderSource = {}; - this.dataSource = {}; - this.themeSetting = {}; - this.visible = true; - this.title = this.id; - } - this.children.push(layer); - return; - } - this.renderLayers.push(...layer.renderLayers); - } -} - -export default SourceModel; diff --git a/src/mapboxgl/web-map/WebMapV2.ts b/src/mapboxgl/web-map/WebMapV2.ts deleted file mode 100644 index fa0fc316..00000000 --- a/src/mapboxgl/web-map/WebMapV2.ts +++ /dev/null @@ -1,2957 +0,0 @@ -/* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html. */ -import mapboxgl from 'vue-iclient/static/libs/mapboxgl/mapbox-gl-enhance'; -import SourceListModel from 'vue-iclient/src/mapboxgl/web-map/SourceListModel'; -import { handleMultyPolygon } from 'vue-iclient/src/mapboxgl/_utils/geometry-util'; -import 'vue-iclient/static/libs/iclient-mapboxgl/iclient-mapboxgl.min'; -import 'vue-iclient/static/libs/geostats/geostats'; -import 'vue-iclient/static/libs/json-sql/jsonsql'; -import echarts from 'echarts'; -import EchartsLayer from 'vue-iclient/static/libs/echarts-layer/EchartsLayer'; -import cloneDeep from 'lodash.clonedeep'; -import { geti18n } from 'vue-iclient/src/common/_lang/index'; -import WebMapBase from 'vue-iclient/src/common/web-map/WebMapBase'; -import { getColorWithOpacity } from 'vue-iclient/src/common/_utils/util'; -import { getProjection, registerProjection, toEpsgCode } from 'vue-iclient/src/common/_utils/epsg-define'; -import proj4 from 'proj4'; - -/** - * @class WebMapViewModel - * @category ViewModel - * @classdesc 对接 iPortal/Online 地图类。目前支持地图坐标系包括:'EPSG:3857','EPSG:4326','EPSG:4490','EPSG:4214','EPSG:4610'。 - * @param {number} id - iPortal|Online 地图 ID。 - * @param {Object} options - 参数。 - * @param {string} [options.target='map'] - 地图容器 ID。 - * @param {string} [options.serverUrl="https://www.supermapol.com"] - SuperMap iPortal/Online 服务器地址。当设置 `id` 时有效。 - * @param {string} [options.accessToken] - 用于访问 SuperMap iPortal 、SuperMap Online 中受保护的服务。当设置 `id` 时有效。 - * @param {string} [options.accessKey] - SuperMap iServer 提供的一种基于 Token(令牌)的用户身份验证机制。当设置 `id` 时有效。 - * @param {String} [options.tiandituKey] - 用于访问天地图的服务。当设置 `id` 时有效。 - * @param {String} [options.bingMapsKey] - 用于访问必应地图的服务。当设置 `id` 时有效。 - * @param {String} [options.googleMapsAPIKey] - 用于访问谷歌地图。当设置 `id` 时有效。 - * @param {String} [options.googleMapsLanguage] - 用于定义在谷歌地图图块上显示标签的语言。当设置 `id` 且底图为谷歌地图时有效。 - * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。当设置 `id` 时有效。 - * @param {boolean} [options.excludePortalProxyUrl] - server 传递过来的 URL 是否带有代理。当设置 `id` 时有效。 - * @param {boolean} [options.ignoreBaseProjection = 'false'] - 是否忽略底图坐标系和叠加图层坐标系不一致。 - * @param {String} [options.iportalServiceProxyUrlPrefix] - iportal的代理服务地址前缀。 - * @fires WebMapViewModel#mapinitialized - * @fires WebMapViewModel#getmapinfofailed - * @fires WebMapViewModel#getlayerdatasourcefailed - * @fires WebMapViewModel#addlayerssucceeded - */ -interface webMapOptions { - target?: string; - serverUrl?: string; - accessToken?: string; - accessKey?: string; - tiandituKey?: string; - bingMapsKey?: string; - googleMapsAPIKey?: string; - googleMapsLanguage?: string; - withCredentials?: boolean; - excludePortalProxyUrl?: boolean; - isSuperMapOnline?: boolean; - center?: number[]; - zoom?: number; - proxy?: boolean | string; - iportalServiceProxyUrlPrefix?: string; - checkSameLayer?: boolean; - parentEvents?: Record; -} -interface mapOptions { - center?: [number, number] | mapboxglTypes.LngLatLike | { lon: number; lat: number } | number[]; - zoom?: number; - bounds?: mapboxglTypes.LngLatBoundsLike; - maxBounds?: [[number, number], [number, number]] | mapboxglTypes.LngLatBoundsLike; - minZoom?: number; - maxZoom?: number; - renderWorldCopies?: boolean; - bearing?: number; - pitch?: number; - style?: any; - rasterTileSize?: number; - container?: string; - crs: string; -} - -type layerType = 'POINT' | 'LINE' | 'POLYGON'; - -export default class WebMap extends WebMapBase { - map: mapboxglTypes.Map; - - center: [number, number] | mapboxglTypes.LngLatLike | { lon: number; lat: number } | number[]; - - bounds: mapboxglTypes.LngLatBoundsLike; - - renderWorldCopies: boolean; - - bearing: number; - - pitch: number; - - rasterTileSize: number; - - layerFilter: Function; - - baseLayerProxy: string | boolean; - - private _sourceListModel: SourceListModel; - - private _legendList: any; - - private _handleDataflowFeaturesCallback: Function; - - private _initDataflowLayerCallback: Function; - - private _dataflowService: any; - - private _unprojectProjection: string; - - private _layerTimerList: Array = []; - - private checkSameLayer: boolean; - - private _mapInfo: Record; - - private _parentEvents: Record; - - private _cacheLayerId: Map> = new Map(); - - private _appendLayers = false; - - constructor( - id: string | number | Object, - options: webMapOptions = {}, - mapOptions: mapOptions, - layerFilter: Function = function () { - return true; - } - ) { - super(id, options, mapOptions); - if (typeof id === 'string' || typeof id === 'number') { - this.mapId = id; - } - if (this.centerValid(mapOptions.center)) { - this.center = mapOptions.center; - } - this.zoom = mapOptions.zoom; - this.renderWorldCopies = mapOptions.renderWorldCopies; - this.bounds = mapOptions.bounds; - this.bearing = mapOptions.bearing; - this.pitch = mapOptions.pitch; - this.rasterTileSize = mapOptions.rasterTileSize || 256; - this.layerFilter = layerFilter; - this.checkSameLayer = options.checkSameLayer; - this._legendList = []; - this._parentEvents = options.parentEvents ?? {}; - this._taskID = new Date(); - } - - initializeMap(mapInfo: Record, map?: mapboxglTypes.Map) { - if (map) { - this._appendLayers = true; - this.map = map; - } - this._getMapInfo(mapInfo, this._taskID); - } - - getLegendInfo() { - return this._legendList; - } - - getLayerCatalog() { - return this._sourceListModel?.getSourceList() || []; - } - - getAppreciableLayers() { - return this._sourceListModel?.getLayers() || []; - } - - _initWebMap(): void {} - - _loadLayers(mapInfo, _taskID): void { - if (this.map) { - // @ts-ignore - if (this.map.getCRS().epsgCode !== this.baseProjection && !this.ignoreBaseProjection) { - this._triggerEvent('projectionisnotmatch', {}); - return; - } - this._handleLayerInfo(mapInfo, _taskID); - } else { - setTimeout(() => { - this._createMap(mapInfo); - this.map.on('load', () => { - this._handleLayerInfo(mapInfo, _taskID); - }); - }, 0); - } - } - - _setCRS(baseProjection, wkt, bounds): void { - const crs = new mapboxgl.CRS(baseProjection, wkt, bounds, bounds[2] > 180 ? 'meter' : 'degree'); - mapboxgl.CRS.set(crs); - } - - _getMapInfo(mapInfo: Record, _taskID: Date): void { - this._mapInfo = mapInfo; - const { projection } = mapInfo; - let bounds, wkt; - this.baseProjection = toEpsgCode(projection); - let defaultWktValue = getProjection(this.baseProjection); - - if (defaultWktValue) { - wkt = defaultWktValue; - } - if (!mapboxgl.CRS.get(this.baseProjection)) { - if (mapInfo.baseLayer && mapInfo.baseLayer.layerType === 'MAPBOXSTYLE') { - let url = mapInfo.baseLayer.dataSource.url; - if (url.indexOf('/restjsr/') > -1 && !/\/style\.json$/.test(url)) { - url += '/style.json'; - } - this.webMapService.getMapBoxStyle(url).then((res: any) => { - if (res && res.metadata && res.metadata.indexbounds) { - bounds = res.metadata.indexbounds; - } else { - bounds = [ - mapInfo.extent.leftBottom.x, - mapInfo.extent.leftBottom.y, - mapInfo.extent.rightTop.x, - mapInfo.extent.rightTop.y - ]; - } - this._defineProj4(projection); - this._setCRS(this.baseProjection, wkt, bounds); - this._loadLayers(mapInfo, _taskID); - }); - } else if (mapInfo.baseLayer && mapInfo.baseLayer.layerType === 'TILE') { - // 获取地图的wkt - this.getEpsgCodeWKT(`${mapInfo.baseLayer.url}/prjCoordSys.wkt`, { - withoutFormatSuffix: true, - withCredentials: this.webMapService.handleWithCredentials('', mapInfo.baseLayer.url, false) - }).then(res => { - if (!wkt) { - wkt = res; - } - this.getBounds(`${mapInfo.baseLayer.url}.json`, { - withoutFormatSuffix: true, - withCredentials: this.webMapService.handleWithCredentials('', mapInfo.baseLayer.url, false) - }).then(res => { - if (res && res.bounds) { - bounds = [res.bounds.leftBottom.x, res.bounds.leftBottom.y, res.bounds.rightTop.x, res.bounds.rightTop.y]; - } else { - bounds = [ - mapInfo.extent.leftBottom.x, - mapInfo.extent.leftBottom.y, - mapInfo.extent.rightTop.x, - mapInfo.extent.rightTop.y - ]; - } - this._defineProj4(wkt, projection); - this._setCRS(this.baseProjection, wkt, bounds); - this._loadLayers(mapInfo, _taskID); - }); - }); - } else { - // this._defineProj4(projection); - // this._loadLayers(mapInfo, _taskID); - throw Error(geti18n().t('webmap.crsNotSupport')); - } - } else { - this._defineProj4(projection); - bounds = [ - mapInfo.extent.leftBottom.x, - mapInfo.extent.leftBottom.y, - mapInfo.extent.rightTop.x, - mapInfo.extent.rightTop.y - ]; - this._setCRS(this.baseProjection, wkt, bounds); - this._loadLayers(mapInfo, _taskID); - } - } - - _handleLayerInfo(mapInfo, _taskID): void { - mapInfo = this._setLayerID(mapInfo); - this._mapInfo = mapInfo; - this.layerAdded = 0; - this.expectLayerLen = 0; - const { layers, grid } = mapInfo; - this._setExpectLayerLen(mapInfo); - if (this.expectLayerLen === 0) { - this._sendMapToUser(0, 0); - } - if (this._shouldLoadBaseLayer(mapInfo, this.layerFilter)) { - this._initBaseLayer(mapInfo, () => { - this._addLayerSucceeded(); - }); - } - if (layers && layers.length !== 0) { - let filterLayers = layers; - if (typeof this.layerFilter === 'function') { - filterLayers = layers.filter(this.layerFilter); - } - this._initOverlayLayers(filterLayers, _taskID); - } - if (grid && grid.graticule) { - this._initGraticuleLayer(grid.graticule); - } - } - - _setExpectLayerLen(mapInfo) { - if (this._shouldLoadBaseLayer(mapInfo, this.layerFilter)) { - this.expectLayerLen++; - } - let overLayers = mapInfo.layers; - if (overLayers && overLayers.length > 0) { - if (typeof this.layerFilter === 'function') { - overLayers = overLayers.filter(this.layerFilter); - } - this.expectLayerLen += overLayers.length; - } - } - - _shouldLoadBaseLayer(mapInfo, layerFilter) { - const baseLayer = mapInfo.baseLayer; - if (!baseLayer) { - return false; - } - if (typeof layerFilter === 'function') { - return layerFilter(baseLayer); - } - return true; - } - - _createMap(mapInfo?): void { - // 获取字体样式 - const fontFamilys: string = this._getLabelFontFamily(mapInfo); - const center = this._getMapCenter(mapInfo); - // zoom - let zoom = mapInfo.level || 0; - let zoomBase = 0; - let { bounds, minZoom, maxZoom } = this.mapOptions; - const interactive = this.mapOptions.interactive; - if (isNaN(minZoom)) { - minZoom = mapInfo.minScale - ? this._transformScaleToZoom(mapInfo.minScale, mapboxgl.CRS.get(this.baseProjection)) - : 0; - } - if (isNaN(maxZoom)) { - maxZoom = mapInfo.maxScale - ? this._transformScaleToZoom(mapInfo.maxScale, mapboxgl.CRS.get(this.baseProjection)) - : 22; - } - if (mapInfo.visibleExtent && mapInfo.visibleExtent.length === 4 && !bounds) { - bounds = [ - this._unproject([mapInfo.visibleExtent[0], mapInfo.visibleExtent[1]]), - this._unproject([mapInfo.visibleExtent[2], mapInfo.visibleExtent[3]]) - ]; - } - if (minZoom > maxZoom) { - [minZoom, maxZoom] = [maxZoom, minZoom]; - } - if (!bounds) { - if (mapInfo.minScale && mapInfo.maxScale) { - zoomBase = Math.min( - this._transformScaleToZoom(mapInfo.minScale, mapboxgl.CRS.get(this.baseProjection)), - this._transformScaleToZoom(mapInfo.maxScale, mapboxgl.CRS.get(this.baseProjection)) - ); - } else { - zoomBase = +Math.log2( - this._getResolution(mapboxgl.CRS.get(this.baseProjection).getExtent()) / this._getResolution(mapInfo.extent) - ).toFixed(2); - } - zoom += zoomBase; - } - - // 初始化 map - this.map = new mapboxgl.Map({ - ...this.mapOptions, - container: this.target, - center: this.center || center, - zoom: this.zoom || zoom, - minZoom, - maxZoom, - bearing: this.bearing || 0, - pitch: this.pitch || 0, - bounds, - interactive: interactive === void 0 ? true : interactive, - style: { - version: 8, - sources: {}, - layers: [] - }, - // @ts-ignore fix-crs - crs: this.baseProjection, - localIdeographFontFamily: fontFamilys || '', - renderWorldCopies: this.renderWorldCopies || false, - transformRequest: (url, resourceType) => { - if (resourceType === 'Tile') { - if (this.isSuperMapOnline && url.indexOf('http://') === 0) { - url = `https://www.supermapol.com/apps/viewer/getUrlResource.png?url=${encodeURIComponent(url)}`; - } - if (this.webMapService.isIportalResourceUrl(url)) { - url = this.webMapService.handleParentRes(url); - } - const proxy = this.webMapService.handleProxy('image'); - return { - url: url, - credentials: this.webMapService.handleWithCredentials(proxy, url, false) ? 'include' : undefined - }; - } - return { url }; - }, - fadeDuration: 0 - }); - /** - * @description Map 初始化成功。 - */ - this._triggerEvent('mapinitialized', { map: this.map }); - } - - private _createMVTBaseLayer(layerInfo, addedCallback?: Function) { - let url = layerInfo.dataSource.url; - if (url.indexOf('/restjsr/') > -1 && !/\/style\.json$/.test(url)) { - url += '/style.json'; - } - this.webMapService - // @ts-ignore - .getMapBoxStyle(url) - .then( - (style: any) => { - const sourceIds = Object.keys(style.sources); - if (sourceIds.some(id => this.map.getSource(id))) { - addedCallback && addedCallback(); - return; - } - // @ts-ignore - this.map.addStyle(style); - const layerIds = []; - style.layers.forEach((item: Record) => { - if (item.type !== 'background') { - layerIds.push(item.id); - } - }); - this._cacheLayerId.set(layerInfo.layerID || layerInfo.name, layerIds.map((layerId: string) => ({ layerId, name: layerId }))); - addedCallback && addedCallback(); - }, - error => { - addedCallback && addedCallback(); - throw new Error(error); - } - ) - .catch(error => { - /** - * @event WebMapViewModel#getmapinfofailed - * @description 获取地图信息失败。 - * @property {Object} error - 失败原因。 - */ - this._triggerEvent('getmapinfofailed', { error }); - }); - } - - _initBaseLayer(mapInfo: any, addedCallback?: Function): void { - const layerInfo = mapInfo.baseLayer || mapInfo; - const layerType = this.getBaseLayerType(layerInfo); - const mapUrls = this.getMapurls(); - let url: string; - this.baseLayerProxy = this.webMapService.handleProxy('image'); - switch (layerType) { - case 'TIANDITU': - this.baseLayerProxy = null; - this._createTiandituLayer(mapInfo, addedCallback); - break; - case 'BING': - this.baseLayerProxy = null; - this._createBingLayer(layerInfo.layerID || layerInfo.name, layerInfo, addedCallback); - break; - case 'WMS': - this._createWMSLayer(layerInfo, addedCallback); - break; - case 'WMTS': - this._createWMTSLayer(layerInfo, addedCallback); - break; - case 'TILE': - this._createDynamicTiledLayer(layerInfo, addedCallback); - break; - case 'CLOUD': - case 'XYZ': - url = mapUrls[layerInfo.layerType] - .replace('{googleMapsLanguage}', this.googleMapsLanguage) - .replace('{googleMapsAPIKey}', this.googleMapsAPIKey); - this._createXYZLayer(layerInfo, url, addedCallback); - break; - case 'BAIDU': - this._triggerEvent('notsupportbaidumap', {}); - addedCallback && addedCallback(); - break; - case 'MAPBOXSTYLE': - this._createMVTBaseLayer(layerInfo, addedCallback); // 添加矢量瓦片服务作为底图 - break; - } - } - - _initOverlayLayers(layers: any, _taskID: any): void { - // 存储地图上所有的图层对象 - if (this.expectLayerLen > 0) { - layers.forEach(layer => { - const type = this.webMapService.getDatasourceType(layer); - // TODO --- 暂不支持 SAMPLE_DATA - if (type === 'SAMPLE_DATA') { - this._addLayerSucceeded(); - this._triggerEvent('getlayerdatasourcefailed', { - error: 'SAMPLE DATA is not supported', - layer, - map: this.map - }); - return; - } - - if (layer.visibleScale) { - const { minScale, maxScale } = layer.visibleScale; - layer.minzoom = Math.max(this._transformScaleToZoom(minScale), 0); - layer.maxzoom = Math.min(24, this._transformScaleToZoom(maxScale) + 0.0000001); - } - - if (type === 'tile') { - this._initBaseLayer(layer, () => { - this._addLayerSucceeded(); - }); - if (layer.autoUpdateTime) { - this._layerTimerList.push( - setInterval(() => { - this._initBaseLayer(layer); - }, layer.autoUpdateTime) - ); - } - } else { - this.getLayerFeatures(layer, _taskID, type); - if (layer.autoUpdateTime) { - this._layerTimerList.push( - setInterval(() => { - this.getLayerFeatures(layer, _taskID, type); - }, layer.autoUpdateTime) - ); - } - } - }, this); - } - } - - _initOverlayLayer(layerInfo: any, features: any = [], mergeByField?: string) { - const { layerID, layerType, visible, style, featureType, projection } = layerInfo; - layerInfo.visible = visible ? 'visible' : 'none'; - features = this.mergeFeatures(layerID, features, mergeByField); - if (layerType === 'restMap') { - this._createRestMapLayer(features, layerInfo); - return; - } - if (layerType === 'mvt') { - this._createMvtLayer(features.info, layerInfo, features.featureType); - return; - } - - // mbgl 目前不能处理 geojson 复杂面情况 - // mbgl isssue https://github.com/mapbox/mapbox-gl-js/issues/7023 - if (features && features[0] && features[0].geometry && features[0].geometry.type === 'Polygon') { - features = handleMultyPolygon(features); - } - - if ( - features && - projection && - (projection !== this.baseProjection || projection === 'EPSG:3857' || projection === 'EPSG:-1000') && - layerInfo.dataSource && - layerInfo.dataSource.type !== 'REST_DATA' - ) { - this._unprojectProjection = this._defineProj4(projection); - features = this.transformFeatures(features); - } - - features = this.handleLayerFeatures(features, layerInfo); - - if (layerType === 'VECTOR') { - if (featureType === 'POINT') { - if (style.type === 'SYMBOL_POINT') { - this._createSymbolLayer(layerInfo, features); - } else { - this._createGraphicLayer(layerInfo, features); - } - } else { - // 线和面 - this._createVectorLayer(layerInfo, features); - // 不在 _createVectorLayer 里面处理 layerAdded++ 的原因:_createDataflowLayer 也调用了_createVectorLayer ,会导致layerAdded > expectLayerLen - this._addLayerSucceeded({ layerInfo, features }); - } - } else if (layerType === 'UNIQUE') { - this._createUniqueLayer(layerInfo, features); - } else if (layerType === 'RANGE') { - this._createRangeLayer(layerInfo, features); - } else if (layerType === 'HEAT') { - this._createHeatLayer(layerInfo, features); - } else if (layerType === 'MARKER') { - this._createMarkerLayer(layerInfo, features); - } else if (layerType === 'MIGRATION') { - this._createMigrationLayer(layerInfo, features); - } else if (layerType === 'RANK_SYMBOL') { - this._createRankSymbolLayer(layerInfo, features); - } else if (layerType === 'DATAFLOW_POINT_TRACK' || layerType === 'DATAFLOW_HEAT') { - this._createDataflowLayer(layerInfo); - } - } - - _initGraticuleLayer(graticuleInfo: any) { - const options = this._createGraticuleOptions(graticuleInfo); - const graticuleLayers = new mapboxgl.supermap.GraticuleLayer(options); - this.map.addLayer(graticuleLayers); - this._setGraticuleDash(graticuleInfo.lineDash, graticuleLayers); - } - - private _createGraticuleOptions(graticuleInfo) { - let { extent, lonLabelStyle, latLabelStyle } = graticuleInfo; - const { strokeColor, lineDash, strokeWidth, interval } = graticuleInfo; - const strokeStyle = { - lineColor: strokeColor, - lindDasharray: lineDash, - lineWidth: strokeWidth - }; - lonLabelStyle = { - textFont: lonLabelStyle.fontFamily.split(','), - textSize: lonLabelStyle.fontSize, - textAnchor: latLabelStyle.textBaseline, - textColor: lonLabelStyle.fill, - textHaloColor: lonLabelStyle.outlineColor, - textHaloWidth: lonLabelStyle.outlineWidth - }; - latLabelStyle = { - textFont: latLabelStyle.fontFamily.split(','), - textSize: latLabelStyle.fontSize, - textAnchor: latLabelStyle.textBaseline, - textColor: latLabelStyle.fill, - textHaloColor: latLabelStyle.outlineColor, - textHaloWidth: latLabelStyle.outlineWidth - }; - // @ts-ignore - extent = extent || this.map.getCRS().extent; - extent = [this._unproject([extent[0], extent[1]]), this._unproject([extent[2], extent[3]])]; - return { - minZoom: 1, - strokeStyle, - extent, - interval: interval && interval[0], - lngLabelStyle: lonLabelStyle, - latLabelStyle - }; - } - - private _setGraticuleDash(lindDasharray, graticuleLayers) { - this.map.on('zoomend', () => { - if (this.map.getZoom() < 3) { - graticuleLayers.setStrokeStyle({ lindDasharray: [0.1, 3] }); - } else { - graticuleLayers.setStrokeStyle({ lindDasharray }); - } - }); - } - - private _createTiandituLayer(mapInfo: any, addedCallback?: Function): void { - const tiandituUrls = this._getTiandituUrl(mapInfo); - const { labelLayerVisible, name, visible } = mapInfo.baseLayer; - const isLabel = Boolean(labelLayerVisible); - const labelUrl = tiandituUrls.labelUrl; - const tiandituUrl = tiandituUrls.tiandituUrl; - this._addBaselayer(tiandituUrl, name, visible); - isLabel && this._addBaselayer(labelUrl, `${name}-label`, visible); - addedCallback && addedCallback(); - } - - private _createWMTSLayer(layerInfo, addedCallback?: Function): void { - this.webMapService - // @ts-ignore - .getWmtsInfo(layerInfo, this.map.getCRS().epsgCode) - .then( - (result: any) => { - const layerId = layerInfo.layerID || layerInfo.name; - if (result.isMatched) { - const wmtsUrl = this._getWMTSUrl(Object.assign({}, layerInfo, result)); - this._addBaselayer( - [wmtsUrl], - layerId, - layerInfo.visible, - result.matchMinZoom, - result.matchMaxZoom, - false, - result.bounds - ); - addedCallback && addedCallback(); - } - }, - error => { - addedCallback && addedCallback(); - throw new Error(error); - } - ) - .catch(error => { - /** - * @event WebMapViewModel#getmapinfofailed - * @description 获取地图信息失败。 - * @property {Object} error - 失败原因。 - */ - this._triggerEvent('getmapinfofailed', { error }); - }); - } - - private async _createBingLayer(layerName: string, layerInfo: any, addedCallback?: Function): Promise { - let metaInfoUrl = - `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/RoadOnDemand?uriScheme=https&include=ImageryProviders&key=${this.bingMapsKey}&c=zh-cn`; - const metaInfo = await this._fetchRequest(metaInfoUrl, 'json', { - withoutFormatSuffix: true - }); - if ( - metaInfo.statusCode !== 200 || - metaInfo.resourceSets.length !== 1 || - metaInfo.resourceSets[0].resources.length !== 1 - ) { - return; - } - const resource = metaInfo.resourceSets[0].resources[0]; - const urls = []; - resource.imageUrlSubdomains.map(function (subdomain) { - const imageUrl = resource.imageUrl - .replace('{subdomain}', subdomain); - urls.push(imageUrl); - }); - - // @ts-ignore - this._addBaselayer(urls, layerName, layerInfo.visible); - addedCallback && addedCallback(); - } - - private _createXYZLayer(layerInfo: any, url: string, addedCallback?: Function): void { - let urlArr: string[] = []; - - if (layerInfo.layerType === 'OSM') { - const res = url.match(/\w\-\w/g)[0]; - const start = res[0]; - const end = res[2]; - let alphabet = ''; - for (let i = 97; i < 123; i++) { - alphabet += String.fromCharCode(i); - } - const alphabetArr = alphabet.split(''); - - const startIndex = alphabetArr.indexOf(start); - const endIndex = alphabetArr.indexOf(end); - - const res3 = alphabetArr.slice(startIndex, endIndex + 1); - - for (let i = 0; i < res3.length; i++) { - const replaceRes = url.replace(/{\w\-\w}/g, res3[i]); - urlArr.push(replaceRes); - } - } else if (layerInfo.layerType === 'GOOGLE_CN') { - const res = url.match(/\d\-\d/g)[0]; - const start = parseInt(res[0]); - const end = parseInt(res[2]); - - for (let i = start; i <= end; i++) { - const replaceRes = url.replace(/{\d\-\d}/g, i.toString()); - urlArr.push(replaceRes); - } - } else { - urlArr = [url]; - } - const layerId = layerInfo.layerID || layerInfo.name; - this._addBaselayer(urlArr, layerId, layerInfo.visible); - addedCallback && addedCallback(); - } - - private _createDynamicTiledLayer(layerInfo: any, addedCallback?: Function): void { - const url = layerInfo.url; - const layerId = layerInfo.layerID || layerInfo.name; - const { minzoom, maxzoom } = layerInfo; - this._addBaselayer([url], layerId, layerInfo.visible, minzoom, maxzoom, true); - addedCallback && addedCallback(); - } - - private _createWMSLayer(layerInfo: any, addedCallback?: Function): void { - this.webMapService - // @ts-ignore - .getWmsInfo(layerInfo) - .then( - (result: any) => { - const layerId = layerInfo.layerID || layerInfo.name; - if (result) { - const wmsUrl = this._getWMSUrl(layerInfo, result.version); - this._addBaselayer([wmsUrl], layerId, layerInfo.visible); - addedCallback && addedCallback(); - } - }, - error => { - addedCallback && addedCallback(); - throw new Error(error); - } - ) - .catch(error => { - /** - * @event WebMapViewModel#getmapinfofailed - * @description 获取地图信息失败。 - * @property {Object} error - 失败原因。 - */ - this._triggerEvent('getmapinfofailed', { error }); - }); - } - - private _createVectorLayer(layerInfo: any, features: any): void { - const type = layerInfo.featureType; - const { layerID, minzoom, maxzoom, style, visible } = layerInfo; - const layerSource = this.map.getSource(layerID); - const sourceData: GeoJSON.FeatureCollection = { - type: 'FeatureCollection', - features: features - }; - if (!layerSource) { - const source: mapboxglTypes.GeoJSONSourceRaw = { - type: 'geojson', - data: sourceData - }; - this.map.addSource(layerID, source); - } else { - // @ts-ignore - layerSource.setData(sourceData); - } - const styleArr = Array.isArray(style) ? style : [style]; - if (styleArr.length === 2) { - // 道路 - if (styleArr[0].lineDash === 'solid' && styleArr[1].lineDash === 'solid') { - styleArr[0].strokeWidth = styleArr[1].strokeWidth; - styleArr[1].strokeWidth = styleArr[1].strokeWidth - 2; - } - // 铁路 - if (styleArr[0].lineDash === 'solid' && styleArr[1].lineDash === 'dash') { - styleArr[0].strokeWidth = styleArr[1].strokeWidth; - styleArr[1].strokeWidth = styleArr[1].strokeWidth * 0.5; - styleArr[1].lineDash = 'dashrailway'; - } - } - styleArr.forEach((element, index) => { - const layerStyle = { - style: this._transformStyleToMapBoxGl(element, type), - layout: { - visibility: visible - } - }; - const newLayerID = index === 0 ? layerID : `${layerID}-additional-${index}`; - this._addOverlayToMap(type, layerID, newLayerID, layerStyle, minzoom, maxzoom); - }); - // 如果面有边框 - type === 'POLYGON' && - style.strokeColor && - this._addStrokeLineForPoly(style, layerID, layerID + '-strokeLine', visible, minzoom, maxzoom); - } - - private _getWMSUrl(mapInfo: any, version = '1.1.1'): string { - let url = mapInfo.url; - const options: any = { - service: 'WMS', - request: 'GetMap', - layers: - mapInfo.layers !== null && typeof mapInfo.layers === 'object' - ? mapInfo.layers.join(',') - : mapInfo.layers || '0', // 如果是多个图层,用逗号分隔 - styles: '', - format: 'image/png', - transparent: 'true', - version, - width: 256, - height: 256 - }; - if (version === '1.3.0') { - options.bbox = this.baseProjection === 'EPSG:4326' ? '{bbox-wms-1.3.0}' : '{bbox-epsg-3857}'; - options.crs = this.baseProjection; - } else { - options.bbox = '{bbox-epsg-3857}'; - options.srs = this.baseProjection; - } - return SuperMap.Util.urlAppend(url, this._getParamString(options, url)); - } - - private _setLayerID(mapInfo): Array { - const sumInfo: Object = {}; - const { baseLayer, layers = [] } = mapInfo; - if (!this.checkSameLayer) { - const baseInfo = this._generateUniqueLayerId(baseLayer.name, 0); - baseLayer.title = baseLayer.name; - baseLayer.name = baseInfo.newId; - } - const layerNames = layers.map(layer => layer.name); - const _layers: Array = layers.map((layer, index) => { - if (!(layer.name in sumInfo)) { - sumInfo[layer.name] = baseLayer.name === layer.name ? 1 : 0; - } - const matchFirstIndex = layerNames.indexOf(layer.name); - const matchLastIndex = layerNames.lastIndexOf(layer.name); - if (index > matchFirstIndex && index <= matchLastIndex) { - sumInfo[layer.name] = sumInfo[layer.name] + 1; - } - let layerID = sumInfo[layer.name] ? `${layer.name}-${sumInfo[layer.name]}` : layer.name; - if (!this.checkSameLayer || layer.layerType !== 'raster') { - const { newId, newIndex } = this._generateUniqueLayerId(layerID, sumInfo[layer.name]); - sumInfo[layer.name] = newIndex; - layerID = newId; - } - return Object.assign(layer, { layerID }); - }); - mapInfo.layers = _layers; - mapInfo.baseLayer = baseLayer; - return mapInfo; - } - - private _generateUniqueLayerId(newId, index) { - if (this.map.getLayer(newId)) { - index++; - // 判断是否带有-index后缀 - if (newId.match(/-\d+&/gi)) { - newId = newId.replace(/\d+$/gi, index); - } else { - newId = `${newId}-${index}`; - } - return this._generateUniqueLayerId(newId, index); - } else { - return { newId, newIndex: index }; - } - } - - _createRestMapLayer(restMaps, layer) { - restMaps.forEach(restMapInfo => { - layer = this.getRestMapLayerInfo(restMapInfo, layer); - this._initBaseLayer(layer); - }); - this._addLayerSucceeded(); - } - - _addLayerSucceeded(options?: { layerInfo: Record; features: GeoJSON.Feature[] }) { - if (options?.layerInfo?.labelStyle?.labelField && options.layerInfo.layerType !== 'DATAFLOW_POINT_TRACK') { - // 存在标签专题图 - this._addLabelLayer(options.layerInfo, options.features, false); - } - this.layerAdded++; - this._sendMapToUser(this.layerAdded, this.expectLayerLen); - } - - private _createDataflowLayer(layerInfo) { - const dataflowService = new mapboxgl.supermap.DataFlowService(layerInfo.wsUrl).initSubscribe(); - this._handleDataflowFeaturesCallback = this._handleDataflowFeatures.bind(this, layerInfo); - this._initDataflowLayerCallback = this._initDataflowLayer.bind(this, layerInfo); - dataflowService.on('subscribesucceeded', this._initDataflowLayerCallback); - dataflowService.on('messageSucceeded', this._handleDataflowFeaturesCallback); - this._dataflowService = dataflowService; - } - - private _initDataflowLayer() { - this._addLayerSucceeded(); - } - - private _handleDataflowFeatures(layerInfo, e) { - let features = [JSON.parse(e.data)]; - // this.transformFeatures([features]); // TODO 坐标系 - this._triggerEvent('dataflowfeatureupdated', { - features, - identifyField: layerInfo.identifyField, - layerID: layerInfo.layerID - }); - - if (layerInfo.projection === 'EPSG:3857') { - features = this.transformFeatures(features); - } - if (layerInfo.filterCondition) { - // 过滤条件 - let condition = this.replaceFilterCharacter(layerInfo.filterCondition); - const properties = features[0].properties || {}; - condition = this.parseCondition(condition, Object.keys(properties)); - const filterFeature = this.parseConditionFeature(properties); - const sql = 'select * from json where (' + condition + ')'; - const filterResult = window.jsonsql.query(sql, { attributes: filterFeature }); - if (filterResult && filterResult.length > 0) { - this._addDataflowLayer(layerInfo, features[0]); - } - } else { - this._addDataflowLayer(layerInfo, features[0]); - } - } - - private _getDataFlowRotateStyle(features, directionField, identifyField) { - const iconRotateExpression = ['match', ['get', identifyField]]; - features.forEach(feature => { - let value; - if (directionField !== undefined && directionField !== '未设置' && directionField !== 'None') { - value = feature.properties[directionField]; - } else { - value = 0; - } - if (value > 360 || value < 0) { - return null; - } - // @ts-ignore - iconRotateExpression.push(feature.properties[identifyField], parseInt(value)); - }); - // @ts-ignore - iconRotateExpression.push(0); - return iconRotateExpression; - } - - private async _addDataflowLayer(layerInfo, feature) { - const layerID = layerInfo.layerID; - if (layerInfo.layerType === 'DATAFLOW_HEAT') { - if (!this.map.getSource(layerID)) { - this._createHeatLayer(layerInfo, [feature], false); - } else { - this._updateDataFlowFeature(layerID, feature, layerInfo); - } - } else { - const layerStyle = layerInfo.pointStyle; - layerInfo.style = layerStyle; - if (!this.map.getSource(layerID)) { - const iconRotateExpression = this._getDataFlowRotateStyle( - [feature], - layerInfo.directionField, - layerInfo.identifyField - ); - if (['BASIC_POINT', 'SVG_POINT', 'IMAGE_POINT'].includes(layerStyle.type)) { - await this._createGraphicLayer(layerInfo, [feature], null, iconRotateExpression, false); - } else { - this._createSymbolLayer(layerInfo, [feature], null, iconRotateExpression, false); - } - } else { - this._updateDataFlowFeature(layerID, feature, layerInfo, 'point'); - } - if (layerInfo.labelStyle && layerInfo.visible) { - if (!this.map.getSource(layerID + '-label')) { - this._addLabelLayer(layerInfo, [feature], true); - } else { - this._updateDataFlowFeature(layerID + '-label', feature, layerInfo); - } - } - if (layerInfo.lineStyle && layerInfo.visible) { - if (!this.map.getSource(layerID + '-line')) { - const geometry = feature.geometry.coordinates; - const lineFeature = { - type: 'Feature', - properties: feature.properties, - geometry: { - type: 'LineString', - coordinates: [geometry] - } - }; - this._createVectorLayer( - { style: layerInfo.lineStyle, featureType: 'LINE', visible: 'visible', layerID: layerID + '-line' }, - [lineFeature] - ); - } else { - this._updateDataFlowFeature(layerID + '-line', feature, layerInfo, 'line'); - } - } - } - } - - private _updateDataFlowFeature(sourceID, newFeature, layerInfo, type?) { - const { identifyField, maxPointCount, directionField } = layerInfo; - // @ts-ignore - const features = cloneDeep(this.map.getSource(sourceID)._data.features); - let has = false; - features.map((item, index) => { - if (item.properties[identifyField] === newFeature.properties[identifyField]) { - has = true; - if (type === 'line') { - const coordinates = item.geometry.coordinates; - coordinates.push(newFeature.geometry.coordinates); - if (maxPointCount && coordinates.length > maxPointCount) { - coordinates.splice(0, coordinates.length - maxPointCount); - } - features[index].geometry.coordinates = coordinates; - } else { - features[index] = newFeature; - } - } - }); - if (!has) { - if (type === 'line') { - features.push({ - type: 'Feature', - properties: newFeature.properties, - geometry: { - type: 'LineString', - coordinates: [newFeature.geometry.coordinates] - } - }); - } else { - features.push(newFeature); - } - } - // @ts-ignore - this.map.getSource(sourceID).setData({ type: 'FeatureCollection', features }); - if (type === 'point') { - const type = layerInfo.pointStyle.type; - const iconRotateExpression = this._getDataFlowRotateStyle(features, directionField, identifyField); - if (['SVG_POINT', 'IMAGE_POINT'].includes(type)) { - this.map.setLayoutProperty(sourceID, 'icon-rotate', iconRotateExpression); - } else if (type === 'SYMBOL_POINT') { - this.map.setLayoutProperty(sourceID, 'text-rotate', iconRotateExpression); - } - } - } - - private _createMigrationLayer(layerInfo, features) { - const { layerID, layerType } = layerInfo; - // @ts-ignore - window.echarts = echarts; - const options = this.getEchartsLayerOptions(layerInfo, features, 'GLMap'); - // @ts-ignore - options.GLMap = { roam: true }; - const echartslayer = new EchartsLayer(this.map); - echartslayer.chart.setOption(options); - this.echartslayer.push(echartslayer); - this._addLayer({ - id: layerID, - type: layerType, - setLayoutProperty(name, value) { - if (name === 'visibility') { - if (value === 'visible') { - echartslayer.chart._dom.style.display = 'block'; - } else { - echartslayer.chart._dom.style.display = 'none'; - } - } - } - }); - this._addLayerSucceeded({ layerInfo, features }); - } - - private _createRankSymbolLayer(layerInfo, features) { - const { minzoom, maxzoom } = layerInfo; - const fieldName = layerInfo.themeSetting.themeField; - const colors = layerInfo.themeSetting.colors; - const style = layerInfo.style; - const featureType = layerInfo.featureType; - const styleSource: any = this.createRankStyleSource(layerInfo, features); - const styleGroups = styleSource.styleGroups; - features = this.getFilterFeatures(layerInfo.filterCondition, features); - // 获取 expression - const expression = ['match', ['get', 'index']]; - const colorExpression = ['match', ['get', 'index']]; - for (let index = 0; index < features.length; index++) { - const row = features[index]; - const tartget = parseFloat(row.properties[fieldName]); - if (styleGroups) { - for (let i = 0; i < styleGroups.length; i++) { - if (styleGroups[i].start <= tartget && tartget < styleGroups[i].end) { - const radius = - style.type === 'SYMBOL_POINT' || style.type === 'IMAGE_POINT' - ? style.type === 'SYMBOL_POINT' - ? styleGroups[i].radius * 2 - : Number.parseFloat((styleGroups[i].radius / style.imageInfo.size.h).toFixed(2)) * 2 - : styleGroups[i].radius; - expression.push(row.properties.index, radius); - colorExpression.push(row.properties.index, styleGroups[i].color); - break; - } - } - } - } - // @ts-ignore - expression.push(1); - colorExpression.push('rgba(0, 0, 0, 0)'); - // 图例处理 - this._initLegendConfigInfo(layerInfo, styleGroups); - if (colors && colors.length > 0) { - style.fillColor = colorExpression; - } - if (style.type === 'SYMBOL_POINT') { - this._createSymbolLayer(layerInfo, features, expression); - } else if (['SVG_POINT', 'IMAGE_POINT'].includes(style.type)) { - this._createGraphicLayer(layerInfo, features, expression); - } else { - const source: mapboxglTypes.GeoJSONSourceRaw = { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: features - } - }; - // 获取样式 - const layerStyle: any = { - layout: { - visibility: layerInfo.visible - } - }; - layerStyle.style = this._transformStyleToMapBoxGl(layerInfo.style, featureType, expression, 'circle-radius'); - const layerID = layerInfo.layerID; - this._addOverlayToMap(featureType, source, layerID, layerStyle, minzoom, maxzoom); - this._addLayerSucceeded({ layerInfo, features }); - } - } - - private _addTextBackgroundImage(rgba: Array): string { - if (!rgba[3]) { - return ''; - } - const width = 20; // The image will be 64 pixels square. - const bytesPerPixel = 4; // Each pixel is represented by 4 bytes: red, green, blue, and alpha. - const data = new Uint8Array(width * width * bytesPerPixel); - - for (let x = 0; x < width; x++) { - for (let y = 0; y < width; y++) { - const offset = (y * width + x) * bytesPerPixel; - data[offset + 0] = rgba[0]; // red - data[offset + 1] = rgba[1]; // green - data[offset + 2] = rgba[2]; // blue - data[offset + 3] = rgba[3] * 255; // alpha - } - } - const imageId = `text-background-${rgba.join('-')}`; - if (!this.map.hasImage(imageId)) { - this.map.addImage( - imageId, - { width: width, height: width, data: data }, - { - // @ts-ignore - stretchX: [[0, 20]], - stretchY: [[0, 20]], - content: [0, 0, 20, 20] - } - ); - } - return imageId; - } - - private _addLabelLayer(layerInfo: any, features: any, addSource = false): void { - const labelLayerId = `${layerInfo.layerID}-label`; - if (this.map.getLayer(labelLayerId)) { - return; - } - const labelStyle = layerInfo.labelStyle; - const properties = features[0]?.properties; - const textField = labelStyle.labelField.replace(/{(.+)}/g, '$1'); - if (!properties || !properties[textField]) { - return; - } - let { backgroundFill } = labelStyle; - const fontFamily = labelStyle.fontFamily; - const { minzoom, maxzoom } = layerInfo; - const textSize = parseFloat(labelStyle.fontSize || 14); - let textBackgroundImageId = ''; - if (labelStyle.placement !== 'line') { - textBackgroundImageId = this._addTextBackgroundImage(backgroundFill); - } - backgroundFill = `rgba(${backgroundFill.join(',')})`; - let textHaloColor = 'rgba(255,255,255,0)'; - if (labelStyle.outlineColor && labelStyle.outlineWidth > 0) { - textHaloColor = labelStyle.outlineColor; - } - - let textHaloWidth = (labelStyle.outlineWidth || 0) / 2; - let textAnchor = labelStyle.textAlign || 'center'; - if (labelStyle.textBaseline && labelStyle.textBaseline !== 'middle') { - textAnchor = `${labelStyle.textBaseline}${textAnchor === 'center' ? '' : `-${textAnchor}`}`; - } - - const textOffset = - layerInfo.featureType === 'POINT' - ? [labelStyle.offsetX / textSize || 0, labelStyle.offsetY / textSize || 0] - : [0, 0]; - const layout = { - 'text-field': `{${labelStyle.labelField}}`, - 'text-size': textSize, - 'text-offset': textOffset, - 'text-font': fontFamily ? [fontFamily] : ['DIN Offc Pro Italic', 'Arial Unicode MS Regular'], - 'symbol-placement': - labelStyle.placement === 'line' ? (layerInfo.featureType === 'POLYGON' ? 'line' : 'line-center') : 'point', - 'text-max-angle': layerInfo.featureType === 'POLYGON' ? 40 : 30, - 'symbol-spacing': layerInfo.featureType === 'POLYGON' ? 200 : 50, - 'text-anchor': textAnchor, - 'text-line-height': 1.2, - visibility: layerInfo.visible - }; - if (textBackgroundImageId) { - Object.assign(layout, { - 'icon-image': textBackgroundImageId, - 'icon-allow-overlap': true, - 'icon-text-fit': 'both', - 'icon-text-fit-padding': [2, 4, 2, 4] - }); - } - this._addLayer({ - id: labelLayerId, - type: 'symbol', - source: - this.map.getSource(layerInfo.layerID) && !addSource - ? layerInfo.layerID - : { type: 'geojson', data: { type: 'FeatureCollection', features: features } }, - paint: { - 'text-color': labelStyle.fill, - 'text-halo-color': textHaloColor, - 'text-halo-width': textHaloWidth - }, - layout, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }); - } - - private _createSymbolLayer( - layerInfo: any, - features: any, - textSizeExpresion?, - textRotateExpresion?, - addToMap = true, - filter? - ): void { - // 用来请求symbol_point字体文件 - const target = document.getElementById(`${this.target}`); - target.classList.add('supermapol-icons-map'); - const { layerID, minzoom, maxzoom, style } = layerInfo; - const unicode = style.unicode; - const text = String.fromCharCode(parseInt(unicode.replace(/^&#x/, ''), 16)); - const textSize = - textSizeExpresion || - (Array.isArray(style.fontSize) ? style.fontSize : (style.fontSize && parseFloat(style.fontSize)) || 12); - const rotate = Array.isArray(style.rotation) ? style.rotation : ((style.rotation || 0) * 180) / Math.PI; - if (!this.map.getSource(layerID)) { - this.map.addSource(layerID, { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: [] - } - }); - } - const layerOptions: any = { - id: layerID, - type: 'symbol', - source: layerID, - paint: { - 'text-color': Array.isArray(style.fillColor) - ? style.fillColor - : getColorWithOpacity(style.fillColor, style.fillOpacity), - // 'text-opacity': style.fillOpacity === 0 ? 0.1 : style.fillOpacity, - 'text-halo-color': Array.isArray(style.strokeColor) - ? style.strokeColor - : getColorWithOpacity(style.strokeColor || 'rgba(0,0,0,0)', style.strokeOpacity), - 'text-halo-width': style.strokeWidth || 0 - }, - layout: { - 'text-field': text, - 'text-size': textSize, - 'text-font': ['supermapol-icons'], - 'text-rotate': textRotateExpresion || rotate || 0, - 'text-offset': Array.isArray(style.offsetX) ? style.offsetX : [style.offsetX / 2 || 0, style.offsetY / 2 || 0], - 'text-allow-overlap': true, - visibility: layerInfo.visible - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }; - if (filter) { - layerOptions.filter = filter; - } - this._addLayer(layerOptions); - // @ts-ignore - this.map.getSource(layerID).setData({ - type: 'FeatureCollection', - features: features - }); - if (addToMap) { - this._addLayerSucceeded({ layerInfo, features }); - } - } - - private async _createGraphicLayer( - layerInfo: any, - features: any, - iconSizeExpression?, - iconRotateExpression?, - addToMap = true, - filter? - ): Promise { - return new Promise(resolve => { - const { layerID, minzoom, maxzoom, style } = layerInfo; - - const source: mapboxglTypes.GeoJSONSourceRaw = { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: features - } - }; - if (!this.map.getSource(layerID)) { - this.map.addSource(layerID, source); - } else { - // @ts-ignore - this.map.getSource(layerID).setData(source.data); - } - const iconID = `imageIcon-${layerID}`; - if (style.type === 'IMAGE_POINT') { - const imageInfo = style.imageInfo; - this.map.loadImage(imageInfo.url, (error, image) => { - if (error) { - console.error(error); - return; - } - const iconSize = Number.parseFloat((style.radius / image.width).toFixed(2)) * 2; - !this.map.hasImage(iconID) && this.map.addImage(iconID, image); - const layerOptions: any = { - id: layerID, - type: 'symbol', - source: layerID, - layout: { - 'icon-image': iconID, - 'icon-anchor': 'bottom-right', - 'icon-size': iconSizeExpression || iconSize, - 'icon-allow-overlap': true, - visibility: layerInfo.visible, - 'icon-offset': [style.offsetX * image.width || 0, style.offsetY * image.height || 0], - 'icon-rotate': iconRotateExpression || ((layerInfo.style.rotation || 0) * 180) / Math.PI - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }; - if (filter) { - layerOptions.filter = filter; - } - this._addLayer(layerOptions); - if (addToMap) { - this._addLayerSucceeded({ layerInfo, features }); - } - resolve(); - }); - } else if (style.type === 'SVG_POINT') { - const svgUrl = style.url; - if (!this._svgDiv) { - this._svgDiv = document.createElement('div'); - document.body.appendChild(this._svgDiv); - } - this.getCanvasFromSVG(svgUrl, this._svgDiv, canvas => { - // this.handleSvgColor(style, canvas); - const imgUrl = canvas.toDataURL('img/png'); - imgUrl && - this.map.loadImage(imgUrl, (error, image) => { - if (error) { - console.log(error); - } - const iconSize = Number.parseFloat((style.radius / canvas.width).toFixed(2)) * 2; - if (iconSizeExpression && Array.isArray(iconSizeExpression)) { - iconSizeExpression = iconSizeExpression.map((item, index) => { - if (typeof item === 'number' && index % 2 === 1) { - return (item / canvas.width) * 2; - } - return item; - }); - } - !this.map.hasImage(svgUrl) && this.map.addImage(svgUrl, image, { sdf: true }); - const layerOptions: any = { - id: layerID, - type: 'symbol', - source: layerID, - layout: { - 'icon-image': svgUrl, - 'icon-size': iconSizeExpression || iconSize, - 'icon-anchor': 'bottom-right', - visibility: layerInfo.visible, - 'icon-offset': [style.offsetX * canvas.width || 0, style.offsetY * canvas.height || 0], - 'icon-allow-overlap': true, - 'icon-rotate': iconRotateExpression || ((layerInfo.style.rotation || 0) * 180) / Math.PI - }, - paint: { - 'icon-color': style.fillColor - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }; - if (filter) { - layerOptions.filter = filter; - } - this._addLayer(layerOptions); - if (addToMap) { - this._addLayerSucceeded({ layerInfo, features }); - } - resolve(); - }); - }); - } else { - const layerStyle = { - style: this._transformStyleToMapBoxGl(style, layerInfo.featureType), - layout: { - visibility: layerInfo.visible - } - }; - this._addOverlayToMap('POINT', layerID, layerID, layerStyle, minzoom, maxzoom); - if (addToMap) { - this._addLayerSucceeded({ layerInfo, features }); - } - resolve(); - } - }); - } - - private async _createUniqueLayer(layerInfo: any, features: any): Promise { - const symbolConvertFunctionFactory = { - unicode: ({ unicode }): string => { - return String.fromCharCode(parseInt(unicode.replace(/^&#x/, ''), 16)); - }, - fontSize: ({ fontSize }): number => { - if (fontSize) { - return parseFloat(fontSize); - } - return 12; - }, - rotation: ({ rotation }): number => { - return ((rotation || 0) * 180) / Math.PI; - }, - fillColor: ({ fillColor, fillOpacity }): string => { - return getColorWithOpacity(fillColor, fillOpacity); - }, - strokeColor: ({ strokeColor, strokeOpacity }): string => { - return getColorWithOpacity(strokeColor || 'rgba(0,0,0,0)', strokeOpacity); - }, - strokeWidth: ({ strokeWidth }): string => { - return strokeWidth || 0; - }, - offsetX: ({ offsetX, offsetY }): [number, number] => { - return [offsetX / 2 || 0, offsetY / 2 || 0]; - } - }; - const defaultValueFactory = { - unicode: '', - fontSize: 12, - rotation: 0, - strokeColor: 'rgba(0,0,0,0)', - fillColor: 'rgba(0,0,0,0)', - strokeWidth: 0, - offsetX: [0, 0] - }; - const styleGroup = this.getUniqueStyleGroup(layerInfo, features); - features = this.getFilterFeatures(layerInfo.filterCondition, features); - const { layerID, minzoom, maxzoom, style } = layerInfo; - const themeField = styleGroup[0].themeField; - const type = layerInfo.featureType; - - const defultLayerStyle = layerInfo.style; - // 样式expression池 样式key值为webmap的样式key值 - const expressionMap: any = {}; - // 自定义单值值对应的样式 - const customStyleMap = {}; - styleGroup.forEach(style => { - customStyleMap[style.value] = style; - }); - // 遍历要素,判断该要素是不是在自定义单值中,若是在对应样式match expression中增加改要素的索引 - features.forEach(({ properties }) => { - const customStyle = customStyleMap[properties[themeField]]; - if (customStyle) { - const itemStyle = customStyle.style; - for (const key in itemStyle) { - if (Object.prototype.hasOwnProperty.call(itemStyle, key)) { - const itemStyleElement = itemStyle[key]; - if (itemStyleElement !== defultLayerStyle[key]) { - if (!expressionMap[key]) { - expressionMap[key] = ['match', ['get', 'index']]; - } - expressionMap[key].push( - properties.index, - symbolConvertFunctionFactory[key] ? symbolConvertFunctionFactory[key](itemStyle) : itemStyleElement - ); - } - } - } - } - }); - // 给每个expression增加最后一个默认值 - for (const key in expressionMap) { - if (Object.prototype.hasOwnProperty.call(expressionMap, key)) { - const expression = expressionMap[key]; - if (!Array.isArray(expression)) { - continue; - } - const defaultStyleItem = defultLayerStyle[key] || defaultValueFactory[key]; - const styleItem = { [key]: defaultStyleItem }; - // 从customsetting里取了透明度和color一起处理了,layerinfo.style里的透明度就不需要了 - if (key === 'fillColor') { - expressionMap['fillOpacity'] = 1; - styleItem['fillOpacity'] = isNaN(defultLayerStyle['fillOpacity']) ? 1 : defultLayerStyle['fillOpacity']; - } - if (key === 'strokeColor') { - expressionMap['strokeOpacity'] = 1; - styleItem['strokeOpacity'] = isNaN(defultLayerStyle['strokeOpacity']) ? 1 : defultLayerStyle['strokeOpacity']; - } - const fn = symbolConvertFunctionFactory[key]; - expression.push(defaultStyleItem === undefined ? null : (fn && fn(styleItem)) || defaultStyleItem); - } - } - // Todo 图例相关 - this._initLegendConfigInfo(layerInfo, styleGroup); - - const source: mapboxglTypes.GeoJSONSourceRaw = { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: features - } - }; - const sourceID = layerID; - if (!this.map.getSource(sourceID)) { - this.map.addSource(sourceID, source); - } else { - // @ts-ignore - this.map.getSource(sourceID).setData(source.data); - } - - const visible = layerInfo.visible; - const layerCreateFcuntion = (type, sourceID, layerID, style, minzoom, maxzoom, filter?) => { - const layerStyle = { - style: this._transformStyleToMapBoxGl({ ...style }, type), - layout: { - visibility: visible - } - }; - this._addOverlayToMap(type, sourceID, layerID, layerStyle, minzoom, maxzoom, filter); - }; - if (['POLYGON', 'LINE'].includes(type)) { - // linedash不能用表达式处理,需用多个图层 - const lineDashExpression = expressionMap.lineDash; - // 非自定义要素过滤表达式 - const defaultFilterExpression: any = ['all']; - let handlerLine = false; - let fristName = ''; - if (lineDashExpression && lineDashExpression.length > 1) { - delete expressionMap.lineDash; - const filterField = lineDashExpression[1]; - const tempLayerID = type === 'POLYGON' ? layerID + '-strokeLine' : layerID; - for (let index = 2; index < lineDashExpression.length - 1; index += 2) { - const filterExpression = ['==', filterField, lineDashExpression[index]]; - defaultFilterExpression.push(['!=', filterField, lineDashExpression[index]]); - const additionalLayerName = `${tempLayerID}-additional-linedasharray-${index / 2}`; - if (!fristName) { - fristName = additionalLayerName; - } - layerCreateFcuntion( - 'LINE', - sourceID, - additionalLayerName, - { ...style, ...expressionMap, lineDash: lineDashExpression[index + 1] }, - minzoom, - maxzoom, - filterExpression - ); - } - if (defaultFilterExpression.length > 1) { - layerCreateFcuntion( - 'LINE', - sourceID, - tempLayerID, - { ...style, ...expressionMap, lineDash: lineDashExpression[lineDashExpression.length] }, - minzoom, - maxzoom, - defaultFilterExpression - ); - } - handlerLine = true; - } - // 没有自定义虚线的情况 - if (type === 'LINE' && !handlerLine) { - layerCreateFcuntion( - 'LINE', - sourceID, - layerID, - { ...style, ...expressionMap }, - minzoom, - maxzoom, - defaultFilterExpression - ); - } - // 面 - if (type === 'POLYGON') { - layerCreateFcuntion('POLYGON', sourceID, layerID, { ...style, ...expressionMap }, minzoom, maxzoom); - if (fristName) { - this.map.moveLayer(layerID, fristName); - } - // 面且没有虚线 - if (!handlerLine) { - layerCreateFcuntion( - 'LINE', - sourceID, - layerID + '-strokeLine', - { ...style, ...expressionMap }, - minzoom, - maxzoom, - defaultFilterExpression - ); - if (fristName) { - this.map.moveLayer(layerID + '-strokeLine', fristName); - } - } - } - } else { - const defaultFilterExpression: any = ['all']; - const unicodeExpression = expressionMap.unicode; - // SYMBOL_POINT - if (unicodeExpression) { - const classNameExpression = expressionMap.className || []; - delete expressionMap.unicode; - delete expressionMap.classname; - const additionalLayerName = `${layerID}-additional-symbol`; - const filterExpression: any = ['any']; - // defaultExpression.push(['!=', filterField, lineDashExpression[index]]); - for (let index = 2; index < classNameExpression.length - 1; index += 2) { - defaultFilterExpression.push(['!=', classNameExpression[1], classNameExpression[index]]); - filterExpression.push(['==', classNameExpression[1], classNameExpression[index]]); - } - // this._createSymbolLayer() - // 用来请求symbol_point字体文件 - const target = document.getElementById(`${this.target}`); - target.classList.add('supermapol-icons-map'); - const symbolStyle = { ...style, ...expressionMap }; - const layerOptions: any = { - id: additionalLayerName, - type: 'symbol', - source: sourceID, - paint: { - 'text-color': symbolStyle.fillColor, - // 'text-opacity': style.fillOpacity === 0 ? 0.1 : style.fillOpacity, - 'text-halo-color': symbolStyle.strokeColor, - 'text-halo-width': symbolStyle.strokeWidth - }, - layout: { - 'text-field': unicodeExpression, - 'text-size': - typeof symbolStyle.fontSize === 'string' ? parseInt(symbolStyle.fontSize) : symbolStyle.fontSize || 12, - 'text-font': ['supermapol-icons'], - 'text-rotate': symbolStyle.rotation || 0, - 'text-offset': Array.isArray(symbolStyle.offsetX) - ? symbolStyle.offsetX - : [symbolStyle.offsetX / 2 || 0, symbolStyle.offsetY / 2 || 0], - 'text-allow-overlap': true, - visibility: visible - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }; - if (filterExpression.length > 1) { - layerOptions.filter = filterExpression; - } - this._addLayer(layerOptions); - } - // IMAGE_POINT 或者 SVG_POINT - const imageInfoExpression = expressionMap.imageInfo || []; - const urlExpression = expressionMap.url || []; - if (imageInfoExpression.length > 0 || urlExpression.length > 0) { - delete expressionMap.imageInfo; - delete expressionMap.url; - const imageList = []; - // image表达式 和 过滤表达式 - const imageExpresssion = imageInfoExpression.length > 0 ? [imageInfoExpression[0], imageInfoExpression[1]] : []; - const svgExpresssion = urlExpression.length > 0 ? [urlExpression[0], urlExpression[1]] : []; - const imagefilterExpression: any = ['any']; - const svgfilterExpression: any = ['any']; - for (let index = 2; index < imageInfoExpression.length - 1; index += 2) { - const element = imageInfoExpression[index + 1]; - imageList.push(element.url); - imageExpresssion.push(imageInfoExpression[index]); - imageExpresssion.push(element.url); - defaultFilterExpression.push(['!=', imageInfoExpression[1], imageInfoExpression[index]]); - imagefilterExpression.push(['==', imageInfoExpression[1], imageInfoExpression[index]]); - } - for (let index = 2; index < urlExpression.length - 1; index += 2) { - const element = urlExpression[index + 1]; - imageList.push(element); - svgExpresssion.push(urlExpression[index]); - svgExpresssion.push(element); - defaultFilterExpression.push(['!=', urlExpression[1], urlExpression[index]]); - svgfilterExpression.push(['==', urlExpression[1], urlExpression[index]]); - } - imageExpresssion.push(''); - svgExpresssion.push(''); - - const loadImagePromise = src => { - return new Promise(resolve => { - if (src.indexOf('svg') < 0) { - this.map.loadImage(src, (error, image) => { - if (error) { - console.log(error); - resolve(error); - return; - } - !this.map.hasImage(src) && this.map.addImage(src, image); - resolve({ src, image }); - }); - } else { - if (!this._svgDiv) { - this._svgDiv = document.createElement('div'); - document.body.appendChild(this._svgDiv); - } - this.getCanvasFromSVG(src, this._svgDiv, canvas => { - this.handleSvgColor(defultLayerStyle, canvas); - this.map.loadImage(canvas.toDataURL('img/png'), (error, image) => { - if (error) { - console.log(error); - resolve(error); - return; - } - // sdf: true 可以设置icon-color - !this.map.hasImage(src) && this.map.addImage(src, image, { sdf: true }); - resolve({ src, image }); - }); - }); - } - }); - }; - const promiseList = []; - imageList.forEach(src => { - promiseList.push(loadImagePromise(src)); - }); - const symbolStyle = { ...style, ...expressionMap }; - await Promise.all(promiseList).then(images => { - const imageSize = {}; - const radiusMap = {}; - const radiusExpress = expressionMap.radius || []; - for (let index = 2; index < radiusExpress.length - 1; index += 2) { - radiusMap[radiusExpress[index]] = radiusExpress[index + 1]; - } - images.forEach(image => { - if (image && image.src) { - imageSize[image.src] = image.image.width; - } - }); - // icon-color在一个图层中能全起作用或者全不起作用 所以image和svg分两个图层 - // icon-size和图片大小有关系 - if (imageExpresssion.length > 1) { - const iconSizeExpression: any = ['match', ['get', 'index']]; - for (let index = 2; index < imageExpresssion.length - 1; index += 2) { - const featureIndex = imageExpresssion[index]; - const featureSrc = imageExpresssion[index + 1]; - const iconSize = - Number.parseFloat(((radiusMap[featureIndex] || 8) / imageSize[featureSrc]).toFixed(2)) * 2; - iconSizeExpression.push(featureIndex); - iconSizeExpression.push(iconSize); - } - iconSizeExpression.push(1); - - this._addLayer({ - id: `${layerID}-additional-image`, - type: 'symbol', - source: sourceID, - layout: { - 'icon-image': imageExpresssion, - 'icon-anchor': 'bottom-right', - 'icon-size': iconSizeExpression, - 'icon-allow-overlap': true, - visibility: layerInfo.visible, - 'icon-offset': symbolStyle.offsetX || [0, 0], - 'icon-rotate': symbolStyle.rotation || 0 - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22, - filter: imagefilterExpression - }); - } - if (svgExpresssion.length > 1) { - const iconSizeExpression: any = ['match', ['get', 'index']]; - for (let index = 2; index < svgExpresssion.length - 1; index += 2) { - const featureIndex = svgExpresssion[index]; - const featureSrc = svgExpresssion[index + 1]; - const iconSize = - Number.parseFloat(((radiusMap[featureIndex] || 8) / imageSize[featureSrc]).toFixed(2)) * 2; - iconSizeExpression.push(featureIndex); - iconSizeExpression.push(iconSize); - } - iconSizeExpression.push(1); - this._addLayer({ - id: `${layerID}-additional-svg`, - type: 'symbol', - source: sourceID, - layout: { - 'icon-image': svgExpresssion, - 'icon-anchor': 'bottom-right', - 'icon-size': 1, - 'icon-allow-overlap': true, - visibility: layerInfo.visible, - 'icon-offset': symbolStyle.offsetX || [0, 0], - 'icon-rotate': symbolStyle.rotation || 0 - }, - paint: { - 'icon-color': symbolStyle.fillColor - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22, - filter: svgfilterExpression - }); - } - }); - } - if (style.type === 'SYMBOL_POINT') { - const tmpLayerInfo = { ...layerInfo }; - tmpLayerInfo.style = { ...style, ...expressionMap, type: style.type }; - this._createSymbolLayer( - tmpLayerInfo, - features, - '', - '', - false, - defaultFilterExpression.length > 1 ? defaultFilterExpression : undefined - ); - } else if (style.type === 'IMAGE_POINT' || style.type === 'SVG_POINT') { - const tmpLayerInfo = { ...layerInfo }; - tmpLayerInfo.style = { ...style, ...expressionMap, type: style.type }; - await this._createGraphicLayer( - tmpLayerInfo, - features, - '', - '', - false, - defaultFilterExpression.length > 1 ? defaultFilterExpression : undefined - ); - } else { - layerCreateFcuntion( - 'POINT', - sourceID, - layerID, - { ...style, ...expressionMap }, - minzoom, - maxzoom, - defaultFilterExpression.length > 1 ? defaultFilterExpression : undefined - ); - } - } - this._addLayerSucceeded({ layerInfo, features }); - } - - private _getWMTSUrl(options: any): string { - if (options.requestEncoding === 'REST' && options.restResourceURL) { - return options.restResourceURL - .replace('{Style}', options.style || '') - .replace('{TileMatrixSet}', options.tileMatrixSet) - .replace('{TileRow}', '{y}') - .replace('{TileCol}', '{x}') - .replace('{TileMatrix}', '{z}'); - } - const obj = { - service: 'WMTS', - request: 'GetTile', - version: '1.0.0', - style: options.style || '', - layer: options.layer, - tilematrixSet: options.tileMatrixSet, - format: 'image/png', - tilematrix: '{z}', - tilerow: '{y}', - tilecol: '{x}' - }; - return SuperMap.Util.urlAppend(options.kvpResourceUrl, this._getParamString(obj, options.kvpResourceUrl)); - } - - private _createMarkerLayer(layerInfo: any, features: any): void { - const { minzoom, maxzoom } = layerInfo; - const markerLayerID = layerInfo.layerID; - const markerSrc = {}; - features = features || []; - features.forEach((feature: any, index: number) => { - const defaultStyle = feature.dv_v5_markerStyle; - let geomType = feature.geometry.type.toUpperCase(); - if (geomType === 'POINT' && defaultStyle.text) { - // 说明是文字的feature类型 - geomType = 'TEXT'; - } - const layerID = index === 0 ? markerLayerID : markerLayerID + '-' + geomType + '-' + index; - if ( - geomType === 'POINT' && - defaultStyle.src && - defaultStyle.src.indexOf('http://') === -1 && - defaultStyle.src.indexOf('https://') === -1 - ) { - // 说明地址不完整 - defaultStyle.src = this.serverUrl + defaultStyle.src; - } - if (!markerSrc[layerID]) { - markerSrc[layerID] = { - src: defaultStyle.src, - defaultStyle, - geomType - }; - } - }); - const loadImagePromise = (layerID: string, { src, defaultStyle, geomType }) => { - return new Promise(resolve => { - if (!src && geomType !== 'TEXT') { - resolve({ [layerID]: undefined }); - return; - } - if (src && src.indexOf('svg') < 0 && (src.startsWith('http://') || src.startsWith('https://'))) { - this.map.loadImage(src, (error, image) => { - if (error) { - console.log(error); - resolve(error); - return; - } - !this.map.hasImage(src) && this.map.addImage(src, image); - resolve({ [layerID]: src }); - }); - } else { - if (!this._svgDiv) { - this._svgDiv = document.createElement('div'); - document.body.appendChild(this._svgDiv); - } - this.getCanvasFromSVG(src, this._svgDiv, canvas => { - this.handleSvgColor(defaultStyle, canvas); - const base64Url = canvas.toDataURL('img/png'); - this.map.loadImage(base64Url, (error, image) => { - if (error) { - console.log(error); - resolve(error); - return; - } - const srcUrl = src || base64Url; - !this.map.hasImage(srcUrl) && this.map.addImage(srcUrl, image); - resolve({ [layerID]: srcUrl }); - }); - }); - } - }); - }; - const promiseList = []; - for (const layerID in markerSrc) { - promiseList.push(loadImagePromise(layerID, markerSrc[layerID])); - } - Promise.all(promiseList).then(images => { - for (let i = 0; i < features.length; i++) { - const feature = features[i]; - const defaultStyle = feature.dv_v5_markerStyle; - let geomType = feature.geometry.type.toUpperCase(); - if (geomType === 'POINT' && defaultStyle.text) { - // 说明是文字的feature类型 - geomType = 'TEXT'; - } - const featureInfo = this.setFeatureInfo(feature); - feature.properties.useStyle = defaultStyle; - feature.properties.featureInfo = featureInfo; - - const source: mapboxglTypes.GeoJSONSourceRaw = { - type: 'geojson', - data: feature - }; - const layerID = i === 0 ? markerLayerID : markerLayerID + '-' + geomType + '-' + i; - const iconImageUrl = images[i][layerID]; - // image-marker svg-marker - if (geomType === 'POINT' || geomType === 'TEXT') { - if (!iconImageUrl) { - this._addLayer({ - id: layerID, - type: 'circle', - source: source, - paint: this._transformStyleToMapBoxGl(defaultStyle, geomType), - layout: {}, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }); - continue; - } - this._addLayer({ - id: layerID, - type: 'symbol', - source: source, - layout: { - 'icon-image': iconImageUrl, - 'icon-allow-overlap': true, - 'icon-size': defaultStyle.scale || 1, - visibility: layerInfo.visible - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }); - } else { - // line-polygon-marker - const layeStyle: any = { - layout: {} - }; - if (geomType === 'LINESTRING' && defaultStyle.lineCap) { - geomType = 'LINE'; - layeStyle.layout = { - 'line-cap': defaultStyle.lineCap - }; - } - const visible = layerInfo.visible; - layeStyle.layout.visibility = visible; - // get style - layeStyle.style = this._transformStyleToMapBoxGl(defaultStyle, geomType); - this._addOverlayToMap(geomType, source, layerID, layeStyle, minzoom, maxzoom); - // 若面有边框 - geomType === 'POLYGON' && - defaultStyle.strokeColor && - this._addStrokeLineForPoly(defaultStyle, layerID, layerID + '-strokeLine', visible, minzoom, maxzoom); - } - } - this._addLayerSucceeded({ layerInfo, features }); - }); - } - - private _createHeatLayer(layerInfo: any, features: any, addToMap = true): void { - const { minzoom, maxzoom } = layerInfo; - const style = layerInfo.themeSetting; - const layerOption = { - gradient: style.colors.slice(), - radius: parseInt(style.radius) - }; - - // 自定义颜色 - const customSettings = style.customSettings; - for (const i in customSettings) { - layerOption.gradient[i] = customSettings[i]; - } - - const color: string | mapboxglTypes.StyleFunction | mapboxglTypes.Expression = [ - 'interpolate', - ['linear'], - ['heatmap-density'] - ]; - - const step = [0.1, 0.3, 0.5, 0.7, 1]; - layerOption.gradient.forEach((item, index) => { - (color).push(step[index]); - if (index === 0) { - item = mapboxgl.supermap.Util.hexToRgba(item, 0); - } - if (index === 1) { - item = mapboxgl.supermap.Util.hexToRgba(item, 0.5); - } - (color).push(item); - }); - // 图例相关 - this._initLegendConfigInfo(layerInfo, color); - - const paint: mapboxglTypes.HeatmapPaint = { - 'heatmap-color': color, - 'heatmap-radius': style.radius * 3, - 'heatmap-intensity': 2.8 - }; - - if (style.weight && features.length >= 4) { - const weight = []; - features.forEach(item => { - item.properties[style.weight] = +item.properties[style.weight]; - weight.push(item.properties[style.weight]); - }); - const max = SuperMap.ArrayStatistic.getMax(weight); - const min = SuperMap.ArrayStatistic.getMin(weight); - paint['heatmap-weight'] = ['interpolate', ['linear'], ['get', style.weight], min, 0, max, 1]; - } - this._addLayer({ - id: layerInfo.layerID, - type: 'heatmap', - source: { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: features - } - }, - paint: paint, - layout: { - visibility: layerInfo.visible - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }); - if (addToMap) { - this._addLayerSucceeded({ layerInfo, features }); - } - } - - private _createRangeLayer(layerInfo: any, features: any): void { - const fieldName = layerInfo.themeSetting.themeField; - const featureType = layerInfo.featureType; - const { minzoom, maxzoom, style } = layerInfo; - const styleGroups = this.getRangeStyleGroup(layerInfo, features); - - features = this.getFilterFeatures(layerInfo.filterCondition, features); - - // 获取 expression - const expression = ['match', ['get', 'index']]; - const datas = features.filter(row => { - const tartget = parseFloat(row.properties[fieldName]); - if (!tartget && tartget !== 0) { - // expression.push(row.properties['index'], 'rgba(0, 0, 0, 0)'); - return false; - } - if (styleGroups) { - for (let i = 0; i < styleGroups.length; i++) { - const startFlag = styleGroups[i].start <= tartget; - const endFlag = tartget < styleGroups[i].end; - const lastEndFlag = i === styleGroups.length - 1 && tartget === styleGroups[i].end; - if (startFlag && (endFlag || lastEndFlag)) { - expression.push(row.properties.index, styleGroups[i].color); - break; - } - } - } - return true; - }, this); - expression.push('rgba(0, 0, 0, 0)'); - const source: mapboxglTypes.GeoJSONSourceRaw = { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: datas - } - }; - // 图例处理 - this._initLegendConfigInfo(layerInfo, styleGroups || []); - - // 获取样式 - const layerStyle: any = { - layout: {} - }; - if (featureType === 'LINE' && style.lineCap) { - layerStyle.layout = { - 'line-cap': style.lineCap - }; - } - const visible = layerInfo.visible; - layerStyle.layout.visibility = visible; - layerStyle.style = this._transformStyleToMapBoxGl(style, featureType, expression); - // 添加图层 - const layerID = layerInfo.layerID; - this._addOverlayToMap(featureType, source, layerID, layerStyle, minzoom, maxzoom); - // 如果面有边框 - featureType === 'POLYGON' && - style.strokeColor && - this._addStrokeLineForPoly(style, layerID, layerID + '-strokeLine', visible, minzoom, maxzoom); - this._addLayerSucceeded({ layerInfo, features }); - } - - private _sendMapToUser(count: number, layersLen: number): void { - if (count === layersLen) { - /** - * @event WebMapViewModel#addlayerssucceeded - * @description 添加图层成功。 - * @property {mapboxglTypes.Map} map - MapBoxGL Map 对象。 - * @property {Object} mapparams - 地图信息。 - * @property {string} mapParams.title - 地图标题。 - * @property {string} mapParams.description - 地图描述。 - * @property {Array.} layers - 地图上所有的图层对象。 - */ - - const cacheLayerToAddList = Array.from(this._cacheLayerId.values()); - const flatCacheLayerId = cacheLayerToAddList.reduce((list: string[], layers) => { - const layerIds = layers.map(item => item.layerId); - list.push(...layerIds); - return list; - }, []); - const layersFromMapInfo = []; - // this._mapInfo.layers 是有序的 - [this._mapInfo.baseLayer].concat(this._mapInfo.layers).forEach((layerInfo: Record) => { - const targetLayerId = layerInfo.layerID || layerInfo.name; - const targetLayerVisible = layerInfo.visible === void 0 || layerInfo.visible === 'visible' || layerInfo.visible === true; - const matchLayers = this._cacheLayerId.get(targetLayerId); - matchLayers?.forEach(({ layerId, name, ignore }) => { - ignore !== false && layersFromMapInfo.push({ - ...layerInfo, - id: layerId, - name, - visible: targetLayerVisible - }); - }); - if (this.map.getLayer(`${targetLayerId}-strokeLine`)) { - layersFromMapInfo.push({ id: `${targetLayerId}-strokeLine`, visible: targetLayerVisible }); - } - const expandLayers = flatCacheLayerId.map(item => item.includes(targetLayerId)); - for (let index = 1; index < expandLayers.length + 1; index++) { - const layerTypes = ['additional', 'additional-image', 'additional-svg', 'additional-linedasharray', 'additional-symbol', 'POINT', 'TEXT', 'LINESTRING', 'POLYGON']; - const layers = layerTypes.filter(type => this.map.getLayer(`${targetLayerId}-${type}-${index}`)); - if (layers.length) { - layers.forEach(layer => { - layersFromMapInfo.push({ id: `${targetLayerId}-${layer}-${index}`, visible: targetLayerVisible }); - }); - } else { - break; - } - } - if (this.map.getLayer(`${targetLayerId}-label`)) { - layersFromMapInfo.push({ id: `${targetLayerId}-label`, visible: targetLayerVisible }); - } - }); - this._sourceListModel = new SourceListModel({ - map: this.map, - layers: layersFromMapInfo, - appendLayers: this._appendLayers - }); - const appreciableLayers = this.getAppreciableLayers(); - this._rectifyLayersOrder(appreciableLayers); - const matchLayers = appreciableLayers.filter((item: Record) => item.renderLayers.some((id: string) => flatCacheLayerId.some(layerId => layerId === id))); - this._triggerEvent('addlayerssucceeded', { - map: this.map, - layers: matchLayers, - cacheLayerIds: flatCacheLayerId, - mapparams: this._mapInfo.mapParams - }); - } - } - - private _rectifyLayersOrder(appreciableLayers: any[]) { - const renderLayers = appreciableLayers.reduce((layers, layer) => { - return layers.concat(layer.renderLayers); - }, []); - const exsitLayers = renderLayers.filter(layerId => !!this.map.getLayer(layerId)); - for (let index = exsitLayers.length - 1; index > -1; index--) { - const targetlayerId = exsitLayers[index]; - let beforLayerId = exsitLayers[index + 1] ? exsitLayers[index + 1] : undefined; - this.map.moveLayer(targetlayerId, beforLayerId); - } - } - - private _getParamString(obj: any, existingUrl: string, uppercase = false): string { - const params = []; - for (const i in obj) { - params.push((uppercase ? i.toUpperCase() : i) + '=' + obj[i]); - } - return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&'); - } - - /** - * @private - * @function WebMapViewModel.prototype._transformStyleToMapBoxGl - * @description 根据图层类型将 layerInfo 中的 style 属性格式转换为 mapboxglTypes 中的 style 格式。 - * @param {Object} style - layerInfo中的style属性 - * @param {String} type - 图层类型 - * @param {Array} [expression] - 存储颜色值得表达式 - */ - private _transformStyleToMapBoxGl(style: any, type: layerType, expression?, expressionType?): any { - let transTable = {}; - if ((style.type === 'POINT' || style.type === 'BASIC_POINT' || type === 'POINT') && type !== 'LINE') { - transTable = { - fillColor: 'circle-color', - strokeWidth: 'circle-stroke-width', - fillOpacity: 'circle-opacity', - radius: 'circle-radius', - strokeColor: 'circle-stroke-color', - strokeOpacity: 'circle-stroke-opacity' - }; - } else if (['LINE', 'LINESTRING', 'MULTILINESTRING'].includes(type)) { - transTable = { - strokeWidth: 'line-width', - strokeColor: 'line-color', - strokeOpacity: 'line-opacity' - }; - } else if (['REGION', 'POLYGON', 'MULTIPOLYGON'].includes(type)) { - transTable = { - fillColor: 'fill-color', - fillOpacity: 'fill-opacity' - // strokeColor: 'fill-outline-color' - }; - } - - const newObj = {}; - for (const item in style) { - if (transTable[item]) { - newObj[transTable[item]] = style[item]; - } - } - if (expression) { - if (expressionType) { - newObj[expressionType] = expression; - } else if (newObj['circle-color']) { - newObj['circle-color'] = expression; - } else if (newObj['line-color']) { - newObj['line-color'] = expression; - } else { - newObj['fill-color'] = expression; - } - } - if (style.lineDash && !newObj['line-dasharray']) { - if (Array.isArray(style.lineDash)) { - newObj['line-dasharray'] = style.lineDash; - } else if (style.lineDash !== 'solid' && type === 'LINE') { - newObj['line-dasharray'] = this.getDashStyle(style.lineDash); - } - } - if (style.lineDash && !newObj['circle-translate']) { - if (Array.isArray(style.circleTranslate)) { - newObj['circle-translate'] = style.circleTranslate; - } else if (style.type === 'POINT' || style.type === 'BASIC_POINT' || type === 'POINT') { - const offsetX = style.offsetX || 0; - const offsetY = style.offsetY || 0; - newObj['circle-translate'] = [offsetX * style.radius, offsetY * style.radius]; - } - } - - return newObj; - } - - /** - * @private - * @function WebMapViewModel.prototype._addOverlayToMap - * @description 添加基础矢量图层到 MAP - * @param {Object} style - mabgl style - * @param {String} type - 图层类型 - */ - private _addOverlayToMap( - type: layerType, - source: mapboxglTypes.GeoJSONSourceRaw, - layerID: string, - layerStyle: any, - minzoom: number, - maxzoom: number, - filter?: string - ): void { - const mbglTypeMap = { - POINT: 'circle', - LINE: 'line', - POLYGON: 'fill' - }; - const mbglType = mbglTypeMap[type]; - if (mbglType === 'circle' || mbglType === 'line' || mbglType === 'fill') { - const style: any = { - id: layerID, - type: mbglType, - source: source, - paint: layerStyle.style, - layout: layerStyle.layout || {}, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }; - if (filter) { - style.filter = filter; - } - this._addLayer(style); - } - } - - private _addBaselayer( - url: Array, - layerID: string, - visibility = true, - minzoom = 0, - maxzoom = 22, - isIserver = false, - bounds? - ): void { - const source: mapboxglTypes.RasterSource = { - type: 'raster', - tiles: url, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22, - tileSize: isIserver ? this.rasterTileSize : 256, - // @ts-ignore - rasterSource: isIserver ? 'iserver' : '', - // @ts-ignore - prjCoordSys: - isIserver && !this.isOnlineBaseLayer(url[0], this.baseProjection) && +this.baseProjection.split(':')[1] > 0 - ? { epsgCode: this.baseProjection.split(':')[1] } - : '', - proxy: this.baseLayerProxy - }; - if (bounds) { - source.bounds = bounds; - } - this._addLayer({ - id: layerID, - type: 'raster', - source: source, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22, - layout: { - visibility: visibility ? 'visible' : 'none' - } - }); - this.baseLayerProxy = null; - } - - /** - * @private - * @function WebMapViewModel.prototype._addStrokeLineForPoly - * @description 添加面的边框。 - * @param {Object} style - mabgl style - */ - private _addStrokeLineForPoly( - style: any, - source: any, - layerID: string, - visible: boolean, - minzoom: number, - maxzoom: number - ): void { - const lineStyle = { - style: this._transformStyleToMapBoxGl(style, 'LINE'), - layout: { - visibility: visible - } - }; - this._addOverlayToMap('LINE', source, layerID, lineStyle, minzoom, maxzoom); - } - - private _initLegendConfigInfo(layerInfo: any, style: any): void { - const legendItem = { - layerId: layerInfo.layerID, - layerTitle: layerInfo.layerID, - themeField: layerInfo.layerType === 'HEAT' ? layerInfo.themeSetting.weight : layerInfo.themeSetting.themeField, - styleGroup: style - }; - - const commonStyleGroupMapping = (styleGroup, layerInfo) => { - let newStyleGroup = { - style: { - shape: this._getShape(layerInfo.featureType), - type: this._getType(styleGroup.style.type) - } - }; - this._addProps(newStyleGroup, styleGroup); - return newStyleGroup; - }; - - switch (layerInfo.layerType) { - case 'UNIQUE': - legendItem.styleGroup = legendItem.styleGroup.map(styleGroup => { - return { - fieldValue: styleGroup.value, - ...commonStyleGroupMapping(styleGroup, layerInfo) - }; - }); - break; - case 'RANGE': - case 'RANK_SYMBOL': - legendItem.styleGroup = legendItem.styleGroup.map(styleGroup => { - const newStyleGroup = { - start: styleGroup.start, - end: styleGroup.end, - ...commonStyleGroupMapping(styleGroup, layerInfo) - }; - return newStyleGroup; - }); - break; - case 'HEAT': - legendItem.styleGroup = [ - { - style: { - shape: 'POINT', - type: 'style', - colors: this._heatColorToGradient(legendItem.styleGroup) - } - } - ]; - break; - default: - break; - } - this._legendList.push(legendItem); - } - - _heatColorToGradient(colors = []) { - const colorList = []; - colors.forEach((color, index) => { - if (index > 5 && index % 2 === 0) { - colorList.push({ - value: color, - key: index === 6 ? 0 : colors[index - 1] - }); - } - }); - return colorList; - } - - _getType(type) { - return ['IMAGE_POINT', 'SVG_POINT'].includes(type) ? 'image' : 'style'; - } - - _getShape(shape) { - return shape === 'POLYGON' ? 'FILL' : shape; - } - - _addProps(newStyleGroup, styleGroup) { - if (newStyleGroup.style.shape === 'POINT') { - Object.assign(newStyleGroup.style, { - color: styleGroup.style.fillColor || styleGroup.color, - opacity: styleGroup.style.fillOpacity, - fontSize: styleGroup.radius * 2 || styleGroup.style.fontSize || '14px' - }); - if (newStyleGroup.style.type === 'image') { - Object.assign(newStyleGroup.style, { - url: styleGroup.style.imageInfo?.url || styleGroup.style.url - }); - return; - } - if (styleGroup.style.className) { - Object.assign(newStyleGroup.style, { - icon: styleGroup.style.className - }); - return; - } - } - if (newStyleGroup.style.shape === 'LINE') { - Object.assign(newStyleGroup.style, { - width: 20, - lineStyles: [ - { - color: styleGroup.color, - lineDash: [], - lineOffset: 0, - lineWidth: 2, - opacity: styleGroup.style.strokeOpacity || 1 - } - ] - }); - return; - } - if (newStyleGroup.style.shape === 'FILL') { - Object.assign(newStyleGroup.style, { - backgroundColor: styleGroup.style.fillColor || styleGroup.color, - opacity: styleGroup.style.fillOpacity, - outlineColor: styleGroup.style.strokeColor, - width: 20, - height: 20 - }); - } - } - - _createMvtLayer(info, layerInfo, featureType) { - const style = this._getDataVectorTileStyle(featureType); - const paint = this._transformStyleToMapBoxGl(style, featureType); - let url = info.url + '/tileFeature.mvt'; - const origin = mapboxgl.CRS.get(this.baseProjection).getOrigin(); - const { minzoom, maxzoom } = layerInfo; - url += `?&returnAttributes=true&width=512&height=512&x={x}&y={y}&scale={scale}&origin={x:${origin[0]},y:${origin[1]}}`; - this._addLayer({ - id: layerInfo.layerID, - // @ts-ignore - type: style.mbglType, - source: { - type: 'vector', - tiles: [url], - proxy: this.webMapService.handleProxy('image') - }, - 'source-layer': `${info.datasetName}@${info.datasourceName}`, - paint, - layout: { - visibility: layerInfo.visible ? 'visible' : 'none' - }, - minzoom: minzoom || 0, - maxzoom: maxzoom || 22 - }); - this._addLayerSucceeded(); - } - - _getDataVectorTileStyle(featureType) { - const styleParameters = { - radius: 8, // 圆点半径 - fillColor: '#EE4D5A', // 填充色 - fillOpacity: 0.9, - strokeColor: '#ffffff', // 边框颜色 - strokeWidth: 1, - strokeOpacity: 1, - lineDash: 'solid', - type: 'BASIC_POINT', - mbglType: 'circle' - }; - if (['LINE', 'LINESTRING', 'MULTILINESTRING'].includes(featureType)) { - styleParameters.strokeColor = '#4CC8A3'; - styleParameters.strokeWidth = 2; - styleParameters.mbglType = 'line'; - } else if (['REGION', 'POLYGON', 'MULTIPOLYGON'].includes(featureType)) { - styleParameters.fillColor = '#826DBA'; - styleParameters.mbglType = 'fill'; - } - return styleParameters; - } - - _unproject(point: [number, number], isReverse = true): [number, number] { - const sourceProjection = this._unprojectProjection || this.baseProjection; - if (sourceProjection === 'EPSG:4326') { - return point; - } - // @ts-ignore - const coor = proj4(sourceProjection, 'EPSG:4326', point); - const proj = proj4.defs(sourceProjection); - if (isReverse && proj.axis && proj.axis.indexOf('ne') === 0) { - coor.reverse(); - } - return coor; - } - - private _getMapCenter(mapInfo) { - // center - let center: [number, number] | mapboxglTypes.LngLat; - center = mapInfo.center && [mapInfo.center.x, mapInfo.center.y]; - - if (!center) { - center = [0, 0]; - } - center = this._unproject(center, false); - center = new mapboxgl.LngLat(center[0], center[1]); - - return center; - } - - private _getLabelFontFamily(mapInfo) { - const fonts: string[] = ['sans-serif']; - const layers = mapInfo.layers; - // 获取 label 图层字体类型 - if (layers && layers.length > 0) { - layers.forEach(layer => { - layer.labelStyle && fonts.push(layer.labelStyle.fontFamily); - }, this); - } - fonts.push('supermapol-icons'); - const fontFamilys: string = fonts.join(','); - - return fontFamilys; - } - - private _getTiandituUrl(mapInfo: any): { tiandituUrl: Array; labelUrl: Array } { - const re = /t0/gi; - type urlArr = Array; - const tiandituUrls: { tiandituUrl: urlArr; labelUrl: urlArr } = { tiandituUrl: [], labelUrl: [] }; - - const layerType = mapInfo.baseLayer.layerType.split('_')[1].toLowerCase(); - const isLabel = Boolean(mapInfo.baseLayer.labelLayerVisible); - const token = this.tiandituKey || mapInfo.baseLayer.tk; - let url = `https://t0.tianditu.gov.cn/{layer}_{proj}/wmts?tk=${token}`; - let labelUrl = url; - - const layerLabelMap = { - vec: 'cva', - ter: 'cta', - img: 'cia' - }; - - const tilematrixSet = this.baseProjection === 'EPSG:4326' ? 'c' : 'w'; - const options = { - service: 'WMTS', - request: 'GetTile', - style: 'default', - version: '1.0.0', - layer: layerType, - tilematrixSet: tilematrixSet, - format: 'tiles', - width: 256, - height: 256 - }; - - url += this._getParamString(options, url) + '&tilematrix={z}&tilerow={y}&tilecol={x}'; - - const tiandituUrl = url.replace('{layer}', layerType).replace('{proj}', tilematrixSet); - const tiandituUrlArr: string[] = []; - - for (let i = 0; i < 8; i++) { - tiandituUrlArr.push(tiandituUrl.replace(re, `t${i}`)); - } - tiandituUrls.tiandituUrl = tiandituUrlArr; - - // 如果有 label 图层 - if (isLabel) { - const labelLayer = layerLabelMap[layerType]; - options.layer = labelLayer; - labelUrl += this._getParamString(options, labelUrl) + '&tilematrix={z}&tilerow={y}&tilecol={x}'; - labelUrl = labelUrl.replace('{layer}', labelLayer).replace('{proj}', tilematrixSet); - const labelUrlArr = []; - for (let i = 0; i < 8; i++) { - labelUrlArr.push(labelUrl.replace(re, `t${i}`)); - } - tiandituUrls.labelUrl = labelUrlArr; - } - - return tiandituUrls; - } - - private _defineProj4(projection: string, defaultEpsgCode?) { - let epsgCode = projection; - let epsgValue: string; - if (!projection.split(':')[1]) { - if (defaultEpsgCode && defaultEpsgCode.split(':')[1]) { - epsgCode = defaultEpsgCode; - } else { - epsgCode = toEpsgCode(projection); - } - epsgValue = projection; - } - const defaultValue = getProjection(epsgCode); - const defValue = epsgValue || defaultValue; - - if (!defValue) { - console.error(`${epsgCode} not define`); - } else { - !proj4.defs(epsgCode) && proj4.defs(epsgCode, defValue); - !defaultValue && registerProjection(epsgCode, defValue); - } - return epsgCode; - } - - private _fetchRequest(url: any, type: string, options?: Object) { - return SuperMap.FetchRequest.get(url, null, options) - .then(response => { - return response[type](); - }) - .then(results => { - return results; - }) - .catch(error => { - console.log(error); - }); - } - - private getEpsgCodeWKT(projectionUrl, options) { - if (!projectionUrl) { - return; - } - return this._fetchRequest(projectionUrl, 'text', options); - } - - private getBounds(baseUrl, options) { - if (!baseUrl) { - return; - } - return this._fetchRequest(baseUrl, 'json', options); - } - - private _addLayer(layerInfo) { - const { id } = layerInfo; - layerInfo = Object.assign(layerInfo, { id }); - if (!this._cacheLayerId.has(id)) { - this._cacheLayerId.set(id, [{ layerId: id, name: layerInfo.name }]); - } - - if (this.map.getLayer(id)) { - if (this.checkSameLayer && this._isSameRasterLayer(id, layerInfo)) { - this._cacheLayerId.set(id, [{ layerId: id, name: layerInfo.name, ignore: false }]); - return; - } - this._updateLayer(layerInfo); - return; - } - this.map.addLayer(layerInfo); - } - - private _isSameRasterLayer(id, layerInfo) { - const { - source: { type, tiles } - } = layerInfo; - if (type === 'raster') { - const source = this.map.getSource(id); - if ( - type === source.type && - tiles && - // @ts-ignore - source.tiles && - // @ts-ignore - tiles[0] === source.tiles[0] - ) { - return true; - } - } - return false; - } - - clean() { - if (this.map) { - this.stopCanvg(); - this.map.remove(); - this.map = null; - this._legendList = []; - this._sourceListModel = null; - this.center = null; - this.zoom = null; - this._dataflowService && - this._dataflowService.off('messageSucceeded', this._handleDataflowFeaturesCallback) && - this._dataflowService.off('subscribesucceeded', this._initDataflowLayerCallback); - this._unprojectProjection = null; - this._cacheLayerId = new Map(); - } - if (this._layerTimerList.length) { - this._layerTimerList.forEach(timer => { - clearInterval(timer); - }); - this._layerTimerList = []; - } - } - - private centerValid(center) { - if ( - center && - ((<[number, number]>center).length > 0 || - typeof center === mapboxgl.LngLat || - (<{ lng: number; lat: number }>center).lng) - ) { - return true; - } - return false; - } - - private _getResolution(bounds, tileSize = 512.0) { - if (bounds.leftBottom && bounds.rightTop) { - return Math.max(bounds.rightTop.x - bounds.leftBottom.x, bounds.rightTop.y - bounds.leftBottom.y) / tileSize; - } - return Math.max(bounds[2] - bounds[0], bounds[3] - bounds[1]) / tileSize; - } - - private _transformScaleToZoom(scale, crs?) { - // @ts-ignore - const extent = (crs || this.map.getCRS()).getExtent(); - // @ts-ignore - const unit = (crs || this.map.getCRS()).unit; - const scaleBase = 1.0 / SuperMap.Util.getScaleFromResolutionDpi((extent[2] - extent[0]) / 512, 96, unit); - const scaleDenominator = scale.split(':')[1]; - return Math.min(24, +Math.log2(scaleBase / +scaleDenominator).toFixed(2)); - } - - private _updateLayer(layerInfo) { - const { - id, - paint, - source: { type, tiles, data, proxy } - } = layerInfo; - const source = this.map.getSource(id); - if (source) { - if (type === 'geojson' || source.type === 'geojson') { - Object.keys(paint).forEach(name => { - this.map.setPaintProperty(id, name, paint[name]); - }); - // @ts-ignore - data && source.setData(data); - } else if (type === 'raster') { - this._updateRasterSource(id, { proxy, tiles }); - } - } - } - - _updateRasterSource(sourceId, options) { - if (!sourceId) { - return; - } - const source = this.map.getSource(sourceId); - - Object.assign(source, options); - // @ts-ignore - this.map.style.sourceCaches[sourceId].clearTiles(); - // @ts-ignore - this.map.style.sourceCaches[sourceId].update(this.map.transform); - // @ts-ignore - this.map.triggerRepaint(); - } - - updateOverlayLayer(layerInfo: any, features: any, mergeByField?: string) { - // @ts-ignore - const originLayerInfo = this._mapInfo.layers.find(layer => { - return layer.layerID === layerInfo.id; - }); - if (features) { - this._initOverlayLayer(originLayerInfo, features, mergeByField); - } else { - const type = this.webMapService.getDatasourceType(originLayerInfo); - this.getLayerFeatures(originLayerInfo, this._taskID, type); - } - } - - isOnlineBaseLayer(url, projection) { - return ( - url.startsWith('https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark') && - projection === 'EPSG:3857' - ); - } - - _triggerEvent(name: string, params?: any) { - this.triggerEvent(name, params); - this._parentEvents[name]?.(params); - } -} diff --git a/src/mapboxgl/web-map/WebMapViewModel.ts b/src/mapboxgl/web-map/WebMapViewModel.ts index ca41df04..d49a8132 100644 --- a/src/mapboxgl/web-map/WebMapViewModel.ts +++ b/src/mapboxgl/web-map/WebMapViewModel.ts @@ -6,14 +6,17 @@ import mapboxgl from 'vue-iclient/static/libs/mapboxgl/mapbox-gl-enhance'; import 'vue-iclient/static/libs/iclient-mapboxgl/iclient-mapboxgl.min'; import 'vue-iclient/static/libs/geostats/geostats'; import 'vue-iclient/static/libs/json-sql/jsonsql'; -import WebMapService from '../../common/_utils/WebMapService'; -import WebMapV2 from './WebMapV2'; -import MapStyle from './MapStyle'; +import echarts from 'echarts'; +import EchartsLayer from 'vue-iclient/static/libs/echarts-layer/EchartsLayer'; import iPortalDataService from 'vue-iclient/src/common/_utils/iPortalDataService'; import { getGroupChildrenLayers } from 'vue-iclient/src/mapboxgl/web-map/GroupUtil'; import difference from 'lodash.difference'; -const WORLD_WIDTH = 360; +// @ts-ignore +window.echarts = echarts; +// @ts-ignore +window.EchartsLayer = EchartsLayer; + // 迁徙图最大支持要素数量 /** * @class WebMapViewModel @@ -71,52 +74,57 @@ interface mapOptions { crs: string; } +interface CRSOptions { + epsgCode: string; + WKT: string; + extends: any[]; + unit: string; +} + interface MapHandler { initializeMap: (mapInfo?: Record, map?: mapboxglTypes.Map) => void; clean: () => void; getLayerCatalog: () => any[]; getLegendInfo: () => any[]; getAppreciableLayers: () => any[]; - _updateRasterSource?: (sourceId: string, options: { tileSize: number }) => void; - echartsLayerResize?: () => void; - updateOverlayLayer?: (layerInfo: Record, features: any, mergeByField?: string) => void; - copyLayer?: (id: string, layerInfo: Record) => boolean; + echartsLayerResize: () => void; + updateOverlayLayer: (layerInfo: Record, features: any, mergeByField?: string) => void; + copyLayer: (id: string, layerInfo: Record) => boolean; + resize: (keepBounds: boolean) => void; + setCrs: (crs: CRSOptions | string) => void; + setCenter: (center: [number, number]) => void; + setRenderWorldCopies: (renderWorldCopies: boolean) => void; + setBearing: (bearing: number) => void; + setPitch: (pitch: number) => void; + setMapId: (mapId: string | number) => void; + setServerUrl: (serverUrl: string) => void; + setStyle: (style: mapboxglTypes.Style) => void; + setRasterTileSize: (tileSize: number) => void; + setMaxBounds: (maxBounds: any[]) => void; + setZoom: (zoom: number) => void; + setMinZoom: (minZoom: number) => void; + setMaxZoom: (minZoom: number) => void; + setProxy: (proxy: string) => void; + setWithCredentials: (withCredentials: boolean) => void; + on: (type: string, callback: () => void) => void; } export default class WebMapViewModel extends Events { map: mapboxglTypes.Map; - center: [number, number] | mapboxglTypes.LngLatLike | { lon: number; lat: number } | number[]; - - bounds: mapboxglTypes.LngLatBoundsLike; - - renderWorldCopies: boolean; - - proxy: string | boolean; - mapOptions: any; options: any; layerFilter: Function; - baseLayerProxy: string | boolean; - mapId: string | number | Object; - webMapInfo: any; - serverUrl: string; - zoom: number; - - target: string; - mapParams: { title?: string; description?: string }; - withCredentials: boolean; - - protected _taskID: Date; + eventTypes: string[]; private _cacheCleanLayers: any[] = []; @@ -126,12 +134,10 @@ export default class WebMapViewModel extends Events { private _appreciableLayersVisibleMap: Map = new Map(); - protected webMapService: WebMapService; - - eventTypes: string[]; - private appreciableLayers: Array> = []; + private layerCatalogs: Array> = []; + private _appendLayers = false; triggerEvent: (name: string, ...rest: any) => any; @@ -151,24 +157,16 @@ export default class WebMapViewModel extends Events { } ) { super(); - this.serverUrl = options.serverUrl || 'https://www.supermapol.com'; - this.proxy = options.proxy; - if (typeof id === 'string' || typeof id === 'number') { - this.mapId = id; - } else if (id !== null && typeof id === 'object') { - this.webMapInfo = id; - } - if (!this.mapId && !mapOptions.center && !mapOptions.zoom) { - mapOptions.center = [0, 0]; - mapOptions.zoom = 0; - } - this.bounds = mapOptions.bounds; - this.target = options.target || 'map'; - this.options = options; - this.withCredentials = options.withCredentials || false; - this.renderWorldCopies = mapOptions.renderWorldCopies; + + this.mapId = id; + this.options = { + ...options, + server: options.serverUrl || 'https://www.supermapol.com', + target: options.target || 'map', + withCredentials: options.withCredentials || false + }; + this.serverUrl = this.options.server; this.layerFilter = layerFilter; - this.webMapService = new WebMapService(id, options); this.mapOptions = mapOptions; this.eventTypes = [ 'getmapinfofailed', @@ -186,135 +184,80 @@ export default class WebMapViewModel extends Events { this._mapInitializedHandler = this._mapInitializedHandler.bind(this); this._addLayersSucceededHandler = this._addLayersSucceededHandler.bind(this); this._styleDataUpdatedHandler = this._styleDataUpdatedHandler.bind(this); + this._beforeMoveMapHandler = this._beforeMoveMapHandler.bind(this); if (map) { this.map = map; this._appendLayers = true; } - this._initWebMap(!this.map); + this._initWebMap(); } - public resize(keepBounds = false): void { - this.map && this.map.resize(); - this._handler?.echartsLayerResize?.(); - const mapContainerStyle = window.getComputedStyle(document.getElementById(this.target)); - if (keepBounds && this.map && this.bounds && mapContainerStyle) { - const zoom = this._getResizedZoom(this.bounds, mapContainerStyle); - if (zoom !== this.map.getZoom()) { - this.map && this.map.setZoom(zoom); - } - } + resize(keepBounds: boolean): void { + this._handler?.resize(keepBounds); } - public setCrs(crs): void { - if (this.map) { - this.mapOptions.crs = crs; - if (this.mapOptions.crs) { - if (crs.epsgCode) { - this.mapOptions.crs = new mapboxgl.CRS( - this.mapOptions.crs.epsgCode, - this.mapOptions.crs.WKT, - this.mapOptions.crs.extent, - this.mapOptions.crs.unit - ); - // @ts-ignore - this.map.setCRS(this.mapOptions.crs); - } else { - // @ts-ignore - this.map.setCRS(mapboxgl.CRS.get(crs)); - } - } - } + setCrs(crs: CRSOptions): void { + this._handler?.setCrs(crs); } - public setCenter(center): void { - if (this.map && this.centerValid(center)) { - this.mapOptions.center = center; - const { lng, lat } = this.map.getCenter(); - if (center[0] !== +lng.toFixed(4) || center[1] !== +lat.toFixed(4)) { - this.map.setCenter(center, { from: 'setCenter' }); - } - } + setCenter(center: [number, number]): void { + this._handler?.setCenter(center); } - public setRenderWorldCopies(renderWorldCopies): void { - if (this.map) { - this.mapOptions.renderWorldCopies = renderWorldCopies; - this.map.setRenderWorldCopies(renderWorldCopies); - } + setRenderWorldCopies(renderWorldCopies: boolean): void { + this._handler?.setRenderWorldCopies(renderWorldCopies); } - public setBearing(bearing): void { - if (this.map) { - this.mapOptions.bearing = bearing; - if (bearing !== +this.map.getBearing().toFixed(2)) { - (bearing || bearing === 0) && this.map.setBearing(bearing); - } - } + setBearing(bearing: number): void { + this._handler?.setBearing(bearing); } - public setPitch(pitch): void { - if (this.map) { - this.mapOptions.pitch = pitch; - if (pitch !== +this.map.getPitch().toFixed(2)) { - (pitch || pitch === 0) && this.map.setPitch(pitch); - } - } + setPitch(pitch: number): void { + this._handler?.setPitch(pitch); } - public setStyle(style): void { - if (this.map) { - this.mapOptions.style = style; - this._initWebMap(); - } + setStyle(style: mapboxglTypes.Style): void { + this._handler?.setStyle(style); } - public setRasterTileSize(tileSize) { - if (this.map) { - if (tileSize <= 0) { - return; - } - const sources = this.map.getStyle().sources; - Object.keys(sources).forEach(sourceId => { - // @ts-ignore - if (sources[sourceId].type === 'raster' && sources[sourceId].rasterSource === 'iserver') { - this._handler._updateRasterSource?.(sourceId, { tileSize }); - } - }); - } + setRasterTileSize(tileSize: number) { + this._handler?.setRasterTileSize(tileSize); } - public getAppreciableLayers() { - return this.appreciableLayers; + setZoom(zoom: number) { + this._handler?.setZoom(zoom); } - public getLegendInfo() { - return this._handler?.getLegendInfo() ?? []; + setServerUrl(serverUrl: string): void { + this._handler?.setServerUrl(serverUrl); } - private getLayerVisible(layer: Record) { - const id = this.getLayerVisibleId(layer); - return this._appreciableLayersVisibleMap.has(id) ? this._appreciableLayersVisibleMap.get(id) : layer.visible; + setWithCredentials(withCredentials: boolean) { + this.options.withCredentials = withCredentials; + this._handler?.setWithCredentials(withCredentials); } - private getLayerVisibleId(layer: Record) { - return `${layer.type}-${layer.id}`; + setProxy(proxy: string) { + this._handler?.setProxy(proxy); } - public getLayerList() { - return this.layerCatalogs; + setMapId(mapId: string | number): void { + this._handler?.setMapId(mapId); } - private _updateLayerCatalogsVisible(catalogs: Array>) { - for (const data of catalogs) { - data.visible = this.getLayerVisible(data); - if (data.type === 'group') { - this._updateLayerCatalogsVisible(data.children); - } - } + getAppreciableLayers() { + return this.appreciableLayers; + } + + getLegendInfo() { + return this._handler?.getLegendInfo() ?? []; + } + + getLayerList() { + return this.layerCatalogs; } protected cleanLayers() { - this._taskID = null; const sourceList = []; for (const item of this._cacheCleanLayers) { item.renderLayers.forEach((layerId: string) => { @@ -332,7 +275,7 @@ export default class WebMapViewModel extends Events { this._cacheCleanLayers = []; } - public getLayerDatas(item) { + getLayerDatas(item) { const isGeojson = item.renderSource.type === 'geojson'; if (isGeojson) { // @ts-ignore @@ -342,7 +285,7 @@ export default class WebMapViewModel extends Events { // TODO iserver服务也可获取要素 if (!dataId) return []; let promise = new Promise((resolve, reject) => { - const dataService = new iPortalDataService(`${this.serverUrl}web/datas/${dataId}`, this.withCredentials, { dataType: 'STRUCTUREDDATA' }); + const dataService = new iPortalDataService(`${this.serverUrl}web/datas/${dataId}`, this.options.withCredentials, { dataType: 'STRUCTUREDDATA' }); dataService.on({ getdatafailed: e => { reject(e); @@ -357,10 +300,10 @@ export default class WebMapViewModel extends Events { } } - public changeItemVisible(item: Record, visible: boolean) { + changeItemVisible(item: Record, visible: boolean) { const visibility = visible ? 'visible' : 'none'; if (item.type === 'group') { - const visbleId = this.getLayerVisibleId(item); + const visbleId = this._getLayerVisibleId(item); this._appreciableLayersVisibleMap.set(visbleId, visible); const targetLayers = getGroupChildrenLayers(item.children); this.updateLayersVisible(targetLayers, visibility); @@ -371,7 +314,7 @@ export default class WebMapViewModel extends Events { updateLayersVisible(layers: Array>, visibility: 'visible' | 'none', ignoreIds: string[] = []) { layers.forEach(layer => { - const visbleId = this.getLayerVisibleId(layer); + const visbleId = this._getLayerVisibleId(layer); this._appreciableLayersVisibleMap.set(visbleId, visibility === 'visible'); if ('l7MarkerLayer' in layer && !ignoreIds.some(id => id === layer.id)) { visibility === 'visible' ? layer.l7MarkerLayer.show() : layer.l7MarkerLayer.hide(); @@ -386,144 +329,62 @@ export default class WebMapViewModel extends Events { this._styleDataUpdatedHandler(); } - protected initWebMap(clean = true) { - clean && this.clean(); - this.serverUrl = this.serverUrl && this.webMapService.handleServerUrl(this.serverUrl); - if (this.webMapInfo) { - // 传入是webmap对象 - const mapInfo = this.webMapInfo; - mapInfo.mapParams = { - title: this.webMapInfo.title, - description: this.webMapInfo.description - }; - this.mapParams = mapInfo.mapParams; - Promise.resolve() - .then(() => { - this._getMapInfo(mapInfo); - }) - .catch(error => { - this.triggerEvent('getmapinfofailed', { error }); - }); - return; - } else if (!this.mapId || !this.serverUrl) { - Promise.resolve() - .then(() => { - this._createMap('MapStyle'); - }) - .catch(error => { - this.triggerEvent('getmapinfofailed', { error }); - }); + setLayersVisible(isShow: boolean, ignoreIds?: string[], onlyClear?: boolean) { + // 只有 webmapv2 支持 + const visibility = isShow ? 'visible' : 'none'; + this._appreciableLayersVisibleMap.clear(); + if (!onlyClear) { + const layers = this._cacheLayerIds?.map(id => { + const layer = this.map.getLayer(id); + return { + id, + type: layer.type, + renderLayers: [id] + }; + }) ?? []; + this.updateLayersVisible(layers, visibility, ignoreIds); return; } - this._taskID = new Date(); - this.getMapInfo(this._taskID); + this._styleDataUpdatedHandler(); } - public setZoom(zoom) { + clean() { if (this.map) { - this.mapOptions.zoom = zoom; - if (zoom !== +this.map.getZoom().toFixed(2)) { - (zoom || zoom === 0) && this.map.setZoom(zoom, { from: 'setZoom' }); - } + this.map.off('styledata', this._styleDataUpdatedHandler); + this._handler?.clean(); } } - public setServerUrl(serverUrl: string): void { - this.serverUrl = serverUrl; - this.webMapService.setServerUrl(serverUrl); - } - - public setWithCredentials(withCredentials) { - this.withCredentials = withCredentials; - this.webMapService.setWithCredentials(withCredentials); - } - - public setProxy(proxy) { - this.proxy = proxy; - this.webMapService.setProxy(proxy); - } - - public setMapId(mapId: string | number): void { - if (typeof mapId === 'string' || typeof mapId === 'number') { - this.mapId = mapId; - this.webMapInfo = null; - } else if (mapId !== null && typeof mapId === 'object') { - this.webMapInfo = mapId; - } - this.webMapService.setMapId(mapId); - if (!mapId) { - return; - } - setTimeout(() => { - this._initWebMap(); - }, 0); - } - - protected getMapInfo(_taskID) { - this.serverUrl = this.serverUrl && this.webMapService.handleServerUrl(this.serverUrl); - this.webMapService - .getMapInfo() - .then( - (mapInfo: any) => { - if (this._taskID !== _taskID) { - return; - } - // 存储地图的名称以及描述等信息,返回给用户 - this.mapParams = mapInfo.mapParams; - this._getMapInfo(mapInfo); - }, - error => { - throw error; - } - ) - .catch(error => { - this.triggerEvent('getmapinfofailed', { error }); - console.log(error); - }); + cleanWebMap() { + this.clean(); } - _initWebMap(clean = true): void { - this.initWebMap(clean); + updateOverlayLayer(layerInfo: any, features: any, mergeByField?: string) { + this._handler?.updateOverlayLayer(layerInfo, features, mergeByField); } - _createMapStyle(commonOptions: webMapOptions, commonEvents: Record) { - const mapStyleHandler = new MapStyle(this.mapId, commonOptions, this.mapOptions, this.layerFilter); - mapStyleHandler.on(commonEvents); - return mapStyleHandler; + copyLayer(id: string, layerInfo: Record) { + return this._handler?.copyLayer(id, layerInfo); } - _createWebMapV2(commonOptions: webMapOptions, commonEvents: Record) { - const webMapHandler = new WebMapV2( - this.mapId, - { - ...commonOptions, - parentEvents: commonEvents - }, - this.mapOptions, - this.layerFilter - ); - return webMapHandler; + get cacheLayerIds(): string[] { + return this._cacheLayerIds || this._cacheCleanLayers.reduce((ids, item) => { + ids.push(...item.renderLayers); + return ids; + }, []); } - _createWebMapV3(commonOptions: webMapOptions, commonEvents: Record) { - const webMapHandler = new mapboxgl.supermap.WebMapV3( - this.mapId, - { ...commonOptions, server: this.serverUrl, iportalServiceProxyUrl: this.webMapService.iportalServiceProxyUrl }, - this.mapOptions - ); - for (const type in commonEvents) { - webMapHandler.on(type, commonEvents[type]); - } - return webMapHandler; + private _initWebMap(): void { + this._createMap(); } - _mapInitializedHandler({ map }) { + private _mapInitializedHandler({ map }) { this.map = map; this.triggerEvent('mapinitialized', { map: this.map }); this.map.on('styledata', this._styleDataUpdatedHandler); } - _styleDataUpdatedHandler() { + private _styleDataUpdatedHandler() { const layers = this._handler?.getAppreciableLayers() ?? []; const layerCatalogs = this._handler?.getLayerCatalog() ?? []; const catalogIds = this._getCatalogVisibleIds(layerCatalogs); @@ -535,7 +396,7 @@ export default class WebMapViewModel extends Events { this.appreciableLayers = layers.map(item => { return { ...item, - visible: this.getLayerVisible(item) + visible: this._getLayerVisible(item) }; }); this._updateLayerCatalogsVisible(layerCatalogs); @@ -551,7 +412,7 @@ export default class WebMapViewModel extends Events { private _getCatalogVisibleIds(layers: Array>) { const results = []; for (const layer of layers) { - results.push(this.getLayerVisibleId(layer)); + results.push(this._getLayerVisibleId(layer)); const { children } = layer; if (children && children.length > 0) { const result = this._getCatalogVisibleIds(children); @@ -561,7 +422,7 @@ export default class WebMapViewModel extends Events { return results; } - _addLayersSucceededHandler({ mapparams, layers, cacheLayerIds }) { + private _addLayersSucceededHandler({ mapparams, layers, cacheLayerIds }) { this.mapParams = mapparams; this._cacheCleanLayers = layers; this._cacheLayerIds = cacheLayerIds; @@ -573,19 +434,7 @@ export default class WebMapViewModel extends Events { }); } - _getMapInfo(mapInfo: Record) { - const type = +mapInfo.version.split('.')[0] === 3 ? 'WebMap3' : 'WebMap2'; - this._createMap(type, mapInfo); - } - - _createMap(type: 'MapStyle' | 'WebMap3' | 'WebMap2', mapInfo?: Record) { - const commonOptions: webMapOptions = { - ...this.options, - iportalServiceProxyUrlPrefix: this.webMapService.iportalServiceProxyUrl, - serverUrl: this.serverUrl, - withCredentials: this.withCredentials, - target: this.target - }; + private _createMap() { const commonEvents = { ...this.eventTypes.reduce((events, name) => { events[name] = params => { @@ -594,106 +443,35 @@ export default class WebMapViewModel extends Events { return events; }, {}), mapinitialized: this._mapInitializedHandler, - addlayerssucceeded: this._addLayersSucceededHandler + addlayerssucceeded: this._addLayersSucceededHandler, + beforeremovemap: this._beforeMoveMapHandler }; - switch (type) { - case 'MapStyle': - this._handler = this._createMapStyle(commonOptions, commonEvents); - break; - case 'WebMap3': - this._handler = this._createWebMapV3(commonOptions, commonEvents); - break; - default: - this._handler = this._createWebMapV2(commonOptions, commonEvents); - break; - } - let _mapInfo: Record = {}; - if (mapInfo) { - _mapInfo = { - ...mapInfo, - layers: typeof this.layerFilter === 'function' ? mapInfo.layers.filter(this.layerFilter) : mapInfo.layers - }; - } - this._handler.initializeMap(_mapInfo, this.map); - } - - private _getResizedZoom(bounds, mapContainerStyle, tileSize = 512, worldWidth = WORLD_WIDTH) { - const { width, height } = mapContainerStyle; - const lngArcLength = Math.abs(bounds.getEast() - bounds.getWest()); - const latArcLength = Math.abs(this._getBoundsRadian(bounds.getSouth()) - this._getBoundsRadian(bounds.getNorth())); - const lngResizeZoom = +Math.log2(worldWidth / ((lngArcLength / parseInt(width)) * tileSize)).toFixed(2); - const latResizeZoom = +Math.log2(worldWidth / ((latArcLength / parseInt(height)) * tileSize)).toFixed(2); - if (lngResizeZoom <= latResizeZoom) { - return lngResizeZoom; + this._handler = new mapboxgl.supermap.WebMap(this.mapId, this.options, this.mapOptions, this.map, this.layerFilter); + for (const type in commonEvents) { + this._handler.on(type, commonEvents[type]); } - return latResizeZoom; - } - - private _getBoundsRadian(point) { - return (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (point * Math.PI) / 360)); } - public setLayersVisible(isShow: boolean, ignoreIds?: string[], onlyClear?: boolean) { - // 只有 webmapv2 支持 - const visibility = isShow ? 'visible' : 'none'; - this._appreciableLayersVisibleMap.clear(); - if (!onlyClear) { - const layers = this._cacheLayerIds?.map(id => { - const layer = this.map.getLayer(id); - return { - id, - type: layer.type, - renderLayers: [id] - }; - }) ?? []; - this.updateLayersVisible(layers, visibility, ignoreIds); - return; - } - this._styleDataUpdatedHandler(); + private _beforeMoveMapHandler() { + this.map.off('styledata', this._styleDataUpdatedHandler); + this.map = null; } - clean() { - if (this.map) { - this.triggerEvent('beforeremovemap', {}); - this.map.off('styledata', this._styleDataUpdatedHandler); - this._handler?.clean(); - this._handler = null; - this.map = null; - if (this.mapOptions && (this.mapId || this.webMapInfo)) { - this.mapOptions.center = null; - this.mapOptions.zoom = null; + private _updateLayerCatalogsVisible(catalogs: Array>) { + for (const data of catalogs) { + data.visible = this._getLayerVisible(data); + if (data.type === 'group') { + this._updateLayerCatalogsVisible(data.children); } } } - cleanWebMap() { - this.clean(); - } - - private centerValid(center) { - if ( - center && - ((<[number, number]>center).length > 0 || - typeof center === mapboxgl.LngLat || - (<{ lng: number; lat: number }>center).lng) - ) { - return true; - } - return false; - } - - public updateOverlayLayer(layerInfo: any, features: any, mergeByField?: string) { - this._handler?.updateOverlayLayer?.(layerInfo, features, mergeByField); - } - - get cacheLayerIds(): string[] { - return this._cacheLayerIds || this._cacheCleanLayers.reduce((ids, item) => { - ids.push(...item.renderLayers); - return ids; - }, []); + private _getLayerVisible(layer: Record) { + const id = this._getLayerVisibleId(layer); + return this._appreciableLayersVisibleMap.has(id) ? this._appreciableLayersVisibleMap.get(id) : layer.visible; } - copyLayer(id: string, layerInfo: Record) { - return this._handler?.copyLayer?.(id, layerInfo); + private _getLayerVisibleId(layer: Record) { + return `${layer.type}-${layer.id}`; } } diff --git a/src/mapboxgl/web-map/__tests__/SourceListModel.spec.js b/src/mapboxgl/web-map/__tests__/SourceListModel.spec.js deleted file mode 100644 index 0ec6da27..00000000 --- a/src/mapboxgl/web-map/__tests__/SourceListModel.spec.js +++ /dev/null @@ -1,125 +0,0 @@ -import SourceList from '../SourceListModel'; - -describe('SourceList', () => { - it('excludeSourceNames', done => { - const layers = [ - { - id: 'CHINA_DARK', - type: 'raster', - source: 'CHINA_DARK', - minzoom: 0, - maxzoom: 12 - }, - { - id: 'tracklayer-1-line', - type: 'line', - source: 'tracklayer-1-line', - layout: { - 'line-cap': 'round', - 'line-join': 'round' - }, - paint: { - 'line-color': '#065726', - 'line-width': 5, - 'line-opacity': 0.8 - } - }, - { - id: 'tdt-search-line', - type: 'line', - source: 'tdt-search-line', - layout: { - 'line-cap': 'round', - 'line-join': 'round' - }, - paint: { - 'line-color': '#065726', - 'line-width': 5, - 'line-opacity': 0.8 - } - }, - { - id: 'tdt-route-line', - type: 'line', - source: 'tdt-route-line', - layout: { - 'line-cap': 'round', - 'line-join': 'round' - }, - paint: { - 'line-color': '#065726', - 'line-width': 5, - 'line-opacity': 0.8 - } - }, - { - id: 'smmeasure', - type: 'line', - source: 'smmeasure', - layout: { - 'line-cap': 'round', - 'line-join': 'round' - }, - paint: { - 'line-color': '#065726', - 'line-width': 5, - 'line-opacity': 0.8 - } - }, - - { - id: 'mapbox-gl-draw', - type: 'line', - source: 'mapbox-gl-draw', - layout: { - 'line-cap': 'round', - 'line-join': 'round' - }, - paint: { - 'line-color': '#065726', - 'line-width': 5, - 'line-opacity': 0.8 - } - }, - { - id: 'mapbox-gl-draw-line', - type: 'line', - source: 'mapbox-gl-draw', - layout: { - 'line-cap': 'round', - 'line-join': 'round' - }, - paint: { - 'line-color': '#065726', - 'line-width': 5, - 'line-opacity': 0.8 - } - } - ]; - const map = { - getStyle() { - return { - layers - }; - }, - getSource() { - return { - type: 'geojson', - data: { - type: 'FeatureCollection', - features: [] - } - }; - }, - getLayer(id) { - return layers.find(layer => layer.id === id); - }, - overlayLayersManager: {} - }; - const sourceList = new SourceList({ map }); - const appreciableLayers = sourceList.getLayers(); - expect(appreciableLayers.length).toBe(1); - done(); - }); -}); - diff --git a/src/mapboxgl/web-map/control/fill-extrusion/FillExtrusionViewModel.ts b/src/mapboxgl/web-map/control/fill-extrusion/FillExtrusionViewModel.ts index f157a477..52ce6219 100644 --- a/src/mapboxgl/web-map/control/fill-extrusion/FillExtrusionViewModel.ts +++ b/src/mapboxgl/web-map/control/fill-extrusion/FillExtrusionViewModel.ts @@ -1,5 +1,4 @@ import mapboxgl from 'vue-iclient/static/libs/mapboxgl/mapbox-gl-enhance'; -import SourceListModel from 'vue-iclient/src/mapboxgl/web-map/SourceListModel'; import cloneDeep from 'lodash.clonedeep'; export interface layerStyleParams { @@ -109,7 +108,7 @@ export default class FillExtrusionViewModel extends mapboxgl.Evented { } private _getSourceList() { - const sourceListModel = new SourceListModel({ + const sourceListModel = new mapboxgl.supermap.SourceListModel({ map: this.map, layers: [] }); diff --git a/static/libs/iclient-leaflet/iclient-leaflet.min.js b/static/libs/iclient-leaflet/iclient-leaflet.min.js index 28df5e67..35378fe3 100644 --- a/static/libs/iclient-leaflet/iclient-leaflet.min.js +++ b/static/libs/iclient-leaflet/iclient-leaflet.min.js @@ -1,1741 +1,8 @@ /*! * - * iclient-leaflet.(http://iclient.supermap.io) - * Copyright© 2000 - 2019 SuperMap Software Co.Ltd + * iclient-leaflet + * Copyright© 2000 - 2024 SuperMap Software Co.Ltd * license: Apache-2.0 - * version: v10.0.0 - * - */!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=608)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t.SuperMap=window.SuperMap=window.SuperMap||{}).Components=window.SuperMap.Components||{}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(0); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/r(64);var a,o,s;t.Util=i.SuperMap.Util=i.SuperMap.Util||{};i.SuperMap.Util.extend=function(e,t){if(e=e||{},t){for(var r in t){var n=t[r];void 0!==n&&(e[r]=n)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},i.SuperMap.Util.copy=function(e,t){var r;if(e=e||{},t)for(var n in e)void 0!==(r=t[n])&&(e[n]=r)},i.SuperMap.Util.reset=function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"===n(e[t])&&e[t]instanceof Array){for(var r in e[t])e[t][r].destroy&&e[t][r].destroy();e[t].length=0}else"object"===n(e[t])&&e[t]instanceof Object&&e[t].destroy&&e[t].destroy();e[t]=null}},i.SuperMap.Util.getElement=function(){for(var e=[],t=0,r=arguments.length;t=0;r--)e[r]===t&&e.splice(r,1);return e},i.SuperMap.Util.indexOf=function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r=0&&parseFloat(s)<1?(e.style.filter="alpha(opacity="+100*s+")",e.style.opacity=s):1===parseFloat(s)&&(e.style.filter="",e.style.opacity="")},i.SuperMap.Util.applyDefaults=function(e,t){e=e||{};var r="function"==typeof window.Event&&t instanceof window.Event;for(var n in t)(void 0===e[n]||!r&&t.hasOwnProperty&&t.hasOwnProperty(n)&&!e.hasOwnProperty(n))&&(e[n]=t[n]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},i.SuperMap.Util.getParameterString=function(e){var t=[];for(var r in e){var i=e[r];if(null!=i&&"function"!=typeof i){var a;if("object"===(void 0===i?"undefined":n(i))&&i.constructor===Array){for(var o,s=[],l=0,u=i.length;l1?1/e:e},i.SuperMap.Util.getResolutionFromScale=function(e,t){var r;e&&(null==t&&(t="degrees"),r=1/(i.SuperMap.Util.normalizeScale(e)*i.SuperMap.INCHES_PER_UNIT[t]*i.SuperMap.DOTS_PER_INCH));return r},i.SuperMap.Util.getScaleFromResolution=function(e,t){return null==t&&(t="degrees"),e*i.SuperMap.INCHES_PER_UNIT[t]*i.SuperMap.DOTS_PER_INCH},i.SuperMap.IS_GECKO=-1===(a=navigator.userAgent.toLowerCase()).indexOf("webkit")&&-1!==a.indexOf("gecko"),i.SuperMap.Browser=function(){var e,t="",r="",n="pc",i=navigator.userAgent.toLowerCase();return i.indexOf("msie")>-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(t="msie",e=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(t="chrome",e=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(t="firefox",e=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(t="opera",e=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(t="safari",e=i.match(/version\/([\d.]+)/)),r=e?e[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?n="apple":i.indexOf("android")>-1&&(r=(e=i.match(/version\/([\d.]+)/))?e[1]:"",n="android"),{name:t,version:r,device:n}}(),i.SuperMap.Util.getBrowser=function(){return i.SuperMap.Browser},i.SuperMap.Util.isSupportCanvas=(o=!0,s=i.SuperMap.Util.getBrowser(),document.createElement("canvas").getContext?("firefox"===s.name&&parseFloat(s.version)<5&&(o=!1),"safari"===s.name&&parseFloat(s.version)<4&&(o=!1),"opera"===s.name&&parseFloat(s.version)<10&&(o=!1),"msie"===s.name&&parseFloat(s.version)<9&&(o=!1)):o=!1,o),i.SuperMap.Util.supportCanvas=function(){return i.SuperMap.Util.isSupportCanvas},i.SuperMap.INCHES_PER_UNIT.degree=i.SuperMap.INCHES_PER_UNIT.dd,i.SuperMap.INCHES_PER_UNIT.meter=i.SuperMap.INCHES_PER_UNIT.m,i.SuperMap.INCHES_PER_UNIT.foot=i.SuperMap.INCHES_PER_UNIT.ft,i.SuperMap.INCHES_PER_UNIT.inch=i.SuperMap.INCHES_PER_UNIT.inches,i.SuperMap.INCHES_PER_UNIT.mile=i.SuperMap.INCHES_PER_UNIT.mi,i.SuperMap.INCHES_PER_UNIT.kilometer=i.SuperMap.INCHES_PER_UNIT.km,i.SuperMap.INCHES_PER_UNIT.yard=i.SuperMap.INCHES_PER_UNIT.yd,i.SuperMap.Util.isInTheSameDomain=function(e){if(!e)return!0;var t=e.indexOf("//"),r=document.location.toString(),n=r.indexOf("//");if(-1===t)return!0;var i,a=i=e.substring(0,t),o=r.substring(n+2);n=o.indexOf("/");var s=o.indexOf(":"),l=o.substring(0,n),u=document.location.protocol;if(-1!==s||(l+=":"+("http:"===u.toLowerCase()?80:443)),u.toLowerCase()!==a.toLowerCase())return!1;var c=(a=e.substring(t+2)).indexOf(":");t=a.indexOf("/");var p,h=a.substring(0,t);return-1!==c?p=a.substring(0,c):(p=a.substring(0,t),h+=":"+("http:"===i.toLowerCase()?80:443)),p===document.domain&&h===l},i.SuperMap.Util.calculateDpi=function(e,t,r,n,i){if(e&&t&&r){var a,o=e.getWidth(),s=e.getHeight(),l=t.w,u=t.h;if(i=i||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){var c=o/l,p=s/u;a=254/(c>p?c:p)/r/(2*Math.PI*i/360)/1e4}else{a=254/(o/l)/r/1e4}return a}},i.SuperMap.Util.toJSON=function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return t=(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r=[],a=0,o=t.length;a0?"{"+c.join(",")+"}":"{}"}return t.toString()}},i.SuperMap.Util.getResolutionFromScaleDpi=function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?(e=i.SuperMap.Util.normalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4):-1},i.SuperMap.Util.getScaleFromResolutionDpi=function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4:-1},i.SuperMap.Util.transformResult=function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},i.SuperMap.Util.copyAttributes=function(e,t){if(e=e||{},t)for(var r in t){var n=t[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(e[r]=n)}return e},i.SuperMap.Util.copyAttributesWithClip=function(e,t,r){if(e=e||{},t)for(var n in t){var i=!1;if(r&&r.length)for(var a=0,o=r.length;a=0&&o<=1&&a<=1&&o>=0?new i.SuperMap.Geometry.Point(e.x+a*(t.x-e.x),e.y+a*(t.y-e.y)):"No Intersection";else if(0==l&&0==u){var p=Math.max(e.y,t.y),h=Math.min(e.y,t.y),f=Math.max(e.x,t.x),d=Math.min(e.x,t.x);s=(r.y>=h&&r.y<=p||n.y>=h&&n.y<=p)&&r.x>=d&&r.x<=f||n.x>=d&&n.x<=f?"Coincident":"Parallel"}else s="Parallel";return s},i.SuperMap.Util.getTextBounds=function(e,t,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",e.fontSize&&(r.style.fontSize=e.fontSize),e.fontFamily&&(r.style.fontFamily=e.fontFamily),e.fontWeight&&(r.style.fontWeight=e.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=t;var n=r.clientWidth,i=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:i}}},function(e,t){e.exports=L},function(e,t,r){"use strict";var n=a(r(2));r(111),r(192),r(179);var i=a(r(12));function a(e){return e&&e.__esModule?e:{default:e}}n.default.supermap=n.default.supermap||{}, -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -n.default.supermap.control=n.default.supermap.control||{},n.default.supermap.components=n.default.supermap.components||{},n.default.Control.Attribution.include({options:{position:"bottomright",prefix:i.default.Prefix}}),n.default.Map.include({latLngToAccurateContainerPoint:function(e){var t=this.project(n.default.latLng(e))._subtract(this.getPixelOrigin());return n.default.point(t).add(this._getMapPanePos())}}),[n.default.Polyline,n.default.Polygon,n.default.Marker,n.default.CircleMarker,n.default.Circle,n.default.LayerGroup].map(function(e){return e.defaultFunction=e.prototype.toGeoJSON,e.include({toGeoJSON:function(t){return e.defaultFunction.call(this,t||10)}}),e})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RasterFunctionType=t.GetFeatureMode=t.AggregationQueryBuilderType=t.AggregationType=t.TopologyValidatorRule=t.SummaryType=t.StatisticAnalystMode=t.AnalystSizeUnit=t.AnalystAreaUnit=t.ClipAnalystMode=t.ChartType=t.ClientType=t.Exponent=t.VariogramMode=t.InterpolationAlgorithmType=t.SearchMode=t.PixelFormat=t.StatisticMode=t.UGCLayerType=t.LayerType=t.ColorSpaceType=t.GridType=t.TransferPreference=t.TransferTactic=t.EditType=t.DataReturnMode=t.SurfaceAnalystMethod=t.SmoothMethod=t.OutputType=t.OverlayOperationType=t.BufferEndType=t.TurnType=t.SupplyCenterType=t.SideType=t.DirectionType=t.LabelOverLengthMode=t.LabelBackShape=t.AlongLineDirection=t.FillGradientMode=t.TextAlignment=t.ColorGradientType=t.ThemeType=t.RangeMode=t.GraduatedMode=t.GraphAxesTextDisplayMode=t.ThemeGraphType=t.ThemeGraphTextFormat=t.EngineType=t.BufferRadiusUnit=t.Unit=t.MeasureMode=t.SpatialRelationType=t.SpatialQueryMode=t.JoinType=t.QueryOption=t.GeometryType=t.ServerType=t.DataFormat=void 0;var n=r(0),i=n.SuperMap.DataFormat={GEOJSON:"GEOJSON",ISERVER:"ISERVER"}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.DataFormat=i;var a=n.SuperMap.ServerType={ISERVER:"ISERVER",IPORTAL:"IPORTAL",ONLINE:"ONLINE"};t.ServerType=a;var o=n.SuperMap.GeometryType={LINE:"LINE",LINEM:"LINEM",POINT:"POINT",REGION:"REGION",POINTEPS:"POINTEPS",LINEEPS:"LINEEPS",REGIONEPS:"REGIONEPS",ELLIPSE:"ELLIPSE",CIRCLE:"CIRCLE",TEXT:"TEXT",RECTANGLE:"RECTANGLE",UNKNOWN:"UNKNOWN"};t.GeometryType=o;var s=n.SuperMap.QueryOption={ATTRIBUTE:"ATTRIBUTE",ATTRIBUTEANDGEOMETRY:"ATTRIBUTEANDGEOMETRY",GEOMETRY:"GEOMETRY"};t.QueryOption=s;var l=n.SuperMap.JoinType={INNERJOIN:"INNERJOIN",LEFTJOIN:"LEFTJOIN"};t.JoinType=l;var u=n.SuperMap.SpatialQueryMode={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"};t.SpatialQueryMode=u;var c=n.SuperMap.SpatialRelationType={CONTAIN:"CONTAIN",INTERSECT:"INTERSECT",WITHIN:"WITHIN"};t.SpatialRelationType=c;var p=n.SuperMap.MeasureMode={DISTANCE:"DISTANCE",AREA:"AREA"};t.MeasureMode=p;var h=n.SuperMap.Unit={METER:"METER",KILOMETER:"KILOMETER",MILE:"MILE",YARD:"YARD",DEGREE:"DEGREE",MILLIMETER:"MILLIMETER",CENTIMETER:"CENTIMETER",INCH:"INCH",DECIMETER:"DECIMETER",FOOT:"FOOT",SECOND:"SECOND",MINUTE:"MINUTE",RADIAN:"RADIAN"};t.Unit=h;var f=n.SuperMap.BufferRadiusUnit={CENTIMETER:"CENTIMETER",DECIMETER:"DECIMETER",FOOT:"FOOT",INCH:"INCH",KILOMETER:"KILOMETER",METER:"METER",MILE:"MILE",MILLIMETER:"MILLIMETER",YARD:"YARD"};t.BufferRadiusUnit=f;var d=n.SuperMap.EngineType={IMAGEPLUGINS:"IMAGEPLUGINS",OGC:"OGC",ORACLEPLUS:"ORACLEPLUS",SDBPLUS:"SDBPLUS",SQLPLUS:"SQLPLUS",UDB:"UDB"};t.EngineType=d;var y=n.SuperMap.ThemeGraphTextFormat={CAPTION:"CAPTION",CAPTION_PERCENT:"CAPTION_PERCENT",CAPTION_VALUE:"CAPTION_VALUE",PERCENT:"PERCENT",VALUE:"VALUE"};t.ThemeGraphTextFormat=y;var v=n.SuperMap.ThemeGraphType={AREA:"AREA",BAR:"BAR",BAR3D:"BAR3D",LINE:"LINE",PIE:"PIE",PIE3D:"PIE3D",POINT:"POINT",RING:"RING",ROSE:"ROSE",ROSE3D:"ROSE3D",STACK_BAR:"STACK_BAR",STACK_BAR3D:"STACK_BAR3D",STEP:"STEP"};t.ThemeGraphType=v;var m=n.SuperMap.GraphAxesTextDisplayMode={ALL:"ALL",NONE:"NONE",YAXES:"YAXES"};t.GraphAxesTextDisplayMode=m;var g=n.SuperMap.GraduatedMode={CONSTANT:"CONSTANT",LOGARITHM:"LOGARITHM",SQUAREROOT:"SQUAREROOT"};t.GraduatedMode=g;var b=n.SuperMap.RangeMode={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"};t.RangeMode=b;var S=n.SuperMap.ThemeType={DOTDENSITY:"DOTDENSITY",GRADUATEDSYMBOL:"GRADUATEDSYMBOL",GRAPH:"GRAPH",LABEL:"LABEL",RANGE:"RANGE",UNIQUE:"UNIQUE"};t.ThemeType=S;var _=n.SuperMap.ColorGradientType={BLACK_WHITE:"BLACKWHITE",BLUE_BLACK:"BLUEBLACK",BLUE_RED:"BLUERED",BLUE_WHITE:"BLUEWHITE",CYAN_BLACK:"CYANBLACK",CYAN_BLUE:"CYANBLUE",CYAN_GREEN:"CYANGREEN",CYAN_WHITE:"CYANWHITE",GREEN_BLACK:"GREENBLACK",GREEN_BLUE:"GREENBLUE",GREEN_ORANGE_VIOLET:"GREENORANGEVIOLET",GREEN_RED:"GREENRED",GREEN_WHITE:"GREENWHITE",PINK_BLACK:"PINKBLACK",PINK_BLUE:"PINKBLUE",PINK_RED:"PINKRED",PINK_WHITE:"PINKWHITE",RAIN_BOW:"RAINBOW",RED_BLACK:"REDBLACK",RED_WHITE:"REDWHITE",SPECTRUM:"SPECTRUM",TERRAIN:"TERRAIN",YELLOW_BLACK:"YELLOWBLACK",YELLOW_BLUE:"YELLOWBLUE",YELLOW_GREEN:"YELLOWGREEN",YELLOW_RED:"YELLOWRED",YELLOW_WHITE:"YELLOWWHITE"};t.ColorGradientType=_;var P=n.SuperMap.TextAlignment={TOPLEFT:"TOPLEFT",TOPCENTER:"TOPCENTER",TOPRIGHT:"TOPRIGHT",BASELINELEFT:"BASELINELEFT",BASELINECENTER:"BASELINECENTER",BASELINERIGHT:"BASELINERIGHT",BOTTOMLEFT:"BOTTOMLEFT",BOTTOMCENTER:"BOTTOMCENTER",BOTTOMRIGHT:"BOTTOMRIGHT",MIDDLELEFT:"MIDDLELEFT",MIDDLECENTER:"MIDDLECENTER",MIDDLERIGHT:"MIDDLERIGHT"};t.TextAlignment=P;var O=n.SuperMap.FillGradientMode={NONE:"NONE",LINEAR:"LINEAR",RADIAL:"RADIAL",CONICAL:"CONICAL",SQUARE:"SQUARE"};t.FillGradientMode=O;var w=n.SuperMap.AlongLineDirection={NORMAL:"ALONG_LINE_NORMAL",LB_TO_RT:"LEFT_BOTTOM_TO_RIGHT_TOP",LT_TO_RB:"LEFT_TOP_TO_RIGHT_BOTTOM",RB_TO_LT:"RIGHT_BOTTOM_TO_LEFT_TOP",RT_TO_LB:"RIGHT_TOP_TO_LEFT_BOTTOM"};t.AlongLineDirection=w;var M=n.SuperMap.LabelBackShape={DIAMOND:"DIAMOND",ELLIPSE:"ELLIPSE",MARKER:"MARKER",NONE:"NONE",RECT:"RECT",ROUNDRECT:"ROUNDRECT",TRIANGLE:"TRIANGLE"};t.LabelBackShape=M;var T=n.SuperMap.LabelOverLengthMode={NEWLINE:"NEWLINE",NONE:"NONE",OMIT:"OMIT"};t.LabelOverLengthMode=T;var C=n.SuperMap.DirectionType={EAST:"EAST",NONE:"NONE",NORTH:"NORTH",SOURTH:"SOURTH",WEST:"WEST"};t.DirectionType=C;var x=n.SuperMap.SideType={LEFT:"LEFT",MIDDLE:"MIDDLE",NONE:"NONE",RIGHT:"RIGHT"};t.SideType=x;var E=n.SuperMap.SupplyCenterType={FIXEDCENTER:"FIXEDCENTER",NULL:"NULL",OPTIONALCENTER:"OPTIONALCENTER"};t.SupplyCenterType=E;var L=n.SuperMap.TurnType={AHEAD:"AHEAD",BACK:"BACK",END:"END",LEFT:"LEFT",NONE:"NONE",RIGHT:"RIGHT"};t.TurnType=L;var A=n.SuperMap.BufferEndType={FLAT:"FLAT",ROUND:"ROUND"};t.BufferEndType=A;var k=n.SuperMap.OverlayOperationType={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"};t.OverlayOperationType=k;var j=n.SuperMap.OutputType={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"};t.OutputType=j;var F=n.SuperMap.SmoothMethod={BSPLINE:"BSPLINE",POLISH:"POLISH"};t.SmoothMethod=F;var I=n.SuperMap.SurfaceAnalystMethod={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"};t.SurfaceAnalystMethod=I;var N=n.SuperMap.DataReturnMode={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"};t.DataReturnMode=N;var R=n.SuperMap.EditType={ADD:"add",UPDATE:"update",DELETE:"delete"};t.EditType=R;var D=n.SuperMap.TransferTactic={LESS_TIME:"LESS_TIME",LESS_TRANSFER:"LESS_TRANSFER",LESS_WALK:"LESS_WALK",MIN_DISTANCE:"MIN_DISTANCE"};t.TransferTactic=D;var G=n.SuperMap.TransferPreference={BUS:"BUS",SUBWAY:"SUBWAY",NO_SUBWAY:"NO_SUBWAY",NONE:"NONE"};t.TransferPreference=G;var B=n.SuperMap.GridType={CROSS:"CROSS",GRID:"GRID",POINT:"POINT"};t.GridType=B;var U=n.SuperMap.ColorSpaceType={CMYK:"CMYK",RGB:"RGB"};t.ColorSpaceType=U;var V=n.SuperMap.LayerType={UGC:"UGC",WMS:"WMS",WFS:"WFS",CUSTOM:"CUSTOM"};t.LayerType=V;var J=n.SuperMap.UGCLayerType={THEME:"THEME",VECTOR:"VECTOR",GRID:"GRID",IMAGE:"IMAGE"};t.UGCLayerType=J;var z=n.SuperMap.StatisticMode={AVERAGE:"AVERAGE",MAX:"MAX",MIN:"MIN",STDDEVIATION:"STDDEVIATION",SUM:"SUM",VARIANCE:"VARIANCE"};t.StatisticMode=z;var H=n.SuperMap.PixelFormat={BIT16:"BIT16",BIT32:"BIT32",BIT64:"BIT64",SINGLE:"SINGLE",DOUBLE:"DOUBLE",UBIT1:"UBIT1",UBIT4:"UBIT4",UBIT8:"UBIT8",UBIT24:"UBIT24",UBIT32:"UBIT32"};t.PixelFormat=H;var q=n.SuperMap.SearchMode={KDTREE_FIXED_COUNT:"KDTREE_FIXED_COUNT",KDTREE_FIXED_RADIUS:"KDTREE_FIXED_RADIUS",NONE:"NONE",QUADTREE:"QUADTREE"};t.SearchMode=q;var W=n.SuperMap.InterpolationAlgorithmType={KRIGING:"KRIGING",SimpleKriging:"SimpleKriging",UniversalKriging:"UniversalKriging"};t.InterpolationAlgorithmType=W;var Q=n.SuperMap.VariogramMode={EXPONENTIAL:"EXPONENTIAL",GAUSSIAN:"GAUSSIAN",SPHERICAL:"SPHERICAL"};t.VariogramMode=Q;var Y=n.SuperMap.Exponent={EXP1:"EXP1",EXP2:"EXP2"};t.Exponent=Y;var X=n.SuperMap.ClientType={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"};t.ClientType=X;var K=n.SuperMap.ChartType={BAR:"Bar",BAR3D:"Bar3D",CIRCLE:"Circle",PIE:"Pie",POINT:"Point",LINE:"Line",RING:"Ring"};t.ChartType=K;var Z=n.SuperMap.ClipAnalystMode={CLIP:"clip",INTERSECT:"intersect"};t.ClipAnalystMode=Z;var $=n.SuperMap.AnalystAreaUnit={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"};t.AnalystAreaUnit=$;var ee=n.SuperMap.AnalystSizeUnit={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"};t.AnalystSizeUnit=ee;var te=n.SuperMap.StatisticAnalystMode={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"};t.StatisticAnalystMode=te;var re=n.SuperMap.SummaryType={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"};t.SummaryType=re;var ne=n.SuperMap.TopologyValidatorRule={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"};t.TopologyValidatorRule=ne;var ie=n.SuperMap.AggregationType={GEOHASH_GRID:"geohash_grid",FILTER:"filter"};t.AggregationType=ie;var ae=n.SuperMap.AggregationQueryBuilderType={GEO_BOUNDING_BOX:"geo_bounding_box"};t.AggregationQueryBuilderType=ae;var oe=n.SuperMap.GetFeatureMode={BOUNDS:"BOUNDS",BUFFER:"BUFFER",ID:"ID",SPATIAL:"SPATIAL",SQL:"SQL"};t.GetFeatureMode=oe;var se=n.SuperMap.RasterFunctionType={NDVI:"NDVI",HILLSHADE:"HILLSHADE"};t.RasterFunctionType=se},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zh=t.en=t.Lang=t.ElasticSearch=t.ThemeStyle=t.CartoCSS=t.TokenServiceParameter=t.ServerInfo=t.SecurityManager=t.KeyServiceParameter=t.SUtil=t.LevelRendererVector=t.Util=t.Transformable=t.Storage=t.SmicText=t.SmicStar=t.SmicSector=t.SmicRing=t.SmicRectangle=t.SmicPolygon=t.SmicPoint=t.SmicIsogon=t.SmicImage=t.SmicEllipse=t.SmicCircle=t.SmicBrokenLine=t.Shape=t.PaintLayer=t.Painter=t.Matrix=t.Math=void 0,t.Log=t.Http=t.Handler=t.Group=t.Eventful=t.LevelRendererEvent=t.Env=t.Easing=t.LevelRendererCurve=t.Config=t.ComputeBoundingBox=t.Color=t.Clip=t.Area=t.Animator=t.Animation=t.Render=t.LevelRenderer=t.FeatureTheme=t.Sector=t.FeatureRectangle=t.FeaturePolygon=t.Point=t.FeatureLine=t.Label=t.Image=t.FeatureCircle=t.ShapeParameters=t.ShapeFactory=t.ThemeVector=t.Ring=t.RankSymbol=t.OverlayPoint=t.Pie=t.Line=t.Graph=t.Circle=t.Bar3D=t.Bar=t.OnlineServiceBase=t.FilterField=t.DataItemOrderBy=t.DataItemType=t.ServiceStatus=t.OnlineQueryDatasParameter=t.OnlineData=t.Online=t.HillshadeParameter=t.NDVIParameter=t.RasterFunctionParameter=t.VectorClipJobsService=t.VectorClipJobsParameter=t.Vector=t.UpdateTurnNodeWeightService=t.UpdateTurnNodeWeightParameters=t.UpdateEdgeWeightService=t.UpdateEdgeWeightParameters=t.UGCSubLayer=t.UGCMapLayer=t.UGCLayer=t.TransferSolutionParameters=t.TransportationAnalystResultSetting=t.TransportationAnalystParameter=t.TransferSolutionService=t.TransferPathService=t.TransferPathParameters=t.TransferLine=t.TopologyValidatorJobsService=t.TopologyValidatorJobsParameter=t.TilesetsService=t.GeometryBatchAnalystService=t.ThiessenAnalystService=t.ThiessenAnalystParameters=t.ThemeUniqueItem=t.ThemeUnique=t.ThemeService=t.ThemeRangeItem=t.ThemeRange=t.ThemeParameters=t.ThemeOffset=t.ThemeMemoryData=t.ThemeLabelUniqueItem=t.ThemeLabelText=t.ThemeLabelItem=t.ThemeLabelBackground=t.ThemeLabelAlongLine=t.ThemeLabel=t.ThemeGridUniqueItem=t.ThemeGridUnique=t.ThemeGridRangeItem=t.ThemeGridRange=t.ThemeGraphText=t.ThemeGraphSize=t.ThemeGraphItem=t.ThemeGraphAxes=t.ThemeGraph=t.ThemeGraduatedSymbolStyle=t.ThemeGraduatedSymbol=t.ThemeFlow=t.ThemeDotDensity=void 0,t.Theme=t.TerrainCurvatureCalculationService=t.TerrainCurvatureCalculationParameters=t.SurfaceAnalystService=t.SurfaceAnalystParametersSetting=t.SurfaceAnalystParameters=t.SupplyCenter=t.SummaryRegionJobsService=t.SummaryRegionJobParameter=t.SummaryMeshJobsService=t.SummaryMeshJobParameter=t.SummaryAttributesJobsService=t.SummaryAttributesJobsParameter=t.StopQueryService=t.StopQueryParameters=t.SpatialAnalystBase=t.SingleObjectQueryJobsService=t.SingleObjectQueryJobsParameter=t.SetLayerStatusService=t.SetLayerStatusParameters=t.SetLayersInfoService=t.SetLayersInfoParameters=t.SetLayerInfoService=t.SetLayerInfoParameters=t.ServerTheme=t.ServerTextStyle=t.ServerStyle=t.ServerGeometry=t.ServerFeature=t.ServerColor=t.RouteLocatorService=t.RouteLocatorParameters=t.RouteCalculateMeasureService=t.RouteCalculateMeasureParameters=t.Route=t.QueryService=t.QueryParameters=t.QueryBySQLService=t.QueryBySQLParameters=t.QueryByGeometryService=t.QueryByGeometryParameters=t.QueryByDistanceService=t.QueryByDistanceParameters=t.QueryByBoundsService=t.QueryByBoundsParameters=t.ProcessingServiceBase=t.PointWithMeasure=t.OverlayGeoJobsService=t.OverlayGeoJobParameter=t.OverlayAnalystService=t.OverlayAnalystParameters=t.OverlapDisplayedOptions=t.MappingParameters=t.OutputSetting=t.NetworkAnalystServiceBase=t.MeasureService=t.MeasureParameters=t.MathExpressionAnalysisService=t.MathExpressionAnalysisParameters=t.MapService=t.LinkItem=t.LayerStatus=t.LabelThemeCell=t.LabelSymbolCell=t.LabelMixedTextStyle=t.LabelMatrixCell=t.LabelImageCell=t.KernelDensityJobsService=t.KernelDensityJobParameter=t.JoinItem=t.InterpolationRBFAnalystParameters=t.InterpolationKrigingAnalystParameters=t.InterpolationIDWAnalystParameters=t.InterpolationAnalystService=t.InterpolationAnalystParameters=t.UGCImage=t.Grid=t.GetLayersInfoService=t.GetGridCellInfosService=t.GetGridCellInfosParameters=t.GetFieldsService=t.GetFeaturesServiceBase=t.GetFeaturesParametersBase=t.GetFeaturesBySQLService=t.GetFeaturesBySQLParameters=t.GetFeaturesByIDsService=t.GetFeaturesByIDsParameters=t.GetFeaturesByGeometryService=t.GetFeaturesByGeometryParameters=t.GetFeaturesByBufferService=t.GetFeaturesByBufferParameters=t.GetFeaturesByBoundsService=t.GetFeaturesByBoundsParameters=t.GeoRelationAnalystService=t.GeoRelationAnalystParameters=t.GeometryThiessenAnalystParameters=t.GeometrySurfaceAnalystParameters=t.GeometryOverlayAnalystParameters=t.GeometryBufferAnalystParameters=t.GeoHashGridAggParameter=void 0,t.GeoDecodingParameter=t.GeoCodingParameter=t.GeoBoundingBoxQueryBuilderParameter=t.GenerateSpatialDataService=t.GenerateSpatialDataParameters=t.FindTSPPathsService=t.FindTSPPathsParameters=t.FindServiceAreasService=t.FindServiceAreasParameters=t.FindPathService=t.FindPathParameters=t.FindMTSPPathsService=t.FindMTSPPathsParameters=t.FindLocationService=t.FindLocationParameters=t.FindClosestFacilitiesService=t.FindClosestFacilitiesParameters=t.FilterParameter=t.FilterAggParameter=t.FieldStatisticsParameters=t.FieldStatisticService=t.FieldParameters=t.FacilityAnalystUpstream3DService=t.FacilityAnalystUpstream3DParameters=t.FacilityAnalystTraceup3DService=t.FacilityAnalystTraceup3DParameters=t.FacilityAnalystTracedown3DService=t.FacilityAnalystTracedown3DParameters=t.FacilityAnalystStreamService=t.FacilityAnalystStreamParameters=t.FacilityAnalystSources3DService=t.FacilityAnalystSources3DParameters=t.FacilityAnalystSinks3DService=t.FacilityAnalystSinks3DParameters=t.FacilityAnalyst3DParameters=t.EditFeaturesService=t.EditFeaturesParameters=t.DensityKernelAnalystParameters=t.DensityAnalystService=t.DatasourceConnectionInfo=t.DatasetThiessenAnalystParameters=t.DatasetSurfaceAnalystParameters=t.DatasetOverlayAnalystParameters=t.DatasetInfo=t.DatasetBufferAnalystParameters=t.DataReturnOption=t.DataFlowService=t.ComputeWeightMatrixService=t.ComputeWeightMatrixParameters=t.CommonServiceBase=t.ColorDictionary=t.ClipParameter=t.ChartQueryService=t.ChartQueryParameters=t.ChartQueryFilterParameter=t.ChartFeatureInfoSpecsService=t.BurstPipelineAnalystService=t.BurstPipelineAnalystParameters=t.BuffersAnalystJobsService=t.BuffersAnalystJobsParameter=t.BufferSetting=t.BufferDistance=t.BufferAnalystService=t.BufferAnalystParameters=t.AreaSolarRadiationService=t.AreaSolarRadiationParameters=t.AggQueryBuilderParameter=t.AggregationParameter=t.AddressMatchService=t.IPortalMapdashboardsQueryParam=t.IPortalMapdashboard=t.IPortalServicesQueryParam=t.IPortalServiceBase=t.IPortalService=t.IPortalScenesQueryParam=t.IPortalScene=t.IPortalInsightsQueryParam=t.IPortalInsight=t.IPortalMapsQueryParam=t.IPortalMap=t.IPortal=t.IManagerServiceBase=t.IManagerCreateNodeParam=t.IManager=t.ArrayStatistic=t.ColorsPickerUtil=t.FetchRequest=t.getRequestTimeout=t.setRequestTimeout=t.isCORS=t.setCORS=t.WKT=t.JSONFormat=t.GeoJSON=t.Format=t.TimeFlowControl=t.TimeControlBase=t.GeometryVector=t.CommonUtil=t.Size=void 0,t.Pixel=t.LonLat=t.Geometry=t.Feature=t.Events=t.Event=t.DateExt=t.Credential=t.Bounds=t.ArrayExt=t.FunctionExt=t.NumberExt=t.StringExt=t.Rectangle=t.Polygon=t.GeometryPoint=t.MultiPolygon=t.MultiPoint=t.MultiLineString=t.LineString=t.LinearRing=t.GeoText=t.Curve=t.Collection=t.RasterFunctionType=t.GetFeatureMode=t.AggregationType=t.AggregationQueryBuilderType=t.OutputType=t.TopologyValidatorRule=t.StatisticAnalystMode=t.AnalystSizeUnit=t.AnalystAreaUnit=t.ClipAnalystMode=t.Exponent=t.VariogramMode=t.InterpolationAlgorithmType=t.SummaryType=t.SearchMode=t.PixelFormat=t.StatisticMode=t.UGCLayerType=t.LayerType=t.ClientType=t.GridType=t.TransferPreference=t.TransferTactic=t.EditType=t.ChartType=t.ColorSpaceType=t.SurfaceAnalystMethod=t.SmoothMethod=t.BufferEndType=t.TurnType=t.SupplyCenterType=t.OverlayOperationType=t.DirectionType=t.LabelOverLengthMode=t.LabelBackShape=t.AlongLineDirection=t.SideType=t.FillGradientMode=t.TextAlignment=t.ColorGradientType=t.ThemeType=t.RangeMode=t.GraduatedMode=t.GraphAxesTextDisplayMode=t.ThemeGraphType=t.ThemeGraphTextFormat=t.SpatialQueryMode=t.BufferRadiusUnit=t.Unit=t.DataReturnMode=t.SpatialRelationType=t.MeasureMode=t.EngineType=t.JoinType=t.QueryOption=t.GeometryType=t.ServerType=t.DataFormat=t.SuperMap=t.ChartViewModel=t.ChartView=t.FileReaderUtil=t.ComponentsUtil=t.PaginationContainer=t.NavTabsPage=t.CityTabsPage=t.IndexTabsPageContainer=t.PopContainer=t.AttributesPopContainer=t.Select=t.DropDownBox=t.CommonContainer=t.MessageBox=t.FileModel=t.FileConfig=t.FileTypes=void 0;var n=r(0),i=r(4),a=r(606),o=r(603),s=r(601),l=r(599),u=r(590),c=r(588),p=r(513),h=r(510),f=r(506),d=r(502),y=r(499),v=r(495),m=r(479),g=r(465); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.FileTypes=m.FileTypes,t.FileConfig=m.FileConfig,t.FileModel=m.FileModel,t.MessageBox=m.MessageBox,t.CommonContainer=m.CommonContainer,t.DropDownBox=m.DropDownBox,t.Select=m.Select,t.AttributesPopContainer=m.AttributesPopContainer,t.PopContainer=m.PopContainer,t.IndexTabsPageContainer=m.IndexTabsPageContainer,t.CityTabsPage=m.CityTabsPage,t.NavTabsPage=m.NavTabsPage,t.PaginationContainer=m.PaginationContainer,t.ComponentsUtil=m.ComponentsUtil,t.FileReaderUtil=m.FileReaderUtil,t.ChartView=m.ChartView,t.ChartViewModel=m.ChartViewModel,t.SuperMap=n.SuperMap,t.DataFormat=i.DataFormat,t.ServerType=i.ServerType,t.GeometryType=i.GeometryType,t.QueryOption=i.QueryOption,t.JoinType=i.JoinType,t.EngineType=i.EngineType,t.MeasureMode=i.MeasureMode,t.SpatialRelationType=i.SpatialRelationType,t.DataReturnMode=i.DataReturnMode,t.Unit=i.Unit,t.BufferRadiusUnit=i.BufferRadiusUnit,t.SpatialQueryMode=i.SpatialQueryMode,t.ThemeGraphTextFormat=i.ThemeGraphTextFormat,t.ThemeGraphType=i.ThemeGraphType,t.GraphAxesTextDisplayMode=i.GraphAxesTextDisplayMode,t.GraduatedMode=i.GraduatedMode,t.RangeMode=i.RangeMode,t.ThemeType=i.ThemeType,t.ColorGradientType=i.ColorGradientType,t.TextAlignment=i.TextAlignment,t.FillGradientMode=i.FillGradientMode,t.SideType=i.SideType,t.AlongLineDirection=i.AlongLineDirection,t.LabelBackShape=i.LabelBackShape,t.LabelOverLengthMode=i.LabelOverLengthMode,t.DirectionType=i.DirectionType,t.OverlayOperationType=i.OverlayOperationType,t.SupplyCenterType=i.SupplyCenterType,t.TurnType=i.TurnType,t.BufferEndType=i.BufferEndType,t.SmoothMethod=i.SmoothMethod,t.SurfaceAnalystMethod=i.SurfaceAnalystMethod,t.ColorSpaceType=i.ColorSpaceType,t.ChartType=i.ChartType,t.EditType=i.EditType,t.TransferTactic=i.TransferTactic,t.TransferPreference=i.TransferPreference,t.GridType=i.GridType,t.ClientType=i.ClientType,t.LayerType=i.LayerType,t.UGCLayerType=i.UGCLayerType,t.StatisticMode=i.StatisticMode,t.PixelFormat=i.PixelFormat,t.SearchMode=i.SearchMode,t.SummaryType=i.SummaryType,t.InterpolationAlgorithmType=i.InterpolationAlgorithmType,t.VariogramMode=i.VariogramMode,t.Exponent=i.Exponent,t.ClipAnalystMode=i.ClipAnalystMode,t.AnalystAreaUnit=i.AnalystAreaUnit,t.AnalystSizeUnit=i.AnalystSizeUnit,t.StatisticAnalystMode=i.StatisticAnalystMode,t.TopologyValidatorRule=i.TopologyValidatorRule,t.OutputType=i.OutputType,t.AggregationQueryBuilderType=i.AggregationQueryBuilderType,t.AggregationType=i.AggregationType,t.GetFeatureMode=i.GetFeatureMode,t.RasterFunctionType=i.RasterFunctionType,t.Collection=a.Collection,t.Curve=a.Curve,t.GeoText=a.GeoText,t.LinearRing=a.LinearRing,t.LineString=a.LineString,t.MultiLineString=a.MultiLineString,t.MultiPoint=a.MultiPoint,t.MultiPolygon=a.MultiPolygon,t.GeometryPoint=a.GeometryPoint,t.Polygon=a.Polygon,t.Rectangle=a.Rectangle,t.StringExt=a.StringExt,t.NumberExt=a.NumberExt,t.FunctionExt=a.FunctionExt,t.ArrayExt=a.ArrayExt,t.Bounds=a.Bounds,t.Credential=a.Credential,t.DateExt=a.DateExt,t.Event=a.Event,t.Events=a.Events,t.Feature=a.Feature,t.Geometry=a.Geometry,t.LonLat=a.LonLat,t.Pixel=a.Pixel,t.Size=a.Size,t.CommonUtil=a.CommonUtil,t.GeometryVector=a.GeometryVector,t.TimeControlBase=s.TimeControlBase,t.TimeFlowControl=s.TimeFlowControl,t.Format=o.Format,t.GeoJSON=o.GeoJSON,t.JSONFormat=o.JSONFormat,t.WKT=o.WKT,t.setCORS=d.setCORS,t.isCORS=d.isCORS,t.setRequestTimeout=d.setRequestTimeout,t.getRequestTimeout=d.getRequestTimeout,t.FetchRequest=d.FetchRequest,t.ColorsPickerUtil=d.ColorsPickerUtil,t.ArrayStatistic=d.ArrayStatistic,t.IManager=l.IManager,t.IManagerCreateNodeParam=l.IManagerCreateNodeParam,t.IManagerServiceBase=l.IManagerServiceBase,t.IPortal=u.IPortal,t.IPortalMap=u.IPortalMap,t.IPortalMapsQueryParam=u.IPortalMapsQueryParam,t.IPortalInsight=u.IPortalInsight,t.IPortalInsightsQueryParam=u.IPortalInsightsQueryParam,t.IPortalScene=u.IPortalScene,t.IPortalScenesQueryParam=u.IPortalScenesQueryParam,t.IPortalService=u.IPortalService,t.IPortalServiceBase=u.IPortalServiceBase,t.IPortalServicesQueryParam=u.IPortalServicesQueryParam,t.IPortalMapdashboard=u.IPortalMapdashboard,t.IPortalMapdashboardsQueryParam=u.IPortalMapdashboardsQueryParam,t.AddressMatchService=c.AddressMatchService,t.AggregationParameter=c.AggregationParameter,t.AggQueryBuilderParameter=c.AggQueryBuilderParameter,t.AreaSolarRadiationParameters=c.AreaSolarRadiationParameters,t.AreaSolarRadiationService=c.AreaSolarRadiationService,t.BufferAnalystParameters=c.BufferAnalystParameters,t.BufferAnalystService=c.BufferAnalystService,t.BufferDistance=c.BufferDistance,t.BufferSetting=c.BufferSetting,t.BuffersAnalystJobsParameter=c.BuffersAnalystJobsParameter,t.BuffersAnalystJobsService=c.BuffersAnalystJobsService,t.BurstPipelineAnalystParameters=c.BurstPipelineAnalystParameters,t.BurstPipelineAnalystService=c.BurstPipelineAnalystService,t.ChartFeatureInfoSpecsService=c.ChartFeatureInfoSpecsService,t.ChartQueryFilterParameter=c.ChartQueryFilterParameter,t.ChartQueryParameters=c.ChartQueryParameters,t.ChartQueryService=c.ChartQueryService,t.ClipParameter=c.ClipParameter,t.ColorDictionary=c.ColorDictionary,t.CommonServiceBase=c.CommonServiceBase,t.ComputeWeightMatrixParameters=c.ComputeWeightMatrixParameters,t.ComputeWeightMatrixService=c.ComputeWeightMatrixService,t.DataFlowService=c.DataFlowService,t.DataReturnOption=c.DataReturnOption,t.DatasetBufferAnalystParameters=c.DatasetBufferAnalystParameters,t.DatasetInfo=c.DatasetInfo,t.DatasetOverlayAnalystParameters=c.DatasetOverlayAnalystParameters,t.DatasetSurfaceAnalystParameters=c.DatasetSurfaceAnalystParameters,t.DatasetThiessenAnalystParameters=c.DatasetThiessenAnalystParameters,t.DatasourceConnectionInfo=c.DatasourceConnectionInfo,t.DensityAnalystService=c.DensityAnalystService,t.DensityKernelAnalystParameters=c.DensityKernelAnalystParameters,t.EditFeaturesParameters=c.EditFeaturesParameters,t.EditFeaturesService=c.EditFeaturesService,t.FacilityAnalyst3DParameters=c.FacilityAnalyst3DParameters,t.FacilityAnalystSinks3DParameters=c.FacilityAnalystSinks3DParameters,t.FacilityAnalystSinks3DService=c.FacilityAnalystSinks3DService,t.FacilityAnalystSources3DParameters=c.FacilityAnalystSources3DParameters,t.FacilityAnalystSources3DService=c.FacilityAnalystSources3DService,t.FacilityAnalystStreamParameters=c.FacilityAnalystStreamParameters,t.FacilityAnalystStreamService=c.FacilityAnalystStreamService,t.FacilityAnalystTracedown3DParameters=c.FacilityAnalystTracedown3DParameters,t.FacilityAnalystTracedown3DService=c.FacilityAnalystTracedown3DService,t.FacilityAnalystTraceup3DParameters=c.FacilityAnalystTraceup3DParameters,t.FacilityAnalystTraceup3DService=c.FacilityAnalystTraceup3DService,t.FacilityAnalystUpstream3DParameters=c.FacilityAnalystUpstream3DParameters,t.FacilityAnalystUpstream3DService=c.FacilityAnalystUpstream3DService,t.FieldParameters=c.FieldParameters,t.FieldStatisticService=c.FieldStatisticService,t.FieldStatisticsParameters=c.FieldStatisticsParameters,t.FilterAggParameter=c.FilterAggParameter,t.FilterParameter=c.FilterParameter,t.FindClosestFacilitiesParameters=c.FindClosestFacilitiesParameters,t.FindClosestFacilitiesService=c.FindClosestFacilitiesService,t.FindLocationParameters=c.FindLocationParameters,t.FindLocationService=c.FindLocationService,t.FindMTSPPathsParameters=c.FindMTSPPathsParameters,t.FindMTSPPathsService=c.FindMTSPPathsService,t.FindPathParameters=c.FindPathParameters,t.FindPathService=c.FindPathService,t.FindServiceAreasParameters=c.FindServiceAreasParameters,t.FindServiceAreasService=c.FindServiceAreasService,t.FindTSPPathsParameters=c.FindTSPPathsParameters,t.FindTSPPathsService=c.FindTSPPathsService,t.GenerateSpatialDataParameters=c.GenerateSpatialDataParameters,t.GenerateSpatialDataService=c.GenerateSpatialDataService,t.GeoBoundingBoxQueryBuilderParameter=c.GeoBoundingBoxQueryBuilderParameter,t.GeoCodingParameter=c.GeoCodingParameter,t.GeoDecodingParameter=c.GeoDecodingParameter,t.GeoHashGridAggParameter=c.GeoHashGridAggParameter,t.GeometryBufferAnalystParameters=c.GeometryBufferAnalystParameters,t.GeometryOverlayAnalystParameters=c.GeometryOverlayAnalystParameters,t.GeometrySurfaceAnalystParameters=c.GeometrySurfaceAnalystParameters,t.GeometryThiessenAnalystParameters=c.GeometryThiessenAnalystParameters,t.GeoRelationAnalystParameters=c.GeoRelationAnalystParameters,t.GeoRelationAnalystService=c.GeoRelationAnalystService,t.GetFeaturesByBoundsParameters=c.GetFeaturesByBoundsParameters,t.GetFeaturesByBoundsService=c.GetFeaturesByBoundsService,t.GetFeaturesByBufferParameters=c.GetFeaturesByBufferParameters,t.GetFeaturesByBufferService=c.GetFeaturesByBufferService,t.GetFeaturesByGeometryParameters=c.GetFeaturesByGeometryParameters,t.GetFeaturesByGeometryService=c.GetFeaturesByGeometryService,t.GetFeaturesByIDsParameters=c.GetFeaturesByIDsParameters,t.GetFeaturesByIDsService=c.GetFeaturesByIDsService,t.GetFeaturesBySQLParameters=c.GetFeaturesBySQLParameters,t.GetFeaturesBySQLService=c.GetFeaturesBySQLService,t.GetFeaturesParametersBase=c.GetFeaturesParametersBase,t.GetFeaturesServiceBase=c.GetFeaturesServiceBase,t.GetFieldsService=c.GetFieldsService,t.GetGridCellInfosParameters=c.GetGridCellInfosParameters,t.GetGridCellInfosService=c.GetGridCellInfosService,t.GetLayersInfoService=c.GetLayersInfoService,t.Grid=c.Grid,t.UGCImage=c.UGCImage,t.InterpolationAnalystParameters=c.InterpolationAnalystParameters,t.InterpolationAnalystService=c.InterpolationAnalystService,t.InterpolationIDWAnalystParameters=c.InterpolationIDWAnalystParameters,t.InterpolationKrigingAnalystParameters=c.InterpolationKrigingAnalystParameters,t.InterpolationRBFAnalystParameters=c.InterpolationRBFAnalystParameters,t.JoinItem=c.JoinItem,t.KernelDensityJobParameter=c.KernelDensityJobParameter,t.KernelDensityJobsService=c.KernelDensityJobsService,t.LabelImageCell=c.LabelImageCell,t.LabelMatrixCell=c.LabelMatrixCell,t.LabelMixedTextStyle=c.LabelMixedTextStyle,t.LabelSymbolCell=c.LabelSymbolCell,t.LabelThemeCell=c.LabelThemeCell,t.LayerStatus=c.LayerStatus,t.LinkItem=c.LinkItem,t.MapService=c.MapService,t.MathExpressionAnalysisParameters=c.MathExpressionAnalysisParameters,t.MathExpressionAnalysisService=c.MathExpressionAnalysisService,t.MeasureParameters=c.MeasureParameters,t.MeasureService=c.MeasureService,t.NetworkAnalystServiceBase=c.NetworkAnalystServiceBase,t.OutputSetting=c.OutputSetting,t.MappingParameters=c.MappingParameters,t.OverlapDisplayedOptions=c.OverlapDisplayedOptions,t.OverlayAnalystParameters=c.OverlayAnalystParameters,t.OverlayAnalystService=c.OverlayAnalystService,t.OverlayGeoJobParameter=c.OverlayGeoJobParameter,t.OverlayGeoJobsService=c.OverlayGeoJobsService,t.PointWithMeasure=c.PointWithMeasure,t.ProcessingServiceBase=c.ProcessingServiceBase,t.QueryByBoundsParameters=c.QueryByBoundsParameters,t.QueryByBoundsService=c.QueryByBoundsService,t.QueryByDistanceParameters=c.QueryByDistanceParameters,t.QueryByDistanceService=c.QueryByDistanceService,t.QueryByGeometryParameters=c.QueryByGeometryParameters,t.QueryByGeometryService=c.QueryByGeometryService,t.QueryBySQLParameters=c.QueryBySQLParameters,t.QueryBySQLService=c.QueryBySQLService,t.QueryParameters=c.QueryParameters,t.QueryService=c.QueryService,t.Route=c.Route,t.RouteCalculateMeasureParameters=c.RouteCalculateMeasureParameters,t.RouteCalculateMeasureService=c.RouteCalculateMeasureService,t.RouteLocatorParameters=c.RouteLocatorParameters,t.RouteLocatorService=c.RouteLocatorService,t.ServerColor=c.ServerColor,t.ServerFeature=c.ServerFeature,t.ServerGeometry=c.ServerGeometry,t.ServerStyle=c.ServerStyle,t.ServerTextStyle=c.ServerTextStyle,t.ServerTheme=c.ServerTheme,t.SetLayerInfoParameters=c.SetLayerInfoParameters,t.SetLayerInfoService=c.SetLayerInfoService,t.SetLayersInfoParameters=c.SetLayersInfoParameters,t.SetLayersInfoService=c.SetLayersInfoService,t.SetLayerStatusParameters=c.SetLayerStatusParameters,t.SetLayerStatusService=c.SetLayerStatusService,t.SingleObjectQueryJobsParameter=c.SingleObjectQueryJobsParameter,t.SingleObjectQueryJobsService=c.SingleObjectQueryJobsService,t.SpatialAnalystBase=c.SpatialAnalystBase,t.StopQueryParameters=c.StopQueryParameters,t.StopQueryService=c.StopQueryService,t.SummaryAttributesJobsParameter=c.SummaryAttributesJobsParameter,t.SummaryAttributesJobsService=c.SummaryAttributesJobsService,t.SummaryMeshJobParameter=c.SummaryMeshJobParameter,t.SummaryMeshJobsService=c.SummaryMeshJobsService,t.SummaryRegionJobParameter=c.SummaryRegionJobParameter,t.SummaryRegionJobsService=c.SummaryRegionJobsService,t.SupplyCenter=c.SupplyCenter,t.SurfaceAnalystParameters=c.SurfaceAnalystParameters,t.SurfaceAnalystParametersSetting=c.SurfaceAnalystParametersSetting,t.SurfaceAnalystService=c.SurfaceAnalystService,t.TerrainCurvatureCalculationParameters=c.TerrainCurvatureCalculationParameters,t.TerrainCurvatureCalculationService=c.TerrainCurvatureCalculationService,t.Theme=c.Theme,t.ThemeDotDensity=c.ThemeDotDensity,t.ThemeFlow=c.ThemeFlow,t.ThemeGraduatedSymbol=c.ThemeGraduatedSymbol,t.ThemeGraduatedSymbolStyle=c.ThemeGraduatedSymbolStyle,t.ThemeGraph=c.ThemeGraph,t.ThemeGraphAxes=c.ThemeGraphAxes,t.ThemeGraphItem=c.ThemeGraphItem,t.ThemeGraphSize=c.ThemeGraphSize,t.ThemeGraphText=c.ThemeGraphText,t.ThemeGridRange=c.ThemeGridRange,t.ThemeGridRangeItem=c.ThemeGridRangeItem,t.ThemeGridUnique=c.ThemeGridUnique,t.ThemeGridUniqueItem=c.ThemeGridUniqueItem,t.ThemeLabel=c.ThemeLabel,t.ThemeLabelAlongLine=c.ThemeLabelAlongLine,t.ThemeLabelBackground=c.ThemeLabelBackground,t.ThemeLabelItem=c.ThemeLabelItem,t.ThemeLabelText=c.ThemeLabelText,t.ThemeLabelUniqueItem=c.ThemeLabelUniqueItem,t.ThemeMemoryData=c.ThemeMemoryData,t.ThemeOffset=c.ThemeOffset,t.ThemeParameters=c.ThemeParameters,t.ThemeRange=c.ThemeRange,t.ThemeRangeItem=c.ThemeRangeItem,t.ThemeService=c.ThemeService,t.ThemeUnique=c.ThemeUnique,t.ThemeUniqueItem=c.ThemeUniqueItem,t.ThiessenAnalystParameters=c.ThiessenAnalystParameters,t.ThiessenAnalystService=c.ThiessenAnalystService,t.GeometryBatchAnalystService=c.GeometryBatchAnalystService,t.TilesetsService=c.TilesetsService,t.TopologyValidatorJobsParameter=c.TopologyValidatorJobsParameter,t.TopologyValidatorJobsService=c.TopologyValidatorJobsService,t.TransferLine=c.TransferLine,t.TransferPathParameters=c.TransferPathParameters,t.TransferPathService=c.TransferPathService,t.TransferSolutionService=c.TransferSolutionService,t.TransportationAnalystParameter=c.TransportationAnalystParameter,t.TransportationAnalystResultSetting=c.TransportationAnalystResultSetting,t.TransferSolutionParameters=c.TransferSolutionParameters,t.UGCLayer=c.UGCLayer,t.UGCMapLayer=c.UGCMapLayer,t.UGCSubLayer=c.UGCSubLayer,t.UpdateEdgeWeightParameters=c.UpdateEdgeWeightParameters,t.UpdateEdgeWeightService=c.UpdateEdgeWeightService,t.UpdateTurnNodeWeightParameters=c.UpdateTurnNodeWeightParameters,t.UpdateTurnNodeWeightService=c.UpdateTurnNodeWeightService,t.Vector=c.Vector,t.VectorClipJobsParameter=c.VectorClipJobsParameter,t.VectorClipJobsService=c.VectorClipJobsService,t.RasterFunctionParameter=c.RasterFunctionParameter,t.NDVIParameter=c.NDVIParameter,t.HillshadeParameter=c.HillshadeParameter,t.Online=p.Online,t.OnlineData=p.OnlineData,t.OnlineQueryDatasParameter=p.OnlineQueryDatasParameter,t.ServiceStatus=p.ServiceStatus,t.DataItemType=p.DataItemType,t.DataItemOrderBy=p.DataItemOrderBy,t.FilterField=p.FilterField,t.OnlineServiceBase=p.OnlineServiceBase,t.Bar=v.Bar,t.Bar3D=v.Bar3D,t.Circle=v.Circle,t.Graph=v.Graph,t.Line=v.Line,t.Pie=v.Pie,t.OverlayPoint=v.OverlayPoint,t.RankSymbol=v.RankSymbol,t.Ring=v.Ring,t.ThemeVector=v.ThemeVector,t.ShapeFactory=v.ShapeFactory,t.ShapeParameters=v.ShapeParameters,t.FeatureCircle=v.FeatureCircle,t.Image=v.Image,t.Label=v.Label,t.FeatureLine=v.FeatureLine,t.Point=v.Point,t.FeaturePolygon=v.FeaturePolygon,t.FeatureRectangle=v.FeatureRectangle,t.Sector=v.Sector,t.FeatureTheme=v.FeatureTheme,t.LevelRenderer=v.LevelRenderer,t.Render=v.Render,t.Animation=v.Animation,t.Animator=v.Animator,t.Area=v.Area,t.Clip=v.Clip,t.Color=v.Color,t.ComputeBoundingBox=v.ComputeBoundingBox,t.Config=v.Config,t.LevelRendererCurve=v.LevelRendererCurve,t.Easing=v.Easing,t.Env=v.Env,t.LevelRendererEvent=v.LevelRendererEvent,t.Eventful=v.Eventful,t.Group=v.Group,t.Handler=v.Handler,t.Http=v.Http,t.Log=v.Log,t.Math=v.Math,t.Matrix=v.Matrix,t.Painter=v.Painter,t.PaintLayer=v.PaintLayer,t.Shape=v.Shape,t.SmicBrokenLine=v.SmicBrokenLine,t.SmicCircle=v.SmicCircle,t.SmicEllipse=v.SmicEllipse,t.SmicImage=v.SmicImage,t.SmicIsogon=v.SmicIsogon,t.SmicPoint=v.SmicPoint,t.SmicPolygon=v.SmicPolygon,t.SmicRectangle=v.SmicRectangle,t.SmicRing=v.SmicRing,t.SmicSector=v.SmicSector,t.SmicStar=v.SmicStar,t.SmicText=v.SmicText,t.Storage=v.Storage,t.Transformable=v.Transformable,t.Util=v.Util,t.LevelRendererVector=v.LevelRendererVector,t.SUtil=v.SUtil,t.KeyServiceParameter=h.KeyServiceParameter,t.SecurityManager=h.SecurityManager,t.ServerInfo=h.ServerInfo,t.TokenServiceParameter=h.TokenServiceParameter,t.CartoCSS=y.CartoCSS,t.ThemeStyle=y.ThemeStyle,t.ElasticSearch=f.ElasticSearch,t.Lang=g.Lang,t.en=g.en,t.zh=g.zh},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PJD_3PARAM=1,t.PJD_7PARAM=2,t.PJD_WGS84=4,t.PJD_NODATUM=5,t.SEC_TO_RAD=484813681109536e-20,t.HALF_PI=Math.PI/2,t.SIXTH=.16666666666666666,t.RA4=.04722222222222222,t.RA6=.022156084656084655,t.EPSLN=1e-10,t.D2R=.017453292519943295,t.R2D=57.29577951308232,t.FORTPI=Math.PI/4,t.TWO_PI=2*Math.PI,t.SPI=3.14159265359},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommonServiceBase=void 0;var n=function(){function e(e,t){for(var r=0;r-1&&"?"===n?e.url+=r.getUrlParameters():e.url.indexOf("?")>-1&&"?"!==n?e.url+="&"+r.getUrlParameters():e.url+="?"+r.getUrlParameters()}t.calculatePollingTimes(),t._processSuccess=e.success,t._processFailed=e.failure,e.scope=t,e.success=t.getUrlCompleted,e.failure=t.getUrlFailed,t.options=e,t._commit(t.options)}},{key:"getCredential",value:function(e){var t=e,r=void 0,n=void 0;switch(this.serverType){case c.ServerType.IPORTAL:(r=(n=l.SecurityManager.getToken(t))?new s.Credential(n,"token"):null)||(r=(n=l.SecurityManager.getKey(t))?new s.Credential(n,"key"):null);break;case c.ServerType.ONLINE:r=(n=l.SecurityManager.getKey(t))?new s.Credential(n,"key"):null;break;default:r=(n=l.SecurityManager.getToken(t))?new s.Credential(n,"token"):null}return r}},{key:"getUrlCompleted",value:function(e){this._processSuccess(e)}},{key:"getUrlFailed",value:function(e){this.totalTimes>0?(this.totalTimes--,this.ajaxPolling()):this._processFailed(e)}},{key:"ajaxPolling",value:function(){var e=this,t=e.options.url,r=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],t=t.replace(r,r.exec(e.url)[0]),e.options.url=t,e.options.isInTheSameDomain=u.Util.isInTheSameDomain(t),e._commit(e.options)}},{key:"calculatePollingTimes",value:function(){var e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.timese.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"serviceProcessCompleted",value:function(e){e=u.Util.transformResult(e),this.events.triggerEvent("processCompleted",{result:e})}},{key:"serviceProcessFailed",value:function(e){var t=(e=u.Util.transformResult(e)).error||e;this.events.triggerEvent("processFailed",{error:t})}},{key:"_commit",value:function(e){"POST"!==e.method&&"PUT"!==e.method||(e.params&&(e.url=u.Util.urlAppend(e.url,u.Util.getParameterString(e.params||{}))),e.params=e.data),a.FetchRequest.commit(e.method,e.url,e.params,{headers:e.headers,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then(function(e){return e.text?e.text():e.json?e.json():e}).then(function(t){var r=t;("string"==typeof t&&(r=(new p.JSONFormat).read(t)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r.error)?(e.scope?h.FunctionExt.bind(e.failure,e.scope):e.failure)(r):(r.succeed=void 0==r.succeed||r.succeed,(e.scope?h.FunctionExt.bind(e.success,e.scope):e.success)(r))}).catch(function(t){(e.scope?h.FunctionExt.bind(e.failure,e.scope):e.failure)(t)})}}]),e}();i.SuperMap.CommonServiceBase=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Math.abs(e)<=i.SPI?e:e-(0,o.default)(e)*i.TWO_PI};var n,i=r(6),a=r(56),o=(n=a)&&n.__esModule?n:{default:n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceBase=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};var o=t.ServiceBase=a.default.Evented.extend({options:{url:null,proxy:null,serverType:null,withCredentials:!1,crossOrigin:null},initialize:function(e,t){e&&(e=e.indexOf("/")!==e.length-1?e:e.substr(0,e.length-1)),this.url=e,a.default.setOptions(this,t),this.fire("initialized",this)},destroy:function(){this.fire("destroy",this)}}); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/a.default.supermap.ServiceBase=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerGeometry=void 0;var n=function(){function e(e,t){for(var r=0;r0){if(1===r)return new a.Point(t[0].x,t[0].y);for(var n=[],i=0;i0){if(1===r){for(var n=[],i=0;i0){if(1===p){for(e=0,r=[];e=0;O--)if(_[P]=-1,y[O].containsBounds(y[P])){v[P]=-1*v[O],v[P]<0&&(_[P]=O);break}for(var w=0;w0?o.push(d[w]):(o[_[w]].components=o[_[w]].components.concat(d[w].components),o.push(""))}else{o=new Array;for(var M=0;M0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(h),h=[]),o.push(d[M])),M==i-1){var T=o.length;if(T)o[T-1].components=o[T-1].components.concat(h);else for(var C=0,x=h.length;C=0;M--)if(O[w]=-1,m[M].containsBounds(m[w])){g[w]=-1*g[M],g[w]<0&&(O[w]=M);break}for(var T=0;T0?u.push(v[T]):(u[O[T]].components=u[O[T]].components.concat(v[T].components),u.push(""))}else{u=new Array;for(var C=0;C0&&u.length>0&&(u[u.length-1].components=u[u.length-1].components.concat(d),d=[]),u.push(v[C])),C==i-1){var x=u.length;if(x)u[x-1].components=u[x-1].components.concat(d);else for(var E=0,L=d.length;Ee[a]){var o=e[a];e[a]=e[i],e[i]=o;var s=t[a];if(t[a]=t[i],t[i]=s,r&&r.length>0){var l=r[a];r[a]=r[i],r[i]=l}if(n&&n.length>0){var u=n[a];n[a]=n[i],n[i]=u}}}}]),e}();i.SuperMap.ServerGeometry=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpatialAnalystBase=void 0;var n=function(){function e(e,t){for(var r=0;rLeaflet\n with © SuperMap iClient",Common:{attribution:"Map Data © SuperMap iServer"},Online:{attribution:"Map Data © SuperMap Online"},ECharts:{attribution:"© 2018 百度 ECharts"},MapV:{attribution:"© 2018 百度 MapV "},Turf:{attribution:"© turfjs"},Baidu:{attribution:"Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方"},Cloud:{attribution:"Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo"},Tianditu:{attribution:"Map Data "}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SUtil=void 0;var n=function(){function e(e,t){for(var r=0;ro-2?o-1:f+1][0]+a[0],t[f>o-2?o-1:f+1][1]+a[1]],g=[t[f>o-3?o-1:f+2][0]+a[0],t[f>o-3?o-1:f+2][1]+a[1]]);var b=d*d,S=d*b;s.push([_(y[0],v[0],m[0],g[0],d,b,S),_(y[1],v[1],m[1],g[1],d,b,S)])}return s;function _(e,t,r,n,i,a,o){var s=.5*(r-e),l=.5*(n-t);return(2*(t-r)+s+l)*o+(-3*(t-r)-2*s-l)*a+s*i+t}}},{key:"SUtil_dashedLineTo",value:function(e,t,r,n,i,a,o){var s=[5,5];if(a="number"!=typeof a?5:a,e.setLineDash)return s[0]=a,s[1]=a,o&&o instanceof Array?e.setLineDash(o):e.setLineDash(s),e.moveTo(t,r),void e.lineTo(n,i);var l=n-t,u=i-r,c=Math.floor(Math.sqrt(l*l+u*u)/a);l/=c,u/=c;for(var p=!0,h=0;h0&&(this.setCtxGlobalAlpha(e,"stroke",r),e.stroke()),this.setCtxGlobalAlpha(e,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",r);break;default:this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)}this.drawText(e,r,this.style),this.afterBrush(e)}},{key:"beforeBrush",value:function(e,t){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),t&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r}},{key:"afterBrush",value:function(e){e.restore()}},{key:"setContext",value:function(e,t){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,i=r.length;n=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height&&l.SUtil.Util_area.isInside(this,this.style,e,t)}},{key:"drawText",value:function(e,r,n){if(void 0!==r.text&&!1!==r.text){var i=r.textColor||r.color||r.strokeColor;e.fillStyle=i;var a,o,s,l,u=10,c=r.textPosition||this.textPosition||"top",p=[];switch(p=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var h=(n||r).__rect||this.getRect(n||r);switch(c){case"inside":s=h.x+h.width/2,l=h.y+h.height/2,a="center",o="middle","stroke"!=r.brushType&&i==r.color&&(e.fillStyle="#fff");break;case"left":s=h.x-u,l=h.y+h.height/2,a="end",o="middle";break;case"right":s=h.x+h.width+u,l=h.y+h.height/2,a="start",o="middle";break;case"top":s=h.x+h.width/2,l=h.y-u,a="center",o="bottom";break;case"bottom":s=h.x+h.width/2,l=h.y+h.height+u,a="center",o="top"}}break;case"start":case"end":var f=0,d=0,y=0,v=0;if(void 0!==r.pointList){var m=r.pointList;if(m.length<2)return;var g=m.length;switch(c){case"start":f=m[0][0]+p[0],d=m[1][0]+p[0],y=m[0][1]+p[1],v=m[1][1]+p[1];break;case"end":f=m[g-2][0]+p[0],d=m[g-1][0]+p[0],y=m[g-2][1]+p[1],v=m[g-1][1]+p[1]}}else f=r.xStart+p[0]||0,d=r.xEnd+p[0]||0,y=r.yStart+p[1]||0,v=r.yEnd+p[1]||0;switch(c){case"start":a=f-1?"&":"?")+"_method="+e,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(t,r,n)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var r=e.split("?");2===r.length&&(e=r[0]+".json?"+r[1])}return t&&t.proxy&&("function"==typeof t.proxy?e=t.proxy(e):(e=decodeURIComponent(e),e=t.proxy+encodeURIComponent(e))),e},_fetch:function(e,t,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,u(e,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?t:void 0,credentials:r.withCredentials?"include":"omit",mode:"cors",timeout:p()}).then(function(e){return e})):u(e,{method:n,body:"PUT"===n||"POST"===n?t:void 0,headers:r.headers,credentials:r.withCredentials?"include":"omit",mode:"cors",timeout:p()}).then(function(e){return e})},_fetchJsonp:function(e,t){return t=t||{},(0,o.default)(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},e),t.then(r,n)})},_getParameterString:function(e){var t=[];for(var r in e){var i=e[r];if(null!=i&&"function"!=typeof i){var a;if("object"===(void 0===i?"undefined":n(i))&&i.constructor===Array){for(var o,s=[],l=0,u=i.length;l-1||e.indexOf(".pbf")>-1}};s.SuperMap.Util.RequestJSONPPromise={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=s.SuperMap.Util.toJSON(e[t]));var r=encodeURIComponent(e[t]);this.queryValues.push(r)}},issue:function(e){for(var t=this,r=t.getUid(),n=e.url,i=[],a=new Promise(function(e){t.supermap_callbacks[r]=function(n){delete t.supermap_callbacks[r],e(n)}}),o=n,s=0,l=t.queryKeys?t.queryKeys.length:0,u=0;u=t.limitLength){if(0==s)return!1;i.push(o),o=n,s=0,u--}else if(o.length+t.queryKeys[u].length+2+t.queryValues[u].length>t.limitLength)for(var c=t.queryValues[u];c.length>0;){var p=t.limitLength-o.length-t.queryKeys[u].length-2;o.indexOf("?")>-1?o+="&":o+="?";var h=c.substring(0,p);"%"===h.substring(p-1,p)?(p-=1,h=c.substring(0,p)):"%"===h.substring(p-2,p-1)&&(p-=2,h=c.substring(0,p)),o+=t.queryKeys[u]+"="+h,c=c.substring(p),h.length>0&&(i.push(o),o=n,s=0)}else s++,o.indexOf("?")>-1?o+="&":o+="?",o+=t.queryKeys[u]+"="+t.queryValues[u];return i.push(o),t.send(i,"SuperMap.Util.RequestJSONPPromise.supermap_callbacks["+r+"]",e&&e.proxy),a},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var n=e.length;if(n>0)for(var i=(new Date).getTime(),a=0;a-1?s+="&":s+="?",s+="sectionCount="+n,s+="§ionIndex="+a,s+="&jsonpUserID="+i,r&&(s=decodeURIComponent(s),s=r+encodeURIComponent(s)),(0,o.default)(s,{jsonpCallbackFunction:t,timeout:3e4})}},GET:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(e.params),this.issue(e)},POST:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},PUT:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},DELETE:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoJSON=void 0;var n=function(){function e(e,t){for(var r=0;r-1||(t[n]=e[n]);return t}}]),t}();a.SuperMap.Format.GeoJSON=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProcessingServiceBase=void 0;var n=function(){function e(e,t){for(var r=0;r0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}]),e}();i.SuperMap.MappingParameters=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutputSetting=void 0;var n=function(){function e(e,t){for(var r=0;r2;return r&&function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeComponent",this).apply(this,arguments),r}},{key:"getSortedSegments",value:function(){for(var e,t,r=this.components.length-1,n=new Array(r),i=0;i=1?1:g)<=-1?-1:g,p=180*Math.acos(g)/Math.PI,s=(p=i.x==r.x?t.x>r.x&&n.x>r.x||t.xf*t.x+d&&n.y>f*n.x+d||t.yr.y?n.xr.x&&(l=!1):i.xf*n.x+d&&(l=!1):i.x>r.x?n.y>r.y&&(l=!1):n.y=0?180*Math.atan(b)/Math.PI:Math.abs(180*Math.atan(b)/Math.PI)+90,_=Math.abs(t.y);r.y==_&&_==i.y&&r.x=0?b>=0?c+=u:c=180-(c-90)+u:c=b>0?c-180+u:90-c+u:P>=0?b>=0?c-=u:c=180-(c-90)-u:c=b>=0?c-180-u:90-c-u,c=c*Math.PI/180;var w=t.x+o*Math.cos(c),M=t.y+o*Math.sin(c);h.push(new a.Point(w,M))}h.push(i)}return h}},{key:"createLineEPS",value:function(e){var r=[],n=e.length;if(n<2)return e;for(var i=0;i=15){var v=parseInt(l.axis3DParameter),m=[a[0]-v,a[1]+v];l.axisUseArrow?(d.push([m[0]+1.5,m[1]-7.5]),d.push([m[0]-1,m[1]+1]),d.push([m[0]+7.5,m[1]-1.5]),y.push([m[0],m[1]])):y.push([m[0],m[1]]),y.push([a[0],a[1]])}y.push([a[2]+5,a[1]])}else{var g=Math.abs(a[1]-a[3])/f,b=a[3];y.push([a[0],b-5]);for(var S=0;S=15){var O=parseInt(l.axis3DParameter),w=[a[0]-O,a[1]+O];l.axisUseArrow?(d.push([w[0]+1.5,w[1]-7.5]),d.push([w[0]-1,w[1]+1]),d.push([w[0]+7.5,w[1]-1.5]),y.push([w[0],w[1]])):y.push([w[0],w[1]]),y.push([a[0],a[1]])}y.push([a[2]+5,a[1]])}if(l.axisUseArrow){var M=[[a[2]+5,a[1]+4],[a[2]+13,a[1]],[a[2]+5,a[1]-4]],T=[[a[0]-4,a[3]-5],[a[0],a[3]-13],[a[0]+4,a[3]-5]],C=new s.Polygon(M);C.style={fillColor:"#008acd"},_.Util.copyAttributesWithClip(C.style,l.axisStyle),p.push(e.createShape(C));var x=new s.Polygon(T);if(x.style={fillColor:"#008acd"},_.Util.copyAttributesWithClip(x.style,l.axisStyle),p.push(e.createShape(x)),l.axis3DParameter&&!isNaN(l.axis3DParameter)&&l.axis3DParameter>=15){var E=new s.Polygon(d);E.style={fillColor:"#008acd"},_.Util.copyAttributesWithClip(E.style,l.axisStyle),p.push(e.createShape(E))}}i=y;var L=new o.Line(i);L.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},l.axisStyle&&_.Util.copyAttributesWithClip(L.style,l.axisStyle),L.clickable=!1,L.hoverable=!1;var A=[e.createShape(L)],k=[];if(l.axisYLabels&&l.axisYLabels.length&&l.axisYLabels.length>0){var j=l.axisYLabels,F=j.length,I=[0,0];if(l.axisYLabelsOffset&&l.axisYLabelsOffset.length&&(I=l.axisYLabelsOffset),1==F){var N=new c.Label(a[0]-5+I[0],a[3]+I[1],j[0]);N.style={labelAlign:"right"},l.axisYLabelsStyle&&_.Util.copyAttributesWithClip(N.style,l.axisYLabelsStyle),N.clickable=!1,N.hoverable=!1,k.push(e.createShape(N))}else for(var R=a[3],D=Math.abs(a[1]-a[3])/(F-1),G=0;G0){var V=l.axisXLabels,J=V.length,z=[0,0];if(l.axisXLabelsOffset&&l.axisXLabelsOffset.length&&(z=l.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==J)for(var H=n.xPositions,q=0;q=0&&r[i]&&_.Util.copyAttributesWithClip(o,r[i]),n&&n.length&&void 0!==a)for(var s=n,l=s.length,u=parseFloat(a),c=0;cthis.right)&&(this.right=r.right),(null==this.top||r.top>this.top)&&(this.top=r.top))}}},{key:"containsLonLat",value:function(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),n=t.worldBounds;if(n&&!r){var i=n.getWidth(),a=(n.left+n.right)/2,o=Math.round((e.lon-a)/i);r=this.containsLonLat({lon:e.lon-o*i,lat:e.lat},{inclusive:t.inclusive})}return r}},{key:"containsPixel",value:function(e,t){return this.contains(e.x,e.y,t)}},{key:"contains",value:function(e,t,r){if(null==r&&(r=!0),null==e||null==t)return!1;var n=!1;return n=r?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&ethis.bottom&&t=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,o=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,l=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;n=(a||o)&&(s||l)}if(t.worldBounds&&!n){var u=t.worldBounds,c=u.getWidth(),p=!u.containsBounds(r),h=!u.containsBounds(e);p&&!h?(e=e.add(-c,0),n=r.intersectsBounds(e,{inclusive:t.inclusive})):h&&!p&&(r=r.add(-c,0),n=e.intersectsBounds(r,{inclusive:t.inclusive}))}return n}},{key:"containsBounds",value:function(e,t,r){null==t&&(t=!1),null==r&&(r=!0);var n=this.contains(e.left,e.bottom,r),i=this.contains(e.right,e.bottom,r),a=this.contains(e.left,e.top,r),o=this.contains(e.right,e.top,r);return t?n||i||a||o:n&&i&&a&&o}},{key:"determineQuadrant",value:function(e){var t="",r=this.getCenterLonLat();return t+=e.lat=e.right&&i.right>e.right;)i=i.add(-a,0);var o=i.left+r;oe.left&&i.right-n>e.right&&(i=i.add(-a,0))}return i}},{key:"toServerJSONObject",value:function(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}},{key:"destroy",value:function(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}}],[{key:"fromString",value:function(t,r){var n=t.split(",");return e.fromArray(n,r)}},{key:"fromArray",value:function(t,r){return!0===r?new e(t[1],t[0],t[3],t[2]):new e(t[0],t[1],t[2],t[3])}},{key:"fromSize",value:function(t){return new e(0,t.h,t.w,0)}},{key:"oppositeQuadrant",value:function(e){var t="";return t+="t"===e.charAt(0)?"b":"t",t+="l"===e.charAt(1)?"r":"l"}}]),e}();i.SuperMap.Bounds=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NormalizeScale=t.GetResolutionFromScaleDpi=t.scaleToResolution=t.resolutionToScale=t.getMeterPerMapUnit=t.toSuperMapGeometry=t.toGeoJSON=t.supermap_callbacks=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n},o=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var s=t.supermap_callbacks={};a.default.Util.supermap_callbacks=s;var l=t.toGeoJSON=function(e){return e?(new o.GeoJSON).toGeoJSON(e):e},u=t.toSuperMapGeometry=function(e){if(!e)return e;var t,r=new o.GeoJSON;if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(e.type))t=r.read(e,e.type);else if("function"==typeof e.toGeoJSON){var n=e.toGeoJSON();t=n?r.read(n,n.type):e}var i=t;return a.default.Util.isArray(t)&&(1===t.length?i=t[0]:t.length>1&&(i=[],t.map(function(e){return i.push(e.geometry),e}))),i&&i.geometry?i.geometry:i},c=t.getMeterPerMapUnit=function(e){var t;if(e===o.Unit.METER)t=1;else if(e===o.Unit.DEGREE)t=2*Math.PI*6378137/360;else if(e===o.Unit.KILOMETER)t=.001;else if(e===o.Unit.INCH)t=1/.025399999918;else{if(e!==o.Unit.FOOT)return t;t=.3048}return t},p=t.resolutionToScale=function(e,t,r){var n=e*t*(1/.0254)*c(r);return n=1/n},h=t.scaleToResolution=function(e,t,r){var n=e*t*(1/.0254)*c(r);return n=1/n},f=t.GetResolutionFromScaleDpi=function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?(e=a.default.Util.NormalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4):-1},d=t.NormalizeScale=function(e){return e>1?1/e:e};a.default.Util.toGeoJSON=l,a.default.Util.toSuperMapGeometry=u,a.default.Util.resolutionToScale=p,a.default.Util.scaleToResolution=h,a.default.Util.getMeterPerMapUnit=c,a.default.Util.GetResolutionFromScaleDpi=f,a.default.Util.NormalizeScale=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=void 0;var n=function(){function e(e,t){for(var r=0;r=c[2]||c[1]<=c[3])&&(this.DVBOrigonPoint=[c[0],c[3]],this.DVBWidth=Math.abs(c[2]-c[0]),this.DVBHeight=Math.abs(c[1]-c[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}},{key:"resetLocation",value:function(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var r=this.width,n=this.height,i=this.location;return this.chartBounds=new a.Bounds(i[0]-r/2,i[1]+n/2,i[0]+r/2,i[1]-n/2),this.resetLinearGradient(),i}},{key:"resetLinearGradient",value:function(){}},{key:"shapesConvertToRelativeCoordinate",value:function(){for(var e=this.shapes,t=this.location,r=0,n=e.length;r=0?n.push(parseFloat(i[o].toString()).toFixed(r)):n.push(parseFloat(i[o].toString()))}catch(e){throw new Error("not a number")}return n.length===t.length&&n},i.SuperMap.Feature.Theme.Graph=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;ra&&(a=e+s+100,n.width=a,r=!0),t+l>o&&(o=t+l+100,n.height=o,r=!0),e<-s&&(a+=s=100*Math.ceil(-e/100),n.width=a,r=!0),t<-l&&(o+=l=100*Math.ceil(-t/100),n.height=o,r=!0),r&&i.translate(s,l)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r-1)){if(null!=t&&t=0;--r)t=this.removeComponent(e[r])||t;return t}},{key:"removeComponent",value:function(e){return s.Util.removeItem(this.components,e),this.clearBounds(),!0}},{key:"getArea",value:function(){for(var e=0,t=0,r=this.components.length;t3&&void 0!==arguments[3]?arguments[3]:{headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials};return t=this.createCredentialUrl(t),l.FetchRequest.commit(e,t,r,n).then(function(e){return e.json()})}},{key:"createCredentialUrl",value:function(e){var t=e,r=this.getCredential();if(r){var n=t.substring(t.length-1,t.length);t.indexOf("?")>-1&&"?"===n?t+=r.getUrlParameters():t.indexOf("?")>-1&&"?"!==n?t+="&"+r.getUrlParameters():t+="?"+r.getUrlParameters()}return t}},{key:"getCredential",value:function(){var e,t=o.SecurityManager.getToken(this.serviceUrl);return(e=t?new s.Credential(t,"token"):null)||(e=(t=this.getKey())?new s.Credential(t,"key"):null),e}},{key:"getKey",value:function(){}}]),e}();i.SuperMap.iPortalServiceBase=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SecurityManager=void 0;var n=function(){function e(e,t){for(var r=0;r3;if(r){this.components.pop(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeComponent",this).apply(this,arguments);var n=this.components[0];i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addComponent",this).apply(this,[n])}return r}},{key:"getArea",value:function(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,n=this.components.length;r1&&(e=e>1?1:-1),Math.asin(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetFeaturesServiceBase=void 0;var n=function(){function e(e,t){for(var r=0;r=0&&r.toIndex>=0&&!n&&(r.url+="&fromIndex="+r.fromIndex+"&toIndex="+r.toIndex),e.returnCountOnly&&(r.url+="&returnCountOnly="+e.returnContent),t=r.getJsonParameters(e),r.request({method:"POST",data:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}},{key:"serviceProcessCompleted",value:function(e){if(e=a.Util.transformResult(e),this.format===o.DataFormat.GEOJSON&&e.features){var t=new l.GeoJSON;e.features=t.toGeoJSON(e.features)}this.events.triggerEvent("processCompleted",{result:e})}}]),t}();i.SuperMap.GetFeaturesServiceBase=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetFeaturesParametersBase=void 0;var n=function(){function e(e,t){for(var r=0;re.right;)t.lon-=e.getWidth()}return t}},{key:"destroy",value:function(){this.lon=null,this.lat=null}}],[{key:"fromString",value:function(t){var r=t.split(",");return new e(r[0],r[1])}},{key:"fromArray",value:function(t){var r=i.Util.isArray(t);return new e(r&&t[0],r&&t[1])}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Symbolizer=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};t.Symbolizer=a.default.Class.extend({initialize:function(e){this.properties=e.properties,this.type=e.type,this.layerName=e.layerName},render:function(e,t){this._renderer=e,this._container=e._container,this.options=t,e._initPath(this),e._updateStyle(this);var r=this.getElement();r&&this.layerName&&a.default.DomUtil.addClass(r,this.layerName)},updateStyle:function(e,t){this.options=t,e._updateStyle(this)},getElement:function(){return this._path||this._renderer._container},_getPixelBounds:function(){for(var e=this._parts,t=a.default.bounds([]),r=0;r3&&(t=Array.prototype.slice.call(t,1));for(var n=this._handlers[e],i=n.length,a=0;a4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var n=t[t.length-1],i=this._handlers[e],a=i.length,o=0;o0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,t,r,i){t=void 0!==t?t:0,r=void 0!==r?r:n.SuperMap.Number.thousandsSeparator,i=void 0!==i?i:n.SuperMap.Number.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var a=e.toString().split(".");1===a.length&&null==t&&(t=0);var o,s=a[0];if(r)for(var l=/(-?[0-9]+)([0-9]{3})/;l.test(s);)s=s.replace(l,"$1"+r+"$2");if(0==t)o=s;else{var u=a.length>1?a[1]:"0";null!=t&&(u+=new Array(t-u.length+1).join("0")),o=s+i+u}return o}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return i.limitSigDigs(this,e)});t.FunctionExt=n.SuperMap.Function={bind:function(e,t){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,n)}},bindAsEventListener:function(e,t){return function(r){return e.call(t,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},t.ArrayExt=n.SuperMap.Array={filter:function(e,t,r){var n=[];if(Array.prototype.filter)n=e.filter(t,r);else{var i=e.length;if("function"!=typeof t)throw new TypeError;for(var a=0;ap)){var g=u[0];u.splice(0,1),delete s[g]}}}}if(t.renderer.render(),n&&t.options.isHoverAble&&t.options.isMultiHover){var b=this.getShapesByFeatureID(n);this.renderer.updateHoverShapes(b)}},createThematicFeature:function(e){var t=this,r=t.getStyleByData(e);e.style&&t.isAllowFeatureStyle&&(r=o.CommonUtil.copyAttributesWithClip(e.style));var n={};n.nodesClipPixel=t.options.nodesClipPixel,n.isHoverAble=t.options.isHoverAble,n.isMultiHover=t.options.isMultiHover,n.isClickAble=t.options.isClickAble,n.highlightStyle=o.ShapeFactory.transformStyle(t.highlightStyle);for(var i=new o.ThemeVector(e,t,o.ShapeFactory.transformStyle(r),n),a=0;a0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(e.beginPath(),this.buildPath(e,r)),this.setCtxGlobalAlpha(e,"stroke",r),e.stroke(),this.setCtxGlobalAlpha(e,"reset",r)),this.drawText(e,r,this.style);var i=a.Util.cloneObject(r);if(i.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,l=0;l0&&("stroke"==i.brushType||"both"==i.brushType)?(n||(e.beginPath(),this.buildPath(e,i)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",i),e.stroke(),this.setCtxGlobalAlpha(e,"reset",i)):e.globalCompositeOperation="source-over"}e.restore()}},{key:"buildPath",value:function(e,t){t.showShadow&&(e.shadowBlur=t.shadowBlur,e.shadowColor=t.shadowColor,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=t.pointList;if(!(n.length<2))if(t.smooth&&"spline"!==t.smooth){var i,a,s,l=o.SUtil.SUtil_smoothBezier(n,t.smooth,!0,t.smoothConstraint,r);e.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,c=0;ca&&(a=l[u][0]+r[0]),l[u][1]+r[1]s&&(s=l[u][1]+r[1]);return n="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(i-n/2),y:Math.round(o-n/2),width:a-i+n,height:s-o+n},e.__rect}}]),t}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var n=t.Config=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};n.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},n.catchBrushException=!1,n.debugMode=0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r-this.EPSILON&&ethis.EPSILON||e<-this.EPSILON}},{key:"cubicAt",value:function(e,t,r,n,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*n+3*a*r)}},{key:"cubicDerivativeAt",value:function(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}},{key:"cubicRootAt",value:function(e,t,r,n,i,a){var o=n+3*(t-r)-e,s=3*(r-2*t+e),l=3*(t-e),u=e-i,c=s*s-3*o*l,p=s*l-9*o*u,h=l*l-3*s*u,f=0;if(this.isAroundZero(c)&&this.isAroundZero(p))if(this.isAroundZero(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[f++]=d)}else{var y=p*p-4*c*h;if(this.isAroundZero(y)){var v=p/c,m=-s/o+v,g=-v/2;m>=0&&m<=1&&(a[f++]=m),g>=0&&g<=1&&(a[f++]=g)}else if(y>0){var b=Math.sqrt(y),S=c*s+1.5*o*(-p+b),_=c*s+1.5*o*(-p-b),P=(-s-((S=S<0?-Math.pow(-S,this.ONE_THIRD):Math.pow(S,this.ONE_THIRD))+(_=_<0?-Math.pow(-_,this.ONE_THIRD):Math.pow(_,this.ONE_THIRD))))/(3*o);P>=0&&P<=1&&(a[f++]=P)}else{var O=(2*c*s-3*o*p)/(2*Math.sqrt(c*c*c)),w=Math.acos(O)/3,M=Math.sqrt(c),T=Math.cos(w),C=(-s-2*M*T)/(3*o),x=(-s+M*(T+this.THREE_SQRT*Math.sin(w)))/(3*o),E=(-s+M*(T-this.THREE_SQRT*Math.sin(w)))/(3*o);C>=0&&C<=1&&(a[f++]=C),x>=0&&x<=1&&(a[f++]=x),E>=0&&E<=1&&(a[f++]=E)}}return f}},{key:"cubicExtrema",value:function(e,t,r,n,i){var a=6*r-12*t+6*e,o=9*t+3*n-3*e-9*r,s=3*t-3*e,l=0;if(this.isAroundZero(o)){if(this.isNotAroundZero(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(this.isAroundZero(c))i[0]=-a/(2*o);else if(c>0){var p=Math.sqrt(c),h=(-a+p)/(2*o),f=(-a-p)/(2*o);h>=0&&h<=1&&(i[l++]=h),f>=0&&f<=1&&(i[l++]=f)}}return l}},{key:"cubicSubdivide",value:function(e,t,r,n,i,a){var o=(t-e)*i+e,s=(r-t)*i+t,l=(n-r)*i+r,u=(s-o)*i+o,c=(l-s)*i+s,p=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=p,a[4]=p,a[5]=c,a[6]=l,a[7]=n}},{key:"cubicProjectPoint",value:function(e,t,r,n,i,a,o,s,l,u,c){var p,h=this.vector.create(),f=this.vector.create(),d=this.vector.create(),y=.005,v=1/0;h[0]=l,h[1]=u;for(var m=0;m<1;m+=.05){f[0]=this.cubicAt(e,r,i,o,m),f[1]=this.cubicAt(t,n,a,s,m);var g=this.vector.distSquare(h,f);g=0&&P=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(this.isAroundZero(c)){var p=-o/(2*a);p>=0&&p<=1&&(i[l++]=p)}else if(c>0){var h=Math.sqrt(c),f=(-o+h)/(2*a),d=(-o-h)/(2*a);f>=0&&f<=1&&(i[l++]=f),d>=0&&d<=1&&(i[l++]=d)}}return l}},{key:"quadraticExtremum",value:function(e,t,r){var n=e+r-2*t;return 0===n?.5:(e-t)/n}},{key:"quadraticProjectPoint",value:function(e,t,r,n,i,a,o,s,l){var u,c=this.vector.create(),p=this.vector.create(),h=this.vector.create(),f=.005,d=1/0;c[0]=o,c[1]=s;for(var y=0;y<1;y+=.05){p[0]=this.quadraticAt(e,r,i,y),p[1]=this.quadraticAt(t,n,a,y);var v=this.vector.distSquare(c,p);v=0&&S-5e-5&&e<5e-5}i.SUtil.Util_vector.sub(t,e,this.position),n(t[0])&&n(t[1])||(i.SUtil.Util_vector.normalize(t,t),r[2]=t[0]*this.scale[1],r[3]=t[1]*this.scale[1],r[0]=t[1]*this.scale[0],r[1]=-t[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})}return n(e,[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function e(e){return e>5e-5||e<-5e-5}this.needLocalTransform=e(this.rotation[0])||e(this.position[0])||e(this.position[1])||e(this.scale[0]-1)||e(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var e=[0,0],t=this.transform||i.SUtil.Util_matrix.create();if(i.SUtil.Util_matrix.identity(t),this.needLocalTransform){if(a(this.scale[0])||a(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;var r=a(e[0])||a(e[1]);r&&i.SUtil.Util_matrix.translate(t,t,e),i.SUtil.Util_matrix.scale(t,t,this.scale),r&&(e[0]=-e[0],e[1]=-e[1],i.SUtil.Util_matrix.translate(t,t,e))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){e[0]=-this.rotation[1]||0,e[1]=-this.rotation[2]||0;var n=a(e[0])||a(e[1]);n&&i.SUtil.Util_matrix.translate(t,t,e),i.SUtil.Util_matrix.rotate(t,t,this.rotation[0]),n&&(e[0]=-e[0],e[1]=-e[1],i.SUtil.Util_matrix.translate(t,t,e))}}else 0!==this.rotation&&i.SUtil.Util_matrix.rotate(t,t,this.rotation);(a(this.position[0])||a(this.position[1]))&&i.SUtil.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?i.SUtil.Util_matrix.mul(this.transform,this.parent.transform,this.transform):i.SUtil.Util_matrix.copy(this.transform,this.parent.transform))}function a(e){return e>5e-5||e<-5e-5}}},{key:"setTransform",value:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],r=this.position,n=this.scale,i=this.rotation;o(t-1)&&(t=Math.sqrt(t));var a=e[2]*e[2]+e[3]*e[3];o(a-1)&&(a=Math.sqrt(a)),r[0]=e[4],r[1]=e[5],n[0]=t,n[1]=a,n[2]=n[3]=0,i[0]=Math.atan2(-e[1]/a,e[0]/t),i[1]=i[2]=0}function o(e){return e>5e-5||e<-5e-5}}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sector=void 0;var n=function(){function e(e,t){for(var r=0;r1)for(var i=0,a=n-1;i1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(e){(e=this.trim(e)).indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,function(e){r<3?e|=0:e=+e,t[r++]=e}),t}},{key:"convert",value:function(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),n=r[3];return void 0===n&&(n=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,t)}},{key:"toRGBA",value:function(e){return this.convert(e,"rgba")}},{key:"toRGB",value:function(e){return this.convert(e,"rgb")}},{key:"toHex",value:function(e){return this.convert(e,"hex")}},{key:"toHSVA",value:function(e){return this.convert(e,"hsva")}},{key:"toHSV",value:function(e){return this.convert(e,"hsv")}},{key:"toHSBA",value:function(e){return this.convert(e,"hsba")}},{key:"toHSB",value:function(e){return this.convert(e,"hsb")}},{key:"toHSLA",value:function(e){return this.convert(e,"hsla")}},{key:"toHSL",value:function(e){return this.convert(e,"hsl")}},{key:"toName",value:function(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}},{key:"trim",value:function(e){return String(e).replace(/\s+/g,"")}},{key:"normalize",value:function(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,r=(240&e)<<4,n=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return e}},{key:"lift",value:function(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var n=this.getData(e),i=0;i<3;i++)n[i]=1===r?n[i]*(1-t)|0:(255-n[i])*t+n[i]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,function(e){return 255-e}),this.toColor(t,"rgb")}},{key:"mix",value:function(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,i=this.getData(this.toRGBA(e)),a=this.getData(this.toRGBA(t)),o=i[3]-a[3],s=((n*o==-1?n:(n+o)/(1+n*o))+1)/2,l=1-s,u=[],c=0;c<3;c++)u[c]=i[c]*s+a[c]*l;var p=i[3]*r+a[3]*(1-r);return p=Math.max(0,Math.min(1,p)),1===i[3]&&1===a[3]?this.toColor(u,"rgb"):(u[3]=p,this.toColor(u,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(t){var r,n,i=(t=this.normalize(t)).match(this.colorRegExp);if(null===i)throw new Error("The color format error");var a,o=[];if(i[2])a=[(r=i[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],o=this.map(a,function(t){return e.prototype.adjust.call(this,parseInt(t,16),[0,255])});else if(i[4]){var s=i[4].split(",");n=s[3],a=s.slice(0,3),o=this.map(a,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),e.prototype.adjust.call(this,t,[0,255])}),void 0!==n&&o.push(this.adjust(parseFloat(n),[0,1]))}else if(i[5]||i[6]){var l=(i[5]||i[6]).split(","),u=parseInt(l[0],0)/360,c=l[1],p=l[2];n=l[3],(o=this.map([c,p],function(t){return e.prototype.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(u),void 0!==n&&o.push(this.adjust(parseFloat(n),[0,1]))}return o}},{key:"alpha",value:function(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,n=0;n=t[1]&&(e=t[1]),e}},{key:"isCalculableColor",value:function(e){return e instanceof Array||"string"==typeof e}},{key:"_HSV_2_RGB",value:function(e){var t,r,n,i=e[0],a=e[1],o=e[2];if(0===a)t=255*o,r=255*o,n=255*o;else{var s=6*i;6===s&&(s=0);var l=0|s,u=o*(1-a),c=o*(1-a*(s-l)),p=o*(1-a*(1-(s-l))),h=0,f=0,d=0;0===l?(h=o,f=p,d=u):1===l?(h=c,f=o,d=u):2===l?(h=u,f=o,d=p):3===l?(h=u,f=c,d=o):4===l?(h=p,f=u,d=o):(h=o,f=u,d=c),t=255*h,r=255*f,n=255*d}return[t,r,n]}},{key:"_HSL_2_RGB",value:function(e){var t,r,n,i=e[0],a=e[1],o=e[2];if(0===a)t=255*o,r=255*o,n=255*o;else{var s,l=2*o-(s=o<.5?o*(1+a):o+a-a*o);t=255*this._HUE_2_RGB(l,s,i+1/3),r=255*this._HUE_2_RGB(l,s,i),n=255*this._HUE_2_RGB(l,s,i-1/3)}return[t,r,n]}},{key:"_HUE_2_RGB",value:function(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}},{key:"_RGB_2_HSB",value:function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o,u=s;if(0===l)t=0,r=0;else{r=l/s;var c=((s-n)/6+l/2)/l,p=((s-i)/6+l/2)/l,h=((s-a)/6+l/2)/l;n===s?t=h-p:i===s?t=1/3+c-h:a===s&&(t=2/3+p-c),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,u*=100]}},{key:"_RGB_2_HSL",value:function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o,u=(s+o)/2;if(0===l)t=0,r=0;else{r=u<.5?l/(s+o):l/(2-s-o);var c=((s-n)/6+l/2)/l,p=((s-i)/6+l/2)/l,h=((s-a)/6+l/2)/l;n===s?t=h-p:i===s?t=1/3+c-h:a===s&&(t=2/3+p-c),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,u*=100]}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelMatrixCell=void 0;var n=r(0); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var i=t.LabelMatrixCell=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.CLASS_NAME="LabelMatrixCell"};n.SuperMap.LabelMatrixCell=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeOffset=void 0;var n=function(){function e(e,t){for(var r=0;r0){e+='"points":[';for(var r=0,n=this.components.length;r0))return null;for(var u=0,c=0,p=[];u0&&this.addLayers(t),this.currentLayerDataModel=null}return i(e,[{key:"addLayers",value:function(e,t,r,n){for(var i=0;i0?n.operatingAttributeNames:n.attributeNames).length;o1?r.weight/10:r.weight)):t.setAttribute("stroke","none"),r.fill?(t.setAttribute("fill",r.fillColor||r.color),t.setAttribute("fill-opacity",r.fillOpacity)):t.setAttribute("fill","none")}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};t.CanvasRenderer=a.default.Canvas.extend({initialize:function(e,t,r){a.default.Canvas.prototype.initialize.call(this,r),this._tileCoord=e,this._size=t,this._initContainer(),this._container.setAttribute("width",this._size.x),this._container.setAttribute("height",this._size.y),this._layers={},this._drawnLayers={},this._drawing=!0,r.interactive&&(this._container.style.pointerEvents="auto")},getCoord:function(){return this._tileCoord},getContainer:function(){return this._container},getOffset:function(){return this._tileCoord.scaleBy(this._size).subtract(this._map.getPixelOrigin())},onAdd:a.default.Util.falseFn,addTo:function(e){this._map=e},removeFrom:function(e){delete this._map},_updateDashArray:function(e){var t=e.options.dashArray;if(t&&"string"==typeof t){var r,n=t.split(","),i=[];for(r=0;r0&&t._reset(),t.addTFEvents(),t.mouseMoveHandler=function(e){var r=e.layerPoint;t.currentMousePosition=n.default.point(r.x+t.movingOffset[0],r.y+t.movingOffset[1])},e.on("mousemove",t.mouseMoveHandler),t.update(e.getBounds())}else e.removeLayer(t)},addFeatures:function(e){},redrawThematicFeatures:function(e){},destroyFeatures:function(e){if(void 0===e&&(e=this.features),e){this.removeFeatures(e);for(var t=e.length-1;t>=0;t--)e[t].destroy()}},removeFeatures:function(e){var t=this;if(e&&0!==e.length){if(e===t.features)return t.removeAllFeatures();n.default.Util.isArray(e)||(e=[e]);for(var r=[],i=e.length-1;i>=0;i--){var a=e[i],o=n.default.Util.indexOf(t.features,a);-1!==o?t.features.splice(o,1):r.push(a)}for(var s=[],l=0,u=t.features.length;l-1;o--)if(e.indexOf(a[o])>-1){i=e.replace(a[o],r[a[o]]);break}i=i.replace(/[#]/gi,"#"),r[e]=n,t=t.replace(new RegExp(i,"g"),n)}),t=(t=t.replace(/[#]/gi,"\n#")).replace(/\[zoom/gi,"[scale")}}},{key:"pickShader",value:function(e){if(!this.cartoCSS)return null;var t=e.replace(/[@#\s]/gi,"___");return this.cartoCSS[t]}},{key:"getDefaultStyle",value:function(e){var t={},r=l.DefaultStyle[e];for(var n in r){var i=r[n];t[n]=i}return t}},{key:"getStyleFromiPortalMarker",value:function(e){return 0==e.indexOf("./")?null:(0==e.indexOf("http://support.supermap.com.cn:8092/static/portal")&&(e=e.replace("http://support.supermap.com.cn:8092/static/portal","http://support.supermap.com.cn:8092/apps/viewer/static")),o.default.icon({iconUrl:e,iconSize:o.default.point(48,43),iconAnchor:o.default.point(24,43),popupAnchor:o.default.point(0,-43)}))}},{key:"getStyleFromiPortalStyle",value:function(e,t,r){var n=r?JSON.parse(r):null,i={};if("Point"===t||"MultiPoint"===t){var a=n||e.pointStyle;return a.externalGraphic?0==a.externalGraphic.indexOf("./")?null:(0==a.externalGraphic.indexOf("http://support.supermap.com.cn:8092/static/portal")&&(a.externalGraphic=a.externalGraphic.replace("http://support.supermap.com.cn:8092/static/portal","http://support.supermap.com.cn:8092/apps/viewer/static")),o.default.icon({iconUrl:a.externalGraphic,iconSize:o.default.point(a.graphicWidth,a.graphicHeight),iconAnchor:o.default.point(-a.graphicXOffset,-a.graphicYOffset),popupAnchor:o.default.point(0,-a.graphicHeight)})):(i.radius=a.pointRadius,i.color=a.strokeColor,i.opacity=a.strokeOpacity,i.lineCap=a.strokeLineCap,i.weight=a.strokeWidth,i.fillColor=a.fillColor,i.fillOpacity=a.fillOpacity,i.dashArray=this.dashStyle(a,1),i)}if("LineString"===t||"MultiLineString"===t||"Box"===t){var s=n||e.lineStyle;return i.color=s.strokeColor,i.opacity=s.strokeOpacity,i.fillOpacity=s.fillOpacity,i.lineCap=s.strokeLineCap,i.weight=s.strokeWidth,i.dashArray=this.dashStyle(s,1),i}if("Polygon"===t||"MultiPolygon"===t){var l=n||e.polygonStyle;return i.color=l.strokeColor,i.opacity=l.strokeOpacity,i.lineCap=l.strokeLineCap,i.weight=l.strokeWidth,i.fillColor=l.fillColor,i.fillOpacity=l.fillOpacity,i.dashArray=this.dashStyle(l,1),i}}},{key:"dashStyle",value:function(e,t){if(!e)return[];var r=e.strokeWidth*t,n=e.strokeDashstyle;switch(n){case"solid":return[];case"dot":return[1,4*r];case"dash":return[4*r,4*r];case"dashdot":return[4*r,4*r,1,4*r];case"longdash":return[8*r,4*r];case"longdashdot":return[8*r,4*r,1,4*r];default:return n?s.CommonUtil.isArray(n)?n:(n=s.StringExt.trim(n).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}}},{key:"getValidStyleFromCarto",value:function(e,t,r,n,i){if(!r)return null;var a=n.type,o=n.properties.attributes||{},s=this.getDefaultStyle(a);i=void 0===i||i,o.FEATUREID=n.properties.id,o.SCALE=t;for(var l,c,p=u.CartoStyleMap[a],h=0,f=r.length;h7?0:i.fillSymbolID,h=i.lineSymbolID>5?0:i.lineSymbolID;for(var f in i){var d=u.ServerStyleMap[f];if(d){var y=d.leafletStyle;switch(d.type){case"number":var v=i[f];d.unit&&(v=v*s.SuperMap.DOTS_PER_INCH*s.SuperMap.INCHES_PER_UNIT[d.unit]*2.5),n[y]=v;break;case"color":var m=i[f],g=void 0,b=1;if("fillColor"===y)0!==p&&1!==p||(b=1-p,g="rgba("+m.red+","+m.green+","+m.blue+","+b+")");else if("color"===y){if(0===h||5===h)b=0===h?1:0;else{var S=[1,0];switch(h){case 1:S=[9.7,3.7];break;case 2:S=[3.7,3.7];break;case 3:S=[9.7,3.7,2.3,3.7];break;case 4:S=[9.7,3.7,2.3,3.7,2.3,3.7]}n.lineDasharray=S}g="rgba("+m.red+","+m.green+","+m.blue+","+b+")"}n[y]=g}}}return t.textField&&(n.textAlign="LEFT"),n}}]),e}();o.default.supermap.CartoCSSToLeaflet=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wmtsLayer=t.WMTSLayer=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var o=t.WMTSLayer=a.default.TileLayer.extend({options:{version:"1.0.0",style:"",tilematrixSet:"",format:"image/png",tileSize:256,matrixIds:null,layer:"",requestEncoding:"KVP",attribution:""},initialize:function(e,t){this._url=e,a.default.setOptions(this,t);var r=this.options;if("REST"===r.requestEncoding){this.formatSuffix="."+({"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"}[r.format]||r.format.split("/").pop()||"png")}else r.requestEncoding="KVP"},getTileUrl:function(e){var t=this._getZoomForUrl(),r=this.options.matrixIds?this.options.matrixIds[t].identifier:t,n=a.default.Util.template(this._url,{s:this._getSubdomain(e)}),i={service:"WMTS",request:"GetTile",version:this.options.version,style:this.options.style,tilematrixSet:this.options.tilematrixSet,format:this.options.format,width:this.options.tileSize,height:this.options.tileSize,layer:this.options.layer,tilematrix:r,tilerow:e.y,tilecol:e.x};if(this.options.tileProxy&&(n=this.options.tileProxy+n),"KVP"===this.options.requestEncoding)n+=a.default.Util.getParamString(i,n);else if("REST"===this.options.requestEncoding){n+="/"+i.layer+"/"+i.style+"/"+i.tilematrixSet+"/"+i.tilematrix+"/"+i.tilerow+"/"+i.tilecol+this.formatSuffix}return n}}),s=t.wmtsLayer=function(e,t){return new o(e,t)};a.default.supermap.wmtsLayer=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r;return e>1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n,i){var a,o;a=e/t;for(var s=0;s<15;s++)if(a+=o=(e-(t*a-r*Math.sin(2*a)+n*Math.sin(4*a)-i*Math.sin(6*a)))/(t-2*r*Math.cos(2*a)+4*n*Math.cos(4*a)-6*i*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=p(r(459)),a=p(r(453)),o=p(r(452)),s=r(449),l=p(r(447)),u=p(r(446)),c=p(r(73));function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(this instanceof h))return new h(e);t=t||function(e){if(e)throw e};var r=(0,i.default)(e);if("object"===(void 0===r?"undefined":n(r))){var o=h.projections.get(r.projName);if(o){if(r.datumCode&&"none"!==r.datumCode){var p=(0,c.default)(l.default,r.datumCode);p&&(r.datum_params=p.towgs84?p.towgs84.split(","):null,r.ellps=p.ellipse,r.datumName=p.datumName?p.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84";var f=(0,s.sphere)(r.a,r.b,r.rf,r.ellps,r.sphere),d=(0,s.eccentricity)(f.a,f.b,f.rf,r.R_A),y=r.datum||(0,u.default)(r.datumCode,r.datum_params,f.a,f.b,d.es,d.ep2);(0,a.default)(this,r),(0,a.default)(this,o),this.a=f.a,this.b=f.b,this.rf=f.rf,this.sphere=f.sphere,this.es=d.es,this.e=d.e,this.ep2=d.ep2,this.datum=y,this.init(),t(null,this)}else t(e)}else t(e)}h.projections=o.default,h.projections.start(),t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nonEarthCRS=t.NonEarthCRS=t.nonProjection=t.NonProjection=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};a.default.Projection={}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var o=t.NonProjection=a.default.Class.extend({initialize:function(e){this.bounds=e},project:function(e){return new a.default.Point(e.lng,e.lat)},unproject:function(e){return new a.default.LatLng(e.y,e.x)}}),s=t.nonProjection=function(e){return new o(e)},l=t.NonEarthCRS=a.default.Class.extend({includes:a.default.CRS,initialize:function(e){e.origin&&(this.transformation=new a.default.Transformation(1,-e.origin.x,-1,e.origin.y)),this.projection=a.default.Projection.NonProjection(e.bounds),this.bounds=e.bounds,this.origin=e.origin,this.resolutions=e.resolutions},scale:function(e){return this.resolutions&&0!==this.resolutions.length?1/this.resolutions[e]:1/(Math.max(this.bounds.getSize().x,this.bounds.getSize().y)/256)*Math.pow(2,e)},zoom:function(e){if(!this.resolutions||0===this.resolutions.length){var t=1/(Math.max(this.bounds.getSize().x,this.bounds.getSize().y)/256);return Math.log(e/t)/Math.LN2}for(var r=0;rc&&(r*=c/(o=r+n),n*=c/o),i+a>c&&(i*=c/(o=i+a),a*=c/o),n+i>p&&(n*=p/(o=n+i),i*=p/o),r+a>p&&(r*=p/(o=r+a),a*=p/o),e.moveTo(l+r,u),e.lineTo(l+c-n,u),0!==n&&e.quadraticCurveTo(l+c,u,l+c,u+n),e.lineTo(l+c,u+p-i),0!==i&&e.quadraticCurveTo(l+c,u+p,l+c-i,u+p),e.lineTo(l+a,u+p),0!==a&&e.quadraticCurveTo(l,u+p,l,u+p-a),e.lineTo(l,u+r),0!==r&&e.quadraticCurveTo(l,u,l+r,u)}},{key:"buildPath",value:function(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+r[0],t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1])),e.closePath()}},{key:"getRect",value:function(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition;return e.__rect?e.__rect:(t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x+r[0]-t/2),y:Math.round(e.y+r[1]-t/2),width:e.width+t,height:e.height+t},e.__rect)}}]),t}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmicImage=void 0;var n=function(){function e(e,t){for(var r=0;rn&&(n=l[0]),l[1]i&&(i=l[1]))}return e.__rect={x:t,y:r,width:n-t,height:i-r},e.__rect}},{key:"getRectNoRotation",value:function(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition,n=a.SUtil.Util_area.getTextHeight("ZH",e.textFont),i=a.SUtil.Util_area.getTextWidth(e.text,e.textFont),o=a.SUtil.Util_area.getTextHeight(e.text,e.textFont),s=e.x+r[0];"end"==e.textAlign||"right"==e.textAlign?s-=i:"center"==e.textAlign&&(s-=i/2),t="top"==e.textBaseline?e.y+r[1]:"bottom"==e.textBaseline?e.y+r[1]-o:e.y+r[1]-o/2;var l,u=!1;if(e.maxWidth){var c=parseInt(e.maxWidth);c-1&&(i+=!0===u?n/3*(i/l):n/3));return{x:s,y:t,width:i,height:o}}},{key:"getTextBackground",value:function(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var n=this.getRectNoRotation(e),i=e.x+r[0],a=e.y+r[1],o=[];if(e.textRotation&&0!==e.textRotation){var s=e.textRotation,l=this.getRotatedLocation(n.x,n.y,i,a,s),u=this.getRotatedLocation(n.x+n.width,n.y,i,a,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,i,a,s),p=this.getRotatedLocation(n.x,n.y+n.height,i,a,s);o.push(l),o.push(u),o.push(c),o.push(p)}else{var h=[n.x,n.y],f=[n.x+n.width,n.y],d=[n.x+n.width,n.y+n.height],y=[n.x,n.y+n.height];o.push(h),o.push(f),o.push(d),o.push(y)}return e.__textBackground=o,e.__textBackground}},{key:"getRotatedLocation",value:function(e,t,r,n,i){var a,o,s=new Array;return t=-t,n=-n,i=-i,a=(e-r)*Math.cos(i/180*Math.PI)-(t-n)*Math.sin(i/180*Math.PI)+r,o=(e-r)*Math.sin(i/180*Math.PI)+(t-n)*Math.cos(i/180*Math.PI)+n,s[0]=a,s[1]=-o,s}}]),t}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmicPoint=void 0;var n=function(){function e(e,t){for(var r=0;r0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.rangeExpression=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}}],[{key:"fromObj",value:function(e){if(e){var r=new t;a.Util.copy(r,e);var n=e.items,i=n?n.length:0;r.items=[];for(var o=0;o0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null)}},{key:"toServerJSONObject",value:function(){var e={};if((e=a.Util.copyAttributes(e,this)).defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,n=0;n=0;e--)this.points[e].destroy();this.points=null}}}],[{key:"toObject",value:function(e,t){for(var r in e)"clipRegion"===r?t.clipRegion=s.ServerGeometry.fromGeometry(e.clipRegion):t[r]=e[r]}}]),t}();i.SuperMap.GeometryThiessenAnalystParameters=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeometryOverlayAnalystParameters=void 0;var n=function(){function e(e,t){for(var r=0;r0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,function(e,r){var n=t[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Format),i(t,[{key:"read",value:function(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch(e){}return this.keepData&&(this.data=r),r}},{key:"write",value:function(e,t){this.pretty=!!t;var r=null,i=void 0===e?"undefined":n(e);if(this.serialize[i])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[i].apply(this,[e])}catch(e){}return r}},{key:"writeIndent",value:function(){var e=[];if(this.pretty)for(var t=0;t1&&(r=parseFloat(r)*p),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":c.x+=t/2,c.y+=r/2;break;case"lm":c.x+=t/2;break;case"lb":c.x+=t/2,c.y-=r/2;break;case"ct":c.y+=r/2;break;case"cb":c.y-=r/2;break;case"rt":c.x-=t/2,c.y+=r/2;break;case"rm":c.x-=t/2;break;case"rb":c.x-=t/2,c.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=t,i=c.x-parseFloat(t)/2,a=c.y+parseFloat(r)/2,u=c.x+parseFloat(t)/2,l=c.y-parseFloat(r)/2,new o.Bounds(i,a,u,l)}},{key:"getLabelPxBoundsByText",value:function(e,t){var r,n,i,a,l=this.getLabelPxSize(t),u=s.Util.cloneObject(e);if(t.labelAlign&&"cm"!==t.labelAlign)switch(t.labelAlign){case"lt":u.x+=l.w/2,u.y+=l.h/2;break;case"lm":u.x+=l.w/2;break;case"lb":u.x+=l.w/2,u.y-=l.h/2;break;case"ct":u.y+=l.h/2;break;case"cb":u.y-=l.h/2;break;case"rt":u.x-=l.w/2,u.y+=l.h/2;break;case"rm":u.x-=l.w/2;break;case"rb":u.x-=l.w/2,u.y-=l.h/2}return this.bsInfo.h=l.h,this.bsInfo.w=l.w,r=u.x-l.w/2,n=u.y+l.h/2,a=t.fontStyle&&"italic"===t.fontStyle?u.x+l.w/2+parseInt(parseFloat(t.fontSize)/2):u.x+l.w/2,i=u.y-l.h/2,new o.Bounds(r,n,a,i)}},{key:"getLabelPxSize",value:function(e){var t,r,n,i,a=parseFloat(e.strokeWidth);t=e.label||this.text,r=e.fontSize?parseFloat(e.fontSize):parseFloat("12px");var o=t.split("\n"),l=o.length;i=l>1?r*l+l+a+.2*r:r+a+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return t.cnC=r,t.enC=n,t.textC=e.length,t}}]),t}();i.SuperMap.Geometry.GeoText=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Curve=void 0;var n=r(0),i=r(51); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var a=t.Curve=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.componentTypes=["SuperMap.Geometry.Point","SuperMap.PointWithMeasure"],r.CLASS_NAME="SuperMap.Geometry.Curve",r.geometryType="Curve",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.MultiPoint),t}();n.SuperMap.Geometry.Curve=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dataServiceQueryViewModel=t.DataServiceQueryViewModel=void 0;var n,i=function(){function e(e,t){for(var r=0;r0?this.fire("searchlayersucceeded",{result:r}):this.fire("searchfailed",{searchType:"searchLayersField"})}},searchFromCityLocalSearchService:function(e){if(this.searchCache[e])this.fire("geocodesucceeded",{result:this.searchCache[e]});else{this.geoCodeParam.keyWords=e||this.geoCodeParam.city;var t=this,r=this._getSearchUrl(this.geoCodeParam);o.FetchRequest.get(r).then(function(e){return e.json()}).then(function(e){if(e.error||0===e.poiInfos.length)t.fire("searchfailed",{searchType:"searchGeocodeField"});else if(e.poiInfos){var r=t._dataToGeoJson(e.poiInfos,t.geoCodeParam);t.fire("geocodesucceeded",{result:r})}})}},addSearchLayers:function(e){var t=this;this.dataModel.addLayers(e,function(e){t.fire("newlayeradded",{layerName:e.layerName})},null,this)},panToLayer:function(e){this.dataModel.layers[e]&&this.map.flyToBounds(this.dataModel.layers[e].layer.getBounds())},panToCity:function(e){this.geoCodeParam.keyWords=e,this.geoCodeParam.city=e;var t=this,r=this._getSearchUrl(this.geoCodeParam);o.FetchRequest.get(r).then(function(e){return e.json()}).then(function(e){if(e.poiInfos.length>0){var r=a.default.latLng(e.poiInfos[0].location.y,e.poiInfos[0].location.x);t.map.setView(r,8)}else t.fire("searchfailed",{searchType:"cityGeocodeField"})})},_dataToGeoJson:function(e,t){for(var r=[],n=0;nthis.fileModel.FileConfig.fileMaxSize)return this.fire("filesizeexceed",{messageType:"warring",message:o.Lang.i18n("msg_fileSizeExceeded")}),!1;var n=t.value,i=r.name,a=o.ComponentsUtil.getFileType(i);if(!a)return this.fire("errorfileformat",{messageType:"failure",message:o.Lang.i18n("msg_fileTypeUnsupported")}),!1;""!==i&&(this.fileModel.set("loadFileObject",{file:r,filePath:n,fileName:i,fileType:a}),this._readData())},_readData:function(){var e=this,t=this,r=this.fileModel.loadFileObject.fileType;o.FileReaderUtil.readFile(r,{file:this.fileModel.loadFileObject.file,path:this.fileModel.loadFileObject.filePath},function(n){o.FileReaderUtil.processDataToGeoJson(r,n,function(t){t&&e.fire("openfilesucceeded",{result:t,layerName:e.fileModel.loadFileObject.fileName.split(".")[0]})},function(e){t.fire("openfilefailed",{messageType:"failure",message:e})},e)},function(){t.fire("openfilefailed",{messageType:"failure",message:o.Lang.i18n("msg_openFileFail")})},this)}}),l=t.openFileViewModel=function(e){return new s(e)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/a.default.supermap.components.openFileViewModel=l,a.default.supermap.components.util=o.ComponentsUtil},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processingService=t.ProcessingService=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3);var o=r(9),s=r(26),l=r(5);var u=t.ProcessingService=o.ServiceBase.extend({initialize:function(e,t){t=t||{},a.default.setOptions(this,t),o.ServiceBase.prototype.initialize.call(this,e,t),this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={}},getKernelDensityJobs:function(e,t){var r=this,n=r._processFormat(t);new l.KernelDensityJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getKernelDensityJobs()},getKernelDensityJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.KernelDensityJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getKernelDensityJob(e)},addKernelDensityJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.KernelDensityJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.kernelDensityJobs[e.id]=e.state}},format:o}).addKernelDensityJob(a,r)},getKernelDensityJobState:function(e){return this.kernelDensityJobs[e]},getSummaryMeshJobs:function(e,t){var r=this,n=r._processFormat(t);new l.SummaryMeshJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getSummaryMeshJobs()},getSummaryMeshJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.SummaryMeshJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getSummaryMeshJob(e)},addSummaryMeshJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.SummaryMeshJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.summaryMeshJobs[e.id]=e.state}},format:o}).addSummaryMeshJob(a,r)},getSummaryMeshJobState:function(e){return this.summaryMeshJobs[e]},getQueryJobs:function(e,t){var r=this,n=r._processFormat(t);new l.SingleObjectQueryJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getQueryJobs()},getQueryJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.SingleObjectQueryJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getQueryJob(e)},addQueryJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.SingleObjectQueryJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.queryJobs[e.id]=e.state}},format:o}).addQueryJob(a,r)},getQueryJobState:function(e){return this.queryJobs[e]},getSummaryRegionJobs:function(e,t){var r=this,n=r._processFormat(t);new l.SummaryRegionJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getSummaryRegionJobs()},getSummaryRegionJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.SummaryRegionJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getSummaryRegionJob(e)},addSummaryRegionJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.SummaryRegionJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.summaryRegionJobs[e.id]=e.state}},format:o}).addSummaryRegionJob(a,r)},getSummaryRegionJobState:function(e){return this.summaryRegionJobs[e]},getVectorClipJobs:function(e,t){var r=this,n=r._processFormat(t);new l.VectorClipJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getVectorClipJobs()},getVectorClipJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.VectorClipJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getVectorClipJob(e)},addVectorClipJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.VectorClipJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.vectorClipJobs[e.id]=e.state}},format:o}).addVectorClipJob(a,r)},getVectorClipJobState:function(e){return this.vectorClipJobs[e]},getOverlayGeoJobs:function(e,t){var r=this,n=r._processFormat(t);new l.OverlayGeoJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getOverlayGeoJobs()},getOverlayGeoJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.OverlayGeoJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getOverlayGeoJob(e)},addOverlayGeoJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.OverlayGeoJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.overlayGeoJobs[e.id]=e.state}},format:o}).addOverlayGeoJob(a,r)},getoverlayGeoJobState:function(e){return this.overlayGeoJobs[e]},getBuffersJobs:function(e,t){var r=this,n=r._processFormat(t);new l.BuffersAnalystJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getBuffersJobs()},getBuffersJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.BuffersAnalystJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getBuffersJob(e)},addBuffersJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.BuffersAnalystJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.buffersJobs[e.id]=e.state}},format:o}).addBuffersJob(a,r)},getBuffersJobState:function(e){return this.buffersJobs[e]},getTopologyValidatorJobs:function(e,t){var r=this,n=r._processFormat(t);new l.TopologyValidatorJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getTopologyValidatorJobs()},getTopologyValidatorJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.TopologyValidatorJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getTopologyValidatorJob(e)},addTopologyValidatorJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.TopologyValidatorJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.topologyValidatorJobs[e.id]=e.state}},format:o}).addTopologyValidatorJob(a,r)},getTopologyValidatorJobState:function(e){return this.topologyValidatorJobs[e]},getSummaryAttributesJobs:function(e,t){var r=this,n=r._processFormat(t);new l.SummaryAttributesJobsService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:n}).getSummaryAttributesJobs()},getSummaryAttributesJob:function(e,t,r){var n=this,i=n._processFormat(r);new l.SummaryAttributesJobsService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:i}).getSummaryAttributesJob(e)},addSummaryAttributesJob:function(e,t,r,n){var i=this,a=i._processParams(e),o=i._processFormat(n);new l.SummaryAttributesJobsService(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,serverType:i.options.serverType,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.summaryAttributesJobs[e.id]=e.state}},format:o}).addSummaryAttributesJob(a,r)},getSummaryAttributesJobState:function(e){return this.summaryAttributesJobs[e]},_processFormat:function(e){return e||l.DataFormat.GEOJSON},_processParams:function(e){return e?(e.bounds&&(e.bounds=s.CommontypesConversion.toSuperMapBounds(e.bounds)),e.query&&(e.query=s.CommontypesConversion.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=s.CommontypesConversion.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=s.CommontypesConversion.toProcessingParam(e.geometryClip)),e):{}}}),c=t.processingService=function(e,t){return new u(e,t)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/a.default.supermap.processingService=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTileJSON=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n},o=r(54),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(32)),l=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.VectorTileJSON=a.default.Class.extend({initialize:function(e){this.url=e},getTile:function(){var e=this;return l.FetchRequest.get(e.url,null,{timeout:1e4}).then(function(e){return e.json()}).then(function(t){return e._processRecordSets(t,e)})},_processRecordSets:function(e,t){var r=e.recordsets;if(!(r=t._convertToGeoJSON(r)))return null;for(var n=0;n>3}if(a--,1===i||2===i)o+=e.readSVarint(),s+=e.readSVarint(),1===i&&(t&&l.push(t),t=[]),t.push(new n(o,s));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&l.push(t),l},i.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;e.pos>3}if(n--,1===r||2===r)i+=e.readSVarint(),a+=e.readSVarint(),is&&(s=i),au&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},i.prototype.toGeoJSON=function(e,t,r){var n,a,s=this.extent*Math.pow(2,r),l=this.extent*e,u=this.extent*t,c=this.loadGeometry(),p=i.types[this.type];function h(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}e.exports=i,i.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new n(this._pbf,t,this.extent,this._keys,this._values)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTilePBF=void 0;var n=l(r(2)),i=l(r(380)),a=r(378),o=r(54),s=r(5);function l(e){return e&&e.__esModule?e:{default:e}}t.VectorTilePBF=n.default.Class.extend({initialize:function(e){this.url=e},getTile:function(){var e=this;return s.FetchRequest.get(e.url,null,{timeout:1e4}).then(function(e){return e.ok?e.blob().then(function(e){var t=new FileReader;return new Promise(function(r){t.addEventListener("loadend",function(){var e=new i.default(t.result);return r(new a.VectorTile(e))}),t.readAsArrayBuffer(e)})}):{layers:[]}}).then(function(t){return e._processVectorTileSpec(t)})},_processVectorTileSpec:function(e){var t=[];for(var r in e.layers){for(var i=[],a=0;a-1?new p.VectorTilePBF(n):new h.VectorTileJSON(n)).getTile().then(function(t){e.render(t,r)})},render:function(e,t){if(e){for(var r=this,n=r.renderer,i=r.layer,s=0;s=r.left&&o.x<=r.right&&o.y>=r.top&&o.y<=r.bottom){n=!0;break}}return n},clearCache:function(){this.cache={},this.charts=[]},removeFeatures:function(e){this.clearCache(),s.ThemeLayer.prototype.removeFeatures.apply(this,arguments)},removeAllFeatures:function(){this.clearCache(),s.ThemeLayer.prototype.removeAllFeatures.apply(this,arguments)},redraw:function(){return this.clearCache(),s.ThemeLayer.prototype.redraw.apply(this,arguments)},clear:function(){var e=this;e.renderer&&(e.renderer.clearAll(),e.renderer.refresh()),e.removeAllFeatures(),e.clearCache()},getWeightFieldValue:function(e,t,r){if((void 0===r||isNaN(r))&&(r=0),!e.attributes)return r;var n=e.attributes[t];return(void 0===n||isNaN(n))&&(n=r),n},_sortChart:function(){this.charts&&this.charts.sort(function(e,t){return void 0===e.__overlayWeight&&void 0===t.__overlayWeight?0:void 0!==e.__overlayWeight&&void 0===t.__overlayWeight?-1:void 0===e.__overlayWeight&&void 0!==t.__overlayWeight?1:void 0!==e.__overlayWeight&&void 0!==t.__overlayWeight?parseFloat(e.__overlayWeight)t.options.maxZoom)){var o=i.getBounds(),l=o.getEast()-o.getWest(),u=o.getNorth()-o.getSouth(),c=i.getSize(),p=l/c.x,h=u/c.y,f=this.canvasLayer.getTopLeft(),d=i.latLngToAccurateContainerPoint(f),y={transferCoordinate:function(e){var r,n={x:(r="2d"===t.context?i.latLngToAccurateContainerPoint(s.default.latLng(e[1],e[0])):{x:(e[0]-f.lng)/p,y:(f.lat-e[1])/h}).x-d.x,y:r.y-d.y};return[n.x,n.y]}};void 0!==e&&(y.filter=function(t){var n=r.trails||10;return e&&t.time>e-n&&t.time=0&&e.options.fontOpacity<1&&(r.globalAlpha=e.options.fontOpacity),r.fillText){r.font=n,r.textAlign=e.options.textAlign,r.textBaseline=e.options.textBaseline;var s=e.options.vfactor,l=r.measureText("Mg").height||r.measureText("xx").width;t.y+=l*s*(o-1);for(var u=0;u0&&0==this.labelFeatures.length)for(var t=this.setLabelsStyle(this.features),r=0,n=t.length;r=0&&d.x<=c.x&&d.y>=0&&d.y<=c.y){if(r.style.minZoomLevel>-1&&p<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&p>r.style.maxZoomLevel)continue;var y=null;r.isStyleChange?(r.isStyleChange=null,y=this.calculateLabelBounds(r,d)):y=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,d):this.calculateLabelBounds(r,d);var v=new s.Bounds(0,c.y,c.x,0),m=y.length;if(this.options.isAvoid){var g=this.getAvoidInfo(v,y);if(g){if("left"===g.aspectW){r.style.labelXOffset+=g.offsetX;for(var b=0;b=i[u].start&&o=i[u].start&&ol&&(l=r,u="top")}if(t.y>e.bottom){var n=Math.abs(t.y-e.bottom);n>l&&(l=n,u="bottom")}if(t.xo&&(o=i,c="left")}if(t.x>e.right){var a=Math.abs(t.x-e.right);a>o&&(o=a,c="right")}}}},isQuadrilateralOverLap:function(e,t){var r=e.length,n=t.length;if(5!==r||5!==n)return null;for(var i=!1,a=0;a0;if(t.themeField&&l&&r.attributes){var u=t.themeField,c=r.attributes;for(var p in c)if(u===p){a=!0,o=c[p];break}}if(a)for(var h=0,f=i.length;h=i[h].start&&o<=i[h].end:o>=i[h].start&&o0;if(t.themeField&&l&&r.attributes){var u=t.themeField,c=r.attributes;for(var p in c)if(u===p){a=!0,o=c[p];break}}if(a)for(var h=0,f=i.length;h1){var p=parseInt(c[1]);u=p&&p>=4e3&&p<=5e3?i.Unit.DEGREE:i.Unit.METER}}return a.resolutionToScale(l,96,u)},setTileSetsInfo:function(e){this.tileSets=e,n.default.Util.isArray(this.tileSets)&&(this.tileSets=this.tileSets[0]),this.tileSets&&(this.fire("tilesetsinfoloaded",{tileVersions:this.tileSets.tileVersions}),this.changeTilesVersion())},lastTilesVersion:function(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()},nextTilesVersion:function(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()},changeTilesVersion:function(){var e=this;if(null!=e.tileSets&&!(e.tempIndex===e.tileSetsIndex||this.tempIndex<0)){var t=e.tileSets.tileVersions;if(t&&e.tempIndex=0){var r=t[e.tempIndex].name;e.mergeTileVersionParam(r)&&(e.tileSetsIndex=e.tempIndex,e.fire("tileversionschanged",{tileVersion:t[e.tempIndex]}))}}},updateCurrentTileSetsIndex:function(e){this.tempIndex=e},mergeTileVersionParam:function(e){return!!e&&(this.requestParams.tileversion=e,this._paramsChanged=!0,this.redraw(),this._paramsChanged=!1,!0)},_getLayerUrl:function(){return this._paramsChanged&&(this._layerUrl=this._createLayerUrl()),this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){var e=this._url+"/tileImage."+this.options.format+"?";return e+=encodeURI(this._getRequestParamString()),e=this._appendCredential(e),this._layerUrl=e,e},_getRequestParamString:function(){this.requestParams=this.requestParams||this._getAllRequestParams();var e=[];for(var t in this.requestParams)e.push(t+"="+this.requestParams[t]);return e.join("&")},_getAllRequestParams:function(){var e=this.options||{},t={},r=this.options.tileSize;r instanceof n.default.Point||(r=n.default.point(r,r)),t.width=r.x,t.height=r.y,t.redirect=!0===e.redirect,t.transparent=!0===e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(t.layersID=e.layersID.toString()),e.clipRegionEnabled&&e.clipRegion instanceof n.default.Path&&(e.clipRegion=a.toSuperMapGeometry(e.clipRegion.toGeoJSON()),e.clipRegion=i.CommonUtil.toJSON(i.ServerGeometry.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion));var o=this._crs;if(o.options&&o.options.origin)t.origin=JSON.stringify({x:o.options.origin[0],y:o.options.origin[1]});else if(o.projection&&o.projection.bounds){var s=o.projection.bounds,l=n.default.point(s.min.x,s.max.y);t.origin=JSON.stringify({x:l.x,y:l.y})}return!1===e.overlapDisplayed?(t.overlapDisplayed=!1,e.overlapDisplayedOptions&&(t.overlapDisplayedOptions=this.overlapDisplayedOptions.toString())):t.overlapDisplayed=!0,!0===t.cacheEnabled&&e.tileversion&&(t.tileversion=e.tileversion.toString()),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),t},_appendCredential:function(e){var t,r,n=e;switch(this.options.serverType){case i.ServerType.IPORTAL:(t=(r=i.SecurityManager.getToken(this._url))?new i.Credential(r,"token"):null)||(t=(r=i.SecurityManager.getKey(this._url))?new i.Credential(r,"key"):null);break;case i.ServerType.ONLINE:t=(r=i.SecurityManager.getKey(this._url))?new i.Credential(r,"key"):null;break;default:t=(r=i.SecurityManager.getToken(this._url))?new i.Credential(r,"token"):null}return t&&(n+="&"+t.getUrlParameters()),n}}),u=t.tiledMapLayer=function(e,t){return new l(e,t)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/n.default.supermap.tiledMapLayer=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tiandituTileLayer=t.TiandituTileLayer=void 0;var n=o(r(2));r(3);var i=r(105),a=o(r(12));function o(e){return e&&e.__esModule?e:{default:e}} -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/var s=t.TiandituTileLayer=i.WMTSLayer.extend({layerLabelMap:{vec:"cva",ter:"cta",img:"cia"},layerZoomMap:{vec:18,ter:14,img:18},options:{layerType:"vec",isLabel:!1,attribution:a.default.Tianditu.attribution,url:"http://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?",zoomOffset:1,key:"",dpi:96,style:"default",format:"tiles",subdomains:[0,1,2,3,4,5,6,7]},initialize:function(e){e=e||{},n.default.setOptions(this,e),this.options.layer=this.options.isLabel?this.layerLabelMap[this.options.layerType]:this.options.layerType,this.options.maxZoom=this.layerZoomMap[this.options.layerType]-1,i.WMTSLayer.prototype.initialize.call(this,this.options.url,this.options),n.default.stamp(this)},onAdd:function(e){this.options.tilematrixSet="EPSG:4326"===e.options.crs.code?"c":"w",this.options.key&&(this._url=this._url+"tk="+this.options.key),this._url=this._url.replace("{layer}",this.options.layer).replace("{proj}",this.options.tilematrixSet),i.WMTSLayer.prototype.onAdd.call(this,e)}}),l=t.tiandituTileLayer=function(e){return new s(e)};n.default.supermap.tiandituTileLayer=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloudTileLayer=t.CloudTileLayer=void 0;var n=a(r(2));r(3);var i=a(r(12));function a(e){return e&&e.__esModule?e:{default:e}}var o=t.CloudTileLayer=n.default.TileLayer.extend({defaultURL:"http://t2.supermapcloud.com/FileService/image",options:{mapName:"quanguo",type:"web",minZoom:3,maxZoom:18,attribution:i.default.Cloud.attribution},initialize:function(e,t){n.default.setOptions(this,t);var r=e||this.defaultURL;this._url=r+"?map="+this.options.mapName+"&type="+this.options.type,n.default.stamp(this)},getTileUrl:function(e){var t=this._url+"&x="+e.x+"&y="+e.y+"&z="+e.z;return this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),t}}),s=t.cloudTileLayer=function(e,t){return new o(e,t)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/n.default.supermap.cloudTileLayer=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.baiduTileLayer=t.BaiduTileLayer=void 0,r(3);var n=a(r(2)),i=a(r(12));function a(e){return e&&e.__esModule?e:{default:e}}var o=t.BaiduTileLayer=n.default.TileLayer.extend({url:"http://online{num}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20150815&scaler=1",options:{minZoom:3,maxZoom:19,bounds:n.default.latLngBounds(n.default.latLng(-85.0511287798,-180),n.default.latLng(85.0511287798,180)),retina:n.default.Browser.retina,attribution:i.default.Baidu.attribution},initialize:function(e,t){e&&(this.url=e),n.default.setOptions(this,t),this.options.retina&&(this.options.maxZoom=18),n.default.stamp(this)},getTileUrl:function(e){var t=n.default.Util.template(this.url,{num:Math.abs((e.x+e.y)%8)+1,x:e.x,y:-e.y-1,z:this._getZoomForUrl(),styles:this.options.retina?"ph":"pl"});return this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),t}}),s=t.baiduTileLayer=function(e,t){return new o(e,t)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/n.default.supermap.baiduTileLayer=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapService=t.MapService=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3);var o=r(9),s=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var l=t.MapService=o.ServiceBase.extend({options:{projection:null},initialize:function(e,t){t=t||{},a.default.setOptions(this,t),t.projection&&(this.options.projection=t.projection),o.ServiceBase.prototype.initialize.call(this,e,t)},getMapInfo:function(e){var t=this;new s.MapService(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,serverType:t.options.serverType,eventListeners:{scope:t,processCompleted:e,processFailed:e},projection:t.options.projection}).processAsync()},getTilesets:function(e){var t=this;new s.TilesetsService(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,serverType:t.options.serverType,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).processAsync()}}),u=t.mapService=function(e,t){return new l(e,t)};a.default.supermap.mapService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TianDiTu_MercatorCRS=t.TianDiTu_WGS84CRS=t.BaiduCRS=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};for(var o,s=t.BaiduCRS=a.default.CRS.Baidu=a.default.extend({},a.default.CRS.EPSG3857,{code:"Baidu",scale:function(e){return 6378137*Math.PI*2/Math.pow(2,18-e)},transformation:(o=.5/(6378137*Math.PI),new a.default.Transformation(o,0,-o,0))}),l=[],u=1 -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/;u<19;u++)l.push(1.40625/Math.pow(2,u));for(var c=t.TianDiTu_WGS84CRS=a.default.CRS.TianDiTu_WGS84=a.default.Proj.CRS("EPSG:4326",{origin:[-180,90],resolutions:l,bounds:a.default.bounds([-180,-90],[180,90])}),p=[],h=1;h<19;h++)p.push(156543.03392804062/Math.pow(2,h));var f=t.TianDiTu_MercatorCRS=a.default.CRS.TianDiTu_Mercator=a.default.Proj.CRS("EPSG:3857",{origin:[-20037508.3427892,20037508.3427892],resolutions:p,bounds:a.default.bounds([-20037508.3427892,-20037508.3427892],[20037508.3427892,20037508.3427892])});a.default.CRS.BaiduCRS=s,a.default.CRS.TianDiTu_WGS84CRS=c,a.default.CRS.TianDiTu_MercatorCRS=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=Math.exp(e);return t=(t-1/t)/2}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=p,t.forward=h,t.inverse=f;var n=c(r(181)),i=c(r(180)),a=c(r(436)),o=c(r(434)),s=c(r(433)),l=c(r(432)),u=c(r(8));function c(e){return e&&e.__esModule?e:{default:e}}function p(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r*=t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r*=t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),r*=t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r*=t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var n=(0,o.default)(this.cbg,this.lat0);this.Zb=-this.Qn*(n+(0,s.default)(this.gtu,2*n))}function h(e){var t=(0,u.default)(e.x-this.long0),r=e.y;r=(0,o.default)(this.cbg,r);var n=Math.sin(r),s=Math.cos(r),c=Math.sin(t),p=Math.cos(t);r=Math.atan2(n,p*s),t=Math.atan2(c*s,(0,i.default)(n,s*p)),t=(0,a.default)(Math.tan(t));var h,f,d=(0,l.default)(this.gtu,2*r,2*t);return r+=d[0],t+=d[1],Math.abs(t)<=2.623395162778?(h=this.a*(this.Qn*t)+this.x0,f=this.a*(this.Qn*r+this.Zb)+this.y0):(h=1/0,f=1/0),e.x=h,e.y=f,e}function f(e){var t,r,a=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(s=(s-this.Zb)/this.Qn,a/=this.Qn,Math.abs(a)<=2.623395162778){var c=(0,l.default)(this.utg,2*s,2*a);s+=c[0],a+=c[1],a=Math.atan((0,n.default)(a));var p=Math.sin(s),h=Math.cos(s),f=Math.sin(a),d=Math.cos(a);s=Math.atan2(p*d,(0,i.default)(f,d*h)),a=Math.atan2(f,d*h),t=(0,u.default)(a+this.long0),r=(0,o.default)(this.cgb,s)}else t=1/0,r=1/0;return e.x=t,e.y=r,e}var d=t.names=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"];t.default={init:p,forward:h,inverse:f,names:d}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var n=1/(1-t),i=e,l=s;l;--l){var u=Math.sin(i),c=1-t*u*u;if(i-=c=((0,a.default)(i,u,Math.cos(i),r)-e)*(c*Math.sqrt(c))*n,Math.abs(c)c&&(g=g-c+o-1,S=!0),(g===s||ys||(g>s||yl||(g>l||yc&&(g=g-c+o-1),b>u?(b=b-u+o-1,S=!0):S=!1,(b===s||vs||(b>s||vl||(b>l||vu&&(b=b-u+o-1),String.fromCharCode(g)+String.fromCharCode(b))+r.substr(r.length-5,t)+n.substr(n.length-5,t);var p,h,f,d,y,v,g,b,S;var _,P,O,w,M,T}(function(e){var t,r,n,i,a,o,s,l=e.lat,u=e.lon,c=6378137,p=d(l),h=d(u);s=Math.floor((u+180)/6)+1,180===u&&(s=60);l>=56&&l<64&&u>=3&&u<12&&(s=32);l>=72&&l<84&&(u>=0&&u<9?s=31:u>=9&&u<21?s=33:u>=21&&u<33?s=35:u>=33&&u<42&&(s=37));o=d(6*(s-1)-180+3),.006739496752268451,t=c/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),r=Math.tan(p)*Math.tan(p),n=.006739496752268451*Math.cos(p)*Math.cos(p),i=Math.cos(p)*(h-o),a=c*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p));var f=.9996*t*(i+(1-r+n)*i*i*i/6+(5-18*r+r*r+72*n-.39089081163157013)*i*i*i*i*i/120)+5e5,y=.9996*(a+t*Math.tan(p)*(i*i/2+(5-r+9*n+4*n*n)*i*i*i*i/24+(61-58*r+r*r+600*n-2.2240339282485886)*i*i*i*i*i*i/720));l<0&&(y+=1e7);return{northing:Math.round(y),easting:Math.round(f),zoneNumber:s,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(l)}}({lat:e[1],lon:e[0]}),t)}function h(e){var t=v(g(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function f(e){var t=v(g(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function d(e){return e*(Math.PI/180)}function y(e){return e/Math.PI*180}function v(e){var t=e.northing,r=e.easting,n=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var a,o,s,l,u,c,p,h,f=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=r-5e5,g=t;n<"N"&&(g-=1e7),c=6*(i-1)-180+3,h=(p=g/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*p)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*p)+151*d*d*d/96*Math.sin(6*p),a=f/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),o=Math.tan(h)*Math.tan(h),s=.006739496752268451*Math.cos(h)*Math.cos(h),l=.99330562*f/Math.pow(1-.00669438*Math.sin(h)*Math.sin(h),1.5),u=m/(.9996*a);var b=h-a*Math.tan(h)/l*(u*u/2-(5+3*o+10*s-4*s*s-.06065547077041606)*u*u*u*u/24+(61+90*o+298*s+45*o*o-1.6983531815716497-3*s*s)*u*u*u*u*u*u/720);b=y(b);var S,_=(u-(1+2*o+s)*u*u*u/6+(5-2*s+28*o-3*s*s+.05391597401814761+24*o*o)*u*u*u*u*u/120)/Math.cos(h);if(_=c+y(_),e.accuracy){var P=v({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});S={top:P.lat,right:P.lon,bottom:b,left:_}}else S={lat:b,lon:_};return S}function m(e){var t=e%n;return 0===t&&(t=n),t}function g(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,n=null,p="",h=0;!/[A-Z]/.test(t=e.charAt(h));){if(h>=2)throw"MGRSPoint bad conversion from: "+e;p+=t,h++}var f=parseInt(p,10);if(0===h||h+3>r)throw"MGRSPoint bad conversion from: "+e;var d=e.charAt(h++);if(d<="A"||"B"===d||"Y"===d||d>="Z"||"I"===d||"O"===d)throw"MGRSPoint zone letter "+d+" not handled: "+e;n=e.substring(h,h+=2);for(var y=m(f),v=function(e,t){var r=i.charCodeAt(t-1),n=1e5,a=!1;for(;r!==e.charCodeAt(0);){if(++r===s&&r++,r===l&&r++,r>c){if(a)throw"Bad character: "+e;r=o,a=!0}n+=1e5}return n}(n.charAt(0),y),g=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var r=a.charCodeAt(t-1),n=0,i=!1;for(;r!==e.charCodeAt(0);){if(++r===s&&r++,r===l&&r++,r>u){if(i)throw"Bad character: "+e;r=o,i=!0}n+=1e5}return n}(n.charAt(1),y);g0&&(_=1e5/Math.pow(10,w),P=e.substring(h,h+w),M=parseFloat(P)*_,O=e.substring(h+w),T=parseFloat(O)*_),{easting:M+v,northing:T+g,zoneLetter:d,zoneNumber:f,accuracy:_}}function b(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}t.default={forward:p,inverse:h,toPoint:f}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,r,u){var c;Array.isArray(u)&&(u=(0,s.default)(u));(0,l.default)(u);t.datum&&r.datum&&function(e,t){return(e.datum.datum_type===n.PJD_3PARAM||e.datum.datum_type===n.PJD_7PARAM)&&"WGS84"!==t.datumCode||(t.datum.datum_type===n.PJD_3PARAM||t.datum.datum_type===n.PJD_7PARAM)&&"WGS84"!==e.datumCode}(t,r)&&(c=new o.default("WGS84"),u=e(t,c,u),t=c);"enu"!==t.axis&&(u=(0,a.default)(t,!1,u));"longlat"===t.projName?u={x:u.x*n.D2R,y:u.y*n.D2R}:(t.to_meter&&(u={x:u.x*t.to_meter,y:u.y*t.to_meter}),u=t.inverse(u));t.from_greenwich&&(u.x+=t.from_greenwich);u=(0,i.default)(t.datum,r.datum,u);r.from_greenwich&&(u={x:u.x-r.from_greenwich,y:u.y});"longlat"===r.projName?u={x:u.x*n.R2D,y:u.y*n.R2D}:(u=r.forward(u),r.to_meter&&(u={x:u.x/r.to_meter,y:u.y/r.to_meter}));if("enu"!==r.axis)return(0,a.default)(r,!0,u);return u};var n=r(6),i=u(r(445)),a=u(r(443)),o=u(r(110)),s=u(r(186)),l=u(r(442));function u(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e){var t=(0,o.default)(e),r=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",r]);var a={};return(0,s.sExpr)(t,a),function(e){"GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"===n(e.PROJECTION)?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION;e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var t=e.GEOGCS;"GEOGCS"===e.type&&(t=e);t&&(t.DATUM?e.datumCode=t.DATUM.name.toLowerCase():e.datumCode=t.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"===e.datumCode&&("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),t.DATUM&&t.DATUM.SPHEROID&&(e.ellps=t.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=t.DATUM.SPHEROID.a,e.rf=parseFloat(t.DATUM.SPHEROID.rf,10)),t.DATUM&&t.DATUM.TOWGS84&&(e.datum_params=t.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93"));e.b&&!isFinite(e.b)&&(e.b=e.a);function r(t){var r=e.to_meter||1;return t*r}[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",u],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",u],["x0","false_easting",r],["y0","false_northing",r],["long0","central_meridian",u],["lat0","latitude_of_origin",u],["lat0","standard_parallel_1",u],["lat1","standard_parallel_1",u],["lat2","standard_parallel_2",u],["azimuth","Azimuth"],["alpha","azimuth",u],["srsCode","name"]].forEach(function(t){return r=e,i=(n=t)[0],a=n[1],void(!(i in r)&&a in r&&(r[i]=r[a],3===n.length&&(r[i]=n[2](r[i]))));var r,n,i,a}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc);e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName||(e.lat0=u(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(a),a};var i,a=r(455),o=(i=a)&&i.__esModule?i:{default:i},s=r(454);var l=.017453292519943295;function u(e){return e*l}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,r,s,l={},u=e.split("+").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var r=t.split("=");return r.push(!0),e[r[0].toLowerCase()]=r[1],e},{}),c={proj:"projName",datum:"datumCode",rf:function(e){l.rf=parseFloat(e)},lat_0:function(e){l.lat0=e*n.D2R},lat_1:function(e){l.lat1=e*n.D2R},lat_2:function(e){l.lat2=e*n.D2R},lat_ts:function(e){l.lat_ts=e*n.D2R},lon_0:function(e){l.long0=e*n.D2R},lon_1:function(e){l.long1=e*n.D2R},lon_2:function(e){l.long2=e*n.D2R},alpha:function(e){l.alpha=parseFloat(e)*n.D2R},lonc:function(e){l.longc=e*n.D2R},x_0:function(e){l.x0=parseFloat(e)},y_0:function(e){l.y0=parseFloat(e)},k_0:function(e){l.k0=parseFloat(e)},k:function(e){l.k0=parseFloat(e)},a:function(e){l.a=parseFloat(e)},b:function(e){l.b=parseFloat(e)},r_a:function(){l.R_A=!0},zone:function(e){l.zone=parseInt(e,10)},south:function(){l.utmSouth=!0},towgs84:function(e){l.datum_params=e.split(",").map(function(e){return parseFloat(e)})},to_meter:function(e){l.to_meter=parseFloat(e)},units:function(e){l.units=e;var t=(0,o.default)(a.default,e);t&&(l.to_meter=t.to_meter)},from_greenwich:function(e){l.from_greenwich=e*n.D2R},pm:function(e){var t=(0,o.default)(i.default,e);l.from_greenwich=(t||parseFloat(e))*n.D2R},nadgrids:function(e){"@null"===e?l.datumCode="none":l.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(l.axis=e)}};for(t in u)r=u[t],t in c?"function"==typeof(s=c[t])?s(r):l[s]=r:l[t]=r;return"string"==typeof l.datumCode&&"WGS84"!==l.datumCode&&(l.datumCode=l.datumCode.toLowerCase()),l};var n=r(6),i=s(r(457)),a=s(r(456)),o=s(r(73));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(r(458)),i=o(r(189)),a=o(r(188));function o(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?s[e]=(0,i.default)(arguments[1]):s[e]=(0,a.default)(arguments[1]):s[e]=r}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?s.apply(t,e):s(e)});if("string"==typeof e){if(e in s)return s[e]}else"EPSG"in e?s["EPSG:"+e.EPSG]=e:"ESRI"in e?s["ESRI:"+e.ESRI]=e:"IAU2000"in e?s["IAU2000:"+e.IAU2000]=e:console.log(e);return}}(0,n.default)(s),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=h(r(460)),i=h(r(110)),a=h(r(441)),o=h(r(186)),s=h(r(190)),l=h(r(187)),u=h(r(185)),c=h(r(440)),p=h(r(438));function h(e){return e&&e.__esModule?e:{default:e}}n.default.defaultDatum="WGS84",n.default.Proj=i.default,n.default.WGS84=new n.default.Proj("WGS84"),n.default.Point=a.default,n.default.toPoint=o.default,n.default.defs=s.default,n.default.transform=l.default,n.default.mgrs=u.default,n.default.version=c.default,(0,p.default)(n.default),t.default=n.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crs=t.CRS=void 0;var n=a(r(2)),i=a(r(191));function a(e){return e&&e.__esModule?e:{default:e}} -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/window.proj4=i.default,window.Proj4js=i.default,n.default.Proj={},n.default.Proj._isProj4Obj=function(e){return void 0!==e.inverse&&void 0!==e.forward},n.default.Proj.Projection=n.default.Class.extend({initialize:function(e,t,r){var i=n.default.Proj._isProj4Obj(e);this._proj=i?e:this._projFromCodeDef(e,t);var a=r;n.default.Util.isArray(r)&&(a=n.default.bounds(r)),this.bounds=i?t:a},project:function(e){var t=this._proj.forward([e.lng,e.lat]);return new n.default.Point(t[0],t[1])},unproject:function(e,t){this.bounds&&(e.x=e.xthis.bounds.max.x?this.bounds.max.x:e.x,e.y=e.ythis.bounds.max.y?this.bounds.max.y:e.y);var r=this._proj.inverse([e.x,e.y]);return new n.default.LatLng(r[1],r[0],t)},_projFromCodeDef:function(e,t){if(t)i.default.defs(e,t);else if(void 0===i.default.defs[e]){var r=e.split(":");if(r.length>3&&(e=r[r.length-3]+":"+r[r.length-1]),void 0===i.default.defs[e])throw"No projection definition for code "+e}return(0,i.default)(e)},getUnits:function(){return this._proj.oProj.units||"degrees"}});var o=t.CRS=n.default.Class.extend({includes:n.default.CRS,options:{transformation:new n.default.Transformation(1,0,-1,0)},initialize:function(e,t){var r,i,a;if(n.default.Proj._isProj4Obj(e)?(r=(i=e).srsCode,t=t||{},this.projection=new n.default.Proj.Projection(i,t.bounds)):(r=e,a=(t=t||{}).def||"",this.projection=new n.default.Proj.Projection(r,a,t.bounds)),n.default.Util.setOptions(this,t),this.code=r,this.transformation=this.options.transformation,this.options.dpi=this.options.dpi||96,this.options.bounds&&(this.options.bounds=n.default.bounds(this.options.bounds)),!this.options.origin&&this.options.bounds&&(this.options.origin=[this.options.bounds.min.x,this.options.bounds.max.y]),this.options.origin&&(this.options.origin instanceof n.default.Point&&(this.options.origin=[this.options.origin.x,this.options.origin.y]),this.transformation=new n.default.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales&&this.options.scales.length>0)this.scales=this.options.scales,this._scales=this._toProj4Scales(this.options.scales,this.options.dpi);else if(this.options.scaleDenominators&&this.options.scaleDenominators.length>0){this.scales=[];for(var o=0;o0){this._scales=[];for(var s=this.options.resolutions.length-1;s>=0;s--)this.options.resolutions[s]&&(this._scales[s]=1/this.options.resolutions[s])}else this.options.bounds&&(this._scales=this._getDefaultProj4ScalesByBounds(this.options.bounds));this._rectify(),this.infinite=!this.options.bounds},_rectify:function(){if(this._scales&&(this.resolutions||(this.resolutions=[],this.resolutions=this._proj4ScalesToResolutions(this._scales)),!this.scales)){this.scales=[];for(var e=0;e0;e--)this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}},{key:"_changeTabsPage",value:function(e){for(var t=e.target.index,r=0;r0){var s=a.SheetNames[0],l=o.default.utils.sheet_to_csv(a.Sheets[s]);t&&t.call(n,l)}}catch(e){r&&r.call(n,e)}},i.onerror=function(e){r&&r.call(n,e)},this.rABF&&i.readAsArrayBuffer(e.file)},processDataToGeoJson:function(e,t,r,n,i){var a=null;if("EXCEL"===e||"CSV"===e)a=this.processExcelDataToGeoJson(t),r&&r.call(i,a);else if("JSON"===e||"GEOJSON"===e){var o=t;"string"==typeof o&&(o=JSON.parse(o)),"ISERVER"===o.type?a=o.data.recordsets[0].features:"FeatureCollection"===o.type?a=o:n&&n.call(i,l.Lang.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(i,a)}else n&&n.call(i,l.Lang.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson:function(e){for(var t=this.string2Csv(e),r=t.colTitles,n=-1,i=-1,a=0,o=r.length;a0&&e.forEach(function(e){e.xAxis&&t.xField.push({field:e.xAxis.field,name:e.xAxis.name}),e.yAxis&&t.yField.push({field:e.yAxis.field,name:e.yAxis.name})})}},{key:"getDatasetInfo",value:function(e){var t=this;this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new a.ChartModel(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:function(e){t.events.triggerEvent("getdatafailed",e)}}))}},{key:"_getDatasetInfoSuccess",value:function(e){var t=this.datasets.url,r=t.indexOf("rest");if(r>0){var n=t.indexOf("/",r+5),i=t.substring(r+5,n),a=t.substring(0,r+4)+"/data";if("maps"===i){var o=t.indexOf("/",n+1),s=t.substring(n+1,o);a=t.substring(0,r+4)+"/maps/"+s,e.result.dataUrl=a,this._getLayerFeatures(e)}else"data"===i&&(e.result.dataUrl=a,this._getDataFeatures(e))}}},{key:"_getDataInfoSuccess",value:function(e,t){"RESTMAP"===t?this._getChartDatasFromLayer(e):this._getChartDatas(e)}},{key:"_getDataFeatures",value:function(e){this.chartModel.getDataFeatures(e,this._getChartDatas.bind(this))}},{key:"_getLayerFeatures",value:function(e){this.chartModel.getLayerFeatures(e,this._getChartDatasFromLayer.bind(this))}},{key:"_getChartDatas",value:function(e){if(e){this.features=e.result.features;var t=this.features.features,r={};if(t.length){var n=t[0],i=[],a=[];for(var o in n.properties)i.push(o),a.push(this._getDataType(n.properties[o]));for(var s in r={features:t,fieldCaptions:i,fieldTypes:a,fieldValues:[]},a){var l=[];for(var u in t){var c=t[u],p=r.fieldCaptions[s],h=c.properties[p];l.push(h)}r.fieldValues.push(l)}this.createChart(r)}}}},{key:"_getChartDatasFromLayer",value:function(e){if(e.result.recordsets){var t=e.result.recordsets[0],r=t.features.features;this.features=t.features;var n={};if(r.length){for(var i in(n={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]}).fieldCaptions){var a=[];for(var o in r){var s=r[o],l=n.fieldCaptions[i],u=s.properties[l];a.push(u)}n.fieldValues.push(a)}this.createChart(n)}}}},{key:"_createChartOptions",value:function(e){return this.calculatedData=this._createChartDatas(e),this.updateChartOptions(this.chartType)}},{key:"changeType",value:function(e){if(e!==this.chartType)return this.chartType=e,this.updateChartOptions(this.chartType)}},{key:"updateData",value:function(e,t,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(t),e.type=e.type||"iServer",e.withCredentials=e.withCredentials||!1,this.datasets=e,this.getDatasetInfo(this._updateDataSuccess.bind(this))}},{key:"_updateDataSuccess",value:function(e){var t=this._createChartOptions(e);this.updateChart(t)}},{key:"updateChartOptions",value:function(e,t){if(this.calculatedData){var r=this.grid,n=this._createChartSeries(this.calculatedData,e),i=[];for(var a in this.calculatedData.XData)i.push({value:this.calculatedData.XData[a].fieldsData});var o={type:"category",name:this.xField[0].name||"X",data:i,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},l={formatter:"{b0}: {c0}"},u="#404a59";return t&&(t.grid&&(r=t.grid),t.tooltip&&(l=t.tooltip),t.backgroundColor&&(u=t.backgroundColor)),{backgroundColor:u,grid:r,series:n,xAxis:o,yAxis:s,tooltip:l}}}},{key:"_createChartDatas",value:function(e){var t=0,r=[],n=e.fieldCaptions,i=this;n.forEach(function(e,r){i.xField[0]&&e===i.xField[0].field&&(t=r)}),this.yFieldName="",this.yField.forEach(function(e,t){0!==t&&(i.yFieldName=i.yFieldName+","),i.yFieldName=i.yFieldName+e.name,n.forEach(function(t,n){t===e.field&&r.push(n)})});var a=this._getAttrData(e,t),o=[];if(r.length>0)r.forEach(function(t){var r=[];for(var n in e.fieldValues[t])r.push({value:e.fieldValues[t][n]});o.push(r)});else{for(var s=[],l=[],u=a.length,c=0;c1&&void 0!==arguments[1]?arguments[1]:"warring";"success"===t?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===t?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===t&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=e,this.messageBoxContainer.hidden=!1}}]),e}();i.SuperMap.Components.MessageBox=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r=0&&this._clips.splice(t,1)}},{key:"_update",value:function(){for(var e=(new Date).getTime(),t=e-this._time,r=this._clips,n=r.length,i=[],a=[],o=0;o=0&&!(g[O]<=o);O--);O=Math.min(O,h-2)}else{for(O=E;Oo);O++);O=Math.min(O-1,h-2)}E=O,L=o;var s=g[O+1]-g[O];if(0!==s){if(w=(o-g[O])/s,a)if(T=b[O],M=b[0===O?O:O-1],C=b[O>h-2?h-1:O+1],x=b[O>h-3?h-1:O+2],d)p._catmullRomInterpolateArray(M,T,C,x,w,w*w,w*w*w,n(e,c),v);else{var l=void 0;l=y?p.rgba2String(A):p._catmullRomInterpolate(M,T,C,x,w,w*w,w*w*w),r(e,c,l)}else if(d)p._interpolateArray(b[O],b[O+1],w,n(e,c),v);else{var u=void 0;y?(p._interpolateArray(b[O],b[O+1],w,A,1),u=p.rgba2String(A)):u=p._interpolateNumber(b[O],b[O+1],w),r(e,c,u)}for(O=0;O0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var i in r)if("hover"!==i){var o=r[i],s=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var l=o.__zoom;l*=t,t=(l=Math.max(Math.min(o.maxZoom,l),o.minZoom))/o.__zoom,o.__zoom=l,s[0]-=(this._mouseX-s[0])*(t-1),s[1]-=(this._mouseY-s[1])*(t-1),o.scale[0]*=t,o.scale[1]*=t,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,a.Config.EVENT.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){this._clickThreshold++,e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=o.SUtil.Util_event.getX(e),this._mouseY=o.SUtil.Util_event.getY(e);var t=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var i=this.painter.getLayers(),s=!1;for(var l in i)if("hover"!==l){var u=i[l];u.panable&&(n="move",u.position[0]+=t,u.position[1]+=r,s=!0,u.dirty=!0)}s&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,a.Config.EVENT.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){var t=(e=this._zrenderEventFixed(e)).toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.refreshHover(),this.dispatch(a.Config.EVENT.GLOBALOUT,e)},mousedown:function(e){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=e.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,a.Config.EVENT.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,a.Config.EVENT.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&o.SUtil.Util_event.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;i--){var a=r[i];if(void 0!==a.zlevel&&(e=this.painter.getLayer(a.zlevel,e),n[0]=this._mouseX,n[1]=this._mouseY,e.needTransform&&(o.SUtil.Util_matrix.invert(t,e.transform),o.SUtil.Util_vector.applyTransform(n,n,t))),this._findHover(a,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(e){var t=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r0&&e>this._zlevelList[0]){for(i=0;ie);i++);n=this._layers[this._zlevelList[i]]}this._zlevelList.splice(i+1,0,e),t=new h(o.Util.createUniqueID("_levelLayer_"+e),this);var a=n?n.dom:this._bgDom;a.nextSibling?a.parentNode.insertBefore(t.dom,a.nextSibling):a.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&(new s.Util).merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(e){var t=this._layers,r={};for(var n in t)"hover"!==n&&(r[n]=t[n].elCount,t[n].elCount=0);for(var i=0;i0}},{key:"addRoot",value:function(e){e instanceof a.Group&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}},{key:"delRoot",value:function(e){if(void 0===e){for(var t=0;t=0&&(this.delFromMap(s.id),this._roots.splice(l,1),s instanceof a.Group&&s.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(e){return e instanceof a.Group&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this}},{key:"get",value:function(e){return this._elements[e]}},{key:"delFromMap",value:function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof a.Group&&(t._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}],[{key:"shapeCompareFunc",value:function(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Render=void 0;var n=function(){function e(e,t){for(var r=0;r=s[2]||s[1]<=s[3])&&(this.DVBOrigonPoint=[s[0],s[3]],this.DVBWidth=Math.abs(s[2]-s[0]),this.DVBHeight=Math.abs(s[1]-s[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-i[0],this.DVBOrigonPoint[1]-i[1]],!0)}}]),t}();i.SuperMap.Feature.Theme.RankSymbol=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmicSector=void 0;var n=function(){function e(e,t){for(var r=0;r1?a.SUtil.Util_computeBoundingBox.arc(s,l,u,p,h,!f,r,i):(r[0]=i[0]=s,r[1]=i[1]=l),a.SUtil.Util_computeBoundingBox.arc(s,l,c,p,h,!f,n,o),a.SUtil.Util_vector.min(r,r,n),a.SUtil.Util_vector.max(i,i,o),e.__rect={x:r[0],y:r[1],width:i[0]-r[0],height:i[1]-r[1]},e.__rect}}]),t}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmicCircle=void 0;var n=function(){function e(e,t){for(var r=0;r1)for(var t in arguments)console.log(arguments[t])}}return n(e,[{key:"destory",value:function(){return!0}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r=200&&a.status<300||304===a.status?t&&t(a.responseText):r&&r(),a.onreadystatechange=new Function,a=null)},a.send(null)}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;ri&&(i=l[0]),l[1]o&&(o=l[1])}t[0]=n,t[1]=a,r[0]=i,r[1]=o}}},{key:"cubeBezier",value:function(e,t,r,n,a,o){var s=new i.Curve,l=[];s.cubicExtrema(e[0],t[0],r[0],n[0],l);for(var u=0;ui&&!o?i+=2*Math.PI:nn&&(h[0]=Math.cos(d)*r+e,h[1]=Math.sin(d)*r+t,u.min(s,h,s),u.max(l,h,l))}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Area=void 0;var n=function(){function e(e,t){for(var r=0;r0){for(var g=this.isInsidePolygon(t.pointList,v,m),b=e.holePolygonPointLists,S=!1,_=0,P=b.length;_t+s&&o>n+s||oe+s&&a>r+s||at+p&&c>n+p&&c>a+p&&c>s+p||ce+p&&u>r+p&&u>i+p&&u>o+p||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||p+c=u)return!0;if(a){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=u);var f=Math.atan2(l,s);return f<0&&(f+=u),f>=n&&f<=i||f+u>=n&&f+u<=i}},{key:"isInsideBrokenLine",value:function(e,t,r,n){for(var i=Math.max(t,10),a=0,o=e.length-1;ar*r}},{key:"isInsideRect",value:function(e,t,r,n,i,a){return i>=e&&i<=e+r&&a>=t&&a<=t+n}},{key:"isInsideCircle",value:function(e,t,r,n,i){return(n-e)*(n-e)+(i-t)*(i-t)t&&a>n||ai?nt&&u>n&&u>a&&u>s||u1&&this.swapExtrema(),d=c.cubicAt(t,n,a,s,h[0]),m>1&&(y=c.cubicAt(t,n,a,s,h[1]))),2==m?bt&&s>n&&s>a||s=0&&p<=1){for(var h=0,f=l.quadraticAt(t,n,a,p),d=0;do||(u[d]o?0:ar||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(l[0]=-c,l[1]=c,Math.abs(n-i)>=u){n=0,i=u;var p=a?1:-1;return o>=l[0]+e&&o<=l[1]+e?p:0}if(a){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=u);for(var f=0,d=0;d<2;d++){var y=l[d];if(y+e>o){var v=Math.atan2(s,y),m=a?1:-1;v<0&&(v=u+v),(v>=n&&v<=i||v+u>=n&&v+u<=i)&&(v>Math.PI/2&&v<1.5*Math.PI&&(m=-m),f+=m)}}return f}},{key:"isInsidePath",value:function(e,t,r,n,i){for(var a=0,o=0,s=0,l=0,u=0,c=!0,p=!0,h="stroke"===(r=r||"fill")||"both"===r,f="fill"===r||"both"===r,d=0;d0&&(f&&(a+=this.windingLine(o,s,l,u,n,i)),0!==a))return!0;l=v[v.length-2],u=v[v.length-1],c=!1,p&&"A"!==y.command&&(p=!1,o=l,s=u)}switch(y.command){case"M":o=v[0],s=v[1];break;case"L":if(h&&this.isInsideLine(o,s,v[0],v[1],t,n,i))return!0;f&&(a+=this.windingLine(o,s,v[0],v[1],n,i)),o=v[0],s=v[1];break;case"C":if(h&&this.isInsideCubicStroke(o,s,v[0],v[1],v[2],v[3],v[4],v[5],t,n,i))return!0;f&&(a+=this.windingCubic(o,s,v[0],v[1],v[2],v[3],v[4],v[5],n,i)),o=v[4],s=v[5];break;case"Q":if(h&&this.isInsideQuadraticStroke(o,s,v[0],v[1],v[2],v[3],t,n,i))return!0;f&&(a+=this.windingQuadratic(o,s,v[0],v[1],v[2],v[3],n,i)),o=v[2],s=v[3];break;case"A":var m=v[0],g=v[1],b=v[2],S=v[3],_=v[4],P=v[5],O=Math.cos(_)*b+m,w=Math.sin(_)*S+g;p?(p=!1,l=O,u=w):a+=this.windingLine(o,s,O,w);var M=(n-m)*S/b+m;if(h&&this.isInsideArcStroke(m,g,S,_,_+P,1-v[7],t,M,i))return!0;f&&(a+=this.windingArc(m,g,S,_,_+P,1-v[7],M,i)),o=Math.cos(_+P)*b+m,s=Math.sin(_+P)*S+g;break;case"z":if(h&&this.isInsideLine(o,s,l,u,t,n,i))return!0;c=!0}}return f&&(a+=this.windingLine(o,s,l,u,n,i)),0!==a}},{key:"getTextWidth",value:function(e,t){var r=e+":"+t;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t);for(var n=0,i=0,a=(e=(e+"").split("\n")).length;ithis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(e,t){var r=e+":"+t;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}]),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Image=void 0;var n=function(){function e(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{};return t=this.createCredentialUrl(t),n.crossOrigin=this.options.crossOrigin,n.headers=this.options.headers,s.FetchRequest.commit(e,t,r,n).then(function(e){return e.json()})}},{key:"createCredentialUrl",value:function(e){var t=e,r=this.getCredential();if(r){var n="key="+r,i=t.substring(t.length-1,t.length);t.indexOf("?")>-1&&"?"===i?t+=n:t.indexOf("?")>-1&&"?"!==i?t+="&"+n:t+="?"+n}return t}},{key:"getCredential",value:function(){}}]),e}();i.SuperMap.OnlineServiceBase=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnlineData=void 0;var n=function(){function e(e,t){for(var r=0;r0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.defaultcolor&&(e.defaultcolor.destroy(),e.defaultcolor=null)}},{key:"toServerJSONObject",value:function(){var e={};if((e=a.Util.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,n=0;n0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.reverseColor=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}}],[{key:"fromObj",value:function(e){if(e){var r=new t;a.Util.copy(r,e);var n=e.items,i=n?n.length:0;r.items=[];for(var o=0;o0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}return null}}]),e}();i.SuperMap.ThemeMemoryData=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerTheme=void 0;var n=function(){function e(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}}}],[{key:"toJsonParameters",value:function(e){var t,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((r=new o.FilterParameter).name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),a.Util.toJSON(t)}}]),t}();i.SuperMap.GetFeaturesByIDsParameters=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetFeaturesByGeometryParameters=void 0;var n=function(){function e(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}}],[{key:"toJsonParameters",value:function(e){var t,r,n;return r=u.ServerGeometry.fromGeometry(e.geometry),n={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new s.FilterParameter).name=e.datasetNames,t.fields=e.fields,n.queryParameter=t),e.attributeFilter&&(n.attributeFilter=e.attributeFilter,n.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(n.maxFeatures=e.maxFeatures),a.Util.toJSON(n)}}]),t}();i.SuperMap.GetFeaturesByGeometryParameters=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetFeaturesByBufferParameters=void 0;var n=function(){function e(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}}],[{key:"toJsonParameters",value:function(e){var t,r,n;return n=l.ServerGeometry.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:n},e.fields&&((t=new s.FilterParameter).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),a.Util.toJSON(r)}}]),t}();i.SuperMap.GetFeaturesByBufferParameters=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetFeaturesByBoundsParameters=void 0;var n=function(){function e(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}}],[{key:"toJsonParameters",value:function(e){var r,n,i;return n={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},i={datasetNames:e.datasetNames,getFeatureMode:t.getFeatureMode.BOUNDS,bounds:n,spatialQueryMode:e.spatialQueryMode},e.fields&&((r=new s.FilterParameter).name=e.datasetNames,r.fields=e.fields,i.queryParameter=r),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode=t.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),a.Util.toJSON(i)}}]),t}();u.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"},i.SuperMap.GetFeaturesByBoundsParameters=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoRelationAnalystParameters=void 0;var n=function(){function e(e,t){for(var r=0;r=0?t.speed:1,this.frequency=t.speed&&t.frequency>=0?t.frequency:1e3,this.startTime=t.startTime&&null!=t.startTime?t.startTime:0,this.endTime=t.endTime&&null!=t.endTime&&t.endTime>=r.startTime?t.endTime:+new Date,this.repeat=void 0===t.repeat||t.repeat,this.reverse=void 0!==t.reverse&&t.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],r.events=new a.Events(this,null,this.EVENT_TYPES),r.speed=Number(r.speed),r.frequency=Number(r.frequency),r.startTime=Number(r.startTime),r.endTime=Number(r.endTime),r.startTime=Date.parse(new Date(r.startTime)),r.endTime=Date.parse(new Date(r.endTime)),r.currentTime=r.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"}return n(e,[{key:"updateOptions",value:function(e){var t=this;(e=e||{}).speed&&e.speed>=0&&(t.speed=e.speed,t.speed=Number(t.speed)),e.speed&&e.frequency>=0&&(t.frequency=e.frequency,t.frequency=Number(t.frequency)),e.startTime&&null!=e.startTime&&(t.startTime=e.startTime,t.startTime=Date.parse(new Date(t.startTime))),e.endTime&&null!=e.endTime&&e.endTime>=t.startTime&&(t.endTime=e.endTime,t.endTime=Date.parse(new Date(t.endTime))),null!=e.repeat&&(t.repeat=e.repeat),null!=e.reverse&&(t.reverse=e.reverse)}},{key:"start",value:function(){var e=this;e.running||(e.running=!0,e.tick(),e.events.triggerEvent("start",e.currentTime))}},{key:"pause",value:function(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}},{key:"stop",value:function(){var e=this;e.currentTime=e.startTime,e.running&&(e.running=!1),e.events.triggerEvent("stop",e.currentTime)}},{key:"toggle",value:function(){this.running?this.pause():this.start()}},{key:"setSpeed",value:function(e){return e>=0&&(this.speed=e,!0)}},{key:"getSpeed",value:function(){return this.speed}},{key:"setFrequency",value:function(e){return e>=0&&(this.frequency=e,!0)}},{key:"getFrequency",value:function(){return this.frequency}},{key:"setStartTime",value:function(e){var t=this;return!((e=Date.parse(new Date(e)))>t.endTime)&&(t.startTime=e,t.currentTime=t.endTime&&(t.currentTime=t.startTime,t.tick()),!0)}},{key:"getEndTime",value:function(){return this.endTime}},{key:"setCurrentTime",value:function(e){var t=this;return t.currentTime=Date.parse(new Date(t.currentTime)),e>=t.startTime&&e<=t.endTime&&(t.currentTime=e,t.startTime=t.currentTime,t.tick(),!0)}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"setRepeat",value:function(e){this.repeat=e}},{key:"getRepeat",value:function(){return this.repeat}},{key:"setReverse",value:function(e){this.reverse=e}},{key:"getReverse",value:function(){return this.reverse}},{key:"getRunning",value:function(){return this.running}},{key:"destroy",value:function(){var e=this;e.speed=null,e.frequency=null,e.startTime=null,e.endTime=null,e.currentTime=null,e.repeat=null,e.running=!1,e.reverse=null}},{key:"tick",value:function(){}}]),e}();i.SuperMap.TimeControlBase=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.LogoBase64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PointWithMeasure=void 0;var n=function(){function e(e,t){for(var r=0;r1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var r=n.SuperMap.Event.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,n){var a=i.Util.getElement(e);if(n=n||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!a._eventCacheID){var o="eventCacheID_";a.id&&(o=a.id+"_"+o),a._eventCacheID=i.Util.createUniqueID(o)}var s=a._eventCacheID;this.observers[s]||(this.observers[s]=[]),this.observers[s].push({element:a,name:t,observer:r,useCapture:n}),a.addEventListener?"mousewheel"===t?a.addEventListener(t,r,{useCapture:n,passive:!1}):a.addEventListener(t,r,n):a.attachEvent&&a.attachEvent("on"+t,r)},stopObservingElement:function(e){var t=i.Util.getElement(e)._eventCacheID;this._removeElementObservers(n.SuperMap.Event.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var r=e[t],i=new Array(r.element,r.name,r.observer,r.useCapture);n.SuperMap.Event.stopObserving.apply(this,i)}},stopObserving:function(e,t,r,a){a=a||!1;var o=i.Util.getElement(e),s=o._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.detachEvent)&&(t="keydown");var l=!1,u=n.SuperMap.Event.observers[s];if(u)for(var c=0;!l&&c1){var n={optionsArr:e,labelName:l.Lang.i18n("text_label_queryMode"),optionsClickCb:this.queryModeltOnchange},i=new l.Select(n).getElement();t.appendChild(i),r=i.children[1].children[0],i.children[1].classList.add("dataservice-select");var o=i.children[1];o.classList.add("dataservice-select"),o.classList.add("querymodel-select")}else{var s=a.default.DomUtil.create("span","",p);s.innerHTML=l.Lang.i18n("text_label_queryMode"),r=a.default.DomUtil.create("div","component-servicequery__querymode-selectname",p);var u=a.default.DomUtil.create("span","",r);e instanceof Array?u.innerHTML=e[0]:u.innerHTML=e,r.title=u.innerHTML,this.queryModeltOnchange(r)}return r.id="queryModelSelectName",r}.bind(this),this.queryModeltOnchange=X.bind(this),this.creatQueryModeSelect(u,h);var f=a.default.DomUtil.create("div","component-analysis__container component-textarea--dataservice__container",o),d=a.default.DomUtil.create("span","textarea-name",f);d.innerHTML=l.Lang.i18n("text_label_IDArrayOfFeatures");var y=a.default.DomUtil.create("div","component-textarea component-textarea--dataservice",f);y.id="getfeaturesIdArr";var v=a.default.DomUtil.create("div","scrollarea",y),m=a.default.DomUtil.create("div","component-scrollarea-content",v);m.setAttribute("tabindex","1");var g=a.default.DomUtil.create("textarea","component-textarea__content",m);g.value="[1,2,3]",g.id="getValueTextArea";var b=a.default.DomUtil.create("div","component-servicequery__maxfeatures-container hidden",o),S={spanName:l.Lang.i18n("text_label_maxFeatures"),value:"1000"},_=this._creatInputBox(S,b).children[1];_.classList.add("max-features-input");var P=a.default.DomUtil.create("div","component-servicequery__distance-container hidden",o),O={spanName:l.Lang.i18n("text_label_bufferDistance"),value:"10"},w=this._creatInputBox(O,P).children[1],M=a.default.DomUtil.create("div","component-analysis__container component-textarea--dataservice__container hidden",o),T=a.default.DomUtil.create("span","textarea-name",M),C=a.default.DomUtil.create("div","",M),x=a.default.DomUtil.create("div","component-servicequery__rangeicon-container",C);T.innerHTML=l.Lang.i18n("text_label_queryRange1");var E=a.default.DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-polygon-layer bounds",x),L=a.default.DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-line-layer hidden",x),A=a.default.DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-point-layer hidden",x),k=a.default.DomUtil.create("div","component-textarea component-textarea--rangequery",C);k.id="getfeaturesIdArr";var j=a.default.DomUtil.create("div","",k),F=a.default.DomUtil.create("div","component-scrollarea-content",j);F.setAttribute("tabindex","1");var I=a.default.DomUtil.create("textarea","component-textarea__content component-textarea--rangequery__content",F);I.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';var N=a.default.DomUtil.create("div","component-servicequery__spatialquerymode-container hidden",o),R={optionsArr:["CONTAIN","CROSS","DISJOINT","IDENTITY","INTERSECT","NONE","OVERLAP","TOUCH","WITHIN"],labelName:l.Lang.i18n("text_label_spatialQueryMode")},D=a.default.DomUtil.create("div","component-analysis__selecttool",N),G=new l.Select(R).getElement();G.children[1].classList.add("dataservice-select"),D.appendChild(G);var B=G.children[1].children[0];B.id="spatialQueryModeSelectName",G.children[1].children[2].classList.add("component-servicequery__spatialquerymode__selectcontent");var U=a.default.DomUtil.create("div","component-analysis__container__analysisbtn",o),V=a.default.DomUtil.create("div","component-analysis__analysisbtn",U),J=a.default.DomUtil.create("button","component-analysis__analysisbtn--analysis",V);J.innerHTML=l.Lang.i18n("btn_query");var z=a.default.DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",V),H=a.default.DomUtil.create("div","component-analysis__analysisbtn--analysising component-servicequery__querybtn--querying",z);a.default.DomUtil.create("div","component-analysis__svg-container",H).innerHTML='\n \n \n \n \n ',a.default.DomUtil.create("span","",H).innerHTML=l.Lang.i18n("btn_querying");var q=a.default.DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",V);q.innerHTML=l.Lang.i18n("btn_emptyTheRresultLayer"),X(u[0]);var W=this;J.onclick=function(){e.messageBox.closeView(),z.style.display="block",J.style.display="none";var t=function(){var e=W.dataSetNames,t=document.getElementById("queryModelSelectName").title,r=g.value,n=void 0;if("ID"===t){var i=g.value,o=i.substring(1,i.length-1).split(",");n=new l.GetFeaturesByIDsParameters({IDs:o,datasetNames:e})}else if("SQL"===t){var s=_.value;n=new l.GetFeaturesBySQLParameters({queryParameter:{attributeFilter:r},datasetNames:e,maxFeatures:s})}else if("BOUNDS"===t){if(!Q){var u=JSON.parse(I.value);Q=a.default.bounds([u.leftBottom.x,u.leftBottom.y],[u.rightTop.x,u.rightTop.y])}n=new l.GetFeaturesByBoundsParameters({attributeFilter:r,datasetNames:e,bounds:Q})}else if("BUFFER"===t){var c=w.value,p=JSON.parse(I.value),h=Y||p;n=new l.GetFeaturesByBufferParameters({attributeFilter:r,datasetNames:e,bufferDistance:c,geometry:h})}else if("SPATIAL"===t){var f=B.title,d=JSON.parse(I.value),y=Y||d;n=new l.GetFeaturesByGeometryParameters({attributeFilter:r,datasetNames:e,spatialQueryMode:f,geometry:y})}return n}();e.viewModel.on("getfeaturessucceeded",function(t){z.style.display="none",J.style.display="block",0===t.result.features.length&&e.messageBox.showView(l.Lang.i18n("msg_dataReturnedIsEmpty"),"success"),e._event.fire("getfeaturessucceeded",{result:t.result})}),e.viewModel.on("getfeaturesfailed",function(t){z.style.display="none",J.style.display="block",e.messageBox.showView(t.error.errorMsg,"failure"),e._event.fire("getfeaturesfailed",{error:t.error})}),e.viewModel.getFeatures(t,e.map)};var Q=void 0,Y=void 0;function X(e){var t=void 0;switch(t=e.title?e.title:e,b.classList.add("hidden"),M.classList.add("hidden"),P.classList.add("hidden"),L.classList.add("hidden"),A.classList.add("hidden"),E.classList.remove("bounds"),N.classList.add("hidden"),d.innerHTML=l.Lang.i18n("text_label_featureFilter"),g.value="SMID<10","BUFFER"!==t&&"SPATIAL"!==t||(M.classList.remove("hidden"),T.innerHTML=l.Lang.i18n("text_label_geometricObject"),I.value='{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[84.90234375,40.25390625]}}',L.classList.remove("hidden"),A.classList.remove("hidden")),t){case"ID":d.innerHTML=l.Lang.i18n("text_label_IDArrayOfFeatures"),g.value="[1,2,3]";break;case"SQL":b.classList.remove("hidden");break;case"BOUNDS":M.classList.remove("hidden"),T.innerHTML=l.Lang.i18n("text_label_queryRange"),I.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}',E.classList.add("bounds");break;case"BUFFER":P.classList.remove("hidden");break;case"SPATIAL":N.classList.remove("hidden")}}return E.onclick=function(t){var r=document.getElementById("queryModelSelectName").title;Y&&Y.remove(),"BOUNDS"===r?e.map.pm.enableDraw("Rectangle"):e.map.pm.enableDraw("Poly"),t.stopPropagation(),t.preventDefault()},L.onclick=function(t){Y&&Y.remove(),e.map.pm.enableDraw("Line"),t.stopPropagation(),t.preventDefault()},A.onclick=function(t){Y&&Y.remove(),e.map.pm.enableDraw("Marker"),t.stopPropagation(),t.preventDefault()},this.map.on("pm:create",function(t){if("Rectangle"===t.shape){var r=(Y=t.layer).getBounds();Q=a.default.bounds([r._southWest.lng,r._southWest.lat],[r._northEast.lng,r._northEast.lat]);var n={leftBottom:{x:r._southWest.lng,y:r._southWest.lat},rightTop:{x:r._northEast.lng,y:r._northEast.lat}};I.value=JSON.stringify(n)}"Marker"===t.shape&&(Y=t.layer,I.value=JSON.stringify(t.layer.toGeoJSON()),e.map.pm.disableDraw("Marker")),"Line"===t.shape&&(Y=t.layer,I.value=JSON.stringify(t.layer.toGeoJSON())),"Poly"===t.shape&&(Y=t.layer,I.value=JSON.stringify(t.layer.toGeoJSON()))}),q.onclick=function(){e.viewModel.clearLayers()},this._preventMapEvent(t,this.map),t},_creatInputBox:function(e,t){var r=a.default.DomUtil.create("div","",t);return a.default.DomUtil.create("span","",r).innerHTML=e.spanName,a.default.DomUtil.create("input","",r).value=e.value,r}}),c=t.dataServiceQueryView=function(e,t,r){return new u(e,t,r)};a.default.supermap.components.dataServiceQuery=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DistributedAnalysisModel=void 0;var n,i=function(){function e(e,t){for(var r=0;r\n \n \n \n \n ',a.default.DomUtil.create("span","",ae).innerHTML=l.Lang.i18n("btn_analyzing");var oe=a.default.DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",re);function se(e){if(this.messageBox.closeView(),this.dataHash){L.innerHTML="";var t=this.dataHash[e.title],r=this;this.viewModel.on("datasetinfoloaded",function(e){E.title=l.Lang.i18n("text_option_notSet"),E.innerHTML=l.Lang.i18n("text_option_notSet"),L.innerHTML="";var t=o.getAttribute("data-value"),n=e.result.type,i=e.result.fields;"density"===t&&("REGION"===n||"LINE"===n?r.messageBox.showView(l.Lang.i18n("msg_datasetOrMethodUnsupport"),"failure"):(r.messageBox.closeView(),r._createOptions(L,i),r.weightFieldsSelectObj.optionClickEvent(L,E)))}),this.viewModel.getDatasetInfo(t)}}return oe.id="deleteLayersBtn",oe.innerHTML=l.Lang.i18n("btn_emptyTheAnalysisLayer"),this.messageBox=new l.MessageBox,this.datasetSelectOnchange=se.bind(this),ne.onclick=function(){e.messageBox.closeView();var t=function(){var e=o.getAttribute("data-value"),t=M.getAttribute("data-value"),r=C.getAttribute("data-value"),n=j.value,i=R.title,a=U.title,s=z.title,u=Z.getAttribute("data-value"),c=W.getAttribute("data-value"),p=new Date,h=ee.value||p.getTime(),f=void 0;f="NOTSET"===c?"":{rangeMode:c,rangeCount:Y.value,colorGradientType:u};var d=void 0;"density"===e&&(d=new l.KernelDensityJobParameter({datasetName:y.title,method:t,meshType:r,resolution:N.value,fields:E.title,radius:B.value,meshSizeUnit:i,radiusUnit:a,areaUnit:s,query:n,mappingParameters:new l.MappingParameters({rangeMode:f.rangeMode,rangeCount:f.rangeCount,colorGradientType:f.colorGradientType})}));return{analysisParam:d,resultLayerName:h}}();y.title===l.Lang.i18n("text_option_selectDataset")?e.messageBox.showView(l.Lang.i18n("msg_selectDataset"),"failure"):E.title===l.Lang.i18n("text_option_notSet")?e.messageBox.showView(l.Lang.i18n("msg_setTheWeightField"),"failure"):(e.messageBox.closeView(),ie.style.display="block",ne.style.display="none",e.viewModel.on("layerloaded",function(t){ie.style.display="none",ne.style.display="block",e._event.fire("analysissucceeded",{layer:t.layer,name:t.name})}),e.viewModel.on("analysisfailed",function(t){e.messageBox.showView(l.Lang.i18n("msg_theFieldNotSupportAnalysis"),"failure"),ie.style.display="none",ne.style.display="block",e._event.fire("analysisfailed",{error:t.error})}),e.viewModel.analysis(t,e.map))},oe.onclick=function(){e.viewModel.on("layersremoved",function(t){e._event.fire("layersremoved",{layers:t.layers})}),e.viewModel.clearLayers()},this._preventMapEvent(t,this.map),t},_createOptions:function(e,t){for(var r in t){var n=document.createElement("div");n.className="component-selecttool__option",n.title=t[r],n.innerHTML=t[r],n.setAttribute("data-value",t[r]),e.appendChild(n)}},_creatInputBox:function(e,t){var r=a.default.DomUtil.create("div","",t);a.default.DomUtil.create("span","",r).innerHTML=e.spanName;var n=a.default.DomUtil.create("input","",r);return n.value=e.value,n.className="component-distributeanalysis__input",r},_creatUnitSelectBox:function(e,t){var r=a.default.DomUtil.create("div","component-clientcomputation__buffer--radius",t);a.default.DomUtil.create("span","",r).innerHTML=e.labelName;var n=a.default.DomUtil.create("div","",r);a.default.DomUtil.create("input","buffer-radius-input",n);var i=a.default.DomUtil.create("div","component-clientcomputation__buffer--unit",n),o=e.selectOptions,s=new l.Select(o).getElement();return i.appendChild(s),r},_setEleAtribute:function(e,t,r){for(var n=0;n\n \n \n \n \n ',a.default.DomUtil.create("span","",te).innerHTML=l.Lang.i18n("btn_analyzing");var ne=a.default.DomUtil.create("button","component-analysis__analysisbtn--cancel",ee);ne.innerHTML=l.Lang.i18n("btn_cancelAnalysis");var ie=a.default.DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",Z);ie.innerHTML=l.Lang.i18n("btn_emptyTheAnalysisLayer");for(var ae=function(t){u.children[t].onclick=function(){o.innerHTML=u.children[t].outerHTML,o.children[0].id="dropDownTop";var r=document.getElementById("layersSelect"),i=document.getElementById("layerSelectName"),a=u.children[t].getAttribute("data-value"),s={};switch(a){case"buffer":g.classList.add("hidden"),F.classList.remove("hidden"),n.style.height="422px",X.value=l.Lang.i18n("text_label_buffer")+i.title,s=e.fillData.point;break;case"isolines":g.classList.remove("hidden"),F.classList.add("hidden"),n.style.height="712px",X.value=l.Lang.i18n("text_label_isolines")+i.title,s=e.fillData.point}if(e.currentFillData!==s){if(r.innerHTML="","{}"==JSON.stringify(s))return X.value="",i.title="",void(i.innerHTML="");var c=[];for(var p in s)c.push(p);i.title=c[0],i.innerHTML=c[0],e._createOptions(r,c),e.layerSelectObj.optionClickEvent(r,i,e.layersSelectOnchange),"buffer"===a?X.value=l.Lang.i18n("text_label_buffer")+c[0]:"isolines"===a&&(X.value=l.Lang.i18n("text_label_isolines")+c[0]),e.currentData=s[i.title],e.currentFillData=s}}},oe=0;oe";t.bindPopup(r)}}},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return new Error("Cannot find map, fileModel.map cannot be null.");this.map=e,a.default.Util.extend(this.options._defaultLayerOptions,t),this.options._defaultLayerOptions.pointToLayer=this.options._defaultLayerOptions.style,this.popupsStatus=!0,this.dataFlowStatus=!1,this.dataFlowUrl="",this.currentFeatures=[],this.dataFlowLayer=null},subscribe:function(e){var t=this;if(this.dataFlowUrl===e){if(this.dataFlowStatus)return void this.fire("dataflowservicesubscribed")}else this.dataFlowUrl=e;this.dataFlowStatus=!0,this.dataFlowLayer&&(this.dataFlowLayer.remove(),this.dataFlowLayer=null);var r=new o.DataFlowLayer(e,this.options._defaultLayerOptions);r.on("subscribesucceeded",function(e){t.fire("subscribesucceeded",{result:e})}),r.on("subscribefailed",function(e){t.fire("subscribefailed",{result:e})}),r.on("dataupdated",function(e){t.fire("dataupdated",{result:e});var r=e.layer.getBounds(),n=s.CommontypesConversion.toSuperMapBounds(t.map.getBounds()),i=s.CommontypesConversion.toSuperMapBounds(r);n.intersectsBounds(i)||(i.left===i.right&&i.top===i.bottom?t.map.setView(r.getCenter()):t.map.flyToBounds(r)),t.popupsStatus&&t.openPopups()}),r.addTo(this.map),this.dataFlowLayer=r},cancelSubscribe:function(){this.dataFlowLayer&&(this.dataFlowStatus=!1,this.dataFlowLayer.dataService.unSubscribe(),this.dataFlowLayer.remove(),this.dataFlowLayer=null)},openPopups:function(){if(this.popupsStatus=!0,this.dataFlowLayer)for(var e=this.dataFlowLayer.getLayers(),t=0;t0&&document.getElementsByClassName("component-single-checked-img")[0].setAttribute("class","component-single-default-img"),r.firstChild.setAttribute("class","component-single-checked-img"),t.currentSearchLayerName=r.lastChild.innerText,t.isSearchLayer=!0,a.removeChild(a.firstChild),a.insertBefore(document.createTextNode(t.currentSearchLayerName),a.firstChild),t.viewModel.panToLayer(t.currentSearchLayerName),t.messageBox.closeView()},r.appendChild(h),e}(),p=[];s&&p.push({title:l.Lang.i18n("title_searchCity"),content:s}),p.push({title:l.Lang.i18n("title_searchLayer"),content:c});var h=new l.NavTabsPage({tabs:p}),f=h.getElement();h.closeView(),n.appendChild(f),i.onclick=function(){f.hidden?h.showView():h.closeView()},n.appendChild(i),a.innerText||a.appendChild(document.createTextNode(l.Lang.i18n("text_label_chooseSearchLayers")));var d=document.createElement("div");d.setAttribute("class","component-search__input");var y=document.createElement("input");y.type="text",y.placeholder=l.Lang.i18n("text_label_searchTips"),d.appendChild(y),this.poiInput=y;var v=document.createElement("span");v.setAttribute("class","supermapol-icons-close"),v.hidden=!0,d.appendChild(v),n.appendChild(d);var m=document.createElement("div");m.setAttribute("class","component-search-icon supermapol-icons-search"),m.onclick=function(){g.closeView(),e.clearSearchResult(),e.messageBox.closeView(),h.closeView();var t=e.poiInput.value.trim();""!==t?e.isSearchLayer?e.viewModel.search(t,e.currentSearchLayerName):e.viewModel.search(t):e.messageBox.showView(l.Lang.i18n("msg_searchKeywords"))},y.onkeypress=function(e){if(13==e.which){var t=document.createEvent("HTMLEvents");t.initEvent("click",!1,!0),m.dispatchEvent(t)}},n.appendChild(m);var g=new l.PaginationContainer;this._resultDomObj=g;var b=function(){var e=g.getElement();return e.style.position="absolute",e.style.top="44px",e.style.right="0",g.closeView(),g.content.onclick=function(e){var r=null;if("component-search-result-info"===e.target.parentNode.className)r=e.target.parentNode.parentNode;else if("component-search__resultitme"===e.target.parentNode.className)r=e.target.parentNode;else{if("component-search__resultitme"!==e.target.className)return;r=e.target}document.getElementsByClassName("component-search__resultitme-selected").length>0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),r.firstChild.classList.add("component-search__resultitme-selected");var n=r.children[1].firstChild.innerText;t._linkageFeature(n)},e}();return n.appendChild(b),v.onclick=function(t){e.clearSearchResult(),y.value="",t.target.hidden=!0,g.closeView()},y.oninput=function(){v.hidden=!1},this.messageBox=new l.MessageBox,this._addViewModelListener(),r.appendChild(n),this._preventMapEvent(r,this.map),r},_createSearchLayerItem:function(e){var t=document.createElement("div");t.setAttribute("class","component-search__layers__itme");var r=document.createElement("div");r.setAttribute("class","component-search__layers__itme__singleselect");var n=document.createElement("div");n.setAttribute("class","component-single-default-img"),r.appendChild(n);var i=document.createElement("span");i.setAttribute("class","single-label"),i.innerHTML=e,r.appendChild(i),t.appendChild(r),document.getElementsByClassName("component-search__layers__body")[0].appendChild(t)},_createResultItem:function(e,t){var r=document.createElement("div");r.setAttribute("class","component-search__resultitme");var n=document.createElement("div");"Point"===e||"MultiPoint"===e?n.setAttribute("class","supermapol-icons-marker-layer component-search-result-icon"):"LineString"===e||"MultiLineString "===e?n.setAttribute("class","supermapol-icons-line-layer component-search-result-icon"):"Polygon"===e||"MultiPolygon"===e?n.setAttribute("class","supermapol-icons-polygon-layer component-search-result-icon"):n.setAttribute("class","supermapol-icons-point-layer component-search-result-icon"),r.appendChild(n);var i=document.createElement("div");i.setAttribute("class","component-search-result-info");var a=document.createElement("div");i.appendChild(a);var o=document.createElement("div");return t.name?(a.innerHTML=t.name,o.innerHTML=t.address,i.appendChild(o)):a.innerHTML=t.filterAttributeName+": "+t.filterAttributeValue,r.appendChild(i),document.createElement("div").setAttribute("class","component-checkbox component-checkbox-default-img"),r},_addViewModelListener:function(){var e=this;this.viewModel.on("searchlayerschanged",function(t){for(var r=0;rt.length?(r=this.perPageDataNum*(e-1),n=t.length-1):(r=this.perPageDataNum*(e-1),n=e*this.perPageDataNum-1);for(var i=document.createElement("div"),a=r;a<=n;a++){var o=void 0,s="Point";t[a].filterAttribute?(s=t[a].feature.geometry.type,o=t[a].filterAttribute):o=t[a].properties,i.appendChild(this._createResultItem(s,o))}this._resultDomObj.setContent(i),this._resultDomObj.showView(),i.firstChild.getElementsByClassName("component-search-result-icon")[0].classList.add("component-search__resultitme-selected");var l=i.firstChild.getElementsByClassName("component-search-result-info")[0].firstChild.innerText;!this._selectMarkerFeature&&this._linkageFeature(l)},_flyToBounds:function(e){var t=e.getSouthWest(),r=e.getNorthEast();t.lat===r.lat&&t.lng===r.lng?this.map.flyTo(t):this.map.fitBounds(e)},_linkageFeature:function(e){var t=this,r="";r=this.isSearchLayer?e.split(":")[1].trim():e,this._selectFeature&&this._selectFeature.addTo(this.map),this.searchResultLayer.eachLayer(function(e){(!r||e.filterAttribute&&e.filterAttribute.filterAttributeValue===r||e.feature.properties&&e.feature.properties.name===r)&&(e.remove(),t._setSelectedLayerStyle(e))})},clearSearchResult:function(){this.searchResultLayer&&(this.map.closePopup(),!this.isSearchLayer&&this.map.removeLayer(this.searchResultLayer),this._selectMarkerFeature&&this.map.removeLayer(this._selectMarkerFeature),this._selectFeaturethis&&this.map.removeLayer(this._selectFeature),this._selectMarkerFeature=null,this._selectFeature=null,this.searchResultLayer=null,this.currentResult=null)},_featureOnclickEvent:function(e,t){var r=this;t.on("click",function(){var n=document.getElementsByClassName("component-pagination__link")[0];r._resultDomObj._changePageEvent({target:n.children[0].children[0]}),r._selectFeature&&r._selectFeature.addTo(r.map),t.remove();for(var i=void 0,a=void 0,o=0;o1)for(var l=1;l0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),h.firstChild.classList.add("component-search__resultitme-selected"),r._setSelectedLayerStyle(t)}},this)},_setSelectedLayerStyle:function(e){this._selectMarkerFeature&&this._selectMarkerFeature.remove(),this._selectMarkerFeature=null,this._selectFeature=e,this._selectMarkerFeature=a.default.geoJSON(e.toGeoJSON(),{pointToLayer:function(e,t){return a.default.marker(t,{icon:a.default.divIcon({className:"component-select-marker-icon",iconAnchor:[15,0]})})},style:{fillColor:"red",weight:1,opacity:1,color:"red",fillOpacity:.2}}).addTo(this.map),this._selectMarkerFeature.bindPopup(function(){return new l.AttributesPopContainer({attributes:e.feature.properties}).getElement()},{closeOnClick:!1}).openPopup().addTo(this.map),this._flyToBounds(this.searchResultLayer.getBounds());var t=void 0;e.getLatLng?t=e.getLatLng():e.getCenter&&(t=e.getCenter()),this.map.setView(t)}}),p=t.searchView=function(e){return new c(e)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/a.default.supermap.components.search=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openFileView=t.OpenFileView=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n},o=r(44),s=r(149),l=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var u=t.OpenFileView=o.ComponentsViewBase.extend({options:{layer:null},initialize:function(e){o.ComponentsViewBase.prototype.initialize.apply(this,[e]),this.viewModel=new s.OpenFileViewModel},setViewStyle:function(e,t){this.rootContainer.style[e]=t},_initView:function(){var e=this,t=a.default.DomUtil.create("div","component-openfile");return t.id="openFile",this.fileSelect=a.default.DomUtil.create("div","",t),this.label=a.default.DomUtil.create("label","component-openfile__span--select",this.fileSelect),this.label.htmlFor="input_file",a.default.DomUtil.create("div","supermapol-icons-upload",this.label),a.default.DomUtil.create("span","component-openfile__span",this.label).appendChild(document.createTextNode(l.Lang.i18n("text_chooseFile"))),this.fileInput=a.default.DomUtil.create("input","component-openfile__input",this.fileSelect),this.fileInput.id="input_file",this.fileInput.type="file",this.fileInput.accept=".json,.geojson,.csv,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",this.fileInput.onchange=function(t){e.messageBox.closeView(),e.viewModel.readFile(t)},this.messageBox=new l.MessageBox,this.viewModel.on("filesizeexceed",function(t){e.messageBox.showView(t.message,t.messageType)}),this.viewModel.on("errorfileformat",function(t){e.messageBox.showView(t.message,t.messageType)}),this.viewModel.on("openfilefailed",function(t){e.messageBox.showView(t.message,t.messageType),e._event.fire("openfilefailed",t)}),this.viewModel.on("readdatafail",function(t){e.messageBox.showView(t.message,t.messageType)}),this.viewModel.on("openfilesucceeded",function(t){e._event.fire("openfilesucceeded",t)}),this._preventMapEvent(t,this.map),t}}),c=t.openFileView=function(e){return new u(e)};a.default.supermap.components.openFile=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dataServiceQueryViewModel=t.DataServiceQueryViewModel=t.dataServiceQueryView=t.DataServiceQueryView=t.distributedAnalysisViewModel=t.DistributedAnalysisViewModel=t.distributedAnalysisView=t.DistributedAnalysisView=t.geoJSONLayerWithName=t.GeoJSONLayerWithName=t.GeoJsonLayerDataModel=t.GeoJsonLayersDataModel=t.clientComputationLayer=t.ClientComputationLayer=t.ClientComputationViewModel=t.clientComputationView=t.ClientComputationView=t.dataFlowView=t.DataFlowView=t.SearchViewModel=t.searchViewModel=t.searchView=t.SearchView=t.openFileViewModel=t.OpenFileViewModel=t.openFileView=t.OpenFileView=void 0;var n=r(354),i=r(149),a=r(353),o=r(148),s=r(351),l=r(349),u=r(147),c=r(348),p=r(96),h=r(146),f=r(347),d=r(145),y=r(345),v=r(144); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.OpenFileView=n.OpenFileView,t.openFileView=n.openFileView,t.OpenFileViewModel=i.OpenFileViewModel,t.openFileViewModel=i.openFileViewModel,t.SearchView=a.SearchView,t.searchView=a.searchView,t.searchViewModel=o.searchViewModel,t.SearchViewModel=o.SearchViewModel,t.DataFlowView=s.DataFlowView,t.dataFlowView=s.dataFlowView,t.ClientComputationView=l.ClientComputationView,t.clientComputationView=l.clientComputationView,t.ClientComputationViewModel=u.ClientComputationViewModel,t.ClientComputationLayer=c.ClientComputationLayer,t.clientComputationLayer=c.clientComputationLayer,t.GeoJsonLayersDataModel=p.GeoJsonLayersDataModel,t.GeoJsonLayerDataModel=p.GeoJsonLayerDataModel,t.GeoJSONLayerWithName=h.GeoJSONLayerWithName,t.geoJSONLayerWithName=h.geoJSONLayerWithName,t.DistributedAnalysisView=f.DistributedAnalysisView,t.distributedAnalysisView=f.distributedAnalysisView,t.DistributedAnalysisViewModel=d.DistributedAnalysisViewModel,t.distributedAnalysisViewModel=d.distributedAnalysisViewModel,t.DataServiceQueryView=y.DataServiceQueryView,t.dataServiceQueryView=y.dataServiceQueryView,t.DataServiceQueryViewModel=v.DataServiceQueryViewModel,t.dataServiceQueryViewModel=v.dataServiceQueryViewModel},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trafficTransferAnalystService=t.TrafficTransferAnalystService=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3);var o=r(9),s=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var l=t.TrafficTransferAnalystService=o.ServiceBase.extend({initialize:function(e,t){o.ServiceBase.prototype.initialize.call(this,e,t)},queryStop:function(e,t){var r=this;new s.StopQueryService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)},analysisTransferPath:function(e,t){var r=this;new s.TransferPathService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(r._processParams(e))},analysisTransferSolution:function(e,t){var r=this;new s.TransferSolutionService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(r._processParams(e))},_processParams:function(e){return e?(e.points&&a.default.Util.isArray(e.points)&&e.points.map(function(t,r){return e.points[r]=t instanceof a.default.LatLng?{x:t.lng,y:t.lat}:t,e.points[r]}),e):{}}}),u=t.trafficTransferAnalystService=function(e,t){return new l(e,t)};a.default.supermap.trafficTransferAnalystService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.themeService=t.ThemeService=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n},o=r(9);r(3);var s=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var l=t.ThemeService=o.ServiceBase.extend({initialize:function(e,t){o.ServiceBase.prototype.initialize.call(this,e,t)},getThemeInfo:function(e,t){var r=this;new s.ThemeService(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,serverType:r.options.serverType,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}}),u=t.themeService=function(e,t){return new l(e,t)};a.default.supermap.themeService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.spatialAnalystService=t.SpatialAnalystService=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3);var o=r(9),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(32)),l=r(26),u=r(5); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var c=t.SpatialAnalystService=o.ServiceBase.extend({initialize:function(e,t){o.ServiceBase.prototype.initialize.call(this,e,t)},getAreaSolarRadiationResult:function(e,t,r){var n=this;new u.AreaSolarRadiationService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(e)},bufferAnalysis:function(e,t,r){var n=this;new u.BufferAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},densityAnalysis:function(e,t,r){var n=this;new u.DensityAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},generateSpatialData:function(e,t,r){var n=this;new u.GenerateSpatialDataService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(e)},geoRelationAnalysis:function(e,t,r){var n=this;new u.GeoRelationAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(e)},interpolationAnalysis:function(e,t,r){var n=this;new u.InterpolationAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},mathExpressionAnalysis:function(e,t,r){var n=this;new u.MathExpressionAnalysisService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},overlayAnalysis:function(e,t,r){var n=this;new u.OverlayAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},routeCalculateMeasure:function(e,t,r){var n=this;new u.RouteCalculateMeasureService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},routeLocate:function(e,t,r){var n=this;new u.RouteLocatorService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},surfaceAnalysis:function(e,t,r){var n=this;new u.SurfaceAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},terrainCurvatureCalculate:function(e,t,r){var n=this;new u.TerrainCurvatureCalculationService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(e)},thiessenAnalysis:function(e,t,r){var n=this;new u.ThiessenAnalystService(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}).processAsync(n._processParams(e))},geometrybatchAnalysis:function(e,t,r){for(var n=this,i=new u.GeometryBatchAnalystService(n.url,{serverType:n.options.serverType,eventListeners:{scope:n,processCompleted:t,processFailed:t},format:n._processFormat(r)}),a=[],o=0;o0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)},convertFastToPixelPoints:function(e){var t,r,n,a,o,s,l,u=[],c=e.getEast()-e.getWest(),p=e.getNorth()-e.getSouth(),h=this._map.getSize();a=c/h.x>p/h.y?c/h.x:p/h.y,this.useRadius=this.useGeoUnit?parseInt(this.radius/a):this.radius;for(var f=0;f0&&this.maxWidth>0))return!1;var r=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;n>1,c=-7,p=r?i-1:0,h=r?-1:1,f=e[t+p];for(p+=h,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+p],p+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+p],p+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=u}return(f?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(t*l-1)*Math.pow(2,i),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=d,o/=256,u-=8);e[r+f-d]|=128*y}},function(e,t,r){"use strict";e.exports=i;var n=r(379);function i(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;function a(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function o(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function l(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function b(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=m(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=b(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=m(this.buf,this.pos)+4294967296*b(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return o(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return o(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return o(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return o(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return o(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return o(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,r){var n="",i=t;for(;i239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var r=a(this);for(e=e||[];this.pos127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var r,n;e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;if(t.buf[t.pos++]|=r|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&s(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),n.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),n.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&s(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){this.writeMessage(e,l,t)},writePackedSVarint:function(e,t){this.writeMessage(e,u,t)},writePackedBoolean:function(e,t){this.writeMessage(e,h,t)},writePackedFloat:function(e,t){this.writeMessage(e,c,t)},writePackedDouble:function(e,t){this.writeMessage(e,p,t)},writePackedFixed32:function(e,t){this.writeMessage(e,f,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,d,t)},writePackedFixed64:function(e,t){this.writeMessage(e,y,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,v,t)},writeBytesField:function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tiledVectorLayer=t.TileVectorLayer=void 0;var n=u(r(2));r(3);var i=r(159),a=r(104),o=r(5),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(32)),l=u(r(12));function u(e){return e&&e.__esModule?e:{default:e}}var c=t.TileVectorLayer=i.VectorGrid.extend({options:{serverType:null,crs:null,cartoCSS:null,layerNames:null,layersID:null,serverCartoCSSStyle:!0,processCharacters:!1,returnAttributes:!1,expands:null,cacheEnabled:!1,tileTemplate:null,subdomains:"abc",timeout:1e4,attribution:l.default.Common.attribution},initialize:function(e,t){(t=t||{}).noWrap=null==t.noWrap||t.noWrap,n.default.setOptions(this,t),i.VectorGrid.prototype.initialize.call(this,t),n.default.stamp(this);var r=this;if(!e||e.indexOf("http")<0)return e="",this;r.url=e,e.indexOf("/")===e.length-1&&(e=e.substr(0,e.length-1),r.url=e),this.cartoCSSToLeaflet=new a.CartoCSSToLeaflet(r.url),r.initLayersInfo(),!r.options.serverCartoCSSStyle&&r.options.cartoCSS&&r.setClientCartoCSS(r.options.cartoCSS)},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._map=e,this._initLayerUrl(),!this.options.tileTemplate&&this.options.serverCartoCSSStyle||this._initGrid()},initLayersInfo:function(){var e=this,t=e.url+"/layers.json";o.FetchRequest.get(t,null,{timeout:e.options.timeout}).then(function(e){return e.json()}).then(function(t){if(e.layersInfoInitialized=!0,e.layersInfo=t,e.layersInfo){for(var r={},n=0,i=e.layersInfo.length;n0&&o[o.length-1]}t.properties.textField=a}r.vectorTileLayerStyles=r.vectorTileLayerStyles||{};var s=r.vectorTileLayerStyles[n];if(s)return t=this._mergeFeatureTextField(t,s),s;var l=this.getScaleFromCoords(e),u=this.cartoCSSToLeaflet.pickShader(n)||[];for(var c in s=[],u)for(var p=u[c],h=0;h1){var p=parseInt(c[1]);u=p&&p>=4e3&&p<=5e3?o.Unit.DEGREE:o.Unit.METER}}return s.resolutionToScale(l,96,u)},_mergeFeatureTextField:function(e,t){if(!this.options.serverCartoCSSStyle||!t||"TEXT"!==e.type)return e;var r=t;n.default.Util.isArray(t)||(r=[t]);for(var i=0;i-1&&(this._data=e),this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();var t=this._getLayerState();t.data=this._data||[],this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)},drawGraphics:function(e){this._clearBuffer();var t=this.layer._map.getSize();this._container.width!==t.x&&(this._container.width=t.x),this._container.height!==t.y&&(this._container.height=t.y);var r=this.layer._map.getPanes().mapPane._leaflet_pos;this._container.style[s]="translate("+-Math.round(r.x)+"px,"+-Math.round(r.y)+"px)",this._data=e||[],this._renderLayer||this._createInnerRender(),this._draw()},_initContainer:function(){this._container=this._createCanvas(this.options.width,this.options.height),this._layerContainer=this.options.container,this._wrapper=a.default.DomUtil.create("div","deck-wrapper",this._layerContainer),this._wrapper.appendChild(this._container)},_createCanvas:function(e,t){var r=a.default.DomUtil.create("canvas","graphicLayer leaflet-layer leaflet-zoom-hide");return r.oncontextmenu=a.default.Util.falseFn,r.width=e,r.height=t,r.style.width=e+"px",r.style.height=t+"px",r},_pixelToMeter:function(e){var t=this.layer._map.getBounds();return e*((t.getEast()-t.getWest())/this.layer._map.getSize().x*(6378137*Math.PI/180))},_createInnerRender:function(){var e=this,t=this._getLayerState(),r=t.color,n=t.radius,i=t.opacity,a=t.highlightColor,o=t.radiusScale,s=t.radiusMinPixels,l=t.radiusMaxPixels,u=t.strokeWidth,c=t.outline,p={id:"scatter-plot",data:e._data,pickable:Boolean(this.options.onClick)||Boolean(this.options.onHover),autoHighlight:!0,color:r,opacity:i,radius:n,radiusScale:o,highlightColor:a,radiusMinPixels:s,radiusMaxPixels:l,strokeWidth:u,outline:c,getPosition:function(e){if(!e)return[0,0,0];var t=e.getLatLng();return t&&[t.lng,t.lat,0]},getColor:function(t){var r=e._getLayerDefaultStyle(),n=t&&t.options;return n&&n.color||r.color},getRadius:function(t){var r=e._getLayerDefaultStyle(),n=t&&t.getStyle();return n&&n.radius||r.radius},updateTriggers:{getColor:[r],getRadius:[n]}},h=this;this.options.onClick&&(p.onClick=function(){h._container.style.cursor="pointer",h.options.onClick.apply(h,arguments)}),this.options.onHover&&(p.onHover=function(){h._container.style.cursor="pointer",h.options.onHover.apply(h,arguments)}),e._renderLayer=new window.DeckGL.ScatterplotLayer(p)},_getLayerDefaultStyle:function(){if(this._layerDefaultStyleCache)return this._layerDefaultStyleCache;var e=this.layer.options,t=e.color,r=e.opacity,n=e.radius,i=e.radiusScale,a=e.radiusMinPixels,o=e.radiusMaxPixels,s=e.strokeWidth,l=e.outline;return n=this._pixelToMeter(n),this._layerDefaultStyleCache={color:t,opacity:r,radius:n,radiusScale:i,radiusMinPixels:a,radiusMaxPixels:o,strokeWidth:s,outline:l},this._layerDefaultStyleCache},_getLayerState:function(){var e=this.layer.getState();return e.zoom=e.zoom-1,e},_draw:function(){var e=this._getLayerState();this._refreshData(),e.data=this._data||[];var t={};for(var r in e)t[r]=e[r];this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._container,t.onBeforeRender=this._onBeforeRender.bind(this),t.onAfterRender=this._onAfterRender.bind(this),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)},_clearBuffer:function(){if(this.deckGL){var e=this.deckGL.layerManager;e&&e.context.gl.clear(e.context.gl.COLOR_BUFFER_BIT)}return this},_refreshData:function(){var e=this._data||[],t=a.default.Util.isArray(e)?[].concat(e):[e];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;if(!e||0===e.length||e===this.graphics)return this.graphics.length=0,void this.update();s.CommonUtil.isArray(e)||(e=[e]);for(var t=e.length-1;t>=0;t--){var r=e[t],n=s.CommonUtil.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()},setStyle:function(e){var t=this.options,r={color:t.color,radius:t.radius,opacity:t.opacity,highlightColor:t.highlightColor,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline};this.options=a.default.Util.extend(this.options,r,e),this.defaultStyle=this._getDefaultStyle(this.options),this.update()},update:function(){this._layerRenderer.update(this.graphics)},clear:function(){this.removeGraphics()},getRenderer:function(){return this._renderer},getState:function(){var e=this._map,t=e.getSize().x,r=e.getSize().y,n=e.getCenter(),i={longitude:n.lng,latitude:n.lat,zoom:e.getZoom(),maxZoom:e.getMaxZoom(),pitch:0,bearing:0},a={};for(var o in i)a[o]=i[o];a.width=t,a.height=r;var s=this.options;return a.color=s.color,a.radius=s.radius,a.opacity=s.opacity,a.highlightColor=s.highlightColor,a.radiusScale=s.radiusScale,a.radiusMinPixels=s.radiusMinPixels,a.radiusMaxPixels=s.radiusMaxPixels,a.strokeWidth=s.strokeWidth,a.outline=s.outline,a},_resize:function(){var e=this._map.getSize();this._container.width=e.x,this._container.height=e.y,this._container.style.width=e.x+"px",this._container.style.height=e.y+"px";var t=this._map.containerPointToLayerPoint([0,0]);a.default.DomUtil.setPosition(this._container,t),this._update()},_moveEnd:function(){this._layerRenderer instanceof l.GraphicWebGLRenderer&&this._update()},_createRenderer:function(){var e=this._map,t=e.getSize().x,r=e.getSize().y,n=void 0;if(this.options.render===u[0])n=new l.GraphicCanvasRenderer(this,{width:t,height:r,renderer:e.getRenderer(this)});else{var i=a.default.Util.setOptions({},c),o=a.default.Util.setOptions({options:i},this.options);(o=a.default.Util.setOptions(this,o)).container=e.getPane("overlayPane"),o.width=t,o.height=r,n=new l.GraphicWebGLRenderer(this,o)}return n.defaultStyle=this.defaultStyle,this._layerRenderer=n,this._layerRenderer.getRenderer()},_update:function(){this._map&&this._updatePath()},_updatePath:function(){var e=this._getGraphicsInBounds();this._renderer.drawGraphics(e,this.defaultStyle)},_project:function(){var e=this;e._getGraphicsInBounds().map(function(t){var r=e._map.latLngToLayerPoint(t.getLatLng()),n=e._clickTolerance(),i=[t._anchor+n,t._anchor+n];return t._pxBounds=new a.default.Bounds(r.subtract(i),r.add(i)),t}),e._pxBounds=a.default.bounds(a.default.point(0,0),a.default.point(this._container.width,this._container.height))},_getDefaultStyle:function(e){var t={};if(e.color){t.fill=!0;var r=this.toRGBA(e.color);t.color=r,t.fillColor=r}return e.opacity&&(t.opacity=e.opacity,t.fillOpacity=e.opacity),e.radius&&(t.radius=e.radius),e.strokeWidth&&(t.weight=e.strokeWidth),e.outline&&(t.stroke=e.outline),new l.CircleStyle(t).getStyle()},toRGBA:function(e){return"rgba("+e[0]+","+e[1]+","+e[2]+","+(e[3]||255)/255+")"},_getGraphicsInBounds:function(){var e=[],t=this._map.getBounds();return this.graphics.map(function(r){return t.contains(r.getLatLng())&&e.push(r),r}),e},_handleClick:function(e){this._layerRenderer._handleClick(e)},beforeAdd:a.default.Util.falseFn,_containsPoint:a.default.Util.falseFn}),h=t.graphicLayer=function(e,t){return new p(e,t)}; -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/a.default.supermap.graphicLayer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.echartsLayer=t.EchartsLayer=void 0,t.LeafletMapCoordSys=l;var n=o(r(2));r(3);var i=o(r(197)),a=o(r(12));function o(e){return e&&e.__esModule?e:{default:e}} -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/var s=t.EchartsLayer=n.default.Layer.extend({includes:[],_echartsContainer:null,_map:null,_ec:null,_echartsOptions:null,options:{attribution:a.default.ECharts.attribution,loadWhileAnimating:!1},initialize:function(e,t){n.default.Util.setOptions(this,t),this.setOption(e)},setOption:function(e,t,r){var n=e.baseOption||e;n.LeafletMap=n.LeafletMap||{roam:!0},n.animation=!0===n.animation,this._echartsOptions=e,this._ec&&this._ec.setOption(e,t,r)},getEcharts:function(){return this._ec},_disableEchartsContainer:function(){this._echartsContainer.style.visibility="hidden"},_enableEchartsContainer:function(){this._echartsContainer.style.visibility="visible"},onAdd:function(e){this._map=e,this._initEchartsContainer(),this._ec=i.default.init(this._echartsContainer),this._ec.leafletMap=e;var t=this;e.on("zoomstart",function(){t._disableEchartsContainer()}),!t.options.loadWhileAnimating&&e.on("movestart",function(){t._disableEchartsContainer()}),i.default.registerAction({type:"LeafletMapLayout",event:"LeafletMapLayout",update:"updateLayout"},function(e){}),i.default.registerCoordinateSystem("leaflet",l),i.default.extendComponentModel({type:"LeafletMap",getBMap:function(){return this.__LeafletMap},defaultOption:{roam:!1}}),i.default.extendComponentView({type:"LeafletMap",render:function(e,r,i){var a=!0,o=r.scheduler.ecInstance.leafletMap,s=i.getZr().painter.getViewportRoot(),l=o.options.zoomAnimation&&n.default.Browser.any3d;s.className=" leaflet-layer leaflet-zoom-"+(l?"animated":"hide")+" echarts-layer";var u=n.default.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);s.style[u]="50% 50%";var c=e.coordinateSystem,p=i.getZr().painter.getLayers(),h=function(){if(!a){var r,n=t._map.containerPointToLayerPoint([0,0]),o=[n.x||0,n.y||0];if(s.style.left=o[0]+"px",s.style.top=o[1]+"px",!t.options.loadWhileAnimating){for(var l in p)p.hasOwnProperty(l)&&p[l]&&(r=p[l].ctx)&&r.clearRect&&r.clearRect(0,0,r.canvas.width,r.canvas.height);t._enableEchartsContainer()}c.setMapOffset(o),e.__mapOffset=o,i.dispatchAction({type:"LeafletMapLayout"})}};function f(){a||(i.dispatchAction({type:"LeafletMapLayout"}),t._enableEchartsContainer())}t._oldMoveHandler&&o.off(t.options.loadWhileAnimating?"move":"moveend",t._oldMoveHandler),t._oldZoomEndHandler&&o.off("zoomend",t._oldZoomEndHandler),o.on(t.options.loadWhileAnimating?"move":"moveend",h),o.on("zoomend",f),t._oldMoveHandler=h,t._oldZoomEndHandler=f,a=!1}}),this._ec.setOption(this._echartsOptions)},onRemove:function(){this._ec.clear(),this._ec.dispose(),delete this._ec,n.default.DomUtil.remove(this._echartsContainer),this._oldZoomEndHandler&&(this._map.off("zoomend",this._oldZoomEndHandler),this._oldZoomEndHandler=null),this._oldMoveHandler&&(this._map.off(this.options.loadWhileAnimating?"move":"moveend",this._oldMoveHandler),this._oldMoveHandler=null),this._resizeHandler&&(this._map.off("resize",this._resizeHandler),this._resizeHandler=null),delete this._map},_initEchartsContainer:function(){var e=this._map.getSize(),t=document.createElement("div");t.style.position="absolute",t.style.height=e.y+"px",t.style.width=e.x+"px",t.style.zIndex=10,this._echartsContainer=t,this.getPane().appendChild(this._echartsContainer);var r=this;function n(e){var t=e.newSize;r._echartsContainer.style.width=t.x+"px",r._echartsContainer.style.height=t.y+"px",r._ec.resize()}this._map.on("resize",n),this._resizeHandler=n}});function l(e){this._LeafletMap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0]}l.prototype.dimensions=["lng","lat"],l.prototype.setMapOffset=function(e){this._mapOffset=e},l.prototype.getBMap=function(){return this._LeafletMap},l.prototype.prepareCustoms=function(){var e=i.default.util,t=this.getViewRect();return{coordSys:{type:"leaflet",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,r){return r=r||[0,0],e.map([0,1],function(e){var n=r[e],i=t[e]/2,a=[],o=[];return a[e]=n-i,o[e]=n+i,a[1-e]=o[1-e]=r[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(o)[e])},this)},this)}}},l.prototype.dataToPoint=function(e){null===e[1]&&(e[1]=n.default.CRS.EPSG3857.projection.MAX_LATITUDE);var t=this._LeafletMap.latLngToLayerPoint([e[1],e[0]]),r=this._mapOffset;return[t.x-r[0],t.y-r[1]]},l.prototype.fixLat=function(e){return e>=90?89.99999999999999:e<=-90?-89.99999999999999:e},l.prototype.pointToData=function(e){var t=this._mapOffset,r=this._LeafletMap.layerPointToLatLng([e[0]+t[0],e[1]+t[1]]);return[r.lng,r.lat]},l.prototype.getViewRect=function(){var e=this._LeafletMap.getSize();return new i.default.graphic.BoundingRect(0,0,e.x,e.y)},l.prototype.getRoamTransform=function(){return i.default.matrix.create()},l.dimensions=l.prototype.dimensions,l.create=function(e){var t=void 0,r=e.scheduler.ecInstance.leafletMap;e.eachComponent("LeafletMap",function(e){t||(t=new l(r)),e.coordinateSystem=t,e.coordinateSystem.setMapOffset(e.__mapOffset||[0,0])}),e.eachSeries(function(e){e.get("coordinateSystem")&&"leaflet"!==e.get("coordinateSystem")||(t||(t=new l(r)),e.coordinateSystem=t,e.animation=!0===e.animation)})};var u=t.echartsLayer=function(e,t){return new s(e,t)};n.default.supermap.echartsLayer=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NormalRenderer=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.NormalRenderer=a.default.GeoJSON.extend({initialize:function(e,t){(t=t||{}).style&&!t.pointToLayer&&(t.pointToLayer=function(e,r){return a.default.circleMarker(r,t.style())}),a.default.Util.setOptions(this,t),this._layers={},a.default.stamp(this),this.url=e,this.idCache={}},onMessageSuccessed:function(e){var t=e.featureResult,r=e.featureResult.properties[this.options.idField],n=null;void 0!==r&&this.idCache[r]?(n=this.getLayer(this.idCache[r]),this._updateLayerData(n,t)):((n=a.default.GeoJSON.geometryToLayer(t,this.options)).feature=a.default.GeoJSON.asFeature(t),this.addLayer(n),void 0!==r&&(this.idCache[r]=this.getLayerId(n))),this.options.onEachFeature&&this.options.onEachFeature(t,n)},_updateLayerData:function(e,t){t.properties&&(e.feature.properties=t.properties);var r=[];switch(t.geometry.type){case"Point":r=a.default.GeoJSON.coordsToLatLng(t.geometry.coordinates),e.setLatLng(r);break;case"LineString":r=a.default.GeoJSON.coordsToLatLngs(t.geometry.coordinates,0),e.setLatLngs(r);break;case"MultiLineString":case"Polygon":r=a.default.GeoJSON.coordsToLatLngs(t.geometry.coordinates,1),e.setLatLngs(r);break;case"MultiPolygon":r=a.default.GeoJSON.coordsToLatLngs(t.geometry.coordinates,2),e.setLatLngs(r)}}})},function(e,t){e.exports=function(){try{return mapv}catch(e){return{}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapvRenderer=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3);var o=r(163);t.MapvRenderer=o.MapVLayer.extend({initialize:function(e,t){t=t||{},a.default.Util.setOptions(this,t),this.data=[],this.mapVOptions={draw:"simple"},o.MapVLayer.prototype.initialize.call(this,new window.mapv.DataSet([]),this.mapVOptions,t),this.idCache={},this.url=e,this._last=new Date,this._imageCache={}},onMessageSuccessed:function(e){var t=this,r=e.featureResult.properties.id,n=e.featureResult.geometry,i={geometry:e.featureResult.geometry};if("Point"===n.type&&this.options.pointToLayer){var o=this.options.pointToLayer(e.featureResult,a.default.latLng(n.coordinates[1],n.coordinates[0]));if(o instanceof a.default.Marker){this.mapVOptions.draw="icon";var s=o.options.icon,l=s._getIconUrl("icon")+"_"+(s.options.iconSize?s.options.iconSize[0]:null)+"_"+(s.options.iconSize?s.options.iconSize[1]:null),u=this._imageCache[l];u||(u=s.createIcon(),this._imageCache[l]=u,u.onload=function(){t.update({data:t.data,options:t.mapVOptions})}),i.icon=u,(s.options.iconSize||u.style.height)&&(this.mapVOptions.offset={x:0,y:-(s.options.iconSize[1]||u.style.height)/2}),this.options.deg&&(i.deg=this.options.deg,"function"==typeof i.deg&&this.idCache[r]&&this.data[this.idCache[r]]&&(i.deg=i.deg(e.featureResult,a.default.latLng(n.coordinates[1],n.coordinates[0]),this.data[this.idCache[r]])))}if(o instanceof a.default.CircleMarker){this.mapVOptions.draw="simple";var c=this._toMapvStyle(o);for(var p in c)c.hasOwnProperty(p)&&(i[p]=c[p])}}else if(this.options.style){var h=this._toMapvStyle(this.options.style(e.featureResult));for(var f in h)h.hasOwnProperty(f)&&(i[f]=h[f])}void 0==this.idCache[r]?(this.data.push(i),this.idCache[r]=this.data.length-1):this.data[this.idCache[r]]=i,new Date-this._last>200&&(this._last=new Date,this.update({data:this.data,options:this.mapVOptions}))},_toMapvStyle:function(e){var t={draw:"simple"};return t.strokeStyle=e.color,t.lineWidth=e.width,t.globalAlpha=e.fillOpacity||e.opacity,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.fillStyle=e.fillColor,t.size=e.radius,t}}); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VectorTilePBF=t.VectorTileJSON=t.VectorTile=t.VectorGrid=t.VectorFeatureType=t.TextSymbolizer=t.PolyBase=t.Symbolizer=t.SVGRenderer=t.RegionSymbolizer=t.PointSymbolizer=t.LineSymbolizer=t.CanvasRenderer=t.ThemeLayer=t.themeFeature=t.ThemeFeature=t.GeoFeatureThemeLayer=t.MapVRenderer=t.graphic=t.Graphic=t.circleStyle=t.CircleStyle=t.cloverStyle=t.CloverStyle=t.imageStyle=t.ImageStyle=t.CompOpMap=t.ServerStyleMap=t.CartoStyleMap=t.DefaultStyle=t.CartoCSSToLeaflet=t.VectorTileFormat=t.heatMapFeature=t.HeatMapFeature=t.heatMapLayer=t.HeatMapLayer=t.uniqueThemeLayer=t.UniqueThemeLayer=t.unicodeMarker=t.UnicodeMarker=t.turfLayer=t.TurfLayer=t.tiledVectorLayer=t.TileVectorLayer=t.rankSymbolThemeLayer=t.RankSymbolThemeLayer=t.rangeThemeLayer=t.RangeThemeLayer=t.mapVLayer=t.MapVLayer=t.labelThemeLayer=t.LabelThemeLayer=t.graphThemeLayer=t.GraphThemeLayer=t.graphicLayer=t.GraphicLayer=t.LeafletMapCoordSys=t.echartsLayer=t.EchartsLayer=t.dataFlowLayer=t.DataFlowLayer=void 0;var n=r(165),i=r(390),a=r(389),o=r(160),s=r(168),l=r(163),u=r(169),c=r(382),p=r(381),h=r(375),f=r(166),d=r(170),y=r(373),v=r(97),m=r(372),g=r(161),b=r(371),S=r(370),_=r(369);t.DataFlowLayer=n.DataFlowLayer,t.dataFlowLayer=n.dataFlowLayer, -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.EchartsLayer=i.EchartsLayer,t.echartsLayer=i.echartsLayer,t.LeafletMapCoordSys=i.LeafletMapCoordSys,t.GraphicLayer=a.GraphicLayer,t.graphicLayer=a.graphicLayer,t.GraphThemeLayer=o.GraphThemeLayer,t.graphThemeLayer=o.graphThemeLayer,t.LabelThemeLayer=s.LabelThemeLayer,t.labelThemeLayer=s.labelThemeLayer,t.MapVLayer=l.MapVLayer,t.mapVLayer=l.mapVLayer,t.RangeThemeLayer=u.RangeThemeLayer,t.rangeThemeLayer=u.rangeThemeLayer,t.RankSymbolThemeLayer=c.RankSymbolThemeLayer,t.rankSymbolThemeLayer=c.rankSymbolThemeLayer,t.TileVectorLayer=p.TileVectorLayer,t.tiledVectorLayer=p.tiledVectorLayer,t.TurfLayer=h.TurfLayer,t.turfLayer=h.turfLayer,t.UnicodeMarker=f.UnicodeMarker,t.unicodeMarker=f.unicodeMarker,t.UniqueThemeLayer=d.UniqueThemeLayer,t.uniqueThemeLayer=d.uniqueThemeLayer,t.HeatMapLayer=y.HeatMapLayer,t.heatMapLayer=y.heatMapLayer,t.HeatMapFeature=y.HeatMapFeature,t.heatMapFeature=y.heatMapFeature,t.VectorTileFormat=v.VectorTileFormat,t.CartoCSSToLeaflet=m.CartoCSSToLeaflet,t.DefaultStyle=m.DefaultStyle,t.CartoStyleMap=m.CartoStyleMap,t.ServerStyleMap=m.ServerStyleMap,t.CompOpMap=m.CompOpMap,t.ImageStyle=g.ImageStyle,t.imageStyle=g.imageStyle,t.CloverStyle=g.CloverStyle,t.cloverStyle=g.cloverStyle,t.CircleStyle=g.CircleStyle,t.circleStyle=g.circleStyle,t.Graphic=g.Graphic,t.graphic=g.graphic,t.MapVRenderer=b.MapVRenderer,t.GeoFeatureThemeLayer=S.GeoFeatureThemeLayer,t.ThemeFeature=S.ThemeFeature,t.themeFeature=S.themeFeature,t.ThemeLayer=S.ThemeLayer,t.CanvasRenderer=_.CanvasRenderer,t.LineSymbolizer=_.LineSymbolizer,t.PointSymbolizer=_.PointSymbolizer,t.RegionSymbolizer=_.RegionSymbolizer,t.SVGRenderer=_.SVGRenderer,t.Symbolizer=_.Symbolizer,t.PolyBase=_.PolyBase,t.TextSymbolizer=_.TextSymbolizer,t.VectorFeatureType=_.VectorFeatureType,t.VectorGrid=_.VectorGrid,t.VectorTile=_.VectorTile,t.VectorTileJSON=_.VectorTileJSON,t.VectorTilePBF=_.VectorTilePBF},function(e,t,r){"use strict";function n(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===n(e)}e.exports={getObjectType:n,isDate:function(e){return"[object Date]"===n(e)},isString:i,isDateString:function(e){return i(e)&&!isNaN(Date.parse(e))},parseDateFromString:function(e){return Date.parse(e)},isNumber:function(e){return"number"==typeof e}}},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(395),a="&&",o="||",s="and",l="or",u="=",c="~",p="!"+u,h="!"+c,f=">",d=">=",y="<",v="<=",m="*",g=",",b=".",S="(",_=")",P="where",O={pathway:[],groups:{}},w={},M={},T=console.log;function C(e){var t=E(e,P),r=t[0],n=t[1];O.pathway=E(r,g);for(var i=0,s=O.pathway.length;il&&-1!==l){var C="gr_"+(new Date).getTime();O.groups[C]=n.substring(l+1,M),n=n.replace(S+O.groups[C]+_,C),T=-1}T+=1}!function e(t,r){var n=x(r,a),i=x(r,o);if(n!==Number.MAX_VALUE||i!==Number.MAX_VALUE)if(n-1}function A(e,t){var r=E(t,b),n=e;for(var a in r){if(!n.hasOwnProperty(r[a]))return"";n=n[r[a]]}return n=i.isDate(n)?n.valueOf():i.isDateString(n)?i.parseDateFromString(n):n.toString()}function k(e,t){var r=!1;for(var n in e){if(r=r||(n===s?j:n===l?k:F)(e[n],t),M.trace&&T(O.step,"======((( or",e[n],r),r)return r}return r}function j(e,t){var r=!0;for(var n in e){if(r=r&&(n===s?j:n===l?k:F)(e[n],t),M.trace&&T(O.step,"======((( and",e[n],r),!r)return r}return r}function F(e,t){if(O.step+=1,e.or){var r=k(e.or,t);return M.trace&&T(O.step,"OR",e,r),r}if(e.and){r=j(e.and,t);return M.trace&&T(O.step,"AND",e,r),r}if("object"===(void 0===e?"undefined":n(e)))return e.eq?A(t,e.eq[0])===e.eq[1]:e.ne?A(t,e.ne[0])!==e.ne[1]:e.req?L(A(t,e.req[0]),e.req[1]):e.nreq?!L(A(t,e.nreq[0]),e.nreq[1]):e.gt?A(t,e.gt[0])>e.gt[1]:e.ge?A(t,e.ge[0])>=e.ge[1]:e.lt?A(t,e.lt[0])0?n.map(function(e){for(var t={},r=0,n=O.pathway.length;r0;){var a=t.pop(),o=a.type,s=a.layerType=a.layerType||"BASE_LAYER";"OVERLAY_LAYER"!==s&&(o=s),this.createLayer(o,a)}this.fire("maploaded",{map:this._map})}},createCRS:function(e,t,r,i,a){return e<0?new l.NonEarthCRS({bounds:a,origin:i,resolutions:r}):910112===e||910102===e?n.default.CRS.BaiduCRS:(910111===e&&(e=3857),910101===e&&(e=4326),n.default.Proj.CRS("EPSG:"+e,{origin:i,resolutions:r,bounds:a}))},createMap:function(e){var t=e.crs||n.default.CRS.EPSG3857,r=n.default.latLngBounds(t.unproject(e.bounds.min),t.unproject(e.bounds.max));this._map=n.default.map(this.options.map,{center:r.getCenter(),maxZoom:e.maxZoom||22,minZoom:e.minZoom||0,zoom:e.zoom||0,crs:t,renderer:n.default.canvas()}),t instanceof l.NonEarthCRS?this._map.setZoom(e.zoom?e.zoom+2:2,{maxZoom:e.maxZoom||22}):this._map.fitBounds(r,{maxZoom:e.maxZoom||22})},getResolutionsFromScales:function(e,t,r,i){for(var a=[],o=0;o 0";var s=new o.GetFeaturesBySQLParameters({queryParameter:{name:r+"@"+t,attributeFilter:n},datasetNames:[t+":"+r],fromIndex:0,toIndex:1e5});(0,m.featureService)(e).getFeaturesBySQL(s,a,i)},createThemeLayer:function(e){var t,r=this,n=e.themeSettings&&JSON.parse(e.themeSettings),i=n.type;if(e.themeSettings=n,(t="HEAT"===i?this.createHeatLayer(e,n):"UNIQUE"===i?this.createUniqueLayer(e,n):"RANGE"===i?this.createRangeLayer(e,n):this.createBaseThemeLayer(e,n))&&(this.addFeature2ThemeLayer(e,t),t.on("add",function(e){r.registerThemeEvent(e.target)})),n&&n.labelField){var a=this.createLabelLayer(e,n);a.on("add",function(e){r.registerThemeEvent(e.target)}),t.labelLayer=a}return t},createBaseThemeLayer:function(e,t){var r=e.style,i=e.opacity,a=t.vectorType,o=r.pointStyle;o.fill="LINE"!==a;var s={};s.radius=o.pointRadius,s.color=o.strokeColor,s.opacity=o.strokeOpacity,s.lineCap=o.strokeLineCap,s.weight=o.strokeWidth,s.fillColor=o.fillColor,s.fillOpacity=o.fillOpacity;var l=function(e,t){return n.default.circleMarker(t,s)};return o.unicode&&(l=function(e,t){return new b.UnicodeMarker(t,o)}),n.default.geoJSON({type:"GeometryCollection",geometries:[]},{pointToLayer:l,opacity:i})},createUniqueLayer:function(e,t){for(var r=e.title,n=t.field,i=[],a=t.settings,o=e.isVisible,s=e.opacity,l=t.vectorType,u=0;u0?{fillColor:"#ffffff"}:s[0].style;var u=n.default.Util.extend(new o.ThemeStyle,r);u.fontWeight="bold",u.fontSize="14px",u.labelRect=!0,u.strokeColor=u.fillColor,u.fontColor=t.labelColor,t.labelFont&&(u.fontFamily=t.labelFont);var c=new v.LabelThemeLayer(i,{visibility:l,opacity:.7});return this.registerThemeEvent(c),c.style=u,c.themeField=a,c.styleGroups=[],c},createHeatLayer:function(e,t){for(var r=t.colors||["blue","cyan","lime","yellow","red"],i={},a=void 0,o=0,s=r.length,l=1;o0&&o.push(n[s]);else for(var c=0,p=(n=a.parseFeatureFromJson(r.content)).length;c0&&o.push(n[c]);var h=e.prjCoordSys&&e.prjCoordSys.epsgCode;u?a.changeFeatureLayerEpsgCode(h,"4326",t,o,function(e){k(e)}):k(o)},function(){});else{for(var _=[],P=e.features,O=0,w=P.length;O0){var T=M.geometry.points[0].x,C=M.geometry.points[0].y,x=new o.GeometryPoint(T,C),E=new o.GeometryVector(x,M.attributes,M.style);_.push(E)}}k(_)}}else if(s){var L=e.datasourceName;f=(h=(p=e.subLayers&&JSON.parse(e.subLayers)).length&&p.length>0?p[0]:p)&&h.name,this.getFeaturesBySQL(e.url,L,f,m.filter,o.DataFormat.ISERVER,function(n){var i,a,s=n.result,l=[];if(s&&s.features){for(var c=0,p=(i=s.features).length;c0?p[0]:p)&&h.name;var A=e.prjCoordSys&&e.prjCoordSys.epsgCode;this.getFeaturesBySQL(d,y,f,g,o.DataFormat.ISERVER,function(e){u?a.changeFeatureLayerEpsgCode(A,"4326",t,e,function(e){k(e)}):k(e)})}}function k(r){if(t&&t.labelLayer instanceof v.LabelThemeLayer&&a.addFeature2LabelLayer(t.labelLayer,r,e),n.default.HeatLayer&&t instanceof n.default.HeatLayer){for(var i=[],s=0,l=r.length;s0){for(a=0,o=n.length;a==/g,">=").replace(/<==/g,"<="))+")":" * where (1==1||1>=0)"},getAttributesObjFromTable:function(e,t){if(0!==e.length&&0!==t.length){for(var r=[],n=0;n-1?(r=(e=JSON.parse(e)).needTransform,t=e.isAddFile):"needTransform"===e?(r=!0,t=!1):t="true"===e,{isAddFile:t,needTransform:r}},registerThemeEvent:function(e){var t=this;e.on("click",function(r){if(e.map){t.selectedFeature&&(t.fire("featureunselected",{feature:t.selectedFeature}),t.selectedFeature=null);var n=void 0;r.target&&r.target.refDataID&&(n=e.getFeatureById(r.target.refDataID)),n&&(t.selectedFeature=n,t.fire("featureselected",{feature:n}))}}),e.on("mousemove",function(r){if(e.map&&r.target&&r.target.refDataID){var n=void 0;r.target&&r.target.refDataID&&(n=e.getFeatureById(r.target.refDataID)),n&&t.fire("featuremousemove",{feature:n})}})},SERVER_TYPE_MAP:{"EPSG:4326":"WGS84","EPSG:3857":"MERCATOR","EPSG:900913":"MERCATOR","EPSG:102113":"MERCATOR","EPSG:910101":"GCJ02","EPSG:910111":"GCJ02MERCATOR","EPSG:910102":"BD","EPSG:910112":"BDMERCATOR"}}),w=t.webMap=function(e,t){return new O(e,t)};n.default.supermap.webmap=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.imageMapLayer=t.ImageMapLayer=void 0;var n=r(2),i=s(n);r(3);var a=r(5),o=s(r(12));function s(e){return e&&e.__esModule?e:{default:e}} -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/var l=t.ImageMapLayer=n.Layer.extend({options:{layersID:null,redirect:!1,transparent:!0,cacheEnabled:!0,clipRegionEnabled:!1,clipRegion:null,prjCoordSys:null,overlapDisplayed:!1,overlapDisplayedOptions:null,opacity:1,alt:"",pane:"tilePane",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",serverType:a.ServerType.ISERVER,attribution:o.default.Common.attribution,updateInterval:150,tileProxy:null,format:"png"},initialize:function(e,t){this._url=e,n.Util.setOptions(this,t)},onAdd:function(e){this.update=n.Util.throttle(this.update,this.options.updateInterval,this),e.on("moveend",this.update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?e.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this.update()},onRemove:function(){this._currentImage&&this._map.removeLayer(this._currentImage),this._map.off("moveend",this.update,this)},bringToFront:function(){return this.options.position="front",this._currentImage&&this._currentImage.bringToFront(),this},bringToBack:function(){return this.options.position="back",this._currentImage&&this._currentImage.bringToBack(),this},getOpacity:function(){return this.options.opacity},setOpacity:function(e){return this.options.opacity=e,this._currentImage&&this._currentImage.setOpacity(e),this},getImageUrl:function(e){var t=n.Util.getParamString(e)+this._initLayerUrl();return t=this._url+"/image."+this.options.format+t,t=this._appendCredential(t),this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),this.options.cacheEnabled||(t+="&_t="+(new Date).getTime()),t},_getImageParams:function(){var e=this._calculateImageSize();return{viewBounds:this._compriseBounds(this._calculateBounds()),width:e.x,height:e.y}},_initLayerUrl:function(){var e="&";return e+=encodeURI(this._initAllRequestParams().join("&"))},_initAllRequestParams:function(){var e=this.options||{},t=[],r=!0===e.redirect&&e.redirect;t.push("redirect="+r);var n=!0===e.transparent&&e.transparent;t.push("transparent="+n);var o=!1!==e.cacheEnabled||e.cacheEnabled;return t.push("cacheEnabled="+o),e.prjCoordSys&&t.push("prjCoordSys="+JSON.stringify(e.prjCoordSys)),e.layersID&&t.push("layersID="+e.layersID),e.rasterfunction&&t.push("rasterfunction="+JSON.stringify(e.rasterfunction)),e.clipRegionEnabled&&e.clipRegion instanceof i.default.Path&&(e.clipRegion=i.default.Util.toSuperMapGeometry(e.clipRegion.toGeoJSON()),e.clipRegion=a.CommonUtil.toJSON(a.ServerGeometry.fromGeometry(e.clipRegion)),t.push("clipRegionEnabled="+e.clipRegionEnabled),t.push("clipRegion="+JSON.stringify(e.clipRegion))),!1===e.overlapDisplayed?(t.push("overlapDisplayed=false"),e.overlapDisplayedOptions&&t.push("overlapDisplayedOptions="+this.overlapDisplayedOptions.toString())):t.push("overlapDisplayed=true"),t},_requestImage:function(e,t){var r=this.getImageUrl(e);this._loadImage(r,t)},_loadImage:function(e,t){if(this._map){var r=new n.ImageOverlay(e,t,{opacity:0,alt:this.options.alt,zIndex:this.options.zIndex,className:this.options.className,errorOverlayUrl:this.options.error,crossOrigin:this.options.crossOrigin,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),i=function e(n){r.off("error",e,this);var i=this._map;if(i){var a=n.target,o=this._currentImage;a._bounds&&a._bounds.equals(t)&&a._bounds.equals(i.getBounds())?(this._currentImage=a,"front"===this.options.position&&this.bringToFront(),"back"===this.options.position&&this.bringToBack(),this._currentImage._map&&this._currentImage.setOpacity(this.options.opacity),o&&i.removeLayer(o),o&&o._map&&o._map.removeLayer(o)):i.removeLayer(a),this.fire("load",{bounds:t})}};r.once("load",i,this),r.once("error",function(){this._map.removeLayer(r),this.fire("error"),r.off("load",i,this)},this),this.fire("loading",{bounds:t})}},update:function(){if(this._map){var e=this._map.getZoom(),t=this._map.getBounds();if(e>this._map.options.maxZoom||e0||o1&&void 0!==arguments[1]?arguments[1]:a.default.CRS.EPSG4326,r=arguments[2],n=null,i=null;if(-1===["FeatureCollection","Feature","Geometry"].indexOf(e.type))if(e.toGeoJSON)e=e.toGeoJSON();else if(e instanceof a.default.LatLngBounds)e=a.default.rectangle(e).toGeoJSON();else{if(!(e instanceof a.default.Bounds))throw new Error("This tool only supports data conversion in geojson format or Vector Layers of Leaflet.");e=a.default.rectangle([[e.getTopLeft().x,e.getTopLeft().y],[e.getBottomRight().x,e.getBottomRight().y]]).toGeoJSON()}var s={point:function(e){return i(e)},multipoint:function(e){return s.linestring.apply(this,[e])},linestring:function(e){for(var t=[],r=null,n=0,i=e.length;n"+r+"",e}}); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/a.default.Map.mergeOptions({logoControl:!0}),a.default.Map.addInitHook(function(){!this._logoAdded&&this.options.logoControl&&(!0===this.options.logoControl?this.logoControl=new s:this.options.logoControl instanceof a.default.Control&&(this.logoControl=this.options.logoControl),this.logoControl&&(this.addControl(this.logoControl),this._logoAdded=!0))});var l=t.logo=function(e){return new s(e)};a.default.supermap.control.logo=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=v,t.forward=m,t.inverse=g;var n,i=r(6),a=r(8),o=(n=a)&&n.__esModule?n:{default:n};var s=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],l=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],u=.8487,c=1.3523,p=i.R2D/5,h=1/p,f=18,d=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},y=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};function v(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function m(e){var t=(0,o.default)(e.x-this.long0),r=Math.abs(e.y),n=Math.floor(r*p);n<0?n=0:n>=f&&(n=f-1),r=i.R2D*(r-h*n);var a={x:d(s[n],r)*t,y:d(l[n],r)};return e.y<0&&(a.y=-a.y),a.x=a.x*this.a*u+this.x0,a.y=a.y*this.a*c+this.y0,a}function g(e){var t={x:(e.x-this.x0)/(this.a*u),y:Math.abs(e.y-this.y0)/(this.a*c)};if(t.y>=1)t.x/=s[f][0],t.y=e.y<0?-i.HALF_PI:i.HALF_PI;else{var r=Math.floor(t.y*f);for(r<0?r=0:r>=f&&(r=f-1);;)if(l[r][0]>t.y)--r;else{if(!(l[r+1][0]<=t.y))break;++r}var n=l[r],a=5*(t.y-n[0])/(l[r+1][0]-n[0]);a=function(e,t,r,n){for(var i=t;n;--n){var a=e(i);if(i-=a,Math.abs(a)=n.HALF_PI-n.FORTPI/2?this.face=i.TOP:this.lat0<=-(n.HALF_PI-n.FORTPI/2)?this.face=i.BOTTOM:Math.abs(this.long0)<=n.FORTPI?this.face=i.FRONT:Math.abs(this.long0)<=n.HALF_PI+n.FORTPI?this.face=this.long0>0?i.RIGHT:i.LEFT:this.face=i.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function s(e){var t,r,o,s,l,p,h={x:0,y:0},f={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,this.face===i.TOP)s=n.HALF_PI-t,r>=n.FORTPI&&r<=n.HALF_PI+n.FORTPI?(f.value=a.AREA_0,o=r-n.HALF_PI):r>n.HALF_PI+n.FORTPI||r<=-(n.HALF_PI+n.FORTPI)?(f.value=a.AREA_1,o=r>0?r-n.SPI:r+n.SPI):r>-(n.HALF_PI+n.FORTPI)&&r<=-n.FORTPI?(f.value=a.AREA_2,o=r+n.HALF_PI):(f.value=a.AREA_3,o=r);else if(this.face===i.BOTTOM)s=n.HALF_PI+t,r>=n.FORTPI&&r<=n.HALF_PI+n.FORTPI?(f.value=a.AREA_0,o=-r+n.HALF_PI):r=-n.FORTPI?(f.value=a.AREA_1,o=-r):r<-n.FORTPI&&r>=-(n.HALF_PI+n.FORTPI)?(f.value=a.AREA_2,o=-r-n.HALF_PI):(f.value=a.AREA_3,o=r>0?-r+n.SPI:-r-n.SPI);else{var d,y,v,m,g,b;this.face===i.RIGHT?r=c(r,+n.HALF_PI):this.face===i.BACK?r=c(r,+n.SPI):this.face===i.LEFT&&(r=c(r,-n.HALF_PI)),m=Math.sin(t),g=Math.cos(t),b=Math.sin(r),d=g*Math.cos(r),y=g*b,v=m,this.face===i.FRONT?o=u(s=Math.acos(d),v,y,f):this.face===i.RIGHT?o=u(s=Math.acos(y),v,-d,f):this.face===i.BACK?o=u(s=Math.acos(-d),v,-y,f):this.face===i.LEFT?o=u(s=Math.acos(-y),v,d,f):(s=o=0,f.value=a.AREA_0)}return p=Math.atan(12/n.SPI*(o+Math.acos(Math.sin(o)*Math.cos(n.FORTPI))-n.HALF_PI)),l=Math.sqrt((1-Math.cos(s))/(Math.cos(p)*Math.cos(p))/(1-Math.cos(Math.atan(1/Math.cos(o))))),f.value===a.AREA_1?p+=n.HALF_PI:f.value===a.AREA_2?p+=n.SPI:f.value===a.AREA_3&&(p+=1.5*n.SPI),h.x=l*Math.cos(p),h.y=l*Math.sin(p),h.x=h.x*this.a+this.x0,h.y=h.y*this.a+this.y0,e.x=h.x,e.y=h.y,e}function l(e){var t,r,o,s,l,u,p,h,f,d,y,v,m={lam:0,phi:0},g={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?g.value=a.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(g.value=a.AREA_1,t-=n.HALF_PI):e.x<0&&-e.x>=Math.abs(e.y)?(g.value=a.AREA_2,t=t<0?t+n.SPI:t-n.SPI):(g.value=a.AREA_3,t+=n.HALF_PI),f=n.SPI/12*Math.tan(t),l=Math.sin(f)/(Math.cos(f)-1/Math.sqrt(2)),u=Math.atan(l),(p=1-(o=Math.cos(t))*o*(s=Math.tan(r))*s*(1-Math.cos(Math.atan(1/Math.cos(u)))))<-1?p=-1:p>1&&(p=1),this.face===i.TOP)h=Math.acos(p),m.phi=n.HALF_PI-h,g.value===a.AREA_0?m.lam=u+n.HALF_PI:g.value===a.AREA_1?m.lam=u<0?u+n.SPI:u-n.SPI:g.value===a.AREA_2?m.lam=u-n.HALF_PI:m.lam=u;else if(this.face===i.BOTTOM)h=Math.acos(p),m.phi=h-n.HALF_PI,g.value===a.AREA_0?m.lam=-u+n.HALF_PI:g.value===a.AREA_1?m.lam=-u:g.value===a.AREA_2?m.lam=-u-n.HALF_PI:m.lam=u<0?-u-n.SPI:-u+n.SPI;else{var b,S,_;f=(b=p)*b,S=(f+=(_=f>=1?0:Math.sqrt(1-f)*Math.sin(u))*_)>=1?0:Math.sqrt(1-f),g.value===a.AREA_1?(f=S,S=-_,_=f):g.value===a.AREA_2?(S=-S,_=-_):g.value===a.AREA_3&&(f=S,S=_,_=-f),this.face===i.RIGHT?(f=b,b=-S,S=f):this.face===i.BACK?(b=-b,S=-S):this.face===i.LEFT&&(f=b,b=S,S=-f),m.phi=Math.acos(-_)-n.HALF_PI,m.lam=Math.atan2(S,b),this.face===i.RIGHT?m.lam=c(m.lam,-n.HALF_PI):this.face===i.BACK?m.lam=c(m.lam,-n.SPI):this.face===i.LEFT&&(m.lam=c(m.lam,+n.HALF_PI))}0!==this.es&&(d=m.phi<0?1:0,y=Math.tan(m.phi),v=this.b/Math.sqrt(y*y+this.one_minus_f_squared),m.phi=Math.atan(Math.sqrt(this.a*this.a-v*v)/(this.one_minus_f*v)),d&&(m.phi=-m.phi));return m.lam+=this.long0,e.x=m.lam,e.y=m.phi,e}function u(e,t,r,i){var o;return en.FORTPI&&o<=n.HALF_PI+n.FORTPI?(i.value=a.AREA_1,o-=n.HALF_PI):o>n.HALF_PI+n.FORTPI||o<=-(n.HALF_PI+n.FORTPI)?(i.value=a.AREA_2,o=o>=0?o-n.SPI:o+n.SPI):(i.value=a.AREA_3,o+=n.HALF_PI)),o}function c(e,t){var r=e+t;return r<-n.SPI?r+=n.TWO_PI:r>+n.SPI&&(r-=n.TWO_PI),r}var p=t.names=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];t.default={init:o,forward:s,inverse:l,names:p}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=s,t.forward=l,t.inverse=u;var n=o(r(8)),i=o(r(45)),a=r(6);function o(e){return e&&e.__esModule?e:{default:e}}function s(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function l(e){var t,r,i,o,s,l,u,c=e.x,p=e.y;return i=(0,n.default)(c-this.long0),t=Math.sin(p),r=Math.cos(p),o=Math.cos(i),1,((s=this.sin_p14*t+this.cos_p14*r*o)>0||Math.abs(s)<=a.EPSLN)&&(l=1*this.a*r*Math.sin(i),u=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*o)),e.x=l,e.y=u,e}function u(e){var t,r,o,s,l,u,c;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=(0,i.default)(t/this.a),o=Math.sin(r),s=Math.cos(r),u=this.long0,Math.abs(t)<=a.EPSLN?(c=this.lat0,e.x=u,e.y=c,e):(c=(0,i.default)(s*this.sin_p14+e.y*o*this.cos_p14/t),l=Math.abs(this.lat0)-a.HALF_PI,Math.abs(l)<=a.EPSLN?(u=this.lat0>=0?(0,n.default)(this.long0+Math.atan2(e.x,-e.y)):(0,n.default)(this.long0-Math.atan2(-e.x,e.y)),e.x=u,e.y=c,e):(u=(0,n.default)(this.long0+Math.atan2(e.x*o,t*this.cos_p14*s-e.y*this.sin_p14*o)),e.x=u,e.y=c,e))}var c=t.names=["ortho"];t.default={init:s,forward:l,inverse:u,names:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=d,t.forward=y,t.inverse=v;var n=f(r(8)),i=r(6),a=f(r(70)),o=f(r(69)),s=f(r(68)),l=f(r(67)),u=f(r(66)),c=f(r(108)),p=f(r(45)),h=f(r(107));function f(e){return e&&e.__esModule?e:{default:e}}function d(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function y(e){var t,r,p,h,f,d,y,v,m,g,b,S,_,P,O,w,M,T,C,x,E,L,A=e.x,k=e.y,j=Math.sin(e.y),F=Math.cos(e.y),I=(0,n.default)(A-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=i.EPSLN?(e.x=this.x0+this.a*(i.HALF_PI-k)*Math.sin(I),e.y=this.y0-this.a*(i.HALF_PI-k)*Math.cos(I),e):Math.abs(this.sin_p12+1)<=i.EPSLN?(e.x=this.x0+this.a*(i.HALF_PI+k)*Math.sin(I),e.y=this.y0+this.a*(i.HALF_PI+k)*Math.cos(I),e):(T=this.sin_p12*j+this.cos_p12*F*Math.cos(I),M=(w=Math.acos(T))/Math.sin(w),e.x=this.x0+this.a*M*F*Math.sin(I),e.y=this.y0+this.a*M*(this.cos_p12*j-this.sin_p12*F*Math.cos(I)),e):(t=(0,o.default)(this.es),r=(0,s.default)(this.es),p=(0,l.default)(this.es),h=(0,u.default)(this.es),Math.abs(this.sin_p12-1)<=i.EPSLN?(f=this.a*(0,a.default)(t,r,p,h,i.HALF_PI),d=this.a*(0,a.default)(t,r,p,h,k),e.x=this.x0+(f-d)*Math.sin(I),e.y=this.y0-(f-d)*Math.cos(I),e):Math.abs(this.sin_p12+1)<=i.EPSLN?(f=this.a*(0,a.default)(t,r,p,h,i.HALF_PI),d=this.a*(0,a.default)(t,r,p,h,k),e.x=this.x0+(f+d)*Math.sin(I),e.y=this.y0+(f+d)*Math.cos(I),e):(y=j/F,v=(0,c.default)(this.a,this.e,this.sin_p12),m=(0,c.default)(this.a,this.e,j),g=Math.atan((1-this.es)*y+this.es*v*this.sin_p12/(m*F)),C=0===(b=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(g)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(g)-this.sin_p12*Math.cos(g)):Math.abs(Math.abs(b)-Math.PI)<=i.EPSLN?-Math.asin(this.cos_p12*Math.sin(g)-this.sin_p12*Math.cos(g)):Math.asin(Math.sin(I)*Math.cos(g)/Math.sin(b)),S=this.e*this.sin_p12/Math.sqrt(1-this.es),w=v*C*(1-(x=C*C)*(O=(_=this.e*this.cos_p12*Math.cos(b)/Math.sqrt(1-this.es))*_)*(1-O)/6+(E=x*C)/8*(P=S*_)*(1-2*O)+(L=E*C)/120*(O*(4-7*O)-3*S*S*(1-7*O))-L*C/48*P),e.x=this.x0+w*Math.sin(b),e.y=this.y0+w*Math.cos(b),e))}function v(e){var t,r,f,d,y,v,m,g,b,S,_,P,O,w,M,T,C,x,E,L,A,k,j;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*i.HALF_PI*this.a)return;return r=t/this.a,f=Math.sin(r),d=Math.cos(r),y=this.long0,Math.abs(t)<=i.EPSLN?v=this.lat0:(v=(0,p.default)(d*this.sin_p12+e.y*f*this.cos_p12/t),m=Math.abs(this.lat0)-i.HALF_PI,y=Math.abs(m)<=i.EPSLN?this.lat0>=0?(0,n.default)(this.long0+Math.atan2(e.x,-e.y)):(0,n.default)(this.long0-Math.atan2(-e.x,e.y)):(0,n.default)(this.long0+Math.atan2(e.x*f,t*this.cos_p12*d-e.y*this.sin_p12*f))),e.x=y,e.y=v,e}return g=(0,o.default)(this.es),b=(0,s.default)(this.es),S=(0,l.default)(this.es),_=(0,u.default)(this.es),Math.abs(this.sin_p12-1)<=i.EPSLN?(O=(P=this.a*(0,a.default)(g,b,S,_,i.HALF_PI))-(t=Math.sqrt(e.x*e.x+e.y*e.y)),v=(0,h.default)(O/this.a,g,b,S,_),y=(0,n.default)(this.long0+Math.atan2(e.x,-1*e.y)),e.x=y,e.y=v,e):Math.abs(this.sin_p12+1)<=i.EPSLN?(P=this.a*(0,a.default)(g,b,S,_,i.HALF_PI),O=(t=Math.sqrt(e.x*e.x+e.y*e.y))-P,v=(0,h.default)(O/this.a,g,b,S,_),y=(0,n.default)(this.long0+Math.atan2(e.x,e.y)),e.x=y,e.y=v,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),T=Math.atan2(e.x,e.y),w=(0,c.default)(this.a,this.e,this.sin_p12),C=Math.cos(T),E=-(x=this.e*this.cos_p12*C)*x/(1-this.es),L=3*this.es*(1-E)*this.sin_p12*this.cos_p12*C/(1-this.es),j=1-E*(k=(A=t/w)-E*(1+E)*Math.pow(A,3)/6-L*(1+3*E)*Math.pow(A,4)/24)*k/2-A*k*k*k/6,M=Math.asin(this.sin_p12*Math.cos(k)+this.cos_p12*Math.sin(k)*C),y=(0,n.default)(this.long0+Math.asin(Math.sin(T)*Math.sin(k)/Math.cos(M))),v=Math.atan((1-this.es*j*this.sin_p12/Math.sin(M))*Math.tan(M)/(1-this.es)),e.x=y,e.y=v,e)}var m=t.names=["Azimuthal_Equidistant","aeqd"];t.default={init:d,forward:y,inverse:v,names:m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=s,t.forward=l,t.inverse=u;var n=o(r(8)),i=r(6),a=o(r(45));function o(e){return e&&e.__esModule?e:{default:e}}function s(){this.R=this.a}function l(e){var t,r,o=e.x,s=e.y,l=(0,n.default)(o-this.long0);Math.abs(s)<=i.EPSLN&&(t=this.x0+this.R*l,r=this.y0);var u=(0,a.default)(2*Math.abs(s/Math.PI));(Math.abs(l)<=i.EPSLN||Math.abs(Math.abs(s)-i.HALF_PI)<=i.EPSLN)&&(t=this.x0,r=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*u):this.y0+Math.PI*this.R*-Math.tan(.5*u));var c=.5*Math.abs(Math.PI/l-l/Math.PI),p=c*c,h=Math.sin(u),f=Math.cos(u),d=f/(h+f-1),y=d*d,v=d*(2/h-1),m=v*v,g=Math.PI*this.R*(c*(d-m)+Math.sqrt(p*(d-m)*(d-m)-(m+p)*(y-m)))/(m+p);l<0&&(g=-g),t=this.x0+g;var b=p+d;return g=Math.PI*this.R*(v*b-c*Math.sqrt((m+p)*(p+1)-b*b))/(m+p),r=s>=0?this.y0+g:this.y0-g,e.x=t,e.y=r,e}function u(e){var t,r,a,o,s,l,u,c,p,h,f,d;return e.x-=this.x0,e.y-=this.y0,f=Math.PI*this.R,s=(a=e.x/f)*a+(o=e.y/f)*o,f=3*(o*o/(c=-2*(l=-Math.abs(o)*(1+s))+1+2*o*o+s*s)+(2*(u=l-2*o*o+a*a)*u*u/c/c/c-9*l*u/c/c)/27)/(p=(l-u*u/3/c)/c)/(h=2*Math.sqrt(-p/3)),Math.abs(f)>1&&(f=f>=0?1:-1),d=Math.acos(f)/3,r=e.y>=0?(-h*Math.cos(d+Math.PI/3)-u/3/c)*Math.PI:-(-h*Math.cos(d+Math.PI/3)-u/3/c)*Math.PI,t=Math.abs(a)=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;if(0!==r&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere)return i=(0,u.default)(this.long0+a/this.ns),n=(0,c.default)(this.g-r/this.a),e.x=i,e.y=n,e;var o=this.g-r/this.a;return n=(0,p.default)(o,this.e0,this.e1,this.e2,this.e3),i=(0,u.default)(this.long0+a/this.ns),e.x=i,e.y=n,e}var m=t.names=["Equidistant_Conic","eqdc"];t.default={init:d,forward:y,inverse:v,names:m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=s,t.forward=l,t.inverse=u;var n,i=r(8),a=(n=i)&&n.__esModule?n:{default:n},o=r(6);function s(){}function l(e){for(var t=e.x,r=e.y,n=(0,a.default)(t-this.long0),i=r,s=Math.PI*Math.sin(r);;){var l=-(i+Math.sin(i)-s)/(1+Math.cos(i));if(i+=l,Math.abs(l).999999999999&&(r=.999999999999),t=Math.asin(r);var n=(0,a.default)(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=n,e.y=i,e}var c=t.names=["Mollweide","moll"];t.default={init:s,forward:l,inverse:u,names:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=h,t.forward=f,t.inverse=d;var n=c(r(8)),i=c(r(55)),a=c(r(184)),o=c(r(109)),s=c(r(183)),l=r(6),u=c(r(45));function c(e){return e&&e.__esModule?e:{default:e}}var p=20;function h(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=(0,a.default)(this.es)}function f(e){var t,r,i=e.x,a=e.y;if(i=(0,n.default)(i-this.long0),this.sphere){if(this.m)for(var s=this.n*Math.sin(a),u=p;u;--u){var c=(this.m*a+Math.sin(a)-s)/(this.m+Math.cos(a));if(a-=c,Math.abs(c)0||Math.abs(s)<=a.EPSLN?(l=this.x0+1*this.a*r*Math.sin(i)/s,u=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*o)/s):(l=this.x0+this.infinity_dist*r*Math.sin(i),u=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*o)),e.x=l,e.y=u,e}function u(e){var t,r,a,o,s,l;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(o=Math.atan2(t,this.rc),r=Math.sin(o),a=Math.cos(o),l=(0,i.default)(a*this.sin_p14+e.y*r*this.cos_p14/t),s=Math.atan2(e.x*r,t*this.cos_p14*a-e.y*this.sin_p14*r),s=(0,n.default)(this.long0+s)):(l=this.phic0,s=0),e.x=s,e.y=l,e}var c=t.names=["gnom"];t.default={init:s,forward:l,inverse:u,names:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=u,t.forward=c,t.inverse=p,t.phi1z=h;var n=l(r(46)),i=l(r(106)),a=l(r(8)),o=l(r(45)),s=r(6);function l(e){return e&&e.__esModule?e:{default:e}}function u(){Math.abs(this.lat1+this.lat2)s.EPSLN?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function c(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=(0,i.default)(this.e3,this.sin_phi,this.cos_phi),o=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*(0,a.default)(t-this.long0),l=o*Math.sin(s)+this.x0,u=this.rh-o*Math.cos(s)+this.y0;return e.x=l,e.y=u,e}function p(e){var t,r,n,i,o,s;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),i=0,0!==t&&(i=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?s=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,s=this.phi1z(this.e3,r)),o=(0,a.default)(i/this.ns0+this.long0),e.x=o,e.y=s,e}function h(e,t){var r,n,i,a,l,u=(0,o.default)(.5*t);if(e0)switch(this.qp=(0,i.default)(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=e*d,t=e*e,r[0]+=t*y,r[1]=t*m,t*=e,r[0]+=t*v,r[1]+=t*g,r[2]=t*b,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=(0,i.default)(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function h(e){var t,r,o,s,l,u,c,p,h,f,d=e.x,y=e.y;if(d=(0,a.default)(d-this.long0),this.sphere){if(l=Math.sin(y),f=Math.cos(y),o=Math.cos(d),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+f*o:1+this.sinph0*l+this.cosph0*f*o)<=n.EPSLN)return null;t=(r=Math.sqrt(2/r))*f*Math.sin(d),r*=this.mode===this.EQUIT?l:this.cosph0*l-this.sinph0*f*o}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(o=-o),Math.abs(y+this.phi0)=0?(t=(h=Math.sqrt(u))*s,r=o*(this.mode===this.S_POLE?h:-h)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function f(e){e.x-=this.x0,e.y-=this.y0;var t,r,i,o,s,l,u,c,p,h,f=e.x/this.a,d=e.y/this.a;if(this.sphere){var y,v=0,m=0;if((r=.5*(y=Math.sqrt(f*f+d*d)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(r),v=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(y)<=n.EPSLN?0:Math.asin(d*m/y),f*=m,d=v*y;break;case this.OBLIQ:r=Math.abs(y)<=n.EPSLN?this.phi0:Math.asin(v*this.sinph0+d*m*this.cosph0/y),f*=m*this.cosph0,d=(v-Math.sin(r)*this.sinph0)*y;break;case this.N_POLE:d=-d,r=n.HALF_PI-r;break;case this.S_POLE:r-=n.HALF_PI}t=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,d):0}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,d*=this.dd,(l=Math.sqrt(f*f+d*d))=15?null:e}var u=t.names=["Krovak","krovak"];t.default={init:o,forward:s,inverse:l,names:u}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=c,t.forward=p,t.inverse=h;var n=u(r(46)),i=u(r(72)),a=u(r(56)),o=u(r(8)),s=u(r(71)),l=r(6);function u(e){return e&&e.__esModule?e:{default:e}}function c(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)l.EPSLN?this.ns=Math.log(a/c)/Math.log(o/p):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=a/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function p(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=l.EPSLN&&(r=(0,a.default)(r)*(l.HALF_PI-2*l.EPSLN));var n,s,u=Math.abs(Math.abs(r)-l.HALF_PI);if(u>l.EPSLN)n=(0,i.default)(this.e,r,Math.sin(r)),s=this.a*this.f0*Math.pow(n,this.ns);else{if((u=r*this.ns)<=0)return null;s=0}var c=this.ns*(0,o.default)(t-this.long0);return e.x=this.k0*(s*Math.sin(c))+this.x0,e.y=this.k0*(this.rh-s*Math.cos(c))+this.y0,e}function h(e){var t,r,n,i,a,u=(e.x-this.x0)/this.k0,c=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(u*u+c*c),r=1):(t=-Math.sqrt(u*u+c*c),r=-1);var p=0;if(0!==t&&(p=Math.atan2(r*u,r*c)),0!==t||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),-9999===(i=(0,s.default)(this.e,n)))return null}else i=-l.HALF_PI;return a=(0,o.default)(p/this.ns+this.long0),e.x=a,e.y=i,e}var f=t.names=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"];t.default={init:c,forward:p,inverse:h,names:f}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=l,t.forward=u,t.inverse=c;var n=s(r(72)),i=s(r(8)),a=s(r(71)),o=r(6);function s(e){return e&&e.__esModule?e:{default:e}}function l(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var e=Math.sin(this.lat0),t=Math.cos(this.lat0),r=this.e*e;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(t,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-r*r);var a,o,s=(0,n.default)(this.e,this.lat0,e),l=this.bl/t*Math.sqrt((1-this.es)/(1-r*r));if(l*l<1&&(l=1),isNaN(this.longc)){var u=(0,n.default)(this.e,this.lat1,Math.sin(this.lat1)),c=(0,n.default)(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(l+Math.sqrt(l*l-1))*Math.pow(s,this.bl):this.el=(l-Math.sqrt(l*l-1))*Math.pow(s,this.bl);var p=Math.pow(u,this.bl),h=Math.pow(c,this.bl);o=.5*((a=this.el/p)-1/a);var f=(this.el*this.el-h*p)/(this.el*this.el+h*p),d=(h-p)/(h+p),y=(0,i.default)(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(f*Math.tan(.5*this.bl*y)/d)/this.bl,this.long0=(0,i.default)(this.long0);var v=(0,i.default)(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*v)/o),this.alpha=Math.asin(l*Math.sin(this.gamma0))}else a=this.lat0>=0?l+Math.sqrt(l*l-1):l-Math.sqrt(l*l-1),this.el=a*Math.pow(s,this.bl),o=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/l),this.long0=this.longc-Math.asin(o*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(l*l-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(l*l-1),Math.cos(this.alpha))}function u(e){var t,r,a,s=e.x,l=e.y,u=(0,i.default)(s-this.long0);if(Math.abs(Math.abs(l)-o.HALF_PI)<=o.EPSLN)a=l>0?-1:1,r=this.al/this.bl*Math.log(Math.tan(o.FORTPI+a*this.gamma0*.5)),t=-1*a*o.HALF_PI*this.al/this.bl;else{var c=(0,n.default)(this.e,l,Math.sin(l)),p=this.el/Math.pow(c,this.bl),h=.5*(p-1/p),f=.5*(p+1/p),d=Math.sin(this.bl*u),y=(h*Math.sin(this.gamma0)-d*Math.cos(this.gamma0))/f;r=Math.abs(Math.abs(y)-1)<=o.EPSLN?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-y)/(1+y))/this.bl,t=Math.abs(Math.cos(this.bl*u))<=o.EPSLN?this.al*this.bl*u:this.al*Math.atan2(h*Math.cos(this.gamma0)+d*Math.sin(this.gamma0),Math.cos(this.bl*u))/this.bl}return this.no_rot?(e.x=this.x0+t,e.y=this.y0+r):(t-=this.uc,e.x=this.x0+r*Math.cos(this.alpha)+t*Math.sin(this.alpha),e.y=this.y0+t*Math.cos(this.alpha)-r*Math.sin(this.alpha)),e}function c(e){var t,r;this.no_rot?(r=e.y-this.y0,t=e.x-this.x0):(r=(e.x-this.x0)*Math.cos(this.alpha)-(e.y-this.y0)*Math.sin(this.alpha),t=(e.y-this.y0)*Math.cos(this.alpha)+(e.x-this.x0)*Math.sin(this.alpha),t+=this.uc);var n=Math.exp(-1*this.bl*r/this.al),s=.5*(n-1/n),l=.5*(n+1/n),u=Math.sin(this.bl*t/this.al),c=(u*Math.cos(this.gamma0)+s*Math.sin(this.gamma0))/l,p=Math.pow(this.el/Math.sqrt((1+c)/(1-c)),1/this.bl);return Math.abs(c-1)1e-7;){if(++p>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=u,e}Object.defineProperty(t,"__esModule",{value:!0}),t.init=n,t.forward=i,t.inverse=a;var o=t.names=["somerc"];t.default={init:n,forward:i,inverse:a,names:o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.ssfn_=c,t.init=p,t.forward=h,t.inverse=f;var n=r(6),i=u(r(56)),a=u(r(46)),o=u(r(72)),s=u(r(71)),l=u(r(8));function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r){return t*=r,Math.tan(.5*(n.HALF_PI+e))*Math.pow((1-t)/(1+t),.5*r)}function p(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=n.EPSLN&&(this.k0=.5*(1+(0,i.default)(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=n.EPSLN&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=n.EPSLN&&(this.k0=.5*this.cons*(0,a.default)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/(0,o.default)(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=(0,a.default)(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n.HALF_PI,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function h(e){var t,r,i,a,s,u,c=e.x,p=e.y,h=Math.sin(p),f=Math.cos(p),d=(0,l.default)(c-this.long0);return Math.abs(Math.abs(c-this.long0)-Math.PI)<=n.EPSLN&&Math.abs(p+this.lat0)<=n.EPSLN?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*h+this.coslat0*f*Math.cos(d)),e.x=this.a*t*f*Math.sin(d)+this.x0,e.y=this.a*t*(this.coslat0*h-this.sinlat0*f*Math.cos(d))+this.y0,e):(r=2*Math.atan(this.ssfn_(p,h,this.e))-n.HALF_PI,a=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=n.EPSLN?(s=(0,o.default)(this.e,p*this.con,this.con*h),u=2*this.a*this.k0*s/this.cons,e.x=this.x0+u*Math.sin(c-this.long0),e.y=this.y0-this.con*u*Math.cos(c-this.long0),e):(Math.abs(this.sinlat0)0?(0,l.default)(this.long0+Math.atan2(e.x,-1*e.y)):(0,l.default)(this.long0+Math.atan2(e.x,e.y)):(0,l.default)(this.long0+Math.atan2(e.x*Math.sin(c),u*this.coslat0*Math.cos(c)-e.y*this.sinlat0*Math.sin(c))),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=n.EPSLN){if(u<=n.EPSLN)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,i=u*this.cons/(2*this.a*this.k0),r=this.con*(0,s.default)(this.e,i),t=this.con*(0,l.default)(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else a=2*Math.atan(u*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,u<=n.EPSLN?o=this.X0:(o=Math.asin(Math.cos(a)*this.sinX0+e.y*Math.sin(a)*this.cosX0/u),t=(0,l.default)(this.long0+Math.atan2(e.x*Math.sin(a),u*this.cosX0*Math.cos(a)-e.y*this.sinX0*Math.sin(a)))),r=-1*(0,s.default)(this.e,Math.tan(.5*(n.HALF_PI+o)));return e.x=t,e.y=r,e}var d=t.names=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];t.default={init:p,forward:h,inverse:f,names:d,ssfn_:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return Math.pow((1-e)/(1+e),t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=l,t.forward=u,t.inverse=c;var n,i=r(426),a=(n=i)&&n.__esModule?n:{default:n},o=r(6);var s=20;function l(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+o.FORTPI)/(Math.pow(Math.tan(.5*this.lat0+o.FORTPI),this.C)*(0,a.default)(this.e*e,this.ratexp))}function u(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+o.FORTPI),this.C)*(0,a.default)(this.e*Math.sin(r),this.ratexp))-o.HALF_PI,e.x=this.C*t,e}function c(e){for(var t=e.x/this.C,r=e.y,n=Math.pow(Math.tan(.5*r+o.FORTPI)/this.K,1/this.C),i=s;i>0&&(r=2*Math.atan(n*(0,a.default)(this.e*Math.sin(e.y),-.5*this.e))-o.HALF_PI,!(Math.abs(r-e.y)<1e-14));--i)e.y=r;return i?(e.x=t,e.y=r,e):null}var p=t.names=["gauss"];t.default={init:l,forward:u,inverse:c,names:p}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=o,t.forward=s,t.inverse=l;var n=a(r(427)),i=a(r(8));function a(e){return e&&e.__esModule?e:{default:e}}function o(){n.default.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function s(e){var t,r,a,o;return e.x=(0,i.default)(e.x-this.long0),n.default.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),a=Math.cos(e.x),o=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*a),e.x=o*r*Math.sin(e.x),e.y=o*(this.cosc0*t-this.sinc0*r*a),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function l(e){var t,r,a,o,s;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,s=Math.sqrt(e.x*e.x+e.y*e.y)){var l=2*Math.atan2(s,this.R2);t=Math.sin(l),r=Math.cos(l),o=Math.asin(r*this.sinc0+e.y*t*this.cosc0/s),a=Math.atan2(e.x*t,s*this.cosc0*r-e.y*this.sinc0*t)}else o=this.phic0,a=0;return e.x=a,e.y=o,n.default.inverse.apply(this,[e]),e.x=(0,i.default)(e.x+this.long0),e}var u=t.names=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];t.default={init:o,forward:s,inverse:l,names:u}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(void 0===e){if((e=Math.floor(30*((0,a.default)(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e};var n,i=r(8),a=(n=i)&&n.__esModule?n:{default:n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=t.dependsOn=void 0,t.init=l;var n=o(r(429)),i=o(r(182)),a=r(6);function o(e){return e&&e.__esModule?e:{default:e}}var s=t.dependsOn="etmerc";function l(){var e=(0,n.default)(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*a.D2R,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,i.default.init.apply(this),this.forward=i.default.forward,this.inverse=i.default.inverse}var u=t.names=["Universal Transverse Mercator System","utm"];t.default={init:l,names:u,dependsOn:s}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=Math.exp(e);return t=(t+1/t)/2}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var a,o,s=Math.sin(t),l=Math.cos(t),u=(0,n.default)(r),c=(0,i.default)(r),p=2*l*c,h=-2*s*u,f=e.length-1,d=e[f],y=0,v=0,m=0;--f>=0;)a=v,o=y,d=p*(v=d)-a-h*(y=m)+e[f],m=h*v-o+p*y;return[(p=s*c)*d-(h=l*u)*m,p*m+h*d]};var n=a(r(181)),i=a(r(431));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var r,n=2*Math.cos(t),i=e.length-1,a=e[i],o=0;--i>=0;)r=n*a-o+e[i],o=a,a=r;return Math.sin(t)*r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var r,n=2*Math.cos(2*t),i=e.length-1,a=e[i],o=0;--i>=0;)r=n*a-o+e[i],o=a,a=r;return t+r*Math.sin(2*t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=Math.abs(e);return t=(0,i.default)(t*(1+t/((0,n.default)(1,t)+1))),e<0?-t:t};var n=a(r(180)),i=a(r(435));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.names=void 0,t.init=c,t.forward=p,t.inverse=h;var n=u(r(184)),i=u(r(109)),a=u(r(183)),o=u(r(8)),s=r(6),l=u(r(56));function u(e){return e&&e.__esModule?e:{default:e}}function c(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=(0,n.default)(this.es),this.ml0=(0,i.default)(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function p(e){var t,r,n,a=e.x,l=e.y,u=(0,o.default)(a-this.long0),c=Math.sin(l),p=Math.cos(l);if(this.es){var h=p*u,f=Math.pow(h,2),d=this.ep2*Math.pow(p,2),y=Math.pow(d,2),v=Math.abs(p)>s.EPSLN?Math.tan(l):0,m=Math.pow(v,2),g=Math.pow(m,2);t=1-this.es*Math.pow(c,2),h/=Math.sqrt(t);var b=(0,i.default)(l,c,p,this.en);r=this.a*(this.k0*h*(1+f/6*(1-m+d+f/20*(5-18*m+g+14*d-58*m*d+f/42*(61+179*g-g*m-479*m)))))+this.x0,n=this.a*(this.k0*(b-this.ml0+c*u*h/2*(1+f/12*(5-m+9*d+4*y+f/30*(61+g-58*m+270*d-330*m*d+f/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var S=p*Math.sin(u);if(Math.abs(Math.abs(S)-1)=1){if(S-1>s.EPSLN)return 93;n=0}else n=Math.acos(n);l<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return e.x=r,e.y=n,e}function h(e){var t,r,n,i,u=(e.x-this.x0)*(1/this.a),c=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+c/this.k0,r=(0,a.default)(t,this.es,this.en),Math.abs(r)s.EPSLN?Math.tan(r):0,d=this.ep2*Math.pow(h,2),y=Math.pow(d,2),v=Math.pow(f,2),m=Math.pow(v,2);t=1-this.es*Math.pow(p,2);var g=u*Math.sqrt(t)/this.k0,b=Math.pow(g,2);n=r-(t*=f)*b/(1-this.es)*.5*(1-b/12*(5+3*v-9*d*v+d-4*y-b/30*(61+90*v-252*d*v+45*m+46*d-b/56*(1385+3633*v+4095*m+1574*m*v)))),i=(0,o.default)(this.long0+g*(1-b/6*(1+2*v+d-b/20*(5+28*v+24*m+8*d*v+6*d-b/42*(61+662*v+1320*m+720*m*v))))/h)}else n=s.HALF_PI*(0,l.default)(c),i=0;else{var S=Math.exp(u/this.k0),_=.5*(S-1/S),P=this.lat0+c/this.k0,O=Math.cos(P);t=Math.sqrt((1-Math.pow(O,2))/(1+Math.pow(_,2))),n=Math.asin(t),c<0&&(n=-n),i=0===_&&0===O?0:(0,o.default)(Math.atan2(_,O)+this.long0)}return e.x=i,e.y=n,e}var f=t.names=["Transverse_Mercator","Transverse Mercator","tmerc"];t.default={init:c,forward:p,inverse:h,names:f}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.Proj.projections.add(n.default),e.Proj.projections.add(i.default),e.Proj.projections.add(a.default),e.Proj.projections.add(o.default),e.Proj.projections.add(s.default),e.Proj.projections.add(l.default),e.Proj.projections.add(u.default),e.Proj.projections.add(c.default),e.Proj.projections.add(p.default),e.Proj.projections.add(h.default),e.Proj.projections.add(f.default),e.Proj.projections.add(d.default),e.Proj.projections.add(y.default),e.Proj.projections.add(v.default),e.Proj.projections.add(m.default),e.Proj.projections.add(g.default),e.Proj.projections.add(b.default),e.Proj.projections.add(S.default),e.Proj.projections.add(_.default),e.Proj.projections.add(P.default),e.Proj.projections.add(O.default),e.Proj.projections.add(w.default),e.Proj.projections.add(M.default),e.Proj.projections.add(T.default),e.Proj.projections.add(C.default),e.Proj.projections.add(x.default)};var n=E(r(437)),i=E(r(182)),a=E(r(430)),o=E(r(428)),s=E(r(425)),l=E(r(424)),u=E(r(423)),c=E(r(422)),p=E(r(421)),h=E(r(420)),f=E(r(419)),d=E(r(418)),y=E(r(417)),v=E(r(416)),m=E(r(414)),g=E(r(413)),b=E(r(412)),S=E(r(411)),_=E(r(410)),P=E(r(409)),O=E(r(408)),w=E(r(407)),M=E(r(406)),T=E(r(405)),C=E(r(404)),x=E(r(403));function E(e){return e&&e.__esModule?e:{default:e}}},function(e){e.exports={_from:"proj4@2.5.0",_id:"proj4@2.5.0",_inBundle:!1,_integrity:"sha1-46iM5+egciGqzLxnYN0ur+50XwM=",_location:"/proj4",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"proj4@2.5.0",name:"proj4",escapedName:"proj4",rawSpec:"2.5.0",saveSpec:null,fetchSpec:"2.5.0"},_requiredBy:["/"],_resolved:"https://registry.npm.taobao.org/proj4/download/proj4-2.5.0.tgz",_shasum:"e3a88ce7e7a07221aaccbc6760dd2eafee745f03",_spec:"proj4@2.5.0",_where:"D:\\iClient-JavaScript",author:"",bugs:{url:"https://github.com/proj4js/proj4js/issues"},bundleDependencies:!1,contributors:[{name:"Mike Adair",email:"madair@dmsolutions.ca"},{name:"Richard Greenwood",email:"rich@greenwoodmap.com"},{name:"Calvin Metcalf",email:"calvin.metcalf@gmail.com"},{name:"Richard Marsden",url:"http://www.winwaed.com"},{name:"T. Mittan"},{name:"D. Steinwand"},{name:"S. Nelson"}],dependencies:{mgrs:"1.0.0","wkt-parser":"^1.2.0"},deprecated:!1,description:"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",devDependencies:{chai:"~4.1.2","curl-amd":"github:cujojs/curl",grunt:"^1.0.1","grunt-cli":"~1.2.0","grunt-contrib-connect":"~1.0.2","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~3.1.0","grunt-mocha-phantomjs":"~4.0.0","grunt-rollup":"^6.0.0",istanbul:"~0.4.5",mocha:"~4.0.0",rollup:"^0.50.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.0",tin:"~0.5.0"},directories:{test:"test",doc:"docs"},homepage:"https://github.com/proj4js/proj4js#readme",license:"MIT",main:"dist/proj4-src.js",module:"lib/index.js",name:"proj4",repository:{type:"git",url:"git://github.com/proj4js/proj4js.git"},scripts:{build:"grunt","build:tmerc":"grunt build:tmerc",test:"npm run build && istanbul test _mocha test/test.js"},version:"2.5.0"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(439);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.version}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(185);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"===(void 0===e?"undefined":n(e)))this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var i=e.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}a.fromMGRS=function(e){return new a((0,i.toPoint)(e))},a.prototype.toMGRS=function(e){return(0,i.forward)([this.x,this.y],e)},t.default=a},function(e,t,r){"use strict";function n(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){n(e.x),n(e.y)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n,i,a,o=r.x,s=r.y,l=r.z||0,u={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==r.z)switch(0===a?(n=o,i="x"):1===a?(n=s,i="y"):(n=l,i="z"),e.axis[a]){case"e":u[i]=n;break;case"w":u[i]=-n;break;case"n":u[i]=n;break;case"s":u[i]=-n;break;case"u":void 0!==r[i]&&(u.z=n);break;case"d":void 0!==r[i]&&(u.z=-n);break;default:return null}return u}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compareDatums=function(e,t){return e.datum_type===t.datum_type&&(!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===n.PJD_3PARAM?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==n.PJD_7PARAM||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]))},t.geodeticToGeocentric=function(e,t,r){var i,a,o,s,l=e.x,u=e.y,c=e.z?e.z:0;if(u<-n.HALF_PI&&u>-1.001*n.HALF_PI)u=-n.HALF_PI;else if(u>n.HALF_PI&&u<1.001*n.HALF_PI)u=n.HALF_PI;else{if(u<-n.HALF_PI)return{x:-1/0,y:-1/0,z:e.z};if(u>n.HALF_PI)return{x:1/0,y:1/0,z:e.z}}l>Math.PI&&(l-=2*Math.PI);return a=Math.sin(u),s=Math.cos(u),o=a*a,{x:((i=r/Math.sqrt(1-t*o))+c)*s*Math.cos(l),y:(i+c)*s*Math.sin(l),z:(i*(1-t)+c)*a}},t.geocentricToGeodetic=function(e,t,r,i){var a,o,s,l,u,c,p,h,f,d,y,v,m,g,b,S,_=e.x,P=e.y,O=e.z?e.z:0;if(a=Math.sqrt(_*_+P*P),o=Math.sqrt(_*_+P*P+O*O),a/r<1e-12){if(g=0,o/r<1e-12)return b=n.HALF_PI,S=-i,{x:e.x,y:e.y,z:e.z}}else g=Math.atan2(P,_);s=O/o,l=a/o,u=1/Math.sqrt(1-t*(2-t)*l*l),h=l*(1-t)*u,f=s*u,m=0;do{m++,p=r/Math.sqrt(1-t*f*f),c=t*p/(p+(S=a*h+O*f-p*(1-t*f*f))),u=1/Math.sqrt(1-c*(2-c)*l*l),v=(y=s*u)*h-(d=l*(1-c)*u)*f,h=d,f=y}while(v*v>1e-24&&m<30);return b=Math.atan(y/Math.abs(d)),{x:g,y:b,z:S}},t.geocentricToWgs84=function(e,t,r){if(t===n.PJD_3PARAM)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===n.PJD_7PARAM){var i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6];return{x:c*(e.x-u*e.y+l*e.z)+i,y:c*(u*e.x+e.y-s*e.z)+a,z:c*(-l*e.x+s*e.y+e.z)+o}}},t.geocentricFromWgs84=function(e,t,r){if(t===n.PJD_3PARAM)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===n.PJD_7PARAM){var i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],p=(e.x-i)/c,h=(e.y-a)/c,f=(e.z-o)/c;return{x:p+u*h-l*f,y:-u*p+h+s*f,z:l*p-s*h+f}}};var n=r(6)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){return(0,i.compareDatums)(e,t)?r:e.datum_type===n.PJD_NODATUM||t.datum_type===n.PJD_NODATUM?r:e.es!==t.es||e.a!==t.a||a(e.datum_type)||a(t.datum_type)?(r=(0,i.geodeticToGeocentric)(r,e.es,e.a),a(e.datum_type)&&(r=(0,i.geocentricToWgs84)(r,e.datum_type,e.datum_params)),a(t.datum_type)&&(r=(0,i.geocentricFromWgs84)(r,t.datum_type,t.datum_params)),(0,i.geocentricToGeodetic)(r,t.es,t.a,t.b)):r};var n=r(6),i=r(444);function a(e){return e===n.PJD_3PARAM||e===n.PJD_7PARAM}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6);t.default=function(e,t,r,i,a,o){var s={};return s.datum_type=void 0===e||"none"===e?n.PJD_NODATUM:n.PJD_WGS84,t&&(s.datum_params=t.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=n.PJD_3PARAM),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=n.PJD_7PARAM,s.datum_params[3]*=n.SEC_TO_RAD,s.datum_params[4]*=n.SEC_TO_RAD,s.datum_params[5]*=n.SEC_TO_RAD,s.datum_params[6]=s.datum_params[6]/1e6+1))),s.a=r,s.b=i,s.es=a,s.ep2=o,s}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default=n,n.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},n.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},n.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},n.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},n.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},n.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},n.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},n.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},n.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},n.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},n.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},n.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},n.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},n.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},n.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},n.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},n.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default=n,n.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},n.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},n.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},n.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},n.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},n.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},n.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},n.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},n.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},n.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},n.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},n.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},n.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},n.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},n.hough={a:6378270,rf:297,ellipseName:"Hough"},n.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},n.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},n.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},n.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},n.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},n.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},n.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},n.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},n.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};t.WGS84=n.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};n.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.eccentricity=function(e,t,r,i){var a=e*e,o=t*t,s=(a-o)/a,l=0;i?(e*=1-s*(n.SIXTH+s*(n.RA4+s*n.RA6)),a=e*e,s=0):l=Math.sqrt(s);return{es:s,e:l,ep2:(a-o)/o}},t.sphere=function(e,t,r,s,l){if(!e){var u=(0,o.default)(a.default,s);u||(u=i.WGS84),e=u.a,t=u.b,r=u.rf}r&&!t&&(t=(1-1/r)*e);(0===r||Math.abs(e-t)90&&o*s.R2D<-90&&n*s.R2D>180&&n*s.R2D<-180)return null;if(Math.abs(Math.abs(o)-s.HALF_PI)<=s.EPSLN)return null;if(this.sphere)t=this.x0+this.a*this.k0*(0,i.default)(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(s.FORTPI+.5*o));else{var l=Math.sin(o),u=(0,a.default)(this.e,o,l);t=this.x0+this.a*this.k0*(0,i.default)(n-this.long0),r=this.y0-this.a*this.k0*Math.log(u)}return e.x=t,e.y=r,e}function p(e){var t,r,n=e.x-this.x0,a=e.y-this.y0;if(this.sphere)r=s.HALF_PI-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var l=Math.exp(-a/(this.a*this.k0));if(-9999===(r=(0,o.default)(this.e,l)))return null}return t=(0,i.default)(this.long0+n/(this.a*this.k0)),e.x=t,e.y=r,e}var h=t.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];t.default={init:u,forward:c,inverse:p,names:h}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=void 0,t.get=c,t.start=p;var n=a(r(451)),i=a(r(450));function a(e){return e&&e.__esModule?e:{default:e}}var o=[n.default,i.default],s={},l=[];function u(e,t){var r=l.length;return e.names?(l[r]=e,e.names.forEach(function(e){s[e.toLowerCase()]=r}),this):(console.log(t),!0)}function c(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==s[t]&&l[s[t]]?l[s[t]]:void 0}function p(){o.forEach(u)}t.add=u,t.default={start:p,add:u,get:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n;if(e=e||{},!t)return e;for(n in t)void 0!==(r=t[n])&&(e[n]=r);return e}},function(e,t,r){"use strict";function n(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var n=t?{}:e,a=r.reduce(function(e,t){return i(t,e),e},n);t&&(e[t]=a)}function i(e,t){if(Array.isArray(e)){var r,a=e.shift();if("PARAMETER"===a&&(a=e.shift()),1===e.length)return Array.isArray(e[0])?(t[a]={},void i(e[0],t[a])):void(t[a]=e[0]);if(e.length)if("TOWGS84"!==a)switch(Array.isArray(a)||(t[a]={}),a){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[a]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&i(e[2],t[a]));case"SPHEROID":case"ELLIPSOID":return t[a]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&i(e[3],t[a]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void n(t,a,e);default:for(r=-1;++r=this.text.length)return;e=this.text[this.place++]}switch(this.state){case n:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},u.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(s.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},u.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=n)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=n,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},u.prototype.number=function(e){if(!l.test(e)){if(s.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},u.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},u.prototype.keyword=function(e){if(o.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=n)}if(!s.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},u.prototype.neutral=function(e){if(a.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(l.test(e))return this.word=e,void(this.state=3);if(!s.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},u.prototype.output=function(){for(;this.place-1})}(e)){var t=(0,i.default)(e);if(function(e){var t=(0,o.default)(e,"authority");if(t){var r=(0,o.default)(t,"epsg");return r&&u.indexOf(r)>-1}}(t))return n.default["EPSG:3857"];var r=function(e){var t=(0,o.default)(e,"extension");if(t)return(0,o.default)(t,"proj4")}(t);return r?(0,a.default)(r):t}return function(e){return"+"===e[0]}(e)?(0,a.default)(e):void 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(110)),i=a(r(187));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("WGS84");function s(e,t,r){var n,a,o;return Array.isArray(r)?(n=(0,i.default)(e,t,r),3===r.length?[n.x,n.y,n.z]:[n.x,n.y]):(a=(0,i.default)(e,t,r),2===(o=Object.keys(r)).length?a:(o.forEach(function(e){"x"!==e&&"y"!==e&&(a[e]=r[e])}),a))}function l(e){return e instanceof n.default?e:e.oProj?e.oProj:(0,n.default)(e)}t.default=function(e,t,r){e=l(e);var n,i=!1;return void 0===t?(t=e,e=o,i=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,t=e,e=o,i=!0),t=l(t),r?s(e,t,r):(n={forward:function(r){return s(e,t,r)},inverse:function(r){return s(t,e,r)}},i&&(n.oProj=t),n)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeTileVersion=t.ChangeTileVersion=void 0;var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};r(3);var o=r(178);var s=t.ChangeTileVersion=a.default.Control.extend({options:{layer:null,position:"topleft",title:"switch tile version",tooltip:"top",collapsed:!0,nextText:"+",lastText:"-",ico:"V",orientation:"horizontal",switch:!0},onAdd:function(){"vertical"!==this.options.orientation&&(this.options.orientation="horizontal");var e=this._initLayout();return this.options.layer&&this.setLayer(this.options.layer),e},setContent:function(e){var t=a.default.Util.extend({},e);this.setVersionName(t.desc).setToolTip(t.desc)},setVersionName:function(e){var t=e;return e||(t=this.getValue()),this._sliderValue.innerHTML=t,this},setToolTip:function(e){return this.tooltip.innerHTML=e,this},updateLength:function(e){e>0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))},setLayer:function(e){e&&(this.options.layer=e);var t=this,r=t.options.layer;r.on("tilesetsinfoloaded",function(e){var r=e&&e.tileVersions;t.update(r)}),r.on("tileversionschanged",function(e){var r=e&&e.tileVersion;t.setContent(r)}),t.getTileSetsInfo()},update:function(e){this.tileVersions=e,this.updateLength(this.tileVersions.length)},getTileSetsInfo:function(){var e=this;e.options.layer&&new o.MapService(e.options.layer._url).getTilesets(function(t){e.options.layer.setTileSetsInfo(t.result)})},removeLayer:function(){this.options.layer=null},nextTilesVersion:function(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)},lastTilesVersion:function(){return parseInt(this.slider.value)=0;e--)this.content.removeChild(this.content.children[e])}},{key:"setPageLink",value:function(e){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(e),this._appendPageLink()}},{key:"_createPageLi",value:function(e){for(var t=0;t1;e--)this.link.removeChild(this.link.children[e])}},{key:"_createLink",value:function(e){for(var t=0;t<4;t++){var r=document.createElement("li");r.setAttribute("class","disable");var n=document.createElement("span");r.appendChild(n),0===t?(n.id="first",n.setAttribute("class","supermapol-icons-first")):1===t?(n.id="prev",n.setAttribute("class","supermapol-icons-prev")):2===t?(n.id="next",n.setAttribute("class","supermapol-icons-next")):3===t&&(n.id="last",n.setAttribute("class","supermapol-icons-last")),e.appendChild(r)}}},{key:"_changePageEvent",value:function(e){var t=e.target;if("disable"!==t.parentElement.classList[0]){var r=void 0;if(t.id)r=t.id;else{if(!Number(t.innerHTML))return;r=Number(t.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}}},{key:"_changeDisableState",value:function(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}},{key:"_prePageNum",value:function(e){var t=[];if(this.currentPage="first"===e?1:"last"===e?this.pageNumberLis.length:"prev"===e?this.currentPage-1:"next"===e?this.currentPage+1:e,this.pageNumberLis.length<=5)for(var r=0;r=this.pageNumberLis.length-3)for(var i=this.pageNumberLis.length-5;i0&&(this.currentPageNumberLis=t)}}]),t}();i.SuperMap.Components.PaginationContainer=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NavTabsPage=void 0;var n=function(){function e(e,t){for(var r=0;r0&&this.appendTabs(e),this.rootContainer=t}},{key:"setTabs",value:function(e){this.removeAllTabs(),this.appendTabs(e)}},{key:"appendTabs",value:function(e){for(var t=0;t0;e--)this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}},{key:"_changeTabsPage",value:function(e){for(var t=e.target.index,r=0;r0;t--)this.content.removeChild(this.content.children[t-1]);var r=this.config[e];for(var n in r)this._createCityItem(n,r[n])}},{key:"_createCityItem",value:function(e,t){var r=document.createElement("div"),n=document.createElement("div");n.setAttribute("class","component-citytabpag__py-key"),n.innerHTML=e,r.appendChild(n);var i=document.createElement("div");i.setAttribute("class","component-citytabpag__content");for(var a=0;a0){var i=void 0;n.dataItemServices.forEach(function(n){if("RESTDATA"===n.serviceType&&"PUBLISHED"===n.serviceStatus)i=n;else{if("RESTMAP"!==n.serviceType||"PUBLISHED"!==n.serviceStatus)return void r.getDatafromContent(e,t);i=n}}),i&&r.getDatafromRest(i.serviceType,i.address,t)}else r.getDatafromContent(e,t);else r._fireFailedEvent(n)}).catch(function(e){console.log(e),r._fireFailedEvent(e)})}},{key:"getDatafromContent",value:function(e,t){var r=this,n={result:{}},i=this;e+="/content.json?pageSize=9999999¤tPage=1",a.FetchRequest.get(e,null,{withCredentials:this.datasets.withCredentials}).then(function(e){return e.json()}).then(function(e){if(!1!==e.succeed){if(e.type){if("JSON"===e.type||"GEOJSON"===e.type){if(e.content=JSON.parse(e.content.trim()),!e.content.features)return void console.log(h.Lang.i18n("msg_jsonResolveFiled"));var a=r._formatGeoJSON(e.content);n.result.features={type:e.content.type,features:a}}else if("EXCEL"===e.type||"CSV"===e.type){var o=r._excelData2Feature(e.content);n.result.features={type:"FeatureCollection",features:o}}t(n,"content")}}else i._fireFailedEvent(e)},this).catch(function(e){console.log(e),i._fireFailedEvent(e)})}},{key:"getDatafromRest",value:function(e,t,r){var n=this,i=this.datasets.withCredentials;if("RESTDATA"===e){var o=t+"/data/datasources",s=void 0,l=void 0;a.FetchRequest.get(o,null,{withCredentials:i}).then(function(e){return e.json()}).then(function(e){s=e.datasourceNames[0],o=t+"/data/datasources/"+s+"/datasets",a.FetchRequest.get(o,null,{withCredentials:i}).then(function(e){return e.json()}).then(function(e){return l=e.datasetNames[0],n.getDatafromRestData(t+"/data",[s+":"+l],r),[s+":"+l]}).catch(function(e){n._fireFailedEvent(e)})}).catch(function(e){n._fireFailedEvent(e)})}else{var u=t+"/maps",c=void 0,p=void 0,h=void 0;a.FetchRequest.get(u,null,{withCredentials:i}).then(function(e){return e.json()}).then(function(e){c=e[0].name,h=e[0].path,u=u=t+"/maps/"+c+"/layers",a.FetchRequest.get(u,null,{withCredentials:i}).then(function(e){return e.json()}).then(function(e){return p=e[0].subLayers.layers[0].caption,n.getDatafromRestMap(p,h,r),p}).catch(function(e){n._fireFailedEvent(e)})}).catch(function(e){n._fireFailedEvent(e)})}}},{key:"getDatafromRestData",value:function(e,t,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,function(e){r(e,"RESTDATA")},function(e){console.log(e),n._fireFailedEvent(e)})}},{key:"getDatafromRestMap",value:function(e,t,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,function(e){r(e,"RESTMAP")},function(e){console.log(e),n._fireFailedEvent(e)})}},{key:"_getFeatureBySQL",value:function(e,t,r,n,i){var a,u,c={name:t.join().replace(":","@")};Object.assign(c,r),a=new s.FilterParameter(c),u=new o.GetFeaturesBySQLParameters({queryParameter:a,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0});var p={eventListeners:{processCompleted:function(e){n&&n(e)},processFailed:function(e){i&&i(e)}}};new l.GetFeaturesBySQLService(e,p).processAsync(u)}},{key:"_queryFeatureBySQL",value:function(e,t,r,n,i,a,o,l,c,h){var f,d,y={name:t};Object.assign(y,r),f=new s.FilterParameter(y),n&&(f.fields=n);var v={queryParams:[f]};h&&(v.queryOption=p.QueryOption.ATTRIBUTE),l&&(v.startRecord=l),c&&(v.expectCount=c),i&&(v.prjCoordSys={epsgCode:i}),d=new u.QueryBySQLParameters(v),this._queryBySQL(e,d,function(e){"processCompleted"===e.type?a(e):o(e)})}},{key:"_queryBySQL",value:function(e,t,r,n){new c.QueryBySQLService(e,{eventListeners:{scope:this,processCompleted:r,processFailed:r},format:this._processFormat(n)}).processAsync(t)}},{key:"_processFormat",value:function(e){return e||p.DataFormat.GEOJSON}},{key:"_formatGeoJSON",value:function(e){var t=e.features;return t.forEach(function(e,t){e.properties.index=t}),t}},{key:"_excelData2Feature",value:function(e){for(var t=e.colTitles,r=-1,n=-1,i=0,a=t.length;i4?c*o(2*s/n)/o(s/n):c/3);var h=s/n,f=-s/2,d=l+c*o(f),y=u+c*i(f);f+=h;var v=t.pointList=[];v.push([d,y]);for(var m,g=0,b=2*n-1;g0){var c=a[a.length-1];if(Math.abs(c[0]-n[0])<=s&&Math.abs(c[1]-n[1])<=s)continue}a.push(n)}if(a.length<2)return null;var p=new Object;(p=o.Util.copyAttributesWithClip(p,this.style,["pointList"])).pointList=a;var h=new S.SmicBrokenLine({style:p,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(h.highlightStyle=this.highlightStyle),h.refOriginalPosition=this.location,h.refDataID=this.data.id,h.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&o.Util.copyAttributesWithClip(h,this.shapeOptions),this.shapes.push(h)}},{key:"multiPointToTF",value:function(e){for(var t=e.components,r=[],n=[],i=this.location,a=[],s=this.nodesClipPixel,l=0;l0){var c=a[a.length-1];if(Math.abs(c[0]-n[0])<=s&&Math.abs(c[1]-n[1])<=s)continue}a.push(n);var p=new Object;p.r=6,(p=o.Util.copyAttributesWithClip(p,this.style)).x=n[0],p.y=n[1];var h=new b.SmicPoint({style:p,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(h.highlightStyle=this.highlightStyle),h.refOriginalPosition=i,h.refDataID=this.data.id,h.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&o.Util.copyAttributesWithClip(h,this.shapeOptions),this.shapes.push(h)}}},{key:"multiLineStringToTF",value:function(e){for(var t=e.components,r=0;r0){var f=a[a.length-1];if(Math.abs(f[0]-n[0])<=u&&Math.abs(f[1]-n[1])<=u)continue}a.push(n)}}else{s=[];for(var d=0;d0){var y=s[s.length-1];if(Math.abs(y[0]-n[0])<=u&&Math.abs(y[1]-n[1])<=u)continue}s.push(n)}}s.length<2||l.push(s)}if(!(a.length<2)){var v={};(v=o.Util.copyAttributesWithClip(v,this.style,["pointList"])).pointList=a;var m=new O.SmicPolygon({style:v,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,l.length>0&&(m.holePolygonPointLists=l),this.shapeOptions&&o.Util.copyAttributesWithClip(m,this.shapeOptions),this.shapes.push(m)}}},{key:"rectangleToTF",value:function(e){var t=this.location,r=new w.LonLat(e.x,e.y),n=this.layer.map.getResolution(),i=this.getLocalXY(r),a=new Object;a.r=6,(a=o.Util.copyAttributesWithClip(a,this.style)).x=i[0]-t[0],a.y=i[1]-t[1]-2*e.width/n,a.width=e.width/n,a.height=e.height/n;var s=new P.SmicRectangle({style:a,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(s.highlightStyle=this.highlightStyle),s.refOriginalPosition=t,s.refDataID=this.data.id,s.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&o.Util.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}},{key:"geoTextToTF",value:function(e){var t=this.location,r=this.getLocalXY(e),n=new Object;n.r=6,(n=o.Util.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-t[0],n.y=r[1]-t[1],n.text=e.text;var i=new _.SmicText({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(i.highlightStyle=this.highlightStyle),i.refOriginalPosition=t,i.refDataID=this.data.id,i.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&o.Util.copyAttributesWithClip(i,this.shapeOptions),this.shapes.push(i)}},{key:"updateAndAddShapes",value:function(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,r=0,n=this.shapes.length;rn[1])return;for(var s=0,l=0;l=0&&t.innerRingRadiusr[1])return null;l=c[p],u=t[1]-(i[p]-r[0])/n;var f=new o.Point(l,u);f.style=a.ShapeFactory.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,p,i[p]),f.highlightStyle=a.ShapeFactory.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(f.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(f.clickable=e.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[p],value:i[p]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}},{key:"calculateXShapeInfo",value:function(){var e,t=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],a=this.DVBWidth,o=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=a-((e=r.xShapeBlank)[0]+e[1]);if(s<=n)return null;o=s/(n-1)}else e=[o=a/(n+1),o,o];for(var l=0,u=0;un[1])return;for(var s=0,l=0;l=360&&(h=359.9999999);var m=new o.Sector(c[0],c[1],d,p,h);if(void 0===e.sectorStyleByFields){var g=y%t.length;m.style=a.ShapeFactory.ShapeStyleTool(null,e.sectorStyle,t,null,g)}else m.style=a.ShapeFactory.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,y,r[y]);m.highlightStyle=a.ShapeFactory.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(m.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(m.clickable=e.sectorClickAble),m.refDataID=this.data.id,m.dataInfo={field:this.fields[y],value:r[y]},this.shapes.push(this.shapeFactory.createShape(m)),p=h}this.shapesConvertToRelativeCoordinate()}}}}]),t}();i.SuperMap.Feature.Theme.Pie=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Line=void 0;var n=function(){function e(e,t){for(var r=0;rr[1])return null;u=p[d],c=t[1]-(i[d]-r[0])/n;var v=new o.Point(u,c);v.style=a.ShapeFactory.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,d,i[d]),v.highlightStyle=a.ShapeFactory.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(v.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(v.clickable=e.pointClickAble),v.refDataID=this.data.id,v.dataInfo={field:this.fields[d],value:i[d]},f.push(this.shapeFactory.createShape(v));var m=[u,c];h.push(m)}var g=new s.Line(h);g.style=a.ShapeFactory.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),g.clickable=!1,g.hoverable=!1;var b=this.shapeFactory.createShape(g);this.shapes.push(b),this.shapes=this.shapes.concat(f),this.shapesConvertToRelativeCoordinate()}}}}},{key:"calculateXShapeInfo",value:function(){var e,t=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],a=this.DVBWidth,o=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=a-((e=r.xShapeBlank)[0]+e[1]);if(s<=n)return null;o=s/(n-1)}else e=[o=a/(n+1),o,o];for(var l=0,u=0;u0?this.DVBUnitValue=e.maxR/(i[1]-i[0]):this.DVBUnitValue=e.maxR;var l=this.DVBUnitValue,u=n[0]*l+e.minR;if(this.width=2*u,this.height=2*u,this.initBaseParameter()&&(!i||!(n[0]i[1]))){var c=this.DVBCenterPoint,p=new o.Circle(c[0],c[1],u);p.style=s.ShapeFactory.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?p.style.fillColor=e.fillColor:p.style.fillColor="#ff9277",p.highlightStyle=s.ShapeFactory.ShapeStyleTool(null,e.circleHoverStyle),void 0!==e.circleHoverAble&&(p.hoverable=e.circleHoverAble),void 0!==e.circleClickAble&&(p.clickable=e.circleClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[0],r:u,value:n[0]},this.shapes.push(this.shapeFactory.createShape(p)),this.shapesConvertToRelativeCoordinate()}}}]),t}();i.SuperMap.Feature.Theme.Circle=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bar3D=void 0;var n=function(){function e(e,t){for(var r=0;rt[1])return;var u=this.calculateXShapeInfo();if(u){var c=u.xPositions,p=u.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(o.ShapeFactory.Background(this.shapeFactory,this.chartBox,e)),(!e.axis3DParameter||isNaN(e.axis3DParameter)||e.axis3DParameter<15)&&(e.axis3DParameter=20),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(o.ShapeFactory.GraphAxis(this.shapeFactory,r,e,u)));for(var h=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10,f=0;fr[1])return;var c=this.calculateXShapeInfo();if(c){var p=c.xPositions,h=c.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(a.ShapeFactory.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(a.ShapeFactory.GraphAxis(this.shapeFactory,n,t,c)));for(var f=0;f=t.length&&(r%=t.length);var u=t[r][0],c=t[r][1],p=(new s.Color).getLinearGradient(o,0,l,0,[[0,u],[1,c]]);i.style.color=p}}}}]),t}();i.SuperMap.Feature.Theme.Bar=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SUtil=t.LevelRendererVector=t.Util=t.Transformable=t.Storage=t.SmicText=t.SmicStar=t.SmicSector=t.SmicRing=t.SmicRectangle=t.SmicPolygon=t.SmicPoint=t.SmicIsogon=t.SmicImage=t.SmicEllipse=t.SmicCircle=t.SmicBrokenLine=t.Shape=t.PaintLayer=t.Painter=t.Matrix=t.Math=t.Log=t.Http=t.Handler=t.Group=t.Eventful=t.LevelRendererEvent=t.Env=t.Easing=t.LevelRendererCurve=t.Config=t.ComputeBoundingBox=t.Color=t.Clip=t.Area=t.Animator=t.Animation=t.Render=t.LevelRenderer=t.FeatureTheme=t.Sector=t.FeatureRectangle=t.FeaturePolygon=t.Point=t.FeatureLine=t.Label=t.Image=t.FeatureCircle=t.ShapeParameters=t.ShapeFactory=t.ThemeVector=t.Ring=t.RankSymbol=t.OverlayPoint=t.Pie=t.Line=t.Graph=t.Circle=t.Bar3D=t.Bar=void 0;var n=r(494),i=r(493),a=r(492),o=r(33),s=r(491),l=r(490),u=r(489),c=r(207),p=r(488),h=r(487),f=r(486),d=r(485); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.Bar=n.Bar,t.Bar3D=i.Bar3D,t.Circle=a.Circle,t.Graph=o.Graph,t.Line=s.Line,t.Pie=l.Pie,t.OverlayPoint=u.Point,t.RankSymbol=c.RankSymbol,t.Ring=p.Ring,t.ThemeVector=h.ThemeVector,t.ShapeFactory=f.ShapeFactory,t.ShapeParameters=f.ShapeParameters,t.FeatureCircle=f.FeatureCircle,t.Image=f.Image,t.Label=f.Label,t.FeatureLine=f.FeatureLine,t.Point=f.Point,t.FeaturePolygon=f.FeaturePolygon,t.FeatureRectangle=f.FeatureRectangle,t.Sector=f.Sector,t.FeatureTheme=f.FeatureTheme,t.LevelRenderer=d.LevelRenderer,t.Render=d.Render,t.Animation=d.Animation,t.Animator=d.Animator,t.Area=d.Area,t.Clip=d.Clip,t.Color=d.Color,t.ComputeBoundingBox=d.ComputeBoundingBox,t.Config=d.Config,t.LevelRendererCurve=d.LevelRendererCurve,t.Easing=d.Easing,t.Env=d.Env,t.LevelRendererEvent=d.LevelRendererEvent,t.Eventful=d.Eventful,t.Group=d.Group,t.Handler=d.Handler,t.Http=d.Http,t.Log=d.Log,t.Math=d.Math,t.Matrix=d.Matrix,t.Painter=d.Painter,t.PaintLayer=d.PaintLayer,t.Shape=d.Shape,t.SmicBrokenLine=d.SmicBrokenLine,t.SmicCircle=d.SmicCircle,t.SmicEllipse=d.SmicEllipse,t.SmicImage=d.SmicImage,t.SmicIsogon=d.SmicIsogon,t.SmicPoint=d.SmicPoint,t.SmicPolygon=d.SmicPolygon,t.SmicRectangle=d.SmicRectangle,t.SmicRing=d.SmicRing,t.SmicSector=d.SmicSector,t.SmicStar=d.SmicStar,t.SmicText=d.SmicText,t.Storage=d.Storage,t.Transformable=d.Transformable,t.Util=d.Util,t.LevelRendererVector=d.LevelRendererVector,t.SUtil=d.SUtil},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeStyle=void 0;var n=r(0),i=r(1); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -var a=t.ThemeStyle=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,i.Util.extend(this,t)};n.SuperMap.ThemeStyle=a},function(e,t,r){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=9007199254740991,i="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",s="[object Map]",l="[object Set]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,p="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=p||h||Function("return this")();function d(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1&&e%1==0&&e-1&&e%1==0&&e<=n}(e.length)&&!W(e)}function W(e){var t=Q(e)?w.call(e):"";return t==a||t==o}function Q(e){var t=void 0===e?"undefined":r(e);return!!e&&("object"==t||"function"==t)}var Y,X=(Y=function(e){return q(e)?D(e):B(e)},function(e){var t,r,n,i=V(e);return i==s?(t=e,r=-1,n=Array(t.size),t.forEach(function(e,t){n[++r]=[t,e]}),n):i==l?function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}(e):d(e,Y(e))});e.exports=X}).call(this,r(138))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CartoCSS=void 0;var n,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var r=0;ru&&(l[n]=l[n].slice(r-u),u=r)}function y(e){var i,a,o,s;if(e instanceof Function)return e.call(c.parsers);if("string"==typeof e)i=t.charAt(r)===e?e:null,a=1,d();else{if(d(),!(i=e.exec(l[n])))return null;a=i[0].length}if(i){var p=r+=a;for(s=r+l[n].length-a;r=0&&"\n"!==n.charAt(o);o--)r.column++;return new Error([r.filename,r.line,r.column,r.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},c={parse:function(i){var a,c=null;if(r=n=u=s=0,l=[],t=i.replace(/\r\n/g,"\n"),e.filename&&(p.env.inputs[e.filename]=t),l=function(e){for(var r,n,i,a,o=0,s=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,l=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,u=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,p=0,h=e[0],f=0;f0?"missing closing `}`":"missing opening `{`"}),e.map(function(e){return e.join("")})}([[]]),c)throw v(c);var h=function(e,t){var r=e.specificity,n=t.specificity;return r[0]!=n[0]?n[0]-r[0]:r[1]!=n[1]?n[1]-r[1]:r[2]!=n[2]?n[2]-r[2]:n[3]-r[3]};return(a=new o.SuperMap.CartoCSS.Tree.Ruleset([],y(this.parsers.primary))).root=!0,a.toList=function(e){e.error=function(t){e.errors||(e.errors=new Error("")),e.errors.message?e.errors.message+="\n"+v(t).message:e.errors.message=v(t).message},e.frames=e.frames||[];var t=this.flatten([],[],e);return t.sort(h),t},a},parsers:{primary:function(){for(var e,t=[];(e=y(this.rule)||y(this.ruleset)||y(this.comment))||y(/^[\s\n]+/)||(e=y(this.invalid));)e&&t.push(e);return t},invalid:function(){var e=y(/^[^;\n]*[;\n]/);if(e)return new o.SuperMap.CartoCSS.Tree.Invalid(e,a)},comment:function(){var e;if("/"===t.charAt(r))return"/"===t.charAt(r+1)?new o.SuperMap.CartoCSS.Tree.Comment(y(/^\/\/.*/),!0):(e=y(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new o.SuperMap.CartoCSS.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===t.charAt(r)||"'"===t.charAt(r)){var e=y(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new o.SuperMap.CartoCSS.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(y("[")){var e=y(/(^[^\]]+)/);if(y("]"))return e?new o.SuperMap.CartoCSS.Tree.Field(e[1]):void 0}},comparison:function(){var e=y(/^=~|=|!=|<=|>=|<|>/);if(e)return e},keyword:function(){var e=y(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new o.SuperMap.CartoCSS.Tree.Keyword(e)},call:function(){var e,t;if(e=/^([\w\-]+|%)\(/.exec(l[n])){if("url"===(e=e[1]))return null;r+=e.length;if(y("("),t=y(this.entities.arguments),y(")"))return e?new o.SuperMap.CartoCSS.Tree.Call(e,t,r):void 0}},arguments:function(){for(var e,t=[];e=y(this.expression);){t.push(e);if(!y(","))break}return t},literal:function(){return y(this.entities.dimension)||y(this.entities.keywordcolor)||y(this.entities.hexcolor)||y(this.entities.quoted)},url:function(){var e;if("u"===t.charAt(r)&&y(/^url\(/)){e=y(this.entities.quoted)||y(this.entities.variable)||y(/^[\-\w%@$\/.&=:;#+?~]+/)||"";return y(")")?new o.SuperMap.CartoCSS.Tree.URL(void 0!==e.value||e instanceof o.SuperMap.CartoCSS.Tree.Variable?e:new o.SuperMap.CartoCSS.Tree.Quoted(e)):new o.SuperMap.CartoCSS.Tree.Invalid(e,a,"Missing closing ) in URL.")}},variable:function(){var n,i=r;if("@"===t.charAt(r)&&(n=y(/^@[\w-]+/)))return new o.SuperMap.CartoCSS.Tree.Variable(n,i,e.filename)},hexcolor:function(){var e;if("#"===t.charAt(r)&&(e=y(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new o.SuperMap.CartoCSS.Tree.Color(e[1])},keywordcolor:function(){var e=l[n].match(/^[a-z]+/);if(e&&e[0]in o.SuperMap.CartoCSS.Tree.Reference.data.colors)return new o.SuperMap.CartoCSS.Tree.Color(o.SuperMap.CartoCSS.Tree.Reference.data.colors[y(/^[a-z]+/)])},dimension:function(){var e=t.charCodeAt(r);if(!(e>57||e<45||47===e)){var n=y(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return n?new o.SuperMap.CartoCSS.Tree.Dimension(n[1],n[2],a):void 0}}},variable:function(){var e;if("@"===t.charAt(r)&&(e=y(/^(@[\w-]+)\s*:/)))return e[1]},entity:function(){var e=y(this.entities.call)||y(this.entities.literal),t=y(this.entities.field)||y(this.entities.variable),r=y(this.entities.url)||y(this.entities.keyword);return e||t||r},end:function(){var e;return y(";")||("string"==typeof(e="}")?t.charAt(r)===e:!!e.test(l[n]))},element:function(){var e=y(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new o.SuperMap.CartoCSS.Tree.Element(e)},attachment:function(){var e=y(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(e)return e[1]},selector:function(){for(var e,n,i,s,l,u=[],c=new o.SuperMap.CartoCSS.Tree.Filterset,p=[],h=0,f=0;(i=y(this.element))||(l=y(this.zoom))||(s=y(this.filter))||(e=y(this.attachment));){if(h++,i)u.push(i);else if(l)p.push(l),f++;else if(s){var d=c.add(s);if(d)throw v({message:d,index:r-1});f++}else{if(n)throw v({message:"Encountered second attachment name.",index:r-1});n=e}var m=t.charAt(r);if("{"===m||"}"===m||";"===m||","===m)break}if(h)return new o.SuperMap.CartoCSS.Tree.Selector(c,p,u,n,f,a)},filter:function(){h();var t,r,n;if(y("[")&&(t=y(/^[a-zA-Z0-9\-_]+/)||y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.keyword)||y(this.entities.field))&&(t instanceof o.SuperMap.CartoCSS.Tree.Quoted&&(t=new o.SuperMap.CartoCSS.Tree.Field(t.toString())),(r=y(this.entities.comparison))&&(n=y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.dimension)||y(this.entities.keyword)||y(this.entities.field)))){if(!y("]"))throw v({message:"Missing closing ] of filter.",index:a-1});return t.is||(t=new o.SuperMap.CartoCSS.Tree.Field(t)),new o.SuperMap.CartoCSS.Tree.Filter(t,r,n,a,e.filename)}},zoom:function(){h();var e,t;if(y(/^\[\s*zoom/g)&&(e=y(this.entities.comparison))&&(t=y(this.entities.variable)||y(this.entities.dimension))&&y("]"))return new o.SuperMap.CartoCSS.Tree.Zoom(e,t,a);f()},block:function(){var e;if(y("{")&&(e=y(this.primary))&&y("}"))return e},ruleset:function(){var e,t,r=[];for(h();e=y(this.selector);){for(r.push(e);y(this.comment););if(!y(","))break;for(;y(this.comment););}if(e)for(;y(this.comment););if(r.length>0&&(t=y(this.block))){if(1===r.length&&r[0].elements.length&&"Map"===r[0].elements[0].value){var n=new o.SuperMap.CartoCSS.Tree.Ruleset(r,t);return n.isMap=!0,n}return new o.SuperMap.CartoCSS.Tree.Ruleset(r,t)}f()},rule:function(){var n,i,l=t.charAt(r);if(h(),"."!==l&&"#"!==l&&(n=y(this.variable)||y(this.property))){if((i=y(this.value))&&y(this.end))return new o.SuperMap.CartoCSS.Tree.Rule(n,i,a,e.filename);s=r,f()}},font:function(){for(var e,t=[],r=[];e=y(this.entity);)r.push(e);if(t.push(new o.SuperMap.CartoCSS.Tree.Expression(r)),y(","))for(;(e=y(this.expression))&&(t.push(e),y(",")););return new o.SuperMap.CartoCSS.Tree.Value(t)},value:function(){for(var e,t=[];(e=y(this.expression))&&(t.push(e),y(",")););return t.length>1?new o.SuperMap.CartoCSS.Tree.Value(t.map(function(e){return e.value[0]})):1===t.length?new o.SuperMap.CartoCSS.Tree.Value(t):void 0},sub:function(){var e;if(y("(")&&(e=y(this.expression))&&y(")"))return e},multiplication:function(){var e,t,r,n;if(e=y(this.operand)){for(;(r=y("/")||y("*")||y("%"))&&(t=y(this.operand));)n=new o.SuperMap.CartoCSS.Tree.Operation(r,[n||e,t],a);return n||e}},addition:function(){var e,n,i,s;if(e=y(this.multiplication)){for(;(i=y(/^[-+]\s+/)||" "!=t.charAt(r-1)&&(y("+")||y("-")))&&(n=y(this.multiplication));)s=new o.SuperMap.CartoCSS.Tree.Operation(i,[s||e,n],a);return s||e}},operand:function(){return y(this.sub)||y(this.entity)},expression:function(){for(var e,t=[];e=y(this.addition)||y(this.entity);)t.push(e);if(t.length>0)return new o.SuperMap.CartoCSS.Tree.Expression(t)},property:function(){var e=y(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(e)return e[1]}}}}},{key:"parse",value:function(e){var t=this.parser;return this.ruleSet=t.parse(e)}},{key:"toShaders",value:function(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var r={},n=[];this._toShaders(r,n,t);for(var i=[],a={},o=0,s=t.length;o=0){if(!t.featureFilter){var a=i+n.length,o=r.indexOf(")",a+1),s="featureId&&(featureId"+r.substring(a,o)+")";Object.defineProperty(t,"featureFilter",{configurable:!0,enumerable:!1,value:function(e){return!!s}})}return{property:f,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:f,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(c[f],p);Object.defineProperty(p,"attachment",{configurable:!0,enumerable:!1,value:u}),Object.defineProperty(p,"elements",{configurable:!0,enumerable:!1,value:l.elements}),i.push(p),a[n[o]]=!0}Object.defineProperty(p,"zoom",{configurable:!0,enumerable:!1,value:l.zoom})}return i}}return null}},{key:"_toShaders",value:function(e,t,r){for(var n=0,i=r.length;n= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}},c.mapnik_reference={version:{latest:o.SuperMap._mapnik_reference_latest,"2.1.1":o.SuperMap._mapnik_reference_latest}},o.SuperMap.CartoCSS=c,o.SuperMap.CartoCSS.Tree={},o.SuperMap.CartoCSS.Tree.operate=function(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"%":return t%r;case"/":return t/r}},o.SuperMap.CartoCSS.Tree.functions={rgb:function(e,t,r){return this.rgba(e,t,r,1)},rgba:function(e,t,r,n){var i=this,a=[e,t,r].map(function(e){return i.number(e)});return n=i.number(n),a.some(isNaN)||isNaN(n)?null:new o.SuperMap.CartoCSS.Tree.Color(a,n)},stop:function(e){var t,r;return arguments.length>1&&(t=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:e,color:t,mode:r,toString:function(n){return'\n\t"}}},hsl:function(e,t,r){return this.hsla(e,t,r,1)},hsla:function(e,t,r,n){if([e=this.number(e)%360/360,t=this.number(t),r=this.number(r),n=this.number(n)].some(isNaN))return null;var i=r<=.5?r*(t+1):r+t-r*t,a=2*r-i;return this.rgba(255*o(e+1/3),255*o(e),255*o(e-1/3),n);function o(e){return 6*(e=e<0?e+1:e>1?e-1:e)<1?a+(i-a)*e*6:2*e<1?i:3*e<2?a+(i-a)*(2/3-e)*6:a}},hue:function(e){return"toHSL"in e?new o.SuperMap.CartoCSS.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new o.SuperMap.CartoCSS.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new o.SuperMap.CartoCSS.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new o.SuperMap.CartoCSS.Tree.Dimension(e.toHSL().a):null},saturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s+=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s-=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l+=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l-=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a+=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a-=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL(),n=(r.h+t.value)%360;return r.h=n<0?360+n:n,this.hsla_simple(r)},replace:function(e,t,r){return"field"===e.is?e.toString+".replace("+t.toString()+", "+r.toString()+")":e.replace(t,r)},mix:function(e,t,r){var n=r.value/100,i=2*n-1,a=e.toHSL().a-t.toHSL().a,s=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,l=1-s,u=[e.rgb[0]*s+t.rgb[0]*l,e.rgb[1]*s+t.rgb[1]*l,e.rgb[2]*s+t.rgb[2]*l],c=e.alpha*n+t.alpha*(1-n);return new o.SuperMap.CartoCSS.Tree.Color(u,c)},greyscale:function(e){return this.desaturate(e,new o.SuperMap.CartoCSS.Tree.Dimension(100))},"%":function(e){for(var t=Array.prototype.slice.call(arguments,1),r=e.value,n=0;n.5?u/(2-o-s):u/(o+s),o){case r:e=(n-i)/u+(n=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}},{key:"toColor",value:function(){return new o.SuperMap.CartoCSS.Tree.Color([this.value,this.value,this.value])}},{key:"round",value:function(){return this.value=Math.round(this.value),this}},{key:"toString",value:function(){return this.value.toString()}},{key:"operate",value:function(e,t,r){return"%"===this.unit&&"%"!==r.unit?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===t||"/"===t||"%"===t?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new o.SuperMap.CartoCSS.Tree.Dimension(o.SuperMap.CartoCSS.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new o.SuperMap.CartoCSS.Tree.Dimension(o.SuperMap.CartoCSS.Tree.operate(t,this.value,r.value),this.unit||r.unit)}}]),e}(),o.SuperMap.CartoCSS.Tree.Element=function(){function e(t){u(this,e),this.value=t.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")}return a(e,[{key:"specificity",value:function(){return["id"===this.type?1:0,"class"===this.type?1:0]}},{key:"toString",value:function(){return this.value}}]),e}(),o.SuperMap.CartoCSS.Tree.Expression=function(){function e(t){u(this,e),this.is="expression",this.value=t}return a(e,[{key:"ev",value:function(e){return this.value.length>1?new o.SuperMap.CartoCSS.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}},{key:"toString",value:function(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}}]),e}(),o.SuperMap.CartoCSS.Tree.Field=function(){function e(t){u(this,e),this.is="field",this.value=t||""}return a(e,[{key:"toString",value:function(){return'["'+this.value.toUpperCase()+'"]'}},{key:"ev",value:function(){return this}}]),e}(),o.SuperMap.CartoCSS.Tree.Filter=function(){function e(t,r,n,i,a){u(this,e),this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=t,this.op=r,this.val=n,this.index=i,this.filename=a,this.id=this.key+this.op+this.val}return a(e,[{key:"ev",value:function(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}},{key:"toString",value:function(){return"["+this.id+"]"}}]),e}(),o.SuperMap.CartoCSS.Tree.Filterset=function(){function e(){u(this,e),this.filters={}}return a(e,[{key:"toJS",value:function(e){function t(e){var t=e.op;"="===t&&(t="==");var r=e.val;void 0!==e._val&&(r=e._val.toString(!0)),e.key&&"scale"===e.key.value?r=+r:"string"!=typeof r&&"object"!==(void 0===r?"undefined":i(r))||(r="'"+r+"'");var n="attributes";return n+"&&"+n+e.key+"&&"+n+e.key+" "+t+r}var r=[];for(var n in this.filters)r.push(t(this.filters[n]));return r.join(" && ")}},{key:"toString",value:function(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join("\t")}},{key:"ev",value:function(e){for(var t in this.filters)this.filters[t].ev(e);return this}},{key:"clone",value:function(){var e=new o.SuperMap.CartoCSS.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}},{key:"cloneWith",value:function(e){var t=[];for(var r in e.filters){var n=this.addable(e.filters[r]);if(!1===n)return!1;!0===n&&t.push(e.filters[r])}if(!t.length)return null;var i=new o.SuperMap.CartoCSS.Tree.Filterset;for(r in this.filters)i.filters[r]=this.filters[r];for(;r=t.shift();)i.add(r);return i}},{key:"addable",value:function(e){var t=e.key.toString(),r=e.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?$/)&&(r=parseFloat(r)),e.op){case"=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val.toString()==r&&null:void 0===this.filters[t+"!="+r]&&(!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val"]&&this.filters[t+">"].val>=r?null:void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val":return t+"="in this.filters?!(this.filters[t+"="].val<=r)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)||null));case">=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)||null));case"<":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>=r)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].valr)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)||null))}}},{key:"conflict",value:function(e){var t=e.key.toString(),r=e.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===e.op&&void 0!==this.filters[t+"="]&&r!=this.filters[t+"="].val.toString()||"!="===e.op&&void 0!==this.filters[t+"="]&&r==this.filters[t+"="].val.toString()||"="===e.op&&void 0!==this.filters[t+"!="]&&r===this.filters[t+"!="].val.toString())&&e.toString()+" added to "+this.toString()+" produces an invalid filter"}},{key:"add",value:function(e,t){var r,n=e.key.toString(),i=e.op,a=this.conflict(e);if(a)return a;if("="===i){for(var o in this.filters)this.filters[o].key===n&&delete this.filters[o];this.filters[n+"="]=e}else if("!="===i)this.filters[n+"!="+e.val]=e;else if("=~"===i)this.filters[n+"=~"+e.val]=e;else if(">"===i){for(var s in this.filters)this.filters[s].key===n&&this.filters[s].val<=e.val&&delete this.filters[s];this.filters[n+">"]=e}else if(">="===i){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===n&&r",this.filters[n+">"]=e):this.filters[n+">="]=e}else if("<"===i){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===n&&r>=e.val&&delete this.filters[u];this.filters[n+"<"]=e}else if("<="===i){for(var c in this.filters)r=+this.filters[c].val.toString(),this.filters[c].key===n&&r>e.val&&delete this.filters[c];void 0!==this.filters[n+"!="+e.val]?(delete this.filters[n+"!="+e.val],e.op="<",this.filters[n+"<"]=e):this.filters[n+"<="]=e}}}]),e}(),o.SuperMap.CartoCSS.Tree.Fontset=function e(t,r){u(this,e),this.fonts=r,this.name="fontset-"+t.effects.length},o.SuperMap.CartoCSS.Tree.Invalid=function(){function e(t,r,n){u(this,e),this.is="invalid",this.chunk=t,this.index=r,this.type="syntax",this.message=n||"Invalid code: "+this.chunk}return a(e,[{key:"ev",value:function(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}}]),e}(),o.SuperMap.CartoCSS.Tree.Keyword=function(){function e(t){u(this,e),this.value=t;var r={transparent:"color",true:"boolean",false:"boolean"};this.is=r[t]?r[t]:"keyword"}return a(e,[{key:"ev",value:function(){return this}}]),a(e,[{key:"toString",value:function(){return this.value}}]),e}(),o.SuperMap.CartoCSS.Tree.Literal=function(){function e(t){u(this,e),this.value=t||"",this.is="field"}return a(e,[{key:"toString",value:function(){return this.value}},{key:"ev",value:function(){return this}}]),e}(),o.SuperMap.CartoCSS.Tree.Operation=function(){function e(t,r,n){u(this,e),this.is="operation",this.op=t.trim(),this.operands=r,this.index=n}return a(e,[{key:"ev",value:function(e){var t,r=this.operands[0].ev(e),n=this.operands[1].ev(e);return"undefined"===r.is||"undefined"===n.is?{is:"undefined",value:"undefined"}:(r instanceof o.SuperMap.CartoCSS.Tree.Dimension&&n instanceof o.SuperMap.CartoCSS.Tree.Color&&("*"===this.op||"+"===this.op?(t=n,n=r,r=t):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof o.SuperMap.CartoCSS.Tree.Quoted&&n instanceof o.SuperMap.CartoCSS.Tree.Quoted&&"+"!==this.op?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof o.SuperMap.CartoCSS.Tree.Field||n instanceof o.SuperMap.CartoCSS.Tree.Field||r instanceof o.SuperMap.CartoCSS.Tree.Literal||n instanceof o.SuperMap.CartoCSS.Tree.Literal?"color"===r.is||"color"===n.is?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new o.SuperMap.CartoCSS.Tree.Literal(r.ev(e).toString(!0)+this.op+n.ev(e).toString(!0)):void 0===r.operate?(e.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(e,this.op,n))}}]),e}(),o.SuperMap.CartoCSS.Tree.Quoted=function(){function e(t){u(this,e),this.is="string",this.value=t||""}return a(e,[{key:"toString",value:function(e){var t=this.value.replace(/&/g,"&"),r=t.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===e?"'"+r+"'":t}},{key:"ev",value:function(){return this}},{key:"operate",value:function(e,t,r){return new o.SuperMap.CartoCSS.Tree.Quoted(o.SuperMap.CartoCSS.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}}]),e}(),o.SuperMap.CartoCSS.Tree.Reference={_validateValue:{font:function(e,t){return!e.validation_data||!e.validation_data.fonts||-1!=e.validation_data.fonts.indexOf(t)}},setData:function(e){this.data=e,this.selector_cache=function(e){var t={};for(var r in e.symbolizers)for(var n in e.symbolizers[r])e.symbolizers[r][n].hasOwnProperty("css")&&(t[e.symbolizers[r][n].css]=[e.symbolizers[r][n],r,n]);return t}(e),this.mapnikFunctions=function(e){var t={};for(var r in e.symbolizers)for(var n in e.symbolizers[r])if("functions"===e.symbolizers[r][n].type)for(var i=0;i1?Array.prototype.push.apply(r,n.find(new o.SuperMap.CartoCSS.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(n);break}}),this._lookups[n]=r)}},{key:"evZooms",value:function(e){for(var t=0;to.SuperMap.CartoCSS.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+o.SuperMap.CartoCSS.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t;break;default:return this}return this}},{key:"toString",value:function(){for(var e="",t=0;t<=o.SuperMap.CartoCSS.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<=0&&this.getSqrtInterval(e,r):"logarithm"===t?this.getMin(e)>0&&this.getGeometricProgression(e,r):void 0}},{key:"getSum",value:function(e){return this.getInstance(e).sum()}},{key:"getMax",value:function(e){return this.getInstance(e).max()}},{key:"getMin",value:function(e){return this.getInstance(e).min()}},{key:"getMean",value:function(e){return this.getInstance(e).mean()}},{key:"getMedian",value:function(e){return this.getInstance(e).median()}},{key:"getTimes",value:function(e){return e.length}},{key:"getEqInterval",value:function(e,t){return this.getInstance(e).getClassEqInterval(t)}},{key:"getJenks",value:function(e,t){return this.getInstance(e).getClassJenks(t)}},{key:"getSqrtInterval",value:function(e,t){return e=e.map(function(e){return Math.sqrt(e)}),this.getInstance(e).getClassEqInterval(t).map(function(e){return e*e})}},{key:"getGeometricProgression",value:function(e,t){return this.getInstance(e).getClassGeometricProgression(t)}}]),e}();i.SuperMap.ArrayStatistic=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorsPickerUtil=void 0;var n=function(){function e(e,t){for(var r=0;r=t)if("RANGE"===r)for(i=0;it.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),r})}},{key:"_distance",value:function(e,t,r,n){return Math.sqrt((e-r)*(e-r)+(t-n)*(t-n))}},{key:"_getMeterPerMapUnit",value:function(e){var t=void 0;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}}]),e}();a.SuperMap.ElasticSearch=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElasticSearch=void 0;var n=r(504);t.ElasticSearch=n.ElasticSearch},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElasticSearch=void 0;var n=r(505);t.ElasticSearch=n.ElasticSearch},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenServiceParameter=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(1===i.length?r+="'displayFilter':\""+i[0]+'",':r+="'displayFilter':\""+i[s]+'",'),(o=e.displayOrderBy)&&o.length>0&&(1===o.length?r+="'displayOrderBy':'"+o[0]+"',":r+="'displayOrderBy':'"+o[s]+"',"),(t=e.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+a.Util.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[s]&&(r+="'joinItems':["+a.Util.toJSON(e.joinItems[s])+"],"),e.datasetNames&&e.dataSourceNames){var u=e.datasetNames[s]?s:e.datasetNames.length-1,c=e.dataSourceNames[s]?s:e.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+e.datasetNames[u]+"','dataSourceName': '"+e.dataSourceNames[c]+"'}},"}else r+="},"}e.themes&&e.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var p=this.url.split("/");return r+="'name': '"+p[p.length-2]+"'}]"}}]),t}();i.SuperMap.ThemeService=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeLabelUniqueItem=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(n+='"subLayers":'+e.toJSON()),n+=',"visible":true,',n+='"name":"'+this.getMapName(this.mapUrl)+'"',n+="}]",t.request({method:"PUT",data:n,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}},{key:"createTempLayerComplete",value:function(e){(e=a.Util.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams)}},{key:"getMapName",value:function(e){var t=e;"/"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1));var r=t.lastIndexOf("/");return t.substring(r+1,t.length)}},{key:"serviceProcessCompleted",value:function(e){null!=(e=a.Util.transformResult(e))&&null!=this.lastparams&&(e.newResourceID=this.lastparams.resourceID),this.events.triggerEvent("processCompleted",{result:e})}}]),t}();i.SuperMap.SetLayerStatusService=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SetLayersInfoService=void 0;var n=function(){function e(e,t){for(var r=0;r=200&&e.code<300||0==e.code||304===e.code,r=e.code&&t;!e.code||r?this.events&&this.events.triggerEvent("processCompleted",{result:e}):this.events.triggerEvent("processFailed",{error:e})}}]),t}();i.SuperMap.MapService=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KernelDensityJobsService=void 0;var n=function(){function e(e,t){for(var r=0;r0?e[0].subLayers.layers:null)?t.length:0,this.handleLayers(r,t),this.events.triggerEvent("processCompleted",{result:e[0]})}},{key:"handleLayers",value:function(e,t){var r;if(e)for(var n=0;n0)this.handleLayers(t[n].subLayers.layers.length,t[n].subLayers.layers);else switch(t[n].ugcLayerType){case"THEME":(r=new s.ServerTheme).fromJson(t[n]),t[n]=r;break;case"GRID":(r=new l.Grid).fromJson(t[n]),t[n]=r;break;case"IMAGE":(r=new u.UGCImage).fromJson(t[n]),t[n]=r;break;case"VECTOR":(r=new c.Vector).fromJson(t[n]),t[n]=r}}}}]),t}();i.SuperMap.GetLayersInfoService=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetGridCellInfosService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(t+=","),t+='{"x":'+i[r].x+',"y":'+i[r].y+"}";a+=t+="]"}else if(1==e.isAnalyzeById){for(var o="[",s=e.nodes,l=s.length,u=0;u0&&(o+=","),o+=s[u];a+=o+="]"}return a}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.tspPathList)return null;var t=new s.GeoJSON;return e.tspPathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}]),t}();i.SuperMap.FindTSPPathsService=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FindServiceAreasService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[i].x+',"y":'+t[i].y+"}";else if(1==e)for(var a=0;a0&&(r+=","),r+=t[a];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.serviceAreaList)return e;var t=new l.GeoJSON;return e.serviceAreaList.map(function(e){return e.serviceRegion&&(e.serviceRegion=t.toGeoJSON(e.serviceRegion)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e.routes&&(e.routes=t.toGeoJSON(e.routes)),e}),e}}]),t}();i.SuperMap.FindServiceAreasService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FindPathService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[i].x+',"y":'+t[i].y+"}";else if(1==e)for(var a=0;a0&&(r+=","),r+=t[a];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new l.GeoJSON;return e.pathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}]),t}();i.SuperMap.FindPathService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FindMTSPPathsService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[i].x+',"y":'+t[i].y+"}";else if(1==e)for(var a=0;a0&&(r+=","),r+=t[a];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.pathList)return null;var t=new l.GeoJSON;return e.pathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}]),t}();i.SuperMap.FindMTSPPathsService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FindLocationService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(t+=","),t+=a.Util.toJSON(e[n]);return t+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e)return null;var t=new l.GeoJSON;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}]),t}();i.SuperMap.FindLocationService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FindClosestFacilitiesService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[i].x+',"y":'+t[i].y+"}";else if(1==e)for(var a=0;a0&&(r+=","),r+=t[a];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.facilityPathList)return e;var t=new o.GeoJSON;return e.facilityPathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}]),t}();i.SuperMap.FindClosestFacilitiesService=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldStatisticService=void 0;var n=function(){function e(e,t){for(var r=0;r=0){var t=JSON.parse(e.data);return e.filterParam=t,e.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",e)}var r=JSON.parse(e.data);e.featureResult=r,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}},{key:"_connect",value:function(e){return e=this._appendCredentials(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}},{key:"_appendCredentials",value:function(e){var t=s.SecurityManager.getToken(e);return t&&(e+="?token="+t),e}}]),t}();i.SuperMap.DataFlowService=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComputeWeightMatrixService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[i].x+',"y":'+t[i].y+"}";else if(1==e)for(var a=0;a0&&(r+=","),r+=t[a];return r+="]"}}]),t}();i.SuperMap.ComputeWeightMatrixService=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChartQueryService=void 0;var n=function(){function e(e,t){for(var r=0;r0&&(e.content.map(function(e){return n.push(new p.IPortalMap(t+"/"+e.id,e)),e}),r.content=n,r.currentPage=e.currentPage,r.pageSize=e.pageSize,r.total=e.total,r.totalPage=e.totalPage),r})}},{key:"queryMapdashboards",value:function(e){if(!(e instanceof v.IPortalMapdashboardsQueryParam))return null;var t=void 0;return t=this.withCredentials?this.iportalUrl+"web/mycontent/mapdashboards":this.iportalUrl+"/web/mapdashboards",this.request("GET",t,e).then(function(e){var r={content:[]},n=[];return e.content&&e.content.length>0&&(e.content.map(function(e){return n.push(new y.IPortalMapdashboard(t+"/"+e.id,e)),e}),r.content=n,r.currentPage=e.currentPage,r.pageSize=e.pageSize,r.total=e.total,r.totalPage=e.totalPage),r})}},{key:"deleteMapdashboards",value:function(e){var t=this.iportalUrl+"/web/mapdashboardsworkspaces.json";return this.request("DELETE",t,{ids:encodeURI(JSON.stringify(e))})}},{key:"queryMapdashboard",value:function(e){var t=this.iportalUrl+"/web/mapdashboards/"+e,r=new y.IPortalMapdashboard(t);return r.load().then(function(){return r})}},{key:"queryInsights",value:function(e){if(!(e instanceof s.IPortalInsightsQueryParam))return null;var t=void 0;return t=this.withCredentials?this.iportalUrl+"web/mycontent/insightsworkspaces":this.iportalUrl+"/web/insightsworkspaces",this.request("GET",t,e).then(function(e){var r={content:[]},n=[];return e.content&&e.content.length>0&&(e.content.map(function(e){return n.push(new h.IPortalInsight(t+"/"+e.id,e)),e}),r.content=n,r.currentPage=e.currentPage,r.pageSize=e.pageSize,r.total=e.total,r.totalPage=e.totalPage),r})}},{key:"deleteInsights",value:function(e){var t=this.iportalUrl+"/web/insightsworkspaces.json";return this.request("DELETE",t,{ids:encodeURI(JSON.stringify(e))})}},{key:"queryInsight",value:function(e){var t=this.iportalUrl+"/web/insightsworkspaces/"+e,r=new h.IPortalInsight(t);return r.load().then(function(){return r})}},{key:"updateInsightAttrs",value:function(e,t){var r=this.iportalUrl+"/web/insightsworkspaces/"+e+"/attributes.json";return new h.IPortalInsight(r,t).update()}},{key:"deleteScenes",value:function(e){var t=this.iportalUrl+"/web/scenes.json";return this.request("DELETE",t,{ids:encodeURI(JSON.stringify(e))})}},{key:"queryScenes",value:function(e){if(!(e instanceof l.IPortalScenesQueryParam))return null;var t=void 0;return t=this.withCredentials?this.iportalUrl+"/web/mycontent/scenes":this.iportalUrl+"/web/scenes",this.request("GET",t,e).then(function(e){var r={content:[]},n=[];return e.content&&e.content.length>0&&(e.content.map(function(e){return n.push(new f.IPortalScene(t+"/"+e.id,e)),e}),r.content=n,r.currentPage=e.currentPage,r.pageSize=e.pageSize,r.total=e.total,r.totalPage=e.totalPage),r})}},{key:"queryScene",value:function(e){var t=this.iportalUrl+"/web/scenes/"+e,r=new f.IPortalScene(t);return r.load().then(function(){return r})}},{key:"updateSceneAttrs",value:function(e,t){var r=this.iportalUrl+"/web/scenes/"+e+"/attributes.json";return new f.IPortalScene(r,t).update()}}]),t}();i.SuperMap.iPortal=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IPortalScenesQueryParam=t.IPortalScene=t.IPortalInsightsQueryParam=t.IPortalInsight=t.IPortalMapdashboardsQueryParam=t.IPortalMapdashboard=t.IPortalServicesQueryParam=t.IPortalServiceBase=t.IPortalService=t.IPortalMapsQueryParam=t.IPortalMap=t.IPortal=void 0;var n=r(589),i=r(328),a=r(332),o=r(329),s=r(41),l=r(333),u=r(325),c=r(324),p=r(327),h=r(331),f=r(326),d=r(330); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.IPortal=n.IPortal,t.IPortalMap=i.IPortalMap,t.IPortalMapsQueryParam=a.IPortalMapsQueryParam,t.IPortalService=o.IPortalService,t.IPortalServiceBase=s.IPortalServiceBase,t.IPortalServicesQueryParam=l.IPortalServicesQueryParam,t.IPortalMapdashboard=u.IPortalMapdashboard,t.IPortalMapdashboardsQueryParam=c.IPortalMapdashboardsQueryParam,t.IPortalInsight=p.IPortalInsight,t.IPortalInsightsQueryParam=h.IPortalInsightsQueryParam,t.IPortalScene=f.IPortalScene,t.IPortalScenesQueryParam=d.IPortalScenesQueryParam},function(e,t,r){"use strict";var n,i,a;i=[t,e],void 0===(a="function"==typeof(n=function(e,t){var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=e,o=t.timeout||r.timeout,s=t.jsonpCallback||r.jsonpCallback,l=void 0;return new Promise(function(r,u){var c=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),p=s+"_"+c;window[c]=function(e){r({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),i(p),n(c)},a+=-1===a.indexOf("?")?"?":"&";var h=document.createElement("script");h.setAttribute("src",""+a+s+"="+c),h.id=p,document.getElementsByTagName("head")[0].appendChild(h),l=setTimeout(function(){u(new Error("JSONP request to "+e+" timed out")),n(c),i(p)},o)})}})?n.apply(t,i):n)||(e.exports=a)},function(e,t,r){"use strict";!function(t){if(t.__disableNativeFetch||!t.fetch){s.prototype.append=function(e,t){e=a(e),t=o(t);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(t)},s.prototype.delete=function(e){delete this.map[a(e)]},s.prototype.get=function(e){var t=this.map[a(e)];return t?t[0]:null},s.prototype.getAll=function(e){return this.map[a(e)]||[]},s.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},s.prototype.set=function(e,t){this.map[a(e)]=[o(t)]},s.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){e.call(t,n,r,this)},this)},this)};var r={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this)},p.call(h.prototype),p.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},d.error=function(){var e=new d(null,{status:0,statusText:""});return e.type="error",e};var i=[301,302,303,307,308];d.redirect=function(e,t){if(-1===i.indexOf(t))throw new RangeError("Invalid status code");return new d(null,{status:t,headers:{location:e}})},t.Headers=s,t.Request=h,t.Response=d,t.fetch=function(e,t){return new Promise(function(n,i){var a;a=h.prototype.isPrototypeOf(e)&&!t?e:new h(e,t);var o=new XMLHttpRequest;var l=!1;function u(){if(4===o.readyState){var e=1223===o.status?204:o.status;if(e<100||e>599){if(l)return;return l=!0,void i(new TypeError("Network request failed"))}var t={status:e,statusText:o.statusText,headers:function(e){var t=new s;return e.getAllResponseHeaders().trim().split("\n").forEach(function(e){var r=e.trim().split(":"),n=r.shift().trim(),i=r.join(":").trim();t.append(n,i)}),t}(o),url:"responseURL"in o?o.responseURL:/^X-Request-URL:/m.test(o.getAllResponseHeaders())?o.getResponseHeader("X-Request-URL"):void 0},r="response"in o?o.response:o.responseText;l||(l=!0,n(new d(r,t)))}}o.onreadystatechange=u,o.onload=u,o.onerror=function(){l||(l=!0,i(new TypeError("Network request failed")))},o.open(a.method,a.url,!0);try{"include"===a.credentials&&("withCredentials"in o?o.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(e){console&&console.warn&&console.warn("set withCredentials error:"+e)}"responseType"in o&&r.blob&&(o.responseType="blob"),a.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),o.send(void 0===a._bodyInit?null:a._bodyInit)})},t.fetch.polyfill=!0,void 0!==e&&e.exports&&(e.exports=t.fetch)}function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){this.map={},e instanceof s?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function c(e){var t=new FileReader;return t.readAsArrayBuffer(e),u(t)}function p(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(c)},this.text=function(){var e,t,r,n,i,a,o,s=l(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,r=new FileReader,n=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",i=/charset\=[0-9a-zA-Z\-\_]*;?/,a=e.type.match(i)||n.match(i),o=[e],a&&o.push(a[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,o),u(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=l(this);return e||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function h(e,t){var r,i,a=(t=t||{}).body;if(h.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,a||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new s(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),n.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a,t)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function d(e,t){t||(t={}),this._initBody(e,t),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof s?t.headers:new s(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:void 0)},function(e,t,r){"use strict";var n,i,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var u,c=[],p=!1,h=-1;function f(){p&&u&&(p=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!p){var e=l(f);p=!0;for(var t=c.length;t;){for(u=c,c=[];++h1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(594),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,r(138))},function(e,t,r){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(n){var i=setTimeout;function a(){}function o(e){if("object"!==r(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function s(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn(function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void u(t.promise,e)}l(t.promise,n)}else(1===e._state?l:u)(t.promise,e._value)})):e._deferreds.push(t)}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":r(t))||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void p((i=n,a=t,function(){i.apply(a,arguments)}),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}var i,a}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t=e.endTime&&(e.currentTime=e.endTime)}}}]),t}();a.SuperMap.TimeFlowControl=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeFlowControl=t.TimeControlBase=t.LogoBase64=void 0;var n=r(337),i=r(336),a=r(600);t.LogoBase64=n.LogoBase64, -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.TimeControlBase=i.TimeControlBase,t.TimeFlowControl=a.TimeFlowControl},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WKT=void 0;var n=function(){function e(e,t){for(var r=0;r0&&i.push(","),r=t[a].geometry,i.push(this.extractGeometry(r));return n&&i.push(")"),i.join("")}},{key:"extractGeometry",value:function(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")":null}}]),t}();i.SuperMap.Format.WKT=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WKT=t.GeoJSON=t.JSONFormat=t.Format=void 0;var n=r(140),i=r(19),a=r(139),o=r(602); -/* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved. - * This program are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/ -t.Format=n.Format,t.JSONFormat=a.JSONFormat,t.GeoJSON=i.GeoJSON,t.WKT=o.WKT},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateExt=void 0;var n=r(0);t.DateExt=n.SuperMap.Date={toISOString:function(){if("toISOString"in Date.prototype)return function(e){return e.toISOString()};var e=function(e,t){for(var r=e+"";r.length>3}if(i--,1===o||2===o)a+=t.readSVarint(),s+=t.readSVarint(),1===o&&(e&&u.push(e),e=[]),e.push(new n(a,s));else{if(7!==o)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}}return e&&u.push(e),u},o.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,o=0,i=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos>3}if(n--,1===r||2===r)o+=t.readSVarint(),i+=t.readSVarint(),os&&(s=o),il&&(l=i);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,l]},o.prototype.toGeoJSON=function(t,e,r){var n,i,s=this.extent*Math.pow(2,r),u=this.extent*t,l=this.extent*e,c=this.loadGeometry(),f=o.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))}t.exports=o,o.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 n(this._pbf,e,this.extent,this._keys,this._values)}},304:function(t,e,r){"use strict";var n=r(2651),o=r(5045),i=r(3174);t.exports={XMLParser:o,XMLValidator:n,XMLBuilder:i}},6392:function(t,e){"use strict";var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+r+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,r){if(e)for(var n=Object.keys(e),o=n.length,i=0;i5&&"xml"===n)return y("InvalidXml","XML declaration allowed only at the start of the document.",v(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function s(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},o,e);var r,u=[],l=!1,f=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var d=0;d"!==t[d]&&" "!==t[d]&&"\t"!==t[d]&&"\n"!==t[d]&&"\r"!==t[d];d++)g+=t[d];if("/"===(g=g.trim())[g.length-1]&&(g=g.substring(0,g.length-1),d--),r=g,!n.isName(r)){return y("InvalidTag",0===g.trim().length?"Invalid space after '<'.":"Tag '"+g+"' is an invalid name.",v(t,d))}var S=c(t,d);if(!1===S)return y("InvalidAttr","Attributes for '"+g+"' have open quote.",v(t,d));var w=S.value;if(d=S.index,"/"===w[w.length-1]){var _=d-w.length,O=p(w=w.substring(0,w.length-1),e);if(!0!==O)return y(O.err.code,O.err.msg,v(t,_+O.err.line));l=!0}else if(b){if(!S.tagClosed)return y("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",v(t,d));if(w.trim().length>0)return y("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",v(t,m));var E=u.pop();if(g!==E.tagName){var P=v(t,E.tagStartPos);return y("InvalidTag","Expected closing tag '"+E.tagName+"' (opened in line "+P.line+", col "+P.col+") instead of closing tag '"+g+"'.",v(t,m))}0==u.length&&(f=!0)}else{var x=p(w,e);if(!0!==x)return y(x.err.code,x.err.msg,v(t,d-w.length+x.err.line));if(!0===f)return y("InvalidXml","Multiple possible root nodes found.",v(t,d));-1!==e.unpairedTags.indexOf(g)||u.push({tagName:g,tagStartPos:m}),l=!0}for(d++;d0)||y("InvalidXml","Invalid '"+JSON.stringify(u.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):y("InvalidXml","Start tag expected.",1)};var u='"',l="'";function c(t,e){for(var r="",n="",o=!1;e"===t[e]&&""===n){o=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:o}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(t,e){for(var r=n.getAllMatches(t,f),o={},i=0;i","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(t){this.options=Object.assign({},a,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=u,this.options.format?(this.indentate=l,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(t,e,r){var n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function l(t){return this.options.indentBy.repeat(t)}function c(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}s.prototype.build=function(t){return this.options.preserveOrder?i(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=o({},this.options.arrayNodeName,t)),this.j2x(t,0).val)},s.prototype.j2x=function(t,e){var r="",o="";for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))if(void 0===t[i])this.isAttribute(i)&&(o+="");else if(null===t[i])this.isAttribute(i)?o+="":"?"===i[0]?o+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)o+=this.buildTextValNode(t[i],i,"",e);else if("object"!==n(t[i])){var a=this.isAttribute(i);if(a)r+=this.buildAttrPairStr(a,""+t[i]);else if(i===this.options.textNodeName){var s=this.options.tagValueProcessor(i,""+t[i]);o+=this.replaceEntitiesValue(s)}else o+=this.buildTextValNode(t[i],i,"",e)}else if(Array.isArray(t[i])){for(var u=t[i].length,l="",c=0;c"+t+o},s.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var o=this.options.tagValueProcessor(e,t);return""===(o=this.replaceEntitiesValue(o))?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+o+"0&&this.options.processEntities)for(var e=0;e0&&e.processEntities)for(var r=0;r0&&(s=e),function t(e,a,s,u){for(var l="",c=!1,f=0;f":l+=m+"/>":b&&0!==b.length||!a.suppressEmptyNode?b&&b.endsWith(">")?l+=m+">".concat(b).concat(u,""):(l+=m+">",b&&""!==u&&(b.includes("/>")||b.includes("")):l+=m+"/>",c=!0}else{var g=n(p[":@"],a),S="?xml"===h?"":u,w=p[h][0][a.textNodeName];w=0!==w.length?" "+w:"",l+=S+"<".concat(h).concat(w).concat(g,"?>"),c=!0}else l+=u+"\x3c!--".concat(p[h][0][a.textNodeName],"--\x3e"),c=!0;else c&&(l+=u),l+=""),c=!1;else{var _=p[h];o(y,a)||(_=i(_=a.tagValueProcessor(h,_),a)),c&&(l+=u),l+=_,c=!1}}}return l}(t,a,"",s)}},3214:function(t,e,r){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r"===t[e]){if(h?"-"===t[e-1]&&"-"===t[e-2]&&(h=!1,o--):o--,0===o)break}else"["===t[e]?i=!0:t[e];else{if(i&&u(t,e)){var y=n(a(t,(e+=7)+1),3);entityName=y[0],val=y[1],e=y[2],-1===val.indexOf("&")&&(r[p(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(i&&l(t,e))e+=8;else if(i&&c(t,e))e+=8;else if(i&&f(t,e))e+=9;else{if(!s)throw new Error("Invalid DOCTYPE");h=!0}o++}if(0!==o)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}},3070:function(t,e){var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}};e.buildOptions=function(t){return Object.assign({},r,t)},e.defaultOptions=r},2246:function(t,e,r){"use strict";function n(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return String.fromCharCode(Number.parseInt(e,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return String.fromCharCode(Number.parseInt(e,16))}}},this.addExternalEntities=p,this.parseXml=m,this.parseTextData=h,this.resolveNameSpace=y,this.buildAttributesMap=v,this.isItStopNode=w,this.replaceEntitiesValue=g,this.readStopNodeData=E,this.saveTextToParentTag=S,this.addChild=b});function p(t){for(var e=Object.keys(t),r=0;r0)){s||(t=this.replaceEntitiesValue(t));var u=this.options.tagValueProcessor(e,t,r,i,a);return null===u||void 0===u?t:o(u)!==o(t)||u!==t?u:this.options.trimValues?P(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?P(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function y(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var d=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function v(t,e,r){if(!this.options.ignoreAttributes&&"string"==typeof t){for(var n=s.getAllMatches(t,d),i=n.length,a={},u=0;u",a,"Closing Tag is not closed."),c=t.substring(a+2,s).trim();if(this.options.removeNSPrefix){var f=c.indexOf(":");-1!==f&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(o=this.saveTextToParentTag(o,r,i));var p=i.substring(i.lastIndexOf(".")+1);if(c&&-1!==this.options.unpairedTags.indexOf(c))throw new Error("Unpaired tag can not be used as closing tag: "));var h=0;p&&-1!==this.options.unpairedTags.indexOf(p)?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),r=this.tagsNodeStack.pop(),o="",a=s}else if("?"===t[a+1]){var y=O(t,a,!1,"?>");if(!y)throw new Error("Pi Tag is not closed.");if(o=this.saveTextToParentTag(o,r,i),this.options.ignoreDeclaration&&"?xml"===y.tagName||this.options.ignorePiTags);else{var d=new u(y.tagName);d.add(this.options.textNodeName,""),y.tagName!==y.tagExp&&y.attrExpPresent&&(d[":@"]=this.buildAttributesMap(y.tagExp,i,y.tagName)),this.addChild(r,d,i)}a=y.closeIndex+1}else if("!--"===t.substr(a+1,3)){var v=_(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var m=t.substring(a+4,v-2);o=this.saveTextToParentTag(o,r,i),r.add(this.options.commentPropName,[n({},this.options.textNodeName,m)])}a=v}else if("!D"===t.substr(a+1,2)){var b=l(t,a);this.docTypeEntities=b.entities,a=b.i}else if("!["===t.substr(a+1,2)){var g=_(t,"]]>",a,"CDATA is not closed.")-2,S=t.substring(a+9,g);o=this.saveTextToParentTag(o,r,i);var w=this.parseTextData(S,r.tagname,i,!0,!1,!0,!0);void 0==w&&(w=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[n({},this.options.textNodeName,S)]):r.add(this.options.textNodeName,w),a=g+2}else{var E=O(t,a,this.options.removeNSPrefix),P=E.tagName,x=E.rawTagName,T=E.tagExp,C=E.attrExpPresent,k=E.closeIndex;this.options.transformTagName&&(P=this.options.transformTagName(P)),r&&o&&"!xml"!==r.tagname&&(o=this.saveTextToParentTag(o,r,i,!1));var A=r;if(A&&-1!==this.options.unpairedTags.indexOf(A.tagname)&&(r=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),P!==e.tagname&&(i+=i?"."+P:P),this.isItStopNode(this.options.stopNodes,i,P)){var j="";if(T.length>0&&T.lastIndexOf("/")===T.length-1)a=E.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(P))a=E.closeIndex;else{var N=this.readStopNodeData(t,x,k+1);if(!N)throw new Error("Unexpected end of ".concat(x));a=N.i,j=N.tagContent}var I=new u(P);P!==T&&C&&(I[":@"]=this.buildAttributesMap(T,i,P)),j&&(j=this.parseTextData(j,P,i,!0,C,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),I.add(this.options.textNodeName,j),this.addChild(r,I,i)}else{if(T.length>0&&T.lastIndexOf("/")===T.length-1){"/"===P[P.length-1]?(P=P.substr(0,P.length-1),i=i.substr(0,i.length-1),T=P):T=T.substr(0,T.length-1),this.options.transformTagName&&(P=this.options.transformTagName(P));var M=new u(P);P!==T&&C&&(M[":@"]=this.buildAttributesMap(T,i,P)),this.addChild(r,M,i),i=i.substr(0,i.lastIndexOf("."))}else{var R=new u(P);this.tagsNodeStack.push(r),P!==T&&C&&(R[":@"]=this.buildAttributesMap(T,i,P)),this.addChild(r,R,i),r=R}o="",a=k}}else o+=t[a]}return e.child};function b(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}var g=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var n in this.lastEntities){var o=this.lastEntities[n];t=t.replace(o.regex,o.val)}if(this.options.htmlEntities)for(var i in this.htmlEntities){var a=this.htmlEntities[i];t=t.replace(a.regex,a.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function S(t,e,r,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function w(t,e,r){var n="*."+r;for(var o in t){var i=t[o];if(n===i||e===i)return!0}return!1}function _(t,e,r,n){var o=t.indexOf(e,r);if(-1===o)throw new Error(n);return o+e.length-1}function O(t,e,r){var n=function(t,e){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",o="",i=e;i3&&void 0!==arguments[3]?arguments[3]:">");if(n){var o=n.data,i=n.index,a=o.search(/\s/),s=o,u=!0;-1!==a&&(s=o.substring(0,a),o=o.substring(a+1).trimStart());var l=s;if(r){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==n.data.substr(c+1))}return{tagName:s,tagExp:o,closeIndex:i,attrExpPresent:u,rawTagName:l}}}function E(t,e,r){for(var n=r,o=1;r",r,"".concat(e," is not closed"));if(t.substring(r+2,i).trim()===e&&0===--o)return{tagContent:t.substring(n,r),i:i};r=i}else if("?"===t[r+1]){r=_(t,"?>",r+1,"StopNode is not closed.")}else if("!--"===t.substr(r+1,3)){r=_(t,"--\x3e",r+3,"StopNode is not closed.")}else if("!["===t.substr(r+1,2)){r=_(t,"]]>",r,"StopNode is not closed.")-2}else{var a=O(t,r,">");if(a)(a&&a.tagName)===e&&"/"!==a.tagExp[a.tagExp.length-1]&&o++,r=a.closeIndex}}function P(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&c(t,r)}return s.isExist(t)?t:""}t.exports=f},5045:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r0&&(u[i.textNodeName]=s):void 0!==s&&(u[i.textNodeName]=s),u}(t,e)}},4670:function(t){"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){for(var r=0;r0?this.child.push(r(r({},t.tagname,t.child),":@",t[":@"])):this.child.push(r({},t.tagname,t.child))}}])&&n(t.prototype,e),o&&n(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,o}();t.exports=i},1358:function(t){!function(e){"use strict";if(e.__disableNativeFetch||!e.fetch){s.prototype.append=function(t,e){t=i(t),e=a(e);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(e)},s.prototype.delete=function(t){delete this.map[i(t)]},s.prototype.get=function(t){var e=this.map[i(t)];return e?e[0]:null},s.prototype.getAll=function(t){return this.map[i(t)]||[]},s.prototype.has=function(t){return this.map.hasOwnProperty(i(t))},s.prototype.set=function(t,e){this.map[i(t)]=[a(e)]},s.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){t.call(e,n,r,this)},this)},this)};var r={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this)},f.call(p.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var o=[301,302,303,307,308];y.redirect=function(t,e){if(-1===o.indexOf(e))throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},e.Headers=s,e.Request=p,e.Response=y,e.fetch=function(t,e){return new Promise(function(n,o){var i;i=p.prototype.isPrototypeOf(t)&&!e?t:new p(t,e);var a=new XMLHttpRequest;var u=!1;function l(){if(4===a.readyState){var t=1223===a.status?204:a.status;if(t<100||t>599){if(u)return;return u=!0,void o(new TypeError("Network request failed"))}var e={status:t,statusText:a.statusText,headers:function(t){var e=new s;return t.getAllResponseHeaders().trim().split("\n").forEach(function(t){var r=t.trim().split(":"),n=r.shift().trim(),o=r.join(":").trim();e.append(n,o)}),e}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;u||(u=!0,n(new y(r,e)))}}a.onreadystatechange=l,a.onload=l,a.onerror=function(){u||(u=!0,o(new TypeError("Network request failed")))},a.open(i.method,i.url,!0);try{"include"===i.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(t){console&&console.warn&&console.warn("set withCredentials error:"+t)}"responseType"in a&&r.blob&&(a.responseType="blob"),i.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0,t.exports&&(t.exports=e.fetch)}function i(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function c(t){var e=new FileReader;return e.readAsArrayBuffer(t),l(e)}function f(){return this.bodyUsed=!1,this._initBody=function(t,e){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(r.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t,this._options=e;else if(r.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(c)},this.text=function(){var t,e,r,n,o,i,a,s=u(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=this._options,r=new FileReader,n=e.headers.map["content-type"]?e.headers.map["content-type"].toString():"",o=/charset\=[0-9a-zA-Z\-\_]*;?/,i=t.type.match(o)||n.match(o),a=[t],i&&a.push(i[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),l(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=u(this);return t||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(t,e){var r,o,i=(e=e||{}).body;if(p.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,i||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=(r=e.method||this.method||"GET",o=r.toUpperCase(),n.indexOf(o)>-1?o:r),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i,e)}function h(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function y(t,e){e||(e={}),this._initBody(t,e),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof s?e.headers:new s(e.headers),this.url=e.url||""}}("undefined"!=typeof self?self:this)},3678:function(t,e){var r,n,o;n=[e,t],void 0===(o="function"==typeof(r=function(t,e){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(t){try{delete window[t]}catch(e){window[t]=void 0}}function o(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t,a=e.timeout||r.timeout,s=e.jsonpCallback||r.jsonpCallback,u=void 0;return new Promise(function(r,l){var c=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),f=s+"_"+c;window[c]=function(t){r({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),o(f),n(c)},i+=-1===i.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+i+s+"="+c),e.charset&&p.setAttribute("charset",e.charset),p.id=f,document.getElementsByTagName("head")[0].appendChild(p),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),n(c),o(f),window[c]=function(){n(c)}},a),p.onerror=function(){l(new Error("JSONP request to "+t+" failed")),n(c),o(f),u&&clearTimeout(u)}})}})?r.apply(e,n):r)||(t.exports=o)},4933:function(t,e){e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,c=-7,f=r?o-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+t[e+f],f+=p,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=l}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,l=8*i-o-1,c=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-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=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*u-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=y,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=y,a/=256,l-=8);t[r+h-y]|=128*d}},3448:function(t){var e=[],r=[],n="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function o(t,o){if(o=o||{},void 0===t)throw new Error(n);var i,a=!0===o.prepend?"prepend":"append",s=void 0!==o.container?o.container:document.querySelector("head"),u=e.indexOf(s);return-1===u&&(u=e.push(s)-1,r[u]={}),void 0!==r[u]&&void 0!==r[u][a]?i=r[u][a]:(i=r[u][a]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===a?s.insertBefore(i,s.childNodes[0]):s.appendChild(i)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),i.styleSheet?i.styleSheet.cssText+=t:i.textContent+=t,i}t.exports=o,t.exports.insertCss=o},3871:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(5306),i="&&",a="||",s="and",u="or",l="=",c="~",f="!"+l,p="!"+c,h=">",y=">=",d="<",v="<=",m="*",b=",",g=".",S="(",w=")",_="where",O={pathway:[],groups:{}},E={},P={},x=console.log;function T(t){var e=k(t,_),r=e[0],n=e[1];O.pathway=k(r,b);for(var o=0,s=O.pathway.length;ou&&-1!==u){var T="gr_"+(new Date).getTime();O.groups[T]=n.substring(u+1,P),n=n.replace(S+O.groups[T]+w,T),x=-1}x+=1}!function t(e,r){var n=C(r,i),o=C(r,a);if(n!==Number.MAX_VALUE||o!==Number.MAX_VALUE)if(n-1}function j(t,e){var r=k(e,g),n=t;for(var i in r){if(!n.hasOwnProperty(r[i]))return"";n=n[r[i]]}return n=o.isDate(n)?n.valueOf():o.isDateString(n)?o.parseDateFromString(n):n.toString()}function N(t,e){var r=!1;for(var n in t){if(r=r||(n===s?I:n===u?N:M)(t[n],e),P.trace&&x(O.step,"======((( or",t[n],r),r)return r}return r}function I(t,e){var r=!0;for(var n in t){if(r=r&&(n===s?I:n===u?N:M)(t[n],e),P.trace&&x(O.step,"======((( and",t[n],r),!r)return r}return r}function M(t,e){if(O.step+=1,t.or){var r=N(t.or,e);return P.trace&&x(O.step,"OR",t,r),r}if(t.and){r=I(t.and,e);return P.trace&&x(O.step,"AND",t,r),r}if("object"===n(t))return t.eq?j(e,t.eq[0])===t.eq[1]:t.ne?j(e,t.ne[0])!==t.ne[1]:t.req?A(j(e,t.req[0]),t.req[1]):t.nreq?!A(j(e,t.nreq[0]),t.nreq[1]):t.gt?j(e,t.gt[0])>t.gt[1]:t.ge?j(e,t.ge[0])>=t.ge[1]:t.lt?j(e,t.lt[0])0?n.map(function(t){for(var e={},r=0,n=O.pathway.length;r-1},Tt.prototype.set=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ct.prototype.clear=function(){this.__data__={hash:new xt,map:new(yt||Tt),string:new xt}},Ct.prototype.delete=function(t){return Dt(this,t).delete(t)},Ct.prototype.get=function(t){return Dt(this,t).get(t)},Ct.prototype.has=function(t){return Dt(this,t).has(t)},Ct.prototype.set=function(t,e){return Dt(this,t).set(t,e),this},kt.prototype.clear=function(){this.__data__=new Tt},kt.prototype.delete=function(t){return this.__data__.delete(t)},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Tt){var n=r.__data__;if(!yt||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=a}(t.length)&&!Kt(t)}var Wt=ft||function(){return!1};function Kt(t){var e=Yt(t)?et.call(t):"";return e==c||e==f}function Yt(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function Qt(t){return Jt(t)?At(t):function(t){if(!Vt(t))return pt(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return It(t,!0,!0)}},311:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=200,i="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Function]",l="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,f="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,h=f||p||Function("return this")();function y(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var o=t.length,i=r+(n?1:-1);for(;n?i--:++i-1}function d(t,e,r){for(var n=-1,o=t?t.length:0;++n=o&&(s=b,u=!1,e=new F(e));t:for(;++a-1},D.prototype.set=function(t,e){var r=this.__data__,n=U(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},B.prototype.clear=function(){this.__data__={hash:new L,map:new(M||D),string:new L}},B.prototype.delete=function(t){return z(this,t).delete(t)},B.prototype.get=function(t){return z(this,t).get(t)},B.prototype.has=function(t){return z(this,t).has(t)},B.prototype.set=function(t,e){return z(this,t).set(t,e),this},F.prototype.add=F.prototype.push=function(t){return this.__data__.set(t,i),this},F.prototype.has=function(t){return this.__data__.has(t)};var J,W,K=(J=function(t,e){return X(t)?G(t,function t(e,r,n,o,i){var a=-1,s=e.length;for(n||(n=q),i||(i=[]);++a0&&n(u)?r>1?t(u,r-1,n,o,i):v(i,u):o||(i[i.length]=u)}return i}(e,1,X,!0)):[]},W=I(void 0===W?J.length-1:W,0),function(){for(var t=arguments,e=-1,r=I(t.length-W,0),n=Array(r);++e-1&&t%1==0&&t<=a}(t.length)&&!Z(t)}function X(t){return function(t){return!!t&&"object"==n(t)}(t)&&Q(t)}function Z(t){var e=$(t)?T.call(t):"";return e==u||e==l}function $(t){var e=n(t);return!!t&&("object"==e||"function"==e)}t.exports=K},8518:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=9007199254740991,i="[object Arguments]",a="[object Function]",s="[object GeneratorFunction]",u="[object Map]",l="[object Set]",c=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,p="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,y=p||h||Function("return this")();function d(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1&&t%1==0&&t<=o}(t.length)&&!K(t)}function K(t){var e=Y(t)?P.call(t):"";return e==a||e==s}function Y(t){var e=n(t);return!!t&&("object"==e||"function"==e)}var Q,X=(Q=function(t){return W(t)?F(t):G(t)},function(t){var e,r,n,o=z(t);return o==u?(e=t,r=-1,n=Array(e.size),e.forEach(function(t,e){n[++r]=[e,t]}),n):o==l?function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=[t,t]}),r}(t):d(t,Q(t))});t.exports=X},44:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var o=200,i="Expected a function",a="__lodash_hash_undefined__",s=1,u=2,l=1/0,c=9007199254740991,f="[object Arguments]",p="[object Array]",h="[object Boolean]",y="[object Date]",d="[object Error]",v="[object Function]",m="[object GeneratorFunction]",b="[object Map]",g="[object Number]",S="[object Object]",w="[object RegExp]",_="[object Set]",O="[object String]",E="[object Symbol]",P="[object ArrayBuffer]",x="[object DataView]",T=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/,k=/^\./,A=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/\\(\\)?/g,N=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[f]=M[p]=M[P]=M[h]=M[x]=M[y]=M[d]=M[v]=M[b]=M[g]=M[S]=M[w]=M[_]=M[O]=M["[object WeakMap]"]=!1;var R="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,L="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,D=R||L||Function("return this")(),B="object"==n(e)&&e&&!e.nodeType&&e,F=B&&"object"==n(t)&&t&&!t.nodeType&&t,U=F&&F.exports===B&&R.process,G=function(){try{return U&&U.binding("util")}catch(t){}}(),V=G&&G.isTypedArray;function z(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var o=t.length,i=r+(n?1:-1);for(;n?i--:++i-1}function H(t,e,r){for(var n=-1,o=t?t.length:0;++n-1},kt.prototype.set=function(t,e){var r=this.__data__,n=Mt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},At.prototype.clear=function(){this.__data__={hash:new Ct,map:new(dt||kt),string:new Ct}},At.prototype.delete=function(t){return Ht(this,t).delete(t)},At.prototype.get=function(t){return Ht(this,t).get(t)},At.prototype.has=function(t){return Ht(this,t).has(t)},At.prototype.set=function(t,e){return Ht(this,t).set(t,e),this},jt.prototype.add=jt.prototype.push=function(t){return this.__data__.set(t,a),this},jt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.clear=function(){this.__data__=new kt},Nt.prototype.delete=function(t){return this.__data__.delete(t)},Nt.prototype.get=function(t){return this.__data__.get(t)},Nt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof kt){var n=r.__data__;if(!dt||n.lengthl))return!1;var f=i.get(t);if(f&&i.get(e))return f==e;var p=-1,h=!0,y=o&s?new jt:void 0;for(i.set(t,e),i.set(e,t);++p-1&&t%1==0&&t-1&&t%1==0&&t<=c}function se(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function ue(t){return!!t&&"object"==n(t)}function le(t){return"symbol"==n(t)||ue(t)&&st.call(t)==E}var ce=V?function(t){return function(e){return t(e)}}(V):function(t){return ue(t)&&ae(t.length)&&!!M[st.call(t)]};function fe(t){return oe(t)?It(t):Ut(t)}function pe(t){return t}t.exports=function(t,e){return t&&t.length?function(t,e,r){var n=-1,i=z,a=t.length,s=!0,u=[],l=u;if(r)s=!1,i=H;else if(a>=o){var c=e?null:Vt(t);if(c)return Q(c);s=!1,i=W,l=new jt}else l=e?[]:u;t:for(;++n15?(r=Date.now(),a(t)):(e.push(t),1===e.length&&o.setAttribute("a",n=!n))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.globalScope=i.isNodejs?e:"undefined"==typeof self?window:self,i.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},i.isArrayBufferView=function(t){return t&&i.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},i.ByteBuffer=u,i.ByteStringBuffer=u,i.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},i.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},i.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},i.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(i.encodeUtf8(t))},i.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},i.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},i.ByteStringBuffer.prototype.putInt=function(t,e){a(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e},i.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},i.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},i.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},i.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},i.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var t=i.createBuffer(this.data);return t.read=this.read,t},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},i.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},i.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(t,e){a(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},i.DataBuffer.prototype.putSignedInt=function(t,e){return a(e),this.accommodate(e/8),t<0&&(t+=2<0);return e},i.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},i.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},i.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},i.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},i.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},i.xorBytes=function(t,e,r){for(var n="",o="",i="",a=0,s=0;r>0;--r,++a)o=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(n+=i,i="",s=0),i+=String.fromCharCode(o),++s;return n+i},i.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(t,e){for(var r,n,o,i="",a="",s=0;s>2),i+=l.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=l.charAt((15&n)<<2|o>>6),i+=isNaN(o)?"=":l.charAt(63&o)),e&&i.length>e&&(a+=i.substr(0,e)+"\r\n",i=i.substr(e));return a+i},i.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,o,i="",a=0;a>4),64!==n&&(i+=String.fromCharCode((15&r)<<4|n>>2),64!==o&&(i+=String.fromCharCode((3&n)<<6|o)));return i},i.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},i.decodeUtf8=function(t){return decodeURIComponent(escape(t))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:o.encode,decode:o.decode}},i.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},i.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var o=r=r||0,i=0;i>2),i+=l.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=l.charAt((15&n)<<2|o>>6),i+=isNaN(o)?"=":l.charAt(63&o)),e&&i.length>e&&(a+=i.substr(0,e)+"\r\n",i=i.substr(e));return a+i},i.binary.base64.decode=function(t,e,r){var n,o,i,a,s=e;s||(s=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==i&&(s[l++]=(15&o)<<4|i>>2,64!==a&&(s[l++]=(3&i)<<6|a));return e?l-r:s.subarray(0,l)},i.binary.base58.encode=function(t,e){return i.binary.baseN.encode(t,f,e)},i.binary.base58.decode=function(t,e){return i.binary.baseN.decode(t,f,e)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(t,e,r){t=i.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var o=r=r||0,a=0;a0&&i.push(r),a=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":o");break;case"%":i.push("%");break;default:i.push("<%"+s+"?>")}}return i.push(t.substring(a)),i.join("")},i.formatNumber=function(t,e,r,n){var o=t,i=isNaN(e=Math.abs(e))?2:e,a=void 0===r?",":r,s=void 0===n?".":n,u=o<0?"-":"",l=parseInt(o=Math.abs(+o||0).toFixed(i),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(i?a+Math.abs(o-l).toFixed(i).slice(2):"")},i.formatSize=function(t){return t>=1073741824?i.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?i.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?i.formatNumber(t/1024,0)+" KiB":i.formatNumber(t,0)+" bytes"},i.bytesFromIP=function(t){return-1!==t.indexOf(".")?i.bytesFromIPv4(t):-1!==t.indexOf(":")?i.bytesFromIPv6(t):null},i.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=i.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(a)}if(r.length>0){var l=r[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},i.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in i&&!t.update)return e(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,e(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,e(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,e(null,i.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()s.st&&o.sto.st&&s.ste){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}o.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},o.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},o.create=function(t,e,r,i,a){if(n.util.isArray(i)){for(var s=[],u=0;ur){if(a.strict){var y=new Error("Too few bytes to read ASN.1 value.");throw y.available=e.length(),y.remaining=r,y.requested=h,y}h=r}var d=32==(32&u);if(d)if(f=[],void 0===h)for(;;){if(i(e,r,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),r-=2;break}s=e.length(),f.push(t(e,r,n+1,a)),r-=s-e.length()}else for(;h>0;)s=e.length(),f.push(t(e,h,n+1,a)),r-=s-e.length(),h-=s-e.length();if(void 0===f&&l===o.Class.UNIVERSAL&&c===o.Type.BITSTRING&&(p=e.bytes(h)),void 0===f&&a.decodeBitStrings&&l===o.Class.UNIVERSAL&&c===o.Type.BITSTRING&&h>1){var v=e.read,m=r,b=0;if(c===o.Type.BITSTRING&&(i(e,r,1),b=e.getByte(),r--),0===b)try{s=e.length();var g=t(e,r,n+1,{strict:!0,decodeBitStrings:!0}),S=s-e.length();r-=S,c==o.Type.BITSTRING&&S++;var w=g.tagClass;S!==h||w!==o.Class.UNIVERSAL&&w!==o.Class.CONTEXT_SPECIFIC||(f=[g])}catch(t){}void 0===f&&(e.read=v,r=m)}if(void 0===f){if(void 0===h){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(c===o.Type.BMPSTRING)for(f="";h>0;h-=2)i(e,r,2),f+=String.fromCharCode(e.getInt16()),r-=2;else f=e.getBytes(h),r-=h}var _=void 0===p?null:{bitStringContents:p};return o.create(l,c,d,f,_)}(t,t.length(),0,e);if(e.parseAllBytes&&0!==t.length()){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=t.length(),s}return a},o.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,i=n.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=o.equals(t,t.original))),a)i.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:i.putByte(0);for(var s=0;s1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?i.putBytes(t.value.substr(1)):i.putBytes(t.value);if(e.putByte(r),i.length()<=127)e.putByte(127&i.length());else{var u=i.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(e.putByte(128|l.length),s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(i),e},o.oidToDer=function(t){var e,r,o,i,a=t.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,e||(i|=128),r.push(i),e=!1}while(o>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}return s},o.derToOid=function(t){var e;"string"==typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var o=0;t.length()>0;)o<<=7,128&(r=t.getByte())?o+=127&r:(e+="."+(o+r),o=0);return e},o.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(i,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},o.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),i=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var f=t.length-5,p=t.charAt(f);return"+"!==p&&"-"!==p||(l=60*parseInt(t.substr(f+1,2),10)+parseInt(t.substr(f+4,2),10),l*=6e4,"+"===p&&(l*=-1),c=!0),"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(r,n,o),e.setUTCHours(i,a,s,u),e.setTime(+e+l)):(e.setFullYear(r,n,o),e.setHours(i,a,s,u)),e},o.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},o.derToInteger=function(t){"string"==typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},o.validate=function(t,e,r,i){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)i&&(t.tagClass!==e.tagClass&&i.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&i.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&n.util.isArray(e.value))for(var s=0,u=0;a&&u0&&(i+="\n");for(var s="",u=0;u1?i+="0x"+n.util.bytesToHex(t.value.slice(1)):i+="(none)",t.value.length>0){var p=t.value.charCodeAt(0);1==p?i+=" (1 unused bit shown)":p>1&&(i+=" ("+p+" unused bits shown)")}}else if(t.type===o.Type.OCTETSTRING)a.test(t.value)||(i+="("+t.value+") "),i+="0x"+n.util.bytesToHex(t.value);else if(t.type===o.Type.UTF8)try{i+=n.util.decodeUtf8(t.value)}catch(e){if("URI malformed"!==e.message)throw e;i+="0x"+n.util.bytesToHex(t.value)+" (malformed UTF8)"}else t.type===o.Type.PRINTABLESTRING||t.type===o.Type.IA5String?i+=t.value:a.test(t.value)?i+="0x"+n.util.bytesToHex(t.value):0===t.value.length?i+="[null]":i+=t.value}return i}},function(t,e,r){var n=r(0);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){var n=r(0);function o(t,e){n.cipher.registerAlgorithm(t,function(){return new n.aes.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var o=y({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o},n.aes.createEncryptionCipher=function(t,e){return y({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var o=y({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o},n.aes.createDecryptionCipher=function(t,e){return y({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){c||f();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return h(r._w,t,e,!1)},decrypt:function(t,e){return h(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var o=0;o>>=2,o=0;o>8^255&f^99,i[d]=f,a[f]=d,h=(p=t[f])<<24^f<<16^f<<8^f^p,y=((r=t[d])^(n=t[r])^(o=t[n]))<<24^(d^o)<<16^(d^n^o)<<8^d^r^o;for(var m=0;m<4;++m)u[m][d]=h,l[m][f]=y,h=h<<24|h>>>8,y=y<<24|y>>>8;0===d?d=v=1:(d=r^t[t[t[r^o]]],v^=t[t[v]])}}function p(t,e){for(var r,n=t.slice(0),o=1,a=n.length,u=4*(a+6+1),c=a;c>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^s[o]<<24,o++):a>6&&c%a==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),n[c]=n[c-a]^r;if(e){for(var f,p=l[0],h=l[1],y=l[2],d=l[3],v=n.slice(0),m=(c=0,(u=n.length)-4);c>>24]]^h[i[f>>>16&255]]^y[i[f>>>8&255]]^d[i[255&f]];n=v}return n}function h(t,e,r,n){var o,s,c,f,p,h,y,d,v,m,b,g,S=t.length/4-1;n?(o=l[0],s=l[1],c=l[2],f=l[3],p=a):(o=u[0],s=u[1],c=u[2],f=u[3],p=i),h=e[0]^t[0],y=e[n?3:1]^t[1],d=e[2]^t[2],v=e[n?1:3]^t[3];for(var w=3,_=1;_>>24]^s[y>>>16&255]^c[d>>>8&255]^f[255&v]^t[++w],b=o[y>>>24]^s[d>>>16&255]^c[v>>>8&255]^f[255&h]^t[++w],g=o[d>>>24]^s[v>>>16&255]^c[h>>>8&255]^f[255&y]^t[++w],v=o[v>>>24]^s[h>>>16&255]^c[y>>>8&255]^f[255&d]^t[++w],h=m,y=b,d=g;r[0]=p[h>>>24]<<24^p[y>>>16&255]<<16^p[d>>>8&255]<<8^p[255&v]^t[++w],r[n?3:1]=p[y>>>24]<<24^p[d>>>16&255]<<16^p[v>>>8&255]<<8^p[255&h]^t[++w],r[2]=p[d>>>24]<<24^p[v>>>16&255]<<16^p[h>>>8&255]<<8^p[255&y]^t[++w],r[n?1:3]=p[v>>>24]<<24^p[h>>>16&255]<<16^p[y>>>8&255]<<8^p[255&d]^t[++w]}function y(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),o=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=t,o.call(e,r)},e}},function(t,e,r){var n=r(0);n.pki=n.pki||{};var o=t.exports=n.pki.oids=n.oids=n.oids||{};function i(t,e){o[t]=e,o[e]=t}function a(t,e){o[t]=e}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("1.3.14.3.2.29","sha1WithRSASignature"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("2.16.840.1.101.3.4.2.4","sha224"),i("2.16.840.1.101.3.4.2.5","sha512-224"),i("2.16.840.1.101.3.4.2.6","sha512-256"),i("1.2.840.113549.2.2","md2"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.4","surname"),i("2.5.4.5","serialNumber"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.12","title"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("2.5.4.42","givenName"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,r){var n=r(0);r(1);var o=t.exports=n.pem=n.pem||{};function i(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},o=0;o65&&-1!==a){var s=e[a];","===s?(++a,e=e.substr(0,a)+"\r\n "+e.substr(a)):e=e.substr(0,a)+"\r\n"+s+e.substr(a+1),i=o-a-1,a=-1,++o}else" "!==e[o]&&"\t"!==e[o]&&","!==e[o]||(a=o);return e}function a(t){return t.replace(/^\s+/,"")}o.encode=function(t,e){e=e||{};var r,o="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(o+=i(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(o+=i(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),o+=i(r)),t.headers)for(var a=0;ae.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),r=n.util.createBuffer(),o=n.util.createBuffer(),l=a.length(),u=0;u>>0,u>>>0];for(var l=o.fullMessageLength.length-1;l>=0;--l)o.fullMessageLength[l]+=u[1],u[1]=u[0]+(o.fullMessageLength[l]/4294967296>>>0),o.fullMessageLength[l]=o.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(i),s(t,r,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var u,l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-l));for(var c=8*o.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var p={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(p,r,a);var h=n.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h},o};var i=null,a=!1;function s(t,e,r){for(var n,o,i,a,s,u,l,c=r.length();c>=64;){for(o=t.h0,i=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,n=(o<<5|o>>>27)+(s^i&(a^s))+u+1518500249+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<20;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(o<<5|o>>>27)+(s^i&(a^s))+u+1518500249+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<32;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(o<<5|o>>>27)+(i^a^s)+u+1859775393+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<40;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(o<<5|o>>>27)+(i^a^s)+u+1859775393+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<60;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(o<<5|o>>>27)+(i&a|s&(i^a))+u+2400959708+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<80;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(o<<5|o>>>27)+(i^a^s)+u+3395469782+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+i|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}},function(t,e,r){var n=r(0);function o(t,e){n.cipher.registerAlgorithm(t,function(){return new n.des.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var o=y({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return o.start(e),o},n.des.createEncryptionCipher=function(t,e){return y({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var o=y({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return o.start(e),o},n.des.createDecryptionCipher=function(t,e){return y({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return h(r._keys,t,e,!1)},decrypt:function(t,e){return h(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],o=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=t.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],g=0,S=0;S>>4^_))<<4,w^=e=65535&((_^=e)>>>-16^w),w^=(e=858993459&(w>>>2^(_^=e<<-16)))<<2,w^=e=65535&((_^=e)>>>-16^w),w^=(e=1431655765&(w>>>1^(_^=e<<-16)))<<1,w^=e=16711935&((_^=e)>>>8^w),e=(w^=(e=1431655765&(w>>>1^(_^=e<<8)))<<1)<<8|(_^=e)>>>20&240,w=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=e;for(var O=0;O>>26,_=_<<2|_>>>26):(w=w<<1|w>>>27,_=_<<1|_>>>27);var E=r[(w&=-15)>>>28]|n[w>>>24&15]|o[w>>>20&15]|i[w>>>16&15]|a[w>>>12&15]|s[w>>>8&15]|u[w>>>4&15],P=l[(_&=-15)>>>28]|c[_>>>24&15]|f[_>>>20&15]|p[_>>>16&15]|h[_>>>12&15]|y[_>>>8&15]|d[_>>>4&15];e=65535&(P>>>16^E),m[g++]=E^e,m[g++]=P^e<<16}}return m}(e),this._init=!0}},o("DES-ECB",n.cipher.modes.ecb),o("DES-CBC",n.cipher.modes.cbc),o("DES-CFB",n.cipher.modes.cfb),o("DES-OFB",n.cipher.modes.ofb),o("DES-CTR",n.cipher.modes.ctr),o("3DES-ECB",n.cipher.modes.ecb),o("3DES-CBC",n.cipher.modes.cbc),o("3DES-CFB",n.cipher.modes.cfb),o("3DES-OFB",n.cipher.modes.ofb),o("3DES-CTR",n.cipher.modes.ctr);var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],l=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],c=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],p=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(t,e,r,n){var o,h,y=32===t.length?3:9;o=3===y?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var d=e[0],v=e[1];d^=(h=252645135&(d>>>4^v))<<4,d^=(h=65535&(d>>>16^(v^=h)))<<16,d^=h=858993459&((v^=h)>>>2^d),d^=h=16711935&((v^=h<<2)>>>8^d),d=(d^=(h=1431655765&(d>>>1^(v^=h<<8)))<<1)<<1|d>>>31,v=(v^=h)<<1|v>>>31;for(var m=0;m>>4|v<<28)^t[S+1];h=d,d=v,v=h^(a[w>>>24&63]|u[w>>>16&63]|c[w>>>8&63]|p[63&w]|i[_>>>24&63]|s[_>>>16&63]|l[_>>>8&63]|f[63&_])}h=d,d=v,v=h}v=v>>>1|v<<31,v^=h=1431655765&((d=d>>>1|d<<31)>>>1^v),v^=(h=16711935&(v>>>8^(d^=h<<1)))<<8,v^=(h=858993459&(v>>>2^(d^=h)))<<2,v^=h=65535&((d^=h)>>>16^v),v^=h=252645135&((d^=h<<16)>>>4^v),d^=h<<4,r[0]=d,r[1]=v}function y(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),o=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=t,o.call(e,r)},e}},function(t,e,r){var n=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===o)var o=n.jsbn.BigInteger;var i=n.util.isNodejs?r(16):null,a=n.asn1,u=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var l=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},p={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},y=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},v=function(t){var e;if(!(t.algorithm in l.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=l.oids[t.algorithm];var n=a.oidToDer(e).getBytes(),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);i.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),i.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(i),o.value.push(s),a.toDer(o).getBytes()},m=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var i;e.dP||(e.dP=e.d.mod(e.p.subtract(o.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(o.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{i=new o(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(i.compareTo(e.n)>=0||!i.gcd(e.n).equals(o.ONE));for(var a=(t=t.multiply(i.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u.multiply(i.modInverse(e.n)).mod(e.n)};function b(t,e,r){var o=n.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=i-11,a}o.putByte(0),o.putByte(r);var s,u=i-3-t.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function S(t,e,r){"function"==typeof e&&(r=e,e={});var i={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function a(){s(t.pBits,function(e,n){return e?r(e):(t.p=n,null!==t.q?u(e,t.q):void s(t.qBits,u))})}function s(t,e){n.prime.generateProbablePrime(t,i,e)}function u(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var i=t.p;t.p=t.q,t.q=i}if(0!==t.p.subtract(o.ONE).gcd(t.e).compareTo(o.ONE))return t.p=null,void a();if(0!==t.q.subtract(o.ONE).gcd(t.e).compareTo(o.ONE))return t.q=null,void s(t.qBits,u);if(t.p1=t.p.subtract(o.ONE),t.q1=t.q.subtract(o.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(o.ONE))return t.p=t.q=null,void a();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void s(t.qBits,u);var c=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(i.prng=e.prng),a()}function w(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function _(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function O(t){return n.util.isNodejs&&"function"==typeof i[t]}function E(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.crypto)&&"object"==s(u.globalScope.crypto.subtle)&&"function"==typeof u.globalScope.crypto.subtle[t]}function P(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.msCrypto)&&"object"==s(u.globalScope.msCrypto.subtle)&&"function"==typeof u.globalScope.msCrypto.subtle[t]}function x(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),o=0;o0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},l.rsa.decrypt=function(t,e,r,i){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new o(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=m(u,e,r).toString(16),c=n.util.createBuffer(),f=a-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==i?g(c.getBytes(),e,r):c.getBytes()},l.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var i,a=(r=r||{}).prng||n.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),r=0;r>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},l.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new o(null);r.fromInt(30);for(var n,i=0,a=function(t,e){return t|e},s=+new Date,u=0;null===t.keys&&(e<=0||uf?t.pqState=0:t.num.isProbablePrime(_(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[i++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(o.ONE).gcd(t.e).compareTo(o.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(o.ONE),t.q1=t.q.subtract(o.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(o.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var h=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,h,t.p,t.q,h.mod(t.p1),h.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)}}u+=(n=+new Date)-s,s=n}return null!==t.keys},l.rsa.generateKeyPair=function(t,e,r,o){if(1===arguments.length?"object"==s(t)?(r=t,t=void 0):"function"==typeof t&&(o=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(o=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,o=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(o=r,r=void 0):(o=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(o){if(O("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(t,e,r){if(t)return o(t);o(null,{privateKey:l.privateKeyFromPem(r),publicKey:l.publicKeyFromPem(e)})});if(E("generateKey")&&E("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:x(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return u.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){o(t)}).then(function(t){if(t){var e=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));o(null,{privateKey:e,publicKey:l.setRsaPublicKey(e.n,e.e)})}});if(P("generateKey")&&P("exportKey")){var c=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:x(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=u.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));o(null,{privateKey:r,publicKey:l.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){o(t)}},void(c.onerror=function(t){o(t)})}}else if(O("generateKeyPairSync")){var f=i.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:l.privateKeyFromPem(f.privateKey),publicKey:l.publicKeyFromPem(f.publicKey)}}var p=l.rsa.createKeyPairGenerationState(t,e,r);if(!o)return l.rsa.stepKeyPairGenerationState(p,0),p.keys;S(p,r,o)},l.setRsaPublicKey=l.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,o){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return b(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,o)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var i=e.encode(t,r,!0);return l.rsa.encrypt(i,r,!0)},verify:function(t,e,o,i){"string"==typeof o?o=o.toUpperCase():void 0===o&&(o="RSASSA-PKCS1-V1_5"),void 0===i&&(i={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in i||(i._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===o?o={verify:function(t,e){e=g(e,r,!0);var o=a.fromDer(e,{parseAllBytes:i._parseAllDigestBytes}),s={},u=[];if(!a.validate(o,d,s,u))throw(l=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,l;var l,c=a.derToOid(s.algorithmIdentifier);if(c!==n.oids.md2&&c!==n.oids.md5&&c!==n.oids.sha1&&c!==n.oids.sha224&&c!==n.oids.sha256&&c!==n.oids.sha384&&c!==n.oids.sha512&&c!==n.oids["sha512-224"]&&c!==n.oids["sha512-256"])throw(l=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=c,l;if(!(c!==n.oids.md2&&c!==n.oids.md5||"parameters"in s))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return t===s.digest}}:"NONE"!==o&&"NULL"!==o&&null!==o||(o={verify:function(t,e){return t===g(e,r,!0)}});var s=l.rsa.decrypt(e,r,!0,!1);return o.verify(t,s,r.n.bitLength())}};return r},l.setRsaPrivateKey=l.rsa.setPrivateKey=function(t,e,r,o,i,a,s,u){var c={n:t,e:e,d:r,p:o,q:i,dP:a,dQ:s,qInv:u,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var o=l.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:g};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(o,c,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:v},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,c.n.bitLength());return l.rsa.encrypt(n,c,r)}};return c},l.wrapRsaPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(t).getBytes())])},l.privateKeyFromAsn1=function(t){var e,r,i,s,u,c,h,y,d={},v=[];if(a.validate(t,f,d,v)&&(t=a.fromDer(n.util.createBuffer(d.privateKey))),d={},v=[],!a.validate(t,p,d,v)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=v,m}return e=n.util.createBuffer(d.privateKeyModulus).toHex(),r=n.util.createBuffer(d.privateKeyPublicExponent).toHex(),i=n.util.createBuffer(d.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(d.privateKeyPrime1).toHex(),u=n.util.createBuffer(d.privateKeyPrime2).toHex(),c=n.util.createBuffer(d.privateKeyExponent1).toHex(),h=n.util.createBuffer(d.privateKeyExponent2).toHex(),y=n.util.createBuffer(d.privateKeyCoefficient).toHex(),l.setRsaPrivateKey(new o(e,16),new o(r,16),new o(i,16),new o(s,16),new o(u,16),new o(c,16),new o(h,16),new o(y,16))},l.privateKeyToAsn1=l.privateKeyToRSAPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.qInv))])},l.publicKeyFromAsn1=function(t){var e={},r=[];if(a.validate(t,y,e,r)){var i,s=a.derToOid(e.publicKeyOid);if(s!==l.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=s,i;t=e.rsaPublicKey}if(r=[],!a.validate(t,h,e,r))throw(i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,i;var u=n.util.createBuffer(e.publicKeyModulus).toHex(),c=n.util.createBuffer(e.publicKeyExponent).toHex();return l.setRsaPublicKey(new o(u,16),new o(c,16))},l.publicKeyToAsn1=l.publicKeyToSubjectPublicKeyInfo=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[l.publicKeyToRSAPublicKey(t)])])},l.publicKeyToRSAPublicKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.e))])}},function(t,e,r){var n,o=r(0);function i(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new i(null)}function s(t,e,r,n,o,i){for(var a=16383&e,s=e>>14;--i>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;o=((u=a*u+((16383&c)<<14)+r.data[n]+o)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return o}t.exports=o.jsbn=o.jsbn||{},o.jsbn.BigInteger=i,"undefined"==typeof navigator?(i.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(t,e,r,n,o,i){for(var a=32767&e,s=e>>15;--i>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;o=((u=a*u+((32767&c)<<15)+r.data[n]+(1073741823&o))>>>30)+(c>>>15)+s*l+(o>>>30),r.data[n++]=1073741823&u}return o},n=30):"Netscape"!=navigator.appName?(i.prototype.am=function(t,e,r,n,o,i){for(;--i>=0;){var a=e*this.data[t++]+r.data[n]+o;o=Math.floor(a/67108864),r.data[n++]=67108863&a}return o},n=26):(i.prototype.am=s,n=28),i.prototype.DB=n,i.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function d(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function O(){}function E(t){return t}function P(t){this.r2=a(),this.q3=a(),i.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}d.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},d.prototype.revert=function(t){return t},d.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},d.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(i.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},i.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},i.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},i.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,o=!1,a=0;--n>=0;){var s=8==r?255&t[n]:p(t,n);s<0?"-"==t.charAt(n)&&(o=!0):(o=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},i.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},i.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e.data[r+a+1]=this.data[r]>>o|s,s=(this.data[r]&i)<=0;--r)e.data[r]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},i.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,o=this.DB-n,i=(1<>n;for(var a=r+1;a>n;n>0&&(e.data[this.t-r-1]|=(this.s&i)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},i.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},i.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(c,s),o.lShiftTo(c,r)):(n.copyTo(s),o.copyTo(r));var f=s.t,p=s.data[f-1];if(0!=p){var h=p*(1<1?s.data[f-2]>>this.F2:0),d=this.FV/h,v=(1<=0&&(r.data[r.t++]=1,r.subTo(S,r)),i.ONE.dlShiftTo(f,S),S.subTo(s,s);s.t=0;){var w=r.data[--b]==p?this.DM:Math.floor(r.data[b]*d+(r.data[b-1]+m)*v);if((r.data[b]+=s.am(0,w,r,g,0,f))0&&r.rShiftTo(c,r),u<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(t,e){if(t>4294967295||t<1)return i.ONE;var r=a(),n=a(),o=e.convert(this),s=y(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var u=r;r=n,n=u}return e.revert(r)},i.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(s>s)>0&&(o=!0,i=f(r));a>=0;)s>(s+=this.DB-e)):(r=this.data[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=f(r));return o?i:"0"},i.prototype.negate=function(){var t=a();return i.ZERO.subTo(this,t),t},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+y(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(i.ZERO)>0&&t.subTo(e,e),e},i.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new d(e):new v(e),this.exp(t,r)},i.ZERO=h(0),i.ONE=h(1),O.prototype.convert=E,O.prototype.revert=E,O.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},O.prototype.sqrTo=function(t,e){t.squareTo(e)},P.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},P.prototype.revert=function(t){return t},P.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},P.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},P.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=(1<<26)/x[x.length-1];i.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},i.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=h(r),o=a(),i=a(),s="";for(this.divRemTo(n,o,i);o.signum()>0;)s=(r+i.intValue()).toString(t).substr(1)+s,o.divRemTo(n,o,i);return i.intValue().toString(t)+s},i.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),o&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(i.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(i.ONE.shiftLeft(t-1),this);else{var n=new Array,o=7&t;n.length=1+(t>>3),e.nextBytes(n),o>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},i.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},i.prototype.multiplyLowerTo=function(t,e,r){var n,o=Math.min(this.t+t.t,e);for(r.s=0,r.t=o;o>0;)r.data[--o]=0;for(n=r.t-this.t;o=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},i.prototype.millerRabin=function(t){var e=this.subtract(i.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,o=e.shiftRight(r),a={nextBytes:function(t){for(var e=0;e=0);var u=n.modPow(o,this);if(0!=u.compareTo(i.ONE)&&0!=u.compareTo(e)){for(var l=1;l++>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,o=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[o++]=r|this.s<=0;)n<8?(r=(this.data[t]&(1<>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(e[o++]=r);return e},i.prototype.equals=function(t){return 0==this.compareTo(t)},i.prototype.min=function(t){return this.compareTo(t)<0?this:t},i.prototype.max=function(t){return this.compareTo(t)>0?this:t},i.prototype.and=function(t){var e=a();return this.bitwiseTo(t,m,e),e},i.prototype.or=function(t){var e=a();return this.bitwiseTo(t,b,e),e},i.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,g,e),e},i.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,S,e),e},i.prototype.not=function(){for(var t=a(),e=0;e=this.t?0!=this.s:0!=(this.data[e]&1<1){var f=a();for(n.sqrTo(s[1],f);u<=c;)s[u]=a(),n.mulTo(f,s[u-2],s[u]),u+=2}var p,m,b=t.t-1,g=!0,S=a();for(o=y(t.data[b])-1;b>=0;){for(o>=l?p=t.data[b]>>o-l&c:(p=(t.data[b]&(1<0&&(p|=t.data[b-1]>>this.DB+o-l)),u=r;0==(1&p);)p>>=1,--u;if((o-=u)<0&&(o+=this.DB,--b),g)s[p].copyTo(i),g=!1;else{for(;u>1;)n.sqrTo(i,S),n.sqrTo(S,i),u-=2;u>0?n.sqrTo(i,S):(m=i,i=S,S=m),n.mulTo(S,s[p],i)}for(;b>=0&&0==(t.data[b]&1<=0?(r.subTo(n,r),e&&o.subTo(s,o),a.subTo(u,a)):(n.subTo(r,n),e&&s.subTo(o,s),u.subTo(a,u))}return 0!=n.compareTo(i.ONE)?i.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},i.prototype.pow=function(t){return this.exp(t,new O)},i.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var o=e.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return e;for(o0&&(e.rShiftTo(i,e),r.rShiftTo(i,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=x[x.length-1]){for(e=0;e>>0,s>>>0];for(var u=o.fullMessageLength.length-1;u>=0;--u)o.fullMessageLength[u]+=s[1],s[1]=s[0]+(o.fullMessageLength[u]/4294967296>>>0),o.fullMessageLength[u]=o.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(i),c(t,r,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-s));for(var u,l=0,f=o.fullMessageLength.length-1;f>=0;--f)l=(u=8*o.fullMessageLength[f]+l)/4294967296>>>0,a.putInt32Le(u>>>0);var p={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};c(p,r,a);var h=n.util.createBuffer();return h.putInt32Le(p.h0),h.putInt32Le(p.h1),h.putInt32Le(p.h2),h.putInt32Le(p.h3),h},o};var i=null,a=null,s=null,u=null,l=!1;function c(t,e,r){for(var n,o,i,l,c,f,p,h=r.length();h>=64;){for(o=t.h0,i=t.h1,l=t.h2,c=t.h3,p=0;p<16;++p)e[p]=r.getInt32Le(),n=o+(c^i&(l^c))+u[p]+e[p],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;for(;p<32;++p)n=o+(l^c&(i^l))+u[p]+e[a[p]],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;for(;p<48;++p)n=o+(i^l^c)+u[p]+e[a[p]],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;for(;p<64;++p)n=o+(l^(i|~c))+u[p]+e[a[p]],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;t.h0=t.h0+o|0,t.h1=t.h1+i|0,t.h2=t.h2+l|0,t.h3=t.h3+c|0,h-=64}}},function(t,e,r){var n=r(0);r(8),r(4),r(1);var o,i=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(o=r(16)),t.exports=n.pbkdf2=i.pbkdf2=function(t,e,r,i,a,u){if("function"==typeof a&&(u=a,a=null),n.util.isNodejs&&!n.options.usePureJavaScript&&o.pbkdf2&&(null===a||"object"!=s(a))&&(o.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(t,e,r,i,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):o.pbkdf2(t,e,r,i,a,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):4===o.pbkdf2Sync.length?o.pbkdf2Sync(t,e,r,i).toString("binary"):o.pbkdf2Sync(t,e,r,i,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in n.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=n.md[a].create()}var l=a.digestLength;if(i>4294967295*l){var c=new Error("Derived key is too long.");if(u)return u(c);throw c}var f=Math.ceil(i/l),p=i-(f-1)*l,h=n.hmac.create();h.start(a,t);var y,d,v,m="";if(!u){for(var b=1;b<=f;++b){h.start(null,null),h.update(e),h.update(n.util.int32ToBytes(b)),y=v=h.digest().getBytes();for(var g=2;g<=r;++g)h.start(null,null),h.update(v),d=h.digest().getBytes(),y=n.util.xorBytes(y,d,l),v=d;m+=bf)return u(null,m);h.start(null,null),h.update(e),h.update(n.util.int32ToBytes(b)),y=v=h.digest().getBytes(),g=2,w()}function w(){if(g<=r)return h.start(null,null),h.update(v),d=h.digest().getBytes(),y=n.util.xorBytes(y,d,l),v=d,++g,n.util.setImmediate(w);m+=b128)throw new Error('Invalid "nsComment" content.');t.value=o.create(o.Class.UNIVERSAL,o.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===t.name&&e.cert){if(t.value=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),c=t.value.value,t.keyIdentifier){var y=!0===t.keyIdentifier?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;c.push(o.create(o.Class.CONTEXT_SPECIFIC,0,!1,y))}if(t.authorityCertIssuer){var d=[o.create(o.Class.CONTEXT_SPECIFIC,4,!0,[b(!0===t.authorityCertIssuer?e.cert.issuer:t.authorityCertIssuer)])];c.push(o.create(o.Class.CONTEXT_SPECIFIC,1,!0,d))}if(t.serialNumber){var v=n.util.hexToBytes(!0===t.serialNumber?e.cert.serialNumber:t.serialNumber);c.push(o.create(o.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if("cRLDistributionPoints"===t.name){t.value=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),c=t.value.value;var m,g=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),S=o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[]);for(p=0;p2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,e){u.md=v({signatureOid:u.signatureOid,type:"certificate"});var p=o.toDer(u.tbsCertificate);u.md.update(p.getBytes())}var h=n.md.sha1.create(),m=o.toDer(r.certIssuer);h.update(m.getBytes()),u.issuer.getField=function(t){return y(u.issuer,t)},u.issuer.addField=function(t){g([t]),u.issuer.attributes.push(t)},u.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=h.digest().toHex();var b=n.md.sha1.create(),S=o.toDer(r.certSubject);return b.update(S.getBytes()),u.subject.getField=function(t){return y(u.subject,t)},u.subject.addField=function(t){g([t]),u.subject.attributes.push(t)},u.subject.attributes=i.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=b.digest().toHex(),r.certExtensions?u.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},i.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(r=u.value.charCodeAt(1),i=u.value.length>2?u.value.charCodeAt(2):0),e.digitalSignature=128==(128&r),e.nonRepudiation=64==(64&r),e.keyEncipherment=32==(32&r),e.dataEncipherment=16==(16&r),e.keyAgreement=8==(8&r),e.keyCertSign=4==(4&r),e.cRLSign=2==(2&r),e.encipherOnly=1==(1&r),e.decipherOnly=128==(128&i)}else if("basicConstraints"===e.name){(u=o.fromDer(e.value)).value.length>0&&u.value[0].type===o.Type.BOOLEAN?e.cA=0!==u.value[0].value.charCodeAt(0):e.cA=!1;var s=null;u.value.length>0&&u.value[0].type===o.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(e.pathLenConstraint=o.derToInteger(s))}else if("extKeyUsage"===e.name)for(var u=o.fromDer(e.value),l=0;l1&&(r=u.value.charCodeAt(1)),e.client=128==(128&r),e.server=64==(64&r),e.email=32==(32&r),e.objsign=16==(16&r),e.reserved=8==(8&r),e.sslCA=4==(4&r),e.emailCA=2==(2&r),e.objCA=1==(1&r);else if("subjectAltName"===e.name||"issuerAltName"===e.name){var f;e.altNames=[],u=o.fromDer(e.value);for(var p=0;p=_&&t0&&a.value.push(i.certificateExtensionsToAsn1(t.extensions)),a},i.getCertificationRequestInfo=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(t.version).getBytes()),b(t.subject),i.publicKeyToAsn1(t.publicKey),function(t){var e=o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return e;for(var r=t.attributes,i=0;if.validity.notAfter)&&(l={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===l){if(null===(p=e[0]||t.getIssuer(f))&&f.isIssuer(f)&&(h=!0,p=f),p){var y=p;n.util.isArray(y)||(y=[y]);for(var d=!1;!d&&y.length>0;){p=y.shift();try{d=p.verify(f)}catch(t){}}d||(l={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}null!==l||p&&!h||t.hasCertificate(f)||(l={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(null===l&&p&&!f.isIssuer(p)&&(l={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),null===l)for(var v={keyUsage:!0,basicConstraints:!0},m=0;null===l&&mg.pathLenConstraint&&(l={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var w=null===l||l.error,_=r.verify?r.verify(w,c,o):w;if(!0!==_)throw!0===w&&(l={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(_||0===_)&&("object"!=s(_)||n.util.isArray(_)?"string"==typeof _&&(l.error=_):(_.message&&(l.message=_.message),_.error&&(l.error=_.error))),l;l=null,u=!1,++c}while(e.length>0);return!0}},function(t,e,r){var n=r(0);r(2),r(1),(t.exports=n.pss=n.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,o=t.mgf,i=r.digestLength,a=t.salt||null;if("string"==typeof a&&(a=n.util.createBuffer(a)),"saltLength"in t)e=t.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");e=a.length()}if(null!==a&&a.length()!==e)throw new Error("Given salt length does not match length of given salt.");var s=t.prng||n.random;return{encode:function(t,u){var l,c,f=u-1,p=Math.ceil(f/8),h=t.digest().getBytes();if(p>8*p-f&255;return(S=String.fromCharCode(S.charCodeAt(0)&~w)+S.substr(1))+d+String.fromCharCode(188)},verify:function(t,a,s){var u,l=s-1,c=Math.ceil(l/8);if(a=a.substr(-c),c>8*c-l&255;if(0!=(p.charCodeAt(0)&y))throw new Error("Bits beyond keysize not zero as expected.");var d=o.generate(h,f),v="";for(u=0;u4){var r=t;t=n.util.createBuffer();for(var o=0;o0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},o.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},o.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=i(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},o.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},o.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},o.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=i(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0)t.read-=this.blockSize;else for(o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0)t.read-=this.blockSize;else for(o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},o.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=i(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0)t.read-=this.blockSize;else for(o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.ofb.prototype.decrypt=o.ofb.prototype.encrypt,o.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},o.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=i(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},o.ctr.prototype.decrypt=o.ctr.prototype.encrypt,o.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},o.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var o=r.length();if(12===o)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*o)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=s(8*e.length());var i=e.length()%this.blockSize;for(i&&e.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},o.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},o.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},o.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,o=this._m[r][n];e[0]^=o[0],e[1]^=o[1],e[2]^=o[2],e[3]^=o[3]}return e},o.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},o.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,i=new Array(o),a=0;a>>1,o=new Array(r);o[n]=t.slice(0);for(var i=n>>>1;i>0;)this.pow(o[2*i],o[i]=[]),i>>=1;for(i=2;i>1,s=a+(1&t.length),u=t.substr(0,s),l=t.substr(a,s),c=n.util.createBuffer(),f=n.hmac.create();r=e+r;var p=Math.ceil(o/16),h=Math.ceil(o/20);f.start("MD5",u);var y=n.util.createBuffer();c.putBytes(r);for(var d=0;d0&&(c.queue(t,c.createAlert(t,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(t)),t.process()},c.parseHelloMessage=function(t,e,r){var o=null,i=t.entity===c.ConnectionEnd.client;if(r<38)t.error(t,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var a=e.fragment,s=a.length();if(o={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:u(a,1),extensions:[]},i?(o.cipher_suite=a.getBytes(2),o.compression_method=a.getByte()):(o.cipher_suites=u(a,2),o.compression_methods=u(a,1)),(s=r-(s-a.length()))>0){for(var l=u(a,2);l.length()>0;)o.extensions.push({type:[l.getByte(),l.getByte()],data:u(l,2)});if(!i)for(var f=0;f0&&0===h.getByte();)t.session.extensions.server_name.serverNameList.push(u(h,2).getBytes())}}if(t.session.version&&(o.version.major!==t.session.version.major||o.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(i)t.session.cipherSuite=c.getCipherSuite(o.cipher_suite);else for(var y=n.util.createBuffer(o.cipher_suites.bytes());y.length()>0&&(t.session.cipherSuite=c.getCipherSuite(y.getBytes(2)),null===t.session.cipherSuite););if(null===t.session.cipherSuite)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(o.cipher_suite)});t.session.compressionMethod=i?o.compression_method:c.CompressionMethod.none}return o},c.createSecurityParameters=function(t,e){var r=t.entity===c.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,i=r?n:c.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:c.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:i}},c.handleServerHello=function(t,e,r){var n=c.parseHelloMessage(t,e,r);if(!t.fail){if(!(n.version.minor<=t.version.minor))return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});t.version.minor=n.version.minor,t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=d,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=f,t.session.resuming=!1,c.createSecurityParameters(t,n)),t.session.id=o,t.process()}},c.handleClientHello=function(t,e,r){var o=c.parseHelloMessage(t,e,r);if(!t.fail){var i=o.session_id.bytes(),a=null;if(t.sessionCache&&(null===(a=t.sessionCache.getSession(i))?i="":(a.version.major!==o.version.major||a.version.minor>o.version.minor)&&(a=null,i="")),0===i.length&&(i=n.random.getBytes(32)),t.session.id=i,t.session.clientHelloVersion=o.version,t.session.sp={},a)t.version=t.session.version=a.version,t.session.sp=a.sp;else{for(var s,u=1;u0;)o=u(s.certificate_list,3),i=n.asn1.fromDer(o),o=n.pki.certificateFromAsn1(i,!0),l.push(o)}catch(e){return t.error(t,{message:"Could not parse certificate list.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var f=t.entity===c.ConnectionEnd.client;!f&&!0!==t.verifyClient||0!==l.length?0===l.length?t.expect=f?p:S:(f?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],c.verifyCertificateChain(t,l)&&(t.expect=f?p:S)):t.error(t,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),t.process()},c.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});t.expect=h,t.process()},c.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var o=e.fragment,i={enc_pre_master_secret:u(o,2).getBytes()},a=null;if(t.getPrivateKey)try{a=t.getPrivateKey(t,t.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(e){t.error(t,{message:"Could not get private key.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===a)return t.error(t,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var s=t.session.sp;s.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==s.pre_master_secret.charCodeAt(0)||l.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(t){s.pre_master_secret=n.random.getBytes(48)}t.expect=_,null!==t.session.clientCertificate&&(t.expect=w),t.process()},c.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:u(n,1),certificate_authorities:u(n,2)};t.session.certificateRequest=o,t.expect=y,t.process()},c.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var o=e.fragment;o.read-=4;var i=o.bytes();o.read+=4;var a={signature:u(o,2).getBytes()},s=n.util.createBuffer();s.putBuffer(t.session.md5.digest()),s.putBuffer(t.session.sha1.digest()),s=s.getBytes();try{if(!t.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(i),t.session.sha1.update(i)}catch(e){return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}t.expect=_,t.process()},c.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===t.serverCertificate){var o={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},i=t.verify(t,o.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=s(i)||n.util.isArray(i)?"number"==typeof i&&(o.alert.description=i):(i.message&&(o.message=i.message),i.alert&&(o.alert.description=i.alert))),t.error(t,o)}null!==t.session.certificateRequest&&(e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificate(t)}),c.queue(t,e)),e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createClientKeyExchange(t)}),c.queue(t,e),t.expect=b;var a=function(t,e){null!==t.session.certificateRequest&&null!==t.session.clientCertificate&&c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificateVerify(t,e)})),c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.pending=c.createConnectionState(t),t.state.current.write=t.state.pending.write,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)})),t.expect=d,c.flush(t),t.process()};if(null===t.session.certificateRequest||null===t.session.clientCertificate)return a(t,null);c.getClientSignature(t,a)},c.handleChangeCipherSpec=function(t,e){if(1!==e.fragment.getByte())return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=t.entity===c.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=c.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?v:O,t.process()},c.handleFinished=function(t,e,r){var i=e.fragment;i.read-=4;var a=i.bytes();i.read+=4;var s=e.fragment.getBytes();(i=n.util.createBuffer()).putBuffer(t.session.md5.digest()),i.putBuffer(t.session.sha1.digest());var u=t.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=t.session.sp;if((i=o(f.master_secret,l,i.getBytes(),12)).getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});t.session.md5.update(a),t.session.sha1.update(a),(t.session.resuming&&u||!t.session.resuming&&!u)&&(c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)}))),t.expect=u?m:E,t.handshaking=!1,++t.handshakes,t.peerCertificate=u?t.session.serverCertificate:t.session.clientCertificate,c.flush(t),t.isConnected=!0,t.connected(t),t.process()},c.handleAlert=function(t,e){var r,n=e.fragment,o={level:n.getByte(),description:n.getByte()};switch(o.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(o.description===c.Alert.Description.close_notify)return t.close();t.error(t,{message:r,send:!1,origin:t.entity===c.ConnectionEnd.client?"server":"client",alert:o}),t.process()},c.handleHandshake=function(t,e){var r=e.fragment,o=r.getByte(),i=r.getInt24();if(i>r.length())return t.fragmented=e,e.fragment=n.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var a=r.bytes(i+4);r.read+=4,o in F[t.entity][t.expect]?(t.entity!==c.ConnectionEnd.server||t.open||t.fail||(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),o!==c.HandshakeType.hello_request&&o!==c.HandshakeType.certificate_verify&&o!==c.HandshakeType.finished&&(t.session.md5.update(a),t.session.sha1.update(a)),F[t.entity][t.expect][o](t,e,i)):c.handleUnexpected(t,e)},c.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()},c.handleHeartbeat=function(t,e){var r=e.fragment,o=r.getByte(),i=r.getInt16(),a=r.getBytes(i);if(o===c.HeartbeatMessageType.heartbeat_request){if(t.handshaking||i>a.length)return t.process();c.queue(t,c.createRecord(t,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,a)})),c.flush(t)}else if(o===c.HeartbeatMessageType.heartbeat_response){if(a!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,n.util.createBuffer(a))}t.process()};var f=1,p=2,h=3,y=4,d=5,v=6,m=7,b=8,g=1,S=2,w=3,_=4,O=5,E=6,P=c.handleUnexpected,x=c.handleChangeCipherSpec,T=c.handleAlert,C=c.handleHandshake,k=c.handleApplicationData,A=c.handleHeartbeat,j=[];j[c.ConnectionEnd.client]=[[P,T,C,P,A],[P,T,C,P,A],[P,T,C,P,A],[P,T,C,P,A],[P,T,C,P,A],[x,T,P,P,A],[P,T,C,P,A],[P,T,C,k,A],[P,T,C,P,A]],j[c.ConnectionEnd.server]=[[P,T,C,P,A],[P,T,C,P,A],[P,T,C,P,A],[P,T,C,P,A],[x,T,P,P,A],[P,T,C,P,A],[P,T,C,k,A],[P,T,C,P,A]];var N=c.handleHelloRequest,I=c.handleServerHello,M=c.handleCertificate,R=c.handleServerKeyExchange,L=c.handleCertificateRequest,D=c.handleServerHelloDone,B=c.handleFinished,F=[];F[c.ConnectionEnd.client]=[[P,P,I,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,M,R,L,D,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,P,R,L,D,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,P,P,L,D,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,P,P,P,D,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,B],[N,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[N,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P]];var U=c.handleClientHello,G=c.handleClientKeyExchange,V=c.handleCertificateVerify;F[c.ConnectionEnd.server]=[[P,U,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,M,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,G,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,V,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,B],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P]],c.generateKeys=function(t,e){var r=o,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var i=2*e.mac_key_length+2*e.enc_key_length,a=t.version.major===c.Versions.TLS_1_0.major&&t.version.minor===c.Versions.TLS_1_0.minor;a&&(i+=2*e.fixed_iv_length);var s=r(e.master_secret,"key expansion",n,i),u={client_write_MAC_key:s.getBytes(e.mac_key_length),server_write_MAC_key:s.getBytes(e.mac_key_length),client_write_key:s.getBytes(e.enc_key_length),server_write_key:s.getBytes(e.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(e.fixed_iv_length),u.server_write_IV=s.getBytes(e.fixed_iv_length)),u},c.createConnectionState=function(t){var e=t.entity===c.ConnectionEnd.client,r=function(){var t={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(t){return!0},compressionState:null,compressFunction:function(t){return!0},updateSequenceNumber:function(){4294967295===t.sequenceNumber[1]?(t.sequenceNumber[1]=0,++t.sequenceNumber[0]):++t.sequenceNumber[1]}};return t},n={read:r(),write:r()};if(n.read.update=function(t,e){return n.read.cipherFunction(e,n.read)?n.read.compressFunction(t,e,n.read)||t.error(t,{message:"Could not decompress record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):t.error(t,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_record_mac}}),!t.fail},n.write.update=function(t,e){return n.write.compressFunction(t,e,n.write)?n.write.cipherFunction(e,n.write)||t.error(t,{message:"Could not encrypt record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):t.error(t,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!t.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=c.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=a,n.write.compressFunction=i;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var t=new Date,e=+t+6e4*t.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(e),r.putBytes(n.random.getBytes(28)),r},c.createRecord=function(t,e){return e.data?{type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data}:null},c.createAlert=function(t,e){var r=n.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),c.createRecord(t,{type:c.ContentType.alert,data:r})},c.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=n.util.createBuffer(),r=0;r0&&(y+=2);var d=t.session.id,v=d.length+1+2+4+28+2+i+1+s+y,m=n.util.createBuffer();return m.putByte(c.HandshakeType.client_hello),m.putInt24(v),m.putByte(t.version.major),m.putByte(t.version.minor),m.putBytes(t.session.sp.client_random),l(m,1,n.util.createBuffer(d)),l(m,2,e),l(m,1,a),y>0&&l(m,2,u),m},c.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,o=n.util.createBuffer();return o.putByte(c.HandshakeType.server_hello),o.putInt24(r),o.putByte(t.version.major),o.putByte(t.version.minor),o.putBytes(t.session.sp.server_random),l(o,1,n.util.createBuffer(e)),o.putByte(t.session.cipherSuite.id[0]),o.putByte(t.session.cipherSuite.id[1]),o.putByte(t.session.compressionMethod),o},c.createCertificate=function(t){var e,r=t.entity===c.ConnectionEnd.client,o=null;t.getCertificate&&(e=r?t.session.certificateRequest:t.session.extensions.server_name.serverNameList,o=t.getCertificate(t,e));var i=n.util.createBuffer();if(null!==o)try{n.util.isArray(o)||(o=[o]);for(var a=null,s=0;sc.MaxFragment;)o.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(i.slice(0,c.MaxFragment))})),i=i.slice(c.MaxFragment);i.length>0&&o.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(i)}))}for(var a=0;a0&&(o=r.order[0]),null!==o&&o in r.cache)for(var i in e=r.cache[o],delete r.cache[o],r.order)if(r.order[i]===o){r.order.splice(i,1);break}return e},r.setSession=function(t,e){if(r.order.length===r.capacity){var o=r.order.shift();delete r.cache[o]}o=n.util.bytesToHex(t),r.order.push(o),r.cache[o]=e}}return r},c.createConnection=function(t){var e;e=t.caStore?n.util.isArray(t.caStore)?n.pki.createCaStore(t.caStore):t.caStore:n.pki.createCaStore();var r=t.cipherSuites||null;if(null===r)for(var o in r=[],c.CipherSuites)r.push(c.CipherSuites[o]);var i=t.server?c.ConnectionEnd.server:c.ConnectionEnd.client,a=t.sessionCache?c.createSessionCache(t.sessionCache):null,s={version:{major:c.Version.major,minor:c.Version.minor},entity:i,sessionId:t.sessionId,caStore:e,sessionCache:a,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(t,e,r,n){return e},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:function(e,r){r.origin=r.origin||(e.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(e,c.createAlert(e,r.alert)),c.flush(e));var n=!1!==r.fatal;n&&(e.fail=!0),t.error(e,r),n&&e.close(!1)},deflate:t.deflate||null,inflate:t.inflate||null,reset:function(t){s.version={major:c.Version.major,minor:c.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,c.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(t||void 0===t),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=c.createConnectionState(s)}};return s.reset(),s.handshake=function(t){if(s.entity!==c.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var e=null;(t=t||"").length>0&&(s.sessionCache&&(e=s.sessionCache.getSession(t)),null===e&&(t="")),0===t.length&&s.sessionCache&&null!==(e=s.sessionCache.getSession())&&(t=e.id),s.session={id:t,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},e&&(s.version=e.version,s.session.sp=e.sp),s.session.sp.client_random=c.createRandom().getBytes(),s.open=!0,c.queue(s,c.createRecord(s,{type:c.ContentType.handshake,data:c.createClientHello(s)})),c.flush(s)}},s.process=function(t){var e=0;return t&&s.input.putBytes(t),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(e=function(t){var e=0,r=t.input,o=r.length();if(o<5)e=5-o;else{t.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var i=t.record.version.major===t.version.major;i&&t.session&&t.session.version&&(i=t.record.version.minor===t.version.minor),i||t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}})}return e}(s)),s.fail||null===s.record||s.record.ready||(e=function(t){var e=0,r=t.input,n=r.length();return n=0;u--)k>>=8,k+=P.at(u)+C.at(u),C.setAt(u,255&k);T.putBuffer(C)}S=T,f.putBuffer(O)}return f.truncate(f.length()-i),f},a.pbe.getCipher=function(t,e,r){switch(t){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(t,e,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(t,e,r){var o,s={},u=[];if(!i.validate(e,l,s,u))throw(o=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,o;if((t=i.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(o=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,o.supportedOids=["pkcs5PBKDF2"],o;if((t=i.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&t!==a.oids["aes192-CBC"]&&t!==a.oids["aes256-CBC"]&&t!==a.oids["des-EDE3-CBC"]&&t!==a.oids.desCBC)throw(o=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,o.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],o;var c,f,h=s.kdfSalt,y=n.util.createBuffer(s.kdfIterationCount);switch(y=y.getInt(y.length()<<3),a.oids[t]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var d=p(s.prfOid),v=n.pkcs5.pbkdf2(r,h,y,c,d),m=s.encIv,b=f(v);return b.start(m),b},a.pbe.getCipherForPKCS12PBE=function(t,e,r){var o={},s=[];if(!i.validate(e,c,o,s))throw(d=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,d;var u,l,f,h=n.util.createBuffer(o.salt),y=n.util.createBuffer(o.iterations);switch(y=y.getInt(y.length()<<3),t){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var d;throw(d=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,d}var v=p(o.prfOid),m=a.pbe.generatePkcs12Key(r,h,1,y,u,v);return v.start(),f(m,a.pbe.generatePkcs12Key(r,h,2,y,l,v))},a.pbe.opensslDeriveBytes=function(t,e,r,o){if(null==o){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');o=n.md.md5.create()}null===e&&(e="");for(var i=[f(o,t+e)],a=16,s=1;a>>0,s>>>0];for(var l=o.fullMessageLength.length-1;l>=0;--l)o.fullMessageLength[l]+=s[1],s[1]=s[0]+(o.fullMessageLength[l]/4294967296>>>0),o.fullMessageLength[l]=o.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(i),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s,l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-l));for(var c=8*o.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var p={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(p,r,a);var h=n.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h.putInt32(p.h5),h.putInt32(p.h6),h.putInt32(p.h7),h},o};var i=null,a=!1,s=null;function u(t,e,r){for(var n,o,i,a,u,l,c,f,p,h,y,d,v,m=r.length();m>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=((o=e[u-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[u]=n+e[u-7]+o+e[u-16]|0;for(l=t.h0,c=t.h1,f=t.h2,p=t.h3,h=t.h4,y=t.h5,d=t.h6,v=t.h7,u=0;u<64;++u)i=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|f&(l^c),n=v+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(d^h&(y^d))+s[u]+e[u],v=d,d=y,y=h,h=p+n>>>0,p=f,f=c,c=l,l=n+(o=i+a)>>>0;t.h0=t.h0+l|0,t.h1=t.h1+c|0,t.h2=t.h2+f|0,t.h3=t.h3+p|0,t.h4=t.h4+h|0,t.h5=t.h5+y|0,t.h6=t.h6+d|0,t.h7=t.h7+v|0,m-=64}}},function(t,e,r){var n=r(0);r(1);var o=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(o=r(16)),(t.exports=n.prng=n.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,i=new Array(32),a=0;a<32;++a)i[a]=r.create();function s(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r==0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var o=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(o),e.generated=0}function l(t){var e=null,r=n.util.globalScope,o=r.crypto||r.msCrypto;o&&o.getRandomValues&&(e=function(t){return o.getRandomValues(t)});var i=n.util.createBuffer();if(e)for(;i.length()>16)))<<16,p=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31)),u=0;u<3;++u)f=p>>>(u<<3),f^=Math.floor(256*Math.random()),i.putByte(255&f);return i.getBytes(t)}return e.pools=i,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var o=e.plugin.cipher,i=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed,l=n.util.createBuffer();e.key=null,function c(f){if(f)return r(f);if(l.length()>=t)return r(null,l.getBytes(t));if(e.generated>1048575&&(e.key=null),null===e.key)return n.util.nextTick(function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,function(r,n){if(r)return t(r);e.collect(n),u(),t()})}(c)});var p=o(e.key,e.seed);e.generated+=p.length,l.putBytes(p),e.key=a(o(e.key,i(e.seed))),e.seed=s(o(e.key,e.seed)),n.util.setImmediate(c)}()},e.generateSync=function(t){var r=e.plugin.cipher,o=e.plugin.increment,i=e.plugin.formatKey,a=e.plugin.formatSeed;e.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(e.key=null),null===e.key&&s();var l=r(e.key,e.seed);e.generated+=l.length,u.putBytes(l),e.key=i(r(e.key,o(e.seed))),e.seed=a(r(e.key,e.seed))}return u.getBytes(t)},o?(e.seedFile=function(t,e){o.randomBytes(t,function(t,r){if(t)return e(t);e(null,r.toString())})},e.seedFileSync=function(t){return o.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,l(t))}catch(t){e(t)}},e.seedFileSync=l),e.collect=function(t){for(var r=t.length,n=0;n>o&255);e.collect(n)},e.registerWorker=function(t){t===self?e.seedFile=function(t,e){self.addEventListener("message",function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:t}}})}:t.addEventListener("message",function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})})})},e}},function(t,e,r){var n=r(0);r(1);var o=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],a=function(t,e){return t<>16-e},s=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"==typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,i=t,a=t.length(),s=e,u=Math.ceil(s/8),l=255>>(7&s);for(r=a;r<128;r++)i.putByte(o[i.at(r-1)+i.at(r-a)&255]);for(i.setAt(128-u,o[i.at(128-u)&l]),r=127-u;r>=0;r--)i.setAt(r,o[i.at(r+1)^i.at(r+u)]);return i};var u=function(t,e,r){var o,u,l,c,f=!1,p=null,h=null,y=null,d=[];for(t=n.rc2.expandKey(t,e),l=0;l<64;l++)d.push(t.getInt16Le());r?(o=function(t){for(l=0;l<4;l++)t[l]+=d[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),t[l]=a(t[l],i[l]),c++},u=function(t){for(l=0;l<4;l++)t[l]+=d[63&t[(l+3)%4]]}):(o=function(t){for(l=3;l>=0;l--)t[l]=s(t[l],i[l]),t[l]-=d[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),c--},u=function(t){for(l=3;l>=0;l--)t[l]-=d[63&t[(l+3)%4]]});var v=function(t){var e=[];for(l=0;l<4;l++){var n=p.getInt16Le();null!==y&&(r?n^=y.getInt16Le():y.putInt16Le(n)),e.push(65535&n)}c=r?0:63;for(var o=0;o=8;)v([[5,o],[1,u],[6,o],[1,u],[5,o]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,p,!r);else{var n=8===p.length()?8:8-p.length();p.fillWithByte(n,n)}if(e&&(f=!0,m.update()),!r&&(e=0===p.length()))if(t)e=t(8,h,!r);else{var o=h.length(),i=h.at(o-1);i>o?e=!1:h.truncate(i)}return e}}};n.rc2.startEncrypting=function(t,e,r){var o=n.rc2.createEncryptionCipher(t,128);return o.start(e,r),o},n.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var o=n.rc2.createDecryptionCipher(t,128);return o.start(e,r),o},n.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},function(t,e,r){var n=r(0);r(1),r(2),r(9);var o=t.exports=n.pkcs1=n.pkcs1||{};function i(t,e,r){r||(r=n.md.sha1.create());for(var o="",i=Math.ceil(e/r.digestLength),a=0;a>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(t+s),o+=r.digest().getBytes()}return o.substring(0,e)}o.encode_rsa_oaep=function(t,e,r){var o,a,s,u;"string"==typeof r?(o=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(o=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(d=new Error("RSAES-OAEP input message length is too long.")).length=e.length,d.maxLength=c,d;o||(o=""),s.update(o,"raw");for(var f=s.digest(),p="",h=c-e.length,y=0;yt&&(a=u(t,e));var h=a.toString(16);o.target.postMessage({hex:h,workLoad:c}),a.dAddOffset(f,0)}}}h()}(t,e,o,i):s(t,e,o,i)}(t,l,i.options,o);throw new Error("Invalid prime generation algorithm: "+i.name)}}function s(t,e,r,i){var a=u(t,e),s=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function t(e,r,i,a,s,l,c){var f=+new Date;do{if(e.bitLength()>r&&(e=u(r,i)),e.isProbablePrime(s))return c(null,e);e.dAddOffset(o[a++%8],0)}while(l<0||+new Date-f=0&&o.push(s):o.push(s))}return o}function h(t){if(t.composed||t.constructed){for(var e=n.util.createBuffer(),r=0;r0&&(u=o.create(o.Class.UNIVERSAL,o.Type.SET,!0,f));var p=[],h=[];null!==e&&(h=n.util.isArray(e)?e:[e]);for(var y=[],d=0;d0){var g=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,y),S=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.data).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(g).getBytes())])]);p.push(S)}var w=null;if(null!==t){var _=i.wrapRsaPrivateKey(i.privateKeyToAsn1(t));w=null===r?o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.keyBag).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[_]),u]):o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(_,r,s)]),u]);var O=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[w]),E=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.data).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(O).getBytes())])]);p.push(E)}var P,x=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,p);if(s.useMac){var T=n.md.sha1.create(),C=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),k=s.count,A=(t=a.generateKey(r,C,3,k,20),n.hmac.create());A.start(T,t),A.update(o.toDer(x).getBytes());var j=A.getMac();P=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.sha1).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,j.getBytes())]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,C.getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(k).getBytes())])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(3).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.data).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(x).getBytes())])]),P])},a.generateKey=n.pbe.generatePkcs12Key},function(t,e,r){var n=r(0);r(3),r(1);var o=n.asn1,i=t.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=i;var a={name:"ContentInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:o.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:o.Class.UNIVERSAL,type:o.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},i.encryptedDataValidator={name:"EncryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:o.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:o.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:o.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:o.Class.UNIVERSAL,type:o.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:o.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(t,e,r){var n=r(0);r(1),n.mgf=n.mgf||{},(t.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(t){return{generate:function(e,r){for(var o=new n.util.ByteBuffer,i=Math.ceil(r/t.digestLength),a=0;a>>0,a>>>0];for(var s=h.fullMessageLength.length-1;s>=0;--s)h.fullMessageLength[s]+=a[1],a[1]=a[0]+(h.fullMessageLength[s]/4294967296>>>0),h.fullMessageLength[s]=h.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return o.putBytes(t),c(r,i,o),(o.read>2048||0===o.length())&&o.compact(),h},h.digest=function(){var e=n.util.createBuffer();e.putBytes(o.bytes());var s,u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;e.putBytes(a.substr(0,h.blockLength-u));for(var l=8*h.fullMessageLength[0],f=0;f>>0,e.putInt32(l>>>0),l=s>>>0;e.putInt32(l);var p=new Array(r.length);for(f=0;f=128;){for(A=0;A<16;++A)e[A][0]=r.getInt32()>>>0,e[A][1]=r.getInt32()>>>0;for(;A<80;++A)n=(((j=(I=e[A-2])[0])>>>19|(N=I[1])<<13)^(N>>>29|j<<3)^j>>>6)>>>0,o=((j<<13|N>>>19)^(N<<3|j>>>29)^(j<<26|N>>>6))>>>0,i=(((j=(R=e[A-15])[0])>>>1|(N=R[1])<<31)^(j>>>8|N<<24)^j>>>7)>>>0,a=((j<<31|N>>>1)^(j<<24|N>>>8)^(j<<25|N>>>7))>>>0,M=e[A-7],L=e[A-16],N=o+M[1]+a+L[1],e[A][0]=n+M[0]+i+L[0]+(N/4294967296>>>0)>>>0,e[A][1]=N>>>0;for(y=t[0][0],d=t[0][1],v=t[1][0],m=t[1][1],b=t[2][0],g=t[2][1],S=t[3][0],w=t[3][1],_=t[4][0],O=t[4][1],E=t[5][0],P=t[5][1],x=t[6][0],T=t[6][1],C=t[7][0],k=t[7][1],A=0;A<80;++A)c=((_>>>14|O<<18)^(_>>>18|O<<14)^(O>>>9|_<<23))>>>0,f=(x^_&(E^x))>>>0,s=((y>>>28|d<<4)^(d>>>2|y<<30)^(d>>>7|y<<25))>>>0,l=((y<<4|d>>>28)^(d<<30|y>>>2)^(d<<25|y>>>7))>>>0,p=(y&v|b&(y^v))>>>0,h=(d&m|g&(d^m))>>>0,N=k+(((_<<18|O>>>14)^(_<<14|O>>>18)^(O<<23|_>>>9))>>>0)+((T^O&(P^T))>>>0)+u[A][1]+e[A][1],n=C+c+f+u[A][0]+e[A][0]+(N/4294967296>>>0)>>>0,o=N>>>0,i=s+p+((N=l+h)/4294967296>>>0)>>>0,a=N>>>0,C=x,k=T,x=E,T=P,E=_,P=O,_=S+n+((N=w+o)/4294967296>>>0)>>>0,O=N>>>0,S=b,w=g,b=v,g=m,v=y,m=d,y=n+i+((N=o+a)/4294967296>>>0)>>>0,d=N>>>0;N=t[0][1]+d,t[0][0]=t[0][0]+y+(N/4294967296>>>0)>>>0,t[0][1]=N>>>0,N=t[1][1]+m,t[1][0]=t[1][0]+v+(N/4294967296>>>0)>>>0,t[1][1]=N>>>0,N=t[2][1]+g,t[2][0]=t[2][0]+b+(N/4294967296>>>0)>>>0,t[2][1]=N>>>0,N=t[3][1]+w,t[3][0]=t[3][0]+S+(N/4294967296>>>0)>>>0,t[3][1]=N>>>0,N=t[4][1]+O,t[4][0]=t[4][0]+_+(N/4294967296>>>0)>>>0,t[4][1]=N>>>0,N=t[5][1]+P,t[5][0]=t[5][0]+E+(N/4294967296>>>0)>>>0,t[5][1]=N>>>0,N=t[6][1]+T,t[6][0]=t[6][0]+x+(N/4294967296>>>0)>>>0,t[6][1]=N>>>0,N=t[7][1]+k,t[7][0]=t[7][0]+C+(N/4294967296>>>0)>>>0,t[7][1]=N>>>0,D-=128}}},function(t,e,r){t.exports=r(33)},function(t,e,r){t.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":s(window))&&(r=window)}t.exports=r},function(t,e){var r={};t.exports=r;var n={};r.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var o=0,i=e.length,a=e.charAt(0),s=[0];for(o=0;o0;)s.push(l%i),l=l/i|0}for(o=0;0===t[o]&&o=0;--o)n+=e[s[o]]}else n=function(t,e){var r=0,n=e.length,o=e.charAt(0),i=[0];for(r=0;r0;)i.push(s%n),s=s/n|0}var u="";for(r=0;0===t.at(r)&&r=0;--r)u+=e[i[r]];return u}(t,e);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join("\r\n")}return n},r.decode=function(t,e){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');var r=n[e];if(!r){r=n[e]=[];for(var o=0;o>=8;for(;c>0;)s.push(255&c),c>>=8}for(var f=0;t[f]===a&&f=o.Versions.TLS_1_1.minor&&u.output.putBytes(r),u.update(t.fragment),u.finish(s)&&(t.fragment=u.output,t.length=t.fragment.length(),i=!0),i}function s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}function u(t,e,r){var n=!0;if(r){for(var o=e.length(),i=e.last(),a=o-1-i;a=s?(t.fragment=a.output.getBytes(c-s),l=a.output.getBytes(s)):t.fragment=a.output.getBytes(),t.fragment=n.util.createBuffer(t.fragment),t.length=t.fragment.length();var f=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),function(t,e,r){var o=n.hmac.create();return o.start("SHA1",t),o.update(e),e=o.digest().getBytes(),o.start(null,null),o.update(r),e===(r=o.digest().getBytes())}(e.macKey,l,f)&&i}o.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=o.BulkCipherAlgorithm.aes,t.cipher_type=o.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=o.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:i},o.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=o.BulkCipherAlgorithm.aes,t.cipher_type=o.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=o.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:i}},function(t,e,r){var n=r(0);r(30),t.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(t,e,r){var n=r(0);r(12),r(2),r(31),r(1);var o=r(39),i=o.publicKeyValidator,a=o.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,l="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},t.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var c=n.ed25519;function f(t){var e=t.message;if(e instanceof Uint8Array||e instanceof l)return e;var r=t.encoding;if(void 0===e){if(!t.md)throw new TypeError('"options.message" or "options.md" not specified.');e=t.md.digest().getBytes(),r="binary"}if("string"==typeof e&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof e){if("undefined"!=typeof Buffer)return Buffer.from(e,r);e=new u(e,r)}else if(!(e instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new l(e.length()),o=0;o=0;--r)B(n,n),1!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(r,r),F(r,r,o),F(r,r,i),F(r,r,i),F(t[0],r,i),B(n,t[0]),F(n,n,i),T(n,o)&&F(t[0],t[0],g),B(n,t[0]),F(n,n,i),T(n,o)?-1:(k(t[0])===e[31]>>7&&D(t[0],p,t[0]),F(t[3],t[0],t[1]),0)}(s,n))return-1;for(o=0;o=0};var p=R(),h=R([1]),y=R([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=R([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=R([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=R([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),b=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),g=R([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function S(t,e){var r=n.md.sha512.create(),o=new u(t);r.update(o.getBytes(e),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var a=new l(c.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)a[s]=i.charCodeAt(s);return a}function w(t,e){var r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o>8,e[o]-=256*r;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*b[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*b[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function _(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;w(t,e)}function O(t,e){var r=R(),n=R(),o=R(),i=R(),a=R(),s=R(),u=R(),l=R(),c=R();D(r,t[1],t[0]),D(c,e[1],e[0]),F(r,r,c),L(n,t[0],t[1]),L(c,e[0],e[1]),F(n,n,c),F(o,t[3],e[3]),F(o,o,d),F(i,t[2],e[2]),L(i,i,i),D(a,n,r),D(s,i,o),L(u,i,o),L(l,n,r),F(t[0],a,s),F(t[1],l,u),F(t[2],u,s),F(t[3],a,l)}function E(t,e,r){for(var n=0;n<4;++n)M(t[n],e[n],r)}function P(t,e){var r=R(),n=R(),o=R();!function(t,e){var r,n=R();for(r=0;r<16;++r)n[r]=e[r];for(r=253;r>=0;--r)B(n,n),2!==r&&4!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(o,e[2]),F(r,e[0],o),F(n,e[1],o),x(t,n),t[31]^=k(r)<<7}function x(t,e){var r,n,o,i=R(),a=R();for(r=0;r<16;++r)a[r]=e[r];for(I(a),I(a),I(a),n=0;n<2;++n){for(i[0]=a[0]-65517,r=1;r<15;++r)i[r]=a[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,M(a,i,1-o)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function T(t,e){var r=new l(32),n=new l(32);return x(r,t),x(n,e),C(r,0,n,0)}function C(t,e,r,n){return function(t,e,r,n,o){var i,a=0;for(i=0;i<32;++i)a|=t[e+i]^r[n+i];return(1&a-1>>>8)-1}(t,e,r,n)}function k(t){var e=new l(32);return x(e,t),1&e[0]}function A(t,e,r){var n,o;for(N(t[0],p),N(t[1],h),N(t[2],h),N(t[3],p),o=255;o>=0;--o)E(t,e,n=r[o/8|0]>>(7&o)&1),O(e,t),O(t,t),E(t,e,n)}function j(t,e){var r=[R(),R(),R(),R()];N(r[0],v),N(r[1],m),N(r[2],h),F(r[3],v,m),A(t,r,e)}function N(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function I(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function M(t,e,r){for(var n,o=~(r-1),i=0;i<16;++i)n=o&(t[i]^e[i]),t[i]^=n,e[i]^=n}function R(t){var e,r=new Float64Array(16);if(t)for(e=0;e0&&(a=n.util.fillString(String.fromCharCode(0),u)+a),{encapsulation:e.encrypt(a,"NONE"),key:t.generate(a,i)}},decrypt:function(e,r,n){var o=e.decrypt(r,"NONE");return t.generate(o,n)}}},n.kem.kdf1=function(t,e){i(this,t,0,e||t.digestLength)},n.kem.kdf2=function(t,e){i(this,t,1,e||t.digestLength)}},function(t,e,r){var n=r(0);r(1),t.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var o={},i=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s0){for(var r=o.create(o.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i=r&&a0&&a.value[0].value.push(o.create(o.Class.CONTEXT_SPECIFIC,0,!0,e)),i.length>0&&a.value[0].value.push(o.create(o.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(o.create(o.Class.UNIVERSAL,o.Type.SET,!0,t.signerInfos)),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(t.type).getBytes()),a])},addSigner:function(e){var r=e.issuer,o=e.serialNumber;if(e.certificate){var i=e.certificate;"string"==typeof i&&(i=n.pki.certificateFromPem(i)),r=i.issuer.attributes,o=i.serialNumber}var a=e.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=e.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=e.authenticatedAttributes||[];if(u.length>0){for(var l=!1,c=!1,f=0;f="8"&&(r="00"+r);var o=n.util.hexToBytes(r);t.putInt32(o.length),t.putBytes(o)}function a(t,e){t.putInt32(e.length),t.putString(e)}function s(){for(var t=n.md.sha1.create(),e=arguments.length,r=0;r>>0):4294967296*(e>>>0)+(t>>>0)}function u(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 o=r.pos-1;o>=t;o--)r.buf[o+n]=r.buf[o]}function l(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function S(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}o.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,i=this.pos;this.type=7&n,t(o,e,this),this.pos===i&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=S(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+4294967296*b(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+4294967296*S(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(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,o,i=r.buf;if(o=i[r.pos++],n=(112&o)>>4,o<128)return s(t,n,e);if(o=i[r.pos++],n|=(127&o)<<3,o<128)return s(t,n,e);if(o=i[r.pos++],n|=(127&o)<<10,o<128)return s(t,n,e);if(o=i[r.pos++],n|=(127&o)<<17,o<128)return s(t,n,e);if(o=i[r.pos++],n|=(127&o)<<24,o<128)return s(t,n,e);if(o=i[r.pos++],n|=(1&o)<<31,o<128)return s(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&&i?function(t,e,r){return i.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",o=e;for(;o239?4:u>223?3:u>191?2:1;if(o+c>r)break;1===c?u<128&&(l=u):2===c?128==(192&(i=t[o+1]))&&(l=(31&u)<<6|63&i)<=127&&(l=null):3===c?(i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&((l=(15&u)<<12|(63&i)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),o+=c}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!==o.Bytes)return t.push(this.readVarint(e));var r=a(this);for(t=t||[];this.pos127;);else if(e===o.Bytes)this.pos=this.readVarint()+this.pos;else if(e===o.Fixed32)this.pos+=4;else{if(e!==o.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;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));if(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,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;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,o,i=0;i55295&&n<57344){if(!o){n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=n;continue}n=o-55296<<10|n-56320|65536,o=null}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=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&&u(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(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&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,o.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,o.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,o.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,o.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,o.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,o.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,o.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,o.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},4186:function(t){(function(){var e,r,n,o,i,a;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(t.exports=function(){return(e()-i)/1e6},r=process.hrtime,o=(e=function(){var t;return 1e9*(t=r())[0]+t[1]})(),a=1e9*process.uptime(),i=o-a):Date.now?(t.exports=function(){return Date.now()-n},n=Date.now()):(t.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(this)},5246:function(t,e,r){var n,o,i;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){"use strict";function t(t){var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){return e.reject(r)})})}function e(t){return new this(function(e,r){if(!t||void 0===t.length)return r(new TypeError(a(t)+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(t);if(0===n.length)return e([]);var o=n.length;function i(t,r){if(r&&("object"===a(r)||"function"==typeof r)){var s=r.then;if("function"==typeof s)return void s.call(r,function(e){i(t,e)},function(r){n[t]={status:"rejected",reason:r},0==--o&&e(n)})}n[t]={status:"fulfilled",value:r},0==--o&&e(n)}for(var s=0;se?1:0}return function(r,n,o,i,a){!function e(r,n,o,i,a){for(;i>o;){if(i-o>600){var s=i-o+1,u=n-o+1,l=Math.log(s),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1),p=Math.max(o,Math.floor(n-u*c/s+f)),h=Math.min(i,Math.floor(n+(s-u)*c/s+f));e(r,n,p,h,a)}var y=r[n],d=o,v=i;for(t(r,o,n),a(r[i],y)>0&&t(r,o,i);d0;)v--}0===a(r[o],y)?t(r,o,v):t(r,++v,i),v<=n&&(o=v+1),n<=v&&(i=v-1)}}(r,n,o||0,i||r.length-1,a||e)}},"object"===a(e)?t.exports=i():void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o)},368:function(t,e,r){for(var n=r(4186),o="undefined"==typeof window?r.g:window,i=["moz","webkit"],a="AnimationFrame",s=o["request"+a],u=o["cancel"+a]||o["cancelRequest"+a],l=0;!s&&l=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,r,o,i){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=o||(a=e+Math.ceil((r-e)/o/2)*o,n(t,a,e,r,i),s.push(e,a,a,r))}o.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!y(t,e))return r;for(var o,i,a,s,u=[];e;){for(o=0,i=e.children.length;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(o,i,e)},_split:function(t,e){var r=t[e],n=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,n);var i=this._chooseSplitIndex(r,o,n),s=d(r.children.splice(i,r.children.length-i));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,o,i,a,u,l,c,p,h,y,d,v,m,b;for(l=c=1/0,n=e;n<=r-e;n++)o=s(t,0,n,this.toBBox),i=s(t,n,r,this.toBBox),h=o,y=i,void 0,void 0,void 0,void 0,d=Math.max(h.minX,y.minX),v=Math.max(h.minY,y.minY),m=Math.min(h.maxX,y.maxX),b=Math.min(h.maxY,y.maxY),a=Math.max(0,m-d)*Math.max(0,b-v),u=f(o)+f(i),a=e;o--)i=t.children[o],u(c,t.leaf?a(i):i),f+=p(c);return f},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},9973:function(t){t.exports=function(t){this.ok=!1,this.alpha=1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=e[t]||t;for(var r=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],n=0;n3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r},this.getHelpXML=function(){for(var t=new Array,n=0;n "+l.toRGB()+" -> "+l.toHex());u.appendChild(c),u.appendChild(f),s.appendChild(u)}catch(t){}return s}}},1097:function(t){var e=/^[-+]?0x[a-fA-F0-9]+$/,r=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};t.exports=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o=Object.assign({},n,o),!t||"string"!=typeof t)return t;var i=t.trim();if(void 0!==o.skipLike&&o.skipLike.test(i))return t;if(o.hex&&e.test(i))return Number.parseInt(i,16);var a=r.exec(i);if(a){var s=a[1],u=a[2],l=function(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}(a[3]),c=a[4]||a[6];if(!o.leadingZeros&&u.length>0&&s&&"."!==i[2])return t;if(!o.leadingZeros&&u.length>0&&!s&&"."!==i[1])return t;var f=Number(i),p=""+f;return-1!==p.search(/[eE]/)?o.eNotation?f:t:c?o.eNotation?f:t:-1!==i.indexOf(".")?"0"===p&&""===l?f:p===l?f:s&&p==="-"+l?f:t:u?l===p?f:s+l===p?f:t:i===p?f:i===s+p?f:t}return t}},5400:function(t,e,r){var n,o;function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(a,s){"use strict";"object"===i(t)&&t.exports?t.exports=s():void 0===(o="function"==typeof(n=s)?n.call(e,r,e,t):n)||(t.exports=o)}(0,function(t){"use strict";var e=t&&t.IPv6;return{best:function(t){var e,r,n=t.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),e=0;e1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,l=0,c=0,f=-1,p=!1;for(a=0;al&&(u=f,l=c)):"0"===n[a]&&(p=!0,f=a,c=1);c>l&&(u=f,l=c),l>1&&n.splice(u,l,""),o=n.length;var h="";for(""===n[0]&&(h=":"),a=0;a=t.length-1)return!1;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return!1;var o=r.list[t.slice(e+1)];return!!o&&o.indexOf(" "+t.slice(n+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var n=r.list[t.slice(e+1)];return!!n&&n.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return null;var o=r.list[t.slice(e+1)];return o?o.indexOf(" "+t.slice(n+1,e)+" ")<0?null:t.slice(n+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r})},7411:function(t,e,r){var n,o,i;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(s,u){"use strict";"object"===a(t)&&t.exports?t.exports=u(r(9018),r(5400),r(2714)):(o=[r(9018),r(5400),r(2714)],void 0===(i="function"==typeof(n=u)?n.apply(e,o):n)||(t.exports=i))}(0,function(t,e,r,n){"use strict";var o=n&&n.URI;function i(t,e){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return r?n?new i(t,e):new i(t):new i;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}i.version="1.19.11";var s=i.prototype,u=Object.prototype.hasOwnProperty;function l(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function f(t){return"Array"===c(t)}function p(t,e){var r,n,o={};if("RegExp"===c(e))o=null;else if(f(e))for(r=0,n=e.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return i.domAttributes[e]}},i.encode=m,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=m,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(t,e){var r=i.encode(t+"");return void 0===e&&(e=i.escapeQuerySpace),e?r.replace(/%20/g,"+"):r},i.decodeQuery=function(t,e){t+="",void 0===e&&(e=i.escapeQuerySpace);try{return i.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var b,g={encode:"encode",decode:"decode"},S=function(t,e){return function(r){try{return i[e](r+"").replace(i.characters[t][e].expression,function(r){return i.characters[t][e].map[r]})}catch(t){return r}}};for(b in g)i[b+"PathSegment"]=S("pathname",g[b]),i[b+"UrnPathSegment"]=S("urnpath",g[b]);var w=function(t,e,r){return function(n){var o;o=r?function(t){return i[e](i[r](t))}:i[e];for(var a=(n+"").split(t),s=0,u=a.length;s-1&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),(r=t.indexOf("?"))>-1&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=i.parseAuthority(t,e)):(r=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(i.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=i.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},i.parseHost=function(t,e){t||(t="");var r,n,o=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=t.length),"["===t.charAt(0))r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,o)||null,"/"===e.port&&(e.port=null);else{var a=t.indexOf(":"),s=t.indexOf("/"),u=t.indexOf(":",a+1);-1!==u&&(-1===s||u-1?o:t.length-1);return a>-1&&(-1===o||a-1?h.slice(0,y)+h.slice(y).replace(a,""):h.replace(a,"")).length<=l[0].length||r.ignore&&r.ignore.test(h))){var m=e(h,c,p=c+h.length,t);void 0!==m?(m=String(m),t=t.slice(0,c)+m+t.slice(p),n.lastIndex=c+m.length):n.lastIndex=p}}return n.lastIndex=0,t},i.ensureValidHostname=function(e,r){var n=!!e,o=!1;if(!!r&&(o=h(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(e&&e.match(i.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},i.noConflict=function(t){if(t){var e={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(e.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(e.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=n.SecondLevelDomains.noConflict()),e}return n.URI===this&&(n.URI=o),this},s.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=O("query","?"),s.fragment=O("fragment","#"),s.search=function(t,e){var r=this.query(t,e);return"string"==typeof r&&r.length?"?"+r:r},s.hash=function(t,e){var r=this.fragment(t,e);return"string"==typeof r&&r.length?"#"+r:r},s.pathname=function(t,e){if(void 0===t||!0===t){var r=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=t?i.recodeUrnPath(t):"":this._parts.path=t?i.recodePath(t):"/",this.build(!e),this},s.path=s.pathname,s.href=function(t,e){var r;if(void 0===t)return this.toString();this._string="",this._parts=i._parts();var n=t instanceof i,o="object"===a(t)&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[i.getDomAttribute(t)]||"",o=!1);if(!n&&o&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=i.parse(String(t),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var s=n?t._parts:t;for(r in s)"query"!==r&&u.call(this._parts,r)&&(this._parts[r]=s[r]);s.query&&this.query(s.query,!1)}return this.build(!e),this},s.is=function(t){var e=!1,n=!1,o=!1,a=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(e=n||o))&&r&&r.has(this._parts.hostname),u=a&&i.idn_expression.test(this._parts.hostname),l=a&&i.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return a;case"sld":return s;case"ip":return e;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var E=s.protocol,P=s.port,x=s.hostname;s.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return E.call(this,t,e)},s.scheme=s.protocol,s.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),i.ensureValidPort(t))),P.call(this,t,e))},s.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(t,this._parts.protocol)}return x.call(this,t,e)},s.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(t);return this.protocol(n.protocol()).authority(n.authority()).build(!e),this},s.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==t[t.length-1]&&(t+="@"),i.parseUserinfo(t,this._parts),this.build(!e),this},s.resource=function(t,e){var r;return void 0===t?this.path()+this.search()+this.hash():(r=i.parse(t),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!e),this)},s.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+l(o));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&i.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,t),this.build(!e),this},s.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(e).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var o=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},s.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==e&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');i=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},s.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return t?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),s=new RegExp("^"+l(a));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=i.recodePath(t),this._parts.path=this._parts.path.replace(s,t),this.build(!e),this},s.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return t?i.decodePathSegment(n):n}var o=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(o=!0);var a=new RegExp(l(this.filename())+"$");return t=i.recodePath(t),this._parts.path=this._parts.path.replace(a,t),o?this.normalizePath(e):this.build(!e),this},s.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",t?i.decodePathSegment(n):n)}"."===t.charAt(0)&&(t=t.substring(1));var s,u=this.suffix();if(u)s=t?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!t)return this;this._parts.path+="."+i.recodePath(t)}return s&&(t=i.recodePath(t),this._parts.path=this._parts.path.replace(s,t)),this.build(!e),this},s.segment=function(t,e,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(i&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(f(e)){a=[];for(var s=0,u=e.length;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=p-h,P=Math.floor,x=String.fromCharCode;function T(t){throw new RangeError(O[t])}function C(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function k(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+C((t=t.replace(_,".")).split("."),e).join(".")}function A(t){for(var e,r,n=[],o=0,i=t.length;o=55296&&e<=56319&&o65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=x(t)}).join("")}function N(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,r){var n=0;for(t=r?P(t/v):t>>1,t+=P(t/e);t>E*y>>1;n+=p)t=P(t/E);return P(n+(E+1)*t/(t+d))}function M(t){var e,r,n,o,i,a,s,u,l,c,d,v=[],S=t.length,w=0,_=b,O=m;for((r=t.lastIndexOf(g))<0&&(r=0),n=0;n=128&&T("not-basic"),v.push(t.charCodeAt(n));for(o=r>0?r+1:0;o=S&&T("invalid-input"),((u=(d=t.charCodeAt(o++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:p)>=p||u>P((f-w)/a))&&T("overflow"),w+=u*a,!(u<(l=s<=O?h:s>=O+y?y:s-O));s+=p)a>P(f/(c=p-l))&&T("overflow"),a*=c;O=I(w-i,e=v.length+1,0==i),P(w/e)>f-_&&T("overflow"),_+=P(w/e),w%=e,v.splice(w++,0,_)}return j(v)}function R(t){var e,r,n,o,i,a,s,u,l,c,d,v,S,w,_,O=[];for(v=(t=A(t)).length,e=b,r=0,i=m,a=0;a=e&&dP((f-r)/(S=n+1))&&T("overflow"),r+=(s-e)*S,e=s,a=0;af&&T("overflow"),d==e){for(u=r,l=p;!(u<(c=l<=i?h:l>=i+y?y:l-i));l+=p)_=u-c,w=p-c,O.push(x(N(c+_%w,0))),u=P(_/w);O.push(x(N(u,0))),i=I(r,S,n==o),r=0,++n}++r,++e}return O.join("")}if(l={version:"1.3.2",ucs2:{decode:A,encode:j},decode:M,encode:R,toASCII:function(t){return k(t,function(t){return w.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return k(t,function(t){return S.test(t)?M(t.slice(4).toLowerCase()):t})}},"object"==o(r.amdO)&&r.amdO)void 0===(n=function(){return l}.call(e,r,e,t))||(t.exports=n);else if(a&&s)if(t.exports==a)s.exports=l;else for(c in l)l.hasOwnProperty(c)&&(a[c]=l[c]);else i.punycode=l}(this)},3872:function(){"use strict"},5619:function(t,e,r){"use strict";var n=window.SuperMap=window.SuperMap||{};n.Components=window.SuperMap.Components||{};var o={GEOJSON:"GEOJSON",ISERVER:"ISERVER",FGB:"FGB"},i={ISERVER:"ISERVER",IPORTAL:"IPORTAL",ONLINE:"ONLINE"},a={LINE:"LINE",LINEM:"LINEM",POINT:"POINT",REGION:"REGION",POINTEPS:"POINTEPS",LINEEPS:"LINEEPS",REGIONEPS:"REGIONEPS",ELLIPSE:"ELLIPSE",CIRCLE:"CIRCLE",TEXT:"TEXT",RECTANGLE:"RECTANGLE",UNKNOWN:"UNKNOWN",GEOCOMPOUND:"GEOCOMPOUND"},s={ATTRIBUTE:"ATTRIBUTE",ATTRIBUTEANDGEOMETRY:"ATTRIBUTEANDGEOMETRY",GEOMETRY:"GEOMETRY"},u={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"},l={DISTANCE:"DISTANCE",AREA:"AREA"},c={METER:"METER",KILOMETER:"KILOMETER",MILE:"MILE",YARD:"YARD",DEGREE:"DEGREE",MILLIMETER:"MILLIMETER",CENTIMETER:"CENTIMETER",INCH:"INCH",DECIMETER:"DECIMETER",FOOT:"FOOT",SECOND:"SECOND",MINUTE:"MINUTE",RADIAN:"RADIAN"},f={CENTIMETER:"CENTIMETER",DECIMETER:"DECIMETER",FOOT:"FOOT",INCH:"INCH",KILOMETER:"KILOMETER",METER:"METER",MILE:"MILE",MILLIMETER:"MILLIMETER",YARD:"YARD"},p={CAPTION:"CAPTION",CAPTION_PERCENT:"CAPTION_PERCENT",CAPTION_VALUE:"CAPTION_VALUE",PERCENT:"PERCENT",VALUE:"VALUE"},h={AREA:"AREA",BAR:"BAR",BAR3D:"BAR3D",LINE:"LINE",PIE:"PIE",PIE3D:"PIE3D",POINT:"POINT",RING:"RING",ROSE:"ROSE",ROSE3D:"ROSE3D",STACK_BAR:"STACK_BAR",STACK_BAR3D:"STACK_BAR3D",STEP:"STEP"},y={ALL:"ALL",NONE:"NONE",YAXES:"YAXES"},d={CONSTANT:"CONSTANT",LOGARITHM:"LOGARITHM",SQUAREROOT:"SQUAREROOT"},v={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"},m={BLACK_WHITE:"BLACKWHITE",BLUE_BLACK:"BLUEBLACK",BLUE_RED:"BLUERED",BLUE_WHITE:"BLUEWHITE",CYAN_BLACK:"CYANBLACK",CYAN_BLUE:"CYANBLUE",CYAN_GREEN:"CYANGREEN",CYAN_WHITE:"CYANWHITE",GREEN_BLACK:"GREENBLACK",GREEN_BLUE:"GREENBLUE",GREEN_ORANGE_VIOLET:"GREENORANGEVIOLET",GREEN_RED:"GREENRED",GREEN_WHITE:"GREENWHITE",PINK_BLACK:"PINKBLACK",PINK_BLUE:"PINKBLUE",PINK_RED:"PINKRED",PINK_WHITE:"PINKWHITE",RAIN_BOW:"RAINBOW",RED_BLACK:"REDBLACK",RED_WHITE:"REDWHITE",SPECTRUM:"SPECTRUM",TERRAIN:"TERRAIN",YELLOW_BLACK:"YELLOWBLACK",YELLOW_BLUE:"YELLOWBLUE",YELLOW_GREEN:"YELLOWGREEN",YELLOW_RED:"YELLOWRED",YELLOW_WHITE:"YELLOWWHITE"},b={TOPLEFT:"TOPLEFT",TOPCENTER:"TOPCENTER",TOPRIGHT:"TOPRIGHT",BASELINELEFT:"BASELINELEFT",BASELINECENTER:"BASELINECENTER",BASELINERIGHT:"BASELINERIGHT",BOTTOMLEFT:"BOTTOMLEFT",BOTTOMCENTER:"BOTTOMCENTER",BOTTOMRIGHT:"BOTTOMRIGHT",MIDDLELEFT:"MIDDLELEFT",MIDDLECENTER:"MIDDLECENTER",MIDDLERIGHT:"MIDDLERIGHT"},g={NORMAL:"ALONG_LINE_NORMAL",LB_TO_RT:"LEFT_BOTTOM_TO_RIGHT_TOP",LT_TO_RB:"LEFT_TOP_TO_RIGHT_BOTTOM",RB_TO_LT:"RIGHT_BOTTOM_TO_LEFT_TOP",RT_TO_LB:"RIGHT_TOP_TO_LEFT_BOTTOM"},S={DIAMOND:"DIAMOND",ELLIPSE:"ELLIPSE",MARKER:"MARKER",NONE:"NONE",RECT:"RECT",ROUNDRECT:"ROUNDRECT",TRIANGLE:"TRIANGLE"},w={NEWLINE:"NEWLINE",NONE:"NONE",OMIT:"OMIT"},_={FLAT:"FLAT",ROUND:"ROUND"},O={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"},E={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},P={BSPLINE:"BSPLINE",POLISH:"POLISH"},x={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"},T={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"},C={ADD:"add",UPDATE:"update",DELETE:"delete"},k={LESS_TIME:"LESS_TIME",LESS_TRANSFER:"LESS_TRANSFER",LESS_WALK:"LESS_WALK",MIN_DISTANCE:"MIN_DISTANCE"},A={BUS:"BUS",SUBWAY:"SUBWAY",NO_SUBWAY:"NO_SUBWAY",NONE:"NONE"},j={EXPONENTIAL:"EXPONENTIAL",GAUSSIAN:"GAUSSIAN",SPHERICAL:"SPHERICAL"},N={EXP1:"EXP1",EXP2:"EXP2"},I={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"},M={CLIP:"clip",INTERSECT:"intersect"},R={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"},D={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"},B={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},F={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},U={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"},G={GEOHASH_GRID:"geohash_grid"},V={AVG:"avg",MAX:"max",MIN:"min",SUM:"sum"},z={NDVI:"NDVI",HILLSHADE:"HILLSHADE"},H={CUSTOM:"CUSTOM",INTERSECTION:"INTERSECTION",UNION:"UNION"},q={CUSTOM:"CUSTOM",MAX:"MAX",MIN:"MIN"},J={DAY_BRIGHT:"DAY_BRIGHT",DUSK:"DUSK",NIGHT:"NIGHT"},W={BASIC:"BASIC",STANDARD:"STANDARD",OTHER:"OTHER"};function K(t){"@babel/helpers - typeof";return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Y(t,e){for(var r=0;r0&&(r=parseFloat(t.toPrecision(e))),r},format:function(t,e,r,n){e=void 0!==e?e:0,r=void 0!==r?r:st.thousandsSeparator,n=void 0!==n?n:st.decimalSeparator,null!=e&&(t=parseFloat(t.toFixed(e)));var o=t.toString().split(".");1===o.length&&null==e&&(e=0);var i,a=o[0];if(r)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+r+"$2");if(0==e)i=a;else{var u=o.length>1?o[1]:"0";null!=e&&(u+=new Array(e-u.length+1).join("0")),i=a+n+u}return i}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(t){return st.limitSigDigs(this,t)});var ut={bind:function(t,e){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return t.apply(e,n)}},bindAsEventListener:function(t,e){return function(r){return t.call(e,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},lt={filter:function(t,e,r){var n=[];if(Array.prototype.filter)n=t.filter(e,r);else{var o=t.length;if("function"!=typeof e)throw new TypeError;for(var i=0;i-1||wt.indexOf("trident")>-1&&wt.indexOf("rv")>-1?(bt="msie",mt=wt.match(/msie ([\d.]+)/)||wt.match(/rv:([\d.]+)/)):wt.indexOf("chrome")>-1?(bt="chrome",mt=wt.match(/chrome\/([\d.]+)/)):wt.indexOf("firefox")>-1?(bt="firefox",mt=wt.match(/firefox\/([\d.]+)/)):wt.indexOf("opera")>-1?(bt="opera",mt=wt.match(/version\/([\d.]+)/)):wt.indexOf("safari")>-1&&(bt="safari",mt=wt.match(/version\/([\d.]+)/)),gt=mt?mt[1]:"",wt.indexOf("ipad")>-1||wt.indexOf("ipod")>-1||wt.indexOf("iphone")>-1?St="apple":wt.indexOf("android")>-1&&(gt=(mt=wt.match(/version\/([\d.]+)/))?mt[1]:"",St="android"),{name:bt,version:gt,device:St}),Pt=(_t=!0,Ot=Et,document.createElement("canvas").getContext?("firefox"===Ot.name&&parseFloat(Ot.version)<5&&(_t=!1),"safari"===Ot.name&&parseFloat(Ot.version)<4&&(_t=!1),"opera"===Ot.name&&parseFloat(Ot.version)<10&&(_t=!1),"msie"===Ot.name&&parseFloat(Ot.version)<9&&(_t=!1)):_t=!1,_t),xt=function(){var t=navigator.userAgent.toLowerCase();return-1===t.indexOf("webkit")&&-1!==t.indexOf("gecko")}(),Tt={assign:function(t){for(var e=0;e=0;r--)t[r]===e&&t.splice(r,1);return t},indexOf:function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r=0&&parseFloat(s)<1?(t.style.filter="alpha(opacity="+100*s+")",t.style.opacity=s):1===parseFloat(s)&&(t.style.filter="",t.style.opacity="")},applyDefaults:function(t,e){t=t||{};var r="function"==typeof window.Event&&e instanceof window.Event;for(var n in e)(void 0===t[n]||!r&&e.hasOwnProperty&&e.hasOwnProperty(n)&&!t.hasOwnProperty(n))&&(t[n]=e[n]);return!r&&e&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&!t.hasOwnProperty("toString")&&(t.toString=e.toString),t},getParameterString:function(t){var e=[];for(var r in t){var n,o=t[r];if(null!=o&&"function"!=typeof o)n=Array.isArray(o)||"[object Object]"===o.toString()?encodeURIComponent(JSON.stringify(o)):encodeURIComponent(o),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},urlAppend:function(t,e){var r=t;if(e){0===e.indexOf("?")&&(e=e.substring(1));var n=(t+" ").split(/[?&]/);r+=" "===n.pop()?e:n.length?"&"+e:"?"+e}return r},urlPathAppend:function(t,e){var r=t;if(!e)return r;0===e.indexOf("/")&&(e=e.substring(1));var n=t.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r="".concat(n[0]).concat(e).concat(n.length>1?"?".concat(n[1]):"")},DEFAULT_PRECISION:14,toFloat:function(t,e){return null==e&&(e=Tt.DEFAULT_PRECISION),"number"!=typeof t&&(t=parseFloat(t)),0===e?t:parseFloat(t.toPrecision(e))},rad:function(t){return t*Math.PI/180},getParameters:function(t){t=null===t||void 0===t?window.location.href:t;var e="";if(at.contains(t,"?")){var r=t.indexOf("?")+1,n=at.contains(t,"#")?t.indexOf("#"):t.length;e=t.substring(r,n)}for(var o={},i=e.split(/[&;]/),a=0,s=i.length;a1?1/t:t},getResolutionFromScale:function(t,e){var r;t&&(null==e&&(e="degrees"),r=1/(Tt.normalizeScale(t)*Ct[e]*96));return r},getScaleFromResolution:function(t,e){return null==e&&(e="degrees"),t*Ct[e]*96},getBrowser:function(){return Et},isSupportCanvas:Pt,supportCanvas:function(){return Tt.isSupportCanvas},isInTheSameDomain:function(t){return!t||(-1===t.indexOf("//")||Tt.isSameDomain(t,document.location.toString()))},isSameDomain:function(t,e){return new(dt())(t).normalize().origin()===new(dt())(e).normalize().origin()},calculateDpi:function(t,e,r,n,o){if(t&&e&&r){var i,a=t.getWidth(),s=t.getHeight(),u=e.w,l=e.h;if(o=o||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){var c=a/u,f=s/l;i=254/(c>f?c:f)/r/(2*Math.PI*o/360)/1e4}else{i=254/(a/u)/r/1e4}return i}},toJSON:function(t){var e=t;if(null==e)return null;switch(e.constructor){case String:return e=(e=(e=(e=(e=(e=(e='"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,o=e.length;n0?"{"+u.join(",")+"}":"{}"}return e.toString()}},getResolutionFromScaleDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?(t=Tt.normalizeScale(t),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4):-1},getScaleFromResolutionDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4:-1},transformResult:function(t){return t.responseText&&"string"==typeof t.responseText&&(t=JSON.parse(t.responseText)),t},copyAttributes:function(t,e){if(t=t||{},e)for(var r in e){var n=e[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(t[r]=n)}return t},copyAttributesWithClip:function(t,e,r){if(t=t||{},e)for(var n in e){var o=!1;if(r&&r.length)for(var i=0,a=r.length;i=0&&i<=1&&o<=1&&i>=0?new ht.Point(t.x+o*(e.x-t.x),t.y+o*(e.y-t.y)):"No Intersection";else if(0==s&&0==u){var c=Math.max(t.y,e.y),f=Math.min(t.y,e.y),p=Math.max(t.x,e.x),h=Math.min(t.x,e.x);a=(r.y>=f&&r.y<=c||n.y>=f&&n.y<=c)&&r.x>=h&&r.x<=p||n.x>=h&&n.x<=p?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(t,e,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",t.fontSize&&(r.style.fontSize=t.fontSize),t.fontFamily&&(r.style.fontFamily=t.fontFamily),t.fontWeight&&(r.style.fontWeight=t.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=e;var n=r.clientWidth,o=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:o}},convertPath:function(t,e){return e?t.replace(/\{([\w-\.]+)\}/g,function(t,r){var n;return n=e.hasOwnProperty(r)?function(t){if(void 0==t||null==t)return"";if(t instanceof Date)return t.toJSON();if(function(t){if("string"!=typeof t&&"object"!==vt(t))return!1;try{var e=t.toString();return"[object Object]"===e||"[object Array]"===e}catch(t){return!1}}(t))return JSON.stringify(t);return t.toString()}(e[r]):t,encodeURIComponent(n)}):t}},Ct={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};Ct.in=Ct.inches,Ct.degrees=Ct.dd,Ct.nmi=1852*Ct.m;var kt=.0254000508001016;function At(t){"@babel/helpers - typeof";return(At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){for(var r=0;rt.right;)e.lon-=t.getWidth()}return e}},{key:"destroy",value:function(){this.lon=null,this.lat=null}}])&&jt(e.prototype,r),n&&jt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Mt(t){"@babel/helpers - typeof";return(Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rt(t,e){for(var r=0;rthis.right)&&(this.right=r.right),(null==this.top||r.top>this.top)&&(this.top=r.top))}}},{key:"containsLonLat",value:function(t,e){"boolean"==typeof e&&(e={inclusive:e}),e=e||{};var r=this.contains(t.lon,t.lat,e.inclusive),n=e.worldBounds;if(n&&!r){var o=n.getWidth(),i=(n.left+n.right)/2,a=Math.round((t.lon-i)/o);r=this.containsLonLat({lon:t.lon-a*o,lat:t.lat},{inclusive:e.inclusive})}return r}},{key:"containsPixel",value:function(t,e){return this.contains(t.x,t.y,e)}},{key:"contains",value:function(t,e,r){if(null==r&&(r=!0),null==t||null==e)return!1;var n=!1;return n=r?t>=this.left&&t<=this.right&&e>=this.bottom&&e<=this.top:t>this.left&&tthis.bottom&&e=r.bottom&&t.bottom<=r.top||r.bottom>=t.bottom&&r.bottom<=t.top,a=t.top>=r.bottom&&t.top<=r.top||r.top>t.bottom&&r.top=r.left&&t.left<=r.right||r.left>=t.left&&r.left<=t.right,u=t.right>=r.left&&t.right<=r.right||r.right>=t.left&&r.right<=t.right;n=(i||a)&&(s||u)}if(e.worldBounds&&!n){var l=e.worldBounds,c=l.getWidth(),f=!l.containsBounds(r),p=!l.containsBounds(t);f&&!p?(t=t.add(-c,0),n=r.intersectsBounds(t,{inclusive:e.inclusive})):p&&!f&&(r=r.add(-c,0),n=t.intersectsBounds(r,{inclusive:e.inclusive}))}return n}},{key:"containsBounds",value:function(t,e,r){null==e&&(e=!1),null==r&&(r=!0);var n=this.contains(t.left,t.bottom,r),o=this.contains(t.right,t.bottom,r),i=this.contains(t.left,t.top,r),a=this.contains(t.right,t.top,r);return e?n||o||i||a:n&&o&&i&&a}},{key:"determineQuadrant",value:function(t){var e="",r=this.getCenterLonLat();return e+=t.lat=t.right&&o.right>t.right;)o=o.add(-i,0);var a=o.left+r;at.left&&o.right-n>t.right&&(o=o.add(-i,0))}return o}},{key:"toServerJSONObject",value:function(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}},{key:"destroy",value:function(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}}])&&Rt(e.prototype,r),n&&Rt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Bt(t){"@babel/helpers - typeof";return(Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ft(t,e){for(var r=0;r-1)){if(null!=e&&e=0;--r)e=this.removeComponent(t[r])||e;return e}},{key:"removeComponent",value:function(t){return Tt.removeItem(this.components,t),this.clearBounds(),!0}},{key:"getArea",value:function(){for(var t=0,e=0,r=this.components.length;e=1?1:m)<=-1?-1:m,c=180*Math.acos(m)/Math.PI,a=(c=o.x==r.x?e.x>r.x&&n.x>r.x||e.xp*e.x+h&&n.y>p*n.x+h||e.yr.y?n.xr.x&&(s=!1):o.xp*n.x+h&&(s=!1):o.x>r.x?n.y>r.y&&(s=!1):n.y=0?180*Math.atan(b)/Math.PI:Math.abs(180*Math.atan(b)/Math.PI)+90,S=Math.abs(e.y);r.y==S&&S==o.y&&r.x=0?b>=0?l+=u:l=180-(l-90)+u:l=b>0?l-180+u:90-l+u:w>=0?b>=0?l-=u:l=180-(l-90)-u:l=b>=0?l-180-u:90-l-u,l=l*Math.PI/180;var O=e.x+i*Math.cos(l),E=e.y+i*Math.sin(l);f.push(new he(O,E))}f.push(o)}return f}},{key:"createLineEPS",value:function(t){var r=[],n=t.length;if(n<2)return t;for(var o=0;o2;return r&&be(ge(e.prototype),"removeComponent",this).apply(this,arguments),r}},{key:"getSortedSegments",value:function(){for(var t,e,r=this.components.length-1,n=new Array(r),o=0;o1&&(r=parseFloat(r)*l),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":u.x+=e/2,u.y+=r/2;break;case"lm":u.x+=e/2;break;case"lb":u.x+=e/2,u.y-=r/2;break;case"ct":u.y+=r/2;break;case"cb":u.y-=r/2;break;case"rt":u.x-=e/2,u.y+=r/2;break;case"rm":u.x-=e/2;break;case"rb":u.x-=e/2,u.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=e,o=u.x-parseFloat(e)/2,i=u.y+parseFloat(r)/2,s=u.x+parseFloat(e)/2,a=u.y-parseFloat(r)/2,new Dt(o,i,s,a)}},{key:"getLabelPxBoundsByText",value:function(t,e){var r,n,o,i,a=this.getLabelPxSize(e),s=Tt.cloneObject(t);if(e.labelAlign&&"cm"!==e.labelAlign)switch(e.labelAlign){case"lt":s.x+=a.w/2,s.y+=a.h/2;break;case"lm":s.x+=a.w/2;break;case"lb":s.x+=a.w/2,s.y-=a.h/2;break;case"ct":s.y+=a.h/2;break;case"cb":s.y-=a.h/2;break;case"rt":s.x-=a.w/2,s.y+=a.h/2;break;case"rm":s.x-=a.w/2;break;case"rb":s.x-=a.w/2,s.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=s.x-a.w/2,n=s.y+a.h/2,i=e.fontStyle&&"italic"===e.fontStyle?s.x+a.w/2+parseInt(parseFloat(e.fontSize)/2):s.x+a.w/2,o=s.y-a.h/2,new Dt(r,n,i,o)}},{key:"getLabelPxSize",value:function(t){var e,r,n,o,i=parseFloat(t.strokeWidth);e=t.label||this.text,r=t.fontSize?parseFloat(t.fontSize):parseFloat("12px");var a=e.split("\n"),s=a.length;o=s>1?r*s+s+i+.2*r:r+i+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return e.cnC=r,e.enC=n,e.textC=t.length,e}}])&&Oe(r.prototype,n),o&&Oe(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Ae(t){"@babel/helpers - typeof";return(Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function je(t,e){for(var r=0;r3;if(r){this.components.pop(),Me(Re(e.prototype),"removeComponent",this).apply(this,arguments);var n=this.components[0];Me(Re(e.prototype),"addComponent",this).apply(this,[n])}return r}},{key:"getArea",value:function(){var t=0;if(this.components&&this.components.length>2){for(var e=0,r=0,n=this.components.length;r0){t+=Math.abs(this.components[0].getArea());for(var e=1,r=this.components.length;e1},isLeftClick:function(t){return t.which&&1===t.which||t.button&&1===t.button},isRightClick:function(t){return t.which&&3===t.which||t.button&&2===t.button},stop:function(t,e){e||(t.preventDefault?t.preventDefault():t.returnValue=!1),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},findElement:function(t,e){for(var r=mr.element(t);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=e.toUpperCase());)r=r.parentNode;return r},observe:function(t,e,r,n){var o=Tt.getElement(t);if(n=n||!1,"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!o._eventCacheID){var i="eventCacheID_";o.id&&(i=o.id+"_"+i),o._eventCacheID=Tt.createUniqueID(i)}var a=o._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:o,name:e,observer:r,useCapture:n}),o.addEventListener?"mousewheel"===e?o.addEventListener(e,r,{useCapture:n,passive:!1}):o.addEventListener(e,r,n):o.attachEvent&&o.attachEvent("on"+e,r)},stopObservingElement:function(t){var e=Tt.getElement(t)._eventCacheID;this._removeElementObservers(mr.observers[e])},_removeElementObservers:function(t){if(t)for(var e=t.length-1;e>=0;e--){var r=t[e],n=new Array(r.element,r.name,r.observer,r.useCapture);mr.stopObserving.apply(this,n)}},stopObserving:function(t,e,r,n){n=n||!1;var o=Tt.getElement(t),i=o._eventCacheID;"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.detachEvent)&&(e="keydown");var a=!1,s=mr.observers[i];if(s)for(var u=0;!a&&u0))return null;for(var a=0,s=0,u=[];a0){t+='"points":[';for(var r=0,n=this.components.length;rt[i]){var a=t[i];t[i]=t[o],t[o]=a;var s=e[i];if(e[i]=e[o],e[o]=s,r&&r.length>0){var u=r[i];r[i]=r[o],r[o]=u}if(n&&n.length>0){var l=n[i];n[i]=n[o],n[o]=l}}}}],(r=[{key:"destroy",value:function(){var t=this;t.id=null,t.style=null,t.parts=null,t.partTopo=null,t.points=null,t.type=null,t.prjCoordSys=null}},{key:"toGeometry",value:function(){var t=this;switch(t.type.toUpperCase()){case a.POINT:return t.toGeoPoint();case a.LINE:return t.toGeoLine();case a.LINEM:return t.toGeoLinem();case a.REGION:return t.toGeoRegion();case a.POINTEPS:return t.toGeoPoint();case a.LINEEPS:return t.toGeoLineEPS();case a.REGIONEPS:return t.toGeoRegionEPS();case a.GEOCOMPOUND:return t.transformGeoCompound()}}},{key:"toGeoPoint",value:function(){var t=this.parts||[],e=this.points||[],r=t.length;if(r>0){if(1===r)return new he(e[0].x,e[0].y);for(var n=[],o=0;o0){if(1===r){for(var n=[],o=0;o0){if(1===s){for(t=0,r=[];t=0;g--)if(m[b]=-1,f[g].containsBounds(f[b])){p[b]=-1*p[g],p[b]<0&&(m[b]=g);break}for(var S=0;S0?i.push(c[S]):(i[m[S]].components=i[m[S]].components.concat(c[S].components),i.push(""))}else{i=new Array;for(var w=0;w0&&i.length>0&&(i[i.length-1].components=i[i.length-1].components.concat(u),u=[]),i.push(c[w])),w==o-1){var _=i.length;if(_)i[_-1].components=i[_-1].components.concat(u);else for(var O=0,E=u.length;O=0;S--)if(b[g]=-1,p[S].containsBounds(p[g])){h[g]=-1*h[S],h[g]<0&&(b[g]=S);break}for(var w=0;w0?a.push(f[w]):(a[b[w]].components=a[b[w]].components.concat(f[w].components),a.push(""))}else{a=new Array;for(var _=0;_0&&a.length>0&&(a[a.length-1].components=a[a.length-1].components.concat(l),l=[]),a.push(f[_])),_==o-1){var O=a.length;if(O)a[O-1].components=a[O-1].components.concat(l);else for(var E=0,P=l.length;E0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),e));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(t){var e={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(t)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(t,r){var n=e[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+t+'"'},number:function(t){return isFinite(t)?String(t):"null"},boolean:function(t){return String(t)},date:function(t){function e(t){return t<10?"0"+t:t}return'"'+t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+'"'}},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tn(t,e)}(e,wn),r=e,(n=[{key:"read",value:function(t,e){var r;if(this.nativeJSON)try{r=JSON.parse(t,e)}catch(e){return{data:t}}return this.keepData&&(this.data=r),r}},{key:"write",value:function(t,e){this.pretty=!!e;var r=null,n=_n(t);if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(t):this.serialize[n].apply(this,[t])}catch(t){}return r}},{key:"writeIndent",value:function(){var t=[];if(this.pretty)for(var e=0;e-1||(e[n]=t[n]);return e}}])&&An(r.prototype,n),o&&An(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Dn(t){"@babel/helpers - typeof";return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bn(t,e){for(var r=0;r0&&o.push(","),r=e[i].geometry,o.push(this.extractGeometry(r));return n&&o.push(")"),o.join("")}},{key:"extractGeometry",value:function(t){var e=t.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[e]?("collection"===e?"GEOMETRYCOLLECTION":e.toUpperCase())+"("+this.extract[e].apply(this,[t])+")":null}}])&&Bn(r.prototype,n),o&&Bn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Hn(t){"@babel/helpers - typeof";return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qn(t,e){for(var r=0;r=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=r.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],r.events=new wr(this,null,this.EVENT_TYPES),r.speed=Number(r.speed),r.frequency=Number(r.frequency),r.startTime=Number(r.startTime),r.endTime=Number(r.endTime),r.startTime=Date.parse(new Date(r.startTime)),r.endTime=Date.parse(new Date(r.endTime)),r.currentTime=r.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"},(e=[{key:"updateOptions",value:function(t){var e=this;(t=t||{}).speed&&t.speed>=0&&(e.speed=t.speed,e.speed=Number(e.speed)),t.speed&&t.frequency>=0&&(e.frequency=t.frequency,e.frequency=Number(e.frequency)),t.startTime&&null!=t.startTime&&(e.startTime=t.startTime,e.startTime=Date.parse(new Date(e.startTime))),t.endTime&&null!=t.endTime&&t.endTime>=e.startTime&&(e.endTime=t.endTime,e.endTime=Date.parse(new Date(e.endTime))),null!=t.repeat&&(e.repeat=t.repeat),null!=t.reverse&&(e.reverse=t.reverse)}},{key:"start",value:function(){var t=this;t.running||(t.running=!0,t.tick(),t.events.triggerEvent("start",t.currentTime))}},{key:"pause",value:function(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}},{key:"stop",value:function(){var t=this;t.currentTime=t.startTime,t.running&&(t.running=!1),t.events.triggerEvent("stop",t.currentTime)}},{key:"toggle",value:function(){this.running?this.pause():this.start()}},{key:"setSpeed",value:function(t){return t>=0&&(this.speed=t,!0)}},{key:"getSpeed",value:function(){return this.speed}},{key:"setFrequency",value:function(t){return t>=0&&(this.frequency=t,!0)}},{key:"getFrequency",value:function(){return this.frequency}},{key:"setStartTime",value:function(t){var e=this;return!((t=Date.parse(new Date(t)))>e.endTime)&&(e.startTime=t,e.currentTime=e.endTime&&(e.currentTime=e.startTime,e.tick()),!0)}},{key:"getEndTime",value:function(){return this.endTime}},{key:"setCurrentTime",value:function(t){var e=this;return e.currentTime=Date.parse(new Date(e.currentTime)),t>=e.startTime&&t<=e.endTime&&(e.currentTime=t,e.startTime=e.currentTime,e.tick(),!0)}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"setRepeat",value:function(t){this.repeat=t}},{key:"getRepeat",value:function(){return this.repeat}},{key:"setReverse",value:function(t){this.reverse=t}},{key:"getReverse",value:function(){return this.reverse}},{key:"getRunning",value:function(){return this.running}},{key:"destroy",value:function(){var t=this;t.speed=null,t.frequency=null,t.startTime=null,t.endTime=null,t.currentTime=null,t.repeat=null,t.running=!1,t.reverse=null}},{key:"tick",value:function(){}}])&&qn(t.prototype,e),r&&qn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Kn(t){"@babel/helpers - typeof";return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yn(t,e){for(var r=0;r=t.endTime&&(t.currentTime=t.endTime)}}}])&&Yn(r.prototype,n),o&&Yn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(),oo=(r(5246),r(1358),r(3678)),io=r.n(oo),ao=window.fetch,so={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(t){for(var e in t){this.queryKeys.push(e),"string"!=typeof t[e]&&(t[e]=Tt.toJSON(t[e]));var r=encodeURIComponent(t[e]);this.queryValues.push(r)}},issue:function(t){for(var e=this,r=e.getUid(),n=t.url,o=[],i=n,a=0,s=e.queryKeys?e.queryKeys.length:0,u=0;u=e.limitLength){if(0==a)return!1;o.push(i),i=n,a=0,u--}else if(i.length+e.queryKeys[u].length+2+e.queryValues[u].length>e.limitLength)for(var l=e.queryValues[u];l.length>0;){var c=e.limitLength-i.length-e.queryKeys[u].length-2;i.indexOf("?")>-1?i+="&":i+="?";var f=l.substring(0,c);"%"===f.substring(c-1,c)?(c-=1,f=l.substring(0,c)):"%"===f.substring(c-2,c-1)&&(c-=2,f=l.substring(0,c)),i+=e.queryKeys[u]+"="+f,l=l.substring(c),f.length>0&&(o.push(i),i=n,a=0)}else a++,i.indexOf("?")>-1?i+="&":i+="?",i+=e.queryKeys[u]+"="+e.queryValues[u];return o.push(i),e.send(o,"SuperMapJSONPCallbacks_"+r,t&&t.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(t,e,r){var n=t.length;if(n>0)return new Promise(function(o){for(var i=(new Date).getTime(),a=0;a-1?s+="&":s+="?",s+="sectionCount="+n,s+="§ionIndex="+a,s+="&jsonpUserID="+i,r&&(s=decodeURIComponent(s),s=r+encodeURIComponent(s)),io()(s,{jsonpCallbackFunction:e,timeout:3e4}).then(function(t){o(t.json())})}})},GET:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(t.params),this.issue(t)},POST:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},PUT:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},DELETE:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)}},uo=function(){return void 0!=eo?eo:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},lo=function(){return ro||45e3},co={commit:function(t,e,r,n){switch(t=t?t.toUpperCase():t){case"GET":return this.get(e,r,n);case"POST":return this.post(e,r,n);case"PUT":return this.put(e,r,n);case"DELETE":return this.delete(e,r,n);default:return this.get(e,r,n)}},supportDirectRequest:function(t,e){return!!Tt.isInTheSameDomain(t)||(void 0!=e.crossOrigin?e.crossOrigin:uo()||e.proxy)},get:function(t,e,r){r=r||{};if(t=Tt.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){var n={url:t=t.replace(".json",".jsonp"),data:e};return so.GET(n)}return this.urlIsLong(t)?this._postSimulatie("GET",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"GET")},delete:function(t,e,r){r=r||{};if(t=Tt.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=DELETE",data:e};return so.DELETE(n)}return this.urlIsLong(t)?this._postSimulatie("DELETE",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"DELETE")},post:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:Tt.urlAppend(t,"_method=POST"),data:e};return so.POST(n)}return this._fetch(t,e,r,"POST")},put:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=PUT",data:e};return so.PUT(n)}return this._fetch(t,e,r,"PUT")},urlIsLong:function(t){for(var e=0,r=null,n=0,o=t.length;n-1?"&":"?")+"_method="+t,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(e,r,n)},_processUrl:function(t,e){if(this._isMVTRequest(t))return t;if(-1===t.indexOf(".json")&&!e.withoutFormatSuffix)if(t.indexOf("?")<0)t+=".json";else{var r=t.split("?");2===r.length&&(t=r[0]+".json?"+r[1])}return e&&e.proxy&&("function"==typeof e.proxy?t=e.proxy(t):(t=decodeURIComponent(t),t=e.proxy+encodeURIComponent(t))),t},_fetch:function(t,e,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(e)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,ao(t,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?e:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:lo()}).then(function(t){return t})):ao(t,{method:n,body:"PUT"===n||"POST"===n?e:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:lo()}).then(function(t){return t})},_getWithCredentials:function(t){return!0===t.withCredentials?"include":!1===t.withCredentials?"omit":"same-origin"},_fetchJsonp:function(t,e){return e=e||{},io()(t,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(t,e){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},t),e.then(r,n)})},_getParameterString:function(t){var e=[];for(var r in t){var n,o=t[r];if(null!=o&&"function"!=typeof o)n=Array.isArray(o)||"[object Object]"===o.toString()?encodeURIComponent(JSON.stringify(o)):encodeURIComponent(o),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},_isMVTRequest:function(t){return t.indexOf(".mvt")>-1||t.indexOf(".pbf")>-1}};function fo(t){"@babel/helpers - typeof";return(fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function po(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials};return e=yo.appendCredential(e),co.commit(t,e,r,n).then(function(t){return t.json()})}}])&&No(t.prototype,e),r&&No(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ro(t){"@babel/helpers - typeof";return(Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lo(t,e){for(var r=0;r0?(r.totalTimes--,r.ajaxPolling(t)):r._commit(t)}},{key:"ajaxPolling",value:function(t){var e=this,r=t.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],r=r.replace(n,n.exec(e.url)[0]),t.url=r,t.isInTheSameDomain=Tt.isInTheSameDomain(r),e._commit(t)}},{key:"calculatePollingTimes",value:function(){var t=this;t.times?t.totalTimes>t.POLLING_TIMES?t.times>t.POLLING_TIMES?t.totalTimes=t.POLLING_TIMES:t.totalTimes=t.times:t.timest.POLLING_TIMES&&(t.totalTimes=t.POLLING_TIMES),t.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"transformResult",value:function(t,e){return{result:t=Tt.transformResult(t),options:e}}},{key:"transformErrorResult",value:function(t,e){return{error:(t=Tt.transformResult(t)).error||t,options:e}}},{key:"serviceProcessCompleted",value:function(t,e){t=this.transformResult(t).result,this.events.triggerEvent("processCompleted",{result:t,options:e})}},{key:"serviceProcessFailed",value:function(t,e){var r=(t=this.transformErrorResult(t).error).error||t;this.events.triggerEvent("processFailed",{error:r,options:e})}},{key:"_returnContent",value:function(t){return t.scope.format!==o.FGB&&!!t.scope.returnContent}},{key:"supportDataFormat",value:function(t){return this.dataFormat().includes(t)}},{key:"dataFormat",value:function(){return[o.GEOJSON,o.ISERVER]}},{key:"_commit",value:function(t){var e=this;if("POST"===t.method||"PUT"===t.method||"PATCH"===t.method)if(t.params&&(t.url=Tt.urlAppend(t.url,Tt.getParameterString(t.params||{}))),"object"!==qi(t.data)||t.data instanceof FormData)t.params=t.data;else try{t.params=Tt.toJSON(t.data)}catch(t){console.log("不是json对象")}return co.commit(t.method,t.url,t.params,{headers:t.headers,withoutFormatSuffix:t.withoutFormatSuffix,withCredentials:t.withCredentials,crossOrigin:t.crossOrigin,timeout:t.async?0:null,proxy:t.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(e){var r=e;return"string"==typeof e&&(r=(new Cn).read(e)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&t.scope.format===o.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(function(r){var n={object:e};if(r.error){var o="processFailed";if(e.events&&e.events.listeners[o]&&e.events.listeners[o].length){var i=t.failure&&(t.scope?ut.bind(t.failure,t.scope):t.failure);i?i(r,t):e.serviceProcessFailed(r,t)}else(n=zi(zi({},n),e.transformErrorResult(r,t))).type=o,t.failure&&t.failure(n)}else{var a="processCompleted";if(e.events&&e.events.listeners[a]&&e.events.listeners[a].length){var s=t.success&&(t.scope?ut.bind(t.success,t.scope):t.success);s?s(r,t):e.serviceProcessCompleted(r,t)}else r.succeed=void 0==r.succeed||r.succeed,(n=zi(zi({},n),e.transformResult(r,t))).type=a,t.success&&t.success(n)}return n})}}])&&Ji(t.prototype,e),r&&Ji(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Yi(t){"@babel/helpers - typeof";return(Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qi(t,e){for(var r=0;r0)for(var e in t.items)t.items[e].destroy(),t.items[e]=null;t.items=null}t.numericPrecision=null,t.rangeMode=null,t.rangeCount=null,t.colorGradientType=null}}])&&$s(t.prototype,e),r&&$s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ru(t){"@babel/helpers - typeof";return(ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nu(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[o].x+',"y":'+e[o].y+"}";else if(!0===t)for(var i=0;i0&&(r+=","),r+=e[i];return r+="]"}}])&&Ql(r.prototype,n),o&&Ql(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function nc(t){"@babel/helpers - typeof";return(nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oc(t,e){for(var r=0;r=0){var e=JSON.parse(t.data);return t.filterParam=e,t.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",t)}var r=JSON.parse(t.data);t.featureResult=r,t.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",t)}},{key:"_connect",value:function(t){return t=yo.appendCredential(t),"WebSocket"in window?new WebSocket(t):"MozWebSocket"in window?new(0,window.MozWebSocket)(t):(console.log("no WebSocket"),null)}}])&&oc(r.prototype,n),o&&oc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function cc(t){"@babel/helpers - typeof";return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fc(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[o].x+',"y":'+e[o].y+"}";else if(!0===t)for(var i=0;i0&&(r+=","),r+=e[i];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.facilityPathList)return t;var e=new Ln;return t.facilityPathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&iy(r.prototype,n),o&&iy(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function py(t){"@babel/helpers - typeof";return(py="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hy(t,e){for(var r=0;r0&&(e+=","),e+=Tt.toJSON(t[n]);return e+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t)return null;var e=new Ln;return t.demandResults&&(t.demandResults=e.toGeoJSON(t.demandResults)),t.supplyResults&&(t.supplyResults=e.toGeoJSON(t.supplyResults)),t}}])&&my(r.prototype,n),o&&my(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Ey(t){"@babel/helpers - typeof";return(Ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Py(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[o].x+',"y":'+e[o].y+"}";else if(!0===t)for(var i=0;i0&&(r+=","),r+=e[i];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList)return null;var e=new Ln;return t.pathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&ky(r.prototype,n),o&&ky(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Ly(t){"@babel/helpers - typeof";return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dy(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[o].x+',"y":'+e[o].y+"}";else if(!0===t)for(var i=0;i0&&(r+=","),r+=e[i];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList||t.pathList.length<1)return null;var e=new Ln;return t.pathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&Gy(r.prototype,n),o&&Gy(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Ky(t){"@babel/helpers - typeof";return(Ky="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yy(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[o].x+',"y":'+e[o].y+"}";else if(!0===t)for(var i=0;i0&&(r+=","),r+=e[i];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.serviceAreaList)return t;var e=new Ln;return t.serviceAreaList.map(function(t){return t.serviceRegion&&(t.serviceRegion=e.toGeoJSON(t.serviceRegion)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t.routes&&(t.routes=e.toGeoJSON(t.routes)),t}),t}}])&&$y(r.prototype,n),o&&$y(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function ad(t){"@babel/helpers - typeof";return(ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sd(t,e){for(var r=0;r0&&(e+=","),e+='{"x":'+o[r].x+',"y":'+o[r].y+"}";i+=e+="]"}else if(!0===t.isAnalyzeById){for(var a="[",s=t.nodes,u=s.length,l=0;l0&&(a+=","),a+=s[l];i+=a+="]"}return i}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.tspPathList)return null;var e=new Ln;return t.tspPathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&fd(r.prototype,n),o&&fd(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function bd(t){"@babel/helpers - typeof";return(bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gd(t,e){for(var r=0;r=0;t--)this.points[t].destroy();this.points=null}}}])&&ev(r.prototype,n),o&&ev(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function uv(t){"@babel/helpers - typeof";return(uv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lv(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null}}])&&Gv(r.prototype,n),o&&Gv(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Kv(t){"@babel/helpers - typeof";return(Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yv(t,e){for(var r=0;r=0&&n.toIndex>=0&&!o&&(n.url=Tt.urlAppend(n.url,"fromIndex=".concat(n.fromIndex,"&toIndex=").concat(n.toIndex))),n.returnContent&&(t.returnCountOnly||t.returnDatasetInfoOnly||t.returnFeaturesOnly||console.warn("recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method"),t.returnCountOnly&&(n.url=Tt.urlAppend(n.url,"returnCountOnly="+t.returnCountOnly)),t.returnDatasetInfoOnly&&(n.url=Tt.urlAppend(n.url,"returnDatasetInfoOnly="+t.returnDatasetInfoOnly)),t.returnFeaturesOnly&&(n.url=Tt.urlAppend(n.url,"returnFeaturesOnly="+t.returnFeaturesOnly))),r=n.getJsonParameters(t),n.request({method:"POST",data:r,scope:n,success:e,failure:e})}}},{key:"transformResult",value:function(t,e){t=Tt.transformResult(t);var r=new Ln;(this.format===o.GEOJSON&&t.features&&(t.features=r.toGeoJSON(t.features)),this.returnFeaturesOnly&&Array.isArray(t))&&(t={succeed:t.succeed,features:r.toGeoJSON(t)});return{result:t,options:e}}},{key:"dataFormat",value:function(){return[o.GEOJSON,o.ISERVER,o.FGB]}}])&&Yv(r.prototype,n),i&&Yv(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function rm(t){"@babel/helpers - typeof";return(rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nm(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.geometry&&(t.geometry.destroy(),t.geometry=null)}}])&&fm(r.prototype,n),o&&fm(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function bm(t){"@babel/helpers - typeof";return(bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gm(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null}}])&&Tm(r.prototype,n),o&&Tm(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Mm(t){"@babel/helpers - typeof";return(Mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rm(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}}}])&&zm(r.prototype,n),o&&zm(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Qm(t){"@babel/helpers - typeof";return(Qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xm(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultStyle&&(t.defaultStyle.destroy(),t.defaultStyle=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=Tt.copyAttributes(t,this)).defaultStyle&&t.defaultStyle.toServerJSONObject&&(t.defaultStyle=t.defaultStyle.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.rangeExpression=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&NS(r.prototype,n),o&&NS(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function FS(t){"@babel/helpers - typeof";return(FS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function US(t,e){for(var r=0;r0?t[0].subLayers.layers:null)?r.length:0,this.handleLayers(n,r),{result:t[0],options:e}}},{key:"handleLayers",value:function(t,e){var r;if(t)for(var n=0;n0)this.handleLayers(e[n].subLayers.layers.length,e[n].subLayers.layers);else switch(e[n].ugcLayerType){case"THEME":(r=new vw).fromJson(e[n]),e[n]=r;break;case"GRID":(r=new Ew).fromJson(e[n]),e[n]=r;break;case"IMAGE":(r=new Nw).fromJson(e[n]),e[n]=r;break;case"VECTOR":(r=new Uw).fromJson(e[n]),e[n]=r}}}}])&&Vw(r.prototype,n),o&&Vw(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Yw(t){"@babel/helpers - typeof";return(Yw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qw(t,e){for(var r=0;r=200&&t.code<300||0==t.code||304===t.code,n=t.code&&r;return!t.code||n?{result:t,options:e}:{error:t,options:e}}}])&&jO(r.prototype,n),o&&jO(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function BO(t){"@babel/helpers - typeof";return(BO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FO(t,e){for(var r=0;r0&&(n+='"subLayers":'+t.toJSON()),n+=',"visible":true,',n+='"name":"'+this.getMapName(this.mapUrl)+'"',n+="}]",r.request({method:"PUT",data:n,scope:r,success:e,failure:e})}}},{key:"createTempLayerComplete",value:function(t,e){return e=e.result?e.result:e,(e=Tt.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams,t)}},{key:"getMapName",value:function(t){var e=t;"/"===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1));var r=e.lastIndexOf("/");return e.substring(r+1,e.length)}},{key:"transformResult",value:function(t,e){return null!=(t=Tt.transformResult(t))&&null!=this.lastparams&&null!=this.lastparams.resourceID&&(t.newResourceID=this.lastparams.resourceID),{result:t,options:e}}}])&&pk(r.prototype,n),o&&pk(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function gk(t){"@babel/helpers - typeof";return(gk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sk(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.reverseColor=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&uj(r.prototype,n),o&&uj(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function dj(t){"@babel/helpers - typeof";return(dj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vj(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultcolor&&(t.defaultcolor.destroy(),t.defaultcolor=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=Tt.copyAttributes(t,this)).defaultcolor&&t.defaultcolor.toServerJSONObject&&(t.defaultcolor=t.defaultcolor.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0&&(t=t.substring(0,t.length-1)),"{"+t+"}"}return null}}])&&Nj(t.prototype,e),r&&Nj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Rj(t){"@babel/helpers - typeof";return(Rj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lj(t,e){for(var r=0;r0&&(1===o.length?r+="'displayFilter':\""+o[0]+'",':r+="'displayFilter':\""+o[a]+'",'),(i=t.displayOrderBy)&&i.length>0&&(1===i.length?r+="'displayOrderBy':'"+i[0]+"',":r+="'displayOrderBy':'"+i[a]+"',"),(e=t.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+Tt.toJSON(e)+","),t.joinItems&&t.joinItems.length>0&&t.joinItems[a]&&(r+="'joinItems':["+Tt.toJSON(t.joinItems[a])+"],"),t.datasetNames&&t.dataSourceNames){var u=t.datasetNames[a]?a:t.datasetNames.length-1,l=t.dataSourceNames[a]?a:t.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+t.datasetNames[u]+"','dataSourceName': '"+t.dataSourceNames[l]+"'}},"}else r+="},"}t.themes&&t.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var c=this.url.split("/");return r+="'name': '"+c[c.length-2]+"'}]"}}])&&Uj(r.prototype,n),o&&Uj(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Wj(t){"@babel/helpers - typeof";return(Wj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kj(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function iR(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function aR(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){iR(i,n,o,a,s,"next",t)}function s(t){iR(i,n,o,a,s,"throw",t)}a(void 0)})}}function sR(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function vL(t){return function(t){if(Array.isArray(t))return mL(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mL(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mL(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mL(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]?arguments[3]:{};return e=yo.appendCredential(e),n.crossOrigin=this.options.crossOrigin,n.headers=this.options.headers,co.commit(t,e,r,n).then(function(t){return t.json()})}}])&&jL(t.prototype,e),r&&jL(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ML(t){"@babel/helpers - typeof";return(ML="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function RL(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);re.geoFence.radius&&(e.outOfGeoFence&&e.outOfGeoFence(t),e.events.triggerEvent("outOfGeoFence",{data:t})),r})}},{key:"_distance",value:function(t,e,r,n){return Math.sqrt((t-r)*(t-r)+(e-n)*(e-n))}},{key:"_getMeterPerMapUnit",value:function(t){var e;return"meter"===t?e=1:"degree"===t&&(e=2*Math.PI*6378137/360),e}}])&&cD(t.prototype,e),r&&cD(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function hD(t){"@babel/helpers - typeof";return(hD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yD(t,e){for(var r=0;ri&&(i=t+s+100,n.width=i,r=!0),e+u>a&&(a=e+u+100,n.height=a,r=!0),t<-s&&(i+=s=100*Math.ceil(-t/100),n.width=i,r=!0),e<-u&&(a+=u=100*Math.ceil(-e/100),n.height=a,r=!0),r&&o.translate(s,u)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r1)for(var o=0,i=n-1;o1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],r=0;return t.replace(/[\d.]+/g,function(t){r<3?t|=0:t=+t,e[r++]=t}),e}},{key:"convert",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):e.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,e)}},{key:"toRGBA",value:function(t){return this.convert(t,"rgba")}},{key:"toRGB",value:function(t){return this.convert(t,"rgb")}},{key:"toHex",value:function(t){return this.convert(t,"hex")}},{key:"toHSVA",value:function(t){return this.convert(t,"hsva")}},{key:"toHSV",value:function(t){return this.convert(t,"hsv")}},{key:"toHSBA",value:function(t){return this.convert(t,"hsba")}},{key:"toHSB",value:function(t){return this.convert(t,"hsb")}},{key:"toHSLA",value:function(t){return this.convert(t,"hsla")}},{key:"toHSL",value:function(t){return this.convert(t,"hsl")}},{key:"toName",value:function(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}},{key:"trim",value:function(t){return String(t).replace(/\s+/g,"")}},{key:"normalize",value:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t}},{key:"lift",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),o=0;o<3;o++)n[o]=1===r?n[o]*(1-e)|0:(255-n[o])*e+n[o]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}},{key:"mix",value:function(t,e,r){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,o=this.getData(this.toRGBA(t)),i=this.getData(this.toRGBA(e)),a=o[3]-i[3],s=((n*a==-1?n:(n+a)/(1+n*a))+1)/2,u=1-s,l=[],c=0;c<3;c++)l[c]=o[c]*s+i[c]*u;var f=o[3]*r+i[3]*(1-r);return f=Math.max(0,Math.min(1,f)),1===o[3]&&1===i[3]?this.toColor(l,"rgb"):(l[3]=f,this.toColor(l,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(e){var r,n,o=(e=this.normalize(e)).match(this.colorRegExp);if(null===o)throw new Error("The color format error");var i,a=[];if(o[2])i=[(r=o[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(i,function(e){return t.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(o[4]){var s=o[4].split(",");n=s[3],i=s.slice(0,3),a=this.map(i,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),t.prototype.adjust.call(this,e,[0,255])}),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}else if(o[5]||o[6]){var u=(o[5]||o[6]).split(","),l=parseInt(u[0],0)/360,c=u[1],f=u[2];n=u[3],(a=this.map([c,f],function(e){return t.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}return a}},{key:"alpha",value:function(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var r=this.getData(this.toRGBA(t));return r[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t}},{key:"isCalculableColor",value:function(t){return t instanceof Array||"string"==typeof t}},{key:"_HSV_2_RGB",value:function(t){var e,r,n,o=t[0],i=t[1],a=t[2];if(0===i)e=255*a,r=255*a,n=255*a;else{var s=6*o;6===s&&(s=0);var u=0|s,l=a*(1-i),c=a*(1-i*(s-u)),f=a*(1-i*(1-(s-u))),p=0,h=0,y=0;0===u?(p=a,h=f,y=l):1===u?(p=c,h=a,y=l):2===u?(p=l,h=a,y=f):3===u?(p=l,h=c,y=a):4===u?(p=f,h=l,y=a):(p=a,h=l,y=c),e=255*p,r=255*h,n=255*y}return[e,r,n]}},{key:"_HSL_2_RGB",value:function(t){var e,r,n,o=t[0],i=t[1],a=t[2];if(0===i)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+i):a+i-i*a);e=255*this._HUE_2_RGB(u,s,o+1/3),r=255*this._HUE_2_RGB(u,s,o),n=255*this._HUE_2_RGB(u,s,o-1/3)}return[e,r,n]}},{key:"_HUE_2_RGB",value:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}},{key:"_RGB_2_HSB",value:function(t){var e,r,n=t[0]/255,o=t[1]/255,i=t[2]/255,a=Math.min(n,o,i),s=Math.max(n,o,i),u=s-a,l=s;if(0===u)e=0,r=0;else{r=u/s;var c=((s-n)/6+u/2)/u,f=((s-o)/6+u/2)/u,p=((s-i)/6+u/2)/u;n===s?e=p-f:o===s?e=1/3+c-p:i===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}},{key:"_RGB_2_HSL",value:function(t){var e,r,n=t[0]/255,o=t[1]/255,i=t[2]/255,a=Math.min(n,o,i),s=Math.max(n,o,i),u=s-a,l=(s+a)/2;if(0===u)e=0,r=0;else{r=l<.5?u/(s+a):u/(2-s-a);var c=((s-n)/6+u/2)/u,f=((s-o)/6+u/2)/u,p=((s-i)/6+u/2)/u;n===s?e=p-f:o===s?e=1/3+c-p:i===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}}])&&bD(e.prototype,r),n&&bD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function wD(t){"@babel/helpers - typeof";return(wD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _D(t,e){for(var r=0;r=e)if("RANGE"===r)for(o=0;o0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}function AD(t){"@babel/helpers - typeof";return(AD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jD(){jD=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:x(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function b(){}function g(){}var S={};l(S,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,a)&&(S=_);var O=g.prototype=m.prototype=Object.create(S);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==AD(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ND(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ID(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ID(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ID(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0&&this.getSqrtInterval(t,r):"logarithm"===e?this.getMin(t)>0&&this.getGeometricProgression(t,r):void 0}},{key:"getSum",value:function(t){return this.getInstance(t).sum()}},{key:"getMax",value:function(t){return this.getInstance(t).max()}},{key:"getMin",value:function(t){return this.getInstance(t).min()}},{key:"getMean",value:function(t){return this.getInstance(t).mean()}},{key:"getMedian",value:function(t){return this.getInstance(t).median()}},{key:"getTimes",value:function(t){return t.length}},{key:"getEqInterval",value:function(t,e){return this.getInstance(t).getClassEqInterval(e)}},{key:"getJenks",value:function(t,e){return this.getInstance(t).getClassJenks(e)}},{key:"getSqrtInterval",value:function(t,e){return t=t.map(function(t){return Math.sqrt(t)}),this.getInstance(t).getClassEqInterval(e).map(function(t){return t*t})}},{key:"getGeometricProgression",value:function(t,e){return this.getInstance(t).getClassGeometricProgression(e)}}],(e=null)&&GD(t.prototype,e),r&&GD(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),HD=function(t){var e;if(!t)return e;return["m","meter","meters"].indexOf(t.toLocaleLowerCase())>-1?e=1:["degrees","deg","degree","dd"].indexOf(t.toLocaleLowerCase())>-1?e=2*Math.PI*6378137/360:t===c.KILOMETER?e=.001:t===c.INCH?e=1/.025399999918:t===c.FOOT&&(e=.3048),e};function qD(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:22,i=arguments.length>5?arguments[5]:void 0,a=[];if(t&&t.length>0)for(var s=0;su){c=p;break}}for(var h=0;hMath.abs(t-e[o])&&(r=Math.abs(t-e[o]),n=o);return n}function WD(t,e,r){return 1/(t*e*(1/.0254)*HD(r))}function KD(t,e,r){return 1/e/(t*(1/.0254)*HD(r))}function YD(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t.flat()),n=window.Module._malloc(2*e*8);window.Module.HEAPF64.set(r,n/8);var o=window.Module._UGCWasm_Geometry_CreatePoint2DsFromBuffer(n,e);return window.Module._free(n),o}function QD(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t),n=window.Module._malloc(8*e);window.Module.HEAPF64.set(r,n/8);var o=window.Module._UGCWasm_Helper_CreateDoubleArray(n,e);return window.Module._free(n),o}function XD(t){var e=window.Module._UGCWasm_Helper_GetDoubleArrayLength(t),r=window.Module._malloc(8*e);window.Module._UGCWasm_Helper_GetBufferFromDoubleArray(t,r);for(var n=new Float64Array(window.Module.HEAPF64.buffer,r,e),o=[],i=0;i1)for(var i=1;i1)for(var l=1;l2&&void 0!==arguments[2]?arguments[2]:1e-6,n=$D(t),o=$D(e);return 1===this.module._UGCWasm_Geometrist_IsIdentical(n,o,r)}},{key:"hasIntersection",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=$D(t),o=$D(e);return 1===this.module._UGCWasm_Geometrist_HasIntersection(n,o,r)}},{key:"hasTouch",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=$D(t),o=$D(e);return 1===this.module._UGCWasm_Geometrist_HasTouch(n,o,r)}},{key:"resample",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6,r=$D(t);return{type:"Feature",geometry:ZD(this.module._UGCWasm_Geometrist_Resample(r,e))}}},{key:"isParallel",value:function(t,e,r,n,o,i,a,s){return 1===this.module._UGCWasm_Geometrist_IsParallel(t,e,r,n,o,i,a,s)}},{key:"computePerpendicularPosition",value:function(t,e,r,n,o,i){var a=this.module._UGCWasm_Helper_CreateDoubleArray(0,2);return this.module._UGCWasm_Geometrist_ComputePerpendicularPosition(t,e,r,n,o,i,a),a=XD(a)}},{key:"isPointOnLine",value:function(t,e,r,n,o,i,a){return 1===this.module._UGCWasm_Geometrist_IsPointOnLine(t,e,r,n,o,i,a)}},{key:"isProjectOnLineSegment",value:function(t,e,r,n,o,i){return 1===this.module._UGCWasm_Geometrist_IsProjectOnLineSegment(t,e,r,n,o,i)}},{key:"distanceToLineSegment",value:function(t,e,r,n,o,i){return this.module._UGCWasm_Geometrist_DistanceToLineSegment(t,e,r,n,o,i)}},{key:"nearestPointToVertex",value:function(t,e,r){var n=this.module._UGCWasm_Helper_CreateDoubleArray(0,2),o=$D(r);return this.module._UGCWasm_Geometrist_NearestPointToVertex(t,e,o,n),n=XD(n)}},{key:"computeConcaveHullPoints",value:function(t,e,r){var n=QD(t),o=QD(e);return{type:"Feature",geometry:ZD(this.module._UGCWasm_Geometrist_ComputeConcaveHullPoints(n,o,t.length,r))}}},{key:"isSegmentIntersect",value:function(t,e,r,n,o,i,a,s){return 1===this.module._UGCWasm_Geometrist_IsSegmentIntersect(t,e,r,n,o,i,a,s)}},{key:"isIntersectRegionWithRect",value:function(t,e,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e-6,a=$D(t);return 0!==this.module._UGCWasm_Geometrist_isIntersectRegionWithRect(a,e,r,n,o,i)}},{key:"isOnSameSide",value:function(t,e,r,n,o,i,a,s){return 1===this.module._UGCWasm_Geometrist_IsOnSameSide(t,e,r,n,o,i,a,s)}},{key:"isRight",value:function(t,e,r,n,o,i){return 1===this.module._UGCWasm_Geometrist_IsRight(t,e,r,n,o,i)}},{key:"isLeft",value:function(t,e,r,n,o,i){return 1===this.module._UGCWasm_Geometrist_IsLeft(t,e,r,n,o,i)}},{key:"computeGeodesicArea",value:function(t){var e=$D(t),r=this.module._UGCWasm_Geometry_NewUGPrjCoordSys(4326);return this.module._UGCWasm_Geometrist_ComputeGeodesicArea(e,r)}},{key:"smooth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=$D(t);return{type:"Feature",geometry:ZD(this.module._UGCWasm_Geometrist_Smooth(r,e))}}},{key:"computeGeodesicDistance",value:function(t,e,r,n){var o=QD(t),i=QD(e);return this.module._UGCWasm_Geometrist_ComputeGeodesicDistance(o,i,r,n)}},{key:"computeParallel",value:function(t,e){var r=$D(t);return{type:"Feature",geometry:ZD(this.module._UGCWasm_Geometrist_ComputeParallel(r,e))}}},{key:"computeConvexHullPoints",value:function(t,e){var r=QD(t),n=QD(e);return{type:"Feature",geometry:ZD(this.module._UGCWasm_Geometrist_ComputeConvexHullPoints(r,n,t.length))}}}])&&rB(r.prototype,n),o&&rB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();var uB=r(8518),lB=r.n(uB);function cB(t){"@babel/helpers - typeof";return(cB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pB(t,e){for(var r=0;rl&&(u[o]=u[o].slice(n-l),l=n)}function d(t){var e,i,a,s;if(t instanceof Function)return t.call(c.parsers);if("string"==typeof t)e=r.charAt(n)===t?t:null,i=1,y();else{if(y(),!(e=t.exec(u[o])))return null;i=e[0].length}if(e){var f=n+=i;for(s=n+u[o].length-i;n=0&&"\n"!==n.charAt(a);a--)t.column++;return new Error([t.filename,t.line,t.column,t.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},c={parse:function(i){var a,c=null;if(n=o=l=s=0,u=[],r=i.replace(/\r\n/g,"\n"),e.filename&&(f.env.inputs[e.filename]=r),u=function(t){for(var e,n,o,i,a=0,s=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,u=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,l=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,f=0,p=t[0],h=0;h0?"missing closing `}`":"missing opening `{`"}),t.map(function(t){return t.join("")})}([[]]),c)throw v(c);var p=function(t,e){var r=t.specificity,n=e.specificity;return r[0]!=n[0]?n[0]-r[0]:r[1]!=n[1]?n[1]-r[1]:r[2]!=n[2]?n[2]-r[2]:n[3]-r[3]};return(a=new t.Tree.Ruleset([],d(this.parsers.primary))).root=!0,a.toList=function(t){t.error=function(e){t.errors||(t.errors=new Error("")),t.errors.message?t.errors.message+="\n"+v(e).message:t.errors.message=v(e).message},t.frames=t.frames||[];var e=this.flatten([],[],t);return e.sort(p),e},a},parsers:{primary:function(){for(var t,e=[];(t=d(this.rule)||d(this.ruleset)||d(this.comment))||d(/^[\s\n]+/)||(t=d(this.invalid));)t&&e.push(t);return e},invalid:function(){var e=d(/^[^;\n]*[;\n]/);if(e)return new t.Tree.Invalid(e,a)},comment:function(){var e;if("/"===r.charAt(n))return"/"===r.charAt(n+1)?new t.Tree.Comment(d(/^\/\/.*/),!0):(e=d(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new t.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===r.charAt(n)||"'"===r.charAt(n)){var e=d(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new t.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(d("[")){var e=d(/(^[^\]]+)/);if(d("]"))return e?new t.Tree.Field(e[1]):void 0}},comparison:function(){var t=d(/^=~|=|!=|<=|>=|<|>/);if(t)return t},keyword:function(){var e=d(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new t.Tree.Keyword(e)},call:function(){var e,r;if(e=/^([\w\-]+|%)\(/.exec(u[o])){if("url"===(e=e[1]))return null;n+=e.length;if(d("("),r=d(this.entities.arguments),d(")"))return e?new t.Tree.Call(e,r,n):void 0}},arguments:function(){for(var t,e=[];t=d(this.expression);){e.push(t);if(!d(","))break}return e},literal:function(){return d(this.entities.dimension)||d(this.entities.keywordcolor)||d(this.entities.hexcolor)||d(this.entities.quoted)},url:function(){var e;if("u"===r.charAt(n)&&d(/^url\(/)){e=d(this.entities.quoted)||d(this.entities.variable)||d(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return d(")")?new t.Tree.URL(void 0!==e.value||e instanceof t.Tree.Variable?e:new t.Tree.Quoted(e)):new t.Tree.Invalid(e,a,"Missing closing ) in URL.")}},variable:function(){var o,i=n;if("@"===r.charAt(n)&&(o=d(/^@[\w-]+/)))return new t.Tree.Variable(o,i,e.filename)},hexcolor:function(){var e;if("#"===r.charAt(n)&&(e=d(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new t.Tree.Color(e[1])},keywordcolor:function(){var e=u[o].match(/^[a-z]+/);if(e&&e[0]in t.Tree.Reference.data.colors)return new t.Tree.Color(t.Tree.Reference.data.colors[d(/^[a-z]+/)])},dimension:function(){var e=r.charCodeAt(n);if(!(e>57||e<45||47===e)){var o=d(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return o?new t.Tree.Dimension(o[1],o[2],a):void 0}}},variable:function(){var t;if("@"===r.charAt(n)&&(t=d(/^(@[\w-]+)\s*:/)))return t[1]},entity:function(){var t=d(this.entities.call)||d(this.entities.literal),e=d(this.entities.field)||d(this.entities.variable),r=d(this.entities.url)||d(this.entities.keyword);return t||e||r},end:function(){var t;return d(";")||("string"==typeof(t="}")?r.charAt(n)===t:!!t.test(u[o]))},element:function(){var e=d(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new t.Tree.Element(e)},attachment:function(){var t=d(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(t)return t[1]},selector:function(){for(var e,o,i,s,u,l=[],c=new t.Tree.Filterset,f=[],p=0,h=0;(i=d(this.element))||(u=d(this.zoom))||(s=d(this.filter))||(e=d(this.attachment));){if(p++,i)l.push(i);else if(u)f.push(u),h++;else if(s){var y=c.add(s);if(y)throw v({message:y,index:n-1});h++}else{if(o)throw v({message:"Encountered second attachment name.",index:n-1});o=e}var m=r.charAt(n);if("{"===m||"}"===m||";"===m||","===m)break}if(p)return new t.Tree.Selector(c,f,l,o,h,a)},filter:function(){p();var r,n,o;if(d("[")&&(r=d(/^[a-zA-Z0-9\-_]+/)||d(this.entities.quoted)||d(this.entities.variable)||d(this.entities.keyword)||d(this.entities.field))&&(r instanceof t.Tree.Quoted&&(r=new t.Tree.Field(r.toString())),(n=d(this.entities.comparison))&&(o=d(this.entities.quoted)||d(this.entities.variable)||d(this.entities.dimension)||d(this.entities.keyword)||d(this.entities.field)))){if(!d("]"))throw v({message:"Missing closing ] of filter.",index:a-1});return r.is||(r=new t.Tree.Field(r)),new t.Tree.Filter(r,n,o,a,e.filename)}},zoom:function(){p();var e,r;if(d(/^\[\s*zoom/g)&&(e=d(this.entities.comparison))&&(r=d(this.entities.variable)||d(this.entities.dimension))&&d("]"))return new t.Tree.Zoom(e,r,a);h()},block:function(){var t;if(d("{")&&(t=d(this.primary))&&d("}"))return t},ruleset:function(){var e,r,n=[];for(p();e=d(this.selector);){for(n.push(e);d(this.comment););if(!d(","))break;for(;d(this.comment););}if(e)for(;d(this.comment););if(n.length>0&&(r=d(this.block))){if(1===n.length&&n[0].elements.length&&"Map"===n[0].elements[0].value){var o=new t.Tree.Ruleset(n,r);return o.isMap=!0,o}return new t.Tree.Ruleset(n,r)}h()},rule:function(){var o,i,u=r.charAt(n);if(p(),"."!==u&&"#"!==u&&(o=d(this.variable)||d(this.property))){if((i=d(this.value))&&d(this.end))return new t.Tree.Rule(o,i,a,e.filename);s=n,h()}},font:function(){for(var e,r=[],n=[];e=d(this.entity);)n.push(e);if(r.push(new t.Tree.Expression(n)),d(","))for(;(e=d(this.expression))&&(r.push(e),d(",")););return new t.Tree.Value(r)},value:function(){for(var e,r=[];(e=d(this.expression))&&(r.push(e),d(",")););return r.length>1?new t.Tree.Value(r.map(function(t){return t.value[0]})):1===r.length?new t.Tree.Value(r):void 0},sub:function(){var t;if(d("(")&&(t=d(this.expression))&&d(")"))return t},multiplication:function(){var e,r,n,o;if(e=d(this.operand)){for(;(n=d("/")||d("*")||d("%"))&&(r=d(this.operand));)o=new t.Tree.Operation(n,[o||e,r],a);return o||e}},addition:function(){var e,o,i,s;if(e=d(this.multiplication)){for(;(i=d(/^[-+]\s+/)||" "!=r.charAt(n-1)&&(d("+")||d("-")))&&(o=d(this.multiplication));)s=new t.Tree.Operation(i,[s||e,o],a);return s||e}},operand:function(){return d(this.sub)||d(this.entity)},expression:function(){for(var e,r=[];e=d(this.addition)||d(this.entity);)r.push(e);if(r.length>0)return new t.Tree.Expression(r)},property:function(){var t=d(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(t)return t[1]}}}}},{key:"parse",value:function(t){var e=this.parser;return this.ruleSet=e.parse(t)}},{key:"toShaders",value:function(){if(this.ruleSet){var t=this.ruleSet;if(t){var e=t.toList(this.env);e.reverse();var r={},n=[];this._toShaders(r,n,e);for(var o=[],i={},a=0,s=e.length;a=0){if(!e.featureFilter){var i=o+n.length,a=r.indexOf(")",i+1),s="featureId&&(featureId"+r.substring(i,a)+")";Object.defineProperty(e,"featureFilter",{configurable:!0,enumerable:!1,value:function(t){return!!s}})}return{property:h,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:h,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(c[h],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:l}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),o.push(f),i[n[a]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return o}}return null}},{key:"_toShaders",value:function(e,r,n){for(var o=0,i=n.length;o= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};function mB(t){"@babel/helpers - typeof";return(mB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bB(t,e){for(var r=0;r1&&(e=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:t,color:e,mode:r,toString:function(n){return'\n\t"}}},hsl:function(t,e,r){return this.hsla(t,e,r,1)},hsla:function(t,e,r,n){if([t=this.number(t)%360/360,e=this.number(e),r=this.number(r),n=this.number(n)].some(isNaN))return null;var o=r<=.5?r*(e+1):r+e-r*e,i=2*r-o;return this.rgba(255*a(t+1/3),255*a(t),255*a(t-1/3),n);function a(t){return 6*(t=t<0?t+1:t>1?t-1:t)<1?i+(o-i)*t*6:2*t<1?o:3*t<2?i+(o-i)*(2/3-t)*6:i}},hue:function(t){return"toHSL"in t?new dB.Tree.Dimension(Math.round(t.toHSL().h)):null},saturation:function(t){return"toHSL"in t?new dB.Tree.Dimension(Math.round(100*t.toHSL().s),"%"):null},lightness:function(t){return"toHSL"in t?new dB.Tree.Dimension(Math.round(100*t.toHSL().l),"%"):null},alpha:function(t){return"toHSL"in t?new dB.Tree.Dimension(t.toHSL().a):null},saturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s+=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s-=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l+=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l-=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a+=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a-=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL(),n=(r.h+e.value)%360;return r.h=n<0?360+n:n,this.hsla_simple(r)},replace:function(t,e,r){return"field"===t.is?t.toString+".replace("+e.toString()+", "+r.toString()+")":t.replace(e,r)},mix:function(t,e,r){var n=r.value/100,o=2*n-1,i=t.toHSL().a-e.toHSL().a,a=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,s=1-a,u=[t.rgb[0]*a+e.rgb[0]*s,t.rgb[1]*a+e.rgb[1]*s,t.rgb[2]*a+e.rgb[2]*s],l=t.alpha*n+e.alpha*(1-n);return new dB.Tree.Color(u,l)},greyscale:function(t){return this.desaturate(t,new dB.Tree.Dimension(100))},"%":function(t){for(var e=Array.prototype.slice.call(arguments,1),r=t.value,n=0;n.5?l/(2-a-s):l/(a+s),a){case r:t=(n-o)/l+(n=0){if(!t.ppi)return t.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*t.ppi,this.unit="px"}return this}},{key:"toColor",value:function(){return new dB.Tree.Color([this.value,this.value,this.value])}},{key:"round",value:function(){return this.value=Math.round(this.value),this}},{key:"toString",value:function(){return this.value.toString()}},{key:"operate",value:function(t,e,r){return"%"===this.unit&&"%"!==r.unit?(t.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===e||"/"===e||"%"===e?(t.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new dB.Tree.Dimension(dB.Tree.operate(e,this.value,this.value*r.value*.01),this.unit):new dB.Tree.Dimension(dB.Tree.operate(e,this.value,r.value),this.unit||r.unit)}}])}(),dB.Tree.Element=function(){return hB(function t(e){fB(this,t),this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")},[{key:"specificity",value:function(){return["id"===this.type?1:0,"class"===this.type?1:0]}},{key:"toString",value:function(){return this.value}}])}(),dB.Tree.Expression=function(){return hB(function t(e){fB(this,t),this.is="expression",this.value=e},[{key:"ev",value:function(t){return this.value.length>1?new dB.Tree.Expression(this.value.map(function(e){return e.ev(t)})):this.value[0].ev(t)}},{key:"toString",value:function(t){return this.value.map(function(e){return e.toString(t)}).join(" ")}}])}(),dB.Tree.Field=function(){return hB(function t(e){fB(this,t),this.is="field",this.value=e||""},[{key:"toString",value:function(){return'["'+this.value.toUpperCase()+'"]'}},{key:"ev",value:function(){return this}}])}(),dB.Tree.Filter=function(){return hB(function t(e,r,n,o,i){fB(this,t),this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=r,this.val=n,this.index=o,this.filename=i,this.id=this.key+this.op+this.val},[{key:"ev",value:function(t){return this.key=this.key.ev(t),this.val=this.val.ev(t),this}},{key:"toString",value:function(){return"["+this.id+"]"}}])}(),dB.Tree.Filterset=function(){return hB(function t(){fB(this,t),this.filters={}},[{key:"toJS",value:function(t){function e(t){var e=t.op;"="===e&&(e="==");var r=t.val;void 0!==t._val&&(r=t._val.toString(!0)),t.key&&"scale"===t.key.value?r=+r:"string"!=typeof r&&"object"!==cB(r)||(r="'"+r+"'");var n="attributes";return n+"&&"+n+t.key+"&&"+n+t.key+" "+e+r}var r=[];for(var n in this.filters)r.push(e(this.filters[n]));return r.join(" && ")}},{key:"toString",value:function(){var t=[];for(var e in this.filters)t.push(this.filters[e].id);return t.sort().join("\t")}},{key:"ev",value:function(t){for(var e in this.filters)this.filters[e].ev(t);return this}},{key:"clone",value:function(){var t=new dB.Tree.Filterset;for(var e in this.filters)t.filters[e]=this.filters[e];return t}},{key:"cloneWith",value:function(t){var e=[];for(var r in t.filters){var n=this.addable(t.filters[r]);if(!1===n)return!1;!0===n&&e.push(t.filters[r])}if(!e.length)return null;var o=new dB.Tree.Filterset;for(r in this.filters)o.filters[r]=this.filters[r];for(;r=e.shift();)o.add(r);return o}},{key:"addable",value:function(t){var e=t.key.toString(),r=t.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),t.op){case"=":return void 0!==this.filters[e+"="]?this.filters[e+"="].val.toString()==r&&null:void 0===this.filters[e+"!="+r]&&(!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val"]&&this.filters[e+">"].val>=r?null:void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val":return e+"="in this.filters?!(this.filters[e+"="].val<=r)&&null:!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)&&(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)||null));case">=":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)||null));case"<":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val>=r)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].valr)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)||null))}}},{key:"conflict",value:function(t){var e=t.key.toString(),r=t.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===t.op&&void 0!==this.filters[e+"="]&&r!=this.filters[e+"="].val.toString()||"!="===t.op&&void 0!==this.filters[e+"="]&&r==this.filters[e+"="].val.toString()||"="===t.op&&void 0!==this.filters[e+"!="]&&r===this.filters[e+"!="].val.toString())&&t.toString()+" added to "+this.toString()+" produces an invalid filter"}},{key:"add",value:function(t,e){var r,n=t.key.toString(),o=t.op,i=this.conflict(t);if(i)return i;if("="===o){for(var a in this.filters)this.filters[a].key===n&&delete this.filters[a];this.filters[n+"="]=t}else if("!="===o)this.filters[n+"!="+t.val]=t;else if("=~"===o)this.filters[n+"=~"+t.val]=t;else if(">"===o){for(var s in this.filters)this.filters[s].key===n&&this.filters[s].val<=t.val&&delete this.filters[s];this.filters[n+">"]=t}else if(">="===o){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===n&&r",this.filters[n+">"]=t):this.filters[n+">="]=t}else if("<"===o){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===n&&r>=t.val&&delete this.filters[l];this.filters[n+"<"]=t}else if("<="===o){for(var c in this.filters)r=+this.filters[c].val.toString(),this.filters[c].key===n&&r>t.val&&delete this.filters[c];void 0!==this.filters[n+"!="+t.val]?(delete this.filters[n+"!="+t.val],t.op="<",this.filters[n+"<"]=t):this.filters[n+"<="]=t}}}])}(),dB.Tree.Fontset=hB(function t(e,r){fB(this,t),this.fonts=r,this.name="fontset-"+e.effects.length}),dB.Tree.Invalid=function(){return hB(function t(e,r,n){fB(this,t),this.is="invalid",this.chunk=e,this.index=r,this.type="syntax",this.message=n||"Invalid code: "+this.chunk},[{key:"ev",value:function(t){return t.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}}])}(),dB.Tree.Keyword=function(){return hB(function t(e){fB(this,t),this.value=e;var r={transparent:"color",true:"boolean",false:"boolean"};this.is=r[e]?r[e]:"keyword"},[{key:"ev",value:function(){return this}},{key:"toString",value:function(){return this.value}}])}(),dB.Tree.Literal=function(){return hB(function t(e){fB(this,t),this.value=e||"",this.is="field"},[{key:"toString",value:function(){return this.value}},{key:"ev",value:function(){return this}}])}(),dB.Tree.Operation=function(){return hB(function t(e,r,n){fB(this,t),this.is="operation",this.op=e.trim(),this.operands=r,this.index=n},[{key:"ev",value:function(t){var e,r=this.operands[0].ev(t),n=this.operands[1].ev(t);return"undefined"===r.is||"undefined"===n.is?{is:"undefined",value:"undefined"}:(r instanceof dB.Tree.Dimension&&n instanceof dB.Tree.Color&&("*"===this.op||"+"===this.op?(e=n,n=r,r=e):t.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof dB.Tree.Quoted&&n instanceof dB.Tree.Quoted&&"+"!==this.op?(t.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof dB.Tree.Field||n instanceof dB.Tree.Field||r instanceof dB.Tree.Literal||n instanceof dB.Tree.Literal?"color"===r.is||"color"===n.is?(t.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new dB.Tree.Literal(r.ev(t).toString(!0)+this.op+n.ev(t).toString(!0)):void 0===r.operate?(t.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(t,this.op,n))}}])}(),dB.Tree.Quoted=function(){return hB(function t(e){fB(this,t),this.is="string",this.value=e||""},[{key:"toString",value:function(t){var e=this.value.replace(/&/g,"&"),r=e.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===t?"'"+r+"'":e}},{key:"ev",value:function(){return this}},{key:"operate",value:function(t,e,r){return new dB.Tree.Quoted(dB.Tree.operate(e,this.toString(),r.toString(this.contains_field)))}}])}(),dB.Tree.Reference={_validateValue:{font:function(t,e){return!t.validation_data||!t.validation_data.fonts||-1!=t.validation_data.fonts.indexOf(e)}},setData:function(t){this.data=t,this.selector_cache=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])t.symbolizers[r][n].hasOwnProperty("css")&&(e[t.symbolizers[r][n].css]=[t.symbolizers[r][n],r,n]);return e}(t),this.mapnikFunctions=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])if("functions"===t.symbolizers[r][n].type)for(var o=0;o1?Array.prototype.push.apply(r,n.find(new dB.Tree.Selector(null,null,t.elements.slice(1)),e)):r.push(n);break}}),this._lookups[n]=r)}},{key:"evZooms",value:function(t){for(var e=0;edB.Tree.Zoom.maxZoom||e<0)&&t.error({message:"Only zoom levels between 0 and "+dB.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+e,this;case">":this.zoom="zoom && zoom > "+e;break;case">=":this.zoom="zoom && zoom >= "+e;break;case"<":this.zoom="zoom && zoom < "+e;break;case"<=":this.zoom="zoom && zoom <= "+e}return this}},{key:"toString",value:function(){for(var t="",e=0;e<=dB.Tree.Zoom.maxZoom;e++)t+=this.zoom&1<3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],o=n.length,i=0;i4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],o=this._handlers[t],i=o.length,a=0;a-this.EPSILON&&tthis.EPSILON||t<-this.EPSILON}},{key:"cubicAt",value:function(t,e,r,n,o){var i=1-o;return i*i*(i*t+3*o*e)+o*o*(o*n+3*i*r)}},{key:"cubicDerivativeAt",value:function(t,e,r,n,o){var i=1-o;return 3*(((e-t)*i+2*(r-e)*o)*i+(n-r)*o*o)}},{key:"cubicRootAt",value:function(t,e,r,n,o,i){var a=n+3*(e-r)-t,s=3*(r-2*e+t),u=3*(e-t),l=t-o,c=s*s-3*a*u,f=s*u-9*a*l,p=u*u-3*s*l,h=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(s))i[0]=0;else{var y=-u/s;y>=0&&y<=1&&(i[h++]=y)}else{var d=f*f-4*c*p;if(this.isAroundZero(d)){var v=f/c,m=-s/a+v,b=-v/2;m>=0&&m<=1&&(i[h++]=m),b>=0&&b<=1&&(i[h++]=b)}else if(d>0){var g=Math.sqrt(d),S=c*s+1.5*a*(-f+g),w=c*s+1.5*a*(-f-g),_=(-s-((S=S<0?-Math.pow(-S,this.ONE_THIRD):Math.pow(S,this.ONE_THIRD))+(w=w<0?-Math.pow(-w,this.ONE_THIRD):Math.pow(w,this.ONE_THIRD))))/(3*a);_>=0&&_<=1&&(i[h++]=_)}else{var O=(2*c*s-3*a*f)/(2*Math.sqrt(c*c*c)),E=Math.acos(O)/3,P=Math.sqrt(c),x=Math.cos(E),T=(-s-2*P*x)/(3*a),C=(-s+P*(x+this.THREE_SQRT*Math.sin(E)))/(3*a),k=(-s+P*(x-this.THREE_SQRT*Math.sin(E)))/(3*a);T>=0&&T<=1&&(i[h++]=T),C>=0&&C<=1&&(i[h++]=C),k>=0&&k<=1&&(i[h++]=k)}}return h}},{key:"cubicExtrema",value:function(t,e,r,n,o){var i=6*r-12*e+6*t,a=9*e+3*n-3*t-9*r,s=3*e-3*t,u=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(i)){var l=-s/i;l>=0&&l<=1&&(o[u++]=l)}}else{var c=i*i-4*a*s;if(this.isAroundZero(c))o[0]=-i/(2*a);else if(c>0){var f=Math.sqrt(c),p=(-i+f)/(2*a),h=(-i-f)/(2*a);p>=0&&p<=1&&(o[u++]=p),h>=0&&h<=1&&(o[u++]=h)}}return u}},{key:"cubicSubdivide",value:function(t,e,r,n,o,i){var a=(e-t)*o+t,s=(r-e)*o+e,u=(n-r)*o+r,l=(s-a)*o+a,c=(u-s)*o+s,f=(c-l)*o+l;i[0]=t,i[1]=a,i[2]=l,i[3]=f,i[4]=f,i[5]=c,i[6]=u,i[7]=n}},{key:"cubicProjectPoint",value:function(t,e,r,n,o,i,a,s,u,l,c){var f,p=this.vector.create(),h=this.vector.create(),y=this.vector.create(),d=.005,v=1/0;p[0]=u,p[1]=l;for(var m=0;m<1;m+=.05){h[0]=this.cubicAt(t,r,o,a,m),h[1]=this.cubicAt(e,n,i,s,m);var b=this.vector.distSquare(p,h);b=0&&_=0&&l<=1&&(o[u++]=l)}}else{var c=a*a-4*i*s;if(this.isAroundZero(c)){var f=-a/(2*i);f>=0&&f<=1&&(o[u++]=f)}else if(c>0){var p=Math.sqrt(c),h=(-a+p)/(2*i),y=(-a-p)/(2*i);h>=0&&h<=1&&(o[u++]=h),y>=0&&y<=1&&(o[u++]=y)}}return u}},{key:"quadraticExtremum",value:function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n}},{key:"quadraticProjectPoint",value:function(t,e,r,n,o,i,a,s,u){var l,c=this.vector.create(),f=this.vector.create(),p=this.vector.create(),h=.005,y=1/0;c[0]=a,c[1]=s;for(var d=0;d<1;d+=.05){f[0]=this.quadraticAt(t,r,o,d),f[1]=this.quadraticAt(e,n,i,d);var v=this.vector.distSquare(c,f);v=0&&S0){for(var b=this.isInsidePolygon(e.pointList,v,m),g=t.holePolygonPointLists,S=!1,w=0,_=g.length;w<_;w++){var O=g[w];!0===this.isInsidePolygon(O,v,m)&&(S=!0)}return!0===b&&!1===S}return this.isInsidePolygon(e.pointList,v,m);case"text":var E=e.__rect||t.getRect(e);return this.isInsideRect(E.x,E.y,E.width,E.height,r,n);case"smictext":var P=t.getTextBackground(e);return this.isInsidePolygon(P,r,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,r,n);case"smicimage":var x=e.x,T=e.y;return t.refOriginalPosition&&(x=e.x+t.refOriginalPosition[0],T=e.y+t.refOriginalPosition[1]),this.isInsideRect(x,T,e.width,e.height,r,n)}}},{key:"_buildPathMethod",value:function(t,e,r,n,o){return e.beginPath(),t.buildPath(e,r),e.closePath(),e.isPointInPath(n,o)}},{key:"isOutside",value:function(t,e,r,n){return!this.isInside(t,e,r,n)}},{key:"isInsideLine",value:function(t,e,r,n,o,i,a){if(0===o)return!1;var s=Math.max(o,5),u=0;if(a>e+s&&a>n+s||at+s&&i>r+s||ie+f&&c>n+f&&c>i+f&&c>s+f||ct+f&&l>r+f&&l>o+f&&l>a+f||le+l&&u>n+l&&u>i+l||ut+l&&s>r+l&&s>o+l||sr||f+c=l)return!0;if(i){var p=n;n=this.normalizeRadian(o),o=this.normalizeRadian(p)}else n=this.normalizeRadian(n),o=this.normalizeRadian(o);n>o&&(o+=l);var h=Math.atan2(u,s);return h<0&&(h+=l),h>=n&&h<=o||h+l>=n&&h+l<=o}},{key:"isInsideBrokenLine",value:function(t,e,r,n){for(var o=Math.max(e,10),i=0,a=t.length-1;ir*r}},{key:"isInsideRect",value:function(t,e,r,n,o,i){return o>=t&&o<=t+r&&i>=e&&i<=e+n}},{key:"isInsideCircle",value:function(t,e,r,n,o){return(n-t)*(n-t)+(o-e)*(o-e)e&&i>n||io?ne&&l>n&&l>i&&l>s||l1&&this.swapExtrema(),y=c.cubicAt(e,n,i,s,p[0]),m>1&&(d=c.cubicAt(e,n,i,s,p[1]))),2==m?ge&&s>n&&s>i||s=0&&f<=1){for(var p=0,h=u.quadraticAt(e,n,i,f),y=0;ya||(l[y]a?0:ir||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(u[0]=-c,u[1]=c,Math.abs(n-o)>=l){n=0,o=l;var f=i?1:-1;return a>=u[0]+t&&a<=u[1]+t?f:0}if(i){var p=n;n=this.normalizeRadian(o),o=this.normalizeRadian(p)}else n=this.normalizeRadian(n),o=this.normalizeRadian(o);n>o&&(o+=l);for(var h=0,y=0;y<2;y++){var d=u[y];if(d+t>a){var v=Math.atan2(s,d),m=i?1:-1;v<0&&(v=l+v),(v>=n&&v<=o||v+l>=n&&v+l<=o)&&(v>Math.PI/2&&v<1.5*Math.PI&&(m=-m),h+=m)}}return h}},{key:"isInsidePath",value:function(t,e,r,n,o){for(var i=0,a=0,s=0,u=0,l=0,c=!0,f=!0,p="stroke"===(r=r||"fill")||"both"===r,h="fill"===r||"both"===r,y=0;y0&&(h&&(i+=this.windingLine(a,s,u,l,n,o)),0!==i))return!0;u=v[v.length-2],l=v[v.length-1],c=!1,f&&"A"!==d.command&&(f=!1,a=u,s=l)}switch(d.command){case"M":a=v[0],s=v[1];break;case"L":if(p&&this.isInsideLine(a,s,v[0],v[1],e,n,o))return!0;h&&(i+=this.windingLine(a,s,v[0],v[1],n,o)),a=v[0],s=v[1];break;case"C":if(p&&this.isInsideCubicStroke(a,s,v[0],v[1],v[2],v[3],v[4],v[5],e,n,o))return!0;h&&(i+=this.windingCubic(a,s,v[0],v[1],v[2],v[3],v[4],v[5],n,o)),a=v[4],s=v[5];break;case"Q":if(p&&this.isInsideQuadraticStroke(a,s,v[0],v[1],v[2],v[3],e,n,o))return!0;h&&(i+=this.windingQuadratic(a,s,v[0],v[1],v[2],v[3],n,o)),a=v[2],s=v[3];break;case"A":var m=v[0],b=v[1],g=v[2],S=v[3],w=v[4],_=v[5],O=Math.cos(w)*g+m,E=Math.sin(w)*S+b;f?(f=!1,u=O,l=E):i+=this.windingLine(a,s,O,E);var P=(n-m)*S/g+m;if(p&&this.isInsideArcStroke(m,b,S,w,w+_,1-v[7],e,P,o))return!0;h&&(i+=this.windingArc(m,b,S,w,w+_,1-v[7],P,o)),a=Math.cos(w+_)*g+m,s=Math.sin(w+_)*S+b;break;case"z":if(p&&this.isInsideLine(a,s,u,l,e,n,o))return!0;c=!0}}return h&&(i+=this.windingLine(a,s,u,l,n,o)),0!==i}},{key:"getTextWidth",value:function(t,e){var r=t+":"+e;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,o=0,i=(t=(t+"").split("\n")).length;othis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(t,e){var r=t+":"+e;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}])&&KF(t.prototype,e),r&&KF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function XF(t){"@babel/helpers - typeof";return(XF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ZF(t,e){for(var r=0;ro&&(o=u[0]),u[1]a&&(a=u[1])}e[0]=n,e[1]=i,r[0]=o,r[1]=a}}},{key:"cubeBezier",value:function(t,e,r,n,o,i){var a=new JF,s=[];a.cubicExtrema(t[0],e[0],r[0],n[0],s);for(var u=0;uo&&!i?o+=2*Math.PI:nn&&(f[0]=Math.cos(h)*r+t,f[1]=Math.sin(h)*r+e,u.min(a,f,a),u.max(s,f,s))}}])&&ZF(t.prototype,e),r&&ZF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function eU(t){"@babel/helpers - typeof";return(eU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rU(t,e){for(var r=0;r=200&&o.status<300||304===o.status?e&&e(o.responseText):r&&r(),o.onreadystatechange=new Function,o=null)},o.send(null)}}])&&cU(t.prototype,e),r&&cU(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function hU(t){"@babel/helpers - typeof";return(hU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yU(t,e){for(var r=0;r1)for(var e in arguments)console.log(arguments[e])}},(e=[{key:"destory",value:function(){return!0}}])&&bU(t.prototype,e),r&&bU(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function wU(t){"@babel/helpers - typeof";return(wU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _U(t,e){for(var r=0;ra-2?a-1:h+1][0]+i[0],e[h>a-2?a-1:h+1][1]+i[1]],b=[e[h>a-3?a-1:h+2][0]+i[0],e[h>a-3?a-1:h+2][1]+i[1]]);var g=y*y,S=y*g;s.push([w(d[0],v[0],m[0],b[0],y,g,S),w(d[1],v[1],m[1],b[1],y,g,S)])}return s;function w(t,e,r,n,o,i,a){var s=.5*(r-t),u=.5*(n-e);return(2*(e-r)+s+u)*a+(-3*(e-r)-2*s-u)*i+s*o+e}}},{key:"SUtil_dashedLineTo",value:function(t,e,r,n,o,i,a){var s=[5,5];if(i="number"!=typeof i?5:i,t.setLineDash)return s[0]=i,s[1]=i,a&&a instanceof Array?t.setLineDash(a):t.setLineDash(s),t.moveTo(e,r),void t.lineTo(n,o);var u=n-e,l=o-r,c=Math.floor(Math.sqrt(u*u+l*l)/i);u/=c,l/=c;for(var f=!0,p=0;p-5e-5&&t<5e-5}NU.Util_vector.sub(e,t,this.position),n(e[0])&&n(e[1])||(NU.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})},(e=[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||NU.Util_matrix.create();if(NU.Util_matrix.identity(e),this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;var r=o(t[0])||o(t[1]);r&&NU.Util_matrix.translate(e,e,t),NU.Util_matrix.scale(e,e,this.scale),r&&(t[0]=-t[0],t[1]=-t[1],NU.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;var n=o(t[0])||o(t[1]);n&&NU.Util_matrix.translate(e,e,t),NU.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],NU.Util_matrix.translate(e,e,t))}}else 0!=+this.rotation&&NU.Util_matrix.rotate(e,e,this.rotation);(o(this.position[0])||o(this.position[1]))&&NU.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?NU.Util_matrix.mul(this.transform,this.parent.transform,this.transform):NU.Util_matrix.copy(this.transform,this.parent.transform))}function o(t){return t>5e-5||t<-5e-5}}},{key:"setTransform",value:function(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],r=this.position,n=this.scale,o=this.rotation;a(e-1)&&(e=Math.sqrt(e));var i=t[2]*t[2]+t[3]*t[3];a(i-1)&&(i=Math.sqrt(i)),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=i,n[2]=n[3]=0,o[0]=Math.atan2(-t[1]/i,t[0]/e),o[1]=o[2]=0}function a(t){return t>5e-5||t<-5e-5}}}])&&MU(t.prototype,e),r&&MU(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function DU(t){"@babel/helpers - typeof";return(DU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function BU(t,e){for(var r=0;r0&&(this.setCtxGlobalAlpha(t,"stroke",r),t.stroke()),this.setCtxGlobalAlpha(t,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",r),r.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",r);break;default:this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)}this.drawText(t,r,this.style),this.afterBrush(t)}},{key:"beforeBrush",value:function(t,e){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),e&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r}},{key:"afterBrush",value:function(t){t.restore()}},{key:"setContext",value:function(t,e){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,o=r.length;n=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&NU.Util_area.isInside(this,this.style,t,e)}},{key:"drawText",value:function(t,r,n){if(void 0!==r.text&&!1!==r.text){var o=r.textColor||r.color||r.strokeColor;t.fillStyle=o;var i,a,s,u,l=10,c=r.textPosition||this.textPosition||"top",f=[];switch(f=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var p=(n||r).__rect||this.getRect(n||r);switch(c){case"inside":s=p.x+p.width/2,u=p.y+p.height/2,i="center",a="middle","stroke"!=r.brushType&&o==r.color&&(t.fillStyle="#fff");break;case"left":s=p.x-l,u=p.y+p.height/2,i="end",a="middle";break;case"right":s=p.x+p.width+l,u=p.y+p.height/2,i="start",a="middle";break;case"top":s=p.x+p.width/2,u=p.y-l,i="center",a="bottom";break;case"bottom":s=p.x+p.width/2,u=p.y+p.height+l,i="center",a="top"}}break;case"start":case"end":var h=0,y=0,d=0,v=0;if(void 0!==r.pointList){var m=r.pointList;if(m.length<2)return;var b=m.length;switch(c){case"start":h=m[0][0]+f[0],y=m[1][0]+f[0],d=m[0][1]+f[1],v=m[1][1]+f[1];break;case"end":h=m[b-2][0]+f[0],y=m[b-1][0]+f[0],d=m[b-2][1]+f[1],v=m[b-1][1]+f[1]}}else h=r.xStart+f[0]||0,y=r.xEnd+f[0]||0,d=r.yStart+f[1]||0,v=r.yEnd+f[1]||0;switch(c){case"start":i=hn&&(n=u[0]),u[1]o&&(o=u[1]))}return t.__rect={x:e,y:r,width:n-e,height:o-r},t.__rect}},{key:"getRectNoRotation",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition,n=NU.Util_area.getTextHeight("ZH",t.textFont),o=NU.Util_area.getTextWidth(t.text,t.textFont),i=NU.Util_area.getTextHeight(t.text,t.textFont),a=t.x+r[0];"end"==t.textAlign||"right"==t.textAlign?a-=o:"center"==t.textAlign&&(a-=o/2),e="top"==t.textBaseline?t.y+r[1]:"bottom"==t.textBaseline?t.y+r[1]-i:t.y+r[1]-i/2;var s,u=!1;if(t.maxWidth){var l=parseInt(t.maxWidth);l-1&&(o+=!0===u?n/3*(o/s):n/3));return{x:a,y:e,width:o,height:i}}},{key:"getTextBackground",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!e&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),o=t.x+r[0],i=t.y+r[1],a=[];if(t.textRotation&&0!==t.textRotation){var s=t.textRotation,u=this.getRotatedLocation(n.x,n.y,o,i,s),l=this.getRotatedLocation(n.x+n.width,n.y,o,i,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,o,i,s),f=this.getRotatedLocation(n.x,n.y+n.height,o,i,s);a.push(u),a.push(l),a.push(c),a.push(f)}else{var p=[n.x,n.y],h=[n.x+n.width,n.y],y=[n.x+n.width,n.y+n.height],d=[n.x,n.y+n.height];a.push(p),a.push(h),a.push(y),a.push(d)}return t.__textBackground=a,t.__textBackground}},{key:"getRotatedLocation",value:function(t,e,r,n,o){var i,a,s=new Array;return e=-e,n=-n,o=-o,i=(t-r)*Math.cos(o/180*Math.PI)-(e-n)*Math.sin(o/180*Math.PI)+r,a=(t-r)*Math.sin(o/180*Math.PI)+(e-n)*Math.cos(o/180*Math.PI)+n,s[0]=i,s[1]=-a,s}}])&&tG(r.prototype,n),o&&tG(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function sG(t){"@babel/helpers - typeof";return(sG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uG(t,e){for(var r=0;r0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(t.beginPath(),this.buildPath(t,r)),this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)),this.drawText(t,r,this.style);var o=Tt.cloneObject(r);if(o.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var i=this.holePolygonPointLists,a=i.length,s=0;s0&&("stroke"==o.brushType||"both"==o.brushType)?(n||(t.beginPath(),this.buildPath(t,o)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",o),t.stroke(),this.setCtxGlobalAlpha(t,"reset",o)):t.globalCompositeOperation="source-over"}t.restore()}},{key:"buildPath",value:function(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var o,i,a,s=NU.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,r);t.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,l=0;li&&(i=u[l][0]+r[0]),u[l][1]+r[1]s&&(s=u[l][1]+r[1]);return n="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(o-n/2),y:Math.round(a-n/2),width:i-o+n,height:s-a+n},t.__rect}}])&&vG(r.prototype,n),o&&vG(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function OG(t){"@babel/helpers - typeof";return(OG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function EG(t,e){for(var r=0;rc&&(r*=c/(a=r+n),n*=c/a),o+i>c&&(o*=c/(a=o+i),i*=c/a),n+o>f&&(n*=f/(a=n+o),o*=f/a),r+i>f&&(r*=f/(a=r+i),i*=f/a),t.moveTo(u+r,l),t.lineTo(u+c-n,l),0!==n&&t.quadraticCurveTo(u+c,l,u+c,l+n),t.lineTo(u+c,l+f-o),0!==o&&t.quadraticCurveTo(u+c,l+f,u+c-o,l+f),t.lineTo(u+i,l+f),0!==i&&t.quadraticCurveTo(u,l+f,u,l+f-i),t.lineTo(u,l+r),0!==r&&t.quadraticCurveTo(u,l,u+r,l)}},{key:"buildPath",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+r[0],e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1])),t.closePath()}},{key:"getRect",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+r[0]-e/2),y:Math.round(t.y+r[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}])&&UG(r.prototype,n),o&&UG(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function WG(t){"@babel/helpers - typeof";return(WG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function KG(t,e){for(var r=0;r1?NU.Util_computeBoundingBox.arc(a,s,u,c,f,!p,r,o):(r[0]=o[0]=a,r[1]=o[1]=s),NU.Util_computeBoundingBox.arc(a,s,l,c,f,!p,n,i),NU.Util_vector.min(r,r,n),NU.Util_vector.max(o,o,i),t.__rect={x:r[0],y:r[1],width:o[0]-r[0],height:o[1]-r[1]},t.__rect}}])&&KG(r.prototype,n),o&&KG(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function eV(t){"@babel/helpers - typeof";return(eV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rV(t,e){for(var r=0;r=15){var p=parseInt(i.axis3DParameter),h=[o[0]-p,o[1]+p];i.axisUseArrow?(c.push([h[0]+1.5,h[1]-7.5]),c.push([h[0]-1,h[1]+1]),c.push([h[0]+7.5,h[1]-1.5]),f.push([h[0],h[1]])):f.push([h[0],h[1]]),f.push([o[0],o[1]])}f.push([o[2]+5,o[1]])}else{var y=Math.abs(o[1]-o[3])/l,d=o[3];f.push([o[0],d-5]);for(var v=0;v=15){var b=parseInt(i.axis3DParameter),g=[o[0]-b,o[1]+b];i.axisUseArrow?(c.push([g[0]+1.5,g[1]-7.5]),c.push([g[0]-1,g[1]+1]),c.push([g[0]+7.5,g[1]-1.5]),f.push([g[0],g[1]])):f.push([g[0],g[1]]),f.push([o[0],o[1]])}f.push([o[2]+5,o[1]])}if(i.axisUseArrow){var S=[[o[2]+5,o[1]+4],[o[2]+13,o[1]],[o[2]+5,o[1]-4]],w=[[o[0]-4,o[3]-5],[o[0],o[3]-13],[o[0]+4,o[3]-5]],_=new KB(S);_.style={fillColor:"#008acd"},Tt.copyAttributesWithClip(_.style,i.axisStyle),s.push(t.createShape(_));var O=new KB(w);if(O.style={fillColor:"#008acd"},Tt.copyAttributesWithClip(O.style,i.axisStyle),s.push(t.createShape(O)),i.axis3DParameter&&!isNaN(i.axis3DParameter)&&i.axis3DParameter>=15){var E=new KB(c);E.style={fillColor:"#008acd"},Tt.copyAttributesWithClip(E.style,i.axisStyle),s.push(t.createShape(E))}}var P=new UB(f);P.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},i.axisStyle&&Tt.copyAttributesWithClip(P.style,i.axisStyle),P.clickable=!1,P.hoverable=!1;var x=[t.createShape(P)],T=[];if(i.axisYLabels&&i.axisYLabels.length&&i.axisYLabels.length>0){var C=i.axisYLabels,k=C.length,A=[0,0];if(i.axisYLabelsOffset&&i.axisYLabelsOffset.length&&(A=i.axisYLabelsOffset),1==k){var j=new bF(o[0]-5+A[0],o[3]+A[1],C[0]);j.style={labelAlign:"right"},i.axisYLabelsStyle&&Tt.copyAttributesWithClip(j.style,i.axisYLabelsStyle),j.clickable=!1,j.hoverable=!1,T.push(t.createShape(j))}else for(var N=o[3],I=Math.abs(o[1]-o[3])/(k-1),M=0;M0){var D=i.axisXLabels,B=D.length,F=[0,0];if(i.axisXLabelsOffset&&i.axisXLabelsOffset.length&&(F=i.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==B)for(var U=n.xPositions,G=0;G=0&&r[o]&&Tt.copyAttributesWithClip(a,r[o]),n&&n.length&&void 0!==i)for(var s=n,u=s.length,l=parseFloat(i),c=0;c=l[2]||l[1]<=l[3])&&(this.DVBOrigonPoint=[l[0],l[3]],this.DVBWidth=Math.abs(l[2]-l[0]),this.DVBHeight=Math.abs(l[1]-l[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}},{key:"resetLocation",value:function(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var r=this.width,n=this.height,o=this.location;return this.chartBounds=new Dt(o[0]-r/2,o[1]+n/2,o[0]+r/2,o[1]-n/2),this.resetLinearGradient(),o}},{key:"resetLinearGradient",value:function(){}},{key:"shapesConvertToRelativeCoordinate",value:function(){for(var t=this.shapes,e=this.location,r=0,n=t.length;r=0?n.push(parseFloat(o[a].toString()).toFixed(r)):n.push(parseFloat(o[a].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};var EV=function(t){function e(t,r,n,o,i){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(a=SV(this,e,[t,r,n,o,i])).CLASS_NAME="SuperMap.Feature.Theme.Bar",a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&OV(t,e)}(e,vV),r=e,(n=[{key:"destroy",value:function(){wV(_V(e.prototype),"destroy",this).call(this)}},{key:"assembleShapes",value:function(){var t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},e=this.setting;if(e.barLinearGradient||(e.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var n=this.dataViewBox,o=this.dataValues;if(!(o.length<1)){for(var i=0,a=o.length;ir[1])return;var s=this.calculateXShapeInfo();if(s){var u=s.xPositions,l=s.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(oV.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(oV.GraphAxis(this.shapeFactory,n,e,s)));for(var c=0;c=e.length&&(r%=e.length);var u=e[r][0],l=e[r][1],c=(new SD).getLinearGradient(a,0,s,0,[[0,u],[1,l]]);o.style.color=c}}}}])&&bV(r.prototype,n),o&&bV(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function PV(t){"@babel/helpers - typeof";return(PV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xV(t,e){for(var r=0;re[1])return;var a=this.calculateXShapeInfo();if(a){var s=a.xPositions,u=a.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(oV.Background(this.shapeFactory,this.chartBox,t)),(!t.axis3DParameter||isNaN(t.axis3DParameter)||t.axis3DParameter<15)&&(t.axis3DParameter=20),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(oV.GraphAxis(this.shapeFactory,r,t,a)));for(var l=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10,c=0;c=s[2]||s[1]<=s[3])&&(this.DVBOrigonPoint=[s[0],s[3]],this.DVBWidth=Math.abs(s[2]-s[0]),this.DVBHeight=Math.abs(s[1]-s[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-o[0],this.DVBOrigonPoint[1]-o[1]],!0)}}])&&MV(r.prototype,n),o&&MV(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function GV(t){"@babel/helpers - typeof";return(GV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function VV(t,e){for(var r=0;r0?this.DVBUnitValue=t.maxR/(o[1]-o[0]):this.DVBUnitValue=t.maxR;var i=this.DVBUnitValue,a=n[0]*i+t.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!o||!(n[0]o[1]))){var s=this.DVBCenterPoint,u=new MF(s[0],s[1],a);u.style=oV.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?u.style.fillColor=t.fillColor:u.style.fillColor="#ff9277",u.highlightStyle=oV.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(u.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(u.clickable=t.circleClickAble),u.refDataID=this.data.id,u.dataInfo={field:this.fields[0],r:a,value:n[0]},this.shapes.push(this.shapeFactory.createShape(u)),this.shapesConvertToRelativeCoordinate()}}}])&&VV(r.prototype,n),o&&VV(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function YV(t){"@babel/helpers - typeof";return(YV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function QV(t,e){for(var r=0;rr[1])return null;a=u[f],s=e[1]-(o[f]-r[0])/n;var h=new NB(a,s);h.style=oV.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,f,o[f]),h.highlightStyle=oV.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(h.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(h.clickable=t.pointClickAble),h.refDataID=this.data.id,h.dataInfo={field:this.fields[f],value:o[f]},c.push(this.shapeFactory.createShape(h));var y=[a,s];l.push(y)}var d=new UB(l);d.style=oV.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),d.clickable=!1,d.hoverable=!1;var v=this.shapeFactory.createShape(d);this.shapes.push(v),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var o=[],i=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=i-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=i/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var i=0,a=0;a=360&&(c=359.9999999);var d=new cF(u[0],u[1],p,l,c);if(void 0===t.sectorStyleByFields){var v=h%e.length;d.style=oV.ShapeStyleTool(null,t.sectorStyle,e,null,v)}else d.style=oV.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,h,r[h]);d.highlightStyle=oV.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(d.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(d.clickable=t.sectorClickAble),d.refDataID=this.data.id,d.dataInfo={field:this.fields[h],value:r[h]},this.shapes.push(this.shapeFactory.createShape(d)),l=c}this.shapesConvertToRelativeCoordinate()}}}}])&&oz(r.prototype,n),o&&oz(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function fz(t){"@babel/helpers - typeof";return(fz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pz(t,e){for(var r=0;rr[1])return null;a=u[l],s=e[1]-(o[l]-r[0])/n;var f=new NB(a,s);f.style=oV.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,l,o[l]),f.highlightStyle=oV.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(f.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(f.clickable=t.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[l],value:o[l]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var o=[],i=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=i-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=i/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var i=0,a=0;a=0&&e.innerRingRadius0){var l=i[i.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}i.push(n)}if(i.length<2)return null;var c=new Object;(c=Tt.copyAttributesWithClip(c,this.style,["pointList"])).pointList=i;var f=new AG({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&Tt.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}},{key:"multiPointToTF",value:function(t){for(var e=t.components,r=[],n=[],o=this.location,i=[],a=this.nodesClipPixel,s=0;s0){var l=i[i.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}i.push(n);var c=new Object;c.r=6,(c=Tt.copyAttributesWithClip(c,this.style)).x=n[0],c.y=n[1];var f=new ZU({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=o,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&Tt.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}},{key:"multiLineStringToTF",value:function(t){for(var e=t.components,r=0;r0){var p=i[i.length-1];if(Math.abs(p[0]-n[0])<=u&&Math.abs(p[1]-n[1])<=u)continue}i.push(n)}}else{a=[];for(var h=0;h0){var y=a[a.length-1];if(Math.abs(y[0]-n[0])<=u&&Math.abs(y[1]-n[1])<=u)continue}a.push(n)}}a.length<2||s.push(a)}if(!(i.length<2)){var d={};(d=Tt.copyAttributesWithClip(d,this.style,["pointList"])).pointList=i;var v=new _G({style:d,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(v.highlightStyle=this.highlightStyle),v.refOriginalPosition=this.location,v.refDataID=this.data.id,v.isHoverByRefDataID=this.isMultiHover,s.length>0&&(v.holePolygonPointLists=s),this.shapeOptions&&Tt.copyAttributesWithClip(v,this.shapeOptions),this.shapes.push(v)}}},{key:"rectangleToTF",value:function(t){var e=this.location,r=new It(t.x,t.y),n=this.layer.map.getResolution(),o=this.getLocalXY(r),i=new Object;i.r=6,(i=Tt.copyAttributesWithClip(i,this.style)).x=o[0]-e[0],i.y=o[1]-e[1]-2*t.width/n,i.width=t.width/n,i.height=t.height/n;var a=new JG({style:i,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=e,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&Tt.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}},{key:"geoTextToTF",value:function(t){var e=this.location,r=this.getLocalXY(t),n=new Object;n.r=6,(n=Tt.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-e[0],n.y=r[1]-e[1],n.text=t.text;var o=new aG({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(o.highlightStyle=this.highlightStyle),o.refOriginalPosition=e,o.refDataID=this.data.id,o.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&Tt.copyAttributesWithClip(o,this.shapeOptions),this.shapes.push(o)}},{key:"updateAndAddShapes",value:function(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,r=0,n=this.shapes.length;r0}},{key:"addRoot",value:function(t){t instanceof zz&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}},{key:"delRoot",value:function(t){if(void 0===t){for(var e=0;e=0&&(this.delFromMap(i.id),this._roots.splice(a,1),i instanceof zz&&i.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(t){return t instanceof zz&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}},{key:"get",value:function(t){return this._elements[t]}},{key:"delFromMap",value:function(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof zz&&(e._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}])&&qz(e.prototype,r),n&&qz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Kz(t){"@babel/helpers - typeof";return(Kz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yz(t,e,r){return e=Qz(e),function(t,e){if(e&&("object"===Kz(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],Qz(t).constructor):e.apply(t,r))}function Qz(t){return(Qz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Xz(t,e){return(Xz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Zz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $z(t,e){for(var r=0;r0&&t>this._zlevelList[0]){for(o=0;ot);o++);n=this._layers[this._zlevelList[o]]}this._zlevelList.splice(o+1,0,t),e=new nH(Tt.createUniqueID("_levelLayer_"+t),this);var i=n?n.dom:this._bgDom;i.nextSibling?i.parentNode.insertBefore(e.dom,i.nextSibling):i.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new vD).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(t){var e=this._layers,r={};for(var n in e)"hover"!==n&&(r[n]=e[n].elCount,e[n].elCount=0);for(var o=0;o0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var o in r)if("hover"!==o){var i=r[o],a=i.position;if(i.zoomable){i.__zoom=i.__zoom||1;var s=i.__zoom;s*=e,e=(s=Math.max(Math.min(i.maxZoom,s),i.minZoom))/i.__zoom,i.__zoom=s,a[0]-=(this._mouseX-a[0])*(e-1),a[1]-=(this._mouseY-a[1])*(e-1),i.scale[0]*=e,i.scale[1]*=e,i.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,vU.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=NU.Util_event.getX(t),this._mouseY=NU.Util_event.getY(t);var e=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var o=this.painter.getLayers(),i=!1;for(var a in o)if("hover"!==a){var s=o[a];s.panable&&(n="move",s.position[0]+=e,s.position[1]+=r,i=!0,s.dirty=!0)}i&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,vU.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!=this.root)for(;e&&9!=e.nodeType;){if(e==this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(vU.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,vU.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,vU.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&NU.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment=0;o--){var i=r[o];if(void 0!==i.zlevel&&(t=this.painter.getLayer(i.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(NU.Util_matrix.invert(e,t.transform),NU.Util_vector.applyTransform(n,n,e))),this._findHover(i,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(e,1)}},{key:"_update",value:function(){for(var t=(new Date).getTime(),e=t-this._time,r=this._clips,n=r.length,o=[],i=[],a=0;a=0&&!(d[S]<=a);S--);S=Math.min(S,l-2)}else{for(S=x;Sa);S++);S=Math.min(S-1,l-2)}x=S,T=a;var s=d[S+1]-d[S];if(0!==s){var c,y;for(w=(a-d[S])/s,i?(O=v[S],_=v[0===S?S:S-1],E=v[S>l-2?l-1:S+1],P=v[S>l-3?l-1:S+2],f?TH._catmullRomInterpolateArray(_,O,E,P,w,w*w,w*w*w,n(t,u),h):(c=p?TH.rgba2String(C):TH._catmullRomInterpolate(_,O,E,P,w,w*w,w*w*w),r(t,u,c))):f?TH._interpolateArray(v[S],v[S+1],w,n(t,u),h):(p?(TH._interpolateArray(v[S],v[S+1],w,C,1),y=TH.rgba2String(C)):y=TH._interpolateNumber(v[S],v[S+1],w),r(t,u,y)),S=0;S1&&void 0!==arguments[1]?arguments[1]:"warring";"success"===e?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===e?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===e&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=t,this.messageBoxContainer.hidden=!1}}])&&JH(t.prototype,e),r&&JH(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),YH=function(){try{return echarts}catch(t){return{}}}(),QH={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return QH.code||QH.setCode(),QH.code},setCode:function(){var t=this.getLanguageFromCookie();t||(t=QH.defaultCode,t="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===t.indexOf("zh")&&(t="zh-CN"),0===t.indexOf("en")&&(t="en-US"),QH.code=t},getLanguageFromCookie:function(){for(var t=document.cookie.split(";"),e=0;e0){var a=i.SheetNames[0],s=XH.utils.sheet_to_csv(i.Sheets[a]);e&&e.call(n,s)}}catch(t){r&&r.call(n,t)}},o.onerror=function(t){r&&r.call(n,t)},this.rABF&&o.readAsArrayBuffer(t.file)},processDataToGeoJson:function(t,e,r,n,o){var i=null;if("EXCEL"===t||"CSV"===t)i=this.processExcelDataToGeoJson(e),r&&r.call(o,i);else if("JSON"===t||"GEOJSON"===t){var a=e;"string"==typeof a&&(a=JSON.parse(a)),"ISERVER"===a.type?i=a.data.recordsets[0].features:"FeatureCollection"===a.type?i=a:n&&n.call(o,QH.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(o,i)}else n&&n.call(o,QH.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson:function(t){for(var e=this.string2Csv(t),r=e.colTitles,n=-1,o=-1,i=0,a=r.length;i0?(n.dataItemServices.forEach(function(n){if("RESTDATA"===n.serviceType&&"PUBLISHED"===n.serviceStatus)o=n;else{if("RESTMAP"!==n.serviceType||"PUBLISHED"!==n.serviceStatus)return void r.getDatafromContent(t,e);o=n}}),o&&r.getDatafromRest(o.serviceType,o.address,e)):r.getDatafromContent(t,e):r._fireFailedEvent(n)}).catch(function(t){console.log(t),r._fireFailedEvent(t)})}},{key:"getDatafromContent",value:function(t,e){var r=this,n={result:{}},o=this;t+="/content.json?pageSize=9999999¤tPage=1",co.get(t,null,{withCredentials:this.datasets.withCredentials}).then(function(t){return t.json()}).then(function(t){if(!1!==t.succeed){if(t.type){if("JSON"===t.type||"GEOJSON"===t.type){if(t.content=JSON.parse(t.content.trim()),!t.content.features)return void console.log(QH.i18n("msg_jsonResolveFiled"));var i=r._formatGeoJSON(t.content);n.result.features={type:t.content.type,features:i}}else if("EXCEL"===t.type||"CSV"===t.type){var a=r._excelData2Feature(t.content);n.result.features={type:"FeatureCollection",features:a}}e(n,"content")}}else o._fireFailedEvent(t)},this).catch(function(t){console.log(t),o._fireFailedEvent(t)})}},{key:"getDatafromRest",value:function(t,e,r){var n=this,o=this.datasets.withCredentials;if("RESTDATA"===t){var i,a,s="".concat(e,"/data/datasources");co.get(s,null,{withCredentials:o}).then(function(t){return t.json()}).then(function(t){i=t.datasourceNames[0],s="".concat(e,"/data/datasources/").concat(i,"/datasets"),co.get(s,null,{withCredentials:o}).then(function(t){return t.json()}).then(function(t){return a=t.datasetNames[0],n.getDatafromRestData("".concat(e,"/data"),[i+":"+a],r),[i+":"+a]}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}else{var u,l,c,f="".concat(e,"/maps");co.get(f,null,{withCredentials:o}).then(function(t){return t.json()}).then(function(t){u=t[0].name,c=t[0].path,f=f="".concat(e,"/maps/").concat(u,"/layers"),co.get(f,null,{withCredentials:o}).then(function(t){return t.json()}).then(function(t){return l=t[0].subLayers.layers[0].caption,n.getDatafromRestMap(l,c,r),l}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}}},{key:"getDatafromRestData",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(t,e,this.datasets.queryInfo,function(t){r(t,"RESTDATA")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"getDatafromRestMap",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(e,t,this.datasets.queryInfo,null,null,function(t){r(t,"RESTMAP")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"_getFeatureBySQL",value:function(t,e,r,n,o){var i,a,s={name:e.join().replace(":","@")};Object.assign(s,r),i=new gs(s),a=new fb({queryParameter:i,datasetNames:e,fromIndex:0,toIndex:1e5,returnContent:!0}),new gb(t).processAsync(a,function(t){"processCompleted"===t.type?n&&n(t):o&&o(t)})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,o,i,a,u,l,c){var f,p,h={name:e};Object.assign(h,r),f=new gs(h),n&&(f.fields=n);var y={queryParams:[f]};c&&(y.queryOption=s.ATTRIBUTE),u&&(y.startRecord=u),l&&(y.expectCount=l),o&&(y.prjCoordSys={epsgCode:o}),p=new VP(y),this._queryBySQL(t,p,function(t){"processCompleted"===t.type?i(t):a(t)})}},{key:"_queryBySQL",value:function(t,e,r,n){new QP(t,{format:this._processFormat(n)}).processAsync(e,r)}},{key:"_processFormat",value:function(t){return t||o.GEOJSON}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){for(var e=t.colTitles,r=-1,n=-1,o=0,i=e.length;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function iq(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&t.forEach(function(t){t.xAxis&&e.xField.push({field:t.xAxis.field,name:t.xAxis.name}),t.yAxis&&e.yField.push({field:t.yAxis.field,name:t.yAxis.name})})}},{key:"getDatasetInfo",value:function(t){var e=this;this.createChart=t,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new rq(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:function(t){e.events.triggerEvent("getdatafailed",t)}}))}},{key:"_getDatasetInfoSuccess",value:function(t){var e=this.datasets.url,r=e.indexOf("rest");if(r>0){var n=e.indexOf("/",r+5),o=e.substring(r+5,n),i=e.substring(0,r+4)+"/data";if("maps"===o){var a=e.indexOf("/",n+1),s=e.substring(n+1,a);i=e.substring(0,r+4)+"/maps/"+s,t.result.dataUrl=i,this._getLayerFeatures(t)}else"data"===o&&(t.result.dataUrl=i,this._getDataFeatures(t))}}},{key:"_getDataInfoSuccess",value:function(t,e){"RESTMAP"===e?this._getChartDatasFromLayer(t):this._getChartDatas(t)}},{key:"_getDataFeatures",value:function(t){this.chartModel.getDataFeatures(t,this._getChartDatas.bind(this))}},{key:"_getLayerFeatures",value:function(t){this.chartModel.getLayerFeatures(t,this._getChartDatasFromLayer.bind(this))}},{key:"_getChartDatas",value:function(t){if(t){this.features=t.result.features;var e=this.features.features,r={};if(e.length){var n=e[0],o=[],i=[];for(var a in n.properties)o.push(a),i.push(this._getDataType(n.properties[a]));for(var s in r={features:e,fieldCaptions:o,fieldTypes:i,fieldValues:[]},i){var u=[];for(var l in e){var c=e[l],f=r.fieldCaptions[s],p=c.properties[f];u.push(p)}r.fieldValues.push(u)}this.createChart(r)}}}},{key:"_getChartDatasFromLayer",value:function(t){if(t.result.recordsets){var e=t.result.recordsets[0],r=e.features.features;this.features=e.features;var n={};if(r.length){for(var o in(n={features:e.features,fieldCaptions:e.fieldCaptions,fieldTypes:e.fieldTypes,fieldValues:[]}).fieldCaptions){var i=[];for(var a in r){var s=r[a],u=n.fieldCaptions[o],l=s.properties[u];i.push(l)}n.fieldValues.push(i)}this.createChart(n)}}}},{key:"_createChartOptions",value:function(t){return this.calculatedData=this._createChartDatas(t),this.updateChartOptions(this.chartType)}},{key:"changeType",value:function(t){if(t!==this.chartType)return this.chartType=t,this.updateChartOptions(this.chartType)}},{key:"updateData",value:function(t,e,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(e),t.type=t.type||"iServer",t.withCredentials=t.withCredentials||!1,this.datasets=t,this.getDatasetInfo(this._updateDataSuccess.bind(this))}},{key:"_updateDataSuccess",value:function(t){var e=this._createChartOptions(t);this.updateChart(e)}},{key:"updateChartOptions",value:function(t,e){if(this.calculatedData){var r=this.grid,n=this._createChartSeries(this.calculatedData,t),o=[];for(var i in this.calculatedData.XData)o.push({value:this.calculatedData.XData[i].fieldsData});var a={type:"category",name:this.xField[0].name||"X",data:o,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},u={formatter:"{b0}: {c0}"},l="#404a59";return e&&(e.grid&&(r=e.grid),e.tooltip&&(u=e.tooltip),e.backgroundColor&&(l=e.backgroundColor)),{backgroundColor:l,grid:r,series:n,xAxis:a,yAxis:s,tooltip:u}}}},{key:"_createChartDatas",value:function(t){var e=0,r=[],n=t.fieldCaptions,o=this;n.forEach(function(t,r){o.xField[0]&&t===o.xField[0].field&&(e=r)}),this.yFieldName="",this.yField.forEach(function(t,e){0!==e&&(o.yFieldName=o.yFieldName+","),o.yFieldName=o.yFieldName+t.name,n.forEach(function(e,n){e===t.field&&r.push(n)})});var i=this._getAttrData(t,e),a=[];if(r.length>0)r.forEach(function(e){var r=[];for(var n in t.fieldValues[e])r.push({value:t.fieldValues[e][n]});a.push(r)});else{for(var s=[],u=[],l=i.length,c=0;c0;t--)this.header.removeChild(this.header.children[t]),this.content.removeChild(this.content.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r0;e--)this.content.removeChild(this.content.children[e-1]);var r=this.config[t];for(var n in r)this._createCityItem(n,r[n])}},{key:"_createCityItem",value:function(t,e){var r=document.createElement("div"),n=document.createElement("div");n.setAttribute("class","component-citytabpag__py-key"),n.innerHTML=t,r.appendChild(n);var o=document.createElement("div");o.setAttribute("class","component-citytabpag__content");for(var i=0;i0&&this.appendTabs(t),this.rootContainer=e}},{key:"setTabs",value:function(t){this.removeAllTabs(),this.appendTabs(t)}},{key:"appendTabs",value:function(t){for(var e=0;e0;t--)this.navTabsTitle.removeChild(this.navTabsTitle.children[t]),this.navTabsContent.removeChild(this.navTabsContent.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r=0;t--)this.content.removeChild(this.content.children[t])}},{key:"setPageLink",value:function(t){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(t),this._appendPageLink()}},{key:"_createPageLi",value:function(t){for(var e=0;e1;t--)this.link.removeChild(this.link.children[t])}},{key:"_createLink",value:function(t){for(var e=0;e<4;e++){var r=document.createElement("li");r.setAttribute("class","disable");var n=document.createElement("span");r.appendChild(n),0===e?(n.id="first",n.setAttribute("class","supermapol-icons-first")):1===e?(n.id="prev",n.setAttribute("class","supermapol-icons-prev")):2===e?(n.id="next",n.setAttribute("class","supermapol-icons-next")):3===e&&(n.id="last",n.setAttribute("class","supermapol-icons-last")),t.appendChild(r)}}},{key:"_changePageEvent",value:function(t){var e=t.target;if("disable"!==e.parentElement.classList[0]){var r;if(e.id)r=e.id;else{if(!Number(e.innerHTML))return;r=Number(e.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}}},{key:"_changeDisableState",value:function(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}},{key:"_prePageNum",value:function(t){var e=[];if(this.currentPage="first"===t?1:"last"===t?this.pageNumberLis.length:"prev"===t?this.currentPage-1:"next"===t?this.currentPage+1:t,this.pageNumberLis.length<=5)for(var r=0;r=this.pageNumberLis.length-3)for(var o=this.pageNumberLis.length-5;o0&&(this.currentPageNumberLis=e)}}])&&SJ(r.prototype,n),o&&SJ(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(),xJ=function(t){return/^.*\.(?:xls|xlsx)$/i.test(t)?FH.EXCEL:/^.*\.(?:csv)$/i.test(t)?FH.CSV:/^.*\.(?:geojson|json)$/i.test(t)?FH.GEOJSON:null},TJ=r(44),CJ=r.n(TJ);function kJ(t){"@babel/helpers - typeof";return(kJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function AJ(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function jJ(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:"id";return CJ()(t,e)}function DJ(t){return t.hasOwnProperty("start")&&t.hasOwnProperty("end")}function BJ(t,e,r){var n=t.id,o=t.properties,i=t.lables,a=e?function(t,e){if(!e)return{};for(var r=t.id,n=t.labels,o=e.filter(function(t){return"entity"===t.type}),i=0;it.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.hoverColor;return{stroke:t,shadowColor:t,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:t}}}},{key:"_getDefaultNodeHighlightStyle",value:function(){return{lineWidth:3,stroke:arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hoverColor}}},{key:"_getContextMenu",value:function(){var t=this;return new(zJ().Menu)({shouldBegin:function(t){return!!(t.target&&t.target.isCanvas&&t.target.isCanvas())||!!t.item},getContent:function(e){var r=e.item;if(!(e.target&&e.target.isCanvas&&e.target.isCanvas())&&r){var n=r.getType(),o=r.getModel();return n&&o&&"node"===n?t.isCollpased(o.id)?"
    \n
  • 展开
  • \n
":"
    \n
  • 折叠
  • \n
":void 0}},handleMenuClick:function(e,r){switch(e.id.split("-")[0]){case"hide":t.hideItem(r);break;case"expand":t.expandNode(r);break;case"collapse":t.collapseNode(r);break;case"show":t.showItem(r)}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}},{key:"_getGraphConfig",value:function(t){var e=this,r={speed:120,maxIteration:83,tick:function(){e.refreshPositions()}},n={type:"fruchterman",gravity:5},o={},i={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},a={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),u=[new(zJ().ToolBar),s];if(!t)return this._setToolBarStyle(),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"knowledgeGraph",s=document.querySelector("#".concat(t));return{container:t,width:s.scrollWidth,height:s.scrollHeight,plugins:u,modes:a,layout:QJ(QJ({},n),r),defaultNode:o,defaultEdge:i,nodeStateStyles:{hover:e._getDefaultNodeHighlightStyle(),actived:e._getDefaultNodeHighlightStyle()},edgeStateStyles:{hover:e._getDefaultEdgeHighlightStyle(),actived:e._getDefaultEdgeHighlightStyle()}}}();t.container=t.container||"knowledgeGraph";var l="string"==typeof t.container?document.querySelector("#".concat(t.container)):t.container;t.width=t.width||l.scrollWidth,t.height=t.height||l.scrollHeight,t.layout=QJ(QJ(QJ({},n),t.layout||{}),!1!==t.animate?r:{}),t.defaultNode=QJ(QJ({},o),t.defaultNode||{}),t.defaultEdge=QJ(QJ({},i),t.defaultEdge||{}),t.modes={default:[]},!1!==t.dragCanvas&&t.modes.default.push("drag-canvas"),!1!==t.zoomCanvas&&t.modes.default.push("zoom-canvas"),!1!==t.dragNode&&t.modes.default.push("drag-node");var c=QJ(QJ({},this._getDefaultNodeHighlightStyle()),t.nodeHighlightStyle||{}),f=QJ(QJ({},this._getDefaultEdgeHighlightStyle()),t.edgeHighlightStyle||{});return t.nodeStateStyles={hover:c,actived:c},t.edgeStateStyles={hover:f,actived:f},!1!==t.showToolBar&&(t.plugins=[new(zJ().ToolBar)],this._setToolBarStyle()),!1!==t.showContextMenu&&(t.plugins=[].concat(WJ(t.plugins||[]),[s]),this._setToolBarStyle()),t}},{key:"changeSize",value:function(t,e){return this.graph.changeSize(t,e)}},{key:"autoResize",value:function(){var t=this,e=this.getContainer();window.addEventListener("resize",function(){var r=e.scrollWidth,n=e.scrollHeight;t.graph.changeSize(r,n),t.graph.refresh()})}},{key:"zoom",value:function(t,e,r,n){this.graph.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graph.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graph.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graph.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graph.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graph.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graph.getZoom()}},{key:"getMinZoom",value:function(){return this.graph.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graph.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graph.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graph.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graph.getWidth()}},{key:"getHeight",value:function(){return this.graph.getHeight()}},{key:"setCenter",value:function(t){var e=this.graph.getWidth()/2,r=this.graph.getHeight()/2,n=this.graph.getCanvasByPoint(t.x,t.y);this.graph.translate(e-n.x,r-n.y)}},{key:"_setToolBarStyle",value:function(){qJ()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}},{key:"highlightNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("node:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("node:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"highlightEdge",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("edge:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("edge:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data?e.changeData(t):e.data(t),this.data=t}},{key:"render",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).render()}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data=t,e.changeData(t)}},{key:"refresh",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refresh()}},{key:"getContainer",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getContainer()}},{key:"getCanvas",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).get("canvas")}},{key:"getNodes",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getNodes()}},{key:"getEdges",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getEdges()}},{key:"getNeighbors",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).getNeighbors(t,e)}},{key:"findById",value:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).findById(t)}},{key:"find",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).find(t,e)}},{key:"findAll",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return t.getEdges()}},{key:"getInEdges",value:function(t){return t.getInEdges()}},{key:"getOutEdges",value:function(t){return t.getOutEdges()}},{key:"getSourceByEdge",value:function(t){return t.getSource()}},{key:"getTargetByEdge",value:function(t){return t.getTarget()}},{key:"expandNode",value:function(t){var e=t.getModel().id;this._expandCollapseNode(this.collpasedData[e],"show"),delete this.collpasedData[e]}},{key:"collapseNode",value:function(t){var e=t.getModel().id,r=[];this._collapseFunc(t,r),this.collpasedData[e]=r,this._expandCollapseNode(r)}},{key:"isCollpased",value:function(t){return!!this.collpasedData[t]}},{key:"_collapseFunc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this.getNeighbors(t,"target"),n=this.getNeighbors(t,"source"),o=0;o1&&void 0!==arguments[1]?arguments[1]:"hide";t&&t.forEach(function(t){"hide"===r?e.hideItem(t.id):(e.showItem(t.id),e.isCollpased(t.id)&&delete e.collpasedData[t.id]),t.children&&e._expandCollapseNode(t.children,r)})}},{key:"showItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).showItem(t,e)}},{key:"hideItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).hideItem(t,e)}},{key:"show",value:function(t){t.show()}},{key:"hide",value:function(t){t.hide()}},{key:"changeVisibility",value:function(t,e){t.changeVisibility(e)}},{key:"isVisible",value:function(t){return t.isVisible()}},{key:"getModel",value:function(t){return t.getModel()}},{key:"addItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).addItem(t,e)}},{key:"removeItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).removeItem(t)}},{key:"updateItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).updateItem(t,e)}},{key:"refreshItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).refreshItem(t)}},{key:"refreshPositions",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refreshPositions()}},{key:"on",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).on(t,e)}},{key:"off",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).off(t,e)}},{key:"toDataURL",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).toDataURL(t,e)}},{key:"bindNodeDefaultDragEvent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("node:dragstart",function(t){eW(t)}),t.on("node:drag",function(t){eW(t)}),t.on("node:dragend",function(t){t.item.get("model").fx=null,t.item.get("model").fy=null})}},{key:"stopDefaultEventPropagation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("click",function(t){t.stopPropagation()}),t.on("mousedown",function(t){t.stopPropagation()}),t.on("mouseover",function(t){t.stopPropagation()}),t.on("mouseout",function(t){t.stopPropagation()})}},{key:"clear",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).clear()}},{key:"destroy",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).destroy()}}])&&ZJ(t.prototype,e),r&&ZJ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function eW(t){var e=t.item.get("model");return e.fx=t.x,e.fy=t.y,e.x=t.x,e.y=t.y,e}var rW=r(5611),nW=r.n(rW);function oW(t){"@babel/helpers - typeof";return(oW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iW(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"G6";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=null,this.config=nW()(e),this.graphRender=null,this.type=r,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"},r=[{key:"dataFromGraphMap",value:function(t,e){return RJ(t,e)}},{key:"dataFromKnowledgeGraphQuery",value:function(t){return RJ(t)}}],(e=[{key:"_handleNodes",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.findById(t);e(n,"node")})}},{key:"_handleEdges",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.find("edge",function(e){return e.get("model").edgeId==t});e(n,"edge")})}},{key:"highlight",value:function(t){var e=t.nodeIDs,r=void 0===e?[]:e,n=t.edgeIDs,o=void 0===n?[]:n,i=this.graph,a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"node";if(e){var n=t[r+"StateStyles"];n&&i.updateItem(e,{style:e.style,stateStyles:{actived:n}}),i.setItemState(e,"actived",!0),i.paint(),i.setAutoPaint(!0)}};this._handleNodes(r,a),this._handleEdges(o,a)}},{key:"clearHighlight",value:function(t){var e=this.graph,r=function(t){t&&(e.clearItemStates(t,"actived"),e.paint(),e.setAutoPaint(!0))};if(e.setAutoPaint(!1),!t)return e.getNodes().forEach(function(t){r(t)}),void e.getEdges().forEach(function(t){r(t)});var n=t.nodeIDs,o=void 0===n?[]:n,i=t.edgeIDs,a=void 0===i?[]:i;this._handleNodes(o,r),this._handleEdges(a,r)}},{key:"handleNodeStatus",value:function(t){var e=t.expand,r=t.collapse,n=t.hidden;this.expandNodes(e),this.collapseNodes(r),this.hideNodes(n)}},{key:"expandNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.expandNode(t+"")})}},{key:"collapseNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.collapseNode(t+"")})}},{key:"hideNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.hideItem(t+"")})}},{key:"createGraphRender",value:function(t){"G6"===t&&(this.graphRender=new tW)}},{key:"createGraph",value:function(t){var e=this.initGraph(t);return this.graph=e,this.autoResize(),e}},{key:"getGraph",value:function(){return this.graph}},{key:"autoResize",value:function(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}},{key:"zoom",value:function(t,e,r,n){this.graphRender.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graphRender.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graphRender.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graphRender.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graphRender.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graphRender.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graphRender.getZoom()}},{key:"getMinZoom",value:function(){return this.graphRender.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graphRender.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graphRender.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graphRender.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graphRender.getWidth()}},{key:"getHeight",value:function(){return this.graphRender.getHeight()}},{key:"initGraph",value:function(t){var e=this,r=this.graphRender.initGraph(t);this.graph=r;return this.graph.on("afterlayout",function(){void 0!==e.config.zoom&&e.zoom(e.config.zoom),void 0!==e.config.center&&e.graphRender.setCenter({x:e.config.center[0],y:e.config.center[1]})}),r}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;t=t||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(t.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,t.nodes)),this.graphRender.setData(t,e),this.render(e),this.data=t}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&this.graphRender.render(t)}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;e&&this.graphRender.updateGraph(t,e)}},{key:"refresh",value:function(){return this.graphRender.refresh()}},{key:"changeSize",value:function(t,e){return this.graphRender.changeSize(t,e)}},{key:"resize",value:function(t,e){this.graphRender.changeSize(t,e),this.graphRender.refresh()}},{key:"getContainer",value:function(){return this.graphRender.getContainer()}},{key:"getCanvas",value:function(){return this.graphRender.getCanvas()}},{key:"getNodes",value:function(){return this.graphRender.getNodes()}},{key:"getEdges",value:function(){return this.graphRender.getEdges()}},{key:"getNeighbors",value:function(t,e){return this.graphRender.getNeighbors(t,e)}},{key:"findById",value:function(t){return this.graphRender.findById(t)}},{key:"find",value:function(t,e){return this.graphRender.find(t,e)}},{key:"findAll",value:function(t,e){return this.graphRender.findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return this.graphRender.getEdgesByNode(t)}},{key:"getInEdges",value:function(t){return this.graphRender.getInEdges(t)}},{key:"getOutEdges",value:function(t){return this.graphRender.getOutEdges(t)}},{key:"getSourceByEdge",value:function(t){return this.graphRender.getSourceByEdge(t)}},{key:"getTargetByEdge",value:function(t){return this.graphRender.getTargetByEdge(t)}},{key:"expandNode",value:function(t){var e=this.findById(t);e&&this.graphRender.expandNode(e)}},{key:"collapseNode",value:function(t){var e=this.findById(t);e&&this.graphRender.collapseNode(e)}},{key:"showItem",value:function(t,e){this.graphRender.showItem(t,e)}},{key:"hideItem",value:function(t,e){this.graphRender.hideItem(t,e)}},{key:"show",value:function(t){this.graphRender.show(t)}},{key:"hide",value:function(t){this.graphRender.hide(t)}},{key:"changeVisibility",value:function(t,e){this.graphRender.changeVisibility(t,e)}},{key:"isVisible",value:function(t){return this.graphRender.isVisible(t)}},{key:"getModel",value:function(t){return this.graphRender.getModel(t)}},{key:"addItem",value:function(t,e){return this.graphRender.addItem(t,e)}},{key:"removeItem",value:function(t){return this.graphRender.removeItem(t)}},{key:"updateItem",value:function(t,e){return this.graphRender.updateItem(t,e)}},{key:"refreshItem",value:function(t){return this.graphRender.refreshItem(t)}},{key:"refreshPositions",value:function(){return this.graphRender.refreshPositions()}},{key:"on",value:function(t,e){this.graphRender.on(t,e)}},{key:"off",value:function(t,e){this.graphRender.off(t,e)}},{key:"toDataURL",value:function(t,e){this.graphRender.toDataURL(t,e)}},{key:"nodeLabelOpenEllipsis",value:function(t,e){var r=this;return e?t?e.map(function(e){var n=e.labelCfg&&e.labelCfg.fontSize||r.defaultNode&&r.defaultNode.labelCfg&&r.defaultNode.labelCfg.fontSize||14;return e.label=function(t,e,r){var n=1*r;e*=1.6;if(function(t){for(var e=0,r=0;r0&&t.charCodeAt(r)<128?e++:e+=2;return e}(t)*n>e){var o=Math.floor((e-20)/n),i=t.substring(0,o);return(t.substring(o).length+"…".length)*n>e?i+"\n"+t.substring(o,o+o-2)+"…":0==t.substring(o).length?i:i+"\n"+t.substring(o)}return t}(e.label,t,n),e}):e:[]}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.clear()}},{key:"destroy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.destroy()}}])&&iW(t.prototype,e),r&&iW(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();r(3688);function uW(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function lW(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){uW(i,n,o,a,s,"next",t)}function s(t){uW(i,n,o,a,s,"throw",t)}a(void 0)})}}r(7671),r(2826),r(5730),r(6678),r(2971);function cW(t){"@babel/helpers - typeof";return(cW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fW(t){var e=function(t,e){if("object"!=cW(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=cW(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cW(e)?e:e+""}function pW(t,e,r){return(e=fW(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r(3658),r(9207),r(7982);var hW=r(368),yW=(r(9484),r(9973));r(2114),r(5242),r(888);function dW(t){"@babel/helpers - typeof";return(dW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var vW=function(t,e){return(vW=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function mW(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}vW(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function bW(t,e){var r=t[0],n=t[1];return[r*Math.cos(e)-n*Math.sin(e),r*Math.sin(e)+n*Math.cos(e)]}function gW(){for(var t=[],e=0;et.phi1&&(t.phi2-=2*SW),1===t.sweepFlag&&t.phi2n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];var o=Math.sqrt(n);return[[(t*r+e*o)/(t*t+e*e),(e*r-t*o)/(t*t+e*e)],[(t*r-e*o)/(t*t+e*e),(e*r+t*o)/(t*t+e*e)]]}var OW,EW=Math.PI/180;function PW(t,e,r){return(1-r)*t+r*e}function xW(t,e,r,n){return t+Math.cos(n/180*SW)*e+Math.sin(n/180*SW)*r}function TW(t,e,r,n){var o=e-t,i=r-e,a=3*o+3*(n-r)-6*i,s=6*(i-o),u=3*o;return Math.abs(a)<1e-6?[-u/s]:function(t,e,r){void 0===r&&(r=1e-6);var n=t*t/4-u/a;if(n<-r)return[];if(n<=r)return[-t/2];var o=Math.sqrt(n);return[-t/2-o,-t/2+o]}(s/a,0,1e-6)}function CW(t,e,r,n,o){var i=1-o;return t*(i*i*i)+e*(3*i*i*o)+r*(3*i*o*o)+n*(o*o*o)}!function(t){function e(){return o(function(t,e,r){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t})}function r(){var t=NaN,e=NaN,r=NaN,n=NaN;return o(function(o,i,a){return o.type&MW.SMOOTH_CURVE_TO&&(o.type=MW.CURVE_TO,t=isNaN(t)?i:t,e=isNaN(e)?a:e,o.x1=o.relative?i-t:2*i-t,o.y1=o.relative?a-e:2*a-e),o.type&MW.CURVE_TO?(t=o.relative?i+o.x2:o.x2,e=o.relative?a+o.y2:o.y2):(t=NaN,e=NaN),o.type&MW.SMOOTH_QUAD_TO&&(o.type=MW.QUAD_TO,r=isNaN(r)?i:r,n=isNaN(n)?a:n,o.x1=o.relative?i-r:2*i-r,o.y1=o.relative?a-n:2*a-n),o.type&MW.QUAD_TO?(r=o.relative?i+o.x1:o.x1,n=o.relative?a+o.y1:o.y1):(r=NaN,n=NaN),o})}function n(){var t=NaN,e=NaN;return o(function(r,n,o){if(r.type&MW.SMOOTH_QUAD_TO&&(r.type=MW.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?o:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?o-e:2*o-e),r.type&MW.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?o+r.y1:r.y1;var i=r.x1,a=r.y1;r.type=MW.CURVE_TO,r.x1=((r.relative?0:n)+2*i)/3,r.y1=((r.relative?0:o)+2*a)/3,r.x2=(r.x+2*i)/3,r.y2=(r.y+2*a)/3}else t=NaN,e=NaN;return r})}function o(t){var e=0,r=0,n=NaN,o=NaN;return function(i){if(isNaN(n)&&!(i.type&MW.MOVE_TO))throw new Error("path must start with moveto");var a=t(i,e,r,n,o);return i.type&MW.CLOSE_PATH&&(e=n,r=o),void 0!==i.x&&(e=i.relative?e+i.x:i.x),void 0!==i.y&&(r=i.relative?r+i.y:i.y),i.type&MW.MOVE_TO&&(n=e,o=r),a}}function i(t,e,r,n,i,a){return gW(t,e,r,n,i,a),o(function(o,s,u,l){var c=o.x1,f=o.x2,p=o.relative&&!isNaN(l),h=void 0!==o.x?o.x:p?0:s,y=void 0!==o.y?o.y:p?0:u;function d(t){return t*t}o.type&MW.HORIZ_LINE_TO&&0!==e&&(o.type=MW.LINE_TO,o.y=o.relative?0:u),o.type&MW.VERT_LINE_TO&&0!==r&&(o.type=MW.LINE_TO,o.x=o.relative?0:s),void 0!==o.x&&(o.x=o.x*t+y*r+(p?0:i)),void 0!==o.y&&(o.y=h*e+o.y*n+(p?0:a)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(p?0:i)),void 0!==o.y1&&(o.y1=c*e+o.y1*n+(p?0:a)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(p?0:i)),void 0!==o.y2&&(o.y2=f*e+o.y2*n+(p?0:a));var v=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===v)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=MW.LINE_TO;else{var m=o.xRot*Math.PI/180,b=Math.sin(m),g=Math.cos(m),S=1/d(o.rX),w=1/d(o.rY),_=d(g)*S+d(b)*w,O=2*b*g*(S-w),E=d(b)*S+d(g)*w,P=_*n*n-O*e*n+E*e*e,x=O*(t*n+e*r)-2*(_*r*n+E*t*e),T=_*r*r-O*t*r+E*t*t,C=(Math.atan2(x,P-T)+Math.PI)%Math.PI/2,k=Math.sin(C),A=Math.cos(C);o.rX=Math.abs(v)/Math.sqrt(P*d(A)+x*k*A+T*d(k)),o.rY=Math.abs(v)/Math.sqrt(P*d(k)-x*k*A+T*d(A)),o.xRot=180*C/Math.PI}return void 0!==o.sweepFlag&&0>v&&(o.sweepFlag=+!o.sweepFlag),o})}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),gW(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return o(function(t,e,r){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,e,r){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),o(function(n,o,i,a,s){if(isNaN(a)&&!(n.type&MW.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&MW.HORIZ_LINE_TO&&(n.type=MW.LINE_TO,n.y=n.relative?0:i),r&&n.type&MW.VERT_LINE_TO&&(n.type=MW.LINE_TO,n.x=n.relative?0:o),t&&n.type&MW.CLOSE_PATH&&(n.type=MW.LINE_TO,n.x=n.relative?a-o:a,n.y=n.relative?s-i:s),n.type&MW.ARC&&(0===n.rX||0===n.rY)&&(n.type=MW.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n})},t.NORMALIZE_ST=r,t.QT_TO_C=n,t.INFO=o,t.SANITIZE=function(t){void 0===t&&(t=0),gW(t);var e=NaN,r=NaN,n=NaN,i=NaN;return o(function(o,a,s,u,l){var c=Math.abs,f=!1,p=0,h=0;if(o.type&MW.SMOOTH_CURVE_TO&&(p=isNaN(e)?0:a-e,h=isNaN(r)?0:s-r),o.type&(MW.CURVE_TO|MW.SMOOTH_CURVE_TO)?(e=o.relative?a+o.x2:o.x2,r=o.relative?s+o.y2:o.y2):(e=NaN,r=NaN),o.type&MW.SMOOTH_QUAD_TO?(n=isNaN(n)?a:2*a-n,i=isNaN(i)?s:2*s-i):o.type&MW.QUAD_TO?(n=o.relative?a+o.x1:o.x1,i=o.relative?s+o.y1:o.y2):(n=NaN,i=NaN),o.type&MW.LINE_COMMANDS||o.type&MW.ARC&&(0===o.rX||0===o.rY||!o.lArcFlag)||o.type&MW.CURVE_TO||o.type&MW.SMOOTH_CURVE_TO||o.type&MW.QUAD_TO||o.type&MW.SMOOTH_QUAD_TO){var y=void 0===o.x?0:o.relative?o.x:o.x-a,d=void 0===o.y?0:o.relative?o.y:o.y-s;p=isNaN(n)?void 0===o.x1?p:o.relative?o.x:o.x1-a:n-a,h=isNaN(i)?void 0===o.y1?h:o.relative?o.y:o.y1-s:i-s;var v=void 0===o.x2?0:o.relative?o.x:o.x2-a,m=void 0===o.y2?0:o.relative?o.y:o.y2-s;c(y)<=t&&c(d)<=t&&c(p)<=t&&c(h)<=t&&c(v)<=t&&c(m)<=t&&(f=!0)}return o.type&MW.CLOSE_PATH&&c(a-u)<=t&&c(s-l)<=t&&(f=!0),f?[]:o})},t.MATRIX=i,t.ROTATE=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),gW(t,e,r);var n=Math.sin(t),o=Math.cos(t);return i(o,n,-n,o,e-e*o+r*n,r-e*n-r*o)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),gW(t,e),i(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),gW(t,e),i(t,0,0,e,0,0)},t.SKEW_X=function(t){return gW(t),i(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return gW(t),i(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),gW(t),i(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),gW(t),i(1,0,0,-1,0,t)},t.A_TO_C=function(){return o(function(t,e,r){return MW.ARC===t.type?function(t,e,r){var n,o,i,a;t.cX||wW(t,e,r);for(var s=Math.min(t.phi1,t.phi2),u=Math.max(t.phi1,t.phi2)-s,l=Math.ceil(u/90),c=new Array(l),f=e,p=r,h=0;hs.maxX&&(s.maxX=t),ts.maxY&&(s.maxY=t),tT&&u(CW(r,o.x1,o.x2,o.x,T));for(var p=0,h=TW(n,o.y1,o.y2,o.y);pT&&l(CW(n,o.y1,o.y2,o.y,T))}if(o.type&MW.ARC){u(o.x),l(o.y),wW(o,r,n);for(var y=o.xRot/180*Math.PI,d=Math.cos(y)*o.rX,v=Math.sin(y)*o.rX,m=-Math.sin(y)*o.rY,b=Math.cos(y)*o.rY,g=o.phi1o.phi2?[o.phi2+360,o.phi1+360]:[o.phi2,o.phi1],S=g[0],w=g[1],_=function(t){var e=t[0],r=t[1],n=180*Math.atan2(r,e)/Math.PI;return nS&&TS&&Tu)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+o+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"');this.curArgs.push(u),this.curArgs.length===RW[this.curCommandType]&&(MW.HORIZ_LINE_TO===this.curCommandType?n({type:MW.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):MW.VERT_LINE_TO===this.curCommandType?n({type:MW.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===MW.MOVE_TO||this.curCommandType===MW.LINE_TO||this.curCommandType===MW.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),MW.MOVE_TO===this.curCommandType&&(this.curCommandType=MW.LINE_TO)):this.curCommandType===MW.CURVE_TO?n({type:MW.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===MW.SMOOTH_CURVE_TO?n({type:MW.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===MW.QUAD_TO?n({type:MW.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===MW.ARC&&n({type:MW.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!jW(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(s)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+i+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=MW.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=MW.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=MW.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=MW.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=MW.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=MW.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=MW.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=MW.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError('Unexpected character "'+i+'" at index '+o+".");this.curCommandType=MW.ARC,this.curCommandRelative="a"===i}else e.push({type:MW.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,r){void 0===r&&(r=[]);for(var n=0,o=Object.getPrototypeOf(this).parse.call(this,e);n>>w;if(s[g+3]=K,0!==K){var Y=255/K;s[g]=(L*S>>>w)*Y,s[g+1]=(D*S>>>w)*Y,s[g+2]=(B*S>>>w)*Y}else s[g]=s[g+1]=s[g+2]=0;L-=N,D-=I,B-=M,F-=R,N-=v.r,I-=v.g,M-=v.b,R-=v.a;var Q=W+i+1;Q=b+(Q>>w,at>0?(at=255/at,s[Et]=(ft*S>>>w)*at,s[Et+1]=(pt*S>>>w)*at,s[Et+2]=(ht*S>>>w)*at):s[Et]=s[Et+1]=s[Et+2]=0,ft-=st,pt-=ut,ht-=lt,yt-=ct,st-=v.r,ut-=v.g,lt-=v.b,ct-=v.a,Et=rt+((Et=Ot+f)=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function HW(){return(HW="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=KW(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}}).apply(this,arguments)}function qW(t){return function(t){if(Array.isArray(t))return nK(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||rK(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function JW(t,e,r){return e=KW(e),WW(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],KW(t).constructor):e.apply(t,r))}function WW(t,e){if(e&&("object"===VW(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function KW(t){return(KW=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function YW(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&QW(t,e)}function QW(t,e){return(QW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function XW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZW(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function iK(t){return t.replace(/(?!\u3000)\s+/gm," ")}function aK(t){return((t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var sK=/^[A-Z-]+$/;function uK(t){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t)||[];return e[2]||e[3]||e[4]}var lK=/(\[[^\]]+\])/g,cK=/(#[^\s+>~.[:]+)/g,fK=/(\.[^\s+>~.[:]+)/g,pK=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,hK=/(:[\w-]+\([^)]*\))/gi,yK=/(:[^\s+>~.[:]+)/g,dK=/([^\s+>~.[:]+)/g;function vK(t,e){var r=e.exec(t);return r?[t.replace(e," "),r.length]:[t,0]}var mK=1e-8;function bK(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function gK(t,e){return(t[0]*e[0]+t[1]*e[1])/(bK(t)*bK(e))}function SK(t,e){return(t[0]*e[1]0&&void 0!==arguments[0]?arguments[0]:" ",r=this.document,n=this.name;return iK(this.getString()).trim().split(e).map(function(e){return new t(r,n,e)})}},{key:"hasValue",value:function(t){var e=this.value;return null!==e&&""!==e&&(t||0!==e)&&void 0!==e}},{key:"isString",value:function(t){var e=this.value,r="string"==typeof e;return r&&t?t.test(e):r}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"getValue",value:function(t){return void 0===t||this.hasValue()?this.value:t}},{key:"getNumber",value:function(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);var e=this.value,r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}},{key:"getString",value:function(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}},{key:"getColor",value:function(t){var e=this.getString(t);return this.isNormalizedColor?e:(this.isNormalizedColor=!0,e=function(t){if(!t.startsWith("rgb"))return t;var e=3;return t.replace(/\d+(\.\d+)?/g,function(t,r){return e--&&r?String(Math.round(parseFloat(t))):t})}(e),this.value=e,e)}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9.-]/g,"")}},{key:"getPixels",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var r=eK("boolean"==typeof t?[void 0,t]:[t],2),n=r[0],o=r[1],i=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(i.computeSize("x"),i.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(i.computeSize("x"),i.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*i.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*i.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&o:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*i.computeSize(n);default:var a=this.getNumber();return e&&a<1?a*i.computeSize(n):a}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}},{key:"getFillStyleDefinition",value:function(t,e){var r=this.getDefinition();if(!r)return null;if("function"==typeof r.createGradient)return r.createGradient(this.document.ctx,t,e);if("function"==typeof r.createPattern){if(r.getHrefAttribute().hasValue()){var n=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),n.hasValue()&&r.getAttribute("patternTransform",!0).setValue(n.value)}return r.createPattern(this.document.ctx,t,e)}return null}},{key:"getTextBaseline",value:function(){return this.hasValue()?t.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function(e){for(var r=this.getColor(),n=r.length,o=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=eK(aK(e),2),o=n[0],i=void 0===o?r:o,a=n[1];return new t(i,void 0===a?r:a)}},{key:"parseScale",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=eK(aK(e),2),o=n[0],i=void 0===o?r:o,a=n[1];return new t(i,void 0===a?i:a)}},{key:"parsePath",value:function(e){for(var r=aK(e),n=r.length,o=[],i=0;i0}},{key:"runEvents",value:function(){if(this.working){var t=this.screen,e=this.events,r=this.eventElements,n=t.ctx.canvas.style;n&&(n.cursor=""),e.forEach(function(t,e){for(var n=t.run,o=r[e];o;)n(o),o=o.parent}),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(t,e){if(this.working&&e){var r=this.events,n=this.eventElements;r.forEach(function(r,o){var i=r.x,a=r.y;!n[o]&&e.isPointInPath&&e.isPointInPath(i,a)&&(n[o]=t)})}}},{key:"checkBoundingBox",value:function(t,e){if(this.working&&e){var r=this.events,n=this.eventElements;r.forEach(function(r,o){var i=r.x,a=r.y;!n[o]&&e.isPointInBox(i,a)&&(n[o]=t)})}}},{key:"mapXY",value:function(t,e){for(var r=this.screen,n=r.window,o=r.ctx,i=new AK(t,e),a=o.canvas;a;)i.x-=a.offsetLeft,i.y-=a.offsetTop,a=a.offsetParent;return n.scrollX&&(i.x+=n.scrollX),n.scrollY&&(i.y+=n.scrollY),i}},{key:"onClick",value:function(t){var e=this.mapXY(t.clientX,t.clientY),r=e.x,n=e.y;this.events.push({type:"onclick",x:r,y:n,run:function(t){t.onClick&&t.onClick()}})}},{key:"onMouseMove",value:function(t){var e=this.mapXY(t.clientX,t.clientY),r=e.x,n=e.y;this.events.push({type:"onmousemove",x:r,y:n,run:function(t){t.onMouseMove&&t.onMouseMove()}})}}])}(),NK="undefined"!=typeof window?window:null,IK="undefined"!=typeof fetch?fetch.bind(void 0):null,MK=function(){return $W(function t(e){XW(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.fetch,o=void 0===n?IK:n,i=r.window,a=void 0===i?NK:i;this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new kK,this.mouse=new jK(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=a,this.fetch=o},[{key:"wait",value:function(t){this.waits.push(t)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var t=this.waits.every(function(t){return t()});return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}},{key:"setDefaults",value:function(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}},{key:"setViewBox",value:function(t){var e=t.document,r=t.ctx,n=t.aspectRatio,o=t.width,i=t.desiredWidth,a=t.height,s=t.desiredHeight,u=t.minX,l=void 0===u?0:u,c=t.minY,f=void 0===c?0:c,p=t.refX,h=t.refY,y=t.clip,d=void 0!==y&&y,v=t.clipX,m=void 0===v?0:v,b=t.clipY,g=void 0===b?0:b,S=eK(iK(n).replace(/^defer\s/,"").split(" "),2),w=S[0],_=S[1],O=w||"xMidYMid",E=_||"meet",P=o/i,x=a/s,T=Math.min(P,x),C=Math.max(P,x),k=i,A=s;"meet"===E&&(k*=T,A*=T),"slice"===E&&(k*=C,A*=C);var j=new CK(e,"refX",p),N=new CK(e,"refY",h),I=j.hasValue()&&N.hasValue();if(I&&r.translate(-T*j.getPixels("x"),-T*N.getPixels("y")),d){var M=T*m,R=T*g;r.beginPath(),r.moveTo(M,R),r.lineTo(o,R),r.lineTo(o,a),r.lineTo(M,a),r.closePath(),r.clip()}if(!I){var L="meet"===E&&T===x,D="slice"===E&&C===x,B="meet"===E&&T===P,F="slice"===E&&C===P;O.startsWith("xMid")&&(L||D)&&r.translate(o/2-k/2,0),O.endsWith("YMid")&&(B||F)&&r.translate(0,a/2-A/2),O.startsWith("xMax")&&(L||D)&&r.translate(o-k,0),O.endsWith("YMax")&&(B||F)&&r.translate(0,a-A)}switch(!0){case"none"===O:r.scale(P,x);break;case"meet"===E:r.scale(T,T);break;case"slice"===E:r.scale(C,C)}r.translate(-l,-f)}},{key:"start",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.enableRedraw,o=void 0!==n&&n,i=r.ignoreMouse,a=void 0!==i&&i,s=r.ignoreAnimation,u=void 0!==s&&s,l=r.ignoreDimensions,c=void 0!==l&&l,f=r.ignoreClear,p=void 0!==f&&f,h=r.forceRedraw,y=r.scaleWidth,d=r.scaleHeight,v=r.offsetX,m=r.offsetY,b=this.FRAMERATE,g=this.mouse,S=1e3/b;if(this.frameDuration=S,this.readyPromise=new Promise(function(t){e.resolveReady=t}),this.isReady()&&this.render(t,c,p,y,d,v,m),o){var w=Date.now(),_=w,O=0;a||g.start(),this.intervalId=hW(function r(){w=Date.now(),(O=w-_)>=S&&(_=w-O%S,e.shouldUpdate(u,h)&&(e.render(t,c,p,y,d,v,m),g.runEvents())),e.intervalId=hW(r)})}}},{key:"stop",value:function(){this.intervalId&&(hW.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(t,e){if(!t){var r=this.frameDuration,n=this.animations.reduce(function(t,e){return e.update(r)||t},!1);if(n)return!0}return!("function"!=typeof e||!e())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(t,e,r,n,o,i,a){var s=this.CLIENT_WIDTH,u=this.CLIENT_HEIGHT,l=this.viewPort,c=this.ctx,f=this.isFirstRender,p=c.canvas;l.clear(),p.width&&p.height?l.setCurrent(p.width,p.height):l.setCurrent(s,u);var h=t.getStyle("width"),y=t.getStyle("height");!e&&(f||"number"!=typeof n&&"number"!=typeof o)&&(h.hasValue()&&(p.width=h.getPixels("x"),p.style&&(p.style.width="".concat(p.width,"px"))),y.hasValue()&&(p.height=y.getPixels("y"),p.style&&(p.style.height="".concat(p.height,"px"))));var d=p.clientWidth||p.width,v=p.clientHeight||p.height;if(e&&h.hasValue()&&y.hasValue()&&(d=h.getPixels("x"),v=y.getPixels("y")),l.setCurrent(d,v),"number"==typeof i&&t.getAttribute("x",!0).setValue(i),"number"==typeof a&&t.getAttribute("y",!0).setValue(a),"number"==typeof n||"number"==typeof o){var m=aK(t.getAttribute("viewBox").getString()),b=0,g=0;if("number"==typeof n){var S=t.getStyle("width");S.hasValue()?b=S.getPixels("x")/n:isNaN(m[2])||(b=m[2]/n)}if("number"==typeof o){var w=t.getStyle("height");w.hasValue()?g=w.getPixels("y")/o:isNaN(m[3])||(g=m[3]/o)}b||(b=g),g||(g=b),t.getAttribute("width",!0).setValue(n),t.getAttribute("height",!0).setValue(o);var _=t.getStyle("transform",!0,!0);_.setValue("".concat(_.getString()," scale(").concat(1/b,", ").concat(1/g,")"))}r||c.clearRect(0,0,d,v),t.render(c),f&&(this.isFirstRender=!1)}}])}();MK.defaultWindow=NK,MK.defaultFetch=IK;var RK=MK.defaultFetch,LK="undefined"!=typeof DOMParser?DOMParser:null,DK=function(){return $W(function t(){XW(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.fetch,n=void 0===r?RK:r,o=e.DOMParser,i=void 0===o?LK:o;this.fetch=n,this.DOMParser=i},[{key:"parse",value:function(t){var e=this;return lW(oK().mark(function r(){return oK().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.startsWith("<")){r.next=2;break}return r.abrupt("return",e.parseFromString(t));case 2:return r.abrupt("return",e.load(t));case 3:case"end":return r.stop()}},r)}))()}},{key:"parseFromString",value:function(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch(r){return this.checkDocument(e.parseFromString(t,"text/xml"))}}},{key:"checkDocument",value:function(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}},{key:"load",value:function(t){var e=this;return lW(oK().mark(function r(){var n,o;return oK().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.fetch(t);case 2:return n=r.sent,r.next=5,n.text();case 5:return o=r.sent,r.abrupt("return",e.parseFromString(o));case 7:case"end":return r.stop()}},r)}))()}}])}(),BK=function(){return $W(function t(e,r){XW(this,t),this.type="translate",this.point=null,this.point=AK.parse(r)},[{key:"apply",value:function(t){var e=this.point,r=e.x,n=e.y;t.translate(r||0,n||0)}},{key:"unapply",value:function(t){var e=this.point,r=e.x,n=e.y;t.translate(-1*r||0,-1*n||0)}},{key:"applyToPoint",value:function(t){var e=this.point,r=e.x,n=e.y;t.applyTransform([1,0,0,1,r||0,n||0])}}])}(),FK=function(){return $W(function t(e,r,n){XW(this,t),this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var o=aK(r);this.angle=new CK(e,"angle",o[0]),this.originX=n[0],this.originY=n[1],this.cx=o[1]||0,this.cy=o[2]||0},[{key:"apply",value:function(t){var e=this.cx,r=this.cy,n=this.originX,o=this.originY,i=this.angle,a=e+n.getPixels("x"),s=r+o.getPixels("y");t.translate(a,s),t.rotate(i.getRadians()),t.translate(-a,-s)}},{key:"unapply",value:function(t){var e=this.cx,r=this.cy,n=this.originX,o=this.originY,i=this.angle,a=e+n.getPixels("x"),s=r+o.getPixels("y");t.translate(a,s),t.rotate(-1*i.getRadians()),t.translate(-a,-s)}},{key:"applyToPoint",value:function(t){var e=this.cx,r=this.cy,n=this.angle.getRadians();t.applyTransform([1,0,0,1,e||0,r||0]),t.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),t.applyTransform([1,0,0,1,-e||0,-r||0])}}])}(),UK=function(){return $W(function t(e,r,n){XW(this,t),this.type="scale",this.scale=null,this.originX=null,this.originY=null;var o=AK.parseScale(r);0!==o.x&&0!==o.y||(o.x=mK,o.y=mK),this.scale=o,this.originX=n[0],this.originY=n[1]},[{key:"apply",value:function(t){var e=this.scale,r=e.x,n=e.y,o=this.originX,i=this.originY,a=o.getPixels("x"),s=i.getPixels("y");t.translate(a,s),t.scale(r,n||r),t.translate(-a,-s)}},{key:"unapply",value:function(t){var e=this.scale,r=e.x,n=e.y,o=this.originX,i=this.originY,a=o.getPixels("x"),s=i.getPixels("y");t.translate(a,s),t.scale(1/r,1/n||r),t.translate(-a,-s)}},{key:"applyToPoint",value:function(t){var e=this.scale,r=e.x,n=e.y;t.applyTransform([r||0,0,0,n||0,0,0])}}])}(),GK=function(){return $W(function t(e,r,n){XW(this,t),this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=aK(r),this.originX=n[0],this.originY=n[1]},[{key:"apply",value:function(t){var e=this.originX,r=this.originY,n=this.matrix,o=e.getPixels("x"),i=r.getPixels("y");t.translate(o,i),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),t.translate(-o,-i)}},{key:"unapply",value:function(t){var e=this.originX,r=this.originY,n=this.matrix,o=n[0],i=n[2],a=n[4],s=n[1],u=n[3],l=n[5],c=1/(o*(1*u-0*l)-i*(1*s-0*l)+a*(0*s-0*u)),f=e.getPixels("x"),p=r.getPixels("y");t.translate(f,p),t.transform(c*(1*u-0*l),c*(0*l-1*s),c*(0*a-1*i),c*(1*o-0*a),c*(i*l-a*u),c*(a*s-o*l)),t.translate(-f,-p)}},{key:"applyToPoint",value:function(t){t.applyTransform(this.matrix)}}])}(),VK=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="skew",o.angle=null,o.angle=new CK(t,"angle",r),o}return YW(e,GK),$W(e)}(),zK=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="skewX",o.matrix=[1,0,Math.tan(o.angle.getRadians()),1,0,0],o}return YW(e,VK),$W(e)}(),HK=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="skewY",o.matrix=[1,Math.tan(o.angle.getRadians()),0,1,0,0],o}return YW(e,VK),$W(e)}();var qK=function(){function t(e,r,n){var o=this;XW(this,t),this.document=e,this.transforms=[],function(t){return iK(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(r).forEach(function(e){if("none"!==e){var r=eK(function(t){var e=eK(t.split("("),2),r=e[0],n=e[1];return[r.trim(),n.trim().replace(")","")]}(e),2),i=r[0],a=r[1],s=t.transformTypes[i];void 0!==s&&o.transforms.push(new s(o.document,a,n))}})}return $W(t,[{key:"apply",value:function(t){for(var e=this.transforms,r=e.length,n=0;n=0;r--)e[r].unapply(t)}},{key:"applyToPoint",value:function(t){for(var e=this.transforms,r=e.length,n=0;n2&&void 0!==arguments[2]&&arguments[2];if(this.document=e,this.node=r,this.captureTextNodes=o,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],r&&1===r.nodeType){if(Array.from(r.attributes).forEach(function(t){var r,o=(r=t.nodeName,sK.test(r)?r.toLowerCase():r);n.attributes[o]=new CK(e,o,t.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue())this.getAttribute("style").getString().split(";").map(function(t){return t.trim()}).forEach(function(t){if(t){var r=eK(t.split(":").map(function(t){return t.trim()}),2),o=r[0],i=r[1];n.styles[o]=new CK(e,o,i)}});var i=e.definitions,a=this.getAttribute("id");a.hasValue()&&(i[a.getString()]||(i[a.getString()]=this)),Array.from(r.childNodes).forEach(function(t){if(1===t.nodeType)n.addChild(t);else if(o&&(3===t.nodeType||4===t.nodeType)){var r=e.createTextNode(t);r.getText().length>0&&n.addChild(r)}})}}return $W(t,[{key:"getAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attributes[t];if(!r&&e){var n=new CK(this.document,t,"");return this.attributes[t]=n,n}return r||CK.empty(this.document)}},{key:"getHrefAttribute",value:function(){for(var t in this.attributes)if("href"===t||t.endsWith(":href"))return this.attributes[t];return CK.empty(this.document)}},{key:"getStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.styles[t];if(n)return n;var o=this.getAttribute(t);if(null!==o&&void 0!==o&&o.hasValue())return this.styles[t]=o,o;if(!r){var i=this.parent;if(i){var a=i.getStyle(t);if(null!==a&&void 0!==a&&a.hasValue())return a}}if(e){var s=new CK(this.document,t,"");return this.styles[t]=s,s}return n||CK.empty(this.document)}},{key:"render",value:function(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function(t){}},{key:"applyEffects",value:function(t){var e=qK.fromElement(this.document,this);e&&e.apply(t);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var n=r.getDefinition();n&&n.apply(t)}}},{key:"clearContext",value:function(t){}},{key:"renderChildren",value:function(t){this.children.forEach(function(e){e.render(t)})}},{key:"addChild",value:function(e){var r=e instanceof t?e:this.document.createElement(e);r.parent=this,t.ignoreChildTypes.includes(r.type)||this.children.push(r)}},{key:"matchesSelector",value:function(t){var e,r=this.node;if("function"==typeof r.matches)return r.matches(t);var n=null===(e=r.getAttribute)||void 0===e?void 0:e.call(r,"class");return!(!n||""===n)&&n.split(" ").some(function(e){return".".concat(e)===t})}},{key:"addStylesFromStyleDefinition",value:function(){var t=this.document,e=t.styles,r=t.stylesSpecificity;for(var n in e)if(!n.startsWith("@")&&this.matchesSelector(n)){var o=e[n],i=r[n];if(o)for(var a in o){var s=this.stylesSpecificity[a];void 0===s&&(s="000"),i>=s&&(this.styles[a]=o[a],this.stylesSpecificity[a]=i)}}}},{key:"removeStyles",value:function(t,e){return e.reduce(function(e,r){var n=t.getStyle(r);if(!n.hasValue())return e;var o=n.getString();return n.setValue(""),[].concat(qW(e),[[r,o]])},[])}},{key:"restoreStyles",value:function(t,e){e.forEach(function(e){var r=eK(e,2),n=r[0],o=r[1];t.getStyle(n,!0).setValue(o)})}},{key:"isFirstChild",value:function(){var t;return 0===(null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this))}}])}();JK.ignoreChildTypes=["title"];var WK=function(t){function e(t,r,n){return XW(this,e),JW(this,e,[t,r,n])}return YW(e,JK),$W(e)}();function KK(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}var YK=function(){function t(e,r,n,o,i,a){XW(this,t);var s=a?"string"==typeof a?t.parse(a):a:{};this.fontFamily=i||s.fontFamily,this.fontSize=o||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=n||s.fontWeight,this.fontVariant=r||s.fontVariant}return $W(t,[{key:"toString",value:function(){return[function(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}(this.fontStyle),this.fontVariant,function(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}(this.fontWeight),this.fontSize,(t=this.fontFamily,"undefined"==typeof process?t:t.trim().split(",").map(KK).join(","))].join(" ").trim();var t}}],[{key:"parse",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,n="",o="",i="",a="",s="",u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return iK(e).trim().split(" ").forEach(function(e){switch(!0){case!u.fontStyle&&t.styles.includes(e):"inherit"!==e&&(n=e),u.fontStyle=!0;break;case!u.fontVariant&&t.variants.includes(e):"inherit"!==e&&(o=e),u.fontStyle=!0,u.fontVariant=!0;break;case!u.fontWeight&&t.weights.includes(e):"inherit"!==e&&(i=e),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:if("inherit"!==e){var r=eK(e.split("/"),1);a=r[0]}u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:"inherit"!==e&&(s+=e)}}),new t(n,o,i,a,s,r)}}])}();YK.styles="normal|italic|oblique|inherit",YK.variants="normal|small-caps|inherit",YK.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var QK=function(){return $W(function t(){XW(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=e,this.y1=r,this.x2=n,this.y2=o,this.addPoint(e,r),this.addPoint(n,o)},[{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}},{key:"addPoint",value:function(t,e){void 0!==t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),tthis.x2&&(this.x2=t)),void 0!==e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))}},{key:"addX",value:function(t){this.addPoint(t,null)}},{key:"addY",value:function(t){this.addPoint(null,t)}},{key:"addBoundingBox",value:function(t){if(t){var e=t.x1,r=t.y1,n=t.x2,o=t.y2;this.addPoint(e,r),this.addPoint(n,o)}}},{key:"sumCubic",value:function(t,e,r,n,o){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*r+3*(1-t)*Math.pow(t,2)*n+Math.pow(t,3)*o}},{key:"bezierCurveAdd",value:function(t,e,r,n,o){var i=6*e-12*r+6*n,a=-3*e+9*r-9*n+3*o,s=3*r-3*e;if(0!==a){var u=Math.pow(i,2)-4*s*a;if(!(u<0)){var l=(-i+Math.sqrt(u))/(2*a);0=this.commands.length-1}},{key:"next",value:function(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}},{key:"getPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",r=new AK(this.command[t],this.command[e]);return this.makeAbsolute(r)}},{key:"getAsControlPoint",value:function(t,e){var r=this.getPoint(t,e);return this.control=r,r}},{key:"getAsCurrentPoint",value:function(t,e){var r=this.getPoint(t,e);return this.current=r,r}},{key:"getReflectedControlPoint",value:function(){var t=this.previousCommand.type;if(t!==MW.CURVE_TO&&t!==MW.SMOOTH_CURVE_TO&&t!==MW.QUAD_TO&&t!==MW.SMOOTH_QUAD_TO)return this.current;var e=this.current,r=e.x,n=e.y,o=this.control,i=o.x,a=o.y;return new AK(2*r-i,2*n-a)}},{key:"makeAbsolute",value:function(t){if(this.command.relative){var e=this.current,r=e.x,n=e.y;t.x+=r,t.y+=n}return t}},{key:"addMarker",value:function(t,e,r){var n=this.points,o=this.angles;r&&o.length>0&&!o[o.length-1]&&(o[o.length-1]=n[n.length-1].angleTo(r)),this.addMarkerAngle(t,e?e.angleTo(t):null)}},{key:"addMarkerAngle",value:function(t,e){this.points.push(t),this.angles.push(e)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var t=this.angles,e=t.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];if(!e){var r=this.getStyle("fill"),n=this.getStyle("fill-opacity"),o=this.getStyle("stroke"),i=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var a=r.getFillStyleDefinition(this,n);a&&(t.fillStyle=a)}else if(r.hasValue()){"currentColor"===r.getString()&&r.setValue(this.getStyle("color").getColor());var s=r.getColor();"inherit"!==s&&(t.fillStyle="none"===s?"rgba(0,0,0,0)":s)}if(n.hasValue()){var u=new CK(this.document,"fill",t.fillStyle).addOpacity(n).getColor();t.fillStyle=u}if(o.isUrlDefinition()){var l=o.getFillStyleDefinition(this,i);l&&(t.strokeStyle=l)}else if(o.hasValue()){"currentColor"===o.getString()&&o.setValue(this.getStyle("color").getColor());var c=o.getString();"inherit"!==c&&(t.strokeStyle="none"===c?"rgba(0,0,0,0)":c)}if(i.hasValue()){var f=new CK(this.document,"stroke",t.strokeStyle).addOpacity(i).getString();t.strokeStyle=f}var p=this.getStyle("stroke-width");if(p.hasValue()){var h=p.getPixels();t.lineWidth=h||mK}var y=this.getStyle("stroke-linecap"),d=this.getStyle("stroke-linejoin"),v=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),b=this.getStyle("stroke-dashoffset");if(y.hasValue()&&(t.lineCap=y.getString()),d.hasValue()&&(t.lineJoin=d.getString()),v.hasValue()&&(t.miterLimit=v.getNumber()),m.hasValue()&&"none"!==m.getString()){var g=aK(m.getString());void 0!==t.setLineDash?t.setLineDash(g):void 0!==t.webkitLineDash?t.webkitLineDash=g:void 0===t.mozDash||1===g.length&&0===g[0]||(t.mozDash=g);var S=b.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=S:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=S:void 0!==t.mozDashOffset&&(t.mozDashOffset=S)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){var w=this.getStyle("font"),_=this.getStyle("font-style"),O=this.getStyle("font-variant"),E=this.getStyle("font-weight"),P=this.getStyle("font-size"),x=this.getStyle("font-family"),T=new YK(_.getString(),O.getString(),E.getString(),P.hasValue()?"".concat(P.getPixels(!0),"px"):"",x.getString(),YK.parse(w.getString(),t.font));_.setValue(T.fontStyle),O.setValue(T.fontVariant),E.setValue(T.fontWeight),P.setValue(T.fontSize),x.setValue(T.fontFamily),t.font=T.toString(),P.isPixels()&&(this.document.emSize=P.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function(t){HW(KW(e.prototype),"clearContext",this).call(this,t),this.modifiedEmSizeStack&&this.document.popEmSize()}}])}(),$K=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="path",o.pathParser=null,o.pathParser=new XK(o.getAttribute("d").getString()),o}return YW(e,ZK),$W(e,[{key:"path",value:function(t){var e=this.pathParser,r=new QK;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case XK.MOVE_TO:this.pathM(t,r);break;case XK.LINE_TO:this.pathL(t,r);break;case XK.HORIZ_LINE_TO:this.pathH(t,r);break;case XK.VERT_LINE_TO:this.pathV(t,r);break;case XK.CURVE_TO:this.pathC(t,r);break;case XK.SMOOTH_CURVE_TO:this.pathS(t,r);break;case XK.QUAD_TO:this.pathQ(t,r);break;case XK.SMOOTH_QUAD_TO:this.pathT(t,r);break;case XK.ARC:this.pathA(t,r);break;case XK.CLOSE_PATH:this.pathZ(t,r)}return r}},{key:"getBoundingBox",value:function(t){return this.path()}},{key:"getMarkers",value:function(){var t=this.pathParser,e=t.getMarkerPoints(),r=t.getMarkerAngles();return e.map(function(t,e){return[t,r[e]]})}},{key:"renderChildren",value:function(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==e.getString("inherit")?t.fill(e.getString()):t.fill()),""!==t.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());var r=this.getMarkers();if(r){var n=r.length-1,o=this.getStyle("marker-start"),i=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(o.isUrlDefinition()){var s=o.getDefinition(),u=eK(r[0],2),l=u[0],c=u[1];s.render(t,l,c)}if(i.isUrlDefinition())for(var f=i.getDefinition(),p=1;ps?a:s,m=a>s?1:a/s,b=a>s?s/a:1;t.translate(c.x,c.y),t.rotate(l),t.scale(m,b),t.arc(0,0,v,f,f+p,Boolean(1-u)),t.scale(1/m,1/b),t.rotate(-l),t.translate(-c.x,-c.y)}}},{key:"pathZ",value:function(t,r){e.pathZ(this.pathParser),t&&r.x1!==r.x2&&r.y1!==r.y2&&t.closePath()}}],[{key:"pathM",value:function(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}},{key:"pathL",value:function(t){return{current:t.current,point:t.getAsCurrentPoint()}}},{key:"pathH",value:function(t){var e=t.current,r=t.command,n=new AK((r.relative?e.x:0)+r.x,e.y);return t.current=n,{current:e,point:n}}},{key:"pathV",value:function(t){var e=t.current,r=t.command,n=new AK(e.x,(r.relative?e.y:0)+r.y);return t.current=n,{current:e,point:n}}},{key:"pathC",value:function(t){return{current:t.current,point:t.getPoint("x1","y1"),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathS",value:function(t){return{current:t.current,point:t.getReflectedControlPoint(),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathQ",value:function(t){return{current:t.current,controlPoint:t.getAsControlPoint("x1","y1"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathT",value:function(t){var e=t.current,r=t.getReflectedControlPoint();return t.control=r,{current:e,controlPoint:r,currentPoint:t.getAsCurrentPoint()}}},{key:"pathA",value:function(t){var e=t.current,r=t.command,n=r.rX,o=r.rY,i=r.xRot,a=r.lArcFlag,s=r.sweepFlag,u=i*(Math.PI/180),l=t.getAsCurrentPoint(),c=new AK(Math.cos(u)*(e.x-l.x)/2+Math.sin(u)*(e.y-l.y)/2,-Math.sin(u)*(e.x-l.x)/2+Math.cos(u)*(e.y-l.y)/2),f=Math.pow(c.x,2)/Math.pow(n,2)+Math.pow(c.y,2)/Math.pow(o,2);f>1&&(n*=Math.sqrt(f),o*=Math.sqrt(f));var p=(a===s?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(o,2)-Math.pow(n,2)*Math.pow(c.y,2)-Math.pow(o,2)*Math.pow(c.x,2))/(Math.pow(n,2)*Math.pow(c.y,2)+Math.pow(o,2)*Math.pow(c.x,2)));isNaN(p)&&(p=0);var h=new AK(p*n*c.y/o,p*-o*c.x/n),y=new AK((e.x+l.x)/2+Math.cos(u)*h.x-Math.sin(u)*h.y,(e.y+l.y)/2+Math.sin(u)*h.x+Math.cos(u)*h.y),d=SK([1,0],[(c.x-h.x)/n,(c.y-h.y)/o]),v=[(c.x-h.x)/n,(c.y-h.y)/o],m=[(-c.x-h.x)/n,(-c.y-h.y)/o],b=SK(v,m);return gK(v,m)<=-1&&(b=Math.PI),gK(v,m)>=1&&(b=0),{currentPoint:l,rX:n,rY:o,sweepFlag:s,xAxisRotation:u,centp:y,a1:d,ad:b}}},{key:"pathZ",value:function(t){t.current=t.start}}])}(),tY=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="glyph",o.horizAdvX=o.getAttribute("horiz-adv-x").getNumber(),o.unicode=o.getAttribute("unicode").getString(),o.arabicForm=o.getAttribute("arabic-form").getString(),o}return YW(e,$K),$W(e)}(),eY=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,(this instanceof e?this.constructor:void 0)===e||n])).type="text",o.x=0,o.y=0,o.measureCache=-1,o}return YW(e,ZK),$W(e,[{key:"setContext",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];HW(KW(e.prototype),"setContext",this).call(this,t,r);var n=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();n&&(t.textBaseline=n)}},{key:"initializeCoordinates",value:function(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}},{key:"getBoundingBox",value:function(t){var e=this;if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var r=null;return this.children.forEach(function(n,o){var i=e.getChildBoundingBox(t,e,e,o);r?r.addBoundingBox(i):r=i}),r}},{key:"getFontSize",value:function(){var t=this.document,e=this.parent,r=YK.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(r)}},{key:"getTElementBoundingBox",value:function(t){var e=this.getFontSize();return new QK(this.x,this.y-e,this.x+this.measureText(t),this.y)}},{key:"getGlyph",value:function(t,e,r){var n=e[r],o=null;if(t.isArabic){var i=e.length,a=e[r-1],s=e[r+1],u="isolated";if((0===r||" "===a)&&r0&&" "!==a&&r0&&" "!==a&&(r===i-1||" "===s)&&(u="initial"),void 0!==t.glyphs[n]){var l=t.glyphs[n];o=l instanceof tY?l:l[u]}}else o=t.glyphs[n];return o||(o=t.missingGlyph),o}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(t){var e=t||this.node,r=Array.from(e.parentNode.childNodes),n=r.indexOf(e),o=r.length-1,i=iK(e.textContent||"");return 0===n&&(i=i.replace(/^[\n \t]+/,"")),n===o&&(i=function(t){return t.replace(/[\n \t]+$/,"")}(i)),i}},{key:"renderChildren",value:function(t){var e=this;if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach(function(r,n){e.renderChild(t,e,e,n)});var r=this.document.screen.mouse;r.isWorking()&&r.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}},{key:"renderTElementChildren",value:function(t){var e=this.document,r=this.parent,n=this.getText(),o=r.getStyle("font-family").getDefinition();if(o)for(var i=o.fontFace.unitsPerEm,a=YK.parse(e.ctx.font),s=r.getStyle("font-size").getNumber(a.fontSize),u=r.getStyle("font-style").getString(a.fontStyle),l=s/i,c=o.isRTL?n.split("").reverse().join(""):n,f=aK(r.getAttribute("dx").getString()),p=c.length,h=0;h=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),r=0;r="start"===e?t.x-this.minX:"end"===e?t.x-this.maxX:t.x-(this.minX+this.maxX)/2;for(var n=this.textChunkStart;n0?o.children.forEach(function(r,n){e.adjustChildCoordinatesRecursiveCore(t,e,o,n)}):this.adjustChildCoordinates(t,e,r,n)}},{key:"adjustChildCoordinates",value:function(t,e,r,n){var o=r.children[n];if("function"!=typeof o.measureText)return o;t.save(),o.setContext(t,!0);var i=o.getAttribute("x"),a=o.getAttribute("y"),s=o.getAttribute("dx"),u=o.getAttribute("dy"),l=o.getStyle("font-family").getDefinition(),c=Boolean(l)&&l.isRTL;0===n&&(i.hasValue()||i.setValue(o.getInheritedAttribute("x")),a.hasValue()||a.setValue(o.getInheritedAttribute("y")),s.hasValue()||s.setValue(o.getInheritedAttribute("dx")),u.hasValue()||u.setValue(o.getInheritedAttribute("dy")));var f=o.measureText(t);return c&&(e.x-=f),i.hasValue()?(e.applyAnchoring(),o.x=i.getPixels("x"),s.hasValue()&&(o.x+=s.getPixels("x"))):(s.hasValue()&&(e.x+=s.getPixels("x")),o.x=e.x),e.x=o.x,c||(e.x+=f),a.hasValue()?(o.y=a.getPixels("y"),u.hasValue()&&(o.y+=u.getPixels("y"))):(u.hasValue()&&(e.y+=u.getPixels("y")),o.y=e.y),e.y=o.y,e.leafTexts.push(o),e.minX=Math.min(e.minX,o.x,o.x+f),e.maxX=Math.max(e.maxX,o.x,o.x+f),o.clearContext(t),t.restore(),o}},{key:"getChildBoundingBox",value:function(t,e,r,n){var o=r.children[n];if("function"!=typeof o.getBoundingBox)return null;var i=o.getBoundingBox(t);return i?(o.children.forEach(function(r,n){var a=e.getChildBoundingBox(t,e,o,n);i.addBoundingBox(a)}),i):null}},{key:"renderChild",value:function(t,e,r,n){var o=r.children[n];o.render(t),o.children.forEach(function(r,n){e.renderChild(t,e,o,n)})}},{key:"measureText",value:function(t){var e=this.measureCache;if(~e)return e;var r=this.getText(),n=this.measureTargetText(t,r);return this.measureCache=n,n}},{key:"measureTargetText",value:function(t,e){if(!e.length)return 0;var r=this.parent,n=r.getStyle("font-family").getDefinition();if(n){for(var o=this.getFontSize(),i=n.isRTL?e.split("").reverse().join(""):e,a=aK(r.getAttribute("dx").getString()),s=i.length,u=0,l=0;l0?"":o.getTextFromNode(),o}return YW(e,eY),$W(e,[{key:"getText",value:function(){return this.text}}])}(),nY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="textNode",t}return YW(e,rY),$W(e)}(),oY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="svg",t.root=!1,t}return YW(e,ZK),$W(e,[{key:"setContext",value:function(t){var r,n=this.document,o=n.screen,i=n.window,a=t.canvas;if(o.setDefaults(t),a.style&&void 0!==t.font&&i&&void 0!==i.getComputedStyle){t.font=i.getComputedStyle(a).getPropertyValue("font");var s=new CK(n,"fontSize",YK.parse(t.font).fontSize);s.hasValue()&&(n.rootEmSize=s.getPixels("y"),n.emSize=n.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var u=o.viewPort,l=u.width,c=u.height;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var f=this.getAttribute("refX"),p=this.getAttribute("refY"),h=this.getAttribute("viewBox"),y=h.hasValue()?aK(h.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),v=0,m=0,b=0,g=0;y&&(v=y[0],m=y[1]),this.root||(l=this.getStyle("width").getPixels("x"),c=this.getStyle("height").getPixels("y"),"marker"===this.type&&(b=v,g=m,v=0,m=0)),o.viewPort.setCurrent(l,c),!this.node||this.parent&&"foreignObject"!==(null===(r=this.node.parentNode)||void 0===r?void 0:r.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),HW(KW(e.prototype),"setContext",this).call(this,t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),y&&(l=y[2],c=y[3]),n.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:o.viewPort.width,desiredWidth:l,height:o.viewPort.height,desiredHeight:c,minX:v,minY:m,refX:f.getValue(),refY:p.getValue(),clip:d,clipX:b,clipY:g}),y&&(o.viewPort.removeCurrent(),o.viewPort.setCurrent(l,c))}},{key:"clearContext",value:function(t){HW(KW(e.prototype),"clearContext",this).call(this,t),this.document.screen.viewPort.removeCurrent()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.getAttribute("width",!0),o=this.getAttribute("height",!0),i=this.getAttribute("viewBox"),a=this.getAttribute("style"),s=n.getNumber(0),u=o.getNumber(0);if(r)if("string"==typeof r)this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(t),o.setValue(e),i.hasValue()||i.setValue("0 0 ".concat(s||t," ").concat(u||e)),a.hasValue()){var c=this.getStyle("width"),f=this.getStyle("height");c.hasValue()&&c.setValue("".concat(t,"px")),f.hasValue()&&f.setValue("".concat(e,"px"))}}}])}(),iY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="rect",t}return YW(e,$K),$W(e,[{key:"path",value:function(t){var e=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),o=this.getStyle("height",!1,!0).getPixels("y"),i=this.getAttribute("rx"),a=this.getAttribute("ry"),s=i.getPixels("x"),u=a.getPixels("y");if(i.hasValue()&&!a.hasValue()&&(u=s),a.hasValue()&&!i.hasValue()&&(s=u),s=Math.min(s,n/2),u=Math.min(u,o/2),t){var l=(Math.sqrt(2)-1)/3*4;t.beginPath(),o>0&&n>0&&(t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.bezierCurveTo(e+n-s+l*s,r,e+n,r+u-l*u,e+n,r+u),t.lineTo(e+n,r+o-u),t.bezierCurveTo(e+n,r+o-u+l*u,e+n-s+l*s,r+o,e+n-s,r+o),t.lineTo(e+s,r+o),t.bezierCurveTo(e+s-l*s,r+o,e,r+o-u+l*u,e,r+o-u),t.lineTo(e,r+u),t.bezierCurveTo(e,r+u-l*u,e+s-l*s,r,e+s,r),t.closePath())}return new QK(e,r,e+n,r+o)}},{key:"getMarkers",value:function(){return null}}])}(),aY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="circle",t}return YW(e,$K),$W(e,[{key:"path",value:function(t){var e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return t&&n>0&&(t.beginPath(),t.arc(e,r,n,0,2*Math.PI,!1),t.closePath()),new QK(e-n,r-n,e+n,r+n)}},{key:"getMarkers",value:function(){return null}}])}(),sY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="ellipse",t}return YW(e,$K),$W(e,[{key:"path",value:function(t){var e=(Math.sqrt(2)-1)/3*4,r=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),o=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y");return t&&r>0&&n>0&&(t.beginPath(),t.moveTo(o+r,i),t.bezierCurveTo(o+r,i+e*n,o+e*r,i+n,o,i+n),t.bezierCurveTo(o-e*r,i+n,o-r,i+e*n,o-r,i),t.bezierCurveTo(o-r,i-e*n,o-e*r,i-n,o,i-n),t.bezierCurveTo(o+e*r,i-n,o+r,i-e*n,o+r,i),t.closePath()),new QK(o-r,i-n,o+r,i+n)}},{key:"getMarkers",value:function(){return null}}])}(),uY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="line",t}return YW(e,$K),$W(e,[{key:"getPoints",value:function(){return[new AK(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new AK(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function(t){var e=eK(this.getPoints(),2),r=e[0],n=r.x,o=r.y,i=e[1],a=i.x,s=i.y;return t&&(t.beginPath(),t.moveTo(n,o),t.lineTo(a,s)),new QK(n,o,a,s)}},{key:"getMarkers",value:function(){var t=eK(this.getPoints(),2),e=t[0],r=t[1],n=e.angleTo(r);return[[e,n],[r,n]]}}])}(),lY=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="polyline",o.points=[],o.points=AK.parsePath(o.getAttribute("points").getString()),o}return YW(e,$K),$W(e,[{key:"path",value:function(t){var e=this.points,r=eK(e,1)[0],n=r.x,o=r.y,i=new QK(n,o);return t&&(t.beginPath(),t.moveTo(n,o)),e.forEach(function(e){var r=e.x,n=e.y;i.addPoint(r,n),t&&t.lineTo(r,n)}),i}},{key:"getMarkers",value:function(){var t=this.points,e=t.length-1,r=[];return t.forEach(function(n,o){o!==e&&r.push([n,n.angleTo(t[o+1])])}),r.length>0&&r.push([t[t.length-1],r[r.length-1][1]]),r}}])}(),cY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="polygon",t}return YW(e,lY),$W(e,[{key:"path",value:function(t){var r=HW(KW(e.prototype),"path",this).call(this,t),n=eK(this.points,1)[0],o=n.x,i=n.y;return t&&(t.lineTo(o,i),t.closePath()),r}}])}(),fY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="pattern",t}return YW(e,JK),$W(e,[{key:"createPattern",value:function(t,e,r){var n=this.getStyle("width").getPixels("x",!0),o=this.getStyle("height").getPixels("y",!0),i=new oY(this.document,null);i.attributes.viewBox=new CK(this.document,"viewBox",this.getAttribute("viewBox").getValue()),i.attributes.width=new CK(this.document,"width","".concat(n,"px")),i.attributes.height=new CK(this.document,"height","".concat(o,"px")),i.attributes.transform=new CK(this.document,"transform",this.getAttribute("patternTransform").getValue()),i.children=this.children;var a=this.document.createCanvas(n,o),s=a.getContext("2d"),u=this.getAttribute("x"),l=this.getAttribute("y");u.hasValue()&&l.hasValue()&&s.translate(u.getPixels("x",!0),l.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var f=-1;f<=1;f++)s.save(),i.attributes.x=new CK(this.document,"x",c*a.width),i.attributes.y=new CK(this.document,"y",f*a.height),i.render(s),s.restore();return t.createPattern(a,"repeat")}}])}(),pY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="marker",t}return YW(e,JK),$W(e,[{key:"render",value:function(t,e,r){if(e){var n=e.x,o=e.y,i=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(n,o),"auto"===i&&t.rotate(r),"strokeWidth"===a&&t.scale(t.lineWidth,t.lineWidth),t.save();var s=new oY(this.document,null);s.type=this.type,s.attributes.viewBox=new CK(this.document,"viewBox",this.getAttribute("viewBox").getValue()),s.attributes.refX=new CK(this.document,"refX",this.getAttribute("refX").getValue()),s.attributes.refY=new CK(this.document,"refY",this.getAttribute("refY").getValue()),s.attributes.width=new CK(this.document,"width",this.getAttribute("markerWidth").getValue()),s.attributes.height=new CK(this.document,"height",this.getAttribute("markerHeight").getValue()),s.attributes.overflow=new CK(this.document,"overflow",this.getAttribute("overflow").getValue()),s.attributes.fill=new CK(this.document,"fill",this.getAttribute("fill").getColor("black")),s.attributes.stroke=new CK(this.document,"stroke",this.getAttribute("stroke").getValue("none")),s.children=this.children,s.render(t),t.restore(),"strokeWidth"===a&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===i&&t.rotate(-r),t.translate(-n,-o)}}}])}(),hY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="defs",t}return YW(e,JK),$W(e,[{key:"render",value:function(){}}])}(),yY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="g",t}return YW(e,ZK),$W(e,[{key:"getBoundingBox",value:function(t){var e=new QK;return this.children.forEach(function(r){e.addBoundingBox(r.getBoundingBox(t))}),e}}])}(),dY=function(t){function e(t,r,n){var o;XW(this,e),(o=JW(this,e,[t,r,n])).attributesToInherit=["gradientUnits"],o.stops=[];var i=o,a=i.stops;return i.children.forEach(function(t){"stop"===t.type&&a.push(t)}),o}return YW(e,JK),$W(e,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(t,e,r){var n=this,o=this;this.getHrefAttribute().hasValue()&&(o=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(o));var i=o.stops,a=this.getGradient(t,e);if(!a)return this.addParentOpacity(r,i[i.length-1].color);if(i.forEach(function(t){a.addColorStop(t.offset,n.addParentOpacity(r,t.color))}),this.getAttribute("gradientTransform").hasValue()){var s=this.document,u=s.screen,l=u.MAX_VIRTUAL_PIXELS,c=eK(u.viewPort.viewPorts,1)[0],f=new iY(s,null);f.attributes.x=new CK(s,"x",-l/3),f.attributes.y=new CK(s,"y",-l/3),f.attributes.width=new CK(s,"width",l),f.attributes.height=new CK(s,"height",l);var p=new yY(s,null);p.attributes.transform=new CK(s,"transform",this.getAttribute("gradientTransform").getValue()),p.children=[f];var h=new oY(s,null);h.attributes.x=new CK(s,"x",0),h.attributes.y=new CK(s,"y",0),h.attributes.width=new CK(s,"width",c.width),h.attributes.height=new CK(s,"height",c.height),h.children=[p];var y=s.createCanvas(c.width,c.height),d=y.getContext("2d");return d.fillStyle=a,h.render(d),d.createPattern(y,"no-repeat")}return a}},{key:"inheritStopContainer",value:function(t){var e=this;this.attributesToInherit.forEach(function(r){!e.getAttribute(r).hasValue()&&t.getAttribute(r).hasValue()&&e.getAttribute(r,!0).setValue(t.getAttribute(r).getValue())})}},{key:"addParentOpacity",value:function(t,e){return t.hasValue()?new CK(this.document,"color",e).addOpacity(t).getColor():e}}])}(),vY=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="linearGradient",o.attributesToInherit.push("x1","y1","x2","y2"),o}return YW(e,dY),$W(e,[{key:"getGradient",value:function(t,e){var r="objectBoundingBox"===this.getGradientUnits(),n=r?e.getBoundingBox(t):null;if(r&&!n)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var o=r?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),i=r?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),a=r?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),s=r?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return o===a&&i===s?null:t.createLinearGradient(o,i,a,s)}}])}(),mY=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="radialGradient",o.attributesToInherit.push("cx","cy","r","fx","fy","fr"),o}return YW(e,dY),$W(e,[{key:"getGradient",value:function(t,e){var r="objectBoundingBox"===this.getGradientUnits(),n=e.getBoundingBox(t);if(r&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var o=r?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),i=r?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),a=o,s=i;this.getAttribute("fx").hasValue()&&(a=r?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(s=r?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=r?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),l=this.getAttribute("fr").getPixels();return t.createRadialGradient(a,s,l,o,i,u)}}])}(),bY=function(t){function e(t,r,n){var o;XW(this,e),(o=JW(this,e,[t,r,n])).type="stop";var i=Math.max(0,Math.min(1,o.getAttribute("offset").getNumber())),a=o.getStyle("stop-opacity"),s=o.getStyle("stop-color",!0);return""===s.getString()&&s.setValue("#000"),a.hasValue()&&(s=s.addOpacity(a)),o.offset=i,o.color=s.getColor(),o}return YW(e,JK),$W(e)}(),gY=function(t){function e(t,r,n){var o;XW(this,e),(o=JW(this,e,[t,r,n])).type="animate",o.duration=0,o.initialValue=null,o.initialUnits="",o.removed=!1,o.frozen=!1,t.screen.animations.push(o),o.begin=o.getAttribute("begin").getMilliseconds(),o.maxDuration=o.begin+o.getAttribute("dur").getMilliseconds(),o.from=o.getAttribute("from"),o.to=o.getAttribute("to"),o.values=new CK(t,"values",null);var i=o.getAttribute("values");return i.hasValue()&&o.values.setValue(i.getString().split(";")),o}return YW(e,JK),$W(e,[{key:"getProperty",value:function(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}},{key:"calcValue",value:function(){var t=this.initialUnits,e=this.getProgress(),r=e.progress,n=e.from,o=e.to,i=n.getNumber()+(o.getNumber()-n.getNumber())*r;return"%"===t&&(i*=100),"".concat(i).concat(t)}},{key:"update",value:function(t){var e=this.parent,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==n||this.frozen){if("remove"===n&&!this.removed)return this.removed=!0,r.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=r.getString();return!1}this.duration+=t;var o=!1;if(this.begin0&&Array.from(i).every(function(t){return 3===t.nodeType});return o.hasText=s,o.text=s?o.getTextFromNode(a):"",o}return YW(e,eY),$W(e,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(t){if(this.hasText){HW(KW(e.prototype),"renderChildren",this).call(this,t);var r=this.document,n=this.x,o=this.y,i=r.screen.mouse,a=new CK(r,"fontSize",YK.parse(r.ctx.font).fontSize);i.isWorking()&&i.checkBoundingBox(this,new QK(n,o-a.getPixels("y"),n+this.measureText(t),o))}else if(this.children.length>0){var s=new yY(this.document,null);s.children=this.children,s.parent=this,s.render(t)}}},{key:"onClick",value:function(){var t=this.document.window;t&&t.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}])}();function TY(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function CY(t){for(var e=1;eu?s:u,y=s>u?1:s/u,d=s>u?u/s:1;t&&(t.translate(i,a),t.rotate(f),t.scale(y,d),t.arc(0,0,h,l,l+c,Boolean(1-p)),t.scale(1/y,1/d),t.rotate(-f),t.translate(-i,-a));break;case XK.CLOSE_PATH:t&&t.closePath()}})}},{key:"renderChildren",value:function(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),n=this.glyphInfo,o=t.fillStyle;"underline"===e&&t.beginPath(),n.forEach(function(n,o){var i=n.p0,a=n.p1,s=n.rotation,u=n.text;t.save(),t.translate(i.x,i.y),t.rotate(s),t.fillStyle&&t.fillText(u,0,0),t.strokeStyle&&t.strokeText(u,0,0),t.restore(),"underline"===e&&(0===o&&t.moveTo(i.x,i.y+r/8),t.lineTo(a.x,a.y+r/5))}),"underline"===e&&(t.lineWidth=r/20,t.strokeStyle=o,t.stroke(),t.closePath()),t.restore()}},{key:"getLetterSpacingAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}},{key:"findSegmentToFitChar",value:function(t,e,r,n,o,i,a,s,u){var l=i,c=this.measureText(t,s);" "===s&&"justify"===e&&r-1&&(l+=this.getLetterSpacingAt(u));var f=this.textHeight/20,p=this.getEquidistantPointOnPath(l,f,0),h=this.getEquidistantPointOnPath(l+c,f,0),y={p0:p,p1:h},d=p&&h?Math.atan2(h.y-p.y,h.x-p.x):0;if(a){var v=Math.cos(Math.PI/2+d)*a,m=Math.cos(-d)*a;y.p0=CY(CY({},p),{},{x:p.x+v,y:p.y+m}),y.p1=CY(CY({},h),{},{x:h.x+v,y:h.y+m})}return{offset:l+=c,segment:y,rotation:d}}},{key:"measureText",value:function(t,e){var r=this.measuresCache,n=e||this.getText();if(r.has(n))return r.get(n);var o=this.measureTargetText(t,n);return r.set(n,o),o}},{key:"setTextData",value:function(t){var e=this;if(!this.glyphInfo){var r=this.getText(),n=r.split(""),o=r.split(" ").length-1,i=this.parent.getAttribute("dx").split().map(function(t){return t.getPixels("x")}),a=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),c=0;u.hasValue()&&"inherit"!==u.getValue()?u.hasValue()&&"initial"!==u.getValue()&&"unset"!==u.getValue()&&(c=u.getPixels()):c=l.getPixels();var f=[],p=r.length;this.letterSpacingCache=f;for(var h=0;h0&&(u-=2*Math.PI),1===o&&u<0&&(u+=2*Math.PI),[a.x,a.y,r,n,s,u,i,o]}},{key:"calcLength",value:function(t,e,r,n){var o=0,i=null,a=null,s=0;switch(r){case XK.LINE_TO:return this.getLineLength(t,e,n[0],n[1]);case XK.CURVE_TO:for(o=0,i=this.getPointOnCubicBezier(0,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),s=.01;s<=1;s+=.01)a=this.getPointOnCubicBezier(s,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),o+=this.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case XK.QUAD_TO:for(o=0,i=this.getPointOnQuadraticBezier(0,t,e,n[0],n[1],n[2],n[3]),s=.01;s<=1;s+=.01)a=this.getPointOnQuadraticBezier(s,t,e,n[0],n[1],n[2],n[3]),o+=this.getLineLength(i.x,i.y,a.x,a.y),i=a;return o;case XK.ARC:o=0;var u=n[4],l=n[5],c=n[4]+l,f=Math.PI/180;if(Math.abs(u-c)c;s-=f)a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],s,0),o+=this.getLineLength(i.x,i.y,a.x,a.y),i=a;else for(s=u+f;s5&&void 0!==arguments[5]?arguments[5]:e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:r,s=(o-r)/(n-e+mK),u=Math.sqrt(t*t/(1+s*s));ne)return null;var o,i=zW(this.dataArray);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(!a||!(a.pathLength<5e-5||r+a.pathLength+5e-5=0&&u>f)break;n=this.getPointOnEllipticalArc(a.points[0],a.points[1],a.points[2],a.points[3],u,a.points[6]);break;case XK.CURVE_TO:(u=s/a.pathLength)>1&&(u=1),n=this.getPointOnCubicBezier(u,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]);break;case XK.QUAD_TO:(u=s/a.pathLength)>1&&(u=1),n=this.getPointOnQuadraticBezier(u,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3])}if(n)return n;break}r+=a.pathLength}}catch(t){i.e(t)}finally{i.f()}return null}},{key:"getLineLength",value:function(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-e))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce(function(t,e){return e.pathLength>0?t+e.pathLength:t},0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(t,e,r,n,o,i,a,s,u){return{x:s*wK(t)+i*_K(t)+n*OK(t)+e*EK(t),y:u*wK(t)+a*_K(t)+o*OK(t)+r*EK(t)}}},{key:"getPointOnQuadraticBezier",value:function(t,e,r,n,o,i,a){return{x:i*PK(t)+n*xK(t)+e*TK(t),y:a*PK(t)+o*xK(t)+r*TK(t)}}},{key:"getPointOnEllipticalArc",value:function(t,e,r,n,o,i){var a=Math.cos(i),s=Math.sin(i),u=r*Math.cos(o),l=n*Math.sin(o);return{x:t+(u*a-l*s),y:e+(u*s+l*a)}}},{key:"buildEquidistantCache",value:function(t,e){var r=this.getPathLength(),n=e||.25,o=t||r/100;if(!this.equidistantCache||this.equidistantCache.step!==o||this.equidistantCache.precision!==n){this.equidistantCache={step:o,precision:n,points:[]};for(var i=0,a=0;a<=r;a+=n){var s=this.getPointOnPath(a),u=this.getPointOnPath(a+n);s&&u&&((i+=this.getLineLength(s.x,s.y,u.x,u.y))>=o&&(this.equidistantCache.points.push({x:s.x,y:s.y,distance:a}),i-=o))}}}},{key:"getEquidistantPointOnPath",value:function(t,e,r){if(this.buildEquidistantCache(e,r),t<0||t-this.getPathLength()>5e-5)return null;var n=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}])}(),AY=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,jY=function(t){function e(t,r,n){var o;XW(this,e),(o=JW(this,e,[t,r,n])).type="image",o.loaded=!1;var i=o.getHrefAttribute().getString();if(!i)return WW(o);var a=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);return t.images.push(o),a?o.loadSvg(i):o.loadImage(i),o.isSvg=a,o}return YW(e,ZK),$W(e,[{key:"loadImage",value:function(t){var e=this;return lW(oK().mark(function r(){var n;return oK().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e.document.createImage(t);case 3:n=r.sent,e.image=n,r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.error('Error while loading image "'.concat(t,'":'),r.t0);case 10:e.loaded=!0;case 11:case"end":return r.stop()}},r,null,[[0,7]])}))()}},{key:"loadSvg",value:function(t){var e=this;return lW(oK().mark(function r(){var n,o,i,a;return oK().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(n=AY.exec(t))){r.next=6;break}o=n[5],"base64"===n[4]?e.image=atob(o):e.image=decodeURIComponent(o),r.next=19;break;case 6:return r.prev=6,r.next=9,e.document.fetch(t);case 9:return i=r.sent,r.next=12,i.text();case 12:a=r.sent,e.image=a,r.next=19;break;case 16:r.prev=16,r.t0=r.catch(6),console.error('Error while loading image "'.concat(t,'":'),r.t0);case 19:e.loaded=!0;case 20:case"end":return r.stop()}},r,null,[[6,16]])}))()}},{key:"renderChildren",value:function(t){var e=this.document,r=this.image,n=this.loaded,o=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),a=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(n&&r&&a&&s){if(t.save(),t.translate(o,i),this.isSvg){var u=e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:a,scaleHeight:s});u.document.documentElement.parent=this,u.render()}else{var l=this.image;e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:a,desiredWidth:l.width,height:s,desiredHeight:l.height}),this.loaded&&(void 0===l.complete||l.complete)&&t.drawImage(l,0,0)}t.restore()}}},{key:"getBoundingBox",value:function(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new QK(t,e,t+r,e+n)}}])}(),NY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="symbol",t}return YW(e,ZK),$W(e,[{key:"render",value:function(t){}}])}(),IY=function(){return $W(function t(e){XW(this,t),this.document=e,this.loaded=!1,e.fonts.push(this)},[{key:"load",value:function(t,e){var r=this;return lW(oK().mark(function n(){var o,i,a;return oK().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=r.document,n.next=4,o.canvg.parser.load(e);case 4:i=n.sent,a=i.getElementsByTagName("font"),Array.from(a).forEach(function(e){var r=o.createElement(e);o.definitions[t]=r}),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(0),console.error('Error while loading font "'.concat(e,'":'),n.t0);case 12:r.loaded=!0;case 13:case"end":return n.stop()}},n,null,[[0,9]])}))()}}])}(),MY=function(t){function e(t,r,n){var o;return XW(this,e),(o=JW(this,e,[t,r,n])).type="style",iK(Array.from(r.childNodes).map(function(t){return t.textContent}).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(function(e){var r=e.trim();if(r){var n=r.split("{"),o=n[0].split(","),i=n[1].split(";");o.forEach(function(e){var r=e.trim();if(r){var n=t.styles[r]||{};if(i.forEach(function(e){var r=e.indexOf(":"),o=e.substr(0,r).trim(),i=e.substr(r+1,e.length-r).trim();o&&i&&(n[o]=new CK(t,o,i))}),t.styles[r]=n,t.stylesSpecificity[r]=function(t){var e=[0,0,0],r=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),n=0,o=eK(vK(r,lK),2);r=o[0],n=o[1],e[1]+=n;var i=eK(vK(r,cK),2);r=i[0],n=i[1],e[0]+=n;var a=eK(vK(r,fK),2);r=a[0],n=a[1],e[1]+=n;var s=eK(vK(r,pK),2);r=s[0],n=s[1],e[2]+=n;var u=eK(vK(r,hK),2);r=u[0],n=u[1],e[1]+=n;var l=eK(vK(r,yK),2);r=l[0],n=l[1],e[1]+=n;var c=eK(vK(r=r.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),dK),2);return r=c[0],n=c[1],e[2]+=n,e.join("")}(r),"@font-face"===r){var o=n["font-family"].getString().replace(/"|'/g,"");n.src.getString().split(",").forEach(function(e){if(e.indexOf('format("svg")')>0){var r=uK(e);r&&new IY(t).load(o,r)}})}}})}}),o}return YW(e,JK),$W(e)}();MY.parseExternalUrl=uK;var RY=function(t){function e(){var t;return XW(this,e),(t=JW(this,e,arguments)).type="use",t}return YW(e,ZK),$W(e,[{key:"setContext",value:function(t){HW(KW(e.prototype),"setContext",this).call(this,t);var r=this.getAttribute("x"),n=this.getAttribute("y");r.hasValue()&&t.translate(r.getPixels("x"),0),n.hasValue()&&t.translate(0,n.getPixels("y"))}},{key:"path",value:function(t){var e=this.element;e&&e.path(t)}},{key:"renderChildren",value:function(t){var e=this.document,r=this.element;if(r){var n=r;if("symbol"===r.type&&((n=new oY(e,null)).attributes.viewBox=new CK(e,"viewBox",r.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new CK(e,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new CK(e,"overflow",r.getAttribute("overflow").getString()),n.children=r.children,r.styles.opacity=new CK(e,"opacity",this.calculateOpacity())),"svg"===n.type){var o=this.getStyle("width",!1,!0),i=this.getStyle("height",!1,!0);o.hasValue()&&(n.attributes.width=new CK(e,"width",o.getString())),i.hasValue()&&(n.attributes.height=new CK(e,"height",i.getString()))}var a=n.parent;n.parent=this,n.render(t),n.parent=a}}},{key:"getBoundingBox",value:function(t){var e=this.element;return e?e.getBoundingBox(t):null}},{key:"elementTransform",value:function(){var t=this.document,e=this.element;return qK.fromElement(t,e)}},{key:"element",get:function(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}])}();function LY(t,e,r,n,o,i){return t[r*n*4+4*e+i]}function DY(t,e,r,n,o,i,a){t[r*n*4+4*e+i]=a}function BY(t,e,r){return t[e]*r}function FY(t,e,r,n){return e+Math.cos(t)*r+Math.sin(t)*n}var UY=function(t){function e(t,r,n){var o;XW(this,e),(o=JW(this,e,[t,r,n])).type="feColorMatrix";var i=aK(o.getAttribute("values").getString());switch(o.getAttribute("type").getString("matrix")){case"saturate":var a=i[0];i=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var s=i[0]*Math.PI/180;i=[FY(s,.213,.787,-.213),FY(s,.715,-.715,-.715),FY(s,.072,-.072,.928),0,0,FY(s,.213,-.213,.143),FY(s,.715,.285,.14),FY(s,.072,-.072,-.283),0,0,FY(s,.213,-.213,-.787),FY(s,.715,-.715,.715),FY(s,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return o.matrix=i,o.includeOpacity=o.getAttribute("includeOpacity").hasValue(),o}return YW(e,JK),$W(e,[{key:"apply",value:function(t,e,r,n,o){for(var i=this.includeOpacity,a=this.matrix,s=t.getImageData(0,0,n,o),u=0;u1&&void 0!==o[1]&&o[1],n=document.createElement("img"),r&&(n.crossOrigin="Anonymous"),t.abrupt("return",new Promise(function(t,r){n.onload=function(){t(n)},n.onerror=function(t,e,n,o,i){r(i)},n.src=e}));case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}var KY=function(){function t(e){XW(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.rootEmSize,o=void 0===n?12:n,i=r.emSize,a=void 0===i?12:i,s=r.createCanvas,u=void 0===s?t.createCanvas:s,l=r.createImage,c=void 0===l?t.createImage:l,f=r.anonymousCrossOrigin;this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=o,this.emSize=a,this.createCanvas=u,this.createImage=this.bindCreateImage(c,f),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}return $W(t,[{key:"bindCreateImage",value:function(t,e){return"boolean"==typeof e?function(r,n){return t(r,"boolean"==typeof n?n:e)}:t}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var t=this.emSizeStack;return t[t.length-1]},set:function(t){this.emSizeStack.push(t)}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every(function(t){return t.loaded})}},{key:"isFontsLoaded",value:function(){return this.fonts.every(function(t){return t.loaded})}},{key:"createDocumentElement",value:function(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}},{key:"createElement",value:function(e){var r=e.nodeName.replace(/^[^:]+:/,""),n=t.elementTypes[r];return void 0!==n?new n(this,e):new WK(this,e)}},{key:"createTextNode",value:function(t){return new nY(this,t)}},{key:"setViewBox",value:function(t){this.screen.setViewBox(function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new DK(n),this.screen=new MK(e,n),this.options=n;var o=new KY(this,n),i=o.createDocumentElement(r);this.document=o,this.documentElement=i}return $W(t,[{key:"fork",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.from(e,r,QY(QY({},this.options),n))}},{key:"forkString",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.fromString(e,r,QY(QY({},this.options),n))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:function(){var t=arguments,e=this;return lW(oK().mark(function r(){var n;return oK().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.length>0&&void 0!==t[0]?t[0]:{},e.start(QY({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},n)),r.next=4,e.ready();case 4:e.stop();case 5:case"end":return r.stop()}},r)}))()}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.documentElement,r=this.screen,n=this.options;r.start(e,QY(QY({enableRedraw:!0},n),t))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,e,r)}}],[{key:"from",value:function(e,r){var n=arguments;return lW(oK().mark(function o(){var i,a,s;return oK().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return i=n.length>2&&void 0!==n[2]?n[2]:{},a=new DK(i),o.next=4,a.parse(r);case 4:return s=o.sent,o.abrupt("return",new t(e,s,i));case 6:case"end":return o.stop()}},o)}))()}},{key:"fromString",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new t(e,new DK(n).parseFromString(r),n)}}])}();function ZY(t,e,r){if(null!==t)for(var n,o,i,a,s,u,l,c,f=0,p=0,h=t.type,y="FeatureCollection"===h,d="Feature"===h,v=y?t.features.length:1,m=0;mt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function uQ(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function lQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){uQ(i,n,o,a,s,"next",t)}function s(t){uQ(i,n,o,a,s,"throw",t)}a(void 0)})}}function cQ(t){"@babel/helpers - typeof";return(cQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fQ(t,e){for(var r=0;r-1&&(t.iportalServiceProxyUrl="")),e(o)}else r("serviceProxyFailed")}).catch(function(t){r(t)})})}},{key:"getLayerFeatures",value:function(t,e,r){var n;switch(t){case"hosted":n=this._getFeaturesFromHosted(e,r);break;case"rest_data":n=this._getFeaturesFromRestData(e,r);break;case"rest_map":n=this._getFeaturesFromRestMap(e);break;case"dataflow":n=this._getFeaturesFromDataflow(e);break;case"user_data":n=this._getFeaturesFromUserData(e)}return n}},{key:"getWmsInfo",value:function(t){var e=this;return new Promise(function(r){var n=e.handleProxy(),o=Tt.urlAppend(t.url,"REQUEST=GetCapabilities&SERVICE=WMS");co.get(o,null,{withCredentials:e.handleWithCredentials(n,t.url,!1),withoutFormatSuffix:!0,proxy:n}).then(function(t){return t.text()}).then(function(t){var e=(new eQ.XMLParser).parse(t),n=e.WMT_MS_Capabilities||e.WMS_Capabilities;r({version:n._attributes.version})})})}},{key:"getMapBoxStyle",value:function(t){return new Promise(function(e,r){co.get(t).then(function(t){return t.json()}).then(function(t){e(t)}).catch(function(t){r(t)})})}},{key:"getWmtsInfo",value:function(t,e){var r=this;return new Promise(function(n,o){var i,a=!1,s=22,u=0,l="",c="",f="",p=r.handleProxy(),h=Tt.urlAppend(t.url,"REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0");h=r.handleParentRes(h),co.get(h,null,{withCredentials:r.handleWithCredentials(p,t.url,!1),withoutFormatSuffix:!0,proxy:p}).then(function(t){return t.text()}).then(function(o){var p=["Layer","TileMatrixSet","ows:Operation","ows:Get","ResourceURL","Style"],h=new eQ.XMLParser({isArray:function(t){if(-1!==p.indexOf(t))return!0}}).parse(o).Capabilities,y=h.Contents,d=h["ows:OperationsMetadata"];if(d){var v=d["ows:Operation"];Array.isArray(v)||(v=[v]);var m=v.find(function(t){return"GetTile"===t._attributes.name});if(m){var b=m["ows:DCP"]["ows:HTTP"]["ows:Get"];Array.isArray(b)||(b=[b]);var g=b.find(function(t){return"KVP"===t["ows:Constraint"]["ows:AllowedValues"]["ows:Value"]._text});g&&(f=g._attributes["xlink:href"])}}for(var S=y.TileMatrixSet,w=0;w0)break}var j=Object.keys(_).map(function(t){return+t});if(s=j.length>0?Math.max.apply(Math,iQ(j)):void 0,u=j.length>0?Math.min.apply(Math,iQ(j)):void 0,0===j.length)throw Error("TileMatrixSetNotSuppport");a=!0}break}var N=y.Layer.find(function(e){return e["ows:Identifier"]._text===t.layer});if(N){var I=N.Style;if(l=Array.isArray(N.Style)?I[0]["ows:Identifier"]?I[0]["ows:Identifier"]._text:"":I["ows:Identifier"]?I["ows:Identifier"]._text:"",N["ows:WGS84BoundingBox"]){var M=N["ows:WGS84BoundingBox"]["ows:LowerCorner"]._text.split(" "),R=N["ows:WGS84BoundingBox"]["ows:UpperCorner"]._text.split(" ");i=[parseFloat(M[0]),parseFloat(M[1]),parseFloat(R[0]),parseFloat(R[1])]}var L=N.ResourceURL;Array.isArray(L)||(L=[L]);var D=L.find(function(t){return"tile"===t._attributes.resourceType});D&&(c=D._attributes.template)}n({isMatched:a,matchMaxZoom:s,matchMinZoom:u,style:l,bounds:i,restResourceURL:c,kvpResourceUrl:f})}).catch(function(t){o(t)})})}},{key:"_getFeaturesFromHosted",value:function(t,e){var r=t.dataSource,n=t.layerType,o=r?r.serverId:t.serverId;return o?"MARKER"===n||r&&(!r.accessType||"DIRECT"===r.accessType)?this._getDataFromIportal(o,t):this._getDataFromHosted({layer:t,serverId:o,baseProjection:e}):new Promise(function(t){t({type:"noServerId"})})}},{key:"_getFeaturesFromRestData",value:function(t,e){var r,n=this,o=t.dataSource;return new Promise(function(i,a){n._getFeatureBySQL(o.url,[decodeURIComponent(o.dataSourceName)||t.name],function(t){r=n.parseGeoJsonData2Feature({allDatas:{features:t.result.features.features}}),i({type:"feature",features:r})},function(t){a(t)},e)})}},{key:"_getFeaturesFromRestMap",value:function(t){var e=this;return new Promise(function(r,n){e._queryFeatureBySQL(t.dataSource.url,t.dataSource.layerName,function(o){var i=o&&o.result.recordsets,a=i&&i[0],s=a.fields;if(a&&s){var u=[];for(var l in s){var c=s[l];0===c.indexOf("Sm")&&"SmID"!==c||u.push(c)}e._getFeatures(u,t,function(t){r({type:"feature",features:t})},function(t){n(t)})}},function(t){n(t)},"smid=1")})}},{key:"_getFeaturesFromUserData",value:function(t){var e=this,r=t.dataSource;return new Promise(function(t,n){var o=e.handleProxy(),i=e.handleParentRes(r.url);co.get(i,null,{withCredentials:e.handleWithCredentials(o,i,e.withCredentials),proxy:o,withoutFormatSuffix:!0}).then(function(t){return t.json()}).then(function(r){var n;n=r&&r instanceof Object&&"FeatureCollection"===r.type?r.features:r,n=e.parseGeoJsonData2Feature({allDatas:{features:n}}),t({type:"feature",features:n})}).catch(function(t){n(t)})})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,o,i,a,s,u,l){var c=this._getQueryFeaturesParam(e,o,i,a,s,u,l),f=this.handleProxy(),p=this.handleParentRes(t);new QP(p,{proxy:f,withCredentials:this.handleWithCredentials(f,t,!1),eventListeners:{processCompleted:function(t){r&&r(t)},processFailed:function(t){n&&n(t)}}}).processAsync(c)}},{key:"_getFeatures",value:function(t,e,r,n){var o=this,i=e.dataSource;this._queryFeatureBySQL(i.url,i.layerName,function(t){var e=t.result.recordsets[0].features.features,n=o.parseGeoJsonData2Feature({allDatas:{features:e}});r(n)},function(t){n(t)},null,t)}},{key:"_getQueryFeaturesParam",value:function(t,e,r,n,o,i,a){var u=new gs({name:t,attributeFilter:e});r&&(u.fields=r);var l={queryParams:[u]};return a&&(l.queryOption=s.ATTRIBUTE),o&&(l.startRecord=o),i&&(l.expectCount=i),n&&(l.prjCoordSys={epsgCode:n}),new VP(l)}},{key:"_getFeaturesFromDataflow",value:function(t){var e=this;return new Promise(function(r,n){e._getDataflowInfo(t,function(){r({type:"dataflow"})},function(t){n(t)})})}},{key:"_getDataflowInfo",value:function(t,e,r){var n,o=t.url,i="".concat(o,".json");t.credential&&t.credential.token&&(n=t.credential.token,i+="?token=".concat(n));var a=this.handleProxy();i=this.handleParentRes(i),co.get(i,null,{proxy:a,withCredentials:this.handleWithCredentials(a,i,!1)}).then(function(t){return t.json()}).then(function(n){n?(n.featureMetaData&&(t.featureType=n.featureMetaData.featureType.toUpperCase(),t.dataSource={dataTypes:{}},n.featureMetaData.fieldInfos&&n.featureMetaData.fieldInfos.length>0&&n.featureMetaData.fieldInfos.forEach(function(e){var r=e.name.trim();"TEXT"===e.type?t.dataSource.dataTypes[r]="STRING":["DOUBLE","INT","FLOAT","LONG","SHORT"].includes(e.type)?t.dataSource.dataTypes[r]="NUMBER":t.dataSource.dataTypes[r]="UNKNOWN"})),t.wsUrl=n.urls[0].url,t.name=n.urls[0].url.split("iserver/services/")[1].split("/dataflow")[0],e()):r()}).catch(function(){r()})}},{key:"getDatasourceType",value:function(t){var e,r=t.dataSource,n=t.layerType;return r&&"SAMPLE_DATA"===r.type?r.type:(r&&r.serverId||"MARKER"===n||"HOSTED_TILE"===n?e="hosted":"SUPERMAP_REST"===n||"TILE"===n||"WMS"===n||"WMTS"===n||"MAPBOXSTYLE"===n?e="tile":r&&"REST_DATA"===r.type?e="rest_data":r&&"REST_MAP"===r.type&&r.url?e="rest_map":"DATAFLOW_POINT_TRACK"===n||"DATAFLOW_HEAT"===n?e="dataflow":r&&"USER_DATA"===r.type&&(e="user_data"),e)}},{key:"getFeatureProperties",value:function(t){var e=[];return t&&t.length&&t.forEach(function(t){var r=t.properties;r&&e.push(r)}),e}},{key:"parseGeoJsonData2Feature",value:function(t){for(var e=t.allDatas.features,r=[],n=0,o=e.length;n0){var u=s[0].name,l=s[0].type.toUpperCase();e._getDataService(n,u).then(function(n){var s=n.dataItemServices;0===s.length&&a("noDataServices");var c={layer:r,dataItemServices:s,datasetName:u,featureType:l,resolve:t,reject:a,baseProjection:o};if(i){var f=s.filter(function(t){return t&&"RESTDATA"===t.serviceType})[0];e._isMvt(f.address,u,o).then(function(t){e._getServiceInfoFromLayer(c,t)}).catch(function(){e._getServiceInfoFromLayer(c)})}else e._getServiceInfoFromLayer(c)})}else a("resultIsEmpty")}).catch(function(t){a(t)})})}},{key:"_isMvt",value:function(t,e,r){return this._getDatasetsInfo(t,e).then(function(t){return t.epsgCode==r.split("EPSG:")[1]?co.get("".concat(t.url,"/tilefeature.mvt")).then(function(t){return t.json()}).then(function(e){return t.isMvt=e.error&&400===e.error.code,t}).catch(function(){return t}):t})}},{key:"_getServiceInfoFromLayer",value:function(t,e){var r=this,n=t.layer,o=t.dataItemServices,i=t.datasetName,a=t.featureType,s=t.resolve,u=t.reject,l=t.baseProjection,c=e?!e.isMvt:"HOSTED_TILE"===n.layerType,f=!1;o.forEach(function(t){f||(t&&c&&"RESTMAP"===t.serviceType?(f=!0,r._getTileLayerInfo(t.address,l).then(function(t){s({type:"restMap",restMaps:t})})):t&&!c&&"RESTDATA"===t.serviceType&&(e&&e.isMvt?s({type:"mvt",info:e,featureType:a}):(f=!0,r._getDatasources(t.address).then(function(e){n.dataSource.dataSourceName=e+":"+i,n.dataSource.url="".concat(t.address,"/data"),r._getFeatureBySQL(n.dataSource.url,[n.dataSource.dataSourceName||n.name],function(t){var e=r.parseGeoJsonData2Feature({allDatas:{features:t.result.features.features}});s({type:"feature",features:e})},function(t){u(t)})},function(t){u(t)}))))},this),f||u("noService")}},{key:"_getDatasetsInfo",value:function(t,e){var r=this;return this._getDatasources(t).then(function(n){var o="".concat(t,"/data/datasources/").concat(n,"/datasets/").concat(e),i=r.handleProxy();return o=r.handleParentRes(o),co.get(o,null,{withCredentials:r.handleWithCredentials(i,o,!1),proxy:i}).then(function(t){return t.json()}).then(function(t){return{epsgCode:t.datasetInfo.prjCoordSys.epsgCode,bounds:t.datasetInfo.bounds,datasourceName:n,datasetName:e,url:o}})})}},{key:"_getDatasources",value:function(t){var e=this.handleProxy(),r="".concat(t,"/data/datasources.json");return r=this.handleParentRes(r),co.get(r,null,{withCredentials:this.handleWithCredentials(e,r,!1),proxy:e}).then(function(t){return t.json()}).then(function(t){if(401===t.code)throw Error(t.errorMsg);return t.datasourceNames[0]})}},{key:"_getDataService",value:function(t,e){var r=this.handleProxy(),n="".concat(this.serverUrl,"web/datas/").concat(t,".json");return n=this.handleParentRes(n),co.get(n,null,{withCredentials:this.handleWithCredentials(r,n,this.withCredentials),proxy:r}).then(function(t){return t.json()}).then(function(r){return r.fileId=t,r.datasetName=e,r})}},{key:"_checkUploadToRelationship",value:function(t){var e=this.handleProxy(),r="".concat(this.serverUrl,"web/datas/").concat(t,"/datasets.json");return r=this.handleParentRes(r),co.get(r,null,{withCredentials:this.handleWithCredentials(e,r,this.withCredentials),proxy:e}).then(function(t){return t.json()}).then(function(t){return t})}},{key:"_handleMapUrl",value:function(){var t=this.serverUrl+"web/maps/"+this.mapId+"/map";this.accessToken||this.accessKey?t+=(this.accessToken&&this.accessKey,"token="+this.accessToken):this.credentialValue&&this.credentialKey&&(t+="?"+this.credentialKey+"="+this.credentialValue);var e="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.serverUrl.indexOf(e)>-1){var r=this.serverUrl.split(e);r.length>1&&(t=r[0]+e+this.serverUrl+"web/maps/"+this.mapId+"/map.json")}return t=-1===t.indexOf(".json")?"".concat(t,".json"):t}},{key:"handleProxy",value:function(t){if(!this.proxy)return null;var e=this.proxyOptions[t||"data"],r=this.serverUrl+e;return"string"==typeof this.proxy&&(r=this.proxy),r}},{key:"handleWithCredentials",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.withCredentials;return e&&e.includes("https://www.supermapol.com")?"":!(!t||!t.startsWith(this.serverUrl)||e&&!e.startsWith(t))||(!!(e&&this.iportalServiceProxyUrl&&e.indexOf(this.iportalServiceProxyUrl)>=0)||r)}},{key:"isIportalResourceUrl",value:function(t){return t.startsWith(this.serverUrl)||this.iportalServiceProxyUrl&&t.indexOf(this.iportalServiceProxyUrl)>=0}},{key:"handleParentRes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mapId,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MAP";return this.isIportalResourceUrl(t)?Tt.urlAppend(t,"parentResType=".concat(r,"&parentResId=").concat(e)):t}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colTitles,n=r.indexOf(e.xField),o=r.indexOf(e.yField);if(o<0||n<0)for(var i=0,a=r.length;i2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(+t-+e)<=r}}])&&fQ(t.prototype,e),r&&fQ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),mQ={epsgCodes:{"EPSG:3857":'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]',"EPSG:4326":'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],AXIS["Easting", "EAST"],AXIS["Northing", "NORTH"],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000", DATUM["China 2000", SPHEROID["CGCS2000", 6378137.0, 298.257222101, AUTHORITY["EPSG","1024"]], AUTHORITY["EPSG","1043"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic latitude", NORTH], AXIS["Geodetic longitude", EAST], AUTHORITY["EPSG","4490"]]'},registerProjection:function(t,e){"[object Object]"===Object.prototype.toString.call(arguments[0])&&1===arguments.length?this.epsgCodes=Object.assign({},this.epsgCodes,arguments[0]):t&&e&&(this.epsgCodes[t]=e)},getProjection:function(t){return this.epsgCodes[t]},getAllProjections:function(){return this.epsgCodes}};function bQ(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function gQ(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _Q(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function OQ(t){"@babel/helpers - typeof";return(OQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function EQ(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:wr,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"triggerEvent";return function(r){function n(t,e,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(o=xQ(this,n)).serverUrl=e.serverUrl||"https://www.supermapol.com",o.accessToken=e.accessToken,o.accessKey=e.accessKey,o.tiandituKey=e.tiandituKey||"",o.googleMapsAPIKey=e.googleMapsAPIKey||"",o.bingMapsKey=e.bingMapsKey||"",o.googleMapsLanguage=e.googleMapsLanguage||"zh-CN",o.withCredentials=e.withCredentials||!1,o.proxy=e.proxy,o.target=e.target||"map",o.excludePortalProxyUrl=e.excludePortalProxyUrl,o.isSuperMapOnline=e.isSuperMapOnline,o.ignoreBaseProjection=e.ignoreBaseProjection,o.echartslayer=[],o.canvgsV=[],o.webMapService=new vQ(t,e),o.mapOptions=r,o.eventTypes=["getmapinfofailed","getlayerdatasourcefailed"],o.mapId=t,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&CQ(t,e)}(n,t),o=n,(i=[{key:"_initWebMap",value:function(){throw new Error("_initWebMap is not implemented")}},{key:"_getMapInfo",value:function(){throw new Error("_getMapInfo is not implemented")}},{key:"_createMap",value:function(){throw new Error("_createMap is not implemented")}},{key:"_initBaseLayer",value:function(){throw new Error("_initBaseLayer is not implemented")}},{key:"_initOverlayLayer",value:function(){throw new Error("_initOverlayLayer is not implemented")}},{key:"_addLayerSucceeded",value:function(){throw new Error("_addLayerSucceeded is not implemented")}},{key:"_unproject",value:function(){throw new Error("_unproject is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"echartsLayerResize",value:function(){this.echartslayer.forEach(function(t){t.chart.resize()})}},{key:"setMapId",value:function(t){var e=this;"string"==typeof t||"number"==typeof t?(this.mapId=t,this.webMapInfo=null):null!==t&&"object"===OQ(t)&&(this.webMapInfo=t),this.webMapService.setMapId(t),t&&setTimeout(function(){e._initWebMap()},0)}},{key:"setServerUrl",value:function(t){this.serverUrl=t,this.webMapService.setServerUrl(t)}},{key:"setWithCredentials",value:function(t){this.withCredentials=t,this.webMapService.setWithCredentials(t)}},{key:"setProxy",value:function(t){this.proxy=t,this.webMapService.setProxy(t)}},{key:"setZoom",value:function(t){this.map&&(this.mapOptions.zoom=t,t!==+this.map.getZoom().toFixed(2)&&(t||0===t)&&this.map.setZoom(t,{from:"setZoom"}))}},{key:"setMaxBounds",value:function(t){this.map&&(this.mapOptions.maxBounds=t,t&&this.map.setMaxBounds(t))}},{key:"setMinZoom",value:function(t){this.map&&(this.mapOptions.minZoom=t,(t||0===t)&&this.map.setMinZoom(t))}},{key:"setMaxZoom",value:function(t){this.map&&(this.mapOptions.maxZoom=t,(t||0===t)&&this.map.setMaxZoom(t))}},{key:"initWebMap",value:function(){if(this.clean(),this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapInfo){var t=this.webMapInfo;return t.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=t.mapParams,void this._getMapInfo(t)}this.mapId&&this.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):this._createMap()}},{key:"getMapInfo",value:function(t){var e=this;this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapService.getMapInfo().then(function(r){e._taskID===t&&(e.mapParams=r.mapParams,e._getMapInfo(r,t))},function(t){throw t}).catch(function(t){e._fire("getmapinfofailed",{error:t}),console.log(t)})}},{key:"getBaseLayerType",value:function(t){var e=t.layerType;switch((e.indexOf("TIANDITU_VEC")>-1||e.indexOf("TIANDITU_IMG")>-1||e.indexOf("TIANDITU_TER")>-1)&&(e="TIANDITU"),e){case"TILE":case"SUPERMAP_REST":return"TILE";case"CLOUD":case"CLOUD_BLACK":return"CLOUD";case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":return"XYZ";default:return e}}},{key:"getMapurls",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{CLOUD:t.CLOUD||"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:t.CLOUD_BLACK||"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:t.OSM||"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s{googleMapsLanguage}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key={googleMapsAPIKey}",GOOGLE_CN:"https://mt{0-3}.google.com/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"}}},{key:"getLayerFeatures",value:function(t,e,r){var n,o,i=this,a=this.webMapService.getLayerFeatures(r,t,this.baseProjection);a&&a.then((n=wQ().mark(function r(n){var o;return wQ().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!i.mapId||i._taskID===e){r.next=2;break}return r.abrupt("return");case 2:if(!n||!t.projection){r.next=8;break}if(mQ.getProjection(t.projection)){r.next=8;break}return r.next=6,i.webMapService.getEpsgCodeInfo(t.projection.split(":")[1],i.serverUrl);case 6:(o=r.sent)&&mQ.registerProjection(t.projection,o);case 8:i._getLayerFeaturesSucceeded(n,t);case 9:case"end":return r.stop()}},r)}),o=function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){_Q(i,r,o,a,s,"next",t)}function s(t){_Q(i,r,o,a,s,"throw",t)}a(void 0)})},function(t){return o.apply(this,arguments)}),function(t){throw new Error(t)}).catch(function(e){i._addLayerSucceeded(),i._fire("getlayerdatasourcefailed",{error:e,layer:t,map:i.map}),console.log(e)})}},{key:"setFeatureInfo",value:function(t){var e,r=t.dv_v5_markerInfo;if(!r||!r.dataViz_title)return r;e=r;var n=t.properties;for(var o in e)n[o]&&(e[o]=n[o],delete n[o]);return e}},{key:"getRankStyleGroup",value:function(t,e,r){var n=[],o=[],i=r.style,a=r.themeSetting,s=a.segmentMethod,u=a.segmentCount,l=a.customSettings,c=r.themeSetting.minRadius,f=r.themeSetting.maxRadius,p=a.colors,h=i.fillColor;e.forEach(function(e){var r=e.properties[t];null==r||""===r||isNaN(+r)||n.push(Number(r))});try{o=zD.getArraySegments(n,s,u)}catch(t){console.log(t)}for(var y=0;y0&&(O=l[P]&&l[P].color?l[P].color:E[P]||h,i.fillColor=O),m.push({radius:_,color:O,start:b,end:g,style:i});return m}return!1}},{key:"createRankStyleSource",value:function(t,e){var r=t.themeSetting.themeField,n=this.getRankStyleGroup(r,e,t);return!!n&&{parameters:t,styleGroups:n}}},{key:"getRestMapLayerInfo",value:function(t,e){var r=t.bounds,n=t.coordUnit,o=t.visibleScales,i=t.url;return e.layerType="TILE",e.orginEpsgCode=this.baseProjection,e.units=n&&n.toLowerCase(),e.extent=[r.left,r.bottom,r.right,r.top],e.visibleScales=o,e.url=i,e.sourceType="TILE",e}},{key:"handleLayerFeatures",value:function(t,e){var r=e.layerType,n=e.style,o=e.themeSetting,i=e.filterCondition;return(n||o)&&i&&"RANGE"!==r&&"UNIQUE"!==r&&"RANK_SYMBOL"!==r&&(t=this.getFilterFeatures(i,t)),t}},{key:"mergeFeatures",value:function(t,e,r){if(!(e instanceof Array))return e;if(!(e=e.map(function(t,e){return Object.prototype.hasOwnProperty.call(t.properties,"index")||(t.properties.index=e),t})).length||!r&&e[0].geometry)return e;var n=this.map.getSource(t);if((!n||!n._data.features)&&e[0].geometry)return e;var o=n&&n._data&&n._data.features,i=[];return!r&&o?o:(e.forEach(function(t){var e=o.find(function(e){return isNaN(+e.properties[r])&&isNaN(+t.properties[r])?JSON.stringify(e.properties[r]||"")===JSON.stringify(t.properties[r]||""):+e.properties[r]==+t.properties[r]});e?i.push(gQ(gQ({},e),t)):t.geometry&&i.push(t)}),i)}},{key:"getFilterFeatures",value:function(t,e){if(!t)return e;for(var r=this.replaceFilterCharacter(t),n=[],o=0;o0&&n.push(i)}return n}},{key:"replaceFilterCharacter",value:function(t){return t=t.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")}},{key:"getParseSpecialCharacter",value:function(){var t={};return["(",")","(",")",",",","].forEach(function(e,r){t[e]="$".concat(r)}),t}},{key:"parseSpecialCharacter",value:function(t){var e=this.getParseSpecialCharacter();for(var r in e)for(var n=e[r],o=new RegExp("\\".concat(r),"g");o.test(t);)t=t.replace(o,n);return t}},{key:"parseCondition",value:function(t,e){var r=this,n=t;return t.replace(/&|\||>|<|=|!/g," ").split(" ").filter(function(t){return t}).forEach(function(t){var o=e.find(function(e){return e===t});if(r.startsWithNumber(t)&&o&&(n=n.replace(o,"$"+o)),o){var i=r.parseSpecialCharacter(o);n=n.replace(o,i)}}),n}},{key:"parseConditionFeature",value:function(t){var e={};for(var r in t){var n=r;this.startsWithNumber(r)&&(n="$"+r),e[n=this.parseSpecialCharacter(n)]=t[r]}return e}},{key:"startsWithNumber",value:function(t){return/^\d/.test(t)}},{key:"getEchartsLayerOptions",value:function(t,e,r){var n=this.webMapService.getFeatureProperties(e),o=function(t,e){var r=[];if(e&&e.length){var n,o,i=t.from,a=t.to;if("XY_FIELD"===i.type&&i.xField&&i.yField&&a.xField&&a.yField)e.forEach(function(t){var e=t[i.xField],s=t[i.yField],u=t[a.xField],l=t[a.yField];e&&s&&u&&l&&(n=[t[i.xField],t[i.yField]],o=[t[a.xField],t[a.yField]],r.push({coords:[n,o]}))});else if("PLACE_FIELD"===i.type&&i.field&&a.field){var s=nQ.concat(rQ);e.forEach(function(t){var e=t[i.field],u=t[a.field];n=s.find(function(t){return oQ(t.name,e)}),o=s.find(function(t){return oQ(t.name,u)}),n&&o&&r.push({coords:[n.coord,o.coord]})})}}return r}(t,n),i=this._createPointsData(o,t,n);return this._createOptions(t,o,i,r)}},{key:"getDashStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"array";if(!t)return"array"===r?[]:"";var n,o=e;switch(t){case"solid":n=[];break;case"dot":n=[1,4*o];break;case"dash":n=[4*o,4*o];break;case"dashrailway":n=[8*o,12*o];break;case"dashdot":n=[4*o,4*o,1*o,4*o];break;case"longdash":n=[8*o,4*o];break;case"longdashdot":n=[8*o,4*o,1,4*o];break;default:Tt.isArray(t)&&(n=t),n=(t=at.trim(t).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(",")}return n="array"===r?n:n.join(",")}},{key:"getCanvasFromSVG",value:function(t,e,r){var n=this,o=document.createElement("canvas");if(o.id="dataviz-canvas-".concat((new Date).getTime()),o.style.display="none",e.appendChild(o),t){var i=(window.canvg||{}).default?window.canvg.default:XY,a=o.getContext("2d");i.from(a,t,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:function(){return!1}}).then(function(t){t.start(),n.canvgsV.push(t),o.width>300||o.height>300||r(o)})}else r(o)}},{key:"stopCanvg",value:function(){this.canvgsV.forEach(function(t){return t.stop()}),this.canvgsV=[]}},{key:"getRangeStyleGroup",value:function(t,e){var r,n=t.featureType,o=t.style,i=t.themeSetting,a=i.customSettings,s=i.themeField,u=i.segmentCount,l=i.segmentMethod,c=i.colors,f=[];e.forEach(function(t){if(r=t.properties){var e=r[s];(e||0===e)&&!isNaN(+e)&&f.push(parseFloat(e))}},this);var p=f&&f.length&&zD.getArraySegments(f,l,u);if(p){var h=u;r&&p[0]===p[r.length-1]&&(h=1,p.length=2);for(var y=0;yl&&o>0||"\n"===t[o]?(e=t[o],f++,n=!0):(e=i,c=a)}n?p.push(l):p.push(c)},this);for(var h=0;h=l){c=l;break}y>c&&(c=y)}return c+=a,e=f*i+a-6,s.width=c,s.height=e,r.fillStyle=u,r.fillRect(0,0,c,e),r.lineWidth=n.borderWidth,r.strokeStyle=n.borderColor,r.strokeRect(0,0,c,e),{width:c,height:e}}},{key:"_drawTextWithCanvas",value:function(t){var e=t.context,r=t.canvas,n=t.style,o=Number(n.font.replace(/[^0-9]/gi,""))+3,i=n.text.split("\r\n");e.font=n.font;var a=this._drawTextRectAndGetSize({context:e,style:n,textArray:i,lineHeight:o,doublePadding:16,canvas:r}),s=8;i.forEach(function(t,r){0!==r&&(s+=o),e.font=n.font;var i,u=n.textAlign,l=a.width-16;switch(u){case"center":i=l/2;break;case"right":i=l;break;default:i=8}for(var c=t.split(""),f="",p=n.fillColor,h=n.maxWidth-16,y=0;yh&&y>0||"\n"===c[y]?(e.fillStyle=p,e.textAlign=u,e.textBaseline="top",e.fillText(f,i,s),f=c[y],s+=o):f=d}e.fillStyle=p,e.textAlign=u,e.textBaseline="top",e.fillText(f,i,s)},this)}},{key:"handleSvgColor",value:function(t,e){var r=t.fillColor,n=t.fillOpacity,o=t.strokeColor,i=t.strokeOpacity,a=t.strokeWidth,s=e.getContext("2d");t.text?this._drawTextWithCanvas({context:s,canvas:e,style:t}):(r&&(s.fillStyle=PD.getColorWithOpacity(r,n),s.fill()),(o||a)&&(s.strokeStyle=PD.getColorWithOpacity(o,i),s.lineWidth=a,s.stroke()))}},{key:"_createPointsData",value:function(t,e,r){var n=[],o=e.labelSetting;if(!o.show||!t.length)return n;var i=[],a=[];return t.forEach(function(t,e){var n=t.coords,s=n[0],u=n[1],l=r[e][o.from],c=r[e][o.to];!i.find(function(t){return t.value[0]===s[0]&&t.value[1]===s[1]})&&i.push({name:l,value:s}),!a.find(function(t){return t.value[0]===u[0]&&t.value[1]===u[1]})&&a.push({name:c,value:u})}),n=i.concat(a)}},{key:"_createOptions",value:function(t,e,r,n){var o,i=this._createLineSeries(t,e,n);if(r&&r.length){var a=this._createPointSeries(t,r,n);o=i.concat(a)}else o=i.slice();return{series:o,animation:!1}}},{key:"_createPointSeries",value:function(t,e,r){var n=t.lineSetting,o=t.animationSetting,i=t.labelSetting,a=[{name:"point-series",coordinateSystem:r,zlevel:2,label:{normal:{show:i.show,position:"right",formatter:"{b}",color:i.color,fontFamily:i.fontFamily}},itemStyle:{normal:{color:n.color||i.color}},data:e}];return o.show?(a[0].type="effectScatter",a[0].rippleEffect={brushType:"stroke"}):a[0].type="scatter",a}},{key:"_createLineSeries",value:function(t,e,r){var n=t.lineSetting,o=t.animationSetting,i=[{name:"line-series",coordinateSystem:r,type:"lines",zlevel:1,effect:{show:o.show,constantSpeed:o.constantSpeed,trailLength:0,symbol:o.symbol,symbolSize:o.symbolSize},lineStyle:{normal:{color:n.color,type:n.type,width:n.width,opacity:n.opacity,curveness:n.curveness}},data:e}];return e.length>=kQ&&(i[0].large=!0,i[0].largeThreshold=100,i[0].blendMode="lighter"),i}},{key:"_getLayerFeaturesSucceeded",value:function(t,e){switch(t.type){case"feature":this._initOverlayLayer(e,t.features);break;case"restMap":e.layerType="restMap",this._initOverlayLayer(e,t.restMaps);break;case"mvt":e.layerType="mvt",this._initOverlayLayer(e,t);break;case"dataflow":case"noServerId":this._initOverlayLayer(e)}}},{key:"_fire",value:function(t,r){this[e]&&this[e](t,r)}}])&&EQ(o.prototype,i),a&&EQ(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,a}()},n.WebMapService=vQ,n.epsgDefine=mQ,n.toEpsgCode=function(t){if("string"!=typeof t)return"";if(0===t.indexOf("EPSG"))return t;var e=t.lastIndexOf("AUTHORITY")+10,r=t.indexOf("]",e)-1;return e>0&&r>0?"EPSG:".concat(t.substring(e,r).split(",")[1].substr(1)):""};var MQ=L,RQ=r.n(MQ);var LQ=1,DQ=2,BQ=3,FQ=4,UQ=5,GQ=6378137,VQ=6356752.314,zQ=.0066943799901413165,HQ=484813681109536e-20,qQ=Math.PI/2,JQ=.16666666666666666,WQ=.04722222222222222,KQ=.022156084656084655,YQ=1e-10,QQ=.017453292519943295,XQ=57.29577951308232,ZQ=Math.PI/4,$Q=2*Math.PI,tX=3.14159265359,eX={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},rX={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},nX=/[\s_\-\/\(\)]/g;function oX(t,e){if(t[e])return t[e];for(var r,n=Object.keys(t),o=e.toLowerCase().replace(nX,""),i=-1;++i=this.text.length)return;t=this.text[this.place++]}switch(this.state){case sX:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},hX.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(fX.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},hX.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=sX)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=sX,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},hX.prototype.number=function(t){if(!pX.test(t)){if(fX.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},hX.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},hX.prototype.keyword=function(t){if(cX.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=sX)}if(!fX.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},hX.prototype.neutral=function(t){if(lX.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(pX.test(t))return this.word=t,void(this.state=3);if(!fX.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},hX.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=bX(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(o),o}function SX(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?SX[t]=iX(arguments[1]):SX[t]=gX(arguments[1]):SX[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?SX.apply(e,t):SX(t)});if("string"==typeof t){if(t in SX)return SX[t]}else"EPSG"in t?SX["EPSG:"+t.EPSG]=t:"ESRI"in t?SX["ESRI:"+t.ESRI]=t:"IAU2000"in t?SX["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(SX);var wX=SX;var _X=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var OX=["3857","900913","3785","102113"];var EX=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in wX}(t))return wX[t];if(function(t){return _X.some(function(e){return t.indexOf(e)>-1})}(t)){var e=gX(t);if(function(t){var e=oX(t,"authority");if(e){var r=oX(e,"epsg");return r&&OX.indexOf(r)>-1}}(e))return wX["EPSG:3857"];var r=function(t){var e=oX(t,"extension");if(e)return oX(e,"proj4")}(e);return r?iX(r):e}return function(t){return"+"===t[0]}(t)?iX(t):void 0};function PX(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}function xX(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}function TX(t){return t<0?-1:1}function CX(t){return Math.abs(t)<=tX?t:t-TX(t)*$Q}function kX(t,e,r){var n=t*r,o=.5*t;return n=Math.pow((1-n)/(1+n),o),Math.tan(.5*(qQ-e))/n}function AX(t,e){for(var r,n,o=.5*t,i=qQ-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(i),i+=n=qQ-2*Math.atan(e*Math.pow((1-r)/(1+r),o))-i,Math.abs(n)<=1e-10)return i;return-9999}function jX(t){return t}var NX=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=xX(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,o=t.y;if(o*XQ>90&&o*XQ<-90&&n*XQ>180&&n*XQ<-180)return null;if(Math.abs(Math.abs(o)-qQ)<=YQ)return null;if(this.sphere)e=this.x0+this.a*this.k0*CX(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(ZQ+.5*o));else{var i=Math.sin(o),a=kX(this.e,o,i);e=this.x0+this.a*this.k0*CX(n-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,o=t.y-this.y0;if(this.sphere)r=qQ-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var i=Math.exp(-o/(this.a*this.k0));if(-9999===(r=AX(this.e,i)))return null}return e=CX(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:jX,inverse:jX,names:["longlat","identity"]}],IX={},MX=[];function RX(t,e){var r=MX.length;return t.names?(MX[r]=t,t.names.forEach(function(t){IX[t.toLowerCase()]=r}),this):(console.log(e),!0)}var LX={start:function(){NX.forEach(RX)},add:RX,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==IX[e]&&MX[IX[e]]?MX[IX[e]]:void 0}},DX={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},BX=DX.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};DX.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var FX={};FX.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},FX.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},FX.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},FX.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},FX.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},FX.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},FX.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},FX.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},FX.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},FX.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},FX.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},FX.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},FX.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},FX.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},FX.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},FX.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},FX.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},FX.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var UX=function(t,e,r,n,o,i,a){var s={};return s.datum_type=void 0===t||"none"===t?UQ:FQ,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=LQ),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=DQ,s.datum_params[3]*=HQ,s.datum_params[4]*=HQ,s.datum_params[5]*=HQ,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=BQ,s.grids=a),s.a=r,s.b=n,s.es=o,s.ep2=i,s},GX={};function VX(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:GX[t]||null,isNull:!1}}function zX(t){return t/3600*Math.PI/180}function HX(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function qX(t){return t.map(function(t){return[zX(t.longitudeShift),zX(t.latitudeShift)]})}function JX(t,e,r){return{name:HX(t,e+8,e+16).trim(),parent:HX(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function WX(t,e,r,n){for(var o=e+176,i=[],a=0;a-1.001*qQ)u=-qQ;else if(u>qQ&&u<1.001*qQ)u=qQ;else{if(u<-qQ)return{x:-1/0,y:-1/0,z:t.z};if(u>qQ)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),o=Math.sin(u),a=Math.cos(u),i=o*o,{x:((n=r/Math.sqrt(1-e*i))+l)*a*Math.cos(s),y:(n+l)*a*Math.sin(s),z:(n*(1-e)+l)*o}}function ZX(t,e,r,n){var o,i,a,s,u,l,c,f,p,h,y,d,v,m,b,g=t.x,S=t.y,w=t.z?t.z:0;if(o=Math.sqrt(g*g+S*S),i=Math.sqrt(g*g+S*S+w*w),o/r<1e-12){if(m=0,i/r<1e-12)return qQ,b=-n,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(S,g);a=w/i,f=(s=o/i)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),p=a*u,v=0;do{v++,l=e*(c=r/Math.sqrt(1-e*p*p))/(c+(b=o*f+w*p-c*(1-e*p*p))),d=(y=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*f-(h=s*(1-l)*u)*p,f=h,p=y}while(d*d>1e-24&&v<30);return{x:m,y:Math.atan(y/Math.abs(h)),z:b}}function $X(t){return t===LQ||t===DQ}function tZ(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===LQ?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==DQ||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===UQ||e.datum_type===UQ)return r;var n=t.a,o=t.es;if(t.datum_type===BQ){if(0!==eZ(t,!1,r))return;n=GQ,o=zQ}var i=e.a,a=e.b,s=e.es;if(e.datum_type===BQ&&(i=GQ,a=VQ,s=zQ),o===s&&n===i&&!$X(t.datum_type)&&!$X(e.datum_type))return r;if((r=XX(r,o,n),$X(t.datum_type)&&(r=function(t,e,r){if(e===LQ)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===DQ){var n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],u=r[5],l=r[6];return{x:l*(t.x-u*t.y+s*t.z)+n,y:l*(u*t.x+t.y-a*t.z)+o,z:l*(-s*t.x+a*t.y+t.z)+i}}}(r,t.datum_type,t.datum_params)),$X(e.datum_type)&&(r=function(t,e,r){if(e===LQ)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===DQ){var n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=(t.x-n)/l,f=(t.y-o)/l,p=(t.z-i)/l;return{x:c+u*f-s*p,y:-u*c+f+a*p,z:s*c-a*f+p}}}(r,e.datum_type,e.datum_params)),r=ZX(r,s,i,a),e.datum_type===BQ)&&0!==eZ(e,!0,r))return;return r}function eZ(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},o={x:Number.NaN,y:Number.NaN},i=[];t:for(var a=0;an.y||h>n.x||v1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=CX(i.x+r.ll[0]),n.y=i.y+r.ll[1]}else isNaN(i.x)||(n.x=t.x+i.x,n.y=t.y+i.y);return n}function nZ(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},o=Math.floor(n.x),i=Math.floor(n.y),a=n.x-1*o,s=n.y-1*i,u={x:Number.NaN,y:Number.NaN};if(o<0||o>=e.lim[0])return u;if(i<0||i>=e.lim[1])return u;r=i*e.lim[0]+o;var l=e.cvs[r][0],c=e.cvs[r][1];r++;var f=e.cvs[r][0],p=e.cvs[r][1];r+=e.lim[0];var h=e.cvs[r][0],y=e.cvs[r][1];r--;var d=e.cvs[r][0],v=e.cvs[r][1],m=a*s,b=a*(1-s),g=(1-a)*(1-s),S=(1-a)*s;return u.x=g*l+b*f+S*d+m*h,u.y=g*c+b*p+S*v+m*y,u}function oZ(t,e,r){var n,o,i,a=r.x,s=r.y,u=r.z||0,l={};for(i=0;i<3;i++)if(!e||2!==i||void 0!==r.z)switch(0===i?(n=a,o=-1!=="ew".indexOf(t.axis[i])?"x":"y"):1===i?(n=s,o=-1!=="ns".indexOf(t.axis[i])?"y":"x"):(n=u,o="z"),t.axis[i]){case"e":l[o]=n;break;case"w":l[o]=-n;break;case"n":l[o]=n;break;case"s":l[o]=-n;break;case"u":void 0!==r[o]&&(l.z=n);break;case"d":void 0!==r[o]&&(l.z=-n);break;default:return null}return l}function iZ(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function aZ(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function sZ(t,e,r,n){var o,i=void 0!==(r=Array.isArray(r)?iZ(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){aZ(t.x),aZ(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===LQ||t.datum.datum_type===DQ||t.datum.datum_type===BQ)&&"WGS84"!==e.datumCode||(e.datum.datum_type===LQ||e.datum.datum_type===DQ||e.datum.datum_type===BQ)&&"WGS84"!==t.datumCode}(t,e)&&(r=sZ(t,o=new QX("WGS84"),r,n),t=o),n&&"enu"!==t.axis&&(r=oZ(t,!1,r)),"longlat"===t.projName)r={x:r.x*QQ,y:r.y*QQ,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=tZ(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*XQ,y:r.y*XQ,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),n&&"enu"!==e.axis?oZ(e,!0,r):(r&&!i&&delete r.z,r)}var uZ=QX("WGS84");function lZ(t,e,r,n){var o,i,a;return Array.isArray(r)?(o=sZ(t,e,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof o.z?[o.x,o.y,o.z].concat(r.splice(3)):[o.x,o.y,r[2]].concat(r.splice(3)):[o.x,o.y].concat(r.splice(2)):[o.x,o.y]):(i=sZ(t,e,r,n),2===(a=Object.keys(r)).length?i:(a.forEach(function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;i[n]=r[n]}),i))}function cZ(t){return t instanceof QX?t:t.oProj?t.oProj:QX(t)}var fZ=function(t,e,r){t=cZ(t);var n,o=!1;return void 0===e?(e=t,t=uZ,o=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=uZ,o=!0),e=cZ(e),r?lZ(t,e,r):(n={forward:function(r,n){return lZ(t,e,r,n)},inverse:function(r,n){return lZ(e,t,r,n)}},o&&(n.oProj=e),n)},pZ=6,hZ="AJSAJS",yZ="AFAFAF",dZ=65,vZ=73,mZ=79,bZ=86,gZ=90,SZ={forward:wZ,inverse:function(t){var e=PZ(TZ(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:_Z};function wZ(t,e){return e=e||5,function(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,y=t.northing,d=t.zoneNumber,v=xZ(d),m=Math.floor(h/1e5),b=Math.floor(y/1e5)%20,o=m,i=b,a=v,s=a-1,u=hZ.charCodeAt(s),l=yZ.charCodeAt(s),c=u+o-1,f=l+i,p=!1,c>gZ&&(c=c-gZ+dZ-1,p=!0),(c===vZ||uvZ||(c>vZ||umZ||(c>mZ||ugZ&&(c=c-gZ+dZ-1),f>bZ?(f=f-bZ+dZ-1,p=!0):p=!1,(f===vZ||lvZ||(f>vZ||lmZ||(f>mZ||lbZ&&(f=f-bZ+dZ-1),String.fromCharCode(c)+String.fromCharCode(f))+r.substr(r.length-5,e)+n.substr(n.length-5,e);var o,i,a,s,u,l,c,f,p;var h,y,d,v,m,b}(function(t){var e,r,n,o,i,a,s,u=t.lat,l=t.lon,c=6378137,f=OZ(u),p=OZ(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=OZ(6*(s-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=.006739496752268451*Math.cos(f)*Math.cos(f),o=Math.cos(f)*(p-a),i=c*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var h=.9996*e*(o+(1-r+n)*o*o*o/6+(5-18*r+r*r+72*n-.39089081163157013)*o*o*o*o*o/120)+5e5,y=.9996*(i+e*Math.tan(f)*(o*o/2+(5-r+9*n+4*n*n)*o*o*o*o/24+(61-58*r+r*r+600*n-2.2240339282485886)*o*o*o*o*o*o/720));u<0&&(y+=1e7);return{northing:Math.round(y),easting:Math.round(h),zoneNumber:s,zoneLetter:function(t){var e="Z";84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C");return e}(u)}}({lat:t[1],lon:t[0]}),e)}function _Z(t){var e=PZ(TZ(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function OZ(t){return t*(Math.PI/180)}function EZ(t){return t/Math.PI*180}function PZ(t){var e=t.northing,r=t.easting,n=t.zoneLetter,o=t.zoneNumber;if(o<0||o>60)return null;var i,a,s,u,l,c,f,p,h=6378137,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),d=r-5e5,v=e;n<"N"&&(v-=1e7),c=6*(o-1)-180+3,p=(f=v/.9996/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*f)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*f)+151*y*y*y/96*Math.sin(6*f),i=h/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),s=.006739496752268451*Math.cos(p)*Math.cos(p),u=.99330562*h/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),l=d/(.9996*i);var m=p-i*Math.tan(p)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);m=EZ(m);var b,g=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(p);if(g=c+EZ(g),t.accuracy){var S=PZ({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:S.lat,right:S.lon,bottom:m,left:g}}else b={lat:m,lon:g};return b}function xZ(t){var e=t%pZ;return 0===e&&(e=pZ),e}function TZ(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,o="",i=0;!/[A-Z]/.test(e=t.charAt(i));){if(i>=2)throw"MGRSPoint bad conversion from: "+t;o+=e,i++}var a=parseInt(o,10);if(0===i||i+3>r)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(i++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;n=t.substring(i,i+=2);for(var u=xZ(a),l=function(t,e){var r=hZ.charCodeAt(e-1),n=1e5,o=!1;for(;r!==t.charCodeAt(0);){if(++r===vZ&&r++,r===mZ&&r++,r>gZ){if(o)throw"Bad character: "+t;r=dZ,o=!0}n+=1e5}return n}(n.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var r=yZ.charCodeAt(e-1),n=0,o=!1;for(;r!==t.charCodeAt(0);){if(++r===vZ&&r++,r===mZ&&r++,r>bZ){if(o)throw"Bad character: "+t;r=dZ,o=!0}n+=1e5}return n}(n.charAt(1),u);c0&&(p=1e5/Math.pow(10,d),h=t.substring(i,i+d),v=parseFloat(h)*p,y=t.substring(i+d),m=parseFloat(y)*p),{easting:v+l,northing:m+c,zoneLetter:s,zoneNumber:a,accuracy:p}}function CZ(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function kZ(t){"@babel/helpers - typeof";return(kZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function AZ(t,e,r){if(!(this instanceof AZ))return new AZ(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"===kZ(t))this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}AZ.fromMGRS=function(t){return new AZ(_Z(t))},AZ.prototype.toMGRS=function(t){return wZ([this.x,this.y],t)};var jZ=AZ,NZ=1,IZ=.25,MZ=.046875,RZ=.01953125,LZ=.01068115234375,DZ=.75,BZ=.46875,FZ=.013020833333333334,UZ=.007120768229166667,GZ=.3645833333333333,VZ=.005696614583333333,zZ=.3076171875;function HZ(t){var e=[];e[0]=NZ-t*(IZ+t*(MZ+t*(RZ+t*LZ))),e[1]=t*(DZ-t*(MZ+t*(RZ+t*LZ)));var r=t*t;return e[2]=r*(BZ-t*(FZ+t*UZ)),r*=t,e[3]=r*(GZ-t*VZ),e[4]=r*t*zZ,e}function qZ(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var JZ=20;function WZ(t,e,r){for(var n=1/(1-e),o=t,i=JZ;i;--i){var a=Math.sin(o),s=1-e*a*a;if(o-=s=(qZ(o,a,Math.cos(o),r)-t)*(s*Math.sqrt(s))*n,Math.abs(s)YQ?Math.tan(i):0,y=Math.pow(h,2),d=Math.pow(y,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var v=qZ(i,s,u,this.en);r=this.a*(this.k0*l*(1+c/6*(1-y+f+c/20*(5-18*y+d+14*f-58*y*f+c/42*(61+179*d-d*y-479*y)))))+this.x0,n=this.a*(this.k0*(v-this.ml0+s*a*l/2*(1+c/12*(5-y+9*f+4*p+c/30*(61+d-58*y+270*f-330*y*f+c/56*(1385+543*d-d*y-3111*y))))))+this.y0}else{var m=u*Math.sin(a);if(Math.abs(Math.abs(m)-1)=1){if(m-1>YQ)return 93;n=0}else n=Math.acos(n);i<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,o,i=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(r=WZ(e=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)YQ?Math.tan(r):0,c=this.ep2*Math.pow(u,2),f=Math.pow(c,2),p=Math.pow(l,2),h=Math.pow(p,2);e=1-this.es*Math.pow(s,2);var y=i*Math.sqrt(e)/this.k0,d=Math.pow(y,2);n=r-(e*=l)*d/(1-this.es)*.5*(1-d/12*(5+3*p-9*c*p+c-4*f-d/30*(61+90*p-252*c*p+45*h+46*c-d/56*(1385+3633*p+4095*h+1574*h*p)))),o=CX(this.long0+y*(1-d/6*(1+2*p+c-d/20*(5+28*p+24*h+8*c*p+6*c-d/42*(61+662*p+1320*h+720*h*p))))/u)}else n=qQ*TX(a),o=0;else{var v=Math.exp(i/this.k0),m=.5*(v-1/v),b=this.lat0+a/this.k0,g=Math.cos(b);e=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(m,2))),n=Math.asin(e),a<0&&(n=-n),o=0===m&&0===g?0:CX(Math.atan2(m,g)+this.long0)}return t.x=o,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function YZ(t){var e=Math.exp(t);return e=(e-1/e)/2}function QZ(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function XZ(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(QZ(1,e)+1))),t<0?-e:e}function ZZ(t,e){for(var r,n=2*Math.cos(2*e),o=t.length-1,i=t[o],a=0;--o>=0;)r=n*i-a+t[o],a=i,i=r;return e+r*Math.sin(2*e)}function $Z(t,e,r){for(var n,o,i=Math.sin(e),a=Math.cos(e),s=YZ(r),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(r),l=2*a*u,c=-2*i*s,f=t.length-1,p=t[f],h=0,y=0,d=0;--f>=0;)n=y,o=h,p=l*(y=p)-n-c*(h=d)+t[f],d=c*y-o+l*h;return[(l=i*u)*p-(c=a*s)*d,l*d+c*p]}var t$={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(KZ.init.apply(this),this.forward=KZ.forward,this.inverse=KZ.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var n=ZZ(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),o=t.length-1,i=t[o],a=0;--o>=0;)r=n*i-a+t[o],a=i,i=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=CX(t.x-this.long0),r=t.y;r=ZZ(this.cbg,r);var n=Math.sin(r),o=Math.cos(r),i=Math.sin(e),a=Math.cos(e);r=Math.atan2(n,a*o),e=Math.atan2(i*o,QZ(n,o*a)),e=XZ(Math.tan(e));var s,u,l=$Z(this.gtu,2*r,2*e);return r+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(o=(o-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var i=$Z(this.utg,2*o,2*n);o+=i[0],n+=i[1],n=Math.atan(YZ(n));var a=Math.sin(o),s=Math.cos(o),u=Math.sin(n),l=Math.cos(n);o=Math.atan2(a*l,QZ(u,l*s)),e=CX((n=Math.atan2(u,l*s))+this.long0),r=ZZ(this.cgb,o)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var e$={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(CX(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*QQ,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,t$.init.apply(this),this.forward=t$.forward,this.inverse=t$.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function r$(t,e){return Math.pow((1-t)/(1+t),e)}var n$=20;var o$={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ZQ)/(Math.pow(Math.tan(.5*this.lat0+ZQ),this.C)*r$(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+ZQ),this.C)*r$(this.e*Math.sin(r),this.ratexp))-qQ,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+ZQ)/this.K,1/this.C),o=n$;o>0&&(r=2*Math.atan(n*r$(this.e*Math.sin(t.y),-.5*this.e))-qQ,!(Math.abs(r-t.y)<1e-14));--o)t.y=r;return o?(t.x=e,t.y=r,t):null},names:["gauss"]};var i$={init:function(){o$.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,o;return t.x=CX(t.x-this.long0),o$.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),o=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=o*r*Math.sin(t.x),t.y=o*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,o,i;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,i=QZ(t.x,t.y)){var a=2*Math.atan2(i,this.R2);e=Math.sin(a),r=Math.cos(a),o=Math.asin(r*this.sinc0+t.y*e*this.cosc0/i),n=Math.atan2(t.x*e,i*this.cosc0*r-t.y*this.sinc0*e)}else o=this.phic0,n=0;return t.x=n,t.y=o,o$.inverse.apply(this,[t]),t.x=CX(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var a$={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=YQ&&(this.k0=.5*(1+TX(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=YQ&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=YQ&&Math.abs(Math.cos(this.lat_ts))>YQ&&(this.k0=.5*this.cons*xX(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/kX(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=xX(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-qQ,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,o,i,a,s=t.x,u=t.y,l=Math.sin(u),c=Math.cos(u),f=CX(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=YQ&&Math.abs(u+this.lat0)<=YQ?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(f)),t.x=this.a*e*c*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*l-this.sinlat0*c*Math.cos(f))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,l,this.e))-qQ,o=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=YQ?(i=kX(this.e,u*this.con,this.con*l),a=2*this.a*this.k0*i/this.cons,t.x=this.x0+a*Math.sin(s-this.long0),t.y=this.y0-this.con*a*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)0?CX(this.long0+Math.atan2(t.x,-1*t.y)):CX(this.long0+Math.atan2(t.x,t.y)):CX(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=YQ){if(a<=YQ)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*AX(this.e,n),e=this.con*CX(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else o=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=YQ?i=this.X0:(i=Math.asin(Math.cos(o)*this.sinX0+t.y*Math.sin(o)*this.cosX0/a),e=CX(this.long0+Math.atan2(t.x*Math.sin(o),a*this.cosX0*Math.cos(o)-t.y*this.sinX0*Math.sin(o)))),r=-1*AX(this.e,Math.tan(.5*(qQ+i)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(qQ+t))*Math.pow((1-e)/(1+e),.5*r)}};var s$={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,o=2*n-Math.pow(n,2),i=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+i*e)/(1-i*e));this.K=a-this.alpha*s+this.alpha*i/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,o=2*(Math.atan(Math.exp(n))-Math.PI/4),i=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(i)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(i))),s=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(i));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,o=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),i=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(o))),s=this.lambda0+a/this.alpha,u=0,l=i,c=-1e3,f=0;Math.abs(l-c)>1e-7;){if(++f>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+i/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]};function u$(t){"@babel/helpers - typeof";return(u$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var l$=1e-7;var c$={init:function(){var t,e,r,n,o,i,a,s,u,l,c,f,p,h=0,y=0,d=0,v=0,m=0,b=0,g=0;this.no_off=(p="object"===u$((f=this).PROJECTION)?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(p)),this.no_rot="no_rot"in this;var S=!1;"alpha"in this&&(S=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),S&&(g=this.alpha),w&&(h=this.rectified_grid_angle*QQ),S||w)y=this.longc;else if(d=this.long1,m=this.lat1,v=this.long2,b=this.lat2,Math.abs(m-b)<=l$||(t=Math.abs(m))<=l$||Math.abs(t-qQ)<=l$||Math.abs(Math.abs(this.lat0)-qQ)<=l$||Math.abs(Math.abs(b)-qQ)<=l$)throw new Error;var _=1-this.es;e=Math.sqrt(_),Math.abs(this.lat0)>YQ?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/_),this.A=this.B*this.k0*e/t,(o=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=n,this.E*=Math.pow(kX(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=o=1),S||w?(S?(c=Math.asin(Math.sin(g)/n),w||(h=g)):(c=h,g=Math.asin(n*Math.sin(c))),this.lam0=y-Math.asin(.5*(o-1/o)*Math.tan(c))/this.B):(i=Math.pow(kX(this.e,m,Math.sin(m)),this.B),a=Math.pow(kX(this.e,b,Math.sin(b)),this.B),o=this.E/i,u=(a-i)/(a+i),l=((l=this.E*this.E)-a*i)/(l+a*i),(t=d-v)<-Math.pi?v-=$Q:t>Math.pi&&(v+=$Q),this.lam0=CX(.5*(d+v)-Math.atan(l*Math.tan(.5*this.B*(d-v))/u)/this.B),c=Math.atan(2*Math.sin(this.B*CX(d-this.lam0))/(o-1/o)),h=g=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(g))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(ZQ-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(ZQ+o))},forward:function(t){var e,r,n,o,i,a,s,u,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-qQ)>YQ){if(e=.5*((i=this.E/Math.pow(kX(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/i)),r=.5*(i+a),o=Math.sin(this.B*t.x),n=(e*this.singam-o*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(l.x=s,l.y=u):(s-=this.u_0,l.x=u*this.cosrot+s*this.sinrot,l.y=s*this.cosrot-u*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var e,r,n,o,i,a,s,u={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),o=.5*((n=Math.exp(-this.BrA*r))-1/n),i=.5*(n+1/n),s=((a=Math.sin(this.BrA*e))*this.cosgam+o*this.singam)/i,Math.abs(Math.abs(s)-1)YQ?this.ns=Math.log(n/s)/Math.log(o/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=YQ&&(r=TX(r)*(qQ-2*YQ));var n,o,i=Math.abs(Math.abs(r)-qQ);if(i>YQ)n=kX(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(n,this.ns);else{if((i=r*this.ns)<=0)return null;o=0}var a=this.ns*CX(e-this.long0);return t.x=this.k0*(o*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,t},inverse:function(t){var e,r,n,o,i,a=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+s*s),r=1):(e=-Math.sqrt(a*a+s*s),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*a,r*s)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(o=AX(this.e,n)))return null}else o=-qQ;return i=CX(u/this.ns+this.long0),t.x=i,t.y=o,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var p$={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,o,i,a,s,u=t.x,l=t.y,c=CX(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,o=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(o)),a=this.n*i,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(o/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,o,i,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),i=Math.sqrt(t.x*t.x+t.y*t.y),o=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/i,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(o)),r=Math.asin(Math.cos(n)*Math.sin(o)/Math.cos(e)),t.x=this.long0-r/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function h$(t,e,r,n,o){return t*o-e*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)}function y$(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function d$(t){return.375*t*(1+.25*t*(1+.46875*t))}function v$(t){return.05859375*t*t*(1+.75*t)}function m$(t){return t*t*t*(35/3072)}function b$(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}function g$(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}var O$=.3333333333333333,E$=.17222222222222222,P$=.10257936507936508,x$=.06388888888888888,T$=.0664021164021164,C$=.016415012942191543;var k$={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-qQ)0)switch(this.qp=_$(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=t*O$,e=t*t,r[0]+=e*E$,r[1]=e*x$,e*=t,r[0]+=e*P$,r[1]+=e*T$,r[2]=e*C$,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=_$(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,o,i,a,s,u,l,c,f=t.x,p=t.y;if(f=CX(f-this.long0),this.sphere){if(i=Math.sin(p),c=Math.cos(p),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+c*n:1+this.sinph0*i+this.cosph0*c*n)<=YQ)return null;e=(r=Math.sqrt(2/r))*c*Math.sin(f),r*=this.mode===this.EQUIT?i:this.cosph0*i-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(p+this.lat0)=0?(e=(l=Math.sqrt(a))*o,r=n*(this.mode===this.S_POLE?l:-l)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,o,i,a,s,u,l,c,f=t.x/this.a,p=t.y/this.a;if(this.sphere){var h,y=0,d=0;if((r=.5*(h=Math.sqrt(f*f+p*p)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(r),y=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(h)<=YQ?0:Math.asin(p*d/h),f*=d,p=y*h;break;case this.OBLIQ:r=Math.abs(h)<=YQ?this.lat0:Math.asin(y*this.sinph0+p*d*this.cosph0/h),f*=d*this.cosph0,p=(y-Math.sin(r)*this.sinph0)*h;break;case this.N_POLE:p=-p,r=qQ-r;break;case this.S_POLE:r-=qQ}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,p):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,p*=this.dd,(a=Math.sqrt(f*f+p*p))1&&(t=t>1?1:-1),Math.asin(t)}var j$={init:function(){Math.abs(this.lat1+this.lat2)YQ?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=_$(this.e3,this.sin_phi),o=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,i=this.ns0*CX(e-this.long0),a=o*Math.sin(i)+this.x0,s=this.rh-o*Math.cos(i)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,r,n,o,i,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),o=0,0!==e&&(o=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),i=CX(o/this.ns0+this.long0),t.x=i,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,o,i,a,s=A$(.5*e);if(t0||Math.abs(i)<=YQ?(a=this.x0+1*this.a*r*Math.sin(n)/i,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*o)/i):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*o)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,o,i,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(o=Math.atan2(e,this.rc),r=Math.sin(o),a=A$((n=Math.cos(o))*this.sin_p14+t.y*r*this.cos_p14/e),i=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),i=CX(this.long0+i)):(a=this.phic0,i=0),t.x=i,t.y=a,t},names:["gnom"]};var I$={init:function(){this.sphere||(this.k0=xX(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,o=t.y,i=CX(n-this.long0);if(this.sphere)e=this.x0+this.a*i*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(o)/Math.cos(this.lat_ts);else{var a=_$(this.e,Math.sin(o));e=this.x0+this.a*this.k0*i,r=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=CX(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*qQ:qQ;for(var n,o,i,a,s=Math.asin(.5*e),u=0;u<30;u++)if(o=Math.sin(s),i=Math.cos(s),a=t*o,s+=n=Math.pow(1-a*a,2)/(2*i)*(e/(1-t*t)-o/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=CX(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]};var M$={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=CX(e-this.long0),o=g$(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*o,t},inverse:function(t){var e=t.x,r=t.y;return t.x=CX(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=g$(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},R$=20;var L$={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=y$(this.es),this.e1=d$(this.es),this.e2=v$(this.es),this.e3=m$(this.es),this.ml0=this.a*h$(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,o=t.x,i=t.y,a=CX(o-this.long0);if(n=a*Math.sin(i),this.sphere)Math.abs(i)<=YQ?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(i),r=this.a*(g$(i-this.lat0)+(1-Math.cos(n))/Math.tan(i)));else if(Math.abs(i)<=YQ)e=this.a*a,r=-1*this.ml0;else{var s=b$(this.a,this.e,Math.sin(i))/Math.tan(i);e=s*Math.sin(n),r=this.a*h$(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+s*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,o,i,a,s,u,l;if(n=t.x-this.x0,o=t.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=YQ)e=CX(n/this.a+this.long0),r=0;else{var c;for(a=this.lat0+o/this.a,s=n*n/this.a/this.a+a*a,u=a,i=R$;i;--i)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=YQ){r=u;break}e=CX(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(r))}else if(Math.abs(o+this.ml0)<=YQ)r=0,e=CX(this.long0+n/this.a);else{var f,p,h,y,d;for(a=(this.ml0+o)/this.a,s=n*n/this.a/this.a+a*a,u=a,i=R$;i;--i)if(d=this.e*Math.sin(u),f=Math.sqrt(1-d*d)*Math.tan(u),p=this.a*h$(this.e0,this.e1,this.e2,this.e3,u),h=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(f*(y=p/this.a)+1)-y-.5*f*(y*y+s))/(this.es*Math.sin(2*u)*(y*y+s-2*a*y)/(4*f)+(a-y)*(f*h-2/Math.sin(2*u))-h),Math.abs(l)<=YQ){r=u;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=CX(this.long0+Math.asin(n*f/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]};var D$={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,o=r-this.long0,i=n/HQ*1e-5,a=o,s=1,u=0;for(e=1;e<=10;e++)s*=i,u+=this.A[e]*s;var l,c=u,f=a,p=1,h=0,y=0,d=0;for(e=1;e<=6;e++)l=h*c+p*f,p=p*c-h*f,h=l,y=y+this.B_re[e]*p-this.B_im[e]*h,d=d+this.B_im[e]*p+this.B_re[e]*h;return t.x=d*this.a+this.x0,t.y=y*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,o=t.y,i=n-this.x0,a=(o-this.y0)/this.a,s=i/this.a,u=1,l=0,c=0,f=0;for(e=1;e<=6;e++)r=l*a+u*s,u=u*a-l*s,l=r,c=c+this.C_re[e]*u-this.C_im[e]*l,f=f+this.C_im[e]*u+this.C_re[e]*l;for(var p=0;p.999999999999&&(r=.999999999999),e=Math.asin(r);var n=CX(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var o=Math.asin(r);return t.x=n,t.y=o,t},names:["Mollweide","moll"]};var V$={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var i=0;return 0!==r&&(i=Math.atan2(e*t.x,e*t.y)),this.sphere?(o=CX(this.long0+i/this.ns),n=g$(this.g-r/this.a),t.x=o,t.y=n,t):(n=S$(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),o=CX(this.long0+i/this.ns),t.x=o,t.y=n,t)},names:["Equidistant_Conic","eqdc"]};var z$={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,o=t.y,i=CX(n-this.long0);Math.abs(o)<=YQ&&(e=this.x0+this.R*i,r=this.y0);var a=A$(2*Math.abs(o/Math.PI));(Math.abs(i)<=YQ||Math.abs(Math.abs(o)-qQ)<=YQ)&&(e=this.x0,r=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/i-i/Math.PI),u=s*s,l=Math.sin(a),c=Math.cos(a),f=c/(l+c-1),p=f*f,h=f*(2/l-1),y=h*h,d=Math.PI*this.R*(s*(f-y)+Math.sqrt(u*(f-y)*(f-y)-(y+u)*(p-y)))/(y+u);i<0&&(d=-d),e=this.x0+d;var v=u+f;return d=Math.PI*this.R*(h*v-s*Math.sqrt((y+u)*(u+1)-v*v))/(y+u),r=o>=0?this.y0+d:this.y0-d,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,o,i,a,s,u,l,c,f,p;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,i=(n=t.x/f)*n+(o=t.y/f)*o,f=3*(o*o/(u=-2*(a=-Math.abs(o)*(1+i))+1+2*o*o+i*i)+(2*(s=a-2*o*o+n*n)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(f)>1&&(f=f>=0?1:-1),p=Math.acos(f)/3,r=t.y>=0?(-c*Math.cos(p+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(n)2*qQ*this.a)return;return r=e/this.a,n=Math.sin(r),o=Math.cos(r),i=this.long0,Math.abs(e)<=YQ?a=this.lat0:(a=A$(o*this.sin_p12+t.y*n*this.cos_p12/e),s=Math.abs(this.lat0)-qQ,i=Math.abs(s)<=YQ?this.lat0>=0?CX(this.long0+Math.atan2(t.x,-t.y)):CX(this.long0-Math.atan2(-t.x,t.y)):CX(this.long0+Math.atan2(t.x*n,e*this.cos_p12*o-t.y*this.sin_p12*n))),t.x=i,t.y=a,t}return u=y$(this.es),l=d$(this.es),c=v$(this.es),f=m$(this.es),Math.abs(this.sin_p12-1)<=YQ?(a=S$(((p=this.a*h$(u,l,c,f,qQ))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,u,l,c,f),i=CX(this.long0+Math.atan2(t.x,-1*t.y)),t.x=i,t.y=a,t):Math.abs(this.sin_p12+1)<=YQ?(p=this.a*h$(u,l,c,f,qQ),a=S$(((e=Math.sqrt(t.x*t.x+t.y*t.y))-p)/this.a,u,l,c,f),i=CX(this.long0+Math.atan2(t.x,t.y)),t.x=i,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.x,t.y),h=b$(this.a,this.e,this.sin_p12),v=Math.cos(d),b=-(m=this.e*this.cos_p12*v)*m/(1-this.es),g=3*this.es*(1-b)*this.sin_p12*this.cos_p12*v/(1-this.es),_=1-b*(w=(S=e/h)-b*(1+b)*Math.pow(S,3)/6-g*(1+3*b)*Math.pow(S,4)/24)*w/2-S*w*w*w/6,y=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*v),i=CX(this.long0+Math.asin(Math.sin(d)*Math.sin(w)/Math.cos(y))),O=Math.sin(y),a=Math.atan2((O-this.es*_*this.sin_p12)*Math.tan(y),O*(1-this.es)),t.x=i,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var q$={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,o,i,a,s,u=t.x,l=t.y;return n=CX(u-this.long0),e=Math.sin(l),r=Math.cos(l),o=Math.cos(n),((i=this.sin_p14*e+this.cos_p14*r*o)>0||Math.abs(i)<=YQ)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*o)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,o,i,a,s;return t.x-=this.x0,t.y-=this.y0,r=A$((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),n=Math.sin(r),o=Math.cos(r),a=this.long0,Math.abs(e)<=YQ?(s=this.lat0,t.x=a,t.y=s,t):(s=A$(o*this.sin_p14+t.y*n*this.cos_p14/e),i=Math.abs(this.lat0)-qQ,Math.abs(i)<=YQ?(a=this.lat0>=0?CX(this.long0+Math.atan2(t.x,-t.y)):CX(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=s,t):(a=CX(this.long0+Math.atan2(t.x*n,e*this.cos_p14*o-t.y*this.sin_p14*n)),t.x=a,t.y=s,t))},names:["ortho"]},J$={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},W$={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function K$(t,e,r,n){var o;return tZQ&&o<=qQ+ZQ?(n.value=W$.AREA_1,o-=qQ):o>qQ+ZQ||o<=-(qQ+ZQ)?(n.value=W$.AREA_2,o=o>=0?o-tX:o+tX):(n.value=W$.AREA_3,o+=qQ)),o}function Y$(t,e){var r=t+e;return r<-tX?r+=$Q:r>+tX&&(r-=$Q),r}var Q$={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=qQ-ZQ/2?this.face=J$.TOP:this.lat0<=-(qQ-ZQ/2)?this.face=J$.BOTTOM:Math.abs(this.long0)<=ZQ?this.face=J$.FRONT:Math.abs(this.long0)<=qQ+ZQ?this.face=this.long0>0?J$.RIGHT:J$.LEFT:this.face=J$.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,o,i,a,s={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,this.face===J$.TOP)o=qQ-e,r>=ZQ&&r<=qQ+ZQ?(u.value=W$.AREA_0,n=r-qQ):r>qQ+ZQ||r<=-(qQ+ZQ)?(u.value=W$.AREA_1,n=r>0?r-tX:r+tX):r>-(qQ+ZQ)&&r<=-ZQ?(u.value=W$.AREA_2,n=r+qQ):(u.value=W$.AREA_3,n=r);else if(this.face===J$.BOTTOM)o=qQ+e,r>=ZQ&&r<=qQ+ZQ?(u.value=W$.AREA_0,n=-r+qQ):r=-ZQ?(u.value=W$.AREA_1,n=-r):r<-ZQ&&r>=-(qQ+ZQ)?(u.value=W$.AREA_2,n=-r-qQ):(u.value=W$.AREA_3,n=r>0?-r+tX:-r-tX);else{var l,c,f,p,h,y;this.face===J$.RIGHT?r=Y$(r,+qQ):this.face===J$.BACK?r=Y$(r,+tX):this.face===J$.LEFT&&(r=Y$(r,-qQ)),p=Math.sin(e),h=Math.cos(e),y=Math.sin(r),l=h*Math.cos(r),c=h*y,f=p,this.face===J$.FRONT?n=K$(o=Math.acos(l),f,c,u):this.face===J$.RIGHT?n=K$(o=Math.acos(c),f,-l,u):this.face===J$.BACK?n=K$(o=Math.acos(-l),f,-c,u):this.face===J$.LEFT?n=K$(o=Math.acos(-c),f,l,u):(o=n=0,u.value=W$.AREA_0)}return a=Math.atan(12/tX*(n+Math.acos(Math.sin(n)*Math.cos(ZQ))-qQ)),i=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),u.value===W$.AREA_1?a+=qQ:u.value===W$.AREA_2?a+=tX:u.value===W$.AREA_3&&(a+=1.5*tX),s.x=i*Math.cos(a),s.y=i*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,r,n,o,i,a,s,u,l,c,f,p,h={lam:0,phi:0},y={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?y.value=W$.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(y.value=W$.AREA_1,e-=qQ):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=W$.AREA_2,e=e<0?e+tX:e-tX):(y.value=W$.AREA_3,e+=qQ),l=tX/12*Math.tan(e),i=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),a=Math.atan(i),(s=1-(n=Math.cos(e))*n*(o=Math.tan(r))*o*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===J$.TOP)u=Math.acos(s),h.phi=qQ-u,y.value===W$.AREA_0?h.lam=a+qQ:y.value===W$.AREA_1?h.lam=a<0?a+tX:a-tX:y.value===W$.AREA_2?h.lam=a-qQ:h.lam=a;else if(this.face===J$.BOTTOM)u=Math.acos(s),h.phi=u-qQ,y.value===W$.AREA_0?h.lam=-a+qQ:y.value===W$.AREA_1?h.lam=-a:y.value===W$.AREA_2?h.lam=-a-qQ:h.lam=a<0?-a-tX:-a+tX;else{var d,v,m;l=(d=s)*d,v=(l+=(m=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*m)>=1?0:Math.sqrt(1-l),y.value===W$.AREA_1?(l=v,v=-m,m=l):y.value===W$.AREA_2?(v=-v,m=-m):y.value===W$.AREA_3&&(l=v,v=m,m=-l),this.face===J$.RIGHT?(l=d,d=-v,v=l):this.face===J$.BACK?(d=-d,v=-v):this.face===J$.LEFT&&(l=d,d=v,v=-l),h.phi=Math.acos(-m)-qQ,h.lam=Math.atan2(v,d),this.face===J$.RIGHT?h.lam=Y$(h.lam,-qQ):this.face===J$.BACK?h.lam=Y$(h.lam,-tX):this.face===J$.LEFT&&(h.lam=Y$(h.lam,+qQ))}return 0!==this.es&&(c=h.phi<0?1:0,f=Math.tan(h.phi),p=this.b/Math.sqrt(f*f+this.one_minus_f_squared),h.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(h.phi=-h.phi)),h.lam+=this.long0,t.x=h.lam,t.y=h.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},X$=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Z$=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],$$=.8487,t0=1.3523,e0=XQ/5,r0=1/e0,n0=18,o0=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},i0=function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])};var a0={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=CX(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*e0);n<0?n=0:n>=n0&&(n=n0-1),r=XQ*(r-r0*n);var o={x:o0(X$[n],r)*e,y:o0(Z$[n],r)};return t.y<0&&(o.y=-o.y),o.x=o.x*this.a*$$+this.x0,o.y=o.y*this.a*t0+this.y0,o},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*$$),y:Math.abs(t.y-this.y0)/(this.a*t0)};if(e.y>=1)e.x/=X$[n0][0],e.y=t.y<0?-qQ:qQ;else{var r=Math.floor(e.y*n0);for(r<0?r=0:r>=n0&&(r=n0-1);;)if(Z$[r][0]>e.y)--r;else{if(!(Z$[r+1][0]<=e.y))break;++r}var n=Z$[r],o=5*(e.y-n[0])/(Z$[r+1][0]-n[0]);o=function(t,e,r,n){for(var o=e;n;--n){var i=t(o);if(o-=i,Math.abs(i)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,n,o,i=t.x,a=t.y;if(i-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/QZ(this.radius_p*Math.cos(a),Math.sin(a));if(r=s*Math.cos(i)*Math.cos(a),n=s*Math.sin(i)*Math.cos(a),o=s*Math.sin(a),(this.radius_g-r)*r-n*n-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/QZ(o,e)),t.y=this.radius_g_1*Math.atan(o/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(o/QZ(n,e)))}else"sphere"===this.shape&&(e=Math.cos(a),r=Math.cos(i)*e,n=Math.sin(i)*e,o=Math.sin(a),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/QZ(o,e)),t.y=this.radius_g_1*Math.atan(o/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(o/QZ(n,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,n,o,i=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*QZ(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*QZ(1,a));var u=s/this.radius_p;if(e=a*a+u*u+i*i,(n=(r=2*this.radius_g*i)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;o=(-r-Math.sqrt(n))/(2*e),i=this.radius_g+o*i,a*=o,s*=o,t.x=Math.atan2(a,i),t.y=Math.atan(s*Math.cos(t.x)/i),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+i*i,(n=(r=2*this.radius_g*i)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;o=(-r-Math.sqrt(n))/(2*e),i=this.radius_g+o*i,a*=o,s*=o,t.x=Math.atan2(a,i),t.y=Math.atan(s*Math.cos(t.x)/i)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},p0=1.340264,h0=-.081106,y0=893e-6,d0=.003796,v0=Math.sqrt(3)/2;var m0={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=CX(t.x-this.long0),r=t.y,n=Math.asin(v0*Math.sin(r)),o=n*n,i=o*o*o;return t.x=e*Math.cos(n)/(v0*(p0+3*h0*o+i*(7*y0+9*d0*o))),t.y=n*(p0+h0*o+i*(y0+d0*o)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,r,n,o,i=t.y;for(o=0;o<12&&(i-=n=(i*(p0+h0*(e=i*i)+(r=e*e*e)*(y0+d0*e))-t.y)/(p0+3*h0*e+r*(7*y0+9*d0*e)),!(Math.abs(n)<1e-9));++o);return r=(e=i*i)*e*e,t.x=v0*t.x*(p0+3*h0*e+r*(7*y0+9*d0*e))/Math.cos(i),t.y=Math.asin(Math.sin(i)/v0),t.x=CX(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};fZ.defaultDatum="WGS84",fZ.Proj=QX,fZ.WGS84=new fZ.Proj("WGS84"),fZ.Point=jZ,fZ.toPoint=iZ,fZ.defs=wX,fZ.nadgrid=function(t,e){var r=new DataView(e),n=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),o=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:HX(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,n),i={header:o,subgrids:function(t,e,r){for(var n=176,o=[],i=0;it.length)&&(e=t.length);for(var r=0,n=new Array(e);rthis.bounds.max.x?this.bounds.max.x:t.x,t.y=t.ythis.bounds.max.y?this.bounds.max.y:t.y);var r=this._proj.inverse([t.x,t.y]);return new(RQ().LatLng)(r[1],r[0],e)},_projFromCodeDef:function(t,e){if(e)b0.defs(t,e);else if(void 0===b0.defs[t]){var r=t.split(":");if(r.length>3&&(t=r[r.length-3]+":"+r[r.length-1]),void 0===b0.defs[t])throw"No projection definition for code "+t}return b0(t)},getUnits:function(){return this._proj.oProj.units||"degrees"}});var w0=RQ().Class.extend({includes:RQ().CRS,options:{transformation:new(RQ().Transformation)(1,0,-1,0)},initialize:function(t,e){var r,n,o;if(e.bounds&&4===e.bounds.length){var i=g0(e.bounds,4),a=i[0],s=i[1],u=i[2],l=i[3];e.bounds=[[a,s],[u,l]]}if(RQ().Proj._isProj4Obj(t)?(r=(n=t).srsCode,e=e||{},this.projection=new(RQ().Proj.Projection)(n,e.bounds,e.wrapLng)):(r=t,o=(e=e||{}).def||"",this.projection=new(RQ().Proj.Projection)(r,o,e.bounds,e.wrapLng)),RQ().Util.setOptions(this,e),this.options.wrapLng&&(this.wrapLng=this.options.wrapLng),this.code=r,this.transformation=this.options.transformation,this.options.dpi=this.options.dpi||96,this.options.bounds&&(this.options.bounds=RQ().bounds(this.options.bounds)),!this.options.origin&&this.options.bounds&&(this.options.origin=[this.options.bounds.min.x,this.options.bounds.max.y]),this.options.origin&&(this.options.origin instanceof RQ().Point&&(this.options.origin=[this.options.origin.x,this.options.origin.y]),this.transformation=new(RQ().Transformation)(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales&&this.options.scales.length>0)this.scales=this.options.scales,this._scales=this._toProj4Scales(this.options.scales,this.options.dpi);else if(this.options.scaleDenominators&&this.options.scaleDenominators.length>0){this.scales=[];for(var c=0;c0){this._scales=[];for(var f=this.options.resolutions.length-1;f>=0;f--)this.options.resolutions[f]&&(this._scales[f]=1/this.options.resolutions[f])}else this.options.bounds&&(this._scales=this._getDefaultProj4ScalesByBounds(this.options.bounds));this._rectify(),this.infinite=!this.options.bounds},_rectify:function(){if(this._scales&&(this.resolutions||(this.resolutions=[],this.resolutions=this._proj4ScalesToResolutions(this._scales)),!this.scales)){this.scales=[];for(var t=0;t© SuperMap iClient",Common:{attribution:"Map Data © SuperMap iServer"},Online:{attribution:"Map Data © SuperMap Online"},ECharts:{attribution:"© 2018 百度 ECharts"},MapV:{attribution:"© 2018 百度 MapV "},Turf:{attribution:"© turfjs"},Baidu:{attribution:"Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方"},Cloud:{attribution:"Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo"},Tianditu:{attribution:"Map Data "}};RQ().Control.Attribution.include({options:{position:"bottomright",prefix:O0.Prefix}}),RQ().Map.include({latLngToAccurateContainerPoint:function(t){var e=this.project(RQ().latLng(t))._subtract(this.getPixelOrigin());return RQ().point(e).add(this._getMapPanePos())}}),[RQ().Polyline,RQ().Polygon,RQ().Marker,RQ().CircleMarker,RQ().Circle,RQ().LayerGroup].map(function(t){return t.defaultFunction=t.prototype.toGeoJSON,t.include({toGeoJSON:function(e){return t.defaultFunction.call(this,e||RQ().toGeoJSONPrecision||15)}}),t});var E0=RQ().Evented.extend({options:{url:null,proxy:null,withCredentials:!1,crossOrigin:null},initialize:function(t,e){t&&(t=t.indexOf("/")!==t.length-1?t:t.substr(0,t.length-1)),this.url=t,RQ().setOptions(this,e),this.fire("initialized",this)},destroy:function(){this.fire("destroy",this)}}),P0=E0.extend({options:{projection:null},initialize:function(t,e){e=e||{},RQ().setOptions(this,e),e.projection&&(this.options.projection=e.projection),E0.prototype.initialize.call(this,t,e)},getMapInfo:function(t){var e=this;return new DO(e.url,{proxy:e.options.proxy,withCredentials:e.options.withCredentials,crossOrigin:e.options.crossOrigin,headers:e.options.headers,projection:e.options.projection}).processAsync(t)},getWKT:function(t){var e=this;return new DO(Tt.urlPathAppend(e.url,"prjCoordSys.wkt"),{proxy:e.options.proxy,withCredentials:e.options.withCredentials,withoutFormatSuffix:!0,crossOrigin:e.options.crossOrigin,headers:e.options.headers,projection:e.options.projection}).processAsync(t)},getTilesets:function(t){var e=this;return new vN(e.url,{proxy:e.options.proxy,withCredentials:e.options.withCredentials,crossOrigin:e.options.crossOrigin,headers:e.options.headers}).processAsync(t)}}),x0=RQ().Control.extend({options:{layer:null,position:"topleft",title:"switch tile version",tooltip:"top",collapsed:!0,nextText:"+",lastText:"-",ico:"V",orientation:"horizontal",switch:!0},onAdd:function(){"vertical"!==this.options.orientation&&(this.options.orientation="horizontal");var t=this._initLayout();return this.options.layer&&this.setLayer(this.options.layer),t},setContent:function(t){var e=RQ().Util.extend({},t);this.setVersionName(e.desc).setToolTip(e.desc)},setVersionName:function(t){var e=t;return t||(e=this.getValue()),this._sliderValue.innerHTML=e,this},setToolTip:function(t){return this.tooltip.innerHTML=t,this},updateLength:function(t){t>0&&(this.length=t,this.max=this.length-1,this.slider.setAttribute("max",this.max))},setLayer:function(t){t&&(this.options.layer=t);var e=this,r=e.options.layer;r.on("tilesetsinfoloaded",function(t){var r=t&&t.tileVersions;e.update(r)}),r.on("tileversionschanged",function(t){var r=t&&t.tileVersion;e.setContent(r)}),e.getTileSetsInfo()},update:function(t){this.tileVersions=t||[],this.updateLength(this.tileVersions.length)},getTileSetsInfo:function(){var t=this;t.options.layer&&new P0(t.options.layer._url).getTilesets(function(e){t.options.layer.setTileSetsInfo(e.result)})},removeLayer:function(){this.options.layer=null},nextTilesVersion:function(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)},lastTilesVersion:function(){return parseInt(this.slider.value)";return t.innerHTML=a?""+s+"":s,t}});RQ().Map.mergeOptions({logoControl:!0}),RQ().Map.addInitHook(function(){!this._logoAdded&&this.options.logoControl&&(!0===this.options.logoControl?this.logoControl=new T0:this.options.logoControl instanceof RQ().Control&&(this.logoControl=this.options.logoControl),this.logoControl&&(this.addControl(this.logoControl),this._logoAdded=!0))});for(var C0,k0=function(t){return"[object Array]"==Object.prototype.toString.call(t)},A0={toSuperMapBounds:function(t){return t&&-1!==["FeatureCollection","Feature"].indexOf(t.type)&&(t=RQ().geoJSON(t).getBounds()),t instanceof RQ().LatLngBounds?new Dt(t.getSouthWest().lng,t.getSouthWest().lat,t.getNorthEast().lng,t.getNorthEast().lat):t instanceof RQ().Bounds?new Dt(t.min.x,t.min.y,t.max.x,t.max.y):t instanceof Dt?t:k0(t)?new Dt(t[0],t[1],t[2],t[3]):new Dt},isArray:k0,toProcessingParam:function(t){var e={};if(t.length<1)e="";else{for(var r=[],n=0;n-1?r:Math.log(t/(1/this.resolutions[0]))/Math.LN2},distance:function(t,e){var r=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(r*r+n*n)},infinite:!1}),z0=function(t){return new V0(t)},H0=function(t){return t?-1!=["FeatureCollection","Feature","Geometry"].indexOf(t.type)||t.coordinates?t:t.toGeoJSON?t.toGeoJSON():t instanceof RQ().LatLngBounds?RQ().rectangle(t).toGeoJSON():t instanceof RQ().Bounds?RQ().rectangle([[t.getTopLeft().x,t.getTopLeft().y],[t.getBottomRight().x,t.getBottomRight().y]]).toGeoJSON():(new Ln).toGeoJSON(t):t},q0=function(t){if(!t)return t;var e,r=new Ln;if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(t.type))e=r.read(t,t.type);else if("function"==typeof t.toGeoJSON){var n=t.toGeoJSON();e=n?r.read(n,n.type):t}var o=e||t;return RQ().Util.isArray(e)&&(1===e.length?o=e[0]:e.length>1&&(o=[],e.map(function(t){return o.push(t.geometry),t}))),o&&o.geometry?o.geometry:o},J0=HD,W0=function(t,e,r){var n=t*e*(1/.0254)*J0(r);return n=1/n},K0=function(t,e,r){var n=t*e*(1/.0254)*J0(r);return n=1/n},Y0=function(t){return t>1?1/t:t},Q0=function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?(t=Y0(t),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4):-1},X0=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:RQ().CRS.EPSG4326,r=arguments.length>2?arguments[2]:void 0,n=null,o=null;if(-1===["FeatureCollection","Feature","Geometry"].indexOf(t.type))if(t.toGeoJSON)t=t.toGeoJSON();else if(t instanceof RQ().LatLngBounds)t=RQ().rectangle(t).toGeoJSON();else{if(!(t instanceof RQ().Bounds))throw new Error("This tool only supports data conversion in geojson format or Vector Layers of Leaflet.");t=RQ().rectangle([[t.getTopLeft().x,t.getTopLeft().y],[t.getBottomRight().x,t.getBottomRight().y]]).toGeoJSON()}var i={point:function(t){return o(t)},multipoint:function(t){return i.linestring.apply(this,[t])},linestring:function(t){for(var e=[],r=null,n=0,o=t.length;n(this._map.options.maxZoom||18)||t<(this._map.options.minZoom||0))this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null);else{var r=this._getImageParams(e);r?this._requestImage(r,e):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_calculateBounds:function(t){var e=this._map.options.crs.project(t.getNorthEast()),r=this._map.options.crs.project(t.getSouthWest());return RQ().bounds(e,r)},_compriseBounds:function(t){var e={leftBottom:{x:t.getBottomLeft().x,y:t.getTopRight().y},rightTop:{x:t.getTopRight().x,y:t.getBottomLeft().y}};return JSON.stringify(e)},_calculateImageSize:function(t){return new(RQ().Bounds)(this._map.latLngToLayerPoint(t.getNorthWest()),this._map.latLngToLayerPoint(t.getSouthEast())).getSize()}}),n1=RQ().TileLayer.extend({options:{version:"1.0.0",style:"",tilematrixSet:"",format:"image/png",tileSize:256,matrixIds:null,layer:"",requestEncoding:"KVP",attribution:"",noWrap:!0},initialize:function(t,e){this._url=t,RQ().setOptions(this,e);var r=this.options;if("REST"===r.requestEncoding){this.formatSuffix="."+({"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"}[r.format]||r.format.split("/").pop()||"png")}else r.requestEncoding="KVP"},getTileUrl:function(t){var e=this._getZoomForUrl(),r=this.options.matrixIds?this.options.matrixIds[e].identifier:e,n=this._url.indexOf("?"),o=n>-1?this._url.substring(0,this._url.indexOf("?")):this._url,i=n>-1?this._url.substring(this._url.indexOf("?")):"";o=RQ().Util.template(o,{s:this._getSubdomain(t)});var a={service:"WMTS",request:"GetTile",version:this.options.version,style:this.options.style,tilematrixSet:this.options.tilematrixSet,format:this.options.format,width:this.options.tileSize,height:this.options.tileSize,layer:this.options.layer,tilematrix:r,tilerow:t.y,tilecol:t.x};if(this.options.tileProxy&&(o=this.options.tileProxy+o),"KVP"===this.options.requestEncoding)o+=RQ().Util.getParamString(a,o);else if("REST"===this.options.requestEncoding){o+="/"+a.layer+"/"+a.style+"/"+a.tilematrixSet+"/"+a.tilematrix+"/"+a.tilerow+"/"+a.tilecol+this.formatSuffix}return o=Tt.urlAppend(o,i),o=yo.appendCredential(o)}}),o1=function(t,e){return new n1(t,e)},i1=n1.extend({layerLabelMap:{vec:"cva",ter:"cta",img:"cia"},layerZoomMap:{vec:18,ter:14,img:18},options:{layerType:"vec",isLabel:!1,attribution:O0.Tianditu.attribution,url:"https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?",zoomOffset:1,key:"",dpi:96,style:"default",format:"tiles",subdomains:[0,1,2,3,4,5,6,7],bounds:[[-90,-180],[90,180]],noWrap:!0},initialize:function(t){t=t||{},RQ().setOptions(this,t),this.options.layer=this.options.isLabel?this.layerLabelMap[this.options.layerType]:this.options.layerType,this.options.maxZoom=this.layerZoomMap[this.options.layerType]-1,n1.prototype.initialize.call(this,this.options.url,this.options),RQ().stamp(this),this.options.key&&(this._url="".concat(this._url,"tk=").concat(this.options.key))},onAdd:function(t){this.options.tilematrixSet="EPSG:4326"===t.options.crs.code?"c":"w",this._url=this._url.replace("{layer}",this.options.layer).replace("{proj}",this.options.tilematrixSet),n1.prototype.onAdd.call(this,t)},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var r=this._globalTileRange;if((!e.wrapLng||this.options.noWrap)&&(t.xr.max.x)||!e.wrapLat&&(t.yr.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return RQ().latLngBounds(this.options.bounds).overlaps(n)}}),a1=RQ().TileLayer.extend({options:{layersID:null,redirect:!1,transparent:!0,cacheEnabled:!0,clipRegionEnabled:!1,clipRegion:null,prjCoordSys:null,overlapDisplayed:!1,overlapDisplayedOptions:null,tileversion:null,crs:null,format:"png",tileProxy:null,attribution:O0.Common.attribution,subdomains:null},initialize:function(t,e){this._url=t,RQ().TileLayer.prototype.initialize.apply(this,arguments),RQ().setOptions(this,e),RQ().stamp(this),this.tileSetsIndex=-1,this.tempIndex=-1},onAdd:function(t){this._crs=this.options.crs||t.options.crs,RQ().TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this.getScaleFromCoords(t),r=this._getLayerUrl()+"&scale="+e+"&x="+t.x+"&y="+t.y;return this.options.tileProxy&&(r=this.options.tileProxy+encodeURIComponent(r)),this.options.cacheEnabled||(r+="&_t="+(new Date).getTime()),this.options.subdomains&&(r=RQ().Util.template(r,{s:this._getSubdomain(t)})),r},getScale:function(t){var e=t||this._map.getZoom();return this.scales[e]},getScaleFromCoords:function(t){var e,r=this;return r.scales&&r.scales[t.z]?r.scales[t.z]:(r.scales=r.scales||{},e=r.getDefaultScale(t),r.scales[t.z]=e,e)},getDefaultScale:function(t){var e=this._crs;if(e.scales)return e.scales[t.z];var r=this._tileCoordsToBounds(t),n=e.project(r.getNorthEast()),o=e.project(r.getSouthWest()),i=this.options.tileSize,a=Math.max(Math.abs(n.x-o.x)/i,Math.abs(n.y-o.y)/i),s=c.METER;if(e.code){var u=e.code.split(":");if(u&&u.length>1){var l=parseInt(u[1]);s=l&&l>=4e3&&l<=5e3?c.DEGREE:c.METER}}return W0(a,96,s)},setTileSetsInfo:function(t){this.tileSets=t,RQ().Util.isArray(this.tileSets)&&(this.tileSets=this.tileSets[0]),this.tileSets&&(this.fire("tilesetsinfoloaded",{tileVersions:this.tileSets.tileVersions}),this.changeTilesVersion())},lastTilesVersion:function(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()},nextTilesVersion:function(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()},changeTilesVersion:function(){var t=this;if(null!=t.tileSets&&!(t.tempIndex===t.tileSetsIndex||this.tempIndex<0)){var e=t.tileSets.tileVersions;if(e&&t.tempIndex=0){var r=e[t.tempIndex].name;t.mergeTileVersionParam(r)&&(t.tileSetsIndex=t.tempIndex,t.fire("tileversionschanged",{tileVersion:e[t.tempIndex]}))}}},updateCurrentTileSetsIndex:function(t){this.tempIndex=t},mergeTileVersionParam:function(t){return!!t&&(this.requestParams.tileversion=t,this._paramsChanged=!0,this.redraw(),this._paramsChanged=!1,!0)},updateParams:function(t){Object.assign(this.requestParams,t),this._paramsChanged=!0,this.redraw(),this._paramsChanged=!1},_getLayerUrl:function(){return this._paramsChanged&&(this._layerUrl=this._createLayerUrl()),this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){var t=Tt.urlPathAppend(this._url,"tileImage.".concat(this.options.format));return this.requestParams=this.requestParams||this._getAllRequestParams(),t=Tt.urlAppend(t,Tt.getParameterString(this.requestParams)),t=yo.appendCredential(t),this._layerUrl=t,t},_getAllRequestParams:function(){var t=this.options||{},e={},r=this.options.tileSize;r instanceof RQ().Point||(r=RQ().point(r,r)),e.width=r.x,e.height=r.y,e.redirect=!0===t.redirect,e.transparent=!0===t.transparent,e.cacheEnabled=!(!1===t.cacheEnabled),t.prjCoordSys&&(e.prjCoordSys=JSON.stringify(t.prjCoordSys)),t.layersID&&(e.layersID=t.layersID.toString()),t.clipRegionEnabled&&t.clipRegion&&(t.clipRegion=Xr.fromGeometry(q0(t.clipRegion)),e.clipRegionEnabled=t.clipRegionEnabled,e.clipRegion=JSON.stringify(t.clipRegion));var n=this._crs;if(n.options&&n.options.origin)e.origin=JSON.stringify({x:n.options.origin[0],y:n.options.origin[1]});else if(n.projection&&n.projection.bounds){var o=n.projection.bounds,i=RQ().point(o.min.x,o.max.y);e.origin=JSON.stringify({x:i.x,y:i.y})}return!1===t.overlapDisplayed?(e.overlapDisplayed=!1,t.overlapDisplayedOptions&&(e.overlapDisplayedOptions=t.overlapDisplayedOptions)):e.overlapDisplayed=!0,!0===e.cacheEnabled&&t.tileversion&&(e.tileversion=t.tileversion.toString()),t.rasterfunction&&(e.rasterfunction=JSON.stringify(t.rasterfunction)),t.chartSetting&&(e.chartSetting=JSON.stringify(t.chartSetting)),e}}),s1=function(t,e){return new a1(t,e)},u1=r(3871),l1=r.n(u1),c1={TEXT:{fontSize:"14px",fontFamily:"Arial Unicode MS Regular,Microsoft YaHei",textAlign:"left",color:"rgba(255,255,255,0)",fillColor:"rgba(80,80,80,1)",weight:1,globalAlpha:1},POINT:{fillColor:"#ffcc00",color:"#cc3333",weight:1,radius:3,opacity:1},LINE:{color:"rgba(0,0,0,0)",weight:1,lineCap:"butt",lineJoin:"round",dashOffset:0,dashArray:[],opacity:1},REGION:{color:"rgba(0,0,0,0)",fillColor:"rgba(0,0,0,0)",weight:1,lineCap:"butt",lineJoin:"round",dashOffset:0,opacity:1,fillOpacity:1,dashArray:[]}},f1={TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-name":"textName","text-weight":"fontWeight","text-halo-color":"color","text-fill":"fillColor","text-comp-op":"globalCompositeOperation"},POINT:{"point-file":"iconUrl","point-fill":"fillColor","point-radius":"radius","point-halo-color":"color","point-comp-op":"globalCompositeOperation"},LINE:{"line-color":"color","line-width":"weight","line-cap":"lineCap","line-join":"lineJoin","line-dash-offset":"dashOffset","line-opacity":"opacity","line-dasharray":"dashArray","line-comp-op":"globalCompositeOperation"},REGION:{"line-color":"color","line-width":"weight","line-cap":"lineCap","line-join":"lineJoin","line-dash-offset":"dashOffset","line-opacity":"opacity","line-dasharray":"dashArray","polygon-fill":"fillColor","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"}},p1={lineWidth:{leafletStyle:"weight",type:"number",unit:"mm",defaultValue:.1},fillForeColor:{leafletStyle:"fillColor",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{leafletStyle:"color",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{leafletStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},lineColor:{leafletStyle:"color",type:"color",defaultValue:"#000000"}},h1={clear:"",src:"",dst:"","src-over":"source-over","dst-over":"destination-over","src-in":"source-in","dst-in":"destination-in","src-out":"source-out","dst-out":"destination-out","src-atop":"source-atop","dst-atop":"destination-atop",xor:"xor",plus:"lighter",minus:"",multiply:"",screen:"",overlay:"",darken:"",lighten:"lighter","color-dodge":"","color-burn":"","hard-light":"","soft-light":"",difference:"",exclusion:"",contrast:"",invert:"","invert-rgb":"","grain-merge":"","grain-extract":"",hue:"",saturation:"",color:"",value:""};function y1(t){"@babel/helpers - typeof";return(y1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d1(t,e){for(var r=0;r-1;a--)if(t.indexOf(i[a])>-1){o=t.replace(i[a],r[i[a]]);break}o=o.replace(/[#]/gi,"#"),r[t]=n,e=e.replace(new RegExp(o,"g"),n)}),e=(e=e.replace(/[#]/gi,"\n#")).replace(/\[zoom/gi,"[scale")}}},{key:"pickShader",value:function(t){if(!this.cartoCSS)return null;var e=t.replace(/[@#\s]/gi,"___");return this.cartoCSS[e]}},{key:"getDefaultStyle",value:function(t){var e={},r=c1[t];for(var n in r){var o=r[n];e[n]=o}return e}},{key:"getStyleFromiPortalMarker",value:function(t){return 0==t.indexOf("./")?null:RQ().icon({iconUrl:t,iconSize:RQ().point(48,43),iconAnchor:RQ().point(24,43),popupAnchor:RQ().point(0,-43)})}},{key:"getStyleFromiPortalStyle",value:function(t,e,r){var n=r?JSON.parse(r):null,o={};if("Point"===e||"MultiPoint"===e){var i=n||t.pointStyle;return i.externalGraphic?0==i.externalGraphic.indexOf("./")?null:RQ().icon({iconUrl:i.externalGraphic,iconSize:RQ().point(i.graphicWidth,i.graphicHeight),iconAnchor:RQ().point(-i.graphicXOffset,-i.graphicYOffset),popupAnchor:RQ().point(0,-i.graphicHeight)}):(o.radius=i.pointRadius,o.color=i.strokeColor,o.opacity=i.strokeOpacity,o.lineCap=i.strokeLineCap,o.weight=i.strokeWidth,o.fillColor=i.fillColor,o.fillOpacity=i.fillOpacity,o.dashArray=this.dashStyle(i,1),o)}if("LineString"===e||"MultiLineString"===e||"Box"===e){var a=n||t.lineStyle;return o.color=a.strokeColor,o.opacity=a.strokeOpacity,o.fillOpacity=a.fillOpacity,o.lineCap=a.strokeLineCap,o.weight=a.strokeWidth,o.dashArray=this.dashStyle(a,1),o}if("Polygon"===e||"MultiPolygon"===e){var s=n||t.polygonStyle;return o.color=s.strokeColor,o.opacity=s.strokeOpacity,o.lineCap=s.strokeLineCap,o.weight=s.strokeWidth,o.fillColor=s.fillColor,o.fillOpacity=s.fillOpacity,o.dashArray=this.dashStyle(s,1),o}}},{key:"dashStyle",value:function(t,e){if(!t)return[];var r=t.strokeWidth*e,n=t.strokeDashstyle;switch(n){case"solid":return[];case"dot":return[1,4*r];case"dash":return[4*r,4*r];case"dashdot":return[4*r,4*r,1,4*r];case"longdash":return[8*r,4*r];case"longdashdot":return[8*r,4*r,1,4*r];default:return n?Tt.isArray(n)?n:(n=at.trim(n).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}}},{key:"getValidStyleFromCarto",value:function(t,e,r,n,o){if(!r)return null;var i=n.type,a=n.properties.attributes||{},s=this.getDefaultStyle(i);o=void 0===o||o,a.FEATUREID=n.properties.id,a.SCALE=e;for(var u,l,c=f1[i],f=0,p=r.length;f7?0:o.fillSymbolID,c=o.lineSymbolID>5?0:o.lineSymbolID;for(var f in o){var p=p1[f];if(p){var h=p.leafletStyle;switch(p.type){case"number":var y=o[f];p.unit&&(y=96*y*Ct[p.unit]*2.5),n[h]=y;break;case"color":var d=o[f],v=void 0,m=1;if("fillColor"===h)0!==l&&1!==l||(m=1-l,v="rgba("+d.red+","+d.green+","+d.blue+","+m+")");else if("color"===h){if(0===c||5===c)m=0===c?1:0;else{var b=[1,0];switch(c){case 1:b=[9.7,3.7];break;case 2:b=[3.7,3.7];break;case 3:b=[9.7,3.7,2.3,3.7];break;case 4:b=[9.7,3.7,2.3,3.7,2.3,3.7]}n.lineDasharray=b}v="rgba("+d.red+","+d.green+","+d.blue+","+m+")"}n[h]=v}}}return e.textField&&(n.textAlign="LEFT"),n}}])&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),b1=RQ().Class.extend({initialize:function(t){var e=(t=t||{}).latLng||t._latLng;this._latLng=RQ().latLng(e.lat,e.lng),this._style=t.style||t._canvas,this.attributes=t.attributes,this.id=t.id?t.id:null},getId:function(){return this.id},setId:function(t){this.id=t},setLatLng:function(t){this._latLng=t},setCanvas:function(t){this._style=t},setAttributes:function(t){this.attributes=t},getLatLng:function(){return this._latLng},getCanvas:function(){return this._style},getAttributes:function(){return this.attributes},setStyle:function(t){this._style=t},getStyle:function(){return this._style}}),g1=RQ().Class.extend({initialize:function(t,e){this.geometry=t,this.attributes=e},toFeature:function(){var t=this.geometry;if(t.toGeoJSON){var e=t.toGeoJSON();return e.properties=this.attributes,(new Ln).read(e)[0]}if(3===t.length)t=new ke(t[1],t[0],t[2]);else if(2===t.length)t=new he(t[0],t[1]);else if(t instanceof RQ().LatLng)t=new he(t.lng,t.lat);else if(t instanceof RQ().Point)t=new he(t.x,t.y);else if(t instanceof RQ().CircleMarker){var r=t.getLatLng();t=new he(r.lng,r.lat)}return new mn(t,this.attributes)},reverseLatLngs:function(t){RQ().Util.isArray(t)||(t=[t]);for(var e=0;e0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){var r=t.layerPoint;e.currentMousePosition=RQ().point(r.x+e.movingOffset[0],r.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.update(t.getBounds())}else t.removeLayer(e)},addFeatures:function(t){},redrawThematicFeatures:function(t){},destroyFeatures:function(t){if(void 0===t&&(t=this.features),t){this.removeFeatures(t),Array.isArray(t)||(t=[t]);for(var e=t.length-1;e>=0;e--)t[e].destroy()}},removeFeatures:function(t){var e=this;if(t){if(t===e.features)return e.removeAllFeatures();RQ().Util.isArray(t)||"function"==typeof t||(t=[t]);for(var r=[],n=0;nl)){var v=s[0];s.splice(0,1),delete a[v]}}}}if(e.renderer.render(),n&&e.options.isHoverAble&&e.options.isMultiHover){var m=this.getShapesByFeatureID(n);this.renderer.updateHoverShapes(m)}},createThematicFeature:function(t){var e=this,r=e.getStyleByData(t);t.style&&e.isAllowFeatureStyle&&(r=Tt.copyAttributesWithClip(t.style));var n={};n.nodesClipPixel=e.options.nodesClipPixel,n.isHoverAble=e.options.isHoverAble,n.isMultiHover=e.options.isMultiHover,n.isClickAble=e.options.isClickAble,n.highlightStyle=oV.transformStyle(e.highlightStyle);for(var o=new Rz(t,e,oV.transformStyle(r),n),i=0;i0;if(e.themeField&&s&&r.attributes){var u=e.themeField,l=r.attributes;for(var c in l)if(u===c){i=!0,a=l[c];break}}if(i)for(var f=0,p=o.length;f0;if(e.themeField&&s&&r.attributes){var u=e.themeField,l=r.attributes;for(var c in l)if(u===c){i=!0,a=l[c];break}}if(i)for(var f=0,p=o.length;f=o[f].start&&a<=o[f].end:a>=o[f].start&&a0&&0==this.labelFeatures.length)for(var e=this.setLabelsStyle(this.features),r=0,n=e.length;r=0&&h.x<=l.x&&h.y>=0&&h.y<=l.y){if(r.style.minZoomLevel>-1&&c<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&c>r.style.maxZoomLevel)continue;var y=null;r.isStyleChange?(r.isStyleChange=null,y=this.calculateLabelBounds(r,h)):y=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,h):this.calculateLabelBounds(r,h);var d=new Dt(0,l.y,l.x,0),v=y.length;if(this.options.isAvoid){var m=this.getAvoidInfo(d,y);if(m){if("left"===m.aspectW){r.style.labelXOffset+=m.offsetX;for(var b=0;b=o[u].start&&a=o[u].start&&as&&(s=r,u="top")}if(e.y>t.bottom){var n=Math.abs(e.y-t.bottom);n>s&&(s=n,u="bottom")}if(e.xa&&(a=o,l="left")}if(e.x>t.right){var i=Math.abs(e.x-t.right);i>a&&(a=i,l="right")}}}},isQuadrilateralOverLap:function(t,e){var r=t.length,n=e.length;if(5!==r||5!==n)return null;for(var o=!1,i=0;i=0&&t.options.fontOpacity<1&&(r.globalAlpha=t.options.fontOpacity),r.fillText){r.font=n,r.textAlign=t.options.textAlign,r.textBaseline=t.options.textBaseline;var s=t.options.vfactor,u=r.measureText("Mg").height||r.measureText("xx").width;e.y+=u*s*(a-1);for(var l=0;l0;){var o=e.pop(),i=o.type,a=o.layerType=o.layerType||"BASE_LAYER";"OVERLAY_LAYER"!==a&&(i=a),this.createLayer(i,o)}this.fire("maploaded",{map:this._map})}},createCRS:function(t,e,r,n,o){return t<0?new V0({bounds:o,origin:n,resolutions:r}):910112===t||910102===t?j0:(910111===t&&(t=3857),910101===t&&(t=4326),_0("EPSG:"+t,{origin:n,resolutions:r,bounds:o}))},createMap:function(t){var e=t.crs||RQ().CRS.EPSG3857,r=RQ().latLngBounds(e.unproject(t.bounds.min),e.unproject(t.bounds.max));this._map=RQ().map(this.options.map,{center:r.getCenter(),maxZoom:t.maxZoom||22,minZoom:t.minZoom||0,zoom:t.zoom||0,crs:e,renderer:RQ().canvas()}),e instanceof V0?this._map.setZoom(t.zoom?t.zoom+2:2,{maxZoom:t.maxZoom||22}):this._map.fitBounds(r,{maxZoom:t.maxZoom||22})},getResolutionsFromScales:function(t,e,r,n){for(var o=[],i=0;i 0"},datasetNames:[e+":"+r],fromIndex:0,toIndex:1e5});M1(t).getFeaturesBySQL(a,i,o)},createThemeLayer:function(t){var e,r=this,n=t.themeSettings&&JSON.parse(t.themeSettings),o=n.type;if(t.themeSettings=n,(e="HEAT"===o?this.createHeatLayer(t,n):"UNIQUE"===o?this.createUniqueLayer(t,n):"RANGE"===o?this.createRangeLayer(t,n):this.createBaseThemeLayer(t,n))&&(this.addFeature2ThemeLayer(t,e),e.on("add",function(t){r.registerThemeEvent(t.target)})),n&&n.labelField){var i=this.createLabelLayer(t,n);i.on("add",function(t){r.registerThemeEvent(t.target)}),e.labelLayer=i}return e},createBaseThemeLayer:function(t,e){var r=t.style,n=t.opacity,o=e.vectorType,i=r.pointStyle;i.fill="LINE"!==o;var a={};a.radius=i.pointRadius,a.color=i.strokeColor,a.opacity=i.strokeOpacity,a.lineCap=i.strokeLineCap,a.weight=i.strokeWidth,a.fillColor=i.fillColor,a.fillOpacity=i.fillOpacity;var s=function(t,e){return RQ().circleMarker(e,a)};return i.unicode&&(s=function(t,e){return new R1(e,i)}),RQ().geoJSON({type:"GeometryCollection",geometries:[]},{pointToLayer:s,opacity:n})},createUniqueLayer:function(t,e){for(var r=t.title,n=e.field,o=[],i=e.settings,a=t.isVisible,s=t.opacity,u=e.vectorType,l=0;l0?{fillColor:"#ffffff"}:i[0].style;var s=RQ().Util.extend(new SB,r);s.fontWeight="bold",s.fontSize="14px",s.labelRect=!0,s.strokeColor=s.fillColor,s.fontColor=e.labelColor,e.labelFont&&(s.fontFamily=e.labelFont);var u=new E1(n,{visibility:a,opacity:.7});return this.registerThemeEvent(u),u.style=s,u.themeField=o,u.styleGroups=[],u},createHeatLayer:function(t,e){for(var r,n=e.colors||["blue","cyan","lime","yellow","red"],o={},i=0,a=n.length,s=1;i0&&i.push(o[a]);else for(var l=0,c=(o=n.parseFeatureFromJson(r.content)).length;l0&&i.push(o[l]);var f=t.prjCoordSys&&t.prjCoordSys.epsgCode;s?n.changeFeatureLayerEpsgCode(f,"4326",e,i,function(t){k(t)}):k(i)},function(){});else{for(var b=[],g=t.features,S=0,w=g.length;S0){var O=_.geometry.points[0].x,E=_.geometry.points[0].y,P=new he(O,E),x=new mn(P,_.attributes,_.style);b.push(x)}}k(b)}}else if(i){var T=t.datasourceName;f=(c=(l=t.subLayers&&JSON.parse(t.subLayers)).length&&l.length>0?l[0]:l)&&c.name,this.getFeaturesBySQL(t.url,T,f,y.filter,o.ISERVER,function(n){var o,i,a=n.result,u=[];if(a&&a.features){for(var l=0,c=(o=a.features).length;l0?l[0]:l)&&c.name;var C=t.prjCoordSys&&t.prjCoordSys.epsgCode;this.getFeaturesBySQL(p,h,f,d,o.ISERVER,function(t){s?n.changeFeatureLayerEpsgCode(C,"4326",e,t,function(t){k(t)}):k(t)})}}function k(r){if(e&&e.labelLayer instanceof E1&&n.addFeature2LabelLayer(e.labelLayer,r,t),RQ().HeatLayer&&e instanceof RQ().HeatLayer){for(var o=[],i=0,a=r.length;i0){for(i=0,a=n.length;i==/g,">=").replace(/<==/g,"<="))+")":" * where (1==1||1>=0)"},getAttributesObjFromTable:function(t,e){if(0!==t.length&&0!==e.length){for(var r=[],n=0;n-1?(r=(t=JSON.parse(t)).needTransform,e=t.isAddFile):"needTransform"===t?(r=!0,e=!1):e="true"===t,{isAddFile:e,needTransform:r}},registerThemeEvent:function(t){var e=this;t.on("click",function(r){var n;t.map&&(e.selectedFeature&&(e.fire("featureunselected",{feature:e.selectedFeature}),e.selectedFeature=null),r.target&&r.target.refDataID&&(n=t.getFeatureById(r.target.refDataID)),n&&(e.selectedFeature=n,e.fire("featureselected",{feature:n})))}),t.on("mousemove",function(r){var n;t.map&&(r.target&&r.target.refDataID&&(r.target&&r.target.refDataID&&(n=t.getFeatureById(r.target.refDataID)),n&&e.fire("featuremousemove",{feature:n})))})},SERVER_TYPE_MAP:{"EPSG:4326":"WGS84","EPSG:3857":"MERCATOR","EPSG:900913":"MERCATOR","EPSG:102113":"MERCATOR","EPSG:910101":"GCJ02","EPSG:910111":"GCJ02MERCATOR","EPSG:910102":"BD","EPSG:910112":"BDMERCATOR"}}),D1=RQ().TileLayer.extend({options:{collectionId:null,sqlFilter:null,ids:null,names:null,renderingRule:null,format:"png",zoomOffset:1,transparent:!0,cacheEnabled:!0,tileProxy:null,attribution:O0.Common.attribution,subdomains:null},initialize:function(t,e){this._url=t,RQ().TileLayer.prototype.initialize.apply(this,arguments),RQ().setOptions(this,e),RQ().stamp(this)},onAdd:function(t){RQ().TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._getLayerUrl()+"&z="+this._getZoomForUrl()+"&x="+t.x+"&y="+t.y;return this.options.tileProxy&&(e=this.options.tileProxy+encodeURIComponent(e)),this.options.cacheEnabled||(e+="&_t="+(new Date).getTime()),this.options.subdomains&&(e=RQ().Util.template(e,{s:this._getSubdomain(t)})),e},_getLayerUrl:function(){return this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){var t=Tt.urlPathAppend(this._url,"/collections/".concat(this.options.collectionId,"/tile.").concat(this.options.format));return this.requestParams=this.requestParams||this._getAllRequestParams(),t=Tt.urlAppend(t,MQ.Util.getParamString(this.requestParams)),t=yo.appendCredential(t),this._layerUrl=t,t},_getAllRequestParams:function(){var t=this.options||{},e={};return e.transparent=!0===t.transparent,e.cacheEnabled=!(!1===t.cacheEnabled),t.sqlFilter&&(e.sqlFilter=t.sqlFilter),t.renderingRule&&(e.renderingRule=JSON.stringify(t.renderingRule)),t.ids&&(e.ids=t.ids.join(",")),t.names&&(e.names=t.names.join(",")),e}});function B1(t){"@babel/helpers - typeof";return(B1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F1(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,r=Array.isArray(t)&&t.filter(function(t){return t.metaData.tileType===e.tileType||z1(t.metaData.prjCoordSys)===z1(e.prjCoordSys)});return r&&r[0]&&r[0].metaData}function J1(t){"@babel/helpers - typeof";return(J1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W1(){W1=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:x(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function b(){}function g(){}var S={};l(S,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,a)&&(S=_);var O=g.prototype=m.prototype=Object.create(S);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==J1(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function K1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Y1(t){for(var e=1;e0&&(u.resolutions=i);return new w0(t,u)}(f,{bounds:o,dpi:a,resolutions:c,origin:l}):void 0}function e2(t,e){return r2.apply(this,arguments)}function r2(){return(r2=Z1(W1().mark(function t(e,r){var n;return W1().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n2(e,!1)){t.next=5;break}return t.next=3,r.getWKT();case 3:(n=t.sent)&&b0.defs(e,n);case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function n2(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{b0(t)}catch(r){return e&&console.error("The projection of ".concat(t," is missing, please register the projection of ").concat(t," first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection")),!1}return!0}function o2(t,e){var r=t.scale,n=t.dpi,o=t.coordUnit;return JD(K0(r,n,o),e)}function i2(t,e){var r=e.center,n=e.bounds,o="string"==typeof t?t:t.code;return"number"!=typeof r.x&&"number"!=typeof r.y&&(r={lat:(n.bottom+n.top)/2,lng:(n.left+n.right)/2}),"EPSG:4326"===o?{lat:r.y,lng:r.x}:t.unproject(RQ().point(r.x,r.y))}function a2(t,e){return"EPSG:4326"===("string"==typeof e?e:e.code)?[[t.bottom,t.left],[t.top,t.right]]:RQ().latLngBounds(e.unproject(RQ().point(t.left,t.bottom)),e.unproject(RQ().point(t.right,t.top)))}var s2=E0.extend({options:{geometry:null,prjCoordSys:null,excludeField:null},initialize:function(t,e){e=e||{},RQ().setOptions(this,e),e.projection&&(this.options.prjCoordSys=e.projection),E0.prototype.initialize.call(this,t,e),this.dataFlow=new lc(t,e),this.dataFlow.events.on({broadcastSocketConnected:this._defaultEvent,broadcastSocketError:this._defaultEvent,broadcastFailed:this._defaultEvent,broadcastSucceeded:this._defaultEvent,subscribeSocketConnected:this._defaultEvent,subscribeSocketError:this._defaultEvent,messageSucceeded:this._defaultEvent,setFilterParamSucceeded:this._defaultEvent,scope:this})},initBroadcast:function(){return this.dataFlow.initBroadcast(),this},broadcast:function(t){this.dataFlow.broadcast(t)},initSubscribe:function(){return this.dataFlow.initSubscribe(),this},setExcludeField:function(t){return this.dataFlow.setExcludeField(t),this.options.excludeField=t,this},setGeometry:function(t){return this.dataFlow.setGeometry(t),this.options.geometry=t,this},unSubscribe:function(){this.dataFlow.unSubscribe()},unBroadcast:function(){this.dataFlow.unBroadcast()},_defaultEvent:function(t){this.fire(t.eventType||t.type,t)}}),u2=function(){try{return mapv}catch(t){return{}}}();function l2(t){"@babel/helpers - typeof";return(l2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c2(t,e){for(var r=0;re.options.maxZoom)){var a=o.getBounds(),s=a.getEast()-a.getWest(),u=a.getNorth()-a.getSouth(),l=o.getSize(),c=s/l.x,f=u/l.y,p=J0("DEGREE")*c,h=this.canvasLayer.getTopLeft(),y=o.latLngToAccurateContainerPoint(h),d={transferCoordinate:function(t){var r,n={x:(r="2d"===e.context?o.latLngToAccurateContainerPoint(RQ().latLng(t[1],t[0])):{x:(t[0]-h.lng)/c,y:(h.lat-t[1])/f}).x-y.x,y:r.y-y.y};return[n.x,n.y]}};void 0!==t&&(d.filter=function(e){var n=r.trails||10;return t&&e.time>t-n&&e.time200&&(this._last=new Date,this.update({data:this.data,options:this.mapVOptions}))},_toMapvStyle:function(t){var e={draw:"simple"};return e.strokeStyle=t.color,e.lineWidth=t.width,e.globalAlpha=t.fillOpacity||t.opacity,e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.fillStyle=t.fillColor,e.size=t.radius,e}}),w2=RQ().GeoJSON.extend({initialize:function(t,e){(e=e||{}).style&&!e.pointToLayer&&(e.pointToLayer=function(t,r){return RQ().circleMarker(r,e.style())}),RQ().Util.setOptions(this,e),this._layers={},RQ().stamp(this),this.url=t,this.idCache={}},onMessageSuccessed:function(t){var e=t.featureResult,r=t.featureResult.properties[this.options.idField],n=null;void 0!==r&&this.idCache[r]?(n=this.getLayer(this.idCache[r]),this._updateLayerData(n,e)):((n=RQ().GeoJSON.geometryToLayer(e,this.options)).feature=RQ().GeoJSON.asFeature(e),this.addLayer(n),void 0!==r&&(this.idCache[r]=this.getLayerId(n))),this.options.onEachFeature&&this.options.onEachFeature(e,n)},_updateLayerData:function(t,e){e.properties&&(t.feature.properties=e.properties);var r=[];switch(e.geometry.type){case"Point":r=RQ().GeoJSON.coordsToLatLng(e.geometry.coordinates),t.setLatLng(r);break;case"LineString":r=RQ().GeoJSON.coordsToLatLngs(e.geometry.coordinates,0),t.setLatLngs(r);break;case"MultiLineString":case"Polygon":r=RQ().GeoJSON.coordsToLatLngs(e.geometry.coordinates,1),t.setLatLngs(r);break;case"MultiPolygon":r=RQ().GeoJSON.coordsToLatLngs(e.geometry.coordinates,2),t.setLatLngs(r)}}}),_2=RQ().LayerGroup.extend({options:{geometry:null,prjCoordSys:null,excludeField:null,idField:"id",render:"normal"},initialize:function(t,e){e=e||{},RQ().Util.setOptions(this,e),this.url=t,this._layers={},this.dataService=new s2(this.url,{geometry:this.options.geometry,prjCoordSys:this.options.prjCoordSys,excludeField:this.options.excludeField})},onAdd:function(t){var e=this;this.dataService.initSubscribe(),this.dataService.on("subscribeSocketConnected",function(t){return e.fire("subscribesucceeded",t)}),this.dataService.on("subscribeSocketError",function(t){return e.fire("subscribefailed",t)}),this.dataService.on("messageSucceeded",function(t){return e._onMessageSuccessed(t)}),this.dataService.on("setFilterParamSucceeded",function(t){return e.fire("setfilterparamsucceeded",t)}),"mapv"===this.options.render?this.addLayer(new S2(this.url,this.options)):this.addLayer(new w2(this.url,this.options)),RQ().LayerGroup.prototype.onAdd.call(this,t)},onRemove:function(t){RQ().LayerGroup.prototype.onRemove.call(this,t),this.dataService&&this.dataService.unSubscribe()},setExcludeField:function(t){return this.dataService.setExcludeField(t),this.options.excludeField=t,this},setGeometry:function(t){return this.dataService.setGeometry(t),this.options.geometry=t,this},_onMessageSuccessed:function(t){var e=this;this.getLayers().map(function(r){return r.onMessageSuccessed&&(r.onMessageSuccessed(t),e.fire("dataupdated",{layer:r,data:t.featureResult})),r})}}),O2=RQ().Layer.extend({includes:[],_echartsContainer:null,_map:null,_ec:null,chart:null,_echartsOptions:null,options:{attribution:O0.ECharts.attribution,loadWhileAnimating:!1},initialize:function(t,e){RQ().Util.setOptions(this,e),this.setOption(t)},setOption:function(t,e,r){var n=t.baseOption||t;n.LeafletMap=n.LeafletMap||{roam:!0},n.animation=!0===n.animation,this._echartsOptions=t,this._ec&&this._ec.setOption(t,e,r)},getEcharts:function(){return this._ec},_disableEchartsContainer:function(){this._echartsContainer.style.visibility="hidden"},_enableEchartsContainer:function(){this._echartsContainer.style.visibility="visible"},onAdd:function(t){this._map=t,this._initEchartsContainer(),this._ec=YH.init(this._echartsContainer),this._ec.leafletMap=t,this.chart=this._ec;var e=this;t.on("zoomstart",function(){e._disableEchartsContainer()}),!e.options.loadWhileAnimating&&t.on("movestart",function(){e._disableEchartsContainer()}),YH.registerAction({type:"LeafletMapLayout",event:"LeafletMapLayout",update:"updateLayout"},function(t){}),YH.registerCoordinateSystem("leaflet",E2),YH.extendComponentModel({type:"LeafletMap",getBMap:function(){return this.__LeafletMap},defaultOption:{roam:!1}}),YH.extendComponentView({type:"LeafletMap",render:function(t,r,n){var o=!0,i=r.scheduler.ecInstance.leafletMap,a=n.getZr().painter.getViewportRoot(),s=i.options.zoomAnimation&&RQ().Browser.any3d;a.className=" leaflet-layer leaflet-zoom-"+(s?"animated":"hide")+" echarts-layer";var u=RQ().DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);a.style[u]="50% 50%";var l=t.coordinateSystem,c=n.getZr().painter.getLayers();x2(e._map,a);var f=function(){if(!o){var r,i=x2(e._map,a);if(!e.options.loadWhileAnimating){for(var s in c)c.hasOwnProperty(s)&&c[s]&&(r=c[s].ctx)&&r.clearRect&&r.clearRect(0,0,r.canvas.width,r.canvas.height);e._enableEchartsContainer()}l.setMapOffset(i),t.__mapOffset=i,n.dispatchAction({type:"LeafletMapLayout"})}};function p(){o||(n.dispatchAction({type:"LeafletMapLayout"}),e._enableEchartsContainer())}e._oldMoveHandler&&i.off(e.options.loadWhileAnimating?"move":"moveend",e._oldMoveHandler),e._oldZoomEndHandler&&i.off("zoomend",e._oldZoomEndHandler),i.on(e.options.loadWhileAnimating?"move":"moveend",f),i.on("zoomend",p),e._oldMoveHandler=f,e._oldZoomEndHandler=p,o=!1}}),this._ec.setOption(this._echartsOptions)},onRemove:function(){this._ec.clear(),this._ec.dispose(),delete this._ec,RQ().DomUtil.remove(this._echartsContainer),this._oldZoomEndHandler&&(this._map.off("zoomend",this._oldZoomEndHandler),this._oldZoomEndHandler=null),this._oldMoveHandler&&(this._map.off(this.options.loadWhileAnimating?"move":"moveend",this._oldMoveHandler),this._oldMoveHandler=null),this._resizeHandler&&(this._map.off("resize",this._resizeHandler),this._resizeHandler=null),delete this._map},_initEchartsContainer:function(){var t=this._map.getSize(),e=document.createElement("div");e.style.position="absolute",e.style.height=t.y+"px",e.style.width=t.x+"px",e.style.zIndex=200,this._echartsContainer=e,this.getPane().appendChild(this._echartsContainer);var r=this;function n(t){var e=t.newSize;r._echartsContainer.style.width=e.x+"px",r._echartsContainer.style.height=e.y+"px",r._ec.resize()}this._map.on("resize",n),this._resizeHandler=n}});function E2(t){this._LeafletMap=t,this.dimensions=["lng","lat"],this._mapOffset=P2(t)}function P2(t){var e=t.containerPointToLayerPoint([0,0]);return[e.x||0,e.y||0]}function x2(t,e){var r=P2(t);return e.style.left=r[0]+"px",e.style.top=r[1]+"px",r}E2.prototype.dimensions=["lng","lat"],E2.prototype.setMapOffset=function(t){this._mapOffset=t},E2.prototype.getBMap=function(){return this._LeafletMap},E2.prototype.prepareCustoms=function(){var t=YH.util,e=this.getViewRect();return{coordSys:{type:"leaflet",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.bind(this.dataToPoint,this),size:t.bind(function(e,r){return r=r||[0,0],t.map([0,1],function(t){var n=r[t],o=e[t]/2,i=[],a=[];return i[t]=n-o,a[t]=n+o,i[1-t]=a[1-t]=r[1-t],Math.abs(this.dataToPoint(i)[t]-this.dataToPoint(a)[t])},this)},this)}}},E2.prototype.dataToPoint=function(t){null===t[1]&&(t[1]=RQ().CRS.EPSG3857.projection.MAX_LATITUDE);var e=this._LeafletMap.latLngToLayerPoint([t[1],t[0]]),r=this._mapOffset;return[e.x-r[0],e.y-r[1]]},E2.prototype.fixLat=function(t){return t>=90?89.99999999999999:t<=-90?-89.99999999999999:t},E2.prototype.pointToData=function(t){var e=this._mapOffset,r=this._LeafletMap.layerPointToLatLng([t[0]+e[0],t[1]+e[1]]);return[r.lng,r.lat]},E2.prototype.getViewRect=function(){var t=this._LeafletMap.getSize();return new YH.graphic.BoundingRect(0,0,t.x,t.y)},E2.prototype.getRoamTransform=function(){return YH.matrix.create()},E2.dimensions=E2.prototype.dimensions,E2.create=function(t){var e,r=t.scheduler.ecInstance.leafletMap;t.eachComponent("LeafletMap",function(t){e||(e=new E2(r)),t.coordinateSystem=e,t.coordinateSystem.setMapOffset(t.__mapOffset||P2(r))}),t.eachSeries(function(t){"leaflet"===t.get("coordinateSystem")&&(e||(e=new E2(r)),t.coordinateSystem=e,t.animation=!0===t.animation)})};function T2(t){"@babel/helpers - typeof";return(T2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C2(t,e){for(var r=0;r=0;o--){var i=void 0,a=void 0,s=r.latLngToLayerPoint(n[o].getLatLng()),u=n[o].getStyle();if(!u&&this.defaultStyle&&(u=this.defaultStyle),u.img){var l=u.img.width,c=u.img.height;u.size&&u.size[0]&&u.size[1]&&(l=u.size[0],c=u.size[1]);var f=u.anchor||[l/2,c/2];i=RQ().point(s.x-f[0],s.y-f[1]),a=RQ().point(i.x+l,i.y+c)}else i=RQ().point(s.x-u.width/2,s.y-u.height/2),a=RQ().point(s.x+u.width/2,s.y+u.height/2);if(RQ().bounds(i,a).contains(t))return n[o]}return null},containsPoint:function(t){return!!this._getGraphicAtPoint(t)},_handleClick:function(t){t.target=null;var e=this.layer,r=e._map,n=this._getGraphicAtPoint(r.latLngToLayerPoint(t.latlng));if(n)return this.layer._renderer._ctx.canvas.style.cursor="pointer",t.target=n,void("click"===t.type&&e.options.onClick&&e.options.onClick.call(e,n,t));this.layer._renderer._ctx.canvas.style.cursor="auto"},_clearBuffer:R2});RQ().Canvas.include({drawGraphics:function(t,e){var r=this;r._drawing&&t.forEach(function(t){var n=t.getStyle();!n&&e&&(n=e),n.img?r._drawImage.call(r,r._ctx,n,t.getLatLng()):r._drawCanvas.call(r,r._ctx,n,t.getLatLng())})},_drawCanvas:function(t,e,r){var n=e,o=this._map.latLngToLayerPoint(r),i=o.x-n.width/2,a=o.y-n.height/2,s=n.width,u=n.height;t.drawImage(n,i,a,s,u)},_drawImage:function(t,e,r){var n,o;if(e.size){var i=e.size;n=i[0],o=i[1]}else n=e.img.width,o=e.img.height;var a=this._coordinateToPoint(r),s=RQ().point(a),u=RQ().point(e.anchor||[n/2,o/2]);a=[s.x-u.x,s.y-u.y],t.drawImage(e.img,a[0],a[1],n,o)},_coordinateToPoint:function(t){if(!this._map)return t;var e=t;RQ().Util.isArray(t)?e=RQ().latLng(t[0],t[1]):t instanceof RQ().LatLng&&(e=RQ().latLng(t.lat,t.lng));var r=this._map.latLngToLayerPoint(e);return[r.x,r.y]}});var D2=RQ().Util.falseFn,B2=function(){for(var t=document.createElement("div"),e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],r=0;r-1&&(this._data=t),this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();var e=this._getLayerState();e.data=this._data||[],this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(e)},drawGraphics:function(t){this._clearBuffer();var e=this.layer._map.getSize();this._container.width!==e.x&&(this._container.width=e.x),this._container.height!==e.y&&(this._container.height=e.y);var r=this.layer._map.getPanes().mapPane._leaflet_pos;this._container.style[B2]="translate("+-Math.round(r.x)+"px,"+-Math.round(r.y)+"px)",this._data=t||[],this._renderLayer||this._createInnerRender(),this._draw()},_initContainer:function(){this._container=this._createCanvas(this.options.width,this.options.height),this._layerContainer=this.options.container,this._wrapper=RQ().DomUtil.create("div","deck-wrapper",this._layerContainer),this._wrapper.appendChild(this._container)},_createCanvas:function(t,e){var r=RQ().DomUtil.create("canvas","graphicLayer leaflet-layer leaflet-zoom-hide");return r.oncontextmenu=RQ().Util.falseFn,r.width=t,r.height=e,r.style.width=t+"px",r.style.height=e+"px",r},_pixelToMeter:function(t){var e=this.layer._map.getBounds();return t*((e.getEast()-e.getWest())/this.layer._map.getSize().x*(6378137*Math.PI/180))},_createInnerRender:function(){var t=this,e=this._getLayerState(),r=e.color,n=e.radius,o=e.opacity,i=e.highlightColor,a=e.radiusScale,s=e.radiusMinPixels,u=e.radiusMaxPixels,l=e.strokeWidth,c=e.outline,f={id:"scatter-plot",data:t._data,pickable:Boolean(this.options.onClick)||Boolean(this.options.onHover),autoHighlight:!0,color:r,opacity:o,radius:n,radiusScale:a,highlightColor:i,radiusMinPixels:s,radiusMaxPixels:u,strokeWidth:l,coordinateSystem:this._isWGS84()?window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS:window.DeckGL.COORDINATE_SYSTEM.LNGLAT,isGeographicCoordinateSystem:this._isWGS84(),outline:c,getPosition:function(t){if(!t)return[0,0,0];var e=t.getLatLng();return e&&[e.lng,e.lat,0]},getColor:function(e){var r=t._getLayerDefaultStyle(),n=e&&e.options;return n&&n.color||r.color},getRadius:function(e){var r=t._getLayerDefaultStyle(),n=e&&e.getStyle();return n&&n.radius||r.radius},updateTriggers:{getColor:[r],getRadius:[n]}},p=this;this.options.onClick&&(f.onClick=function(){p._container.style.cursor="pointer",p.options.onClick.apply(p,arguments)}),this.options.onHover&&(f.onHover=function(){p._container.style.cursor="pointer",p.options.onHover.apply(p,arguments)}),t._renderLayer=new window.DeckGL.ScatterplotLayer(f)},_getLayerDefaultStyle:function(){if(this._layerDefaultStyleCache)return this._layerDefaultStyleCache;var t=this.layer.options,e=t.color,r=t.opacity,n=t.radius,o=t.radiusScale,i=t.radiusMinPixels,a=t.radiusMaxPixels,s=t.strokeWidth,u=t.outline;return n=this._pixelToMeter(n),this._layerDefaultStyleCache={color:e,opacity:r,radius:n,radiusScale:o,radiusMinPixels:i,radiusMaxPixels:a,strokeWidth:s,outline:u},this._layerDefaultStyleCache},_getLayerState:function(){var t=this.layer.getState();return t.zoom=t.zoom-1,t},_draw:function(){var t=this._getLayerState();this._refreshData(),t.data=this._data||[];var e={};for(var r in t)e[r]=t[r];this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),e.layers=[this._renderLayer],e.canvas=this._container,e.onBeforeRender=this._onBeforeRender.bind(this),e.onAfterRender=this._onAfterRender.bind(this),e.coordinateSystem=this._isWGS84()?window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS:window.DeckGL.COORDINATE_SYSTEM.LNGLAT,e.isGeographicCoordinateSystem=this._isWGS84(),this.deckGL?this.deckGL.setProps(e):this.deckGL=new window.DeckGL.experimental.DeckGLJS(e)},_clearBuffer:function(){if(this.deckGL){var t=this.deckGL.layerManager;t&&t.context.gl.clear(t.context.gl.COLOR_BUFFER_BIT)}return this},_refreshData:function(){var t=this._data||[],e=RQ().Util.isArray(t)?[].concat(t):[t];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null;if(!t||0===t.length||t===this.graphics)return this.graphics.length=0,void this.update();Tt.isArray(t)||(t=[t]);for(var e=t.length-1;e>=0;e--){var r=t[e],n=Tt.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()},setStyle:function(t){var e=this.options,r={color:e.color,radius:e.radius,opacity:e.opacity,highlightColor:e.highlightColor,radiusScale:e.radiusScale,radiusMinPixels:e.radiusMinPixels,radiusMaxPixels:e.radiusMaxPixels,strokeWidth:e.strokeWidth,outline:e.outline};this.options=RQ().Util.extend(this.options,r,t),this.defaultStyle=this._getDefaultStyle(this.options),this.update()},update:function(){this._layerRenderer.update(this.graphics)},clear:function(){this.removeGraphics()},getRenderer:function(){return this._renderer},getState:function(){var t=this._map,e=t.getSize().x,r=t.getSize().y,n=t.getCenter(),o=n.lng,i=n.lat,a=z2[this._crs.code]||0;V2[this._crs.code]&&this._crs.resolutions&&this._crs.resolutions.length>0&&(a=Math.round(Math.log2(V2[this._crs.code]/this._crs.resolutions[0])));var s={longitude:o,latitude:i,zoom:t.getZoom()+a,maxZoom:t.getMaxZoom()+a,pitch:0,bearing:0},u={};for(var l in s)u[l]=s[l];u.width=e,u.height=r;var c=this.options;return u.color=c.color,u.radius=c.radius,u.opacity=c.opacity,u.highlightColor=c.highlightColor,u.radiusScale=c.radiusScale,u.radiusMinPixels=c.radiusMinPixels,u.radiusMaxPixels=c.radiusMaxPixels,u.strokeWidth=c.strokeWidth,u.outline=c.outline,u},_resize:function(){var t=this._map.getSize();this._container.width=t.x,this._container.height=t.y,this._container.style.width=t.x+"px",this._container.style.height=t.y+"px";var e=this._map.containerPointToLayerPoint([0,0]);RQ().DomUtil.setPosition(this._container,e),this._update()},_moveEnd:function(){this._layerRenderer instanceof F2&&this._update()},_createRenderer:function(){var t,e=this._map,r=e.getSize().x,n=e.getSize().y;if(this.options.render===U2[0])t=new L2(this,{width:r,height:n,renderer:e.getRenderer(this)});else{var o=RQ().Util.setOptions({},G2),i=RQ().Util.setOptions({options:o},this.options);(i=RQ().Util.setOptions(this,i)).container=e.getPane("overlayPane"),i.width=r,i.height=n,t=new F2(this,i)}return t.defaultStyle=this.defaultStyle,this._layerRenderer=t,this._layerRenderer.getRenderer()},_update:function(){this._map&&this._updatePath()},_updatePath:function(){var t=this._getGraphicsInBounds();this._renderer.drawGraphics(t,this.defaultStyle)},_project:function(){var t=this;t._getGraphicsInBounds().map(function(e){var r=t._map.latLngToLayerPoint(e.getLatLng()),n=t._clickTolerance(),o=[e._anchor+n,e._anchor+n];return e._pxBounds=new(RQ().Bounds)(r.subtract(o),r.add(o)),e}),t._pxBounds=RQ().bounds(RQ().point(0,0),RQ().point(this._container.width,this._container.height))},_getDefaultStyle:function(t){var e={};if(t.color){e.fill=!0;var r=this.toRGBA(t.color);e.color=r,e.fillColor=r}return t.opacity&&(e.opacity=t.opacity,e.fillOpacity=t.opacity),t.radius&&(e.radius=t.radius),t.strokeWidth&&(e.weight=t.strokeWidth),t.outline&&(e.stroke=t.outline),new I2(e).getStyle()},toRGBA:function(t){return"rgba(".concat(t[0],",").concat(t[1],",").concat(t[2],",").concat((t[3]||255)/255,")")},_getGraphicsInBounds:function(){var t=[],e=this._map.getBounds();return this.graphics.map(function(r){return e.contains(r.getLatLng())&&t.push(r),r}),t},_handleClick:function(t){this._layerRenderer._handleClick(t)},beforeAdd:RQ().Util.falseFn,_containsPoint:function(t){return this._layerRenderer.containsPoint(t)}}),q2=S1.extend({options:{isOverLay:!0},initialize:function(t,e,r){var n=[];n.push(t),n.push(r),S1.prototype.initialize.apply(this,n),this.chartsType=e,this.themeFields=r&&r.themeFields?r.themeFields:null,this.charts=r&&r.charts?r.charts:[],this.cache=r&&r.cache?r.cache:{},this.chartsSetting=r&&r.chartsSetting?r.chartsSetting:{}},setChartsType:function(t){this.chartsType=t,this.redraw()},addFeatures:function(t){var e=this;e.fire("beforefeaturesadded",{features:t}),this.features=this.toiClientFeature(t),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},redrawThematicFeatures:function(t){var e=this;e.renderer.clearAll();var r=e.features;if(this.options.alwaysMapCRS&&t&&t instanceof RQ().LatLngBounds){var n=this._map.options.crs;t=RQ().bounds(n.project(t.getSouthWest()),n.project(t.getNorthEast()))}t=A0.toSuperMapBounds(t);for(var o=0,i=r.length;o=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){n=!0;break}}return n},clearCache:function(){this.cache={},this.charts=[]},removeFeatures:function(t){this.clearCache(),S1.prototype.removeFeatures.call(this,t)},removeAllFeatures:function(){this.clearCache(),S1.prototype.removeAllFeatures.apply(this,arguments)},redraw:function(){return this.clearCache(),S1.prototype.redraw.apply(this,arguments)},clear:function(){var t=this;t.renderer&&(t.renderer.clearAll(),t.renderer.refresh()),t.removeAllFeatures(),t.clearCache()},getWeightFieldValue:function(t,e,r){if((void 0===r||isNaN(r))&&(r=0),!t.attributes)return r;var n=t.attributes[e];return(void 0===n||isNaN(n))&&(n=r),n},_sortChart:function(){this.charts&&this.charts.sort(function(t,e){return void 0===t.__overlayWeight&&void 0===e.__overlayWeight?0:void 0!==t.__overlayWeight&&void 0===e.__overlayWeight?-1:void 0===t.__overlayWeight&&void 0!==e.__overlayWeight?1:void 0!==t.__overlayWeight&&void 0!==e.__overlayWeight?parseFloat(t.__overlayWeight)1?r.weight/10:r.weight)):e.setAttribute("stroke","none"),r.fill?(e.setAttribute("fill",r.fillColor||r.color),e.setAttribute("fill-opacity",r.fillOpacity)):e.setAttribute("fill","none")}});var o3,i3=RQ().CircleMarker.extend({includes:t3.prototype,statics:{iconCache:{}},initialize:function(t,e){t3.prototype.initialize.call(this,t),this._makeFeatureParts(t,e)},getLatLng:void 0,render:function(t,e){t3.prototype.render.call(this,t,e),this._radius=e.radius||RQ().CircleMarker.prototype.options.radius,this._updatePath()},_makeFeatureParts:function(t,e){e=e||{x:1,y:1};var r=t.geometry[0];"object"===n3(r[0])&&"x"in r[0]?(this._point=RQ().point(r[0]).scaleBy(e),this._empty=RQ().Util.falseFn):(this._point=RQ().point(r).scaleBy(e),this._empty=RQ().Util.falseFn)},makeInteractive:function(){this._updateBounds()},updateStyle:function(t,e){return this._radius=e.radius||this._radius,this._updateBounds(),t3.prototype.updateStyle.call(this,t,e)},_updateBounds:function(){if(this.options.iconUrl&&this.options.iconSize){var t=RQ().point(this.options.iconSize),e=t&&t.divideBy(2,!0),r=this._point.subtract(e);this._pxBounds=new(RQ().Bounds)(r,r.add(t))}else RQ().CircleMarker.prototype._updateBounds.call(this)},_updatePath:function(){this.options.iconUrl?this._renderer._updateIcon(this):RQ().CircleMarker.prototype._updatePath.call(this)},_getImage:function(){if(!this.options.iconUrl)return null;var t=this.options.iconUrl,e=i3.iconCache[t];if(!e){var r=this.options.iconSize||[50,50];e=i3.iconCache[t]=this._createIcon(t,r)}return e},_createIcon:function(t,e){var r=t;if(!r)throw new Error("iconUrl not set in Icon options (see the docs).");var n=document.createElement("img");n.src=r,n.className="leaflet-marker-icon "+(this.layerName||"");var o=e;if("number"==typeof o&&(o=[o,o]),o){var i=RQ().point(o),a=RQ().point(i&&i.divideBy(2,!0));i&&(n.style.width=i.x+"px",n.style.height=i.y+"px"),a&&(n.style.marginLeft=-a.x+"px",n.style.marginTop=-a.y+"px")}return n.onload=function(){o||(n.style.width=this.width+"px",n.style.height=this.height+"px")},n},_containsPoint:function(t){return this.options.iconUrl?this._pxBounds.contains(t):RQ().CircleMarker.prototype._containsPoint.call(this,t)}}),a3={_makeFeatureParts:function(t,e){e=e||{x:1,y:1};var r,n=t.geometry;this._parts=[];for(var o=0;o-1?new p3(n):new h3(n)).getTile().then(function(e){t.render(e,r)})},render:function(t,e){if(t){for(var r=this,n=r.renderer,o=r.layer,i=0;i0&&a[a.length-1]}e.properties.textField=i}r.vectorTileLayerStyles=r.vectorTileLayerStyles||{};var s=r.vectorTileLayerStyles[n];if(s)return e=this._mergeFeatureTextField(e,s),s;var u=this.getScaleFromCoords(t),l=this.cartoCSSToLeaflet.pickShader(n)||[];for(var c in s=[],l)for(var f=l[c],p=0;p1){var l=parseInt(u[1]);s=l&&l>=4e3&&l<=5e3?c.DEGREE:c.METER}}return W0(a,96,s)},_mergeFeatureTextField:function(t,e){if(!this.options.serverCartoCSSStyle||!e||"TEXT"!==t.type)return t;var r=e;RQ().Util.isArray(e)||(r=[e]);for(var n=0;n0?this.convertFastToPixelPoints(t):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)},convertFastToPixelPoints:function(t){var e,r,n,o,i,a,s,u=[],l=t.getEast()-t.getWest(),c=t.getNorth()-t.getSouth(),f=this._map.getSize();o=l/f.x>c/f.y?l/f.x:c/f.y,this.useRadius=this.useGeoUnit?parseInt(this.radius/o):this.radius;for(var p=0;p0&&this.maxWidth>0))return!1;var r=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;n>24}},{key:"readUint8",value:function(t){return this.bytes_[t]}},{key:"readInt16",value:function(t){return this.readUint16(t)<<16>>16}},{key:"readUint16",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8}},{key:"readInt32",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}},{key:"readUint32",value:function(t){return this.readInt32(t)>>>0}},{key:"readInt64",value:function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}},{key:"writeUint16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeInt32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeUint32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeInt64",value:function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}},{key:"writeUint64",value:function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}},{key:"writeFloat32",value:function(t,e){x3[0]=e,this.writeInt32(t,P3[0])}},{key:"writeFloat64",value:function(t,e){T3[0]=e,this.writeInt32(t,P3[C3?0:1]),this.writeInt32(t+4,P3[C3?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length=0;r--)t.addInt32(e[r]);return t.endVector()}},{key:"startEndsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addXy",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"createXyVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startXyVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addZ",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createZVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startZVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addM",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"createMVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startMVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addT",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"createTVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startTVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addTm",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"createTmVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}},{key:"startTmVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addType",value:function(t,e){t.addFieldInt8(6,e,o3.Unknown)}},{key:"addParts",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createPartsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startPartsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endGeometry",value:function(t){return t.endObject()}},{key:"createGeometry",value:function(e,r,n,o,i,a,s,u,l){return t.startGeometry(e),t.addEnds(e,r),t.addXy(e,n),t.addZ(e,o),t.addM(e,i),t.addT(e,a),t.addTm(e,s),t.addType(e,u),t.addParts(e,l),t.endGeometry(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"ends",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}},{key:"endsLength",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"endsArray",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"xy",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"xyLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"xyArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"z",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"zLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"zArray",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"m",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"mLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"mArray",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"t",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"tLength",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"tArray",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"tm",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):BigInt(0)}},{key:"tmLength",value:function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"type",value:function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):o3.Unknown}},{key:"parts",value:function(e,r){var n=this.bb.__offset(this.bb_pos,18);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}},{key:"partsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&M3(e.prototype,r),n&&M3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function B3(t,e){for(var r=[],n=0;n>1]),r.push(o)}return r}function F3(t,e,r){if(!r||0===r.length)return[B3(t,e)];var n,o=0,i=Array.from(r).map(function(e){return t.slice(o,o=e<<1)});return e&&(o=0,n=Array.from(r).map(function(t){return e.slice(o,o=t)})),i.map(function(t,e){return B3(t,n?n[e]:void 0)})}function U3(t,e){var r=e;if(r===o3.Unknown&&(r=t.type()),r===o3.GeometryCollection){for(var n=[],o=0;o=0;r--)t.addInt8(e[r]);return t.endVector()}},{key:"startPropertiesVector",value:function(t,e){t.startVector(1,e,1)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endFeature",value:function(t){return t.endObject()}},{key:"finishFeatureBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedFeatureBuffer",value:function(t,e){t.finish(e,void 0,!0)}},{key:"createFeature",value:function(e,r,n,o){return t.startFeature(e),t.addGeometry(e,r),t.addProperties(e,n),t.addColumns(e,o),t.endFeature(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"geometry",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new D3).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"properties",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}},{key:"propertiesLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"propertiesArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new H3).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&J3(e.prototype,r),n&&J3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),Y3=(new TextEncoder,new TextDecoder);function Q3(t,e){var r={};if(!e||0===e.length)return r;var n=t.propertiesArray();if(!n)return r;for(var o=new DataView(n.buffer,n.byteOffset),i=t.propertiesLength(),a=0;a0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:function(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}(e,r.value)}})},$3.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function o(){return e._source.read().then(function(i){return i.done?(e._array=Z3,e._index=0,r>0?n.subarray(0,r):null):r+i.value.length>=t?(e._array=i.value,e._index=t-r,n.set(i.value.subarray(0,t-r),r),n):(n.set(i.value,r),r+=i.value.length,o())})}()},$3.prototype.cancel=function(){return this._source.cancel()};var n4=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bb=null,this.bb_pos=0}return e=t,n=[{key:"getRootAsCrs",value:function(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"getSizePrefixedRootAsCrs",value:function(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startCrs",value:function(t){t.startObject(6)}},{key:"addOrg",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addCode",value:function(t,e){t.addFieldInt32(1,e,0)}},{key:"addName",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"addWkt",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"addCodeString",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"endCrs",value:function(t){return t.endObject()}},{key:"createCrs",value:function(e,r,n,o,i,a,s){return t.startCrs(e),t.addOrg(e,r),t.addCode(e,n),t.addName(e,o),t.addDescription(e,i),t.addWkt(e,a),t.addCodeString(e,s),t.endCrs(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"org",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"code",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"wkt",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"codeString",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&e4(e.prototype,r),n&&e4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function o4(t){"@babel/helpers - typeof";return(o4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i4(t,e){for(var r=0;r=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startEnvelopeVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addGeometryType",value:function(t,e){t.addFieldInt8(2,e,o3.Unknown)}},{key:"addHasZ",value:function(t,e){t.addFieldInt8(3,+e,0)}},{key:"addHasM",value:function(t,e){t.addFieldInt8(4,+e,0)}},{key:"addHasT",value:function(t,e){t.addFieldInt8(5,+e,0)}},{key:"addHasTm",value:function(t,e){t.addFieldInt8(6,+e,0)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addFeaturesCount",value:function(t,e){t.addFieldInt64(8,e,BigInt("0"))}},{key:"addIndexNodeSize",value:function(t,e){t.addFieldInt16(9,e,16)}},{key:"addCrs",value:function(t,e){t.addFieldOffset(10,e,0)}},{key:"addTitle",value:function(t,e){t.addFieldOffset(11,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(12,e,0)}},{key:"addMetadata",value:function(t,e){t.addFieldOffset(13,e,0)}},{key:"endHeader",value:function(t){return t.endObject()}},{key:"finishHeaderBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedHeaderBuffer",value:function(t,e){t.finish(e,void 0,!0)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"envelope",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"envelopeLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"envelopeArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"geometryType",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):o3.Unknown}},{key:"hasZ",value:function(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasM",value:function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasT",value:function(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasTm",value:function(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new H3).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"featuresCount",value:function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt("0")}},{key:"indexNodeSize",value:function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}},{key:"crs",value:function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new n4).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"title",value:function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"metadata",value:function(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&i4(e.prototype,r),n&&i4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function u4(t){for(var e=s4.getRootAsHeader(t),r=e.featuresCount(),n=e.indexNodeSize(),o=[],i=0;i0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h4(t){return this instanceof h4?(this.v=t,this):new h4(t)}function y4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){o[t]&&(n[t]=function(e){return new Promise(function(r,n){i.push([t,e,r,n])>1||s(t,e)})})}function s(t,e){try{(r=o[t](e)).value instanceof h4?Promise.resolve(r.value.v).then(u,l):c(i[0][2],r)}catch(t){c(i[0][3],t)}var r}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){t(e),i.shift(),i.length&&s(i[0][0],i[0][1])}}var d4=function(t){function e(e){var r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(t,e){function r(){this.constructor=t}l4(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Error);(function(){function t(t){if(t<0)throw new RangeError("Capacity may not be less than 0");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){if(this.full)throw new Error("Buffer full");this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}})(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){for(;this._q.length>=this._c;)this._q.shift();this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}}(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){this._q.length=S4;return Promise.resolve(e).then(function(e){return!r&&t.state>=w4?E4(t).then(function(t){return{value:t,done:!0}}):{value:e,done:r}})}function x4(t,e){var r,n;if(!(t.state>=g4))if(t.state=g4,t.onnext(),t.onstop(),null==t.err&&(t.err=e),0!==t.pushes.length||void 0!==t.buffer&&!t.buffer.empty)try{for(var o=p4(t.pushes),i=o.next();!i.done;i=o.next()){i.value.resolve()}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}else T4(t)}function T4(t){var e,r;if(!(t.state>=S4)){t.state=w4||(t.state=b4)){t.state=b4;var e=function(t,e){if(v4(e),t.pushes.length>=_4)throw new d4("No more than "+_4+" pending calls to push are allowed on a single repeater.");if(t.state>=g4)return Promise.resolve(void 0);var r,n=void 0===t.pending?Promise.resolve(e):t.pending.then(function(){return e});n=n.catch(function(e){t.state=_4)throw new d4("No more than "+_4+" pending calls to next are allowed on a single repeater.");if(e.state<=m4&&k4(e),e.onnext(t),void 0!==e.buffer&&!e.buffer.empty){var r=P4(e,e.buffer.remove());if(e.pushes.length){var n=e.pushes.shift();e.buffer.add(n.value),e.onnext=n.resolve}return r}if(e.pushes.length){var o=e.pushes.shift();return e.onnext=o.resolve,P4(e,o.value)}return e.state>=g4?(T4(e),P4(e,E4(e))):new Promise(function(r){return e.nexts.push({resolve:r,value:t})})},t.prototype.return=function(t){v4(t);var e=A4.get(this);if(void 0===e)throw new Error("WeakMap error");return T4(e),e.execution=Promise.resolve(e.execution).then(function(){return t}),P4(e,E4(e))},t.prototype.throw=function(t){var e=A4.get(this);if(void 0===e)throw new Error("WeakMap error");return e.state<=m4||e.state>=g4||void 0!==e.buffer&&!e.buffer.empty?(T4(e),null==e.err&&(e.err=t),P4(e,E4(e))):this.next(Promise.reject(t))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=I4,t.merge=M4,t.zip=R4,t.latest=L4,t}();function N4(t,e){var r,n,o=[],i=function(t){null!=t&&"function"==typeof t[Symbol.asyncIterator]?o.push(t[Symbol.asyncIterator]()):null!=t&&"function"==typeof t[Symbol.iterator]?o.push(t[Symbol.iterator]()):o.push(function(){return y4(this,arguments,function(){return f4(this,function(r){switch(r.label){case 0:return e.yieldValues?[4,h4(t)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return e.returnValues?[4,h4(t)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=p4(t),s=a.next();!s.done;s=a.next()){i(s.value)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function I4(t){var e=this,r=N4(t,{returnValues:!0});return new j4(function(t,n){return c4(e,void 0,void 0,function(){var e,o,i,a,s,u;return f4(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2];o=!1,n.then(function(){e(),o=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),a=void 0,s=0,u=function(){var o,u,l,c,f,p;return f4(this,function(h){switch(h.label){case 0:o=s;try{for(f=void 0,u=p4(r),l=u.next();!l.done;l=u.next())c=l.value,Promise.resolve(c.next()).then(function(t){t.done?(n(),void 0===i&&(i=t)):s===o&&(s++,e(t))},function(t){return n(t)})}catch(t){f={error:t}}finally{try{l&&!l.done&&(p=u.return)&&p.call(u)}finally{if(f)throw f.error}}return[4,new Promise(function(t){return e=t})];case 1:return void 0===(a=h.sent())?[3,3]:[4,t(a.value)];case 2:h.sent(),h.label=3;case 3:return[2]}})},l.label=2;case 2:return o?[3,4]:[5,u()];case 3:return l.sent(),[3,2];case 4:return[2,i&&i.value];case 5:return n(),[4,Promise.race(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function M4(t){var e=this,r=N4(t,{yieldValues:!0});return new j4(function(t,n){return c4(e,void 0,void 0,function(){var e,o,i,a=this;return f4(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2];e=[],o=!1,n.then(function(){var t,r;o=!0;try{for(var n=p4(e),i=n.next();!i.done;i=n.next()){(0,i.value)()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,s){return c4(a,void 0,void 0,function(){var a;return f4(this,function(u){switch(u.label){case 0:u.trys.push([0,,6,9]),u.label=1;case 1:return o?[3,5]:(Promise.resolve(r.next()).then(function(t){return e[s](t)},function(t){return n(t)}),[4,new Promise(function(t){e[s]=t})]);case 2:return void 0===(a=u.sent())?[3,4]:a.done?(i=a,[2]):[4,t(a.value)];case 3:u.sent(),u.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return s.sent(),[2,i&&i.value];case 3:return n(),[7];case 4:return[2]}})})})}function R4(t){var e=this,r=N4(t,{returnValues:!0});return new j4(function(t,n){return c4(e,void 0,void 0,function(){var e,o,i,a;return f4(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2,[]];o=!1,n.then(function(){e(),o=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return o?[3,5]:(Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})]);case 3:return void 0===(i=s.sent())?[2]:(a=i.map(function(t){return t.value}),i.some(function(t){return t.done})?[2,a]:[4,t(a)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function L4(t){var e=this,r=N4(t,{yieldValues:!0,returnValues:!0});return new j4(function(t,n){return c4(e,void 0,void 0,function(){var e,o,i,a,s,u=this;return f4(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2,[]];o=[],i=!1,n.then(function(){var t,r;e();try{for(var n=p4(o),a=n.next();!a.done;a=n.next()){(0,a.value)()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}i=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})];case 2:return void 0===(a=l.sent())?[2]:(s=a.map(function(t){return t.value}),a.every(function(t){return t.done})?[2,s]:[4,t(s.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(e,r){return c4(u,void 0,void 0,function(){var u;return f4(this,function(l){switch(l.label){case 0:if(a[r].done)return[2,a[r].value];l.label=1;case 1:return i?[3,4]:(Promise.resolve(e.next()).then(function(t){return o[r](t)},function(t){return n(t)}),[4,new Promise(function(t){return o[r]=t})]);case 2:return void 0===(u=l.sent())?[2,a[r].value]:u.done?[2,u.value]:(s[r]=u.value,[4,t(s.slice())]);case 3:return l.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function D4(t){"@babel/helpers - typeof";return(D4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function B4(t,e){for(var r=0;rt)){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q4(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return X4(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X4(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X4(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rthis.nodes[1]),this.nodes[1]=t}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&$4(t.prototype,e),r&&$4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),a=n.minX,s=n.minY,u=n.maxX,l=n.maxY,W4.info("tree items: ".concat(e,", nodeSize: ").concat(r)),c=i5(e,r),f=c[0][0],void 0,d=c.length-1,p=new i([0,1],d),h=[p],W4.debug("starting stream search with queue: ".concat(h,", numItems: ").concat(e,", nodeSize: ").concat(r,", levelBounds: ").concat(c)),y=Y4().mark(function t(){var n,p,y,d,v,m,b,g,S;return Y4().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=h.shift(),W4.debug("popped node: ".concat(n,", queueLength: ").concat(h.length)),p=n.startNodeIdx(),y=p>=f,d=function(){var t=Q4(c[n.level()],2)[1],e=Math.min(n.endNodeIdx()+r,t);return y&&eb.getFloat64(c+16,!0))){t.next=8;break}return t.abrupt("return",0);case 8:if(!(s>b.getFloat64(c+24,!0))){t.next=10;break}return t.abrupt("return",0);case 10:if(d=b.getBigUint64(c+32,!0),!y){t.next=18;break}return v=d,m=function(){if(r ").concat(S)),_.extendEndNodeIdx(Number(S)),t.abrupt("return",0);case 25:void 0,void 0,E=n.level()-1,P=[Number(S),Number(S)+1],O=new i(P,E),void 0!==_&&_.level()==O.level()?W4.info("Same level, but too far away. Pushing new request for nodeIdx: ".concat(S," rather than merging with distant ").concat(_)):W4.info("Pushing new level for ".concat(O," onto queue with nearestNodeRange: ").concat(_," since there's not already a range for this level.")),h.push(O);case 28:case"end":return t.stop()}var E,P},t)}),S=p;case 12:if(!(S=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function p5(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||h5(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h5(t,e){if(t){if("string"==typeof t)return y5(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y5(t,e):void 0}}function y5(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function v5(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function m5(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){v5(i,n,o,a,s,"next",t)}function s(t){v5(i,n,o,a,s,"throw",t)}a(void 0)})}}function b5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g5(t,e){for(var r=0;rV4.global.extraRequestThreshold()&&(W4.info("Pushing new feature batch, since gap ".concat(g," was too large")),a.push(s),s=[]),s.push([d,m]);case 23:u=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),l=!0,c=r.t0;case 32:if(r.prev=32,r.prev=33,!u||null==f.return){r.next=37;break}return r.next=37,E5(f.return());case 37:if(r.prev=37,!l){r.next=40;break}throw c;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return e.headerClient.logUsage("header+index"),s.length>0&&a.push(s),S=a.flatMap(function(t){return e.readFeatureBatch(t,e.nocache)}),r.delegateYield(P5(T5(j4.merge(S))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return u5.length+l5+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(t){return new A5(this.headerClient.httpClient,t)}},{key:"readFeatureBatch",value:function(t,e){var r=this;return _5(d5().mark(function n(){var o,i,a,s,u,l,c,f,p,h,y,d;return d5().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:o=p5(t[0],1),i=o[0],a=p5(t[t.length-1],2),s=a[0],u=a[1],l=s+u-i,c=r.buildFeatureClient(e),f=l,p=f5(t),n.prev=8,p.s();case 10:if((h=p.n()).done){n.next=19;break}return y=p5(h.value,1),d=y[0],n.next=14,E5(r.readFeature(c,d,f));case 14:return n.next=16,n.sent;case 16:f=0;case 17:n.next=10;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n.catch(8),p.e(n.t0);case 24:return n.prev=24,p.f(),n.finish(24);case 27:c.logUsage("feature");case 28:case"end":return n.stop()}},n,null,[[8,21,24,27]])}))()}},{key:"readFeature",value:function(){var t=m5(d5().mark(function t(e,r,n){var o,i,a,s,u,l,c;return d5().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r+this.lengthBeforeFeatures(),t.next=3,e.getRange(o,4,n,"feature length");case 3:return a=t.sent,i=new DataView(a).getUint32(0,!0),t.next=7,e.getRange(o+4,i,n,"feature data");case 7:return s=t.sent,u=new Uint8Array(s),(l=new Uint8Array(i+l5)).set(u,l5),(c=new N3(l)).setPosition(l5),t.abrupt("return",K3.getRootAsFeature(c));case 14:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}],[{key:"open",value:function(){var e=m5(d5().mark(function e(r,n){var o,i,a,s,u,l,c,f,p,h,y;return d5().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=2024,i=new A5(r,n),a=function(){var t,e=0;for(t=0;t<3;t++){e+=Math.pow(16,t)*n5}return e}(),s=o+a,W4.debug("fetching header. minReqLength: ".concat(s," (assumedHeaderLength: ").concat(o,", assumedIndexLength: ").concat(a,")")),e.t0=Uint8Array,e.next=8,i.getRange(0,8,s,"header");case 8:if(e.t1=e.sent,(u=new e.t0(e.t1)).subarray(0,3).every(function(t,e){return u5[e]===t})){e.next=13;break}throw W4.error("bytes: ".concat(u," != ").concat(u5)),new Error("Not a FlatGeobuf file");case 13:return W4.debug("magic bytes look good"),e.next=16,i.getRange(8,4,s,"header");case 16:if(c=e.sent,!((l=new DataView(c).getUint32(0,!0))>10485760||l<8)){e.next=21;break}throw new Error("Invalid header size");case 21:return W4.debug("headerLength: ".concat(l)),e.next=24,i.getRange(12,l,s,"header");case 24:return f=e.sent,p=new N3(new Uint8Array(f)),h=u4(p),y=o5(h.featuresCount,h.indexNodeSize),W4.debug("completed: opening http reader"),e.abrupt("return",new t(i,h,l,y,n));case 30:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()}])}(),A5=function(){return S5(function t(e,r){if(b5(this,t),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,"string"==typeof e)this.httpClient=new j5(e,r);else{if(!(e instanceof j5))throw new Error("Unknown source ");this.httpClient=e}},[{key:"getRange",value:function(){var t=m5(d5().mark(function t(e,r,n,o){var i,a,s;return d5().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.bytesEverUsed+=r,i=e-this.head,a=i+r,!(i>=0&&a<=this.buffer.byteLength)){t.next=5;break}return t.abrupt("return",this.buffer.slice(i,a));case 5:return s=Math.max(r,n),this.bytesEverFetched+=s,W4.debug("requesting for new Range: ".concat(e,"-").concat(e+s-1)),t.next=10,this.httpClient.getRange(e,s,o);case 10:return this.buffer=t.sent,this.head=e,t.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return t.stop()}},t,this)}));return function(e,r,n,o){return t.apply(this,arguments)}}()},{key:"logUsage",value:function(t){var e=t.split(" ")[0],r=this.bytesEverUsed,n=this.bytesEverFetched,o=(100*r/n).toFixed(2);W4.info("".concat(e," bytes used/requested: ").concat(r," / ").concat(n," = ").concat(o,"%"))}}])}(),j5=function(){return S5(function t(e,r){b5(this,t),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e,this.nocache=r},[{key:"getRange",value:function(){var t=m5(d5().mark(function t(e,r,n){var o,i,a;return d5().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,o="bytes=".concat(e,"-").concat(e+r-1),W4.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(n,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(o)),i={Range:o},this.nocache&&(i["Cache-Control"]="no-cache, no-store"),t.next=8,fetch(this.url,{headers:i});case 8:return a=t.sent,t.abrupt("return",a.arrayBuffer());case 10:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}])}();function N5(t){"@babel/helpers - typeof";return(N5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I5(){I5=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:x(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function b(){}function g(){}var S={};l(S,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,a)&&(S=_);var O=g.prototype=m.prototype=Object.create(S);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==N5(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function M5(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function R5(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){M5(i,n,o,a,s,"next",t)}function s(t){M5(i,n,o,a,s,"throw",t)}a(void 0)})}}function L5(t){var e,r,n,o=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);o--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new D5(e.call(t));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function D5(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(D5=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new D5(t)}function B5(t){return new G5(t,0)}function F5(t){return function(){return new U5(t.apply(this,arguments))}}function U5(t){var e,r;function n(e,r){try{var i=t[e](r),a=i.value,s=a instanceof G5;Promise.resolve(s?a.v:a).then(function(r){if(s){var u="return"===e?"return":"next";if(!a.k||r.done)return n(u,r);r=t[u](r).value}o(i.done?"return":"normal",r)},function(t){n("throw",t)})}catch(t){o("throw",t)}}function o(t,o){switch(t){case"return":e.resolve({value:o,done:!0});break;case"throw":e.reject(o);break;default:e.resolve({value:o,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,o){return new Promise(function(i,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,o))})},"function"!=typeof t.return&&(this.return=void 0)}function G5(t,e){this.v=t,this.k=e}function V5(){return(V5=F5(I5().mark(function t(e,r,n){var o,i,a,s,u,l,c,f,p,h;return I5().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o="function"==typeof(y=e).slice?y:new $3("function"==typeof y.read?y:y.getReader()),i=function(){var t=R5(I5().mark(function t(e){return I5().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.slice(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),t.t0=Uint8Array,t.next=5,B5(i(8,"magic bytes"));case 5:if(t.t1=t.sent,(a=new t.t0(t.t1)).subarray(0,3).every(function(t,e){return u5[e]===t})){t.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return t.t2=Uint8Array,t.next=12,B5(i(4,"header length"));case 12:return t.t3=t.sent,a=new t.t2(t.t3),s=new N3(a),u=s.readUint32(0),t.t4=Uint8Array,t.next=19,B5(i(u,"header data"));case 19:if(t.t5=t.sent,a=new t.t4(t.t5),s=new N3(a),l=u4(s),n&&n(l),c=l.indexNodeSize,f=l.featuresCount,!(c>0)){t.next=29;break}return p=o5(f,c),t.next=29,B5(i(p,"entire index, w/o rect"));case 29:return t.next=31,B5(H5(i,l,r));case 31:if(!(h=t.sent)){t.next=36;break}return t.next=34,h;case 34:t.next=29;break;case 36:case"end":return t.stop()}var y},t)}))).apply(this,arguments)}function z5(){return(z5=F5(function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return I5().mark(function i(){var a,s,u,l,c,f,p;return I5().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,B5(k5.open(t,o));case 2:a=i.sent,W4.debug("opened reader"),n&&n(a.header),s=!1,u=!1,i.prev=7,c=L5(a.selectBbox(e));case 9:return i.next=11,B5(c.next());case 11:if(!(s=!(f=i.sent).done)){i.next=18;break}return p=f.value,i.next=15,r(p,a.header);case 15:s=!1,i.next=9;break;case 18:i.next=24;break;case 20:i.prev=20,i.t0=i.catch(7),u=!0,l=i.t0;case 24:if(i.prev=24,i.prev=25,!s||null==c.return){i.next=29;break}return i.next=29,B5(c.return());case 29:if(i.prev=29,!u){i.next=32;break}throw l;case 32:return i.finish(29);case 33:return i.finish(24);case 34:case"end":return i.stop()}},i,null,[[7,20,24,34],[25,,29,33]])})()})).apply(this,arguments)}function H5(t,e,r){return q5.apply(this,arguments)}function q5(){return(q5=R5(I5().mark(function t(e,r,n){var o,i,a,s,u;return I5().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,e(4,"feature length");case 3:if(t.t1=t.sent,0!==(o=new t.t0(t.t1)).byteLength){t.next=7;break}return t.abrupt("return");case 7:return i=new N3(o),a=i.readUint32(0),t.t2=Uint8Array,t.next=12,e(a,"feature data");case 12:return t.t3=t.sent,o=new t.t2(t.t3),(s=new Uint8Array(a+4)).set(o,4),(i=new N3(s)).setPosition(l5),u=K3.getRootAsFeature(i),t.abrupt("return",n(u,r));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function J5(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,3).every(function(t,e){return u5[e]===t}))throw new Error("Not a FlatGeobuf file");var n=new N3(t),o=n.readUint32(u5.length);n.setPosition(u5.length+l5);var i=u4(n);r&&r(i);var a=u5.length+l5+o,s=i.indexNodeSize,u=i.featuresCount;s>0&&(a+=o5(u,s));for(var l=[];a3&&void 0!==arguments[3]&&arguments[3])}function Y5(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t instanceof Uint8Array?J5(t,r):t instanceof ReadableStream?W5(t,r):K5(t,e,r,n)}function Q5(t){"@babel/helpers - typeof";return(Q5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function X5(){X5=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:x(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function b(){}function g(){}var S={};l(S,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,a)&&(S=_);var O=g.prototype=m.prototype=Object.create(S);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Q5(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Z5(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function $5(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Z5(i,n,o,a,s,"next",t)}function s(t){Z5(i,n,o,a,s,"throw",t)}a(void 0)})}}function t6(t){var e,r,n,o=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);o--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new e6(e.call(t));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function e6(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(e6=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new e6(t)}U5.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},U5.prototype.next=function(t){return this._invoke("next",t)},U5.prototype.throw=function(t){return this._invoke("throw",t)},U5.prototype.return=function(t){return this._invoke("return",t)};var r6=RQ().FeatureGroup.extend({initialize:function(t,e){this.options=e||{},this.strategy=this.options.strategy||"bbox",this._layers={},this.url=t,this.previousLayer=null,this.loadedExtentsRtree_=new(O3()),this.extent=this.options.extent,this._cacheIds=[],this._validatedId=!1,this._checked=!1,this.idField=this.options.idField||"SmID",this._updateFeaturesFn=this._updateFeatures.bind(this),RQ().Util.setOptions(this,e)},onAdd:function(t){this.map=t;var e,r,n,o=[];if("bbox"===this.strategy){var i=t.getBounds();o=[i.getWest(),i.getSouth(),i.getEast(),i.getNorth()],t.on("moveend",this._updateFeaturesFn)}if(this.extent){var a=(e=this.extent,n=[],function(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}(e,r=o)&&(e[0]>r[0]?n[0]=e[0]:n[0]=r[0],e[1]>r[1]?n[1]=e[1]:n[1]=r[1],e[2]=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function i6(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}var a6=E0.extend({initialize:function(t,e){E0.prototype.initialize.call(this,t,e),this._knowledgeGraphService=new PL(this.url,e)},findShortestPath:function(t,e){return this._knowledgeGraphService.findShortestPath(t,e)},query:function(t,e){return this._knowledgeGraphService.query(t,e)},getGraphMaps:function(t){return this._knowledgeGraphService.getGraphMaps(t)},getGraphMap:function(t,e){return this._knowledgeGraphService.getGraphMap(t,e)},getGraphMapData:function(t){var e,r=this;return(e=o6().mark(function e(){var n;return o6().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r._knowledgeGraphService.getGraphMapData(t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}},e)}),function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(t){i6(i,n,o,a,s,"next",t)}function s(t){i6(i,n,o,a,s,"throw",t)}a(void 0)})})()}});function s6(t){"@babel/helpers - typeof";return(s6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u6(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l6(){l6=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:x(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function b(){}function g(){}var S={};l(S,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==r&&n.call(_,a)&&(S=_);var O=g.prototype=m.prototype=Object.create(S);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function P(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==s6(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function T(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function j(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function c6(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function f6(t,e){for(var r=0;rthis.fileModel.FileConfig.fileMaxSize)return this.fire("filesizeexceed",{messageType:"warring",message:QH.i18n("msg_fileSizeExceeded")}),!1;var n=e.value,o=r.name,i=xJ(o);if(!i)return this.fire("errorfileformat",{messageType:"failure",message:QH.i18n("msg_fileTypeUnsupported")}),!1;""!==o&&(this.fileModel.set("loadFileObject",{file:r,filePath:n,fileName:o,fileType:i}),this._readData())},_readData:function(){var t=this,e=this,r=this.fileModel.loadFileObject.fileType;ZH.readFile(r,{file:this.fileModel.loadFileObject.file,path:this.fileModel.loadFileObject.filePath},function(n){ZH.processDataToGeoJson(r,n,function(e){e&&t.fire("openfilesucceeded",{result:e,layerName:t.fileModel.loadFileObject.fileName.split(".")[0]})},function(t){e.fire("openfilefailed",{messageType:"failure",message:t})},t)},function(){e.fire("openfilefailed",{messageType:"failure",message:QH.i18n("msg_openFileFail")})},this)}}),m8=d8.extend({options:{layer:null},initialize:function(t){d8.prototype.initialize.apply(this,[t]),this.viewModel=new v8},setViewStyle:function(t,e){this.rootContainer.style[t]=e},_initView:function(){var t=this,e=RQ().DomUtil.create("div","component-openfile");return e.id="openFile",this.fileSelect=RQ().DomUtil.create("div","",e),this.label=RQ().DomUtil.create("label","component-openfile__span--select",this.fileSelect),this.label.htmlFor="input_file",RQ().DomUtil.create("div","supermapol-icons-upload",this.label),RQ().DomUtil.create("span","component-openfile__span",this.label).appendChild(document.createTextNode(QH.i18n("text_chooseFile"))),this.fileInput=RQ().DomUtil.create("input","component-openfile__input",this.fileSelect),this.fileInput.id="input_file",this.fileInput.type="file",this.fileInput.accept=".json,.geojson,.csv,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",this.fileInput.onchange=function(e){t.messageBox.closeView(),t.viewModel.readFile(e)},this.messageBox=new KH,this.viewModel.on("filesizeexceed",function(e){t.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("errorfileformat",function(e){t.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("openfilefailed",function(e){t.messageBox.showView(e.message,e.messageType),t._event.fire("openfilefailed",e)}),this.viewModel.on("readdatafail",function(e){t.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("openfilesucceeded",function(e){t._event.fire("openfilesucceeded",e)}),this._preventMapEvent(e,this.map),e}});function b8(t){"@babel/helpers - typeof";return(b8="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S8(t,e){for(var r=0;r0&&this.addLayers(e),this.currentLayerDataModel=null},[{key:"addLayers",value:function(t,e,r,n){for(var o=0;o0?n.operatingAttributeNames:n.attributeNames).length;a0?this.fire("searchlayersucceeded",{result:r}):this.fire("searchfailed",{searchType:"searchLayersField"})}},searchFromCityLocalSearchService:function(t){if(this.searchCache[t])this.fire("geocodesucceeded",{result:this.searchCache[t]});else{this.geoCodeParam.keyWords=t||this.geoCodeParam.city;var e=this,r=this._getSearchUrl(this.geoCodeParam);co.get(r).then(function(t){return t.json()}).then(function(t){if(t.error||0===t.poiInfos.length)e.fire("searchfailed",{searchType:"searchGeocodeField"});else if(t.poiInfos){var r=e._dataToGeoJson(t.poiInfos,e.geoCodeParam);e.fire("geocodesucceeded",{result:r})}})}},addSearchLayers:function(t){var e=this;this.dataModel.addLayers(t,function(t){e.fire("newlayeradded",{layerName:t.layerName})},null,this)},panToLayer:function(t){this.dataModel.layers[t]&&this.map.flyToBounds(this.dataModel.layers[t].layer.getBounds())},panToCity:function(t){this.geoCodeParam.keyWords=t,this.geoCodeParam.city=t;var e=this,r=this._getSearchUrl(this.geoCodeParam);co.get(r).then(function(t){return t.json()}).then(function(t){if(t.poiInfos.length>0){var r=RQ().latLng(t.poiInfos[0].location.y,t.poiInfos[0].location.x);e.map.setView(r,8)}else e.fire("searchfailed",{searchType:"cityGeocodeField"})})},_dataToGeoJson:function(t,e){for(var r=[],n=0;n0&&document.getElementsByClassName("component-single-checked-img")[0].setAttribute("class","component-single-default-img"),r.firstChild.setAttribute("class","component-single-checked-img"),e.currentSearchLayerName=r.lastChild.innerText,e.isSearchLayer=!0,i.removeChild(i.firstChild),i.insertBefore(document.createTextNode(e.currentSearchLayerName),i.firstChild),e.viewModel.panToLayer(e.currentSearchLayerName),e.messageBox.closeView()},r.appendChild(f),t}(),c=[];s&&c.push({title:QH.i18n("title_searchCity"),content:s}),c.push({title:QH.i18n("title_searchLayer"),content:l});var f=new bJ({tabs:c}),p=f.getElement();f.closeView(),n.appendChild(p),o.onclick=function(){p.hidden?f.showView():f.closeView()},n.appendChild(o),i.innerText||i.appendChild(document.createTextNode(QH.i18n("text_label_chooseSearchLayers")));var h=document.createElement("div");h.setAttribute("class","component-search__input");var y=document.createElement("input");y.type="text",y.placeholder=QH.i18n("text_label_searchTips"),h.appendChild(y),this.poiInput=y;var d=document.createElement("span");d.setAttribute("class","supermapol-icons-close"),d.hidden=!0,h.appendChild(d),n.appendChild(h);var v=document.createElement("div");v.setAttribute("class","component-search-icon supermapol-icons-search");var m=new PJ;this._resultDomObj=m,v.onclick=function(){m.closeView(),t.clearSearchResult(),t.messageBox.closeView(),f.closeView();var e=t.poiInput.value.trim();""!==e?t.isSearchLayer?t.viewModel.search(e,t.currentSearchLayerName):t.viewModel.search(e):t.messageBox.showView(QH.i18n("msg_searchKeywords"))},y.onkeypress=function(t){if(13==t.which){var e=document.createEvent("HTMLEvents");e.initEvent("click",!1,!0),v.dispatchEvent(e)}},n.appendChild(v);var b=function(){var t=m.getElement();return t.style.position="absolute",t.style.top="44px",t.style.right="0",m.closeView(),m.content.onclick=function(t){var r=null;if("component-search-result-info"===t.target.parentNode.className)r=t.target.parentNode.parentNode;else if("component-search__resultitme"===t.target.parentNode.className)r=t.target.parentNode;else{if("component-search__resultitme"!==t.target.className)return;r=t.target}document.getElementsByClassName("component-search__resultitme-selected").length>0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),r.firstChild.classList.add("component-search__resultitme-selected");var n=r.children[1].firstChild.innerText;e._linkageFeature(n)},t}();return n.appendChild(b),d.onclick=function(e){t.clearSearchResult(),y.value="",e.target.hidden=!0,m.closeView()},y.oninput=function(){d.hidden=!1},this.messageBox=new KH,this._addViewModelListener(),r.appendChild(n),this._preventMapEvent(r,this.map),r},_createSearchLayerItem:function(t){var e=document.createElement("div");e.setAttribute("class","component-search__layers__itme");var r=document.createElement("div");r.setAttribute("class","component-search__layers__itme__singleselect");var n=document.createElement("div");n.setAttribute("class","component-single-default-img"),r.appendChild(n);var o=document.createElement("span");o.setAttribute("class","single-label"),o.innerHTML=t,r.appendChild(o),e.appendChild(r),document.getElementsByClassName("component-search__layers__body")[0].appendChild(e)},_createResultItem:function(t,e){var r=document.createElement("div");r.setAttribute("class","component-search__resultitme");var n=document.createElement("div");"Point"===t||"MultiPoint"===t?n.setAttribute("class","supermapol-icons-marker-layer component-search-result-icon"):"LineString"===t||"MultiLineString "===t?n.setAttribute("class","supermapol-icons-line-layer component-search-result-icon"):"Polygon"===t||"MultiPolygon"===t?n.setAttribute("class","supermapol-icons-polygon-layer component-search-result-icon"):n.setAttribute("class","supermapol-icons-point-layer component-search-result-icon"),r.appendChild(n);var o=document.createElement("div");o.setAttribute("class","component-search-result-info");var i=document.createElement("div");o.appendChild(i);var a=document.createElement("div");return e.name?(i.innerHTML=e.name,a.innerHTML=e.address,o.appendChild(a)):i.innerHTML=e.filterAttributeName+": "+e.filterAttributeValue,r.appendChild(o),document.createElement("div").setAttribute("class","component-checkbox component-checkbox-default-img"),r},_addViewModelListener:function(){var t=this;this.viewModel.on("searchlayerschanged",function(e){for(var r=0;re.length?(n=this.perPageDataNum*(t-1),r=e.length-1):(n=this.perPageDataNum*(t-1),r=t*this.perPageDataNum-1);for(var o=document.createElement("div"),i=n;i<=r;i++){var a=void 0,s="Point";e[i].filterAttribute?(s=e[i].feature.geometry.type,a=e[i].filterAttribute):a=e[i].properties,o.appendChild(this._createResultItem(s,a))}this._resultDomObj.setContent(o),this._resultDomObj.showView(),o.firstChild.getElementsByClassName("component-search-result-icon")[0].classList.add("component-search__resultitme-selected");var u=o.firstChild.getElementsByClassName("component-search-result-info")[0].firstChild.innerText;!this._selectMarkerFeature&&this._linkageFeature(u)},_flyToBounds:function(t){var e=t.getSouthWest(),r=t.getNorthEast();e.lat===r.lat&&e.lng===r.lng?this.map.flyTo(e):this.map.fitBounds(t)},_linkageFeature:function(t){var e=this,r="";r=this.isSearchLayer?t.split(":")[1].trim():t,this._selectFeature&&this._selectFeature.addTo(this.map),this.searchResultLayer.eachLayer(function(t){(!r||t.filterAttribute&&t.filterAttribute.filterAttributeValue===r||t.feature.properties&&t.feature.properties.name===r)&&(t.remove(),e._setSelectedLayerStyle(t))})},clearSearchResult:function(){this.searchResultLayer&&(this.map.closePopup(),!this.isSearchLayer&&this.map.removeLayer(this.searchResultLayer),this._selectMarkerFeature&&this.map.removeLayer(this._selectMarkerFeature),this._selectFeaturethis&&this.map.removeLayer(this._selectFeature),this._selectMarkerFeature=null,this._selectFeature=null,this.searchResultLayer=null,this.currentResult=null)},_featureOnclickEvent:function(t,e){var r=this;e.on("click",function(){var n,o,i=document.getElementsByClassName("component-pagination__link")[0];r._resultDomObj._changePageEvent({target:i.children[0].children[0]}),r._selectFeature&&r._selectFeature.addTo(r.map),e.remove();for(var a=0;a1)for(var u=1;u0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),p.firstChild.classList.add("component-search__resultitme-selected"),r._setSelectedLayerStyle(e)}},this)},_setSelectedLayerStyle:function(t){var e;this._selectMarkerFeature&&this._selectMarkerFeature.remove(),this._selectMarkerFeature=null,this._selectFeature=t,this._selectMarkerFeature=RQ().geoJSON(t.toGeoJSON(),{pointToLayer:function(t,e){return RQ().marker(e,{icon:RQ().divIcon({className:"component-select-marker-icon",iconAnchor:[15,0]})})},style:{fillColor:"red",weight:1,opacity:1,color:"red",fillOpacity:.2}}).addTo(this.map),this._selectMarkerFeature.bindPopup(function(){return new Xq({attributes:t.feature.properties}).getElement()},{closeOnClick:!1}).openPopup().addTo(this.map),this._flyToBounds(this.searchResultLayer.getBounds()),t.getLatLng?e=t.getLatLng():t.getCenter&&(e=t.getCenter()),this.map.setView(e)}}),T8=RQ().Evented.extend({options:{_defaultLayerOptions:{style:null,onEachFeature:function(t,e){var r="属性信息如下:
";for(var n in t.properties)r+=n+": "+t.properties[n]+"
";e.bindPopup(r)}}},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return new Error("Cannot find map, fileModel.map cannot be null.");this.map=t,RQ().Util.extend(this.options._defaultLayerOptions,e),this.options._defaultLayerOptions.pointToLayer=this.options._defaultLayerOptions.style,this.popupsStatus=!0,this.dataFlowStatus=!1,this.dataFlowUrl="",this.currentFeatures=[],this.dataFlowLayer=null},subscribe:function(t){var e=this;if(this.dataFlowUrl===t){if(this.dataFlowStatus)return void this.fire("dataflowservicesubscribed")}else this.dataFlowUrl=t;this.dataFlowStatus=!0,this.dataFlowLayer&&(this.dataFlowLayer.remove(),this.dataFlowLayer=null);var r=new _2(t,this.options._defaultLayerOptions);r.on("subscribesucceeded",function(t){e.fire("subscribesucceeded",{result:t})}),r.on("subscribefailed",function(t){e.fire("subscribefailed",{result:t})}),r.on("dataupdated",function(t){e.fire("dataupdated",{result:t});var r=t.layer.getBounds(),n=A0.toSuperMapBounds(e.map.getBounds()),o=A0.toSuperMapBounds(r);n.intersectsBounds(o)||(o.left===o.right&&o.top===o.bottom?e.map.setView(r.getCenter()):e.map.flyToBounds(r)),e.popupsStatus&&e.openPopups()}),r.addTo(this.map),this.dataFlowLayer=r},cancelSubscribe:function(){this.dataFlowLayer&&(this.dataFlowStatus=!1,this.dataFlowLayer.dataService.unSubscribe(),this.dataFlowLayer.remove(),this.dataFlowLayer=null)},openPopups:function(){if(this.popupsStatus=!0,this.dataFlowLayer)for(var t=this.dataFlowLayer.getLayers(),e=0;e\n \n \n \n \n ',RQ().DomUtil.create("span","",Z).innerHTML=QH.i18n("btn_analyzing");var tt=RQ().DomUtil.create("button","component-analysis__analysisbtn--cancel",X);tt.innerHTML=QH.i18n("btn_cancelAnalysis");var et=RQ().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",Y);et.innerHTML=QH.i18n("btn_emptyTheAnalysisLayer");for(var rt=function(e){a.children[e].onclick=function(){i.innerHTML=a.children[e].outerHTML,i.children[0].id="dropDownTop";var r=document.getElementById("layersSelect"),o=document.getElementById("layerSelectName"),s=a.children[e].getAttribute("data-value"),u={};switch(s){case"buffer":d.classList.add("hidden"),j.classList.remove("hidden"),n.style.height="422px",W.value=QH.i18n("text_label_buffer")+o.title,u=t.fillData.point;break;case"isolines":d.classList.remove("hidden"),j.classList.add("hidden"),n.style.height="712px",W.value=QH.i18n("text_label_isolines")+o.title,u=t.fillData.point}if(t.currentFillData!==u){if(r.innerHTML="","{}"==JSON.stringify(u))return W.value="",o.title="",void(o.innerHTML="");var l=[];for(var c in u)l.push(c);o.title=l[0],o.innerHTML=l[0],t._createOptions(r,l),t.layerSelectObj.optionClickEvent(r,o,t.layersSelectOnchange),"buffer"===s?W.value=QH.i18n("text_label_buffer")+l[0]:"isolines"===s&&(W.value=QH.i18n("text_label_isolines")+l[0]),t.currentData=u[o.title],t.currentFillData=u}}},nt=0;nt\n \n \n \n \n ',RQ().DomUtil.create("span","",nt).innerHTML=QH.i18n("btn_analyzing");var ot=RQ().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",tt);function it(t){if(this.messageBox.closeView(),this.dataHash){C.innerHTML="";var e=this.dataHash[t.title],r=this;this.viewModel.on("datasetinfoloaded",function(t){T.title=QH.i18n("text_option_notSet"),T.innerHTML=QH.i18n("text_option_notSet"),C.innerHTML="";var e=i.getAttribute("data-value"),n=t.result.type,o=t.result.fields;"density"===e&&("REGION"===n||"LINE"===n?r.messageBox.showView(QH.i18n("msg_datasetOrMethodUnsupport"),"failure"):(r.messageBox.closeView(),r._createOptions(C,o),r.weightFieldsSelectObj.optionClickEvent(C,T)))}),this.viewModel.getDatasetInfo(e)}}return ot.id="deleteLayersBtn",ot.innerHTML=QH.i18n("btn_emptyTheAnalysisLayer"),this.messageBox=new KH,this.datasetSelectOnchange=it.bind(this),et.onclick=function(){t.messageBox.closeView();var e=function(){var t,e,r=i.getAttribute("data-value"),n=O.getAttribute("data-value"),o=P.getAttribute("data-value"),a=j.value,s=R.title,u=F.title,l=V.title,c=Q.getAttribute("data-value"),f=q.getAttribute("data-value"),p=new Date,y=Z.value||p.getTime();t="NOTSET"===f?"":{rangeMode:f,rangeCount:W.value,colorGradientType:c};"density"===r&&(e=new V_({datasetName:h.title,method:n,meshType:o,resolution:M.value,fields:T.title,radius:B.value,meshSizeUnit:s,radiusUnit:u,areaUnit:l,query:a,mappingParameters:new eu({rangeMode:t.rangeMode,rangeCount:t.rangeCount,colorGradientType:t.colorGradientType})}));return{analysisParam:e,resultLayerName:y}}();h.title===QH.i18n("text_option_selectDataset")?t.messageBox.showView(QH.i18n("msg_selectDataset"),"failure"):T.title===QH.i18n("text_option_notSet")?t.messageBox.showView(QH.i18n("msg_setTheWeightField"),"failure"):(t.messageBox.closeView(),rt.style.display="block",et.style.display="none",t.viewModel.on("layerloaded",function(e){rt.style.display="none",et.style.display="block",t._event.fire("analysissucceeded",{layer:e.layer,name:e.name})}),t.viewModel.on("analysisfailed",function(e){t.messageBox.showView(QH.i18n("msg_theFieldNotSupportAnalysis"),"failure"),rt.style.display="none",et.style.display="block",t._event.fire("analysisfailed",{error:e.error})}),t.viewModel.analysis(e,t.map))},ot.onclick=function(){t.viewModel.on("layersremoved",function(e){t._event.fire("layersremoved",{layers:e.layers})}),t.viewModel.clearLayers()},this._preventMapEvent(e,this.map),e},_createOptions:function(t,e){for(var r in e){var n=document.createElement("div");n.className="component-selecttool__option",n.title=e[r],n.innerHTML=e[r],n.setAttribute("data-value",e[r]),t.appendChild(n)}},_creatInputBox:function(t,e){var r=RQ().DomUtil.create("div","",e);RQ().DomUtil.create("span","",r).innerHTML=t.spanName;var n=RQ().DomUtil.create("input","",r);return n.value=t.value,n.className="component-distributeanalysis__input",r},_creatUnitSelectBox:function(t,e){var r=RQ().DomUtil.create("div","component-clientcomputation__buffer--radius",e);RQ().DomUtil.create("span","",r).innerHTML=t.labelName;var n=RQ().DomUtil.create("div","",r);RQ().DomUtil.create("input","buffer-radius-input",n);var o=RQ().DomUtil.create("div","component-clientcomputation__buffer--unit",n),i=t.selectOptions,a=new Aq(i).getElement();return o.appendChild(a),r},_setEleAtribute:function(t,e,r){for(var n=0;n1){var n={optionsArr:t,labelName:QH.i18n("text_label_queryMode"),optionsClickCb:this.queryModeltOnchange},o=new Aq(n).getElement();e.appendChild(o),r=o.children[1].children[0],o.children[1].classList.add("dataservice-select");var i=o.children[1];i.classList.add("dataservice-select"),i.classList.add("querymodel-select")}else{var a=RQ().DomUtil.create("span","",u);a.innerHTML=QH.i18n("text_label_queryMode"),r=RQ().DomUtil.create("div","component-servicequery__querymode-selectname",u);var s=RQ().DomUtil.create("span","",r);t instanceof Array?s.innerHTML=t[0]:s.innerHTML=t,r.title=s.innerHTML,this.queryModeltOnchange(r)}return r.id="queryModelSelectName",r}.bind(this),this.queryModeltOnchange=W.bind(this),this.creatQueryModeSelect(n,l);var c=RQ().DomUtil.create("div","component-analysis__container component-textarea--dataservice__container",a),f=RQ().DomUtil.create("span","textarea-name",c);f.innerHTML=QH.i18n("text_label_IDArrayOfFeatures");var p=RQ().DomUtil.create("div","component-textarea component-textarea--dataservice",c);p.id="getfeaturesIdArr";var h=RQ().DomUtil.create("div","scrollarea",p),y=RQ().DomUtil.create("div","component-scrollarea-content",h);y.setAttribute("tabindex","1");var d=RQ().DomUtil.create("textarea","component-textarea__content",y);d.value="[1,2,3]",d.id="getValueTextArea";var v=RQ().DomUtil.create("div","component-servicequery__maxfeatures-container hidden",a),m={spanName:QH.i18n("text_label_maxFeatures"),value:"1000"},b=this._creatInputBox(m,v).children[1];b.classList.add("max-features-input");var g=RQ().DomUtil.create("div","component-servicequery__distance-container hidden",a),S={spanName:QH.i18n("text_label_bufferDistance"),value:"10"},w=this._creatInputBox(S,g).children[1],_=RQ().DomUtil.create("div","component-analysis__container component-textarea--dataservice__container hidden",a),O=RQ().DomUtil.create("span","textarea-name",_),E=RQ().DomUtil.create("div","",_),P=RQ().DomUtil.create("div","component-servicequery__rangeicon-container",E);O.innerHTML=QH.i18n("text_label_queryRange1");var x=RQ().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-polygon-layer bounds",P),T=RQ().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-line-layer hidden",P),C=RQ().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-point-layer hidden",P),k=RQ().DomUtil.create("div","component-textarea component-textarea--rangequery",E);k.id="getfeaturesIdArr";var A=RQ().DomUtil.create("div","",k),j=RQ().DomUtil.create("div","component-scrollarea-content",A);j.setAttribute("tabindex","1");var N=RQ().DomUtil.create("textarea","component-textarea__content component-textarea--rangequery__content",j);N.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';var I=RQ().DomUtil.create("div","component-servicequery__spatialquerymode-container hidden",a),M={optionsArr:["CONTAIN","CROSS","DISJOINT","IDENTITY","INTERSECT","NONE","OVERLAP","TOUCH","WITHIN"],labelName:QH.i18n("text_label_spatialQueryMode")},R=RQ().DomUtil.create("div","component-analysis__selecttool",I),L=new Aq(M).getElement();L.children[1].classList.add("dataservice-select"),R.appendChild(L);var D=L.children[1].children[0];D.id="spatialQueryModeSelectName",L.children[1].children[2].classList.add("component-servicequery__spatialquerymode__selectcontent");var B=RQ().DomUtil.create("div","component-analysis__container__analysisbtn",a),F=RQ().DomUtil.create("div","component-analysis__analysisbtn",B),U=RQ().DomUtil.create("button","component-analysis__analysisbtn--analysis",F);U.innerHTML=QH.i18n("btn_query");var G=RQ().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",F),V=RQ().DomUtil.create("div","component-analysis__analysisbtn--analysising component-servicequery__querybtn--querying",G);RQ().DomUtil.create("div","component-analysis__svg-container",V).innerHTML='\n \n \n \n \n ',RQ().DomUtil.create("span","",V).innerHTML=QH.i18n("btn_querying");var z=RQ().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",F);z.innerHTML=QH.i18n("btn_emptyTheRresultLayer"),W(n[0]);var H,q,J=this;function W(t){var e;switch(e=t.title?t.title:t,v.classList.add("hidden"),_.classList.add("hidden"),g.classList.add("hidden"),T.classList.add("hidden"),C.classList.add("hidden"),x.classList.remove("bounds"),I.classList.add("hidden"),f.innerHTML=QH.i18n("text_label_featureFilter"),d.value="SMID<10","BUFFER"!==e&&"SPATIAL"!==e||(_.classList.remove("hidden"),O.innerHTML=QH.i18n("text_label_geometricObject"),N.value='{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[84.90234375,40.25390625]}}',T.classList.remove("hidden"),C.classList.remove("hidden")),e){case"ID":f.innerHTML=QH.i18n("text_label_IDArrayOfFeatures"),d.value="[1,2,3]";break;case"SQL":v.classList.remove("hidden");break;case"BOUNDS":_.classList.remove("hidden"),O.innerHTML=QH.i18n("text_label_queryRange"),N.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}',x.classList.add("bounds");break;case"BUFFER":g.classList.remove("hidden");break;case"SPATIAL":I.classList.remove("hidden")}}return U.onclick=function(){t.messageBox.closeView(),G.style.display="block",U.style.display="none";var e=function(){var t,e=J.dataSetNames,r=document.getElementById("queryModelSelectName").title,n=d.value;if("ID"===r){var o=d.value,i=o.substring(1,o.length-1).split(",");t=new Ym({IDs:i,datasetNames:e})}else if("SQL"===r){var a=b.value;t=new fb({queryParameter:{attributeFilter:n},datasetNames:e,maxFeatures:a})}else if("BOUNDS"===r){if(!H){var s=JSON.parse(N.value);H=RQ().bounds([s.leftBottom.x,s.leftBottom.y],[s.rightTop.x,s.rightTop.y])}t=new Wv({attributeFilter:n,datasetNames:e,bounds:H})}else if("BUFFER"===r){var u=w.value,l=JSON.parse(N.value),c=q||l;t=new mm({attributeFilter:n,datasetNames:e,bufferDistance:u,geometry:c})}else if("SPATIAL"===r){var f=D.title,p=JSON.parse(N.value),h=q||p;t=new Im({attributeFilter:n,datasetNames:e,spatialQueryMode:f,geometry:h})}return t}();t.viewModel.on("getfeaturessucceeded",function(e){G.style.display="none",U.style.display="block",0===e.result.features.length&&t.messageBox.showView(QH.i18n("msg_dataReturnedIsEmpty"),"success"),t._event.fire("getfeaturessucceeded",{result:e.result})}),t.viewModel.on("getfeaturesfailed",function(e){G.style.display="none",U.style.display="block",t.messageBox.showView(e.error.errorMsg,"failure"),t._event.fire("getfeaturesfailed",{error:e.error})}),t.viewModel.getFeatures(e,t.map)},x.onclick=function(e){var r=document.getElementById("queryModelSelectName").title;q&&q.remove(),"BOUNDS"===r?t.map.pm.enableDraw("Rectangle"):t.map.pm.enableDraw("Poly"),e.stopPropagation(),e.preventDefault()},T.onclick=function(e){q&&q.remove(),t.map.pm.enableDraw("Line"),e.stopPropagation(),e.preventDefault()},C.onclick=function(e){q&&q.remove(),t.map.pm.enableDraw("Marker"),e.stopPropagation(),e.preventDefault()},this.map.on("pm:create",function(e){if("Rectangle"===e.shape){var r=(q=e.layer).getBounds();H=RQ().bounds([r._southWest.lng,r._southWest.lat],[r._northEast.lng,r._northEast.lat]);var n={leftBottom:{x:r._southWest.lng,y:r._southWest.lat},rightTop:{x:r._northEast.lng,y:r._northEast.lat}};N.value=JSON.stringify(n)}"Marker"===e.shape&&(q=e.layer,N.value=JSON.stringify(e.layer.toGeoJSON()),t.map.pm.disableDraw("Marker")),"Line"===e.shape&&(q=e.layer,N.value=JSON.stringify(e.layer.toGeoJSON())),"Polygon"===e.shape&&(q=e.layer,N.value=JSON.stringify(e.layer.toGeoJSON()))}),z.onclick=function(){t.viewModel.clearLayers()},this._preventMapEvent(e,this.map),e},_creatInputBox:function(t,e){var r=RQ().DomUtil.create("div","",e);return RQ().DomUtil.create("span","",r).innerHTML=t.spanName,RQ().DomUtil.create("input","",r).value=t.value,r}});function y9(t){"@babel/helpers - typeof";return(y9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d9(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function v9(t){for(var e=1;ec;)if((l=s[c++])!=l)return!0}else for(;u>c;c++)if((t||c in s)&&s[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},9084:function(t,e,r){"use strict";var n=r(4877);t.exports=function(t,e){var r=[][t];return!!r&&n(function(){r.call(null,e||function(){return 1},1)})}},6072:function(t,e,r){"use strict";var n=r(7644),o=r(6079),i=r(9213),a=r(428),s=TypeError,u="Reduce of empty array with no initial value",l=function(t){return function(e,r,l,c){var f=o(e),p=i(f),h=a(f);if(n(r),0===h&&l<2)throw new s(u);var y=t?h-1:0,d=t?-1:1;if(l<2)for(;;){if(y in p){c=p[y],y+=d;break}if(y+=d,t?y<0:h<=y)throw new s(u)}for(;t?y>=0:h>y;y+=d)y in p&&(c=r(c,p[y],y,f));return c}};t.exports={left:l(!1),right:l(!0)}},7934:function(t,e,r){"use strict";var n=r(398);t.exports=n([].slice)},8113:function(t,e,r){"use strict";var n=r(7709)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){try{if(!e&&!o)return!1}catch(t){return!1}var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r}},4538:function(t,e,r){"use strict";var n=r(398),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},5229:function(t,e,r){"use strict";var n=r(3774),o=r(2631),i=r(4538),a=r(7709)("toStringTag"),s=Object,u="Arguments"===i(function(){return arguments}());t.exports=n?i:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?r:u?i(e):"Object"===(n=i(e))&&o(e.callee)?"Arguments":n}},578:function(t,e,r){"use strict";var n=r(2791),o=r(7197),i=r(1805),a=r(1807);t.exports=function(t,e,r){for(var s=o(e),u=a.f,l=i.f,c=0;c0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},1009:function(t){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3768:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(1697),i=r(1805).f,a=r(5233),s=r(5414),u=r(6507),l=r(578),c=r(3670);t.exports=function(t,e){var r,f,p,h,y,d=t.target,v=t.global,m=t.stat;if(r=v?o:m?o[d]||u(d,{}):o[d]&&o[d].prototype)for(f in e){if(h=e[f],p=t.dontCallGetSet?(y=i(r,f))&&y.value:r[f],!c(v?f:d+(m?".":"#")+f,t.forced)&&void 0!==p){if(n(h)==n(p))continue;l(h,p)}(t.sham||p&&p.sham)&&a(h,"sham",!0),s(r,f,h,t)}}},4877:function(t){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},2610:function(t,e,r){"use strict";r(1569);var n=r(9707),o=r(5414),i=r(2693),a=r(4877),s=r(7709),u=r(5233),l=s("species"),c=RegExp.prototype;t.exports=function(t,e,r,f){var p=s(t),h=!a(function(){var e={};return e[p]=function(){return 7},7!==""[t](e)}),y=h&&!a(function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[l]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return e=!0,null},r[p](""),!e});if(!h||!y||r){var d=/./[p],v=e(p,""[t],function(t,e,r,o,a){var s=e.exec;return s===i||s===c.exec?h&&!a?{done:!0,value:n(d,e,r,o)}:{done:!0,value:n(t,r,e,o)}:{done:!1}});o(String.prototype,t,v[0]),o(c,p,v[1])}f&&u(c[p],"sham",!0)}},2039:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(8574),i=Function.prototype,a=i.apply,s=i.call;t.exports="object"==("undefined"==typeof Reflect?"undefined":n(Reflect))&&Reflect.apply||(o?s.bind(a):function(){return s.apply(a,arguments)})},3406:function(t,e,r){"use strict";var n=r(5846),o=r(7644),i=r(8574),a=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},8574:function(t,e,r){"use strict";var n=r(4877);t.exports=!n(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},9707:function(t,e,r){"use strict";var n=r(8574),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},2756:function(t,e,r){"use strict";var n=r(9234),o=r(2791),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),u=s&&"something"===function(){}.name,l=s&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:l}},6700:function(t,e,r){"use strict";var n=r(398),o=r(7644);t.exports=function(t,e,r){try{return n(o(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},5846:function(t,e,r){"use strict";var n=r(4538),o=r(398);t.exports=function(t){if("Function"===n(t))return o(t)}},398:function(t,e,r){"use strict";var n=r(8574),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=n?a:function(t){return function(){return i.apply(t,arguments)}}},5189:function(t,e,r){"use strict";var n=r(1697),o=r(2631);t.exports=function(t,e){return arguments.length<2?(r=n[t],o(r)?r:void 0):n[t]&&n[t][e];var r}},5933:function(t,e,r){"use strict";var n=r(5229),o=r(2968),i=r(155),a=r(2347),s=r(7709)("iterator");t.exports=function(t){if(!i(t))return o(t,s)||o(t,"@@iterator")||a[n(t)]}},5795:function(t,e,r){"use strict";var n=r(9707),o=r(7644),i=r(9809),a=r(4861),s=r(5933),u=TypeError;t.exports=function(t,e){var r=arguments.length<2?s(t):e;if(o(r))return i(n(r,t));throw new u(a(t)+" is not iterable")}},2968:function(t,e,r){"use strict";var n=r(7644),o=r(155);t.exports=function(t,e){var r=t[e];return o(r)?void 0:n(r)}},5560:function(t,e,r){"use strict";var n=r(398),o=r(6079),i=Math.floor,a=n("".charAt),s=n("".replace),u=n("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,n,f,p){var h=r+t.length,y=n.length,d=c;return void 0!==f&&(f=o(f),d=l),s(p,d,function(o,s){var l;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,r);case"'":return u(e,h);case"<":l=f[u(s,1,-1)];break;default:var c=+s;if(0===c)return o;if(c>y){var p=i(c/10);return 0===p?o:p<=y?void 0===n[p-1]?a(s,1):n[p-1]+a(s,1):o}l=n[c-1]}return void 0===l?"":l})}},1697:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=function(t){return t&&t.Math===Math&&t};t.exports=o("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||o("object"==("undefined"==typeof window?"undefined":n(window))&&window)||o("object"==("undefined"==typeof self?"undefined":n(self))&&self)||o("object"==(void 0===r.g?"undefined":n(r.g))&&r.g)||o("object"==n(this)&&this)||function(){return this}()||Function("return this")()},2791:function(t,e,r){"use strict";var n=r(398),o=r(6079),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},8551:function(t){"use strict";t.exports={}},8079:function(t){"use strict";t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},511:function(t,e,r){"use strict";var n=r(5189);t.exports=n("document","documentElement")},107:function(t,e,r){"use strict";var n=r(9234),o=r(4877),i=r(2533);t.exports=!n&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},9213:function(t,e,r){"use strict";var n=r(398),o=r(4877),i=r(4538),a=Object,s=n("".split);t.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?s(t,""):a(t)}:a},3128:function(t,e,r){"use strict";var n=r(398),o=r(2631),i=r(4243),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},7863:function(t,e,r){"use strict";var n,o,i,a=r(5032),s=r(1697),u=r(6220),l=r(5233),c=r(2791),f=r(4243),p=r(109),h=r(8551),y=s.TypeError,d=s.WeakMap;if(a||f.state){var v=f.state||(f.state=new d);v.get=v.get,v.has=v.has,v.set=v.set,n=function(t,e){if(v.has(t))throw new y("Object already initialized");return e.facade=t,v.set(t,e),e},o=function(t){return v.get(t)||{}},i=function(t){return v.has(t)}}else{var m=p("state");h[m]=!0,n=function(t,e){if(c(t,m))throw new y("Object already initialized");return e.facade=t,l(t,m,e),e},o=function(t){return c(t,m)?t[m]:{}},i=function(t){return c(t,m)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=o(e)).type!==t)throw new y("Incompatible receiver, "+t+" required");return r}}}},8223:function(t,e,r){"use strict";var n=r(7709),o=r(2347),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},3494:function(t,e,r){"use strict";var n=r(4538);t.exports=Array.isArray||function(t){return"Array"===n(t)}},2631:function(t){"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r="object"==("undefined"==typeof document?"undefined":e(document))&&document.all;t.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},3779:function(t,e,r){"use strict";var n=r(398),o=r(4877),i=r(2631),a=r(5229),s=r(5189),u=r(3128),l=function(){},c=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=n(f.exec),h=!f.test(l),y=function(t){if(!i(t))return!1;try{return c(l,[],t),!0}catch(t){return!1}},d=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(f,u(t))}catch(t){return!0}};d.sham=!0,t.exports=!c||o(function(){var t;return y(y.call)||!y(Object)||!y(function(){t=!0})||t})?d:y},3670:function(t,e,r){"use strict";var n=r(4877),o=r(2631),i=/#|\.prototype\./,a=function(t,e){var r=u[s(t)];return r===c||r!==l&&(o(e)?n(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},155:function(t){"use strict";t.exports=function(t){return null===t||void 0===t}},6220:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(2631);t.exports=function(t){return"object"==n(t)?null!==t:o(t)}},883:function(t,e,r){"use strict";var n=r(6220);t.exports=function(t){return n(t)||null===t}},497:function(t){"use strict";t.exports=!1},7078:function(t,e,r){"use strict";var n=r(6220),o=r(4538),i=r(7709)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"===o(t))}},3443:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(5189),i=r(2631),a=r(7123),s=r(5970),u=Object;t.exports=s?function(t){return"symbol"==n(t)}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,u(t))}},9318:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(3406),i=r(9707),a=r(9809),s=r(4861),u=r(8223),l=r(428),c=r(7123),f=r(5795),p=r(5933),h=r(2861),y=TypeError,d=function(t,e){this.stopped=t,this.result=e},v=d.prototype;t.exports=function(t,e,r){var m,b,g,S,w,_,O,E=r&&r.that,P=!(!r||!r.AS_ENTRIES),x=!(!r||!r.IS_RECORD),T=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),k=o(e,E),A=function(t){return m&&h(m,"normal",t),new d(!0,t)},j=function(t){return P?(a(t),C?k(t[0],t[1],A):k(t[0],t[1])):C?k(t,A):k(t)};if(x)m=t.iterator;else if(T)m=t;else{if(!(b=p(t)))throw new y(s(t)+" is not iterable");if(u(b)){for(g=0,S=l(t);S>g;g++)if((w=j(t[g]))&&c(v,w))return w;return new d(!1)}m=f(t,b)}for(_=x?t.next:m.next;!(O=i(_,m)).done;){try{w=j(O.value)}catch(t){h(m,"throw",t)}if("object"==n(w)&&w&&c(v,w))return w}return new d(!1)}},2861:function(t,e,r){"use strict";var n=r(9707),o=r(9809),i=r(2968);t.exports=function(t,e,r){var a,s;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw r;return r}a=n(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw r;if(s)throw a;return o(a),r}},3932:function(t,e,r){"use strict";var n=r(1983).IteratorPrototype,o=r(7766),i=r(1718),a=r(7625),s=r(2347),u=function(){return this};t.exports=function(t,e,r,l){var c=e+" Iterator";return t.prototype=o(n,{next:i(+!l,r)}),a(t,c,!1,!0),s[c]=u,t}},2514:function(t,e,r){"use strict";var n=r(3768),o=r(9707),i=r(497),a=r(2756),s=r(2631),u=r(3932),l=r(4609),c=r(5949),f=r(7625),p=r(5233),h=r(5414),y=r(7709),d=r(2347),v=r(1983),m=a.PROPER,b=a.CONFIGURABLE,g=v.IteratorPrototype,S=v.BUGGY_SAFARI_ITERATORS,w=y("iterator"),_=function(){return this};t.exports=function(t,e,r,a,y,v,O){u(r,e,a);var E,P,x,T=function(t){if(t===y&&N)return N;if(!S&&t&&t in A)return A[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},C=e+" Iterator",k=!1,A=t.prototype,j=A[w]||A["@@iterator"]||y&&A[y],N=!S&&j||T(y),I="Array"===e&&A.entries||j;if(I&&(E=l(I.call(new t)))!==Object.prototype&&E.next&&(i||l(E)===g||(c?c(E,g):s(E[w])||h(E,w,_)),f(E,C,!0,!0),i&&(d[C]=_)),m&&"values"===y&&j&&"values"!==j.name&&(!i&&b?p(A,"name","values"):(k=!0,N=function(){return o(j,this)})),y)if(P={values:T("values"),keys:v?N:T("keys"),entries:T("entries")},O)for(x in P)!S&&!k&&x in A||h(A,x,P[x]);else n({target:e,proto:!0,forced:S||k},P);return i&&!O||A[w]===N||h(A,w,N,{name:y}),d[e]=N,P}},1983:function(t,e,r){"use strict";var n,o,i,a=r(4877),s=r(2631),u=r(6220),l=r(7766),c=r(4609),f=r(5414),p=r(7709),h=r(497),y=p("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(n=o):d=!0),!u(n)||a(function(){var t={};return n[y].call(t)!==t})?n={}:h&&(n=l(n)),s(n[y])||f(n,y,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},2347:function(t){"use strict";t.exports={}},428:function(t,e,r){"use strict";var n=r(9800);t.exports=function(t){return n(t.length)}},7773:function(t,e,r){"use strict";var n=r(398),o=r(4877),i=r(2631),a=r(2791),s=r(9234),u=r(2756).CONFIGURABLE,l=r(3128),c=r(7863),f=c.enforce,p=c.get,h=String,y=Object.defineProperty,d=n("".slice),v=n("".replace),m=n([].join),b=s&&!o(function(){return 8!==y(function(){},"length",{value:8}).length}),g=String(String).split("String"),S=t.exports=function(t,e,r){"Symbol("===d(h(e),0,7)&&(e="["+v(h(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(s?y(t,"name",{value:e,configurable:!0}):t.name=e),b&&r&&a(r,"arity")&&t.length!==r.arity&&y(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=f(t);return a(n,"source")||(n.source=m(g,"string"==typeof e?e:"")),t};Function.prototype.toString=S(function(){return i(this)&&p(this).source||l(this)},"toString")},7443:function(t){"use strict";var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},453:function(t,e,r){"use strict";var n,o,i,a,s,u=r(1697),l=r(4847),c=r(3406),f=r(755).set,p=r(7975),h=r(3925),y=r(5262),d=r(5419),v=r(7218),m=u.MutationObserver||u.WebKitMutationObserver,b=u.document,g=u.process,S=u.Promise,w=l("queueMicrotask");if(!w){var _=new p,O=function(){var t,e;for(v&&(t=g.domain)&&t.exit();e=_.get();)try{e()}catch(t){throw _.head&&n(),t}t&&t.enter()};h||v||d||!m||!b?!y&&S&&S.resolve?((a=S.resolve(void 0)).constructor=S,s=c(a.then,a),n=function(){s(O)}):v?n=function(){g.nextTick(O)}:(f=c(f,u),n=function(){f(O)}):(o=!0,i=b.createTextNode(""),new m(O).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),w=function(t){_.head||n(),_.add(t)}}t.exports=w},3985:function(t,e,r){"use strict";var n=r(7644),o=TypeError;t.exports.f=function(t){return new function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw new o("Bad Promise constructor");e=t,r=n}),this.resolve=n(e),this.reject=n(r)}(t)}},4249:function(t,e,r){"use strict";var n=r(7078),o=TypeError;t.exports=function(t){if(n(t))throw new o("The method doesn't accept regular expressions");return t}},6355:function(t,e,r){"use strict";var n=r(9234),o=r(398),i=r(9707),a=r(4877),s=r(3334),u=r(791),l=r(15),c=r(6079),f=r(9213),p=Object.assign,h=Object.defineProperty,y=o([].concat);t.exports=!p||a(function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection");return t[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(t){e[t]=t}),7!==p({},t)[r]||"abcdefghijklmnopqrst"!==s(p({},e)).join("")})?function(t,e){for(var r=c(t),o=arguments.length,a=1,p=u.f,h=l.f;o>a;)for(var d,v=f(arguments[a++]),m=p?y(s(v),p(v)):s(v),b=m.length,g=0;b>g;)d=m[g++],n&&!i(h,v,d)||(r[d]=v[d]);return r}:p},7766:function(t,e,r){"use strict";var n,o=r(9809),i=r(9507),a=r(1009),s=r(8551),u=r(511),l=r(2533),c=r(109)("IE_PROTO"),f=function(){},p=function(t){return"