/*! For license information please see iclient-mapboxgl-react.min.js.LICENSE.txt */ /*! * * @supermap/react-iclient.(https://iclient.supermap.io) * Copyright© 2000 - 2023 SuperMap Software Co.Ltd * license: Apache-2.0 * version: v11.1.0 * */ !function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("../public/libs/mapboxgl/mapbox-gl-enhance.js"),require("echarts"),require("three/build/three"),require("../public/libs/deckgl/deck.gl.min.js"),require("../public/libs/iclient-mapboxgl/iclient-mapboxgl.min.js"),require("antd"),require("../public/libs/echarts-layer/EchartsLayer.js"),require("react"),require("canvg")):"function"===typeof define&&define.amd?define(["../public/libs/mapboxgl/mapbox-gl-enhance.js","echarts","three/build/three","../public/libs/deckgl/deck.gl.min.js","../public/libs/iclient-mapboxgl/iclient-mapboxgl.min.js","antd","../public/libs/echarts-layer/EchartsLayer.js","react","canvg"],t):"object"===typeof exports?exports.SuperMap=t(require("../public/libs/mapboxgl/mapbox-gl-enhance.js"),require("echarts"),require("three/build/three"),require("../public/libs/deckgl/deck.gl.min.js"),require("../public/libs/iclient-mapboxgl/iclient-mapboxgl.min.js"),require("antd"),require("../public/libs/echarts-layer/EchartsLayer.js"),require("react"),require("canvg")):(e.SuperMap=e.SuperMap||{},e.SuperMap.Components=t(e.mapboxgl,e.echarts,e.THREE,e.DeckGL,e.SuperMap,e.antd,e.EchartsLayer,e.React,e.canvg))}(self,(function(__WEBPACK_EXTERNAL_MODULE__375__,__WEBPACK_EXTERNAL_MODULE__550__,__WEBPACK_EXTERNAL_MODULE__2069__,__WEBPACK_EXTERNAL_MODULE__2371__,__WEBPACK_EXTERNAL_MODULE__2395__,__WEBPACK_EXTERNAL_MODULE__2721__,__WEBPACK_EXTERNAL_MODULE__3094__,__WEBPACK_EXTERNAL_MODULE__3899__,__WEBPACK_EXTERNAL_MODULE__5973__){/******/ return function(){// webpackBootstrap /******/var __webpack_modules__={ /***/9705: /***/function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1540); /** * Takes a set of features, calculates the bbox of all input features, and returns a bounding box. * * @name bbox * @param {GeoJSON} geojson any GeoJSON object * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order * @example * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]); * var bbox = turf.bbox(line); * var bboxPolygon = turf.bboxPolygon(bbox); * * //addToMap * var addToMap = [line, bboxPolygon] */function a(e){var t=[1/0,1/0,-1/0,-1/0];return n.coordEach(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Iterate over coordinates in any GeoJSON object, similar to Array.forEach() * * @name coordEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * }); */ function n(e,t,r){ // Handles null Geometry -- Skips this GeoJSON if(null!==e) // This logic may look a little weird. The reason why it is that way // is because it's trying to be fast. GeoJSON supports multiple kinds // of objects at its root: FeatureCollection, Features, Geometries. // This function has the responsibility of handling all of them, and that // means that some of the `for` loops you see below actually just don't apply // to certain inputs. For instance, if you give this just a // Point geometry, then both loops are short-circuited and all we do // is gradually rename the input until it's called 'geometry'. // This also aims to allocate as few resources as possible: just a // few numbers and booleans, rather than any temporary arrays as would // be required with the normalization approach. for(var a,i,o,s,u,l,c,d,f=0,h=0,p=e.type,y="FeatureCollection"===p,m="Feature"===p,v=y?e.features.length:1,g=0;g} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * Starts at index 0, if an initialValue is provided, and at index 1 otherwise. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Reduce coordinates in any GeoJSON object, similar to Array.reduce() * * @name coordReduce * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {*} The value that results from the reduction. * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=previousValue * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * return currentCoord; * }); */ /* harmony default export */var a=// CONCATENATED MODULE: ./node_modules/@turf/envelope/node_modules/@turf/bbox/main.es.js /** * Takes a set of features, calculates the bbox of all input features, and returns a bounding box. * * @name bbox * @param {GeoJSON} geojson any GeoJSON object * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order * @example * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]); * var bbox = turf.bbox(line); * var bboxPolygon = turf.bboxPolygon(bbox); * * //addToMap * var addToMap = [line, bboxPolygon] */ function(e){var t=[1/0,1/0,-1/0,-1/0];return n(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON Feature * @example * var geometry = { * "type": "Point", * "coordinates": [110, 50] * }; * * var feature = turf.feature(geometry); * * //=feature */ function i(e,t,r){if(!u( // Optional Parameters r=r||{}))throw new Error("options is invalid");var n=r.bbox,a=r.id; // Validation if(void 0===e)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");n&&l(n),a&&c(a); // Main var i={type:"Feature"};return a&&(i.id=a),n&&(i.bbox=n),i.properties=t||{},i.geometry=e,i} /** * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates. * For GeometryCollection type use `helpers.geometryCollection` * * @name geometry * @param {string} type Geometry Type * @param {Array} coordinates Coordinates * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Geometry * @returns {Geometry} a GeoJSON Geometry * @example * var type = 'Point'; * var coordinates = [110, 50]; * * var geometry = turf.geometry(type, coordinates); * * //=geometry */ /** * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings. * * @name polygon * @param {Array>>} coordinates an array of LinearRings * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} Polygon Feature * @example * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' }); * * //=polygon */ function o(e,t,r){if(!e)throw new Error("coordinates is required");for(var n=0;n>>>} coordinates an array of Polygon coordinates * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Polygon FeatureCollection * @example * var polygons = turf.polygons([ * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]], * ]); * * //=polygons */ /** * isNumber * * @param {*} num Number to validate * @returns {boolean} true/false * @example * turf.isNumber(123) * //=true * turf.isNumber('foo') * //=false */ function s(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)} /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */function u(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */function l(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!s(e))throw new Error("bbox must only contain numbers")}))} /** * Validate Id * * @private * @param {string|number} id Id to validate * @returns {void} * @throws Error if Id is not valid * @example * validateId([-180, -40, 110, 50]) * //=Error * validateId([-180, -40]) * //=Error * validateId('Foo') * //=OK * validateId(5) * //=OK * validateId(null) * //=Error * validateId(undefined) * //=Error */function c(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")} // Deprecated methods /* harmony default export */var d=// CONCATENATED MODULE: ./node_modules/@turf/bbox-polygon/main.es.js /** * Takes a bbox and returns an equivalent {@link Polygon|polygon}. * * @name bboxPolygon * @param {BBox} bbox extent in [minX, minY, maxX, maxY] order * @returns {Feature} a Polygon representation of the bounding box * @example * var bbox = [0, 0, 10, 10]; * * var poly = turf.bboxPolygon(bbox); * * //addToMap * var addToMap = [poly] */ function(e){l(e); // Convert BBox positions to Numbers // No performance loss for including Number() // https://github.com/Turfjs/turf/issues/1119 var t=Number(e[0]),r=Number(e[1]),n=Number(e[2]),a=Number(e[3]);if(6===e.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var i=[t,r];return o([[i,[n,r],[n,a],[t,a],i]])}; /* harmony default export */var f=// CONCATENATED MODULE: ./node_modules/@turf/envelope/main.es.js /** * Takes any number of features and returns a rectangular {@link Polygon} that encompasses all vertices. * * @name envelope * @param {GeoJSON} geojson input features * @returns {Feature} a rectangular Polygon feature that encompasses all vertices * @example * var features = turf.featureCollection([ * turf.point([-75.343, 39.984], {"name": "Location A"}), * turf.point([-75.833, 39.284], {"name": "Location B"}), * turf.point([-75.534, 39.123], {"name": "Location C"}) * ]); * * var enveloped = turf.envelope(features); * * //addToMap * var addToMap = [features, enveloped]; */ function(e){return d(a(e))}; /***/}, /***/4102: /***/function(e,t){"use strict"; /** * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}. * * @name feature * @param {Geometry} geometry input geometry * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON Feature * @example * var geometry = { * "type": "Point", * "coordinates": [110, 50] * }; * * var feature = turf.feature(geometry); * * //=feature */ function r(e,t,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n} /** * Creates a {@link Point} {@link Feature} from a Position. * * @name point * @param {Array} coordinates longitude, latitude position (each in decimal degrees) * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a Point feature * @example * var point = turf.point([-75.343, 39.984]); * * //=point */ function n(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!h(e[0])||!h(e[1]))throw new Error("coordinates must contain numbers");return r({type:"Point",coordinates:e},t,n)} /** * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings. * * @name polygon * @param {Array>>} coordinates an array of LinearRings * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} Polygon Feature * @example * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' }); * * //=polygon */ function a(e,t,n){void 0===n&&(n={});for(var a=0,i=e;a>} coordinates an array of Positions * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} LineString Feature * @example * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'}); * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'}); * * //=linestring1 * //=linestring2 */ function i(e,t,n){if(void 0===n&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return r({type:"LineString",coordinates:e},t,n)} /** * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}. * * @name featureCollection * @param {Feature[]} features input features * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {FeatureCollection} FeatureCollection of Features * @example * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'}); * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'}); * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'}); * * var collection = turf.featureCollection([ * locationA, * locationB, * locationC * ]); * * //=collection */ function o(e,t){void 0===t&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r} /** * Creates a {@link Feature} based on a * coordinate array. Properties can be added optionally. * * @name multiLineString * @param {Array>>} coordinates an array of LineStrings * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a MultiLineString feature * @throws {Error} if no coordinates are passed * @example * var multiLine = turf.multiLineString([[[0,0],[10,10]]]); * * //=multiLine */ function s(e,t,n){return void 0===n&&(n={}),r({type:"MultiLineString",coordinates:e},t,n)} /** * Creates a {@link Feature} based on a * coordinate array. Properties can be added optionally. * * @name multiPoint * @param {Array>} coordinates an array of Positions * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a MultiPoint feature * @throws {Error} if no coordinates are passed * @example * var multiPt = turf.multiPoint([[0,0],[10,10]]); * * //=multiPt */ function u(e,t,n){return void 0===n&&(n={}),r({type:"MultiPoint",coordinates:e},t,n)} /** * Creates a {@link Feature} based on a * coordinate array. Properties can be added optionally. * * @name multiPolygon * @param {Array>>>} coordinates an array of Polygons * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a multipolygon feature * @throws {Error} if no coordinates are passed * @example * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]); * * //=multiPoly * */ function l(e,t,n){return void 0===n&&(n={}),r({type:"MultiPolygon",coordinates:e},t,n)} /** * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @name radiansToLength * @param {number} radians in radians across the sphere * @param {string} [units="kilometers"] can be degrees, radians, miles, inches, yards, metres, * meters, kilometres, kilometers. * @returns {number} distance */ function c(e,r){void 0===r&&(r="kilometers");var n=t.factors[r];if(!n)throw new Error(r+" units is invalid");return e*n} /** * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @name lengthToRadians * @param {number} distance in real units * @param {string} [units="kilometers"] can be degrees, radians, miles, inches, yards, metres, * meters, kilometres, kilometers. * @returns {number} radians */ function d(e,r){void 0===r&&(r="kilometers");var n=t.factors[r];if(!n)throw new Error(r+" units is invalid");return e/n} /** * Converts an angle in radians to degrees * * @name radiansToDegrees * @param {number} radians angle in radians * @returns {number} degrees between 0 and 360 degrees */ function f(e){return 180*(e%(2*Math.PI))/Math.PI} /** * isNumber * * @param {*} num Number to validate * @returns {boolean} true/false * @example * turf.isNumber(123) * //=true * turf.isNumber('foo') * //=false */ function h(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}), /** * @module helpers */ /** * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth. * * @memberof helpers * @type {number} */ t.earthRadius=6371008.8, /** * Unit of measurement factors using a spherical (non-ellipsoid) earth radius. * * @memberof helpers * @type {Object} */ t.factors={centimeters:100*t.earthRadius,centimetres:100*t.earthRadius,degrees:t.earthRadius/111325,feet:3.28084*t.earthRadius,inches:39.37*t.earthRadius,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:1e3*t.earthRadius,millimetres:1e3*t.earthRadius,nauticalmiles:t.earthRadius/1852,radians:1,yards:1.0936*t.earthRadius}, /** * Units of measurement factors based on 1 meter. * * @memberof helpers * @type {Object} */ t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133}, /** * Area of measurement factors based on 1 square meter. * * @memberof helpers * @type {Object} */ t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},t.feature=r,t.geometry= /** * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates. * For GeometryCollection type use `helpers.geometryCollection` * * @name geometry * @param {string} type Geometry Type * @param {Array} coordinates Coordinates * @param {Object} [options={}] Optional Parameters * @returns {Geometry} a GeoJSON Geometry * @example * var type = "Point"; * var coordinates = [110, 50]; * var geometry = turf.geometry(type, coordinates); * // => geometry */ function(e,t,r){switch(void 0===r&&(r={}),e){case"Point":return n(t).geometry;case"LineString":return i(t).geometry;case"Polygon":return a(t).geometry;case"MultiPoint":return u(t).geometry;case"MultiLineString":return s(t).geometry;case"MultiPolygon":return l(t).geometry;default:throw new Error(e+" is invalid")}},t.point=n,t.points= /** * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates. * * @name points * @param {Array>} coordinates an array of Points * @param {Object} [properties={}] Translate these properties to each Feature * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] * associated with the FeatureCollection * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Point Feature * @example * var points = turf.points([ * [-75, 39], * [-80, 45], * [-78, 50] * ]); * * //=points */ function(e,t,r){return void 0===r&&(r={}),o(e.map((function(e){return n(e,t)})),r)},t.polygon=a,t.polygons= /** * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates. * * @name polygons * @param {Array>>>} coordinates an array of Polygon coordinates * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Polygon FeatureCollection * @example * var polygons = turf.polygons([ * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]], * ]); * * //=polygons */ function(e,t,r){return void 0===r&&(r={}),o(e.map((function(e){return a(e,t)})),r)},t.lineString=i,t.lineStrings= /** * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates. * * @name lineStrings * @param {Array>>} coordinates an array of LinearRings * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] * associated with the FeatureCollection * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} LineString FeatureCollection * @example * var linestrings = turf.lineStrings([ * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]], * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]] * ]); * * //=linestrings */ function(e,t,r){return void 0===r&&(r={}),o(e.map((function(e){return i(e,t)})),r)},t.featureCollection=o,t.multiLineString=s,t.multiPoint=u,t.multiPolygon=l,t.geometryCollection= /** * Creates a {@link Feature} based on a * coordinate array. Properties can be added optionally. * * @name geometryCollection * @param {Array} geometries an array of GeoJSON Geometries * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON GeometryCollection Feature * @example * var pt = turf.geometry("Point", [100, 0]); * var line = turf.geometry("LineString", [[101, 0], [102, 1]]); * var collection = turf.geometryCollection([pt, line]); * * // => collection */ function(e,t,n){return void 0===n&&(n={}),r({type:"GeometryCollection",geometries:e},t,n)},t.round= /** * Round number to precision * * @param {number} num Number * @param {number} [precision=0] Precision * @returns {number} rounded number * @example * turf.round(120.4321) * //=120 * * turf.round(120.4321, 2) * //=120.43 */ function(e,t){if(void 0===t&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},t.radiansToLength=c,t.lengthToRadians=d,t.lengthToDegrees= /** * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet * * @name lengthToDegrees * @param {number} distance in real units * @param {string} [units="kilometers"] can be degrees, radians, miles, inches, yards, metres, * meters, kilometres, kilometers. * @returns {number} degrees */ function(e,t){return f(d(e,t))},t.bearingToAzimuth= /** * Converts any bearing angle from the north line direction (positive clockwise) * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line * * @name bearingToAzimuth * @param {number} bearing angle, between -180 and +180 degrees * @returns {number} angle between 0 and 360 degrees */ function(e){var t=e%360;return t<0&&(t+=360),t},t.radiansToDegrees=f,t.degreesToRadians= /** * Converts an angle in degrees to radians * * @name degreesToRadians * @param {number} degrees angle between 0 and 360 degrees * @returns {number} angle in radians */ function(e){return e%360*Math.PI/180},t.convertLength= /** * Converts a length to the requested unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @param {number} length to be converted * @param {Units} [originalUnit="kilometers"] of the length * @param {Units} [finalUnit="kilometers"] returned unit * @returns {number} the converted length */ function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return c(d(e,t),r)},t.convertArea= /** * Converts a area to the requested unit. * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares * @param {number} area to be converted * @param {Units} [originalUnit="meters"] of the distance * @param {Units} [finalUnit="kilometers"] returned unit * @returns {number} the converted area */ function(e,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=t.areaFactors[r];if(!a)throw new Error("invalid original units");var i=t.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},t.isNumber=h,t.isObject= /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */ function(e){return!!e&&e.constructor===Object},t.validateBBox= /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */ function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!h(e))throw new Error("bbox must only contain numbers")}))},t.validateId= /** * Validate Id * * @private * @param {string|number} id Id to validate * @returns {void} * @throws Error if Id is not valid * @example * validateId([-180, -40, 110, 50]) * //=Error * validateId([-180, -40]) * //=Error * validateId('Foo') * //=OK * validateId(5) * //=OK * validateId(null) * //=Error * validateId(undefined) * //=Error */ function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}, /***/1540: /***/function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4102); /** * Callback for coordEach * * @callback coordEachCallback * @param {Array} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Iterate over coordinates in any GeoJSON object, similar to Array.forEach() * * @name coordEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * }); */function a(e,t,r){ // Handles null Geometry -- Skips this GeoJSON if(null!==e) // This logic may look a little weird. The reason why it is that way // is because it's trying to be fast. GeoJSON supports multiple kinds // of objects at its root: FeatureCollection, Features, Geometries. // This function has the responsibility of handling all of them, and that // means that some of the `for` loops you see below actually just don't apply // to certain inputs. For instance, if you give this just a // Point geometry, then both loops are short-circuited and all we do // is gradually rename the input until it's called 'geometry'. // This also aims to allocate as few resources as possible: just a // few numbers and booleans, rather than any temporary arrays as would // be required with the normalization approach. for(var n,i,o,s,u,l,c,d,f=0,h=0,p=e.type,y="FeatureCollection"===p,m="Feature"===p,v=y?e.features.length:1,g=0;g} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * Starts at index 0, if an initialValue is provided, and at index 1 otherwise. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Reduce coordinates in any GeoJSON object, similar to Array.reduce() * * @name coordReduce * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {*} The value that results from the reduction. * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=previousValue * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * return currentCoord; * }); */ /** * Callback for propEach * * @callback propEachCallback * @param {Object} currentProperties The current Properties being processed. * @param {number} featureIndex The current index of the Feature being processed. */ /** * Iterate over properties in any GeoJSON object, similar to Array.forEach() * * @name propEach * @param {FeatureCollection|Feature} geojson any GeoJSON object * @param {Function} callback a method that takes (currentProperties, featureIndex) * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.point([36, 53], {hello: 'world'}) * ]); * * turf.propEach(features, function (currentProperties, featureIndex) { * //=currentProperties * //=featureIndex * }); */ function i(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r} currentFeature The current Feature being processed. * @param {number} featureIndex The current index of the Feature being processed. */ /** * Iterate over features in any GeoJSON object, similar to * Array.forEach. * * @name featureEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentFeature, featureIndex) * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.point([36, 53], {hello: 'world'}) * ]); * * turf.featureEach(features, function (currentFeature, featureIndex) { * //=currentFeature * //=featureIndex * }); */ function o(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var r=0;r} featureBBox The current Feature BBox being processed. * @param {number|string} featureId The current Feature Id being processed. */ /** * Iterate over each geometry in any GeoJSON object, similar to Array.forEach() * * @name geomEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.point([36, 53], {hello: 'world'}) * ]); * * turf.geomEach(features, function (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) { * //=currentGeometry * //=featureIndex * //=featureProperties * //=featureBBox * //=featureId * }); */ function s(e,t){var r,n,a,i,o,s,u,l,c,d,f=0,h="FeatureCollection"===e.type,p="Feature"===e.type,y=h?e.features.length:1; // This logic may look a little weird. The reason why it is that way // is because it's trying to be fast. GeoJSON supports multiple kinds // of objects at its root: FeatureCollection, Features, Geometries. // This function has the responsibility of handling all of them, and that // means that some of the `for` loops you see below actually just don't apply // to certain inputs. For instance, if you give this just a // Point geometry, then both loops are short-circuited and all we do // is gradually rename the input until it's called 'geometry'. // This also aims to allocate as few resources as possible: just a // few numbers and booleans, rather than any temporary arrays as would // be required with the normalization approach. for(r=0;r} featureBBox The current Feature BBox being processed. * @param {number|string} featureId The current Feature Id being processed. */ /** * Reduce geometry in any GeoJSON object, similar to Array.reduce(). * * @name geomReduce * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @returns {*} The value that results from the reduction. * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.point([36, 53], {hello: 'world'}) * ]); * * turf.geomReduce(features, function (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) { * //=previousValue * //=currentGeometry * //=featureIndex * //=featureProperties * //=featureBBox * //=featureId * return currentGeometry * }); */ /** * Callback for flattenEach * * @callback flattenEachCallback * @param {Feature} currentFeature The current flattened feature being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. */ /** * Iterate over flattened features in any GeoJSON object, similar to * Array.forEach. * * @name flattenEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentFeature, featureIndex, multiFeatureIndex) * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'}) * ]); * * turf.flattenEach(features, function (currentFeature, featureIndex, multiFeatureIndex) { * //=currentFeature * //=featureIndex * //=multiFeatureIndex * }); */ function u(e,t){s(e,(function(e,r,a,i,o){ // Callback for single geometry var s,u=null===e?null:e.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==t(n.feature(e,a,{bbox:i,id:o}),r,0)&&void 0} // Callback for multi-geometry switch(u){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l} currentSegment The current Segment being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. * @param {number} segmentIndex The current index of the Segment being processed. * @returns {void} */ /** * Iterate over 2-vertex line segment in any GeoJSON object, similar to Array.forEach() * (Multi)Point geometries do not contain segments therefore they are ignored during this operation. * * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON * @param {Function} callback a method that takes (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) * @returns {void} * @example * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]); * * // Iterate over GeoJSON by 2-vertex segments * turf.segmentEach(polygon, function (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) { * //=currentSegment * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * //=segmentIndex * }); * * // Calculate the total number of segments * var total = 0; * turf.segmentEach(polygon, function () { * total++; * }); */ function l(e,t){u(e,(function(e,r,i){var o=0; // Exclude null Geometries if(e.geometry){ // (Multi)Point geometries do not contain segments therefore they are ignored during this operation. var s=e.geometry.type;if("Point"!==s&&"MultiPoint"!==s){ // Generate 2-vertex line segments var u,l=0,c=0,d=0;return!1!==a(e,(function(a,s,f,h,p){ // Simulating a meta.coordReduce() since `reduce` operations cannot be stopped by returning `false` if(void 0===u||r>l||h>c||p>d)return u=a,l=r,c=h,d=p,void(o=0);var y=n.lineString([u,a],e.properties);if(!1===t(y,r,i,p,o))return!1;o++,u=a}))&&void 0}}}))} /** * Callback for segmentReduce * * The first time the callback function is called, the values provided as arguments depend * on whether the reduce method has an initialValue argument. * * If an initialValue is provided to the reduce method: * - The previousValue argument is initialValue. * - The currentValue argument is the value of the first element present in the array. * * If an initialValue is not provided: * - The previousValue argument is the value of the first element present in the array. * - The currentValue argument is the value of the second element present in the array. * * @callback segmentReduceCallback * @param {*} previousValue The accumulated value previously returned in the last invocation * of the callback, or initialValue, if supplied. * @param {Feature} currentSegment The current Segment being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. * @param {number} segmentIndex The current index of the Segment being processed. */ /** * Reduce 2-vertex line segment in any GeoJSON object, similar to Array.reduce() * (Multi)Point geometries do not contain segments therefore they are ignored during this operation. * * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON * @param {Function} callback a method that takes (previousValue, currentSegment, currentIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @returns {void} * @example * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]); * * // Iterate over GeoJSON by 2-vertex segments * turf.segmentReduce(polygon, function (previousSegment, currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) { * //= previousSegment * //= currentSegment * //= featureIndex * //= multiFeatureIndex * //= geometryIndex * //= segmentIndex * return currentSegment * }); * * // Calculate the total number of segments * var initialValue = 0 * var total = turf.segmentReduce(polygon, function (previousValue) { * previousValue++; * return previousValue; * }, initialValue); */ /** * Callback for lineEach * * @callback lineEachCallback * @param {Feature} currentLine The current LineString|LinearRing being processed * @param {number} featureIndex The current index of the Feature being processed * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed * @param {number} geometryIndex The current index of the Geometry being processed */ /** * Iterate over line or ring coordinates in LineString, Polygon, MultiLineString, MultiPolygon Features or Geometries, * similar to Array.forEach. * * @name lineEach * @param {Geometry|Feature} geojson object * @param {Function} callback a method that takes (currentLine, featureIndex, multiFeatureIndex, geometryIndex) * @example * var multiLine = turf.multiLineString([ * [[26, 37], [35, 45]], * [[36, 53], [38, 50], [41, 55]] * ]); * * turf.lineEach(multiLine, function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) { * //=currentLine * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * }); */ function c(e,t){ // validation if(!e)throw new Error("geojson is required");u(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var s=0;s} currentLine The current LineString|LinearRing being processed. * @param {number} featureIndex The current index of the Feature being processed * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed * @param {number} geometryIndex The current index of the Geometry being processed */ /** * Reduce features in any GeoJSON object, similar to Array.reduce(). * * @name lineReduce * @param {Geometry|Feature} geojson object * @param {Function} callback a method that takes (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @returns {*} The value that results from the reduction. * @example * var multiPoly = turf.multiPolygon([ * turf.polygon([[[12,48],[2,41],[24,38],[12,48]], [[9,44],[13,41],[13,45],[9,44]]]), * turf.polygon([[[5, 5], [0, 0], [2, 2], [4, 4], [5, 5]]]) * ]); * * turf.lineReduce(multiPoly, function (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) { * //=previousValue * //=currentLine * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * return currentLine * }); */t.coordAll= /** * Get all coordinates from any GeoJSON object. * * @name coordAll * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @returns {Array>} coordinate position array * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.point([36, 53], {hello: 'world'}) * ]); * * var coords = turf.coordAll(features); * //= [[26, 37], [36, 53]] */ function(e){var t=[];return a(e,(function(e){t.push(e)})),t},t.coordEach=a,t.coordReduce=function(e,t,r,n){var i=r;return a(e,(function(e,n,a,o,s){i=0===n&&void 0===r?e:t(i,e,n,a,o,s)}),n),i},t.featureEach=o,t.featureReduce=function(e,t,r){var n=r;return o(e,(function(e,a){n=0===a&&void 0===r?e:t(n,e,a)})),n},t.findPoint= /** * Finds a particular Point from a GeoJSON using `@turf/meta` indexes. * * Negative indexes are permitted. * * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry * @param {Object} [options={}] Optional parameters * @param {number} [options.featureIndex=0] Feature Index * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index * @param {number} [options.geometryIndex=0] Geometry Index * @param {number} [options.coordIndex=0] Coord Index * @param {Object} [options.properties={}] Translate Properties to output Point * @param {BBox} [options.bbox={}] Translate BBox to output Point * @param {number|string} [options.id={}] Translate Id to output Point * @returns {Feature} 2-vertex GeoJSON Feature Point * @example * var multiLine = turf.multiLineString([ * [[10, 10], [50, 30], [30, 40]], * [[-10, -10], [-50, -30], [-30, -40]] * ]); * * // First Segment (defaults are 0) * turf.findPoint(multiLine); * // => Feature> * * // First Segment of the 2nd Multi-Feature * turf.findPoint(multiLine, {multiFeatureIndex: 1}); * // => Feature> * * // Last Segment of last Multi-Feature * turf.findPoint(multiLine, {multiFeatureIndex: -1, coordIndex: -1}); * // => Feature> */ function(e,t){if( // Optional Parameters t=t||{},!n.isObject(t))throw new Error("options is invalid");var r,a=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.coordIndex||0,u=t.properties;switch(e.type){case"FeatureCollection":a<0&&(a=e.features.length+a),u=u||e.features[a].properties,r=e.features[a].geometry;break;case"Feature":u=u||e.properties,r=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=e;break;default:throw new Error("geojson is invalid")} // Find Coord Index if(null===r)return null;var l=r.coordinates;switch(r.type){case"Point":return n.point(l,u,t);case"MultiPoint":return i<0&&(i=l.length+i),n.point(l[i],u,t);case"LineString":return s<0&&(s=l.length+s),n.point(l[s],u,t);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),n.point(l[o][s],u,t);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s),n.point(l[i][s],u,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s),n.point(l[i][o][s],u,t)}throw new Error("geojson is invalid")},t.findSegment= /** * Finds a particular 2-vertex LineString Segment from a GeoJSON using `@turf/meta` indexes. * * Negative indexes are permitted. * Point & MultiPoint will always return null. * * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry * @param {Object} [options={}] Optional parameters * @param {number} [options.featureIndex=0] Feature Index * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index * @param {number} [options.geometryIndex=0] Geometry Index * @param {number} [options.segmentIndex=0] Segment Index * @param {Object} [options.properties={}] Translate Properties to output LineString * @param {BBox} [options.bbox={}] Translate BBox to output LineString * @param {number|string} [options.id={}] Translate Id to output LineString * @returns {Feature} 2-vertex GeoJSON Feature LineString * @example * var multiLine = turf.multiLineString([ * [[10, 10], [50, 30], [30, 40]], * [[-10, -10], [-50, -30], [-30, -40]] * ]); * * // First Segment (defaults are 0) * turf.findSegment(multiLine); * // => Feature> * * // First Segment of 2nd Multi Feature * turf.findSegment(multiLine, {multiFeatureIndex: 1}); * // => Feature> * * // Last Segment of Last Multi Feature * turf.findSegment(multiLine, {multiFeatureIndex: -1, segmentIndex: -1}); * // => Feature> */ function(e,t){if( // Optional Parameters t=t||{},!n.isObject(t))throw new Error("options is invalid");var r,a=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,s=t.segmentIndex||0,u=t.properties;switch(e.type){case"FeatureCollection":a<0&&(a=e.features.length+a),u=u||e.features[a].properties,r=e.features[a].geometry;break;case"Feature":u=u||e.properties,r=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=e;break;default:throw new Error("geojson is invalid")} // Find SegmentIndex if(null===r)return null;var l=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),n.lineString([l[s],l[s+1]],u,t);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),n.lineString([l[o][s],l[o][s+1]],u,t);case"MultiLineString":return i<0&&(i=l.length+i),s<0&&(s=l[i].length+s-1),n.lineString([l[i][s],l[i][s+1]],u,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),s<0&&(s=l[i][o].length-s-1),n.lineString([l[i][o][s],l[i][o][s+1]],u,t)}throw new Error("geojson is invalid")},t.flattenEach=u,t.flattenReduce=function(e,t,r){var n=r;return u(e,(function(e,a,i){n=0===a&&0===i&&void 0===r?e:t(n,e,a,i)})),n},t.geomEach=s,t.geomReduce=function(e,t,r){var n=r;return s(e,(function(e,a,i,o,s){n=0===a&&void 0===r?e:t(n,e,a,i,o,s)})),n},t.lineEach=c,t.lineReduce=function(e,t,r){var n=r;return c(e,(function(e,a,i,o){n=0===a&&void 0===r?e:t(n,e,a,i,o)})),n},t.propEach=i,t.propReduce=function(e,t,r){var n=r;return i(e,(function(e,a){n=0===a&&void 0===r?e:t(n,e,a)})),n},t.segmentEach=l,t.segmentReduce=function(e,t,r){var n=r,a=!1;return l(e,(function(e,i,o,s,u){n=!1===a&&void 0===r?e:t(n,e,i,o,s,u),a=!0})),n}}, /***/5748: /***/function(e,t,r){"use strict"; // ESM COMPAT FLAG /** * Clone Feature * * @private * @param {Feature} geojson GeoJSON Feature * @returns {Feature} cloned Feature */ function n(e){var t={type:"Feature"}; // Preserve Foreign Members return Object.keys(e).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:t[r]=e[r]}})), // Add properties & geometry last t.properties=a(e.properties),t.geometry=i(e.geometry),t} /** * Clone Properties * * @private * @param {Object} properties GeoJSON Properties * @returns {Object} cloned Properties */function a(e){var t={};return e?(Object.keys(e).forEach((function(r){var n=e[r];"object"===typeof n?null===n? // handle null t[r]=null:n.length? // handle Array t[r]=n.map((function(e){return e})): // handle generic Object t[r]=a(n):t[r]=n})),t):t} /** * Clone Feature Collection * * @private * @param {FeatureCollection} geojson GeoJSON Feature Collection * @returns {FeatureCollection} cloned Feature Collection */ /** * Clone Geometry * * @private * @param {Geometry} geometry GeoJSON Geometry * @returns {Geometry} cloned Geometry */ function i(e){var t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map((function(e){return i(e)})),t):(t.coordinates=o(e.coordinates),t)} /** * Deep Slice coordinates * * @private * @param {Coordinates} coords Coordinates * @returns {Coordinates} all coordinates sliced */function o(e){return"object"!==typeof e[0]?e.slice():e.map((function(e){return o(e)}))} /* harmony default export */r.r(t), // EXPORTS r.d(t,{default:function(){/* binding */return ie}});var s=// CONCATENATED MODULE: ./node_modules/@turf/clone/main.es.js /** * Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'. * ~3-5x faster than the common JSON.parse + JSON.stringify combo method. * * @name clone * @param {GeoJSON} geojson GeoJSON Object * @returns {GeoJSON} cloned GeoJSON Object * @example * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]], {color: 'red'}); * * var lineCloned = turf.clone(line); */ function(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return n(e);case"FeatureCollection":return function(e){var t={type:"FeatureCollection"}; // Preserve Foreign Members return Object.keys(e).forEach((function(r){switch(r){case"type":case"features":return;default:t[r]=e[r]}})), // Add features t.features=e.features.map((function(e){return n(e)})),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return i(e);default:throw new Error("unknown GeoJSON type")}}; /** * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}. * * @name feature * @param {Geometry} geometry input geometry * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON Feature * @example * var geometry = { * "type": "Point", * "coordinates": [110, 50] * }; * * var feature = turf.feature(geometry); * * //=feature */ function u(e,t,r){if(!d( // Optional Parameters r=r||{}))throw new Error("options is invalid");var n=r.bbox,a=r.id; // Validation if(void 0===e)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");n&&f(n),a&&h(a); // Main var i={type:"Feature"};return a&&(i.id=a),n&&(i.bbox=n),i.properties=t||{},i.geometry=e,i} /** * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates. * For GeometryCollection type use `helpers.geometryCollection` * * @name geometry * @param {string} type Geometry Type * @param {Array} coordinates Coordinates * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Geometry * @returns {Geometry} a GeoJSON Geometry * @example * var type = 'Point'; * var coordinates = [110, 50]; * * var geometry = turf.geometry(type, coordinates); * * //=geometry */ /** * Creates a {@link Point} {@link Feature} from a Position. * * @name point * @param {Array} coordinates longitude, latitude position (each in decimal degrees) * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a Point feature * @example * var point = turf.point([-75.343, 39.984]); * * //=point */ function l(e,t,r){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!c(e[0])||!c(e[1]))throw new Error("coordinates must contain numbers");return u({type:"Point",coordinates:e},t,r)} /** * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates. * * @name points * @param {Array>} coordinates an array of Points * @param {Object} [properties={}] Translate these properties to each Feature * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the FeatureCollection * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Point Feature * @example * var points = turf.points([ * [-75, 39], * [-80, 45], * [-78, 50] * ]); * * //=points */ /** * isNumber * * @param {*} num Number to validate * @returns {boolean} true/false * @example * turf.isNumber(123) * //=true * turf.isNumber('foo') * //=false */ function c(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)} /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */function d(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */function f(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!c(e))throw new Error("bbox must only contain numbers")}))} /** * Validate Id * * @private * @param {string|number} id Id to validate * @returns {void} * @throws Error if Id is not valid * @example * validateId([-180, -40, 110, 50]) * //=Error * validateId([-180, -40]) * //=Error * validateId('Foo') * //=OK * validateId(5) * //=OK * validateId(null) * //=Error * validateId(undefined) * //=Error */function h(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")} // Deprecated methods // CONCATENATED MODULE: ./node_modules/@turf/center/node_modules/@turf/meta/main.es.js /** * Callback for coordEach * * @callback coordEachCallback * @param {Array} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Iterate over coordinates in any GeoJSON object, similar to Array.forEach() * * @name coordEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * }); */ function p(e,t,r){ // Handles null Geometry -- Skips this GeoJSON if(null!==e) // This logic may look a little weird. The reason why it is that way // is because it's trying to be fast. GeoJSON supports multiple kinds // of objects at its root: FeatureCollection, Features, Geometries. // This function has the responsibility of handling all of them, and that // means that some of the `for` loops you see below actually just don't apply // to certain inputs. For instance, if you give this just a // Point geometry, then both loops are short-circuited and all we do // is gradually rename the input until it's called 'geometry'. // This also aims to allocate as few resources as possible: just a // few numbers and booleans, rather than any temporary arrays as would // be required with the normalization approach. for(var n,a,i,o,s,u,l,c,d=0,f=0,h=e.type,y="FeatureCollection"===h,m="Feature"===h,v=y?e.features.length:1,g=0;g} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * Starts at index 0, if an initialValue is provided, and at index 1 otherwise. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Reduce coordinates in any GeoJSON object, similar to Array.reduce() * * @name coordReduce * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {*} The value that results from the reduction. * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=previousValue * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * return currentCoord; * }); */ /* harmony default export */var y=// CONCATENATED MODULE: ./node_modules/@turf/center/node_modules/@turf/bbox/main.es.js /** * Takes a set of features, calculates the bbox of all input features, and returns a bounding box. * * @name bbox * @param {GeoJSON} geojson any GeoJSON object * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order * @example * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]); * var bbox = turf.bbox(line); * var bboxPolygon = turf.bboxPolygon(bbox); * * //addToMap * var addToMap = [line, bboxPolygon] */ function(e){var t=[1/0,1/0,-1/0,-1/0];return p(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]} a Point feature at the absolute center point of all input features * @example * var features = turf.featureCollection([ * turf.point( [-97.522259, 35.4691]), * turf.point( [-97.502754, 35.463455]), * turf.point( [-97.508269, 35.463245]) * ]); * * var center = turf.center(features); * * //addToMap * var addToMap = [features, center] * center.properties['marker-size'] = 'large'; * center.properties['marker-color'] = '#000'; */ function(e,t){if(!d( // Optional parameters t=t||{}))throw new Error("options is invalid");var r=t.properties; // Input validation if(!e)throw new Error("geojson is required");var n=y(e);return l([(n[0]+n[2])/2,(n[1]+n[3])/2],r)}; /** * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}. * * @name feature * @param {Geometry} geometry input geometry * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON Feature * @example * var geometry = { * "type": "Point", * "coordinates": [110, 50] * }; * * var feature = turf.feature(geometry); * * //=feature */ function v(e,t,r){if(!w( // Optional Parameters r=r||{}))throw new Error("options is invalid");var n=r.bbox,a=r.id; // Validation if(void 0===e)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");n&&S(n),a&&L(a); // Main var i={type:"Feature"};return a&&(i.id=a),n&&(i.bbox=n),i.properties=t||{},i.geometry=e,i} /** * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates. * For GeometryCollection type use `helpers.geometryCollection` * * @name geometry * @param {string} type Geometry Type * @param {Array} coordinates Coordinates * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Geometry * @returns {Geometry} a GeoJSON Geometry * @example * var type = 'Point'; * var coordinates = [110, 50]; * * var geometry = turf.geometry(type, coordinates); * * //=geometry */ /** * Creates a {@link Point} {@link Feature} from a Position. * * @name point * @param {Array} coordinates longitude, latitude position (each in decimal degrees) * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a Point feature * @example * var point = turf.point([-75.343, 39.984]); * * //=point */ function g(e,t,r){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(e[0])||!b(e[1]))throw new Error("coordinates must contain numbers");return v({type:"Point",coordinates:e},t,r)} /** * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates. * * @name points * @param {Array>} coordinates an array of Points * @param {Object} [properties={}] Translate these properties to each Feature * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the FeatureCollection * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Point Feature * @example * var points = turf.points([ * [-75, 39], * [-80, 45], * [-78, 50] * ]); * * //=points */ /** * isNumber * * @param {*} num Number to validate * @returns {boolean} true/false * @example * turf.isNumber(123) * //=true * turf.isNumber('foo') * //=false */ function b(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)} /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */function w(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */function S(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!b(e))throw new Error("bbox must only contain numbers")}))} /** * Validate Id * * @private * @param {string|number} id Id to validate * @returns {void} * @throws Error if Id is not valid * @example * validateId([-180, -40, 110, 50]) * //=Error * validateId([-180, -40]) * //=Error * validateId('Foo') * //=OK * validateId(5) * //=OK * validateId(null) * //=Error * validateId(undefined) * //=Error */function L(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")} // Deprecated methods // CONCATENATED MODULE: ./node_modules/@turf/centroid/node_modules/@turf/meta/main.es.js /** * Callback for coordEach * * @callback coordEachCallback * @param {Array} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Iterate over coordinates in any GeoJSON object, similar to Array.forEach() * * @name coordEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * }); */ function E(e,t,r){ // Handles null Geometry -- Skips this GeoJSON if(null!==e) // This logic may look a little weird. The reason why it is that way // is because it's trying to be fast. GeoJSON supports multiple kinds // of objects at its root: FeatureCollection, Features, Geometries. // This function has the responsibility of handling all of them, and that // means that some of the `for` loops you see below actually just don't apply // to certain inputs. For instance, if you give this just a // Point geometry, then both loops are short-circuited and all we do // is gradually rename the input until it's called 'geometry'. // This also aims to allocate as few resources as possible: just a // few numbers and booleans, rather than any temporary arrays as would // be required with the normalization approach. for(var n,a,i,o,s,u,l,c,d=0,f=0,h=e.type,p="FeatureCollection"===h,y="Feature"===h,m=p?e.features.length:1,v=0;v} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * Starts at index 0, if an initialValue is provided, and at index 1 otherwise. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Reduce coordinates in any GeoJSON object, similar to Array.reduce() * * @name coordReduce * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {*} The value that results from the reduction. * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=previousValue * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * return currentCoord; * }); */ /* harmony default export */var M=// CONCATENATED MODULE: ./node_modules/@turf/centroid/main.es.js /** * Takes one or more features and calculates the centroid using the mean of all vertices. * This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons. * * @name centroid * @param {GeoJSON} geojson GeoJSON to be centered * @param {Object} [properties={}] an Object that is used as the {@link Feature}'s properties * @returns {Feature} the centroid of the input features * @example * var polygon = turf.polygon([[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]); * * var centroid = turf.centroid(polygon); * * //addToMap * var addToMap = [polygon, centroid] */ function(e,t){var r=0,n=0,a=0;return E(e,(function(e){r+=e[0],n+=e[1],a++}),!0),g([r/a,n/a],t)}; /** * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}. * * @name feature * @param {Geometry} geometry input geometry * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON Feature * @example * var geometry = { * "type": "Point", * "coordinates": [110, 50] * }; * * var feature = turf.feature(geometry); * * //=feature */ function k(e,t,r){if(!F( // Optional Parameters r=r||{}))throw new Error("options is invalid");var n=r.bbox,a=r.id; // Validation if(void 0===e)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");n&&P(n),a&&C(a); // Main var i={type:"Feature"};return a&&(i.id=a),n&&(i.bbox=n),i.properties=t||{},i.geometry=e,i} /** * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates. * For GeometryCollection type use `helpers.geometryCollection` * * @name geometry * @param {string} type Geometry Type * @param {Array} coordinates Coordinates * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Geometry * @returns {Geometry} a GeoJSON Geometry * @example * var type = 'Point'; * var coordinates = [110, 50]; * * var geometry = turf.geometry(type, coordinates); * * //=geometry */ /** * Creates a {@link Point} {@link Feature} from a Position. * * @name point * @param {Array} coordinates longitude, latitude position (each in decimal degrees) * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a Point feature * @example * var point = turf.point([-75.343, 39.984]); * * //=point */ function x(e,t,r){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!T(e[0])||!T(e[1]))throw new Error("coordinates must contain numbers");return k({type:"Point",coordinates:e},t,r)} /** * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates. * * @name points * @param {Array>} coordinates an array of Points * @param {Object} [properties={}] Translate these properties to each Feature * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the FeatureCollection * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Point Feature * @example * var points = turf.points([ * [-75, 39], * [-80, 45], * [-78, 50] * ]); * * //=points */ /** * isNumber * * @param {*} num Number to validate * @returns {boolean} true/false * @example * turf.isNumber(123) * //=true * turf.isNumber('foo') * //=false */ function T(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)} /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */function F(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */function P(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!T(e))throw new Error("bbox must only contain numbers")}))} /** * Validate Id * * @private * @param {string|number} id Id to validate * @returns {void} * @throws Error if Id is not valid * @example * validateId([-180, -40, 110, 50]) * //=Error * validateId([-180, -40]) * //=Error * validateId('Foo') * //=OK * validateId(5) * //=OK * validateId(null) * //=Error * validateId(undefined) * //=Error */function C(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")} // Deprecated methods // CONCATENATED MODULE: ./node_modules/@turf/transform-scale/node_modules/@turf/meta/main.es.js /** * Callback for coordEach * * @callback coordEachCallback * @param {Array} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Iterate over coordinates in any GeoJSON object, similar to Array.forEach() * * @name coordEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex) * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * }); */ function N(e,t,r){ // Handles null Geometry -- Skips this GeoJSON if(null!==e) // This logic may look a little weird. The reason why it is that way // is because it's trying to be fast. GeoJSON supports multiple kinds // of objects at its root: FeatureCollection, Features, Geometries. // This function has the responsibility of handling all of them, and that // means that some of the `for` loops you see below actually just don't apply // to certain inputs. For instance, if you give this just a // Point geometry, then both loops are short-circuited and all we do // is gradually rename the input until it's called 'geometry'. // This also aims to allocate as few resources as possible: just a // few numbers and booleans, rather than any temporary arrays as would // be required with the normalization approach. for(var n,a,i,o,s,u,l,c,d=0,f=0,h=e.type,p="FeatureCollection"===h,y="Feature"===h,m=p?e.features.length:1,v=0;v} currentCoord The current coordinate being processed. * @param {number} coordIndex The current index of the coordinate being processed. * Starts at index 0, if an initialValue is provided, and at index 1 otherwise. * @param {number} featureIndex The current index of the Feature being processed. * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed. * @param {number} geometryIndex The current index of the Geometry being processed. */ /** * Reduce coordinates in any GeoJSON object, similar to Array.reduce() * * @name coordReduce * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex) * @param {*} [initialValue] Value to use as the first argument to the first call of the callback. * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration. * @returns {*} The value that results from the reduction. * @example * var features = turf.featureCollection([ * turf.point([26, 37], {"foo": "bar"}), * turf.point([36, 53], {"hello": "world"}) * ]); * * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) { * //=previousValue * //=currentCoord * //=coordIndex * //=featureIndex * //=multiFeatureIndex * //=geometryIndex * return currentCoord; * }); */ /** * Callback for featureEach * * @callback featureEachCallback * @param {Feature} currentFeature The current Feature being processed. * @param {number} featureIndex The current index of the Feature being processed. */ /** * Iterate over features in any GeoJSON object, similar to * Array.forEach. * * @name featureEach * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object * @param {Function} callback a method that takes (currentFeature, featureIndex) * @returns {void} * @example * var features = turf.featureCollection([ * turf.point([26, 37], {foo: 'bar'}), * turf.point([36, 53], {hello: 'world'}) * ]); * * turf.featureEach(features, function (currentFeature, featureIndex) { * //=currentFeature * //=featureIndex * }); */ function W(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var r=0;re[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]|Geometry|Feature} coord GeoJSON Point or an Array of numbers * @returns {Array} coordinates * @example * var pt = turf.point([10, 10]); * * var coord = turf.getCoord(pt); * //= [10, 10] */ function I(e){if(!e)throw new Error("coord is required");if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates;if(Array.isArray(e)&&e.length>=2&&void 0===e[0].length&&void 0===e[1].length)return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")} /** * Unwrap coordinates from a Feature, Geometry Object or an Array * * @name getCoords * @param {Array|Geometry|Feature} coords Feature, Geometry Object or an Array * @returns {Array} coordinates * @example * var poly = turf.polygon([[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]); * * var coords = turf.getCoords(poly); * //= [[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]] */ /** * Converts an angle in radians to degrees * * @name radiansToDegrees * @param {number} radians angle in radians * @returns {number} degrees between 0 and 360 degrees */ function O(e){if(null===e||void 0===e)throw new Error("radians is required");return 180*(e%(2*Math.PI))/Math.PI} /** * Converts an angle in degrees to radians * * @name degreesToRadians * @param {number} degrees angle between 0 and 360 degrees * @returns {number} angle in radians */function D(e){if(null===e||void 0===e)throw new Error("degrees is required");return e%360*Math.PI/180} /** * Converts a length to the requested unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @param {number} length to be converted * @param {string} originalUnit of the length * @param {string} [finalUnit='kilometers'] returned unit * @returns {number} the converted length */ /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */ function R(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */ /** * Returns the bearing from ‘this’ point to destination point along a rhumb line. * Adapted from Geodesy: https://github.com/chrisveness/geodesy/blob/master/latlon-spherical.js * * @private * @param {Array} from - origin point. * @param {Array} to - destination point. * @returns {number} Bearing in degrees from north. * @example * var p1 = new LatLon(51.127, 1.338); * var p2 = new LatLon(50.964, 1.853); * var d = p1.rhumbBearingTo(p2); // 116.7 m */ function V(e,t){ // φ => phi // Δλ => deltaLambda // Δψ => deltaPsi // θ => theta var r=D(e[1]),n=D(t[1]),a=D(t[0]-e[0]); // if deltaLambdaon over 180° take shorter rhumb line across the anti-meridian: a>Math.PI&&(a-=2*Math.PI),a<-Math.PI&&(a+=2*Math.PI);var i=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(r/2+Math.PI/4));return(O(Math.atan2(a,i))+360)%360} /* harmony default export */var U=// CONCATENATED MODULE: ./node_modules/@turf/rhumb-bearing/main.es.js // https://en.wikipedia.org/wiki/Rhumb_line /** * Takes two {@link Point|points} and finds the bearing angle between them along a Rhumb line * i.e. the angle measured in degrees start the north line (0 degrees) * * @name rhumbBearing * @param {Coord} start starting Point * @param {Coord} end ending Point * @param {Object} [options] Optional parameters * @param {boolean} [options.final=false] calculates the final bearing if true * @returns {number} bearing from north in decimal degrees, between -180 and 180 degrees (positive clockwise) * @example * var point1 = turf.point([-75.343, 39.984], {"marker-color": "#F00"}); * var point2 = turf.point([-75.534, 39.123], {"marker-color": "#00F"}); * * var bearing = turf.rhumbBearing(point1, point2); * * //addToMap * var addToMap = [point1, point2]; * point1.properties.bearing = bearing; * point2.properties.bearing = bearing; */ function(e,t,r){if(!R( // Optional parameters r=r||{}))throw new Error("options is invalid");var n,a=r.final; // validation if(!e)throw new Error("start point is required");if(!t)throw new Error("end point is required");return(n=a?V(I(t),I(e)):V(I(e),I(t)))>180?-(360-n):n},A=6371008.8,q={meters:A,metres:A,millimeters:1e3*A,millimetres:1e3*A,centimeters:100*A,centimetres:100*A,kilometers:A/1e3,kilometres:A/1e3,miles:A/1609.344,nauticalmiles:A/1852,inches:39.37*A,yards:A/1.0936,feet:3.28084*A,radians:1,degrees:A/111325}; /** * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @name lengthToRadians * @param {number} distance in real units * @param {string} [units='kilometers'] can be degrees, radians, miles, or kilometers inches, yards, metres, meters, kilometres, kilometers. * @returns {number} radians */ function K(e,t){if(void 0===e||null===e)throw new Error("distance is required");if(t&&"string"!==typeof t)throw new Error("units must be a string");var r=q[t||"kilometers"];if(!r)throw new Error(t+" units is invalid");return e/r} /** * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet * * @name lengthToDegrees * @param {number} distance in real units * @param {string} [units='kilometers'] can be degrees, radians, miles, or kilometers inches, yards, metres, meters, kilometres, kilometers. * @returns {number} degrees */ /** * Converts a length to the requested unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @param {number} length to be converted * @param {string} originalUnit of the length * @param {string} [finalUnit='kilometers'] returned unit * @returns {number} the converted length */ function X(e,t,r){if(null===e||void 0===e)throw new Error("length is required");if(!(e>=0))throw new Error("length must be a positive number"); /** * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @name radiansToLength * @param {number} radians in radians across the sphere * @param {string} [units='kilometers'] can be degrees, radians, miles, or kilometers inches, yards, metres, meters, kilometres, kilometers. * @returns {number} distance */ return function(e,t){if(void 0===e||null===e)throw new Error("radians is required");if(t&&"string"!==typeof t)throw new Error("units must be a string");var r=q[t||"kilometers"];if(!r)throw new Error(t+" units is invalid");return e*r}(K(e,t),r||"kilometers")} /** * Converts a area to the requested unit. * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches * @param {number} area to be converted * @param {string} [originalUnit='meters'] of the distance * @param {string} [finalUnit='kilometers'] returned unit * @returns {number} the converted distance */ /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */ function Z(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */ /* harmony default export */var z=// CONCATENATED MODULE: ./node_modules/@turf/rhumb-distance/main.es.js // https://en.wikipedia.org/wiki/Rhumb_line /** * Calculates the distance along a rhumb line between two {@link Point|points} in degrees, radians, * miles, or kilometers. * * @name rhumbDistance * @param {Coord} from origin point * @param {Coord} to destination point * @param {Object} [options] Optional parameters * @param {string} [options.units="kilometers"] can be degrees, radians, miles, or kilometers * @returns {number} distance between the two points * @example * var from = turf.point([-75.343, 39.984]); * var to = turf.point([-75.534, 39.123]); * var options = {units: 'miles'}; * * var distance = turf.rhumbDistance(from, to, options); * * //addToMap * var addToMap = [from, to]; * from.properties.distance = distance; * to.properties.distance = distance; */ function(e,t,r){if(!Z( // Optional parameters r=r||{}))throw new Error("options is invalid");var n=r.units; // validation if(!e)throw new Error("from point is required");if(!t)throw new Error("to point is required");var a=I(e),i=I(t); // compensate the crossing of the 180th meridian (https://macwright.org/2016/09/26/the-180th-meridian.html) // solution from https://github.com/mapbox/mapbox-gl-js/issues/3250#issuecomment-294887678 return i[0]+=i[0]-a[0]>180?-360:a[0]-i[0]>180?360:0,X( /** * Returns the distance travelling from ‘this’ point to destination point along a rhumb line. * Adapted from Geodesy: https://github.com/chrisveness/geodesy/blob/master/latlon-spherical.js * * @private * @param {Array} origin point. * @param {Array} destination point. * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres). * @returns {number} Distance in km between this point and destination point (same units as radius). * * @example * var p1 = new LatLon(51.127, 1.338); * var p2 = new LatLon(50.964, 1.853); * var d = p1.distanceTo(p2); // 40.31 km */ function(e,t,r){ // see www.edwilliams.org/avform.htm#Rhumb var n= // φ => phi // λ => lambda // ψ => psi // Δ => Delta // δ => delta // θ => theta r=void 0===r?A:Number(r),a=e[1]*Math.PI/180,i=t[1]*Math.PI/180,o=i-a,s=Math.abs(t[0]-e[0])*Math.PI/180; // if dLon over 180° take shorter rhumb line across the anti-meridian: s>Math.PI&&(s-=2*Math.PI); // on Mercator projection, longitude distances shrink by latitude; q is the 'stretch factor' // q becomes ill-conditioned along E-W line (0/0); use empirical tolerance to avoid it var u=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(a);return Math.sqrt(o*o+l*l*s*s)*n}(a,i),"meters",n)},Y=6371008.8,B={meters:Y,metres:Y,millimeters:1e3*Y,millimetres:1e3*Y,centimeters:100*Y,centimetres:100*Y,kilometers:Y/1e3,kilometres:Y/1e3,miles:Y/1609.344,nauticalmiles:Y/1852,inches:39.37*Y,yards:Y/1.0936,feet:3.28084*Y,radians:1,degrees:Y/111325}; /** * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}. * * @name feature * @param {Geometry} geometry input geometry * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a GeoJSON Feature * @example * var geometry = { * "type": "Point", * "coordinates": [110, 50] * }; * * var feature = turf.feature(geometry); * * //=feature */ function G(e,t,r){if(!ee( // Optional Parameters r=r||{}))throw new Error("options is invalid");var n=r.bbox,a=r.id; // Validation if(void 0===e)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");n&&te(n),a&&re(a); // Main var i={type:"Feature"};return a&&(i.id=a),n&&(i.bbox=n),i.properties=t||{},i.geometry=e,i} /** * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates. * For GeometryCollection type use `helpers.geometryCollection` * * @name geometry * @param {string} type Geometry Type * @param {Array} coordinates Coordinates * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Geometry * @returns {Geometry} a GeoJSON Geometry * @example * var type = 'Point'; * var coordinates = [110, 50]; * * var geometry = turf.geometry(type, coordinates); * * //=geometry */ /** * Creates a {@link Point} {@link Feature} from a Position. * * @name point * @param {Array} coordinates longitude, latitude position (each in decimal degrees) * @param {Object} [properties={}] an Object of key-value pairs to add as properties * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature * @param {string|number} [options.id] Identifier associated with the Feature * @returns {Feature} a Point feature * @example * var point = turf.point([-75.343, 39.984]); * * //=point */ function J(e,t,r){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!$(e[0])||!$(e[1]))throw new Error("coordinates must contain numbers");return G({type:"Point",coordinates:e},t,r)} /** * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates. * * @name points * @param {Array>} coordinates an array of Points * @param {Object} [properties={}] Translate these properties to each Feature * @param {Object} [options={}] Optional Parameters * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the FeatureCollection * @param {string|number} [options.id] Identifier associated with the FeatureCollection * @returns {FeatureCollection} Point Feature * @example * var points = turf.points([ * [-75, 39], * [-80, 45], * [-78, 50] * ]); * * //=points */ /** * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @name lengthToRadians * @param {number} distance in real units * @param {string} [units='kilometers'] can be degrees, radians, miles, or kilometers inches, yards, metres, meters, kilometres, kilometers. * @returns {number} radians */ function H(e,t){if(void 0===e||null===e)throw new Error("distance is required");if(t&&"string"!==typeof t)throw new Error("units must be a string");var r=B[t||"kilometers"];if(!r)throw new Error(t+" units is invalid");return e/r} /** * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet * * @name lengthToDegrees * @param {number} distance in real units * @param {string} [units='kilometers'] can be degrees, radians, miles, or kilometers inches, yards, metres, meters, kilometres, kilometers. * @returns {number} degrees */ /** * Converts an angle in degrees to radians * * @name degreesToRadians * @param {number} degrees angle between 0 and 360 degrees * @returns {number} angle in radians */ function Q(e){if(null===e||void 0===e)throw new Error("degrees is required");return e%360*Math.PI/180} /** * Converts a length to the requested unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @param {number} length to be converted * @param {string} originalUnit of the length * @param {string} [finalUnit='kilometers'] returned unit * @returns {number} the converted length */function _(e,t,r){if(null===e||void 0===e)throw new Error("length is required");if(!(e>=0))throw new Error("length must be a positive number"); /** * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit. * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet * * @name radiansToLength * @param {number} radians in radians across the sphere * @param {string} [units='kilometers'] can be degrees, radians, miles, or kilometers inches, yards, metres, meters, kilometres, kilometers. * @returns {number} distance */ return function(e,t){if(void 0===e||null===e)throw new Error("radians is required");if(t&&"string"!==typeof t)throw new Error("units must be a string");var r=B[t||"kilometers"];if(!r)throw new Error(t+" units is invalid");return e*r}(H(e,t),r||"kilometers")} /** * Converts a area to the requested unit. * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches * @param {number} area to be converted * @param {string} [originalUnit='meters'] of the distance * @param {string} [finalUnit='kilometers'] returned unit * @returns {number} the converted distance */ /** * isNumber * * @param {*} num Number to validate * @returns {boolean} true/false * @example * turf.isNumber(123) * //=true * turf.isNumber('foo') * //=false */ function $(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)} /** * isObject * * @param {*} input variable to validate * @returns {boolean} true/false * @example * turf.isObject({elevation: 10}) * //=true * turf.isObject('foo') * //=false */function ee(e){return!!e&&e.constructor===Object} /** * Validate BBox * * @private * @param {Array} bbox BBox to validate * @returns {void} * @throws Error if BBox is not valid * @example * validateBBox([-180, -40, 110, 50]) * //=OK * validateBBox([-180, -40]) * //=Error * validateBBox('Foo') * //=Error * validateBBox(5) * //=Error * validateBBox(null) * //=Error * validateBBox(undefined) * //=Error */function te(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!$(e))throw new Error("bbox must only contain numbers")}))} /** * Validate Id * * @private * @param {string|number} id Id to validate * @returns {void} * @throws Error if Id is not valid * @example * validateId([-180, -40, 110, 50]) * //=Error * validateId([-180, -40]) * //=Error * validateId('Foo') * //=OK * validateId(5) * //=OK * validateId(null) * //=Error * validateId(undefined) * //=Error */function re(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")} // Deprecated methods /* harmony default export */var ne=// CONCATENATED MODULE: ./node_modules/@turf/rhumb-destination/main.es.js // https://en.wikipedia.org/wiki/Rhumb_line /** * Returns the destination {@link Point} having travelled the given distance along a Rhumb line from the * origin Point with the (varant) given bearing. * * @name rhumbDestination * @param {Coord} origin starting point * @param {number} distance distance from the starting point * @param {number} bearing varant bearing angle ranging from -180 to 180 degrees from north * @param {Object} [options={}] Optional parameters * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers * @param {Object} [options.properties={}] translate properties to destination point * @returns {Feature} Destination point. * @example * var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"}); * var distance = 50; * var bearing = 90; * var options = {units: 'miles'}; * * var destination = turf.rhumbDestination(pt, distance, bearing, options); * * //addToMap * var addToMap = [pt, destination] * destination.properties['marker-color'] = '#00F'; */ function(e,t,r,n){if(!ee( // Optional parameters n=n||{}))throw new Error("options is invalid");var a=n.units,i=n.properties; // validation if(!e)throw new Error("origin is required");if(void 0===t||null===t)throw new Error("distance is required");if(void 0===r||null===r)throw new Error("bearing is required");if(!(t>=0))throw new Error("distance must be greater than 0");var o=_(t,a,"meters"),s=I(e),u= /** * Returns the destination point having travelled along a rhumb line from origin point the given * distance on the given bearing. * Adapted from Geodesy: http://www.movable-type.co.uk/scripts/latlong.html#rhumblines * * @private * @param {Array} origin - point * @param {number} distance - Distance travelled, in same units as earth radius (default: metres). * @param {number} bearing - Bearing in degrees from north. * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres). * @returns {Array} Destination point. */ function(e,t,r,n){ // φ => phi // λ => lambda // ψ => psi // Δ => Delta // δ => delta // θ => theta n=void 0===n?Y:Number(n);var a=t/n,i=e[0]*Math.PI/180,o=Q(e[1]),s=Q(r),u=a*Math.cos(s),l=o+u;// angular distance in radians // check for some daft bugger going past the pole, normalise latitude if so Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),d=Math.abs(c)>1e-11?u/c:Math.cos(o),f=a*Math.sin(s)/d;return[(180*(i+f)/Math.PI+540)%360-180,180*l/Math.PI];// normalise to −180..+180° }(s,o,r); // compensate the crossing of the 180th meridian (https://macwright.org/2016/09/26/the-180th-meridian.html) // solution from https://github.com/mapbox/mapbox-gl-js/issues/3250#issuecomment-294887678 return u[0]+=u[0]-s[0]>180?-360:s[0]-u[0]>180?360:0,J(u,i)}; /** * Scale Feature/Geometry * * @private * @param {Feature|Geometry} feature GeoJSON Feature/Geometry * @param {number} factor of scaling, positive or negative values greater than 0 * @param {string|Coord} [origin="centroid"] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid) * @returns {Feature|Geometry} scaled GeoJSON Feature/Geometry */ function ae(e,t,r){ // Default params var n="Point"=== /** * Get GeoJSON object's type, Geometry type is prioritize. * * @param {GeoJSON} geojson GeoJSON object * @param {string} [name="geojson"] name of the variable to display in error message * @returns {string} GeoJSON type * @example * var point = { * "type": "Feature", * "properties": {}, * "geometry": { * "type": "Point", * "coordinates": [110, 40] * } * } * var geom = turf.getType(point) * //="Point" */ function(e,t){if(!e)throw new Error((t||"geojson")+" is required"); // GeoJSON Feature & GeometryCollection if(e.geometry&&e.geometry.type)return e.geometry.type; // GeoJSON Geometry & FeatureCollection if(e.type)return e.type;throw new Error((t||"geojson")+" is invalid")}(e); // Shortcut no-scaling return r= /** * Define Origin * * @private * @param {GeoJSON} geojson GeoJSON * @param {string|Coord} origin sw/se/nw/ne/center/centroid * @returns {Feature} Point origin */ function(e,t){ // Default params void 0!==t&&null!==t||(t="centroid"); // Input Coord if(Array.isArray(t)||"object"===typeof t)return I(t); // Define BBox var r=e.bbox?e.bbox:j(e),n=r[0],a=r[1],i=r[2],o=r[3];switch(t){case"sw":case"southwest":case"westsouth":case"bottomleft":return x([n,a]);case"se":case"southeast":case"eastsouth":case"bottomright":return x([i,a]);case"nw":case"northwest":case"westnorth":case"topleft":return x([n,o]);case"ne":case"northeast":case"eastnorth":case"topright":return x([i,o]);case"center":return m(e);case void 0:case null:case"centroid":return M(e);default:throw new Error("invalid origin")}} /* harmony default export */(e,r),1===t||n|| // Scale each coordinate N(e,(function(e){var n=z(r,e),a=U(r,e),i=function(e){if(!e)throw new Error("coords is required"); // Feature if("Feature"===e.type&&null!==e.geometry)return e.geometry.coordinates; // Geometry if(e.coordinates)return e.coordinates; // Array of numbers if(Array.isArray(e))return e;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")} /** * Checks if coordinates contains a number * * @name containsNumber * @param {Array} coordinates GeoJSON Coordinates * @returns {boolean} true if Array contains a number */(ne(r,n*t,a));e[0]=i[0],e[1]=i[1],3===e.length&&(e[2]*=t)})),e}var ie=// CONCATENATED MODULE: ./node_modules/@turf/transform-scale/main.es.js /** * Scale a GeoJSON from a given point by a factor of scaling (ex: factor=2 would make the GeoJSON 200% larger). * If a FeatureCollection is provided, the origin point will be calculated based on each individual Feature. * * @name transformScale * @param {GeoJSON} geojson GeoJSON to be scaled * @param {number} factor of scaling, positive or negative values greater than 0 * @param {Object} [options={}] Optional parameters * @param {string|Coord} [options.origin='centroid'] Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid) * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true) * @returns {GeoJSON} scaled GeoJSON * @example * var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]); * var scaledPoly = turf.transformScale(poly, 3); * * //addToMap * var addToMap = [poly, scaledPoly]; * scaledPoly.properties = {stroke: '#F00', 'stroke-width': 4}; */ function(e,t,r){if(!F( // Optional parameters r=r||{}))throw new Error("options is invalid");var n=r.origin,a=r.mutate; // Input validation if(!e)throw new Error("geojson required");if("number"!==typeof t||0===t)throw new Error("invalid factor");var i=Array.isArray(n)||"object"===typeof n; // Clone geojson to avoid side effects // Scale each Feature separately return!0!==a&&(e=s(e)),"FeatureCollection"!==e.type||i?ae(e,t,n):(W(e,(function(r,a){e.features[a]=ae(r,t,n)})),e); // Scale Feature/Geometry }; /***/}, /***/9458: /***/function(e,t,r){"use strict";var n=(0,r(4836).default)(r(885));function a(e,t,r,n){var a;return n=(255-(a=Math.min(e,t,r)))/255,[e=((e-a)/n).toFixed(0),t=((t-a)/n).toFixed(0),r=((r-a)/n).toFixed(0),n=parseFloat(n.toFixed(4))]}function i(e){var t={},r={h:e[1]/360,s:e[2]/100,l:e[3]/100,a:parseFloat(e[4])};if(0===r.s){var n=255*r.l;t={r:n,g:n,b:n,a:r.a}}else{var a=r.l<.5?r.l*(1+r.s):r.l+r.s-r.l*r.s,i=2*r.l-a;t.r=255*l(i,a,r.h+1/3),t.g=255*l(i,a,r.h),t.b=255*l(i,a,r.h-1/3),t.a=r.a}return t}function o(e){e.r=e.r/255,e.g=e.g/255,e.b=e.b/255;var t,r=Math.max(e.r,e.g,e.b),n=Math.min(e.r,e.g,e.b),a=[];if(a.a=e.a,a.l=(r+n)/2,r===n)a.h=0,a.s=0;else{switch(t=r-n,a.s=a.l>=.5?t/(2-r-n):t/(r+n),r){case e.r:a.h=(e.g-e.b)/t+(e.g1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(2/3-r)*(t-e):e}function c(e,t){return e/t}e.exports=/*jshint esversion: 6 */function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba",l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=e.toLowerCase(),t=t.toLowerCase();var c,d,f,h,p=e,y=r(8874),m={rgb:{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],toRGBA:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),1]}},rgba:{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d+(?:\.\d+)?|\.\d+)\s*\)/,example:["rgba(123, 234, 45, 1)","rgba(255,234,245, 0.5)"],toRGBA:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])]}},hex:{re:/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["00ff00","336699"],toRGBA:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),1]}},hex3:{re:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["fb0","f0f"],toRGBA:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),1]}},hexa:{re:/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["00ff00ff","336699a0"],toRGBA:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255]}},hex4a:{re:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["fb0f","f0f8"],toRGBA:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255]}},hsl:{re:/^hsl\((\d{1,3}),\s*(\d{1,3})%,\s*(\d{1,3})%\)$/,example:["hsl(120, 100%, 25%)","hsl(0, 100%, 50%)"],toRGBA:function(e){e[4]=1;var t=i(e);return[t.r,t.g,t.b,t.a]}},hsla:{re:/^hsla\((\d{1,3}),\s*(\d{1,3})%,\s*(\d{1,3})%,\s*(\d+(?:\.\d+)?|\.\d+)\s*\)/,example:["hsla(120, 100%, 25%, 1)","hsla(0, 100%, 50%, 0.5)"],toRGBA:function(e){var t=i(e);return[t.r,t.g,t.b,t.a]}},hsv:{re:/^hsv\((\d{1,3}),\s*(\d{1,3})%,\s*(\d{1,3})%\)$/,example:["hsv(120, 100%, 25%)","hsv(0, 100%, 50%)"],toRGBA:function(e){var t=s(e);return[t.r,t.g,t.b,1]}},hsb:{re:/^hsb\((\d{1,3}),\s*(\d{1,3})%,\s*(\d{1,3})%\)$/,example:["hsb(120, 100%, 25%)","hsb(0, 100%, 50%)"],toRGBA:function(e){var t=s(e);return[t.r,t.g,t.b,1]}}};// Search the color definitions for a match for(var v in// If this is a named color, convert it to hex y.hasOwnProperty(e)&&((e=y[e]).forEach((function(t,r){e[r]=("0"+t.toString(16)).slice(-2)})),e="#"+e.join("")),m){var g=m[v].re,b=m[v].toRGBA,w=g.exec(e);if(w){var S=b(w);c=S[0],d=S[1],f=S[2],h=+(Math.round(S[3]+"e+4")+"e-4")}}switch(c=Math.round(c<0||isNaN(c)?0:c>255?255:c),d=Math.round(d<0||isNaN(d)?0:d>255?255:d),f=Math.round(f<0||isNaN(f)?0:f>255?255:f),h=h<0||isNaN(h)?0:h>1?1:h,t){case"hex":p="#"+("0"+c.toString(16)).slice(-2)+("0"+d.toString(16)).slice(-2)+("0"+f.toString(16)).slice(-2);break;case"hexa":if(l){var L=a(c,d,f,h),E=(0,n.default)(L,4);c=E[0],d=E[1],f=E[2],h=E[3]}p="#"+("0"+c.toString(16)).slice(-2)+("0"+d.toString(16)).slice(-2)+("0"+f.toString(16)).slice(-2)+("0"+Math.round(255*h).toString(16)).slice(-2);break;case"hsl":var M=o({r:c,g:d,b:f});p="hsl(".concat(M.h,",").concat(M.s,"%,").concat(M.l,"%)");break;case"hsla":if(l){var k=a(c,d,f,h),x=(0,n.default)(k,4);c=x[0],d=x[1],f=x[2],h=x[3]}var T=o({r:c,g:d,b:f,a:h});p="hsla(".concat(T.h,",").concat(T.s,"%,").concat(T.l,"%,").concat(T.a,")");break;case"hsb":/* Same as `hsv` */var F=u({r:c,g:d,b:f});p="hsb(".concat(F.h,",").concat(F.s,"%,").concat(F.v,"%)");break;case"hsv":var P=u({r:c,g:d,b:f});p="hsv(".concat(P.h,",").concat(P.s,"%,").concat(P.v,"%)");break;case"rgb":p="rgb(".concat(c,",").concat(d,",").concat(f,")");break;/* falls through */default:if(l){var C=a(c,d,f,h),N=(0,n.default)(C,4);c=N[0],d=N[1],f=N[2],h=N[3]}p="rgba(".concat(c,",").concat(d,",").concat(f,",").concat(h,")")}return p},r.g.colorcolor=e.exports}, /***/1892: /***/function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addListener=function(e,t){e.__resize_mutation_handler__||(e.__resize_mutation_handler__=c.bind(e));if(!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var r=e.offsetWidth,n=e.offsetHeight,p=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==r||e.offsetHeight!==n))&&f(e)})),y=o(e),m=y.detached,v=y.rendered;e.__resize_observer_triggered__=!1===m&&!1===v,e.__resize_observer__=p,p.observe(e)}else if(e.attachEvent&&e.addEventListener)// targeting IE9/10 e.__resize_legacy_resize_handler__=function(){f(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(u||(l=function(e){var t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));return(document.querySelector("head")||document.body).appendChild(t),t}(s)),function(e){var t=i(e,"position");t&&"static"!==t||(e.style.position="relative");e.__resize_old_position__=t,e.__resize_last__={};var r=a("div",{className:"resize-triggers"}),n=a("div",{className:"resize-expand-trigger"}),o=a("div"),s=a("div",{className:"resize-contract-trigger"});n.appendChild(o),r.appendChild(n),r.appendChild(s),e.appendChild(r),e.__resize_triggers__={triggers:r,expand:n,expandChild:o,contract:s},h(e),e.addEventListener("scroll",d,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=o(e).rendered,window.MutationObserver){var g=new MutationObserver(e.__resize_mutation_handler__);g.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=g}e.__resize_listeners__.push(t),u++},t.removeListener=function(e,t){var r=e.__resize_listeners__;if(!r)return;t&&r.splice(r.indexOf(t),1);// no listeners exist, or removing all listeners if(!r.length||!t){// targeting IE9/10 if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",d),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --u&&l&&l.parentNode.removeChild(l)};var r=null;var n=null;function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.createElement(e);return Object.keys(t).forEach((function(e){r[e]=t[e]})),r}function i(e,t,r){return(window.getComputedStyle(e,r||null)||{display:"none"})[t]}function o(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===i(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var s='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',u=0,l=null;function c(){// `this` denotes the scrolling element var e=o(this),t=e.rendered,r=e.detached;t!==this.__resize_rendered__&&(!r&&this.__resize_triggers__&&(h(this),this.addEventListener("scroll",d,!0)),this.__resize_rendered__=t,f(this))}function d(){var e,t,a=this;// `this` denotes the scrolling element h(this),this.__resize_raf__&&(e=this.__resize_raf__,n||(n=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),n(e)),this.__resize_raf__=(t=function(){var e=function(e){var t=e.__resize_last__,r=t.width,n=t.height,a=e.offsetWidth,i=e.offsetHeight;return a!==r||i!==n?{width:a,height:i}:null}(a);e&&(a.__resize_last__=e,f(a))},r||(r=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),r(t))}function f(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function h(e){var t=e.__resize_triggers__,r=t.expand,n=t.expandChild,a=t.contract,i=a.scrollWidth,o=a.scrollHeight,s=r.offsetWidth,u=r.offsetHeight,l=r.scrollWidth,c=r.scrollHeight;// batch read // batch write a.scrollLeft=i,a.scrollTop=o,n.style.width=s+1+"px",n.style.height=u+1+"px",r.scrollLeft=l,r.scrollTop=c} /***/}, /***/4870: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=r(7187),l=n(r(5618)),c=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default[1];return(0,a.default)(this,r),(e=t.call(this))._theme=n,e}return(0,i.default)(r,[{key:"theme",get:function(){return this._theme},set:function(e){this._theme=e}}]),r}(u.EventEmitter),d=new c;t.default=d}, /***/9752: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.callHook=function(e,t,r){i.includes(t)&&e[t]&&"function"===typeof e[t]&&e[t](r)},t.clearNumberComma=// 清除数字(字符串型的)的逗号 function(e){e.replace&&(e=e.replace(/,/g,""));return e} /** * 判断是否地理X坐标 * @param data */,t.getColorWithOpacity=function(e,t){if(e.indexOf("rgba")>-1)return e.substring(0,e.lastIndexOf(",")+1)+t+")";var r=(0,a.default)(e,"rgb");return"rgba"+r.substring(3,r.length-1)+",".concat(t,")")},t.getComponentInstance=function(e){this.instanceRef=e},t.getFirstMapTarget=function(e){var t;for(var r in e)if(r){t=r;break}return t} /***/,t.hexToRgba=// 获取当前时间返回置顶格式 // export function getDateTime(timeType) { // return geti18n().d(new Date(), timeType.replace(/\+/g, '_'), getLanguage()); // } // hex -> rgba function(e,t){return"rgba("+parseInt("0x"+e.slice(1,3))+","+parseInt("0x"+e.slice(3,5))+","+parseInt("0x"+e.slice(5,7))+","+t+")"}// export function isTransparent(color) { // const rgba = colorcolor(color, 'rgba'); // return +rgba.match(/(\d(\.\d+)?)+/g)[3] === 0; // } // 保留指定位数的小数 ,t.isFunction=function(e){return"[object Function]"===Object.prototype.toString.call(e)},t.isXField=function(e){var t=e.toLowerCase();return"x"===t||"smx"===t||"jd"===t||"\u7ecf\u5ea6"===t||"\u4e1c\u7ecf"===t||"longitude"===t||"lot"===t||"lon"===t||"lng"===t||"x\u5750\u6807"===t} /** * 判断是否地理Y坐标 * @param data */,t.isYField=function(e){var t=e.toLowerCase();return"y"===t||"smy"===t||"wd"===t||"\u7eac\u5ea6"===t||"\u5317\u7eac"===t||"latitude"===t||"lat"===t||"y\u5750\u6807"===t},t.reservedDecimal=function(e,t){return Number(e).toFixed(t)};var a=n(r(9458));var i=["loaded","removed"]}, /***/7006: /***/function(e,t,r){"use strict";var n=r(5263).default,a=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=function(t){(0,l.default)(n,t);var r=(0,c.default)(n);function n(e){var t;return(0,o.default)(this,n),(t=r.call(this,e)).registerEvents=[],t.$_emitEvent=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="on".concat((0,y.default)(e));(0,m.isFunction)(t.props[n])&&t.props[n]((0,i.default)({map:t.map,layerId:t.props.layerId},r))},t.$_emitLayerMapEvent=function(e){t.$_emitEvent(e.type,{mapboxEvent:e})},t.$_bindLayerEvents=function(){Object.keys(t.props).forEach((function(e){if(t.eventList.includes(e)){var r=t.props.layerId,n=t.map.overlayLayersManager[r],a=e.replace("on","").toLowerCase();// @ts-ignore t.registerEvents.push(a),n?(t.overLayer=n,n.on(a,t.$_emitLayerMapEvent)):t.map.on(a,r,t.$_emitLayerMapEvent)}}))},t.$_unbindLayerEvents=function(e){t.map&&e.forEach((function(e){!t.overLayer&&t.map.off(e,t.props.layerId,t.$_emitLayerMapEvent)}))},// move = beforeId => { // this.map.moveLayer(this.props.layerId, beforeId); // this.$_emitEvent('layer-moved', { // beforeId: beforeId // }); // }; t.remove=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.props.layerId;t.registerEvents&&t.registerEvents.length&&t.$_unbindLayerEvents(t.registerEvents),t.map&&(t.map&&t.map.removeLayer(e),t.$_emitEvent("layer-removed"))},t.eventList=["onMousedown","onMouseup","onClick","onDblclick","onMousemove","onMouseenter","onMouseleave","onMouseover","onMouseout","onContextmenu","onTouchstart","onTouchend","onTouchcancel"],t.getComponentInstance=m.getComponentInstance.bind((0,u.default)(t)),t}return(0,s.default)(n,[{key:"componentDidUpdate",value:function(e){if(e.minzoom===this.props.minzoom&&e.maxzoom===this.props.maxzoom||this.map.setLayerZoomRange(this.props.layerId,this.props.minzoom,this.props.maxzoom),e.filter!==this.props.filter&&this.map.setFilter(this.props.layerId,this.props.filter),this.props.layout&&e.layout!==this.props.layout)for(var t=0,r=Object.keys(this.props.layout);t0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,e),this.layout={visibility:"visible"},this.paint={"circle-radius":6,"circle-color":"#3fb1e3","circle-opacity":1,"circle-blur":0,"circle-translate":[0,0],"circle-translate-anchor":"map","circle-pitch-scale":"map","circle-pitch-alignment":"viewport","circle-stroke-width":0,"circle-stroke-color":"#000","circle-stroke-opacity":1},Object.assign(this.paint,t),Object.assign(this.layout,r)}));t.default=o}, /***/3768: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(3144)),i=n(r(5671)),o=(0,a.default)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,e),this.layout={visibility:"visible"},this.paint={"fill-opacity":.8,"fill-color":"#3fb1e3","fill-translate":[0,0],"fill-antialias":!0,"fill-outline-color":"#3fb1e3","fill-translate-anchor":"map"},Object.assign(this.paint,t),Object.assign(this.layout,r)}));t.default=o}, /***/9623: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(3144)),i=n(r(5671)),o=(0,a.default)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,e),this.paint={"heatmap-radius":30,"heatmap-weight":1,"heatmap-intensity":1,"heatmap-color":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],"heatmap-opacity":1},this.layout={visibility:"visible"},Object.assign(this.paint,t),Object.assign(this.layout,r)}));t.default=o}, /***/8214: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(3144)),i=n(r(5671)),o=(0,a.default)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,e),this.layout={visibility:"visible","line-cap":"butt","line-join":"miter"},this.paint={"line-opacity":1,"line-color":"#3fb1e3","line-width":3,"line-blur":1},Object.assign(this.paint,t),Object.assign(this.layout,r)}));t.default=o}, /***/1700: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(3144)),i=n(r(5671)),o=(0,a.default)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(this,e),this.paint=Object.assign({},t),this.layout=Object.assign({visibility:"visible"},r)}));t.default=o}, /***/2009: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CircleStyle",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"FillStyle",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"HeatMapStyle",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"LineStyle",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"SymbolStyle",{enumerable:!0,get:function(){return u.default}});var a=n(r(1558)),i=n(r(3768)),o=n(r(8214)),s=n(r(9623)),u=n(r(1700))}, /***/1104: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=r(7187),l=n(r(8383)),c=n(r(4870)),d=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(){var e;(0,a.default)(this,r);for(var n=arguments.length,i=new Array(n),o=0;o1){var r=[];t.forEach((function(e){r.push([e])})),e.geometry.coordinates=r,e.geometry.type="MultiPolygon"}}})),e}}, /***/1191: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"SmAnimateMarkerLayer",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"SmClusterLayer",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"SmDataFlowLayer",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"SmDeckglLayer",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"SmEchartsLayer",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"SmFireLayer",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"SmGeojsonLayer",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"SmGraphThemeLayer",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"SmHeatmapLayer",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"SmLabelThemeLayer",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"SmLayer",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"SmMap",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"SmMapvLayer",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"SmRangeThemeLayer",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"SmRanksymbolThemeLayer",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"SmRasterTileLayer",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"SmSource",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"SmUniqueThemeLayer",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"SmVectorTileLayer",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"SmWebMap",{enumerable:!0,get:function(){return a.default}});var a=n(r(4416)),i=n(r(8611)),o=n(r(1406)),s=n(r(5558)),u=n(r(9704)),l=n(r(1771)),c=n(r(2125)),d=n(r(4204)),f=n(r(3930)),h=n(r(5890)),p=n(r(910)),y=n(r(9407)),m=n(r(9183)),v=n(r(2174)),g=n(r(6073)),b=n(r(7)),w=n(r(1762)),S=n(r(2313)),L=n(r(4799)),E=n(r(1193))}, /***/4483: /***/function(e,t,r){"use strict";var n=r(5263).default,a=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0});var i={};t.default=void 0;var o=a(r(8683));r(9626),r(2547);var s=n(r(1191));Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var u=n(r(2009)),l=(0,o.default)((0,o.default)({},s),{},{commontypes:u});t.default=l}, /***/1016: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(3144)),i=n(r(5671)),o=(0,a.default)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(this,e),this.id=t.id,this.maxzoom=t.maxzoom,this.minzoom=t.minzoom,this.source=t.source,this.type=t.type,this.visibility=t.visibility||"visible"})),s=o;t.default=s}, /***/8611: /***/function(e,t,r){"use strict";var n=r(5263).default,a=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r(8683)),o=a(r(5671)),s=a(r(3144)),u=a(r(7326)),l=a(r(9340)),c=a(r(8557)),d=n(r(3899)),f=r(4831),h=a(r(8031)),p=a(r(1296)),y=a(r(1633)),m=a(r(39)),v=a(r(9208)),g=a(r(2307)),b=r(1892),w=a(r(1104)),S=r(9752),L=r(5893),E=function(e){(0,l.default)(r,e);var t=(0,c.default)(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this,e)).viewModelProps=["mapOptions.center","mapOptions.zoom","mapOptions.crs","mapOptions.minZoom","mapOptions.maxZoom","mapOptions.maxBounds","mapOptions.renderWorldCopies","mapOptions.bearing","mapOptions.pitch"],n.initializeWebMap=function(){var e=n.props,t=e.target,r=e.tiandituKey,a=e.mapOptions,i=e.autoresize;n.viewModel=new h.default({target:t,tiandituKey:r},a),i&&(0,b.addListener)(n.selfRef.current,n.__resizeHandler)},n.registerEvents=function(){var e=n.props,t=e.target,r=e.onLoad;n.viewModel.on("addlayerssucceeded",(function(e){n.setState({spinning:!1}),w.default.setMap(t,e.map),n.viewModel&&w.default.setWebMap(t,n.viewModel),w.default.emit("load-map",e.map,t),e.map.resize(),n.map=e.map,// 绑定map event n.bindMapEvents(), /** * @event load * @desc webmap 加载完成之后触发。 * @property {mapboxgl.Map} map - MapBoxGL Map 对象。 */ (0,S.isFunction)(r)&&r((0,i.default)((0,i.default)({},e),{},{component:(0,u.default)(n)}))}))},n.mapEventCallback=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.emitMapEvent(e.type,(0,i.default)({mapboxEvent:e},t))},n.state={spinning:!0},n.selfRef=d.default.createRef(),n.__resizeHandler=(0,p.default)(n.__resizeHandler.bind((0,u.default)(n)),100,{leading:!0}),n}return(0,s.default)(r,[{key:"componentDidMount",value:function(){this.initializeWebMap(),this.registerEvents()}},{key:"getLayerIds",value:function(e){return null===e||void 0===e?void 0:e.reduce((function(e,t){var r,n;if(null!==t&&void 0!==t&&null!==(r=t.type)&&void 0!==r&&null!==(n=r.displayName)&&void 0!==n&&n.includes("Layer")){var a=t.props.layerId;a&&e.push(a)}return e}),[])}},{key:"componentDidUpdate",value:function(e){var t=this;this.viewModel&&this.viewModelProps.forEach((function(r){var n=r.includes(".")?r.split(".")[1]:r,a="set".concat((0,m.default)(n)),i=(0,v.default)(t.props,r),o=(0,v.default)(e,r);i&&!(0,g.default)(i,o)&&t.viewModel[a](i)}));var r=this.props,n=r.sprites,a=r.glyphs;for(var i in n)e.sprites[i]!==n[i]&&this.viewModel.addSprites(i,n[i]);for(var o in a)e.glyphs[o]!==a[o]&&this.viewModel.addGlyphs(o,a[o]);if(this.map){var s=this.getLayerIds(e.children),u=this.getLayerIds(this.props.children);// 过滤图层顺序相等的情况 (0,g.default)(s,u)||this.viewModel.changeLayersOrder(u)}}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.target,r=e.autoresize;w.default.deleteMap(t),w.default.deleteWebMap(t),r&&this.selfRef.current&&(0,b.removeListener)(this.selfRef.current,this.__resizeHandler)}},{key:"bindMapEvents",value:function(){var e=this;Object.keys(this.props).forEach((function(t){if(f.MAP_EVENT_NAMES.includes(t)){var r=t.replace("on","");e.bindMapEvent(r.toLowerCase(),e.mapEventCallback)}}))}},{key:"bindMapEvent",value:function(e,t){this.map.on(e,t)}},{key:"emitMapEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="on".concat((0,y.default)(e));(0,S.isFunction)(this.props[r])&&this.props[r]((0,i.default)({map:this.map,component:this},t))}},{key:"__resizeHandler",value:function(){this.resize()}},{key:"resize",value:function(){this.viewModel&&this.viewModel.resize&&this.viewModel.resize()}},{key:"render",value:function(){var e=this.state.spinning,t=this.props,r=t.target,n=t.children;return(0,L.jsx)("div",{id:r,className:"sm-component-map",ref:this.selfRef,children:!e&&n})}}]),r}(d.Component);E.defaultProps={target:"map",autoresize:!0};var M=E;t.default=M}, /***/8031: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(375)),l=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{style:{version:8,sources:{},layers:[]}};return(0,a.default)(this,r),(n=t.call(this)).mapOptions=Object.assign({style:{version:8,sources:{},layers:[]}},i),n.tiandituKey=e.tiandituKey||"",n.target=e.target||"map",n.center=i.center||[],n.zoom=i.zoom,n._createMap(),n}return(0,i.default)(r,[{key:"_createMap",value:function(){var e=this;this.map&&(this.map.remove(),this.center=[],this.zoom=null),this.mapOptions.container=this.target,setTimeout((function(){e.map=new u.default.Map(e.mapOptions),e.map.on("load",(function(){e.fire("addlayerssucceeded",{map:e.map})}))}),0)} /** * @function WebMapViewModel.prototype.resize * @description Map 更新大小。 */},{key:"resize",value:function(){this.map&&this.map.resize()} /** * @function WebMapViewModel.prototype.setCRS * @description 设置地图的投影。 * @param {Number} crs - 地图投影。 */},{key:"setCrs",value:function(e){this.map&&(this.mapOptions.crs=e,//@ts-ignore e&&this.map.setCRS(u.default.CRS.get(e)))} /** * @function WebMapViewModel.prototype.setZoom * @description 设置地图的缩放级别。 * @param {Number} zoom - 地图缩放级别。 */},{key:"setZoom",value:function(e){this.map&&(this.mapOptions.zoom=e,(e||0===e)&&this.map.setZoom(e))} /** * @function WebMapViewModel.prototype.setCenter * @description 设置地图的中心点。 * @param {Array} center - 地图中心点。 */},{key:"setCenter",value:function(e){this.map&&(this.mapOptions.center=e,e&&e.length>0&&this.map.setCenter(e))} /** * @function WebMapViewModel.prototype.setMaxBounds * @description 设置地图的最大范围。 * @param {Array} maxBounds - 地图最大范围。 */},{key:"setMaxBounds",value:function(e){this.map&&(this.mapOptions.maxBounds=e,e&&e.length>0&&this.map.setMaxBounds(e))} /** * @function WebMapViewModel.prototype.setMinZoom * @description 设置地图的最小级别。 * @param {Number} minZoom - 地图最小级别。 */},{key:"setMinZoom",value:function(e){this.map&&(this.mapOptions.minZoom=e,(e||0===e)&&this.map.setMinZoom(e))} /** * @function WebMapViewModel.prototype.setMaxZoom * @description 设置地图的最大级别。 * @param {Number} maxZoom - 地图最大级别。 */},{key:"setMaxZoom",value:function(e){this.map&&(this.mapOptions.maxZoom=e,(e||0===e)&&this.map.setMinZoom(e))} /** * @function WebMapViewModel.prototype.setRenderWorldCopies * @description 设置地图的平铺。 * @param {Boolean} renderWorldCopies - 地图是否平铺。 */},{key:"setRenderWorldCopies",value:function(e){this.map&&(this.mapOptions.renderWorldCopies=e,e&&this.map.setRenderWorldCopies(e))} /** * @function WebMapViewModel.prototype.setBearing * @description 设置地图的方位。 * @param {Number} bearing - 地图的初始方位。 */},{key:"setBearing",value:function(e){this.map&&(this.mapOptions.bearing=e,(e||0===e)&&this.map.setBearing(e))} /** * @function WebMapViewModel.prototype.setPitch * @description 设置地图的俯仰。 * @param {Number} pitch - 地图的初始俯仰。 */},{key:"setPitch",value:function(e){this.map&&(this.mapOptions.pitch=e,(e||0===e)&&this.map.setPitch(e))}},{key:"addSprites",value:function(e,t){var r;null!==(r=this.map)&&void 0!==r&&r.style&&this.map.style.addSprite(e,t)}},{key:"addGlyphs",value:function(e,t){var r;null!==(r=this.map)&&void 0!==r&&r.style&&this.map.style.addGlyphs(e,t)} /** * @function MapViewModel.prototype.changeLayersOrder * @description 设置图层顺序 * @param {string[]} newLayerIds - 正确顺序的图层id数据 */},{key:"changeLayersOrder",value:function(e){// 最后一个图层的位置不变,从倒数第二个图层开始移动图层顺序 for(var t=e.length-2;t>-1;t--){var r=e[t],n=e[t+1];this.map.moveLayer(r,n)}}}]),r}(u.default.Evented),c=l;t.default=c}, /***/1406: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i=n(r(4925)),o=n(r(5671)),s=n(r(3144)),u=n(r(9340)),l=n(r(8557)),c=n(r(8808)),d=n(r(3899)),f=n(r(9635)),h=["id","mapNotLoadedTip"],p=(0,c.default)(f.default)(a=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this,e))._map=null,n}return(0,s.default)(r,[{key:"componentWillUnmount",value:function(){var e=this;setTimeout((function(){e._map.removeSource(e.props.id)}),100)}},{key:"loaded",value:function(e){this._map=e;var t=this.props,r=t.id,n=(t.mapNotLoadedTip,(0,i.default)(t,h));this._map.getSource(r)||this._map.addSource(r,n)}},{key:"render",value:function(){return null}}]),r}(d.default.PureComponent))||a;t.default=p}, /***/8383: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(7591)),s=n(r(1016)),u=function(){function e(t){(0,a.default)(this,e),this.map=t.map,this.style=this.map.getStyle(),this.layers=this.map.getStyle().layers,this.overlayLayers=this.map.overlayLayersManager,this.detailLayers=null,this.sourceList={},this.sourceNames=[],this._initLayers(),this._initSource(),this.excludeSourceNames=["tdt-search-","tdt-route-","smmeasure","mapbox-gl-draw"]}return(0,i.default)(e,[{key:"getSourceList",value:function(){var e={};for(var t in this.sourceList)t&&this.excludeSource(t)&&(e[t]=this.sourceList[t]);return e}},{key:"getSourceNames",value:function(){var e=this,t=[];return this.sourceNames.forEach((function(r){r&&e.excludeSource(r)&&t.push(r)})),t}},{key:"excludeSource",value:function(e){for(var t=0;t=0)return!1;return!0}},{key:"getLegendStyle",value:function(e){return e?this.sourceList[e]?this.sourceList[e].style:"":(Object.values(this.sourceList)||[]).filter((function(e){return!!e.style}))}},{key:"getLayers",value:function(){return this.detailLayers}},{key:"getLayersBySourceLayer",value:function(e,t){return this.sourceList[e].sourceLayerList[t]}},{key:"getSourceLayersBySource",value:function(e){return this.sourceList[e].sourceLayerList}},{key:"addSourceStyle",value:function(e,t){this.sourceList[e]&&(this.sourceList[e].style=t)}},{key:"_initLayers",value:function(){var e=this;this.layers&&(this.detailLayers=this.layers.map((function(t){return e.map.getLayer(t.id)}))),Object.values(this.overlayLayers).forEach((function(t){t.id&&e.detailLayers.push({id:t.id,visibility:t.visibility?"visible":"none",source:t.id})}))}},{key:"_initSource",value:function(){var e=this;this.detailLayers&&this.detailLayers.forEach((function(t){e.sourceList[t.source]||(e.sourceList[t.source]=new o.default({source:t.source}),e.sourceNames.push(t.source)),e.sourceList[t.source].addLayer(new s.default(t),t.sourceLayer)}))}}]),e}();t.default=u}, /***/7591: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=function(){function e(t){(0,a.default)(this,e),this.id=t.source,this.sourceLayerList={},this.layers=[],this.type=null}return(0,i.default)(e,[{key:"addLayer",value:function(e,t){t?(this.sourceLayerList[t]||(this.sourceLayerList[t]=[]),this.sourceLayerList[t].push(e)):this.sourceLayerList=void 0,this.layers.push(e),this.type=e.type,[e.visibility,this.visibility].includes("visible")?this.visibility="visible":this.visibility="none"}}]),e}();t.default=o}, /***/4416: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(8683)),i=n(r(5671)),o=n(r(3144)),s=n(r(7326)),u=n(r(9340)),l=n(r(8557)),c=n(r(3899)),d=r(1892),f=n(r(1296)),h=n(r(1633)),p=n(r(39)),y=r(2721),m=n(r(9208)),v=n(r(2307)),g=n(r(1104)),b=n(r(2872)),w=r(9752),S=r(4831),L=r(5893),E=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(e){var n;return(0,i.default)(this,r),(n=t.call(this,e))._isMounted=!1,n.initializeWebMap=function(){var e=n.props,t=e.target,r=e.serverUrl,a=e.accessToken,i=e.accessKey,o=e.tiandituKey,s=e.withCredentials,u=e.excludePortalProxyUrl,l=e.mapOptions,c=e.autoresize;n.viewModel=new b.default(n.props.mapId,{target:t,serverUrl:r,accessToken:a,accessKey:i,tiandituKey:o,withCredentials:s,excludePortalProxyUrl:u},l),c&&(0,d.addListener)(n.selfRef.current,n.__resizeHandler)},n.registerEvents=function(){var e=n.props,t=e.target,r=e.onLoad;n.viewModel.on("addlayerssucceeded",(function(e){n._isMounted&&n.setState({spinning:!1}),g.default.setMap(t,e.map),n.viewModel&&g.default.setWebMap(t,n.viewModel),g.default.emit("load-map",e.map,t),e.map.resize(),n.map=e.map,// 绑定map event n.bindMapEvents(), /** * @event load * @desc webmap 加载完成之后触发。 * @property {mapboxgl.Map} map - MapBoxGL Map 对象。 */ (0,w.isFunction)(r)&&r((0,a.default)((0,a.default)({},e),{},{component:(0,s.default)(n)}))})),n.viewModel.on("getmapinfofailed",(function(e){var t=n.props.onGetMapFailed; /** * @event getMapFailed * @desc 获取 WebMap 地图信息失败。 * @property {Object} error - 失败原因。 */(0,w.isFunction)(t)&&t({error:e.error}),y.message.error(e.error.message),n._isMounted&&n.setState({spinning:!1})})),n.viewModel.on("getlayerdatasourcefailed",(function(e){var t=n.props.onGetLayerDatasourceFailed; /** * @event getLayerDatasourceFailed * @desc 获取图层数据失败。 * @property {Object} error - 失败原因。 * @property {Object} layer - 图层信息。 * @property {mapboxgl.Map} map - MapBoxGL Map 对象。 */(0,w.isFunction)(t)&&t({error:e.error,layer:e.layer,map:e.map}),// TODO // message.error(this.$t('webmap.getLayerInfoFailed')); y.message.error("\u83b7\u53d6\u56fe\u5c42\u4fe1\u606f\u5931\u8d25\uff01")}))},n.state={spinning:!0,viewModelProps:["mapId","serverUrl","mapOptions.center","mapOptions.zoom","mapOptions.style","mapOptions.crs","mapOptions.minZoom","mapOptions.maxZoom","mapOptions.maxBounds","mapOptions.renderWorldCopies","mapOptions.bearing","mapOptions.pitch","withCredentials"]},n.selfRef=c.default.createRef(),n.__resizeHandler=(0,f.default)(n.__resizeHandler.bind((0,s.default)(n)),100,{leading:!0}),n}return(0,o.default)(r,[{key:"componentDidMount",value:function(){this._isMounted=!0,this.initializeWebMap(),this.registerEvents()}},{key:"componentDidUpdate",value:function(e){var t=this;this.viewModel&&this.state.viewModelProps.forEach((function(r){var n=r.includes(".")?r.split(".")[1]:r,a="set".concat((0,p.default)(n)),i=(0,m.default)(t.props,r),o=(0,m.default)(e,r);void 0===i||null===i||(0,v.default)(i,o)||t.viewModel[a](i)}))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.target,r=e.autoresize;g.default.deleteMap(t),g.default.deleteWebMap(t),r&&this.selfRef.current&&(0,d.removeListener)(this.selfRef.current,this.__resizeHandler),this._isMounted=!1}},{key:"__resizeHandler",value:function(){this.resize()}},{key:"resize",value:function(){this.viewModel&&this.viewModel.resize&&this.viewModel.resize()}},{key:"bindMapEvents",value:function(){var e=this;Object.keys(this.props).forEach((function(t){if(S.MAP_EVENT_NAMES.includes(t)){var r=t.replace("on","");e.bindMapEvent(r.toLowerCase(),e.mapEventCallback.bind(e))}}))}},{key:"bindMapEvent",value:function(e,t){this.map.on(e,t)}},{key:"mapEventCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.emitMapEvent(e.type,(0,a.default)({mapboxEvent:e},t))}},{key:"emitMapEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="on".concat((0,h.default)(e));(0,w.isFunction)(this.props[r])&&this.props[r]((0,a.default)({map:this.map,component:this},t))}},{key:"render",value:function(){var e=this.state.spinning,t=this.props,r=t.target,n=t.children;return(0,L.jsxs)("div",{id:r,className:"sm-component-web-map",ref:this.selfRef,children:[n,e&&(0,L.jsx)(y.Spin,{size:"large",tip:"\u5730\u56fe\u52a0\u8f7d\u4e2d...",spinning:e})]})}}]),r}(c.default.Component);E.defaultProps={target:"map",autoresize:!0};var M=E;t.default=M}, /***/2872: /***/function(e,t,r){"use strict";var n=r(5263).default,a=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r(5671)),o=a(r(3144)),s=a(r(9340)),u=a(r(8557)),l=a(r(375)),c=a(r(8383)),d=r(3595),f=r(9752);r(2395),r(8399),r(8553);var h=n(r(7888)),p=a(r(5973)),y=a(r(550)),m=a(r(3094)),v=a(r(5385)),g=a(r(2158)),b=a(r(4461)),w=a(r(3465)),S=["559082264.0287178","279541132.0143589","139770566.0071794","69885283.00358972","34942641.50179486","17471320.75089743","8735660.375448715","4367830.1877224357","2183915.093862179","1091957.546931089","545978.7734655447","272989.7734655447","272989.3867327723","136494.6933663862","68247.34668319309","34123.67334159654","17061.83667079827","8530.918335399136","4265.459167699568","2132.729583849784"],L=["5.590822640287176E8","2.795411320143588E8","1.397705660071794E8","6.98852830035897E7","3.494264150179485E7","1.7471320750897426E7","8735660.375448713","4367830.187724357","2183915.0938621783","1091957.5469310891","545978.7734655446","272989.3867327723","136494.69336638614","68247.34668319307","34123.673341596535","17061.836670798268","8530.918335399134"],E=["GoogleCRS84Quad","GoogleMapsCompatible","GlobalCRS84Scale"],M=function(e){(0,s.default)(r,e);var t=(0,u.default)(r);function r(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return(0,i.default)(this,r),(n=t.call(this)).mapParams={},// on: any; // fire: any; n.echartslayer=[],n.canvgsV=[],n._layers=[],n.mapId=e,n.mapOptions=Object.assign({style:{version:8,sources:{},layers:[]}},o),n.serverUrl=a.serverUrl||"http://www.supermapol.com",n.accessToken=a.accessToken,n.accessKey=a.accessKey,n.tiandituKey=a.tiandituKey||"",n.withCredentials=a.withCredentials||!1,n.target=a.target||"map",n.excludePortalProxyUrl=a.excludePortalProxyUrl,n.center=o.center||[],n.zoom=o.zoom,n.echartslayer=[],n._createWebMap(),n.on("mapinitialized",(function(){n.map.on("remove",(function(){n._stopCanvg()}))})),n} /** * @function WebMapViewModel.prototype.resize * @description Map 更新大小。 */return(0,o.default)(r,[{key:"resize",value:function(){this.map&&this.map.resize(),this.echartsLayerResize()} /** * @function WebMapViewModel.prototype.EchartsLayerResize * @description echartslayer 更新大小。 */},{key:"echartsLayerResize",value:function(){this.echartslayer.forEach((function(e){e.chart.resize()}))} /** * @function WebMapViewModel.prototype.setMapId * @description 设置地图 ID。 * @param {String} mapId - iPortal|Online 地图 ID。 */},{key:"setMapId",value:function(e){var t=this;this.mapId=e,setTimeout((function(){t._createWebMap(),//@ts-ignore window.map=t.map}),0)} /** * @function WebMapViewModel.prototype.setServerUrl * @description 设置地图的地址。 * @param {string} options.serverUrl - 地图的地址。 */},{key:"setServerUrl",value:function(e){this.serverUrl=e}},{key:"setWithCredentials",value:function(e){this.withCredentials=e} /** * @function WebMapViewModel.prototype.setCRS * @description 设置地图的投影。 * @param {Number} crs - 地图投影。 */},{key:"setCrs",value:function(e){this.map&&(this.mapOptions.crs=e,//@ts-ignore e&&this.map.setCRS(l.default.CRS.get(e)))} /** * @function WebMapViewModel.prototype.setZoom * @description 设置地图的缩放级别。 * @param {Number} zoom - 地图缩放级别。 */},{key:"setZoom",value:function(e){this.map&&(this.mapOptions.zoom=e,(e||0===e)&&this.map.setZoom(e))} /** * @function WebMapViewModel.prototype.setCenter * @description 设置地图的中心点。 * @param {Array} center - 地图中心点。 */},{key:"setCenter",value:function(e){this.map&&(this.mapOptions.center=e,e&&e.length>0&&this.map.setCenter(e))} /** * @function WebMapViewModel.prototype.setMaxBounds * @description 设置地图的最大范围。 * @param {Array} maxBounds - 地图最大范围。 */},{key:"setMaxBounds",value:function(e){this.map&&(this.mapOptions.maxBounds=e,e&&e.length>0&&this.map.setMaxBounds(e))} /** * @function WebMapViewModel.prototype.setMinZoom * @description 设置地图的最小级别。 * @param {Number} minZoom - 地图最小级别。 */},{key:"setMinZoom",value:function(e){this.map&&(this.mapOptions.minZoom=e,(e||0===e)&&this.map.setMinZoom(e))} /** * @function WebMapViewModel.prototype.setMaxZoom * @description 设置地图的最大级别。 * @param {Number} maxZoom - 地图最大级别。 */},{key:"setMaxZoom",value:function(e){this.map&&(this.mapOptions.maxZoom=e,(e||0===e)&&this.map.setMaxZoom(e))} /** * @function WebMapViewModel.prototype.setRenderWorldCopies * @description 设置地图的平铺。 * @param {Boolean} renderWorldCopies - 地图是否平铺。 */},{key:"setRenderWorldCopies",value:function(e){this.map&&(this.mapOptions.renderWorldCopies=e,e&&this.map.setRenderWorldCopies(e))} /** * @function WebMapViewModel.prototype.setBearing * @description 设置地图的方位。 * @param {Number} bearing - 地图的初始方位。 */},{key:"setBearing",value:function(e){this.map&&(this.mapOptions.bearing=e,(e||0===e)&&this.map.setBearing(e))} /** * @function WebMapViewModel.prototype.setPitch * @description 设置地图的俯仰。 * @param {Number} pitch - 地图的初始俯仰。 */},{key:"setPitch",value:function(e){this.map&&(this.mapOptions.pitch=e,(e||0===e)&&this.map.setPitch(e))} /** * @function WebMapViewModel.prototype.setStyle * @description 设置地图的样式。 * @param {Object} style - 地图的样式。 */},{key:"setStyle",value:function(e){this.map&&(this.mapOptions.style=e,e&&this.map.setStyle(e))}},{key:"getSourceListModel",get:function(){return this._sourceListModel} /** * @private * @function WebMapViewModel.prototype._createWebMap * @description 登陆窗口后添加地图图层。 */},{key:"_createWebMap",value:function(){var e=this;if(this.map&&(this.map.remove(),this.center=[],this.zoom=null,this._dataflowService&&this._dataflowService.off("messageSucceeded",this._handleDataflowFeaturesCallback)),!this.mapId||!this.serverUrl)return this.mapOptions.container=this.target,void setTimeout((function(){e.map=new l.default.Map(e.mapOptions),e.map.on("load",(function(){e.fire("addlayerssucceeded",{map:e.map,mapparams:{},layers:[]})}))}),0);this._legendList={},this._taskID=new Date;var t=this.serverUrl.split("");"/"!==t[t.length-1]&&(this.serverUrl+="/");var r=this.serverUrl+"web/maps/"+this.mapId+"/map";(this.accessToken||this.accessKey)&&(r+=(this.accessToken&&this.accessKey,"token="+this.accessToken));var n="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.serverUrl.indexOf(n)>-1){// 大屏需求,或者有加上代理的 var a=this.serverUrl.split(n);a.length>1&&(r=a[0]+n+this.serverUrl+"web/maps/"+this.mapId+"/map.json")}this._getMapInfo(r,this._taskID)} /** * @private * @function WebMapViewModel.prototype._createMap * @description 创建地图。 */},{key:"_createMap",value:function(e){// 获取字体样式 var t=[],r=e.layers;// 获取 label 图层字体类型 r&&r.length>0&&r.forEach((function(e){e.labelStyle&&t.push(e.labelStyle.fontFamily)}),this),t.push("'supermapol-icons'");var n,a=t.join(",");// zoom n=e.center&&[e.center.x,e.center.y];// center var i=e.level||0;i=0===i?0:i-1,n||(n=[0,0]),"EPSG:3857"===this.baseProjection&&(n=this._unproject(n)),n=new l.default.LngLat(n[0],n[1]),// 初始化 map this.map=new l.default.Map({container:this.target,center:this.center.length?this.center:n,zoom:this.zoom||i,style:{version:8,sources:{},// "glyphs": 'http://iclsvr.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf', layers:[]},// @ts-ignore -------- crs 为 enhance 新加属性 crs:this.baseProjection,localIdeographFontFamily:a||"",renderWorldCopies:!1,preserveDrawingBuffer:this.mapOptions.preserveDrawingBuffer||!1}), /** * @event WebMapViewModel#mapinitialized * @description Map 初始化成功。 * @property {mapboxglTypes.Map} map - MapBoxGL Map 对象。 */ this.fire("mapinitialized",{map:this.map})} /** * @private * @function WebMapViewModel.prototype._getMapInfo * @description 获取地图的 JSON 信息。 * @param {string} url - 请求地图的 url。 */},{key:"_getMapInfo",value:function(e,t){var r=this,n=-1===e.indexOf(".json")?"".concat(e,".json"):e;SuperMap.FetchRequest.get(n,null,{withCredentials:this.withCredentials}).then((function(e){return e.json()})).then((function(e){// 坐标系异常处理 if(r.baseProjection=e.projection,// 存储地图的名称以及描述等信息,返回给用户 r.mapParams={title:e.title,description:e.description},!l.default.CRS.get(r.baseProjection))throw Error("\u4e0d\u652f\u6301\u5f53\u524d\u5730\u56fe\u7684\u5750\u6807\u7cfb");r._createMap(e);var n=e.layers;r.map.on("load",(function(){e.baseLayer&&"MAPBOXSTYLE"===e.baseLayer.layerType?// 添加矢量瓦片服务作为底图 r._addMVTBaseMap(e):r._addBaseMap(e),n&&0!==n.length?r._addLayers(n,t):r._sendMapToUser(0,0)}))})).catch((function(e){ /** * @event WebMapViewModel#getmapinfofailed * @description 获取地图信息失败。 * @property {Object} error - 失败原因。 */ r.fire("getmapinfofailed",{error:e})}))}},{key:"_addMVTBaseMap",value:function(e){var t=e.baseLayer.dataSource.url;// @ts-ignore this.map.addStyle(t)} /** * @private * @function WebMapViewModel.prototype._addBaseMap * @description 添加底图。 * @param {Object} mapInfo - map 信息。 */},{key:"_addBaseMap",value:function(e){this._createBaseLayer(e)} /** * @private * @function WebMapViewModel.prototype._createBaseLayer * @description 创建底图。 * @param {Object} mapInfo - map 信息。 */},{key:"_createBaseLayer",value:function(e){var t=e.baseLayer||e,r=t.layerType;// 底图和rest地图兼容 (r.indexOf("TIANDITU_VEC")>-1||r.indexOf("TIANDITU_IMG")>-1||r.indexOf("TIANDITU_TER")>-1)&&(r=r.substr(0,12));var n;switch(r){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":this._createTiandituLayer(e);break;case"BING":this._createBingLayer(t.name);break;case"WMS":this._createWMSLayer(t);break;case"WMTS":this._createWMTSLayer(t);break;case"TILE":case"SUPERMAP_REST":this._createDynamicTiledLayer(t);break;case"CLOUD":case"CLOUD_BLACK":case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":n={CLOUD:"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:"http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"http://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i380072576!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0",GOOGLE_CN:"https://mt{0-3}.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"http://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"http://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"http://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"http://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"}[r],this._createXYZLayer(t,n)}} /** * @private * @function WebMapViewModel.prototype._createTiandituLayer * @description 创建天地图底图。 * @param {Object} mapInfo - map 信息。 */},{key:"_createTiandituLayer",value:function(e){var t=this._getTiandituUrl(e),r=e.baseLayer.layerType,n=Boolean(e.baseLayer.labelLayerVisible),a=t.labelUrl,i=t.tiandituUrl;this._addBaselayer(i,"tianditu-layers-"+r),n&&this._addBaselayer(a,"tianditu-label-layers-"+r)} /** * @private * @function WebMapViewModel.prototype._createWMTSLayer * @description 创建 WMTS 底图。 * @param {Object} layerInfo - 地图信息。 */},{key:"_createWMTSLayer",value:function(e){var t=this,r=this._getWMTSUrl(e);this._filterWMTSIsMatched(e,(function(n,a){n&&t._addBaselayer([r],"wmts-layers"+e.name,0,a)}))} /** * @private * @function WebMapViewModel.prototype._filterWMTSIsMatched * @description 过滤能够跟mapboxgl匹配的wmts服务。 * @param {Object} mapInfo - map 信息。 * @callback matchedCallback */},{key:"_filterWMTSIsMatched",value:function(e,t){var r=this,n=!1,a=22,i=e.url;SuperMap.FetchRequest.get(i,null,{withCredentials:!1,withoutFormatSuffix:!0}).then((function(e){return e.text()})).then((function(i){for(var o=h||window.convert,s=JSON.parse(o.xml2json(i,{compact:!0,spaces:4})).Capabilities.Contents.TileMatrixSet,u=0;u} 关系型文件一些参数 */},{key:"_checkUploadToRelationship",value:function(e){return SuperMap.FetchRequest.get("".concat(this.serverUrl,"web/datas/").concat(e,"/datasets.json"),null,{withCredentials:this.withCredentials}).then((function(e){return e.json()})).then((function(e){return e}))} /** * @private * @function ol.supermap.WebMap.prototype._getDataService * @description 获取上传的数据信息 * @param {String} fileId - 文件id * @param {String} datasetName 数据服务的数据集名称 * @returns {Promise} 数据的信息 */},{key:"_getDataService",value:function(e,t){return SuperMap.FetchRequest.get("".concat(this.serverUrl,"web/datas/").concat(e,".json"),null,{withCredentials:this.withCredentials}).then((function(e){return e.json()})).then((function(r){return r.fileId=e,r.datasetName=t,r}))} /** * @private * @function WebMapViewModel.prototype._getService * @description 获取当前数据发布的服务中的某种类型服务 * @param {Array} services 服务集合 * @param {String} type 服务类型,RESTDATA, RESTMAP * @returns {Object} 服务 */},{key:"_getService",value:function(e,t){return e.filter((function(e){return e&&e.serviceType===t}))[0]}},{key:"_getServiceInfoFromLayer",value:function(e,t,r,n,a,i,o){var s=this,u=o?!o.isMvt:"HOSTED_TILE"===r.layerType,l=!1;n.forEach((function(n,c){l||(//有服务了,就不需要循环 n&&u&&"RESTMAP"===n.serviceType?(l=!0,//地图服务,判断使用mvt还是tile s._getTileLayerInfo(n.address).then((function(e){e.forEach((function(e){var n=e.bounds;r.layerType="TILE",r.orginEpsgCode=s.baseProjection,r.units=e.coordUnit&&e.coordUnit.toLowerCase(),r.extent=[n.left,n.bottom,n.right,n.top],r.visibleScales=e.visibleScales,r.url=e.url,r.sourceType="TILE",s._createBaseLayer(r),s.layerAdded++,s._sendMapToUser(s.layerAdded,t)}))}))):n&&!u&&"RESTDATA"===n.serviceType&&(o&&o.isMvt?(s._addVectorLayer(o,r,i),s.layerAdded++,s._sendMapToUser(s.layerAdded,t)):(//数据服务 l=!0,//关系型文件发布的数据服务 s._getDatasources(n.address).then((function(i){r.dataSource.dataSourceName=i+":"+a,r.dataSource.url="".concat(n.address,"/data"),s._getFeatureBySQL(r.dataSource.url,[r.dataSource.dataSourceName||r.name],(function(n){var a=s._parseGeoJsonData2Feature({allDatas:{features:n.result.features.features},fileCode:r.projection,featureProjection:s.baseProjection});s._addLayer(r,a,e),s.layerAdded++,s._sendMapToUser(s.layerAdded,t)}),(function(e){s.layerAdded++,s._sendMapToUser(s.layerAdded,t),s.fire("getlayerdatasourcefailed",{error:e,layer:r,map:s.map})}))})))))}),this),l||(//循环完成了,也没有找到合适的服务。有可能服务被删除 this.layerAdded++,this._sendMapToUser(this.layerAdded,t),this.fire("getlayerdatasourcefailed",{error:null,layer:r,map:this.map}))} /** * @private * @function WebMapViewModel.prototype._getDatasources * @description 获取关系型文件发布的数据服务中数据源的名称 * @param {String} url - 获取数据源信息的url * @returns {Promise} 数据源名称 */},{key:"_getDatasources",value:function(e){return SuperMap.FetchRequest.get("".concat(e,"/data/datasources.json")).then((function(e){return e.json()})).then((function(e){return e.datasourceNames[0]}))} /** * @private * @function WebMapViewModel.prototype._getTileLayerInfo * @description 获取地图服务的信息 * @param {String} url 地图服务的url(没有地图名字) * @returns {Promise} 地图服务信息 */},{key:"_getTileLayerInfo",value:function(e){var t=this,r=this.serverUrl+"apps/viewer/getUrlResource.json?url=",n=r+encodeURIComponent(e),a=this.baseProjection.split("EPSG:")[1];return SuperMap.FetchRequest.get("".concat(n,"/maps.json"),null,{withCredentials:this.withCredentials}).then((function(e){return e.json()})).then((function(e){var n=[];return e&&e.forEach((function(e){var i=SuperMap.FetchRequest.get("".concat(r).concat(e.path,".json?prjCoordSys=").concat(JSON.stringify({epsgCode:a})),null,{withCredentials:t.withCredentials}).then((function(e){return e.json()})).then((function(t){return t.url=e.path,t}));n.push(i)})),Promise.all(n).then((function(e){return e}))}))} /** * @private * @function WebMapViewModel.prototype._addLayers * @description 添加叠加图层。 * @param {Object} mapInfo - 图层信息。 */},{key:"_addLayers",value:function(e,t){var r,n=this;// 存储地图上所有的图层对象 this._layers=e,this.layerAdded=0;var a=e.length;a>0&&e.forEach((function(e,i){if(e.dataSource&&e.dataSource.serverId||"MARKER"===e.layerType||"HOSTED_TILE"===e.layerType){//数据存储到iportal上了 var o=e.dataSource,s=o?o.serverId:e.serverId;if(!s)return n._addLayer(e,null,i),n.layerAdded++,void n._sendMapToUser(n.layerAdded,a);if("MARKER"===e.layerType||o&&(!o.accessType||"DIRECT"===o.accessType)){//原来二进制文件 var u="".concat(n.serverUrl,"web/datas/").concat(s,"/content.json?pageSize=9999999¤tPage=1");n.accessToken&&(u="".concat(u,"&").concat(n.accessKey,"=").concat(n.accessToken)),SuperMap.FetchRequest.get(u,null,{withCredentials:n.withCredentials}).then((function(e){return e.json()})).then((function(o){if(t===n._taskID)return!1===o.succeed?(//请求失败 n.layerAdded++,n._sendMapToUser(n.layerAdded,a),void// -----------------------todo----------------- n.fire("getlayerdatasourcefailed",{error:o.error,layer:e,map:n.map})):void(o&&o.type&&("JSON"===o.type||"GEOJSON"===o.type?(o.content=JSON.parse(o.content.trim()),r=n._formatGeoJSON(o.content)):"EXCEL"!==o.type&&"CSV"!==o.type||(r=n._excelData2Feature(o.content)),n._addLayer(e,r,i),n.layerAdded++,n._sendMapToUser(n.layerAdded,a)))})).catch((function(t){n.layerAdded++,n._sendMapToUser(n.layerAdded,a),n.fire("getlayerdatasourcefailed",{error:t,layer:e,map:n.map})}))}else{//关系型文件 var l="HOSTED_TILE"===e.layerType,c=o?o.serverId:e.serverId;n._checkUploadToRelationship(c).then((function(t){if(t&&t.length>0){var r=t[0].name,o=t[0].type.toUpperCase();n._getDataService(c,r).then((function(t){var s=t.dataItemServices;if(0===s.length)return n.layerAdded++,n._sendMapToUser(n.layerAdded,a),void n.fire("getlayerdatasourcefailed",{error:null,layer:e,map:n.map});if(l){var u=s.filter((function(e){return e&&"RESTDATA"===e.serviceType}))[0];n._isMvt(u.address,r).then((function(t){n._getServiceInfoFromLayer(i,a,e,s,r,o,t)})).catch((function(){//判断失败就走之前逻辑,>数据量用tile n._getServiceInfoFromLayer(i,a,e,s,r,o)}))}else n._getServiceInfoFromLayer(i,a,e,s,r,o)}))}else n.layerAdded++,n._sendMapToUser(n.layerAdded,a),n.fire("getlayerdatasourcefailed",{error:null,layer:e,map:n.map})})).catch((function(t){n.layerAdded++,n._sendMapToUser(n.layerAdded,a),n.fire("getlayerdatasourcefailed",{error:t,layer:e,map:n.map})}))}}else if("SUPERMAP_REST"===e.layerType||"TILE"===e.layerType||"WMS"===e.layerType||"WMTS"===e.layerType)n._createBaseLayer(e),n.layerAdded++,n._sendMapToUser(n.layerAdded,a);else if(e.dataSource&&"REST_DATA"===e.dataSource.type){//从restData获取数据 var d=e.dataSource;n._getFeatureBySQL(d.url,[d.dataSourseName||e.name],(function(t){r=n._parseGeoJsonData2Feature({allDatas:{features:t.result.features.features},fileCode:e.projection,featureProjection:n.baseProjection}),n._addLayer(e,r,i),n.layerAdded++,n._sendMapToUser(n.layerAdded,a)}),(function(t){n.layerAdded++,n._sendMapToUser(n.layerAdded,a),n.fire("getlayerdatasourcefailed",{error:t,layer:e,map:n.map})}))}else e.dataSource&&"REST_MAP"===e.dataSource.type&&e.dataSource.url?n._queryFeatureBySQL(e.dataSource.url,e.dataSource.layerName,(function(t){var r=t&&t.result.recordsets,o=r&&r[0],s=o.fields;if(o&&s){var u=[];for(var l in s){var c=s[l];0===c.indexOf("Sm")&&"SmID"!==c||u.push(c)}n._getFeatures(u,e,(function(t){n._addLayer(e,t,i),n.layerAdded++,n._sendMapToUser(n.layerAdded,a)}),(function(t){n.layerAdded++,n.fire("getlayerdatasourcefailed",{error:t,layer:e,map:n.map})}))}}),(function(t){n.fire("getlayerdatasourcefailed",{error:t,layer:e,map:n.map})}),"smid=1"):"DATAFLOW_POINT_TRACK"!==e.layerType&&"DATAFLOW_HEAT"!==e.layerType||n._getDataflowInfo(e,(function(){n._addLayer(e,null,i),n.layerAdded++,n._sendMapToUser(n.layerAdded,a)}),(function(e){n.layerAdded++;// TODO fire faild }))}),this)} /** * @private * @function WebMapViewModel.prototype._getFeatures */},{key:"_getFeatures",value:function(e,t,r,n){var a=this,i=t.dataSource,o=t.projection;this._queryFeatureBySQL(i.url,i.layerName,(function(e){var t=e.result.recordsets[0].features.features,n=a._parseGeoJsonData2Feature({allDatas:{features:t},fileCode:o,featureProjection:a.baseProjection});r(n)}),(function(e){n(e)}),null,e)} /** * @private * @function WebMapViewModel.prototype._addLayer * @description 将单个图层添加到地图上。 * @param layerInfo 某个图层的图层信息 * @param {Array.} features - feature。 */},{key:"_addLayer",value:function(e,t,r){var n=e.layerType;e.layerID=n+"-"+e.name+"-"+r,e.visible=e.visible?"visible":"none",// mbgl 目前不能处理 geojson 复杂面情况 // mbgl isssue https://github.com/mapbox/mapbox-gl-js/issues/7023 t&&t[0]&&"Polygon"===t[0].geometry.type&&(t=(0,d.handleMultyPolygon)(t)),e.style&&e.filterCondition&&"RANGE"!==n&&"UNIQUE"!==n&&"RANK_SYMBOL"!==n&&(t=this._getFiterFeatures(e.filterCondition,t)),t&&e.projection&&"EPSG:4326"!==e.projection&&this._transformFeatures(t),"VECTOR"===n?"POINT"===e.featureType?"SYMBOL_POINT"===e.style.type?this._createSymbolLayer(e,t):this._createGraphicLayer(e,t):// 线和面 this._createVectorLayer(e,t):"UNIQUE"===n?this._createUniqueLayer(e,t):"RANGE"===n?this._createRangeLayer(e,t):"HEAT"===n?this._createHeatLayer(e,t):"MARKER"===n?this._createMarkerLayer(e,t):"MIGRATION"===e.layerType?this._createMigrationLayer(e,t):"RANK_SYMBOL"===e.layerType?this._createRankSymbolLayer(e,t):"DATAFLOW_POINT_TRACK"!==e.layerType&&"DATAFLOW_HEAT"!==e.layerType||this._createDataflowLayer(e),e.labelStyle&&e.labelStyle.labelField&&"DATAFLOW_POINT_TRACK"!==e.layerType&&// 存在标签专题图 this._addLabelLayer(e,t)}},{key:"_createDataflowLayer",value:function(e){var t=new l.default.supermap.DataFlowService(e.wsUrl).initSubscribe();this._handleDataflowFeaturesCallback=this._handleDataflowFeatures.bind(this,e),t.on("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService=t}},{key:"_handleDataflowFeatures",value:function(e,t){var r=t.data&&JSON.parse(t.data);// this._transformFeatures([features]); // TODO 坐标系 if(this.fire("dataflowfeatureupdated",{features:r,identifyField:e.identifyField,layerID:e.layerID}),e.filterCondition){//过滤条件 var n="select * from json where ("+this._replaceFilterCharacter(e.filterCondition)+")",a=window.jsonsql.query(n,{attributes:r&&r.properties});a&&a.length>0&&this._addDataflowLayer(e,r)}else this._addDataflowLayer(e,r)}},{key:"_getDataFlowRotateStyle",value:function(e,t,r){var n=["match",["get",r]];return e.forEach((function(e){var a;if((a=void 0!==t&&"\u672a\u8bbe\u7f6e"!==t&&"None"!==t?e.properties[t]:0)>360||a<0)return null;// @ts-ignore n.push(e.properties[r],parseInt(a))})),// @ts-ignore n.push(0),n}},{key:"_addDataflowLayer",value:function(e,t){var r=e.layerID;if("DATAFLOW_HEAT"===e.layerType)this.map.getSource(r)?this._updateDataFlowFeature(r,t,e):this._createHeatLayer(e,[t]);else{var n=e.pointStyle;if(e.style=n,this.map.getSource(r))this._updateDataFlowFeature(r,t,e,"point");else{var a=this._getDataFlowRotateStyle(t?[t]:[],e.directionField,e.identifyField);["BASIC_POINT","SVG_POINT","IMAGE_POINT"].includes(n.type)?this._createGraphicLayer(e,[t],null,a):this._createSymbolLayer(e,[t],null,a)}if(e.labelStyle&&e.visible&&(this.map.getSource(r+"label")?this._updateDataFlowFeature(r+"label",t,e):this._addLabelLayer(e,[t])),e.lineStyle&&e.visible)if(this.map.getSource(r+"-line"))this._updateDataFlowFeature(r+"-line",t,e,"line");else{var i=t&&t.geometry.coordinates||[],o={type:"Feature",properties:t&&t.properties,geometry:{type:"LineString",coordinates:[i]}};this._createVectorLayer({style:e.lineStyle,featureType:"LINE",visible:"visible",layerID:r+"-line"},[o])}}}},{key:"_updateDataFlowFeature",value:function(e,t,r,n){var a=r.identifyField,i=r.maxPointCount,o=r.directionField,s=(0,w.default)(this.map.getSource(e)._data.features),u=!1;// @ts-ignore if(s.map((function(e,r){if(t&&e.properties[a]===t.properties[a])if(u=!0,"line"===n){var o=e.geometry.coordinates;o.push(t.geometry.coordinates),i&&o.length>i&&o.splice(0,o.length-i),s[r].geometry.coordinates=o}else s[r]=t})),u||("line"===n?s.push({type:"Feature",properties:t.properties,geometry:{type:"LineString",coordinates:[t.geometry.coordinates]}}):s.push(t)),// @ts-ignore this.map.getSource(e).setData({type:"FeatureCollection",features:s}),"point"===n){var l=r.pointStyle.type,c=this._getDataFlowRotateStyle(s,o,a);["SVG_POINT","IMAGE_POINT"].includes(l)?this.map.setLayoutProperty(e,"icon-rotate",c):"SYMBOL_POINT"===l&&this.map.setLayoutProperty(e,"text-rotate",c)}}},{key:"_getDataflowInfo",value:function(e,t,r){var n,a=e.url,i="".concat(a,".json");e.credential&&e.credential.token&&(n=e.credential.token,i+="?token=".concat(n)),SuperMap.FetchRequest.get(i).then((function(e){return e.json()})).then((function(n){n&&n.featureMetaData?(e.featureType=n.featureMetaData.featureType.toUpperCase(),e.dataSource={dataTypes:{}},n.featureMetaData.fieldInfos&&n.featureMetaData.fieldInfos.length>0&&n.featureMetaData.fieldInfos.forEach((function(t){var r=t.name.trim();"TEXT"===t.type?e.dataSource.dataTypes[r]="STRING":["DOUBLE","INT","FLOAT","LONG","SHORT"].includes(t.type)?e.dataSource.dataTypes[r]="NUMBER":e.dataSource.dataTypes[r]="UNKNOWN"})),e.wsUrl=n.urls[0].url,e.name=n.urls[0].url.split("iserver/services/")[1].split("/dataflow")[0],t())://失败也要到成功会调函数中,否则不会继续执行 r()})).catch((function(){r()}))}},{key:"_createMigrationLayer",value:function(e,t){window.echarts=y.default;var r=this._getFeatureProperties(t),n=this._createLinesData(e,r),a=this._createPointsData(n,e,r),i=this._createOptions(e,n,a),o=new m.default(this.map);o.chart.setOption(i),this.echartslayer.push(o)}},{key:"_createOptions",value:function(e,t,r){var n,a=this._createLineSeries(e,t);if(r&&r.length){var i=this._createPointSeries(e,r);n=a.concat(i)}else n=a.slice();return{GLMap:{roam:!0},// geo: { // map: 'GLMap', // label: { // emphasis: { // show: false // } // }, // roam: true, // itemStyle: { // normal: { // areaColor: '#323c48', // borderColor: '#404a59' // }, // emphasis: { // areaColor: '#2a333d' // } // } // }, series:n}}},{key:"_createPointSeries",value:function(e,t){var r=e.lineSetting,n=e.animationSetting,a=e.labelSetting,i=[{name:"point-series",coordinateSystem:"GLMap",zlevel:2,label:{normal:{show:a.show,position:"right",formatter:"{b}",color:a.color,fontFamily:a.fontFamily}},itemStyle:{normal:{color:r.color||a.color}},data:t}];return n.show?(// 开启动画 // @ts-ignore i[0].type="effectScatter",// @ts-ignore i[0].rippleEffect={brushType:"stroke"}):// 关闭动画 // @ts-ignore i[0].type="scatter",i}},{key:"_createLineSeries",value:function(e,t){var r=e.lineSetting,n=e.animationSetting,a=[// 轨迹线样式 {name:"line-series",coordinateSystem:"GLMap",type:"lines",zlevel:1,effect:{show:n.show,constantSpeed:n.constantSpeed,trailLength:0,symbol:n.symbol,symbolSize:n.symbolSize},lineStyle:{normal:{color:r.color,type:r.type,width:r.width,opacity:r.opacity,curveness:r.curveness}},data:t}];return t.length>=1e3&&(// @ts-ignore a[0].large=!0,// @ts-ignore a[0].largeThreshold=100,// @ts-ignore a[0].blendMode="lighter"),a}},{key:"_createLinesData",value:function(e,t){var r=[];if(t&&t.length){// 重新获取数据 var n,a,i=e.from,o=e.to;if("XY_FIELD"===i.type&&i.xField&&i.yField&&o.xField&&o.yField)t.forEach((function(e){var t=e[i.xField],s=e[i.yField],u=e[o.xField],l=e[o.yField];t&&s&&u&&l&&(n=[e[i.xField],e[i.yField]],a=[e[o.xField],e[o.yField]],r.push({coords:[n,a]}))}));else if("PLACE_FIELD"===i.type&&i.field&&o.field){var s=v.default.concat(g.default);t.forEach((function(e){var t=e[i.field],u=e[o.field];n=s.find((function(e){return l.default.supermap.Util.isMatchAdministrativeName(e.name,t)})),a=s.find((function(e){return l.default.supermap.Util.isMatchAdministrativeName(e.name,u)})),n&&a&&r.push({coords:[n.coord,a.coord]})}))}}return r}},{key:"_createPointsData",value:function(e,t,r){var n=[],a=t.labelSetting;// 标签隐藏则直接返回 if(!a.show||!e.length)return n;var i=[],o=[];return e.forEach((function(e,t){var n=e.coords,s=n[0],u=n[1],l=r[t][a.from],c=r[t][a.to];// 起始字段去重 !i.find((function(e){return e.value[0]===s[0]&&e.value[1]===s[1]}))&&i.push({name:l,value:s}),!o.find((function(e){return e.value[0]===u[0]&&e.value[1]===u[1]}))&&o.push({name:c,value:u})})),n=i.concat(o)}},{key:"_createRankSymbolLayer",value:function(e,t){var r=e.themeSetting.themeField,n=e.style,a=e.featureType,i=this._createRankStyleSource(e,t,e.featureType).styleGroups;t=this._getFiterFeatures(e.filterCondition,t);// 获取 expression var o=["match",["get","index"]];if(t.forEach((function(e){var t=parseFloat(e.properties[r]);if(i)for(var a=0;a} features - feature。 */},{key:"_addLabelLayer",value:function(e,t){var r=e.labelStyle;this.map.addLayer({id:e.layerID+"label",type:"symbol",source:{type:"geojson",data:{type:"FeatureCollection",features:t}},paint:{"text-color":r.fill,"text-halo-color":"rgba(255,255,255,0.8)","text-halo-width":parseFloat(r.fontSize)||12},layout:{"text-field":"{".concat(r.labelField,"}"),"text-size":parseFloat(r.fontSize)||12,"text-offset":r.offsetX?[r.offsetX/10||0,r.offsetY/10||0]:[0,-2.5],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],visibility:e.visible}})} /** * @private * @function WebMapViewModel.prototype._createSymbolLayer * @description 添加 symbol 图层。 * @param layerInfo 某个图层的图层信息。 * @param {Array.} features - feature。 */},{key:"_createSymbolLayer",value:function(e,t,r,n){document.getElementById("".concat(this.target)).classList.add("supermapol-icons-map");var a=e.style,i=e.style.unicode,o=String.fromCharCode(parseInt(i.replace(/^&#x/,""),16)),s=e.layerID;this.map.addSource(s,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:s,type:"symbol",source:s,paint:{"text-color":a.fillColor},layout:{"text-field":o,"text-size":r||a.fontSize&&parseFloat(a.fontSize)||12,"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"text-rotate":n||0,visibility:e.visible}}),// @ts-ignore this.map.getSource(s).setData({type:"FeatureCollection",features:t})} /** * @private * @function WebMapViewModel.prototype._createGraphicLayer * @description 创建 Graphic 图层。 * @param {Object} layerInfo - map 信息。 * @param {Array} features - 属性 信息。 */},{key:"_createGraphicLayer",value:function(e,t,r,n){var a=this,i=e.style,o=e.layerID,s={type:"geojson",data:{type:"FeatureCollection",features:t}};if("IMAGE_POINT"===i.type){var u=i.imageInfo;this.map.loadImage(u.url,(function(t,u){t&&console.log(t);var l=2*Number.parseFloat((i.radius/u.height).toFixed(2));a.map.addImage("imageIcon",u),a.map.addLayer({id:o,type:"symbol",source:s,layout:{"icon-image":"imageIcon","icon-size":r||l,visibility:e.visible,"icon-rotate":n||0}})}))}else if("SVG_POINT"===i.type){var l=i.url;this._svgDiv||(this._svgDiv=document.createElement("div"),document.body.appendChild(this._svgDiv)),this._getCanvasFromSVG(l,this._svgDiv,(function(t){var u=t.toDataURL("img/png");u&&a.map.loadImage(u,(function(u,l){u&&console.log(u);var c=Number.parseFloat((i.radius/t.width).toFixed(2));a.map.addImage("imageIcon",l),a.map.addLayer({id:o,type:"symbol",source:s,layout:{"icon-image":"imageIcon","icon-size":r||c,visibility:e.visible,"icon-rotate":n||0}})}))}))}else{var c={style:this._transformStyleToMapBoxGl(i,e.featureType),layout:{visibility:e.visible}};this._addOverlayToMap("POINT",s,o,c)}} /** * @private * @function WebMapViewModel.prototype._createUniqueLayer * @description 创建单值图层。 * @param layerInfo 某个图层的图层信息 * @param features 图层上的 feature */},{key:"_createUniqueLayer",value:function(e,t){var r=this._getUniqueStyleGroup(e,t);t=this._getFiterFeatures(e.filterCondition,t);var n=e.style,a=e.themeSetting.themeField;Object.keys(t[0].properties).forEach((function(e){e.toLocaleUpperCase()===a.toLocaleUpperCase()&&(a=e)}));var i=e.featureType,o=["match",["get","index"]],s=e.layerID;t.forEach((function(e){r.forEach((function(t){t.value===e.properties[a]&&o.push(e.properties.index,t.color)}))})),o.push("#ffffff"),// 图例相关 this._initLegendConfigInfo(e,r);var u=e.visible,l={style:this._transformStyleToMapBoxGl(n,i,o),layout:{visibility:u}},c={type:"geojson",data:{type:"FeatureCollection",features:t}};this._addOverlayToMap(i,c,s,l),"POLYGON"===i&&n.strokeColor&&this._addStrokeLineForPoly(n,c,s+"-strokeLine",u)} /** * @private * @function WebMapViewModel.prototype._getUniqueStyleGroup * @description 获取单值的目标字段与颜色的对应数组。 * @param layerInfo 某个图层的图层信息 * @param features 图层上的 feature */},{key:"_getUniqueStyleGroup",value:function(e,t){// 找出所有的单值 var r=e.featureType,n=e.style,a=e.themeSetting,i=a.themeField,o=a.colors;Object.keys(t[0].properties).forEach((function(e){e.toLocaleUpperCase()===i.toLocaleUpperCase()&&(i=e)}));var s=[],u=a.customSettings;for(var l in t){var c=t[l].properties[i],d=!1;for(var f in s)if(s[f]===c){d=!0;break}d||s.push(c)}// 获取一定量的颜色 var h=o;h=SuperMap.ColorsPickerUtil.getGradientColors(h,s.length);// 生成styleGroup var p=[];return s.forEach((function(e,t){var a=h[t];e in u&&(a=u[e]),"LINE"===r?n.strokeColor=a:n.fillColor=a,p.push({color:a,value:e})}),this),p} /** * @private * @function WebMapViewModel.prototype._getWMTSUrl * @description 根据传入的配置信息拼接wmts url。 * @param options 配置对象 */},{key:"_getWMTSUrl",value:function(e){var t={service:"WMTS",request:"GetTile",version:"1.0.0",style:"default",layer:e.layer,tilematrixSet:e.tileMatrixSet,format:"image/png"},r=e.url;return r+=this._getParamString(t,r)+"&tilematrix={z}&tilerow={y}&tilecol={x}"} /** * @private * @function WebMapViewModel.prototype._createMarkerLayer * @description 添加标记图层。 * @param {Array.} features - feature。 */},{key:"_createMarkerLayer",value:function(e,t){var r=this;t&&t.forEach((function(t){var n=t.geometry.type.toUpperCase(),a=t.dv_v5_markerStyle;"POINT"===n&&a.text&&(// 说明是文字的feature类型 n="TEXT");var i=r._setFeatureInfo(t);t.properties.useStyle=a,t.properties.featureInfo=i,"POINT"===n&&a.src&&-1===a.src.indexOf("http://")&&-1===a.src.indexOf("https://")&&(// 说明地址不完整 a.src=r.serverUrl+a.src);var o={type:"geojson",data:t},s=t.properties.index,u=n+"-"+s;// point-line-polygon-marker if(// image-marker "POINT"===n&&a.src&&a.src.indexOf("svg")<=-1&&r.map.loadImage(a.src,(function(t,n){t&&console.log(t),r.map.addImage(s+"",n),r.map.addLayer({id:u,type:"symbol",source:o,layout:{"icon-image":a.src,"icon-size":a.scale,visibility:e.visible}})})),// svg-marker "POINT"===n&&a.src&&a.src.indexOf("svg")>-1&&(r._svgDiv||(r._svgDiv=document.createElement("div"),document.body.appendChild(r._svgDiv)),r._getCanvasFromSVG(a.src,r._svgDiv,(function(t){var n=t.toDataURL("img/png");n&&r.map.loadImage(n,(function(t,n){t&&console.log(t),r.map.addImage(s+"",n),r.map.addLayer({id:u,type:"symbol",source:o,layout:{"icon-image":s+"","icon-size":a.scale,visibility:e.visible}}),console.log(r.map.getStyle())}))}))),!a.src){var l={layout:{}};"LINESTRING"===n&&a.lineCap&&(n="LINE",l.layout={"line-cap":a.lineCap});var c=e.visible;l.layout.visibility=c,// get style l.style=r._transformStyleToMapBoxGl(a,n),r._addOverlayToMap(n,o,u,l),// 若面有边框 "POLYGON"===n&&a.strokeColor&&r._addStrokeLineForPoly(a,o,u+"-strokeLine",c)}}),this)} /** * @private * @function WebMapViewModel.prototype._setFeatureInfo * @description 设置 feature 信息。 * @param {Array.} features - feature。 */},{key:"_setFeatureInfo",value:function(e){var t,r=e.dv_v5_markerInfo;if(!r||!r.dataViz_title)// featureInfo = this.getDefaultAttribute(); return r;// 有featureInfo信息就不需要再添加 t=r;var n=e.properties;for(var a in t)n[a]&&(t[a]=n[a],delete n[a]);return t} /** * @private * @function WebMapViewModel.prototype._createHeatLayer * @description 添加热力图。 * @param {Array.} features - feature。 */},{key:"_createHeatLayer",value:function(e,t){var r=e.themeSetting,n={gradient:r.colors.slice(),radius:parseInt(r.radius)},a=r.customSettings;for(var i in a)n.gradient[i]=a[i];// 权重字段恢复 r.weight&&this._changeWeight(t,r.weight);var o=["interpolate",["linear"],["heatmap-density"]],s=n.gradient.length,u=parseFloat((1/s).toFixed(2));n.gradient.forEach((function(e,t){o.push(t*u),0===t&&(e=l.default.supermap.Util.hexToRgba(e,0)),o.push(e)})),// 图例相关 this._initLegendConfigInfo(e,n.gradient);var c={"heatmap-color":o,"heatmap-radius":r.radius+15,"heatmap-intensity":{base:1,stops:[[0,.8],[22,1]]}};if(t[0].weight&&t.length>=4){var d=[];t.forEach((function(e){d.push(e.weight)}));var f=SuperMap.ArrayStatistic.getMax(d),h=SuperMap.ArrayStatistic.getMin(d);c["heatmap-weight"]=["interpolate",["linear"],["get","weight"],h,0,f,1]}this.map.addLayer({id:e.layerID,type:"heatmap",source:{type:"geojson",data:{type:"FeatureCollection",features:t}},paint:c})} /** * @private * @function WebMapViewModel.prototype._changeWeight * @description 改变当前权重字段 * @param {Array.} features - feature。 * @param {String} weightFeild - 权重字段 */},{key:"_changeWeight",value:function(e,t){this._fieldMaxValue={},this._getMaxValue(e,t);var r=this._fieldMaxValue[t];e.forEach((function(e){var n=e.properties[t];e.weight=n/r}))} /** * @private * @function WebMapViewModel.prototype._getMaxValue * @description 获取当前字段对应的最大值,用于计算权重。 * @param {Array.} features - feature。 * @param {String} weightFeild - 权重字段 */},{key:"_getMaxValue",value:function(e,t){var r,n=[],a=t;this._fieldMaxValue[a]||(e.forEach((function(e){// 收集当前权重字段对应的所有值 (r=e.properties)&&parseFloat(r[a])&&n.push(parseFloat(r[a]))})),this._fieldMaxValue[a]=SuperMap.ArrayStatistic.getArrayStatistic(n,"Maximum"))} /** * @private * @function WebMapViewModel.prototype._createRangeLayer * @description 添加分段专题图。 * @param {Array.} features - feature。 */},{key:"_createRangeLayer",value:function(e,t){var r=e.themeSetting.themeField,n=e.style,a=e.featureType,i=this._getRangeStyleGroup(e,t),o={type:"geojson",data:{type:"FeatureCollection",features:t=this._getFiterFeatures(e.filterCondition,t)}},s=["match",["get","index"]];t.forEach((function(e){var t=parseFloat(e.properties[r]);if(i)for(var n=0;n0&&// afterFilterFeatureIdx.push(i); n.push(i)}return n} /** * @private * @function WebMapViewModel.prototype._replaceFilterCharacter * @description 获取过滤字符串。 * @param {String} filterString - 过滤条件。 */},{key:"_replaceFilterCharacter",value:function(e){return e=e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")} /** * @private * @function WebMapViewModel.prototype._getRangeStyleGroup * @description 获取分段样式。 * @param {Array.} features - feature。 */},{key:"_getRangeStyleGroup",value:function(e,t){// 找出分段值 var r,n=e.featureType,a=e.style,i=[],o=e.themeSetting,s=o.customSettings,u=o.themeField,c=o.segmentCount;t.forEach((function(e){(r=e.properties||e.get("Properties"))?// 过滤掉非数值的数据 r[u]&&l.default.supermap.Util.isNumber(r[u])&&i.push(parseFloat(r[u])):e.get(u)&&l.default.supermap.Util.isNumber(e.get(u))&&e.get(u)&&i.push(parseFloat(e.get(u)))}),this);var d=SuperMap.ArrayStatistic.getArraySegments(i,o.segmentMethod,c);if(d){var f=c;r&&d[0]===d[r.length-1]&&(f=1,d.length=2);// 保留两位有效数 for(var h=0;h} layers - 地图上所有的图层对象。 */ this._sourceListModel=new c.default({map:this.map}),this._legendList)this._sourceListModel.addSourceStyle(r,this._legendList[r]);for(var n=this._layers.length-2;n>-1;n--){var a=this._layers[n].layerID,i=this._layers[n+1].layerID;this.map.moveLayer(a,i)}this.fire("addlayerssucceeded",{map:this.map,mapparams:this.mapParams,layers:this._layers})}} /** * @function WebMapViewModel.prototype._unproject * @private * @description 墨卡托转经纬度。 * @param {} point - 待转换的点。 */},{key:"_unproject",value:function(e){for(var t=180/Math.PI,r=6378137,n=Math.exp(-e[1]/r),a=Math.PI/2-2*Math.atan(n),i=0,o=.1;i<15&&Math.abs(o)>1e-7;i++)1,a+=o=Math.PI/2-2*Math.atan(1*n)-a;return[e[0]*t/r,a*t]} /** * @function WebMapViewModel.prototype._getParamString * @private * @param {Object} obj - 待添加的参数。 * @param {string} existingUrl - 待添加参数的 url。 * @param {Boolean} [uppercase] - 参数是否转换为大写。 */},{key:"_getParamString",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];for(var a in e)n.push((r?a.toUpperCase():a)+"="+e[a]);return(t&&-1!==t.indexOf("?")?"&":"?")+n.join("&")} /** * @private * @function WebMapViewModel.prototype._transformStyleToMapBoxGl * @description 根据图层类型将 layerInfo 中的 style 属性格式转换为 mapboxglTypes 中的 style 格式。 * @param {Object} style - layerInfo中的style属性 * @param {String} type - 图层类型 * @param {Array} [expression] - 存储颜色值得表达式 */},{key:"_transformStyleToMapBoxGl",value:function(e,t,r,n){var a={};"POINT"!==e.type&&"BASIC_POINT"!==e.type&&"POINT"!==t||"LINE"===t?["LINE","LINESTRING","MULTILINESTRING"].includes(t)?a={strokeWidth:"line-width",strokeColor:"line-color",strokeOpacity:"line-opacity"}:["REGION","POLYGON","MULTIPOLYGON"].includes(t)&&(a={fillColor:"fill-color",fillOpacity:"fill-opacity",strokeColor:"fill-outline-color"}):a={fillColor:"circle-color",strokeWidth:"circle-stroke-width",fillOpacity:"circle-opacity",radius:"circle-radius",strokeColor:"circle-stroke-color",strokeOpacity:"circle-stroke-opacity"};var i={};for(var o in e)a[o]&&(i[a[o]]=e[o]);return r&&(n?i[n]=r:i["circle-color"]?i["circle-color"]=r:i["line-color"]?i["line-color"]=r:i["fill-color"]=r),e.lineDash&&"solid"!==e.lineDash&&"LINE"===t&&(i["line-dasharray"]=this._dashStyle(e)),i} /** * @private * @function WebMapViewModel.prototype.._dashStyle * @description 符号样式。 * @param {Object} style - 样式参数。 * @param {number} widthFactor - 宽度系数。 */},{key:"_dashStyle",value:function(e){if(!e)return[];// var w = style.strokeWidth * widthFactor; var t=e.strokeDashstyle||e.lineDash;switch(t){case"solid":return[];case"dot":return[1,4];case"dash":return[4,4];case"dashdot":return[4,4,1,4];case"longdash":return[8,4];case"longdashdot":return[8,4,1,4];default:return t?SuperMap.Util.isArray(t)?t:(t=SuperMap.String.trim(t).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}} /** * @private * @description 将SVG转换成Canvas * @param svgUrl * @param divDom * @param callBack */},{key:"_getCanvasFromSVG",value:function(e,t,r){var n=this,a=document.createElement("canvas");// 一个图层对应一个canvas a.id="dataviz-canvas-"+l.default.supermap.Util.newGuid(8),a.style.display="none",t.appendChild(a);var i=window.canvg&&window.canvg.default?window.canvg.default:p.default;try{var o=a.getContext("2d");i.from(o,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:function(){return!1}}).then((function(e){e.start(),n.canvgsV.push(e),a.width>300||a.height>300||r(a)}))}catch(s){console.log(s)}}},{key:"_stopCanvg",value:function(){this.canvgsV.forEach((function(e){return e.stop()})),this.canvgsV=[]} /** * @private * @function WebMapViewModel.prototype._addOverlayToMap * @description 添加基础矢量图层到 MAP * @param {Object} style - mabgl style * @param {String} type - 图层类型 */},{key:"_addOverlayToMap",value:function(e,t,r,n){var a={POINT:"circle",LINE:"line",POLYGON:"fill"}[e];"circle"!==a&&"line"!==a&&"fill"!==a||this.map.addLayer({id:r,type:a,source:t,paint:n.style,layout:n.layout||{}})}},{key:"_addBaselayer",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:22,a={type:"raster",tiles:e,tileSize:256};this.map.addLayer({id:t,type:"raster",source:a,minzoom:r,maxzoom:n})} /** * @private * @function WebMapViewModel.prototype._addStrokeLineForPoly * @description 添加面的边框。 * @param {Object} style - mabgl style */},{key:"_addStrokeLineForPoly",value:function(e,t,r,n){var a={style:this._transformStyleToMapBoxGl(e,"LINE"),layout:{visibility:n}};this._addOverlayToMap("LINE",t,r,a)} /** * @private * @function WebMapViewModel.prototype._parseGeoJsonData2Feature * @description 将从restData地址上获取的json转换成feature(从iserver中获取的json转换成feature) * @param {object} metaData - json内容 */},{key:"_parseGeoJsonData2Feature",value:function(e){for(var t=e.allDatas.features,r=[],n=0,a=t.length;n 0"}),i=new SuperMap.GetFeaturesBySQLParameters({queryParameter:a,datasetNames:t,fromIndex:0,toIndex:-1,maxFeatures:-1,returnContent:!0});var o={eventListeners:{processCompleted:function(e){r&&r(e)},processFailed:function(e){n&&n(e)}}};new SuperMap.GetFeaturesBySQLService(e,o).processAsync(i)} /** * @private * @function WebMapViewModel.prototype._queryFeatureBySQL * @description 通过 sql 方式查询数据。 */},{key:"_queryFeatureBySQL",value:function(e,t,r,n,a,i,o,s,u,c){var d=new SuperMap.FilterParameter({name:t,attributeFilter:a});i&&(d.fields=i);var f={queryParams:[d]};c&&(f.queryOption=SuperMap.QueryOption.ATTRIBUTE),s&&(f.startRecord=s),u&&(f.expectCount=u),o&&(f.prjCoordSys={epsgCode:o});var h=new SuperMap.QueryBySQLParameters(f);new l.default.supermap.QueryService(e).queryBySQL(h,(function(e){"processCompleted"===e.type?r(e):n(e)}))}},{key:"_initLegendConfigInfo",value:function(e,t){this._legendList[e.layerID]||(this._legendList[e.layerID]={layerType:e.layerType,featureType:e.featureType,layerId:e.layerID,themeField:"HEAT"===e.layerType?e.themeSetting.weight:e.themeSetting.themeField,styleGroup:t})}},{key:"_getFeatureProperties",value:function(e){var t=[];return e&&e.length&&e.forEach((function(e){var r=e.properties;r&&t.push(r)})),t}},{key:"_addVectorLayer",value:function(e,t,r){var n=this._getDataVectorTileStyle(r),a=this._transformStyleToMapBoxGl(n,r),i=e.url+"/tileFeature.mvt",o=l.default.CRS.get(this.baseProjection).getOrigin();i+="?&returnAttributes=true&width=512&height=512&x={x}&y={y}&scale={scale}&origin={x:".concat(o[0],",y:").concat(o[1],"}"),this.map.addLayer({id:(0,b.default)(t.name+"-"),// @ts-ignore type:n.mbglType,source:{type:"vector",tiles:[i]},"source-layer":"".concat(e.datasetName,"@").concat(e.datasourceName),paint:a,layout:{visibility:t.visible?"visible":"none"}})}},{key:"_isMvt",value:function(e,t){var r=this;return this._getDatasetsInfo(e,t).then((function(e){//判断是否和底图坐标系一直 return e.epsgCode==r.baseProjection.split("EPSG:")[1]?SuperMap.FetchRequest.get("".concat(e.url,"/tilefeature.mvt")).then((function(e){return e.json()})).then((function(t){return e.isMvt=t.error&&400===t.error.code,e})).catch((function(){return e})):e}))}},{key:"_getDatasetsInfo",value:function(e,t){return this._getDatasources(e).then((function(r){//判断mvt服务是否可用 var n="".concat(e,"/data/datasources/").concat(r,"/datasets/").concat(t);return SuperMap.FetchRequest.get(n).then((function(e){return e.json()})).then((function(e){return{epsgCode:e.datasetInfo.prjCoordSys.epsgCode,bounds:e.datasetInfo.bounds,datasourceName:r,datasetName:t,url:n}}))}))}},{key:"_getDataVectorTileStyle",value:function(e){var t={radius:8,//圆点半径 fillColor:"#EE4D5A",//填充色 fillOpacity:.9,strokeColor:"#ffffff",//边框颜色 strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT",mbglType:"circle"};return["LINE","LINESTRING","MULTILINESTRING"].includes(e)?(t.strokeColor="#4CC8A3",t.strokeWidth=2,t.mbglType="line"):["REGION","POLYGON","MULTIPOLYGON"].includes(e)&&(t.fillColor="#826DBA",t.mbglType="fill"),t}},{key:"_transformFeatures",value:function(e){var t=this;e&&e.forEach((function(r,n){var a=r.geometry.type,i=r.geometry.coordinates;"LineString"===a?i.forEach((function(e,r){e=t._unproject(e),i[r]=e}),t):"Point"===a?(i=t._unproject(i),r.geometry.coordinates=i):"MultiPolygon"!==a&&"Polygon"!==a||i.forEach((function(e,r){var n="MultiPolygon"===a?e[0]:e;n.forEach((function(e,r){e=t._unproject(e),n[r]=e})),i[r]=e})),e[n]=r}),this)}}]),r}(l.default.Evented);t.default=M}, /***/4831: /***/function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAP_EVENT_NAMES=void 0;t.MAP_EVENT_NAMES=["onResize","onWebglcontextlost","onWebglcontextrestored","onRemove","onMovestart","onContextmenu","onDblclick","onClick","onTouchcancel","onTouchmove","onTouchend","onTouchstart","onDataloading","onMousemove","onMouseup","onMousedown","onSourcedataloading","onError","onData","onStyledata","onSourcedata","onMouseout","onStyledataloading","onMoveend","onMove","onRender","onZoom","onZoomstart","onZoomend","onBoxzoomstart","onBoxzoomcancel","onBoxzoomend","onRotate","onRotatestart","onRotateend","onDragend","onDrag","onDragstart","onPitch","onIdle"]}, /***/5558: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i=n(r(5671)),o=n(r(3144)),s=n(r(9340)),u=n(r(8557)),l=n(r(8808)),c=n(r(3899)),d=n(r(9635)),f=n(r(7006)),h=(0,l.default)(d.default,f.default)(a=function(e){(0,s.default)(r,e);var t=(0,u.default)(r);function r(){return(0,i.default)(this,r),t.apply(this,arguments)}return(0,o.default)(r,[{key:"loaded",value:function(e){var t=this.props,r=t.type,n=t.source,a=t.layerId,i=t.minzoom,o=t.maxzoom,s=t.filter,u=t.layout,l=t.paint,c=t.metadata;if(e.getLayer(a))console.error('There is already a layer with the id "'.concat(a,'"'));else if("string"!==typeof n||e.getSource(n))if("background"===r||n){var d={id:a,type:r};n&&(d.source=n),void 0!==i&&(d.minzoom=i),void 0!==o&&(d.maxzoom=o),s&&(d.filter=s),u&&(d.layout=u),l&&(d.paint=l),c&&(d.metadata=c),this.props["source-layer"]&&(d["source-layer"]=this.props["source-layer"]),e.addLayer(d)}else console.error("Source is required unless type is background");else console.error('Source "'.concat(n,'" is not loaded'))}},{key:"removed",value:function(){}},{key:"render",value:function(){return null}}]),r}(c.default.Component))||a;t.default=h}, /***/1193: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i,o=n(r(5671)),s=n(r(3144)),u=n(r(9340)),l=n(r(8557)),c=r(3899),d=n(r(2307)),f=n(r(9635)),h=n(r(3843)),p=n(r(7278)),y=n(r(2017)),m=n(r(6130)),v=n(r(970)),g=n(r(9041)),b=n(r(6889)),w=(0,f.default)((i=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"componentDidMount",value:function(){this._markersElement=[]}},{key:"componentDidUpdate",value:function(e){this.viewModel&&!(0,d.default)(e.features,this.props.features)&&(this._markersElement=[],this._getMarkerElement(),this.props.features&&this.viewModel.setFeatures(this.props.features,this._markersElement)),this.viewModel&&!(0,d.default)(e.type,this.props.type)&&(this._markersElement=[],this._getMarkerElement(),this.viewModel.setType(this._markersElement)),this.viewModel&&this.props.width&&e.width!==this.props.width&&this.marker&&this.marker.setMarkersWidth(this.props.width),this.viewModel&&this.props.height&&e.height!==this.props.height&&this.marker&&this.marker.setMarkersHeight&&this.marker.setMarkersHeight(this.props.height),this.viewModel&&this.props.textColor&&e.textColor!==this.props.textColor&&this.marker&&this.marker.setMarkersTextColor(this.props.textColor),this.viewModel&&this.props.textFontSize&&e.textFontSize!==this.props.textFontSize&&this.marker&&this.marker.setMarkersTextFontSize(this.props.textFontSize),this.viewModel&&this.props.colors&&this.props.colors.length&&this.props.colors.length>0&&!(0,d.default)(e.colors,this.props.colors)&&this.marker&&this.marker.setMarkersColors(this.props.colors),this.viewModel&&this.props.textField&&e.textField!==this.props.textField&&this.marker&&this.marker.setMarkersTextField(this.props.textField)}},{key:"componentWillUnmount",value:function(){this.viewModel&&this.viewModel.clearMarkerLayer()}},{key:"loaded",value:function(e){this.props.features&&this._getMarkerElement(),this.viewModel=new h.default(e,this.props.features,this._markersElement,this.props.fitBounds)}},{key:"_getMarkerElement",value:function(){this.setState({marker:null});var e=this.props,t=e.features,r=e.width,n=e.height,a=e.colors,i=e.textFontSize,o=e.textColor,s=e.textField,u=e.type;if(t&&"{}"!==JSON.stringify(t)&&t.features){switch(u){case"rotatingAperture":this.marker=new v.default(t,{width:r,colors:a,textField:s,textColor:o,textFontSize:i});break;case"haloRing":this.marker=new m.default(t,{width:r,colors:a,textField:s,textColor:o,textFontSize:i});break;case"breathingAperture":this.marker=new p.default(t,{width:r,colors:a,textField:s,textColor:o,textFontSize:i});break;case"diffusedAperture":this.marker=new y.default(t,{width:r,colors:a,textField:s,textColor:o,textFontSize:i});break;case"rotatingTextBorder":this.marker=new g.default(t,{width:r,height:n,colors:a,textField:s,textColor:o,textFontSize:i});break;case"fluorescence":this.marker=new b.default(t,{width:r,colors:a,textField:s,textColor:o,textFontSize:i})}this.marker&&(this._markersElement=this.marker.getMarkersElement())}else this.viewModel&&this.viewModel.clearMarkerLayer()}},{key:"render",value:function(){return null}}]),r}(c.Component),i.defaultProps={type:"breathingAperture",textFontSize:14},a=i))||a;t.default=w}, /***/3843: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(375)),l=n(r(3880)),c=n(r(9705)),d=n(r(5748)),f=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n,i){var o,s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if((0,a.default)(this,r),o=t.call(this),!e)throw new Error("map is requierd");return o.map=e,o.features=n,o.markers=[],o.markersElement=i,o.fitBounds=s,o.features&&o._initalizeMarkerLayer(),o}return(0,i.default)(r,[{key:"setType",value:function(e){this.markersElement=e,this._initalizeMarkerLayer()}},{key:"setFeatures",value:function(e,t){this.markersElement=t,this.features=e,this._initalizeMarkerLayer()}},{key:"_initalizeMarkerLayer",value:function(){this.features&&"{}"!==JSON.stringify(this.features)&&(this.clearMarkerLayer(),this._createMarker())}},{key:"_createMarker",value:function(){var e=this;if(this.features.features.forEach((function(t,r){var n=new u.default.Marker(e.markersElement[r]||e.markersElement[0]).setLngLat(t.geometry.coordinates).addTo(e.map);e.markers.push(n)}),this),this.fitBounds){// @ts-ignore var t=(0,c.default)((0,d.default)((0,l.default)(this.features),1.7));this.fitBounds&&this.map.fitBounds([[t[0],t[1]],[t[2],t[3]]],{maxZoom:17})}}},{key:"clearMarkerLayer",value:function(){this.markers.length>0&&this.markers.forEach((function(e){e&&e.remove()})),this.markers=[]}}]),r}(u.default.Evented);t.default=f}, /***/7278: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)(this,r),(n=t.call(this,e,i)).features&&n._createMarker(),n}return(0,i.default)(r,[{key:"setMarkersWidth",value:function(e){this.options.width=e;for(var t=document.getElementsByClassName("sm-component-animate-marker__pulse"),r=0;r0){for(var t=document.getElementsByClassName("sm-component-animate-marker__dot-point"),r=0;r0&&(n=e.options.colors),n&&(a.style.background=n[0]),r.appendChild(a),e._createMakerElement(3,"span",["sm-component-animate-marker__delay","sm-component-animate-marker__pulse"]).forEach((function(t){n&&(t.style.borderColor=n[0],t.style.boxShadow="0 0 12px ".concat(n[1],", 0 0 20px ").concat(n[1]," inset")),e._setBreathingApertureWidth(t.style),r.appendChild(t)}));var i=e._getTextContainer(t,"breathing-aperture-name");r.appendChild(i),e.markersElement.push(r)}),this)}},{key:"_setBreathingApertureWidth",value:function(e){var t=this.options.width;t&&(e.width=t+"px",e.height=t+"px",e.top=-t/2+"px",e.left=-t/2+"px",e.borderRadius=t/2+"px")}},{key:"_createMakerElement",value:function(e,t,r){for(var n=[],a=1;a1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)(this,r),(n=t.call(this,e,i)).features&&n._createMarker(),n}return(0,i.default)(r,[{key:"setMarkersWidth",value:function(e){this.options.width=e;for(var t=document.getElementsByClassName("sm-component-animate-marker--diffused-aperture"),r=0;r0)for(var t=document.getElementsByClassName("sm-component-animate-marker--diffused-aperture"),r=0;r0&&(r.style.setProperty("--background-color",e.options.colors[0]),r.style.setProperty("--box-shadow-color",e.options.colors[1]||e.options.colors[0])),e.markersElement.push(r)}),this)}}]),r}(n(r(9853)).default);t.default=u}, /***/6889: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)(this,r),(n=t.call(this,e,i)).features&&n._createMarker(),n}return(0,i.default)(r,[{key:"setMarkersWidth",value:function(e){this.options.width=e;for(var t=document.getElementsByClassName("sm-component-animate-marker--fluorescence"),r=0;r0)for(var t=document.getElementsByClassName("sm-component-animate-marker--fluorescence"),r=0;r0&&(e.setProperty("--box-shadow-color",this.options.colors[0]),e.setProperty("--light-color",this.options.colors[1]))}}]),r}(n(r(9853)).default);t.default=u}, /***/6130: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(9458)),l=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)(this,r),(n=t.call(this,e,i)).features&&n._createMarker(),n}return(0,i.default)(r,[{key:"setMarkersWidth",value:function(e){this.options.width=e;for(var t=document.getElementsByClassName("sm-component-animate-marker--halo-ring"),r=0;r0)for(var t=document.getElementsByClassName("sm-component-animate-marker--halo-ring"),r=0;r0&&(r.style.setProperty("--color-1",e._getColorWithOpacity((0,u.default)(e.options.colors[0],"rgba",!0),.3)),r.style.setProperty("--color-1-transparent",e._getColorWithOpacity((0,u.default)(e.options.colors[0],"rgba",!0),.1)),r.style.setProperty("--color-2",e._getColorWithOpacity((0,u.default)(e.options.colors[1],"rgba",!0),.3)),r.style.setProperty("--color-2-transparent",e._getColorWithOpacity((0,u.default)(e.options.colors[1],"rgba",!0),.1))),e.markersElement.push(r)}),this)}},{key:"_createMakerElement",value:function(e,t,r){for(var n=[],a=1;a1&&void 0!==arguments[1]?arguments[1]:{};(0,a.default)(this,e),this.markersElement=[],this.features=t,this.options=r}return(0,i.default)(e,[{key:"setFeatures",value:function(e){this.markersElement=[],this.features=e,this.features&&this._createMarker()}},{key:"getMarkersElement",value:function(){return this.markersElement}},{key:"setMarkersTextField",value:function(e){if(this.features&&"{}"!==JSON.stringify(this.features)){this.options.textField=e;for(var t=document.getElementsByClassName("sm-component-animate-marker__name"),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)(this,r),(n=t.call(this,e,i)).features&&n._createMarker(),n}return(0,i.default)(r,[{key:"setMarkersWidth",value:function(e){// TODO 待抛出 width 不能小于 40 if(this.options.width=e,this.options.width&&!(this.options.width<40))for(var t=document.getElementsByClassName("sm-component-animate-marker--rotating-aperture"),r=0;r0)for(var t=document.getElementsByClassName("sm-component-animate-marker--rotating-aperture"),r=0;r=40?e.options.width:50,n=document.createElement("div");n.className="sm-component-animate-marker--rotating-aperture",e._createMakerElement(3,"div",["sm-component-animate-marker__dots","sm-component-animate-marker__dots"]).forEach((function(t,a){var i;0===a&&(i=r-32),1===a&&(i=r-16),2===a&&(i=r),t.setAttribute("style",e._getDotsStyleObj(i)),n.appendChild(t)}));var a=e._getTextContainer(t,"rotating-aperture-name");n.appendChild(a),e.options.colors&&e.options.colors.length&&e.options.colors.length>0&&e.options.colors[0].indexOf("rgb")>-1&&(n.style.setProperty("--color",e.options.colors[0]),n.style.setProperty("--line-color",e._getColorWithOpacity(e.options.colors[0],.2)),n.style.setProperty("--light-color",e.options.colors[1])),n.style.setProperty("--container-width",r+"px"),e.markersElement.push(n)}),this)}},{key:"_createMakerElement",value:function(e,t,r){for(var n=[],a=1;a1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)(this,r),(n=t.call(this,e)).options=i,n.features&&n._createMarker(),n}return(0,i.default)(r,[{key:"setMarkersWidth",value:function(e){this.options.width=e,this._setMarkerContainerProperty({"--clip-width-1":e+e/10+"px","--clip-width-2":e+e/10-2+"px","--boder-width":e+"px","--text-left-position":-e/2+"px"})}},{key:"setMarkersHeight",value:function(e){this.options.height=e,this._setMarkerContainerProperty({"--clip-height-1":e+e/10+"px","--clip-height-2":e+e/10-2+"px","--boder-height":e+"px"})}},{key:"setMarkersTextField",value:function(e){if(this.features&&"{}"!==JSON.stringify(this.features)){this.options.textField=e;for(var t=document.getElementsByClassName("sm-component-animate-marker__text"),r=0;r0&&this._setMarkerContainerProperty({"--border-color":e[0],"--box-shadow-color":e[1]})}},{key:"_createMarker",value:function(){var e=this;this.features.features.forEach((function(t){var r=document.createElement("div");r.className="sm-component-animate-marker--text-boder";var n=document.createElement("div");n.className="sm-component-animate-marker__boder";var a,i=Object.keys(t.properties);(t.properties||0!==Object.keys(t.properties).length)&&(a=t.properties[e.options.textField]||t.properties[i[0]]);var o=document.createElement("span");o.className="sm-component-animate-marker__text",o.innerHTML=a||"",n.appendChild(o),e.options.colors&&e.options.colors.length&&e.options.colors.length>0&&(r.style.setProperty("--border-color",e.options.colors[0]),r.style.setProperty("--box-shadow-color",e.options.colors[1])),e.options.textColor&&r.style.setProperty("--text-color",e.options.textColor),e.options.textFontSize&&r.style.setProperty("--text-font-size",e.options.textFontSize+"px"),e.options.width&&(r.style.setProperty("--clip-width-1",e.options.width+e.options.width/10+"px"),r.style.setProperty("--clip-width-2",e.options.width+e.options.width/10-2+"px"),r.style.setProperty("--boder-width",e.options.width+"px"),r.style.setProperty("--text-left-position",-e.options.width/2+"px")),e.options.height&&(r.style.setProperty("--clip-height-1",e.options.height+e.options.width/10+"px"),r.style.setProperty("--clip-height-2",e.options.height+e.options.width/10-2+"px"),r.style.setProperty("--boder-height",e.options.height+"px")),(e.options.width||100)>(e.options.width||200)?r.style.setProperty("--animation-name","clipMe2"):r.style.setProperty("--animation-name","clipMe1"),r.appendChild(n),e.markersElement.push(r)}),this)}},{key:"_setMarkerContainerProperty",value:function(e){for(var t=this,r=document.getElementsByClassName("sm-component-animate-marker--text-boder"),n=function(){// @ts-ignore var n=r[a].style;Object.keys(e).forEach((function(t){n.setProperty(t,e[t])})),(t.options.height||100)>(t.options.width||200)?n.setProperty("--animation-name","clipMe2"):n.setProperty("--animation-name","clipMe1")},a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if((0,a.default)(this,r),(i=t.call(this)).options=o,!e)throw new Error("map is requierd");return i.map=e,i.data=n,i.layerId=o.layerId||"clusterLayer"+(new Date).getTime(),i.data&&i._initializeClusterLayer(),i}return(0,i.default)(r,[{key:"setData",value:function(e){e&&(this.data=e,this.layerId&&!this.map.getSource(this.layerId)?this._initializeClusterLayer():this.map.getSource(this.layerId).setData(e))}},{key:"setClusteredPointStyle",value:function(e){!e||this.layerId&&!this.map.getSource(this.layerId)||(this.options.clusteredPointStyle=e,this._setPaintProperty(e.paint,this.layerId),this._setLayoutProperty(e.layout,this.layerId))}},{key:"setUnclusteredPointStyle",value:function(e){var t="unclustered_point"+this.layerId;e&&this.map.getSource(t)&&(this.options.unclusteredPointStyle=e,this._setPaintProperty(e.paint,t),this._setLayoutProperty(e.layout,t))}},{key:"setClusteredPointTextLayout",value:function(e){var t="count_"+this.layerId;e&&this.map.getSource(t)&&(this.options.clusteredPointTextLayout=e,this._setLayoutProperty(e,t))}},{key:"_setPaintProperty",value:function(e,t){var r=this;Object.keys(e).forEach((function(n){r.map.setPaintProperty(t,n,e[n])}))}},{key:"_setLayoutProperty",value:function(e,t){var r=this;Object.keys(e).forEach((function(n){r.map.setLayoutProperty(t,n,e[n])}))}},{key:"_initializeClusterLayer",value:function(){var e=this;this.map.addSource(this.layerId,{type:"geojson",data:this.data,cluster:!0,clusterMaxZoom:this.options.maxZoom||14,clusterRadius:this.options.radius||50}),this.map.addLayer({id:this.layerId,type:"circle",source:this.layerId,filter:["has","point_count"],paint:this.options.clusteredPointStyle&&this.options.clusteredPointStyle.paint||{"circle-color":["step",["get","point_count"],"#51bbd6",100,"#f1f075",750,"#f28cb1"],"circle-radius":["step",["get","point_count"],20,100,30,750,40]}}),// 聚合点文本 layer this.map.addLayer({id:"count_"+this.layerId,type:"symbol",source:this.layerId,filter:["has","point_count"],layout:this.options.clusteredPointTextLayout||{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12}}),// 未聚合点 layer this.map.addLayer({id:"unclustered_point"+this.layerId,type:"circle",source:this.layerId,filter:["!",["has","point_count"]],paint:this.options.unclusteredPointStyle&&this.options.unclusteredPointStyle.paint||{"circle-color":"#11b4da","circle-radius":4,"circle-stroke-width":1,"circle-stroke-color":"#fff"}}), /** * @event addcusterlayersucceeded * @description 添加点聚合图层成功后触发。 * @property {Object} map - mapboxgl map 对象。 */ this.fire("addcusterlayersucceeded",{map:this.map}),this.map.on("click",this.layerId,(function(t){var r=e.map.queryRenderedFeatures(t.point,{layers:[e.layerId]}),n=r[0].properties.cluster_id;e.map.getSource(e.layerId).getClusterExpansionZoom(n,(function(t,n){t||e.map.easeTo({center:r[0].geometry.coordinates,zoom:n})}))})),this.map.on("mouseenter",this.layerId,(function(){e.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave",this.layerId,(function(){e.map.getCanvas().style.cursor=""}))}}]),r}(n(r(375)).default.Evented);t.default=u}, /***/2313: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i,o=n(r(8683)),s=n(r(5671)),u=n(r(3144)),l=n(r(9340)),c=n(r(8557)),d=n(r(8808)),f=n(r(3899)),h=n(r(9635)),p=n(r(7006)),y=n(r(9162)),m=r(2009),v=r(9752),g=(0,d.default)(h.default,p.default)((i=function(e){(0,l.default)(r,e);var t=(0,c.default)(r);function r(){return(0,s.default)(this,r),t.apply(this,arguments)}return(0,u.default)(r,[{key:"loaded",value:function(e){var t=JSON.parse(JSON.stringify(this.props));delete t.serviceUrl,this.viewModel=new y.default(e,this.props.serviceUrl,(0,o.default)({},t)),this.registerEvents()}},{key:"registerEvents",value:function(){var e=this;// @ts-ignore this.viewModel.on("subscribefailed",(function(t){// this.$message.error(this.$t('dataFlow.dataSubscriptionFailed')); /** * @event subscribeFailed * @desc 数据订阅失败后触发。 * @property {Object} e - 事件对象。 */ (0,v.isFunction)(e.props.onSubscribeFailed)&&e.props.onSubscribeFailed(t)})),// @ts-ignore this.viewModel.on("subscribesucceeded",(function(t){ /** * @event subscribeSucceeded * @desc 数据订阅失败后触发。 * @property {Object} e - 事件对象。 */ (0,v.isFunction)(e.props.onSubscribeSucceeded)&&e.props.onSubscribeSucceeded(t)})),// @ts-ignore this.viewModel.on("dataupdated",(function(t){ /** * @event dataUpdated * @desc 数据更新成功后触发。 * @property {GeoJSONObject} data - 更新的数据。 * @property {mapboxgl.Map} map - MapBoxGL Map 对象。 */ (0,v.isFunction)(e.props.onDataUpdated)&&e.props.onDataUpdated(t)}))}},{key:"render",value:function(){return null}}]),r}(f.default.Component),i.defaultProps={layerStyle:{line:new m.LineStyle,circle:new m.CircleStyle,fill:new m.FillStyle}},a=i))||a;t.default=g}, /***/9162: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(3465)),l=n(r(375));r(2395); /** * @class DataFlowLayerViewModel * @category ViewModel * @classdesc 数据流图层组件功能类。 * @param {mapboxgl.Map} map - mapboxgl map 对象。 * @param {String} serviceUrl - 数据流服务地址。 * @param {Object} [options] - 可选参数。 * @param {String} [options.layerId] - 图层 ID。 * @param {Object} [options.layerStyle] - 指定图层样式。 * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。 * @param {String} [options.excludeField] - 排除字段。 * @param {Object} [options.styleOptions] - style OPtion * @fires DataFlowLayerViewModel#subscribesucceeded * @fires DataFlowLayerViewModel#subscribefailed * @fires DataFlowLayerViewModel#dataUpdated */ var c=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n,i){var o;if((0,a.default)(this,r),o=t.call(this),!n)throw new Error("serviceUrl is requierd");if(!e)throw new Error("map is requierd");return o.options=i||{},o.map=e,o.serviceUrl=n,o.sourceID=i.layerId||"dataFlow"+(new Date).getTime(),o.layerStyle=i.layerStyle||{},o.options.registerToken&&SuperMap.SecurityManager.registerToken(o.serviceUrl,o.options.registerToken),o._initializeDataFlow(),o}return(0,i.default)(r,[{key:"setLayerStyle",value:function(e){this.layerStyle=e} /** * @function DataFlowLayerViewModel.prototype.setExcludeField * @description 设置唯一字段。 * @param {string} excludeField - 唯一字段。 */},{key:"setExcludeField",value:function(e){return this.dataService.setExcludeField(e),this.options.excludeField=e,this} /** * @function DataFlowLayerViewModel.prototype.setGeometry * @description 设置集合要素。 * @param {GeoJSONObject} geometry - 待设置的 GeoJSON 几何要素对象。 */},{key:"setGeometry",value:function(e){return this.dataService.setGeometry(e),this.options.geometry=e,this}},{key:"_initializeDataFlow",value:function(){var e=this,t=new l.default.supermap.DataFlowService(this.serviceUrl,{geometry:this.options.geometry,excludeField:this.options.excludeField}).initSubscribe();t.on("subscribeSocketConnected",(function(t){ /** * @event DataFlowLayerViewModel#subscribesucceeded * @description 数据订阅成功后触发。 * @property {Object} e - 事件对象。 */ e.fire("subscribesucceeded",t)})),t.on("subscribeSocketError",(function(t){ /** * @event DataFlowLayerViewModel#subscribefailed * @description 数据订阅失败后触发。 * @property {Object} e - 事件对象。 */ e.fire("subscribefailed",t)})),t.on("messageSucceeded",(function(t){e._addLayer(t)})),this.dataService=t}},{key:"_addLayer",value:function(e){if(e.featureResult){var t=e.featureResult,r=t.geometry.type,n=this.layerStyle;if(this.map.getSource(this.sourceID)){// update layer var a=(0,u.default)(this.map.getSource(this.sourceID)._data.features),i=!1;a.forEach((function(e,r){e.properties.id===t.properties.id&&(i=!0,a[r]=t)})),i||a.push(t),this.map.getSource(this.sourceID).setData({type:"FeatureCollection",features:a}), /** * @event DataFlowLayerViewModel#dataUpdated * @description 数据更新成功后触发。 * @property {GeoJSONObject} data - 更新的数据。 * @property {mapboxgl.Map} map - MapBoxGL Map 对象。 */ this.fire("dataupdated",{data:t,map:this.map})}else if(this.map.addSource(this.sourceID,{type:"geojson",data:{type:"FeatureCollection",features:[t]}}),"Point"===r){var o="circle",s={"circle-radius":6,"circle-color":"red"};n.symbol&&(o="symbol",s={}),this.map.addLayer({id:this.sourceID,type:o,source:this.sourceID,paint:n[o]&&n[o].paint||s,layout:n[o]&&n[o].layout||{}})}else"MultiPolygon"===r||"Polygon"===r?this.map.addLayer({id:this.sourceID,type:"fill",paint:n.fill&&n.fill.paint||{"fill-color":"red","fill-opacity":1},layout:n.fill&&n.fill.layout||{},source:this.sourceID}):"LineString"!==r&&"Line"!==r&&"MultiLineString"!==r||this.map.addLayer({id:this.sourceID,type:"line",paint:n.line&&n.line.paint||{"line-width":5,"line-color":"red","line-opacity":1},layout:n.line&&n.line.layout||{},source:this.sourceID})}}}]),r}(l.default.Evented);t.default=c}, /***/9183: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i=n(r(5671)),o=n(r(3144)),s=n(r(9340)),u=n(r(8557)),l=n(r(8808)),c=r(3899),d=n(r(9635)),f=n(r(7006)),h=n(r(5703)),p=["scatter-plot","path-layer","polygon-layer","arc-layer","hexagon-layer","screen-grid-layer"],y=(0,l.default)(d.default,f.default)(a=function(e){(0,s.default)(r,e);var t=(0,u.default)(r);function r(){return(0,i.default)(this,r),t.apply(this,arguments)}return(0,o.default)(r,[{key:"loaded",value:function(e){var t=this;p.findIndex((function(e){return e===t.props.layerType}))>-1&&(this.viewModel=new h.default(e,this.props))}},{key:"render",value:function(){return null}}]),r}(c.Component))||a;t.default=y}, /***/5703: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(375));r(2395),r(2371);var l=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n){var i;(0,a.default)(this,r),(i=t.call(this)).map=e;var o=n.layerType,s=n.options,u=n.layerId;return i.layerType=o,s.data=s.data||[],s.layerId=s.layerId||u,i.options=s,i._init(),i}return(0,i.default)(r,[{key:"_init",value:function(){this.layerType&&this.options&&this._addDeckglLayer()}},{key:"_addDeckglLayer",value:function(){var e=new u.default.supermap.DeckglLayer(this.layerType,this.options);this.map.addLayer(e)}}]),r}(u.default.Evented);t.default=l}, /***/1762: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i=n(r(5671)),o=n(r(3144)),s=n(r(9340)),u=n(r(8557)),l=n(r(8808)),c=n(r(3899)),d=n(r(9635)),f=n(r(7006)),h=n(r(3395)),p=(0,l.default)(d.default,f.default)(a=function(e){(0,s.default)(r,e);var t=(0,u.default)(r);function r(){return(0,i.default)(this,r),t.apply(this,arguments)}return(0,o.default)(r,[{key:"loaded",value:function(e){this.viewModel=new h.default(e,this.props.options)}},{key:"render",value:function(){return null}}]),r}(c.default.Component))||a;t.default=p}, /***/3395: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(550)),l=n(r(375)),c=n(r(3094)),d=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n){var i;if((0,a.default)(this,r),i=t.call(this),!n)throw new Error("echarts options is requierd");if(!e)throw new Error("map is requierd");return i.map=e,i.options=n,i._initializeEchartsLayer(),i}return(0,i.default)(r,[{key:"_initializeEchartsLayer",value:function(){window.echarts=u.default;var e=new c.default(this.map);e.chart.setOption(this.options), /** * @event echartslayeraddsucceeded * @property {Object} layer - Echarts Layer. */ this.fire("echartslayeraddsucceeded",{layer:e}),this.echartslayer=e}}]),r}(l.default.Evented);t.default=d}, /***/4799: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i,o=n(r(5671)),s=n(r(3144)),u=n(r(9340)),l=n(r(8557)),c=n(r(8808)),d=n(r(3899)),f=n(r(2307)),h=n(r(9635)),p=n(r(7006)),y=n(r(5382)),m=(0,c.default)(h.default,p.default)((i=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.features,n=t.modelScale;this.viewModel&&((0,f.default)(e.features,r)||this.viewModel.setFeatures(r),e.modelScale!==n&&this.viewModel.setModelScale(n))}},{key:"loaded",value:function(e){this.viewModel=new y.default(e,this.props.features,this.props.modelScale,this.props.layerId)}},{key:"render",value:function(){return null}}]),r}(d.default.Component),i.defaultProps={modelScale:541843220338983e-20},a=i))||a;t.default=m}, /***/5382: /***/function(e,t,r){"use strict";var n=r(5263).default,a=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(r(2982)),o=a(r(5671)),s=a(r(3144)),u=a(r(9340)),l=a(r(8557)),c=n(r(2069)),d=a(r(375)),f=a(r(2769)),h=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(e,n){var a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:541843220338983e-20,s=arguments.length>3?arguments[3]:void 0;if((0,o.default)(this,r),a=t.call(this),!e)throw new Error("map is requierd");return a.map=e,a.layerId=s,a.features=n,a.modelScale=i,a.features&&a._addFireLayer(),a}return(0,s.default)(r,[{key:"setFeatures",value:function(e){this.features=e,this._addFireLayer()}},{key:"setModelScale",value:function(e){this.modelScale=e,this._addFireLayer()}},{key:"_addFireLayer",value:function(){var e=this;if("Point"!==this.features.features[0].geometry.type)throw new Error("Feature's type must be point");if(this.features.features.length>50)throw new Error("The maximum number of features is 50");this.features.features.forEach((function(t,r){var n=t.geometry;"Point"===n.type&&e._initializeFireLayer(n.coordinates,r)}))}},{key:"_initializeFireLayer",value:function(e,t){var r=this,n=this._getModelTransform(e),a=this.layerId&&this.layerId+"-"+t||"threeLayerFire-".concat(new Date);this.map.getLayer(a)&&this.map.removeLayer(a);var i={id:a,type:"custom",renderingMode:"3d",onAdd:function(e,t){r.camera=new c.PerspectiveCamera(45,e.getCanvas().width/e.getCanvas().height,.1,2e3),r.scene=new c.Scene,r.renderer=new c.WebGLRenderer({canvas:e.getCanvas(),context:t,antialias:!0}),r.renderer.autoClear=!1;var n=new c.Group;n.add(r.camera),r.scene.add(n),r._fire(),r.scene.add(r._object);var a=new c.PointLight(16777215,1,100);a.position.set(10,10,20),r.scene.add(a),r.map=e},render:function(e,t){var a=(new c.Matrix4).makeRotationAxis(new c.Vector3(1,0,0),n.rotateX),i=(new c.Matrix4).makeRotationAxis(new c.Vector3(0,1,0),n.rotateY),o=(new c.Matrix4).makeRotationAxis(new c.Vector3(0,0,1),n.rotateZ),s=(new c.Matrix4).fromArray(t),u=(new c.Matrix4).makeTranslation(n.translateX,n.translateY,n.translateZ).scale(new c.Vector3(n.scale,-n.scale,n.scale)).multiply(a).multiply(i).multiply(o);r.camera.projectionMatrix.elements=t,r.camera.projectionMatrix=s.multiply(u),r.renderer.state.reset(),r._update(),r.renderer.render(r.scene,r.camera),// @ts-ignore r.map.triggerRepaint()}};// @ts-ignore TODO mapbox-gl types 未更新 this.map.addLayer(i)}},{key:"_getModelTransform",value:function(e){var t=e,r=[Math.PI/2,0,0];return{translateX:d.default.MercatorCoordinate.fromLngLat(t,0).x,translateY:d.default.MercatorCoordinate.fromLngLat(t,0).y,translateZ:d.default.MercatorCoordinate.fromLngLat(t,0).z,rotateX:r[0],rotateY:r[1],rotateZ:r[2],scale:this.modelScale}}},{key:"_fire",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2;this._object=new c.Group,this._fireballs=[],this._height=r,this._radius=n;var a=(new c.TextureLoader).load(f.default,(function(){console.log("loaded")}),void 0,(function(e){console.log("error",e)}));// @ts-ignore a.crossOrigin="",// "anonymous"; this._fireMaterial=new c.ShaderMaterial({uniforms:{time:{value:1},blend:{value:1},blendPattern:{type:"t",value:a}},vertexShader:"precision mediump float;\n precision mediump int;\n attribute vec4 color;\n varying vec2 vUv;\n varying float vFade;\n void main()\t{\n vUv = uv;\n vec4 localPosition = vec4( position, 1);\n vFade = clamp((localPosition.y + 3.0) / 6.0, 0.0, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * localPosition;\n }",fragmentShader:"precision mediump float;\n precision mediump int;\n uniform float time;\n uniform float blend;\n uniform sampler2D blendPattern;\n varying float vFade;\n varying vec2 vUv;\n\n\n void main()\t{\n\n vec4 startColor = vec4(1., 0.5, 0.1, 1.0);\n vec4 endColor = vec4(0.2, 0.2, 0.2, 1.0);\n\n float dissolve = texture2D(blendPattern, vUv).r * 0.5;\n\n float spread = 0.4;\n\n float fadeAmount = smoothstep(\n max(0.0, vFade - spread),\n min(1.0, vFade + spread),\n blend + dissolve\n );\n\n vec4 color = mix(\n startColor, endColor,\n smoothstep(0.1,1., fadeAmount)\n );\n\n gl_FragColor = vec4(color.rgb, 1.-fadeAmount);\n }",transparent:!0,side:c.DoubleSide,blending:c.AdditiveBlending}),this._light=new c.PointLight(16733440,1,100),this._light.position.set(0,.4,0),this._lightIntensity=5*Math.random(),this._object.add(this._light);// this._fireMaterial = new THREE.MeshStandardMaterial(0x661100); for(var o=0;oe._height&&(t.position.y=.1*Math.random(),t.position.x=(.5-Math.random())*e._radius,t.position.z=(.5-Math.random())*e._radius);var r=.1+t.position.y/e._height;t.rotateX(.01*(1.2-r)),t.rotateZ(.01*(1.2-r)),t.rotateY(.01*(1.2-r)),t.scale.set(r,r,r),/// ball.opacity = p; t.material.uniforms.blend.value=r})),this._light.intensity+=.006*(this._lightIntensity-this._light.intensity),Math.random()>.8&&(this._lightIntensity=5*Math.random())}}]),r}(d.default.Evented);t.default=h}, /***/9704: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i=n(r(5671)),o=n(r(3144)),s=n(r(9340)),u=n(r(8557)),l=n(r(8808)),c=r(3899),d=n(r(8428)),f=n(r(2307)),h=n(r(9635)),p=n(r(7006)),y=(0,l.default)(h.default,p.default)(a=function(e){(0,s.default)(r,e);var t=(0,u.default)(r);function r(){return(0,i.default)(this,r),t.apply(this,arguments)}return(0,o.default)(r,[{key:"componentDidUpdate",value:function(e){!(0,f.default)(this.props.layerStyle,e.layerStyle)&&this.viewModel&&this.viewModel.setLayerStyle(this.props.layerStyle),!(0,f.default)(this.props.data,e.data)&&this.viewModel&&this.viewModel.setData(this.props.data)}},{key:"loaded",value:function(e){this.viewModel=new d.default(e,this.props)}},{key:"render",value:function(){return null}}]),r}(c.Component))||a;t.default=y}, /***/8428: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n){var i;if((0,a.default)(this,r),i=t.call(this),!e)throw new Error("map is requierd");i.map=e;var o=n.layerStyle,s=n.data,u=n.layerId;return i.data=s,i.layerStyle=o,i.layerId=u,i.data&&i._addLayer(),i}return(0,i.default)(r,[{key:"setData",value:function(e){e&&this.map.getSource(this.layerId)&&(this.data=e,this.layerId&&!this.map.getSource(this.layerId)?this._addLayer():this.map.getSource(this.layerId).setData(e))}},{key:"setLayerStyle",value:function(e){if(e&&this.map.getSource(this.layerId)){for(var t=e.paint,r=e.layout,n=0,a=Object.keys(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e).join(" ").match(/circle-|line-|fill-extrusion-|fill-+/i),r=t?t[0]:"";return r.substr(0,r.length-1)}}]),r}(n(r(375)).default.Evented);t.default=u}, /***/910: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i,o=n(r(5671)),s=n(r(3144)),u=n(r(9340)),l=n(r(8557)),c=n(r(8808)),d=n(r(3899)),f=n(r(2307)),h=n(r(9635)),p=n(r(7006)),y=r(9752),m=n(r(1043)),v=(0,c.default)(h.default,p.default)((i=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"componentDidUpdate",value:function(e){var t=this.props.data;!(0,f.default)(e.data,t)&&this.viewModel&&this.viewModel.setData(t)}},{key:"loaded",value:function(e){var t=this.props.onLoad;this.viewModel=new m.default(e,this.props),(0,y.isFunction)(t)&&t(this.viewModel.themeLayer,e)}},{key:"render",value:function(){return null}}]),r}(d.default.Component),i.defaultProps={options:{},chartsType:"Bar"},a=i))||a;t.default=v}, /***/1043: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=n(r(375));r(2395);var l=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n){var i;(0,a.default)(this,r),(i=t.call(this)).map=e;var o=n.layerName,s=n.options,u=n.chartsType,l=n.layerId,c=n.data;return i.layerName=o||l,i.chartsType=u||"Bar",s.id=s.id||l,i.options=s,i.data=c||{},i._init(),i}return(0,i.default)(r,[{key:"_init",value:function(){this.themeLayer=new u.default.supermap.GraphThemeLayer(this.layerName,this.chartsType,this.options),this.map.addLayer(this.themeLayer),"{}"!==JSON.stringify(this.data)&&this.setData(this.data)}},{key:"setData",value:function(e){this.themeLayer.addFeatures(e)}}]),r}(u.default.Evented);t.default=l}, /***/6073: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,i,o=n(r(5671)),s=n(r(3144)),u=n(r(9340)),l=n(r(8557)),c=n(r(8808)),d=n(r(3899)),f=n(r(2307)),h=n(r(9635)),p=n(r(7006)),y=n(r(9354)),m=n(r(9623)),v=(0,c.default)(h.default,p.default)((i=function(e){(0,u.default)(r,e);var t=(0,l.default)(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"componentDidUpdate",value:function(e){e.layerStyle!==this.props.layerStyle&&this.viewModel&&this.viewModel.setLayerStyle(this.props.layerStyle),!(0,f.default)(this.props.data,e.data)&&this.viewModel&&this.viewModel.setData(this.props.data)}},{key:"loaded",value:function(e){var t=this.props,r=t.data,n=t.layerId,a=t.layerStyle;this.viewModel=new y.default(e,r,{layerId:n,layerStyle:a})}},{key:"render",value:function(){return null}}]),r}(d.default.Component),i.defaultProps={layerStyle:new m.default},a=i))||a;t.default=v}, /***/9354: /***/function(e,t,r){"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(r(5671)),i=n(r(3144)),o=n(r(9340)),s=n(r(8557)),u=function(e){(0,o.default)(r,e);var t=(0,s.default)(r);function r(e,n,i){var o;if((0,a.default)(this,r),o=t.call(this),!e)throw new Error("map is requierd");i=i||{},o.map=e,o.data=n,o.layerId=i.layerId||"heatmap"+(new Date).getTime();var s=i.layerStyle;return o.paint=s&&s.paint,o.layout=s&&s.layout,o._initializeHeatMapLayer(),o}return(0,i.default)(r,[{key:"setData",value:function(e){e&&this.map.getSource(this.layerId)&&(this.data=e,this.layerId&&!this.map.getSource(this.layerId)?this._initializeHeatMapLayer():this.map.getSource(this.layerId).setData(e))}},{key:"setLayerStyle",value:function(e){if(e&&this.map.getSource(this.layerId)){for(var t=e.paint,r=e.layout,n=0,a=Object.keys(t);n0&&o.length>a&&!o.warned){o.warned=!0; // No error code for this since it is a Warning // eslint-disable-next-line no-restricted-syntax var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,l=c,console&&console.warn&&console.warn(l)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=c.bind(n);return a.listener=r,n.wrapFn=a,a}function f(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"===typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error) // Note: The comments on the `throw` lines are intentional, they show // up in Node's output if this results in an unhandled exception. throw o;// Unhandled 'error' event // At least give some kind of context to the user var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s;// Unhandled 'error' event }var u=i[e];if(void 0===u)return!1;if("function"===typeof u)n(u,this,t);else{var l=u.length,c=p(u,l);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}, /***/8679: /***/function(e,t,r){"use strict";var n=r(7109),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={}; /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */function u(e){ // React v16.11 and below return n.isMemo(e)?o:s[e.$$typeof]||a;// React v16.12 and above }s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){ // don't hoist over string (html) components if(p){var a=h(r);a&&a!==p&&e(t,a,n)}var o=c(r);d&&(o=o.concat(d(r)));for(var s=u(t),y=u(r),m=0;m * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var n=1/0,a="[object Symbol]",i="\\ud800-\\udfff",o="\\u0300-\\u036f\\ufe20-\\ufe23",s="\\u20d0-\\u20f0",u="\\ufe0e\\ufe0f",l="["+i+"]",c="["+o+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="[^"+i+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",m="(?:"+c+"|"+d+")"+"?",v="["+u+"]?",g=v+m+("(?:"+y+"(?:"+[f,h,p].join("|")+")"+v+m+")*"),b="(?:"+[f+c+"?",c,h,p,l].join("|")+")",w=RegExp(d+"(?="+d+")|"+b+g,"g"),S=RegExp("["+y+i+o+s+u+"]"),L="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E="object"==typeof self&&self&&self.Object===Object&&self,M=L||E||Function("return this")(); /** `Object#toString` result references. */ /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function k(e){return S.test(e)} /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */function x(e){return k(e)? /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function(e){return e.match(w)||[]} /** Used for built-in method references. */(e): /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function(e){return e.split("")}(e)}var T=Object.prototype.toString,F=M.Symbol,P=F?F.prototype:void 0,C=P?P.toString:void 0; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function N(e){ // Exit early for strings to avoid a performance hit in some environments. if("string"==typeof e)return e;if( /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function(e){return"symbol"==typeof e|| /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function(e){return!!e&&"object"==typeof e}(e)&&T.call(e)==a} /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t} /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */function W(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e: /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n 'Fred' */ /** * Converts the first character of `string` to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.upperFirst('fred'); * // => 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var I,O=(I="toUpperCase",function(e){var t=k(e=j(e))?x(e):void 0,r=t?t[0]:e.charAt(0),n=t?W(t,1).join(""):e.slice(1);return r[I]()+n});e.exports=function(e){return O(j(e).toLowerCase())}}, /***/3465: /***/function(e,t,r){ /* module decorator */e=r.nmd(e); /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the size to enable large array optimizations. */ var n="__lodash_hash_undefined__",a=9007199254740991,i="[object Arguments]",o="[object Boolean]",s="[object Date]",u="[object Function]",l="[object GeneratorFunction]",c="[object Map]",d="[object Number]",f="[object Object]",h="[object Promise]",p="[object RegExp]",y="[object Set]",m="[object String]",v="[object Symbol]",g="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",S="[object Float32Array]",L="[object Float64Array]",E="[object Int8Array]",M="[object Int16Array]",k="[object Int32Array]",x="[object Uint8Array]",T="[object Uint8ClampedArray]",F="[object Uint16Array]",P="[object Uint32Array]",C=/\w*$/,N=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,j={}; /** Used to stand-in for `undefined` hash values. */j[i]=j["[object Array]"]=j[b]=j[w]=j[o]=j[s]=j[S]=j[L]=j[E]=j[M]=j[k]=j[c]=j[d]=j[f]=j[p]=j[y]=j[m]=j[v]=j[x]=j[T]=j[F]=j[P]=!0,j["[object Error]"]=j[u]=j[g]=!1; /** Detect free variable `global` from Node.js. */ var I="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,O="object"==typeof self&&self&&self.Object===Object&&self,D=I||O||Function("return this")(),R=t&&!t.nodeType&&t,V=R&&e&&!e.nodeType&&e,U=V&&V.exports===R; /** Detect free variable `self`. */ /** * Adds the key-value `pair` to `map`. * * @private * @param {Object} map The map to modify. * @param {Array} pair The key-value pair to add. * @returns {Object} Returns `map`. */ function A(e,t){ // Don't return `map.set` because it's not chainable in IE 11. return e.set(t[0],t[1]),e} /** * Adds `value` to `set`. * * @private * @param {Object} set The set to modify. * @param {*} value The value to add. * @returns {Object} Returns `set`. */function q(e,t){ // Don't return `set.add` because it's not chainable in IE 11. return e.add(t),e} /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function K(e,t,r,n){var a=-1,i=e?e.length:0;for(n&&i&&(r=e[++a]);++a true * * _.isArguments([1, 2, 3]); * // => false */ function(e){ // Safari 8.1 makes `arguments.callee` enumerable in strict mode. /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ return function(e){ /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ return function(e){return!!e&&"object"==typeof e} /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */(e)&&ze(e)} /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */(e)&&$.call(e,"callee")&&(!se.call(e,"callee")||ee.call(e)==i)} /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */(e)?function(e,t){for(var r=-1,n=Array(e);++r-1} /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */,xe.prototype.set=function(e,t){var r=this.__data__,n=Ne(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}, // Add methods to `MapCache`. Te.prototype.clear=function(){this.__data__={hash:new ke,map:new(he||xe),string:new ke}} /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,Te.prototype.delete=function(e){return De(this,e).delete(e)} /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,Te.prototype.get=function(e){return De(this,e).get(e)} /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,Te.prototype.has=function(e){return De(this,e).has(e)} /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */,Te.prototype.set=function(e,t){return De(this,e).set(e,t),this}, // Add methods to `Stack`. Fe.prototype.clear=function(){this.__data__=new xe} /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,Fe.prototype.delete=function(e){return this.__data__.delete(e)} /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,Fe.prototype.get=function(e){return this.__data__.get(e)} /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,Fe.prototype.has=function(e){return this.__data__.has(e)} /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */,Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xe){var n=r.__data__;if(!he||n.length<199)return n.push([e,t]),this;r=this.__data__=new Te(n)}return r.set(e,t),this};var Ve=le?z(le,Object): /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function(){return[]} /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */,Ue=function(e){return ee.call(e)}; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */function Ae(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||W.test(e))&&e>-1&&e%1==0&&e false */ /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function Xe(e,t){return e===t||e!==e&&t!==t} // Fallback for data views, maps, sets, and weak maps in IE 11, // for data views in Edge < 14, and promises in Node.js. (fe&&Ue(new fe(new ArrayBuffer(1)))!=w||he&&Ue(new he)!=c||pe&&Ue(pe.resolve())!=h||ye&&Ue(new ye)!=y||me&&Ue(new me)!=g)&&(Ue=function(e){var t=ee.call(e),r=t==f?e.constructor:void 0,n=r?Ke(r):void 0;if(n)switch(n){case ge:return w;case be:return c;case we:return h;case Se:return y;case Le:return g}return t});var Ze=Array.isArray; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */function ze(e){return null!=e&& /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a} /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */(e.length)&&!Be(e)}var Ye=ce||function(){return!1}; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */function Be(e){ // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var t=Ge(e)?ee.call(e):"";return t==u||t==l}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Je(e){return ze(e)?Pe(e):function(e){if(!qe(e))return de(e);var t=[];for(var r in Object(e))$.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return We(e,!0,!0)}}, /***/1296: /***/function(e,t,r){ /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the `TypeError` message for "Functions" methods. */ var n=NaN,a="[object Symbol]",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),h=Object.prototype.toString,p=Math.max,y=Math.min,m=function(){return f.Date.now()}; /** Used as references for various `Number` constants. */ /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)} /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function g(e){if("number"==typeof e)return e;if( /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==a}(e))return n;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=s.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):o.test(e)?n:+e}e.exports= /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function(e,t,r){var n,a,i,o,s,u,l=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=n,i=a;return n=a=void 0,l=t,o=e.apply(i,r)}function b(e){var r=e-u; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return void 0===u||r>=t||r<0||d&&e-l>=i}function w(){var e=m();if(b(e))return S(e); // Restart the timer. s=setTimeout(w,function(e){var r=t-(e-u);return d?y(r,i-(e-l)):r}(e))}function S(e){ // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. return s=void 0,f&&n?h(e):(n=a=void 0,o)}function L(){var e=m(),r=b(e);if(n=arguments,a=this,u=e,r){if(void 0===s)return function(e){ // Invoke the leading edge. // Reset any `maxWait` timer. return l=e, // Start the timer for the trailing edge. s=setTimeout(w,t),c?h(e):o}(u);if(d) // Handle invocations in a tight loop. return s=setTimeout(w,t),h(u)}return void 0===s&&(s=setTimeout(w,t)),o}return t=g(t)||0,v(r)&&(c=!!r.leading,i=(d="maxWait"in r)?p(g(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),L.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=a=s=void 0},L.flush=function(){return void 0===s?o:S(m())},L}}, /***/9208: /***/function(e,t,r){ /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the `TypeError` message for "Functions" methods. */ var n="__lodash_hash_undefined__",a=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,y="object"==typeof self&&self&&self.Object===Object&&self,m=p||y||Function("return this")(); /** Used to stand-in for `undefined` hash values. */ /** Used for built-in method references. */ var v=Array.prototype,g=Function.prototype,b=Object.prototype,w=m["__core-js_shared__"],S=function(){var e=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),L=g.toString,E=b.hasOwnProperty,M=b.toString,k=RegExp("^"+L.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=m.Symbol,T=v.splice,F=U(m,"Map"),P=U(Object,"create"),C=x?x.prototype:void 0,N=C?C.toString:void 0; /** Used to detect overreaching core-js shims. */ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function W(e){var t=-1,r=e?e.length:0;for(this.clear();++t true * * _.isFunction(/abc/); * // => false */ function(e){ // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var t=Z(e)?M.call(e):"";return t==i||t==o} /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */(e)|| /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ function(e){ // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}(e)?k:h; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */return r.test( /** * Converts `func` to its source code. * * @private * @param {Function} func The function to process. * @returns {string} Returns the source code. */ function(e){if(null!=e){try{return L.call(e)}catch(t){}try{return e+""}catch(t){}}return""} /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */(e))} /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */function V(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map} /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */function U(e,t){var r= /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function(e,t){return null==e?void 0:e[t]}(e,t);return R(r)?r:void 0} // Add methods to `Hash`. W.prototype.clear=function(){this.__data__=P?P(null):{}} /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,W.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]} /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,W.prototype.get=function(e){var t=this.__data__;if(P){var r=t[e];return r===n?void 0:r}return E.call(t,e)?t[e]:void 0} /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,W.prototype.has=function(e){var t=this.__data__;return P?void 0!==t[e]:E.call(t,e)} /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */,W.prototype.set=function(e,t){return this.__data__[e]=P&&void 0===t?n:t,this}, // Add methods to `ListCache`. j.prototype.clear=function(){this.__data__=[]} /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,j.prototype.delete=function(e){var t=this.__data__,r=O(t,e);return!(r<0)&&(r==t.length-1?t.pop():T.call(t,r,1),!0)} /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,j.prototype.get=function(e){var t=this.__data__,r=O(t,e);return r<0?void 0:t[r][1]} /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,j.prototype.has=function(e){return O(this.__data__,e)>-1} /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */,j.prototype.set=function(e,t){var r=this.__data__,n=O(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}, // Add methods to `MapCache`. I.prototype.clear=function(){this.__data__={hash:new W,map:new(F||j),string:new W}} /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,I.prototype.delete=function(e){return V(this,e).delete(e)} /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,I.prototype.get=function(e){return V(this,e).get(e)} /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,I.prototype.has=function(e){return V(this,e).has(e)} /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */,I.prototype.set=function(e,t){return V(this,e).set(e,t),this};var A=K((function(e){ /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ var t; /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */e=null==(t=e)?"":function(e){ // Exit early for strings to avoid a performance hit in some environments. if("string"==typeof e)return e;if(z(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(d,(function(e,t,n,a){r.push(n?a.replace(f,"$1"):t||e)})),r})); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */function q(e){if("string"==typeof e||z(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function K(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o),o};return r.cache=new(K.Cache||I),r} // Assign cache to `_.memoize`. K.Cache=I; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var X=Array.isArray;function Z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)} /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function z(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&M.call(e)==s}e.exports=function(e,t,r){var n=null==e?void 0:D(e,t);return void 0===n?r:n}}, /***/2307: /***/function(e,t,r){ /* module decorator */e=r.nmd(e); /** * Lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the size to enable large array optimizations. */ var n="__lodash_hash_undefined__",a=1,i=2,o=9007199254740991,s="[object Arguments]",u="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",y="[object Map]",m="[object Number]",v="[object Null]",g="[object Object]",b="[object Promise]",w="[object Proxy]",S="[object RegExp]",L="[object Set]",E="[object String]",M="[object Symbol]",k="[object Undefined]",x="[object WeakMap]",T="[object ArrayBuffer]",F="[object DataView]",P=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,N={}; /** Used to stand-in for `undefined` hash values. */N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N[s]=N[u]=N[T]=N[c]=N[F]=N[d]=N[f]=N[h]=N[y]=N[m]=N[g]=N[S]=N[L]=N[E]=N[x]=!1; /** Detect free variable `global` from Node.js. */ var W="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,j="object"==typeof self&&self&&self.Object===Object&&self,I=W||j||Function("return this")(),O=t&&!t.nodeType&&t,D=O&&e&&!e.nodeType&&e,R=D&&D.exports===O,V=R&&W.process,U=function(){try{return V&&V.binding&&V.binding("util")}catch(e){}}(),A=U&&U.isTypedArray; /** Detect free variable `self`. */ /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function q(e,t){for(var r=-1,n=null==e?0:e.length;++rl))return!1; // Assume cyclic values are equal. var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,h=!0,p=r&i?new xe:void 0; // Ignore non-index properties. for(s.set(e,t),s.set(t,e);++f-1} /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */,Me.prototype.set=function(e,t){var r=this.__data__,n=Pe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}, // Add methods to `MapCache`. ke.prototype.clear=function(){this.size=0,this.__data__={hash:new Ee,map:new(de||Me),string:new Ee}} /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,ke.prototype.delete=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t} /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,ke.prototype.get=function(e){return Re(this,e).get(e)} /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,ke.prototype.has=function(e){return Re(this,e).has(e)} /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */,ke.prototype.set=function(e,t){var r=Re(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}, // Add methods to `SetCache`. xe.prototype.add=xe.prototype.push=function(e){return this.__data__.set(e,n),this} /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */,xe.prototype.has=function(e){return this.__data__.has(e)}, // Add methods to `Stack`. Te.prototype.clear=function(){this.__data__=new Me,this.size=0} /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */,Te.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r} /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */,Te.prototype.get=function(e){return this.__data__.get(e)} /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */,Te.prototype.has=function(e){return this.__data__.has(e)} /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */,Te.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ke(n)}return r.set(e,t),this.size=r.size,this};var Ue=se?function(e){return null==e?[]:(e=Object(e), /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function(){return[]} /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */,Ae=Ce; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function qe(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||C.test(e))&&e>-1&&e%1==0&&e true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */function Xe(e,t){return e===t||e!==e&&t!==t} /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. (ce&&Ae(new ce(new ArrayBuffer(1)))!=F||de&&Ae(new de)!=y||fe&&Ae(fe.resolve())!=b||he&&Ae(new he)!=L||pe&&Ae(new pe)!=x)&&(Ae=function(e){var t=Ce(e),r=t==g?e.constructor:void 0,n=r?Ke(r):"";if(n)switch(n){case me:return F;case ve:return y;case ge:return b;case be:return L;case we:return x}return t});var Ze=Ne(function(){return arguments}())?Ne:function(e){return He(e)&&Q.call(e,"callee")&&!ae.call(e,"callee")},ze=Array.isArray; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var Ye=ue||function(){return!1}; /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function Be(e){if(!Je(e))return!1; // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var t=Ce(e);return t==h||t==p||t==l||t==w} /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */function Ge(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o} /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */function Je(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)} /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */function He(e){return null!=e&&"object"==typeof e} /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */var Qe=A?function(e){return function(t){return e(t)}}(A):function(e){return He(e)&&Ge(e.length)&&!!N[Ce(e)]}; /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */function _e(e){return null!=(t=e)&&Ge(t.length)&&!Be(t)?Fe(e):Ie(e); /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ var t}e.exports=function(e,t){return We(e,t)}}, /***/4461: /***/function(e,t,r){ /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var n=1/0,a="[object Symbol]",i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,o="object"==typeof self&&self&&self.Object===Object&&self,s=i||o||Function("return this")(),u=Object.prototype,l=0,c=u.toString,d=s.Symbol,f=d?d.prototype:void 0,h=f?f.toString:void 0; /** `Object#toString` result references. */ /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function p(e){ // Exit early for strings to avoid a performance hit in some environments. if("string"==typeof e)return e;if( /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function(e){return"symbol"==typeof e|| /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function(e){return!!e&&"object"==typeof e}(e)&&c.call(e)==a} /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */(e))return h?h.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}e.exports= /** * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * * _.uniqueId('contact_'); * // => 'contact_104' * * _.uniqueId(); * // => '105' */ function(e){var t,r=++l;return(null==(t=e)?"":p(t))+r}}, /***/39: /***/function(e,t,r){ /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var n=1/0,a="[object Symbol]",i="\\ud800-\\udfff",o="\\u0300-\\u036f\\ufe20-\\ufe23",s="\\u20d0-\\u20f0",u="\\ufe0e\\ufe0f",l="["+i+"]",c="["+o+s+"]",d="\\ud83c[\\udffb-\\udfff]",f="[^"+i+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",m="(?:"+c+"|"+d+")"+"?",v="["+u+"]?",g=v+m+("(?:"+y+"(?:"+[f,h,p].join("|")+")"+v+m+")*"),b="(?:"+[f+c+"?",c,h,p,l].join("|")+")",w=RegExp(d+"(?="+d+")|"+b+g,"g"),S=RegExp("["+y+i+o+s+u+"]"),L="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E="object"==typeof self&&self&&self.Object===Object&&self,M=L||E||Function("return this")(); /** `Object#toString` result references. */ /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function k(e){return S.test(e)} /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */function x(e){return k(e)? /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function(e){return e.match(w)||[]} /** Used for built-in method references. */(e): /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function(e){return e.split("")}(e)}var T=Object.prototype.toString,F=M.Symbol,P=F?F.prototype:void 0,C=P?P.toString:void 0; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function N(e){ // Exit early for strings to avoid a performance hit in some environments. if("string"==typeof e)return e;if( /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function(e){return"symbol"==typeof e|| /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function(e){return!!e&&"object"==typeof e}(e)&&T.call(e)==a} /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t} /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */function W(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e: /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var j,I=(j="toUpperCase",function(e){var t,r=k(e=null==(t=e)?"":N(t))?x(e):void 0,n=r?r[0]:e.charAt(0),a=r?W(r,1).join(""):e.slice(1);return n[j]()+a});e.exports=I}, /***/9626: /***/function(e,t,r){"use strict";r.r(t), // extracted by mini-css-extract-plugin /* harmony default export */t.default={}}, /***/2547: /***/function(e,t,r){"use strict";r.r(t), // extracted by mini-css-extract-plugin /* harmony default export */t.default={}}, /***/5251: /***/function(e,t,r){"use strict"; /** @license React v16.14.0 * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var n=r(3899),a=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var i=Symbol.for;a=i("react.element"),t.Fragment=i("react.fragment")}var o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var n,i={},l=null,c=null;for(n in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)s.call(t,n)&&!u.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:a,type:e,key:l,ref:c,props:i,_owner:o.current}}t.jsx=l,t.jsxs=l}, /***/5893: /***/function(e,t,r){"use strict";e.exports=r(5251)}, /***/8808: /***/function(e,t){"use strict";t.__esModule=!0,t.default=void 0;var r=function(){for(var e=arguments.length,t=new Array(e),r=0;r"===i?(M(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=S.TEXT):v(i)?(r.state=S.SGML_DECL_QUOTED,r.sgmlDecl+=i):r.sgmlDecl+=i;continue;case S.SGML_DECL_QUOTED:i===r.q&&(r.state=S.SGML_DECL,r.q=""),r.sgmlDecl+=i;continue;case S.DOCTYPE:">"===i?(r.state=S.TEXT,M(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=i,"["===i?r.state=S.DOCTYPE_DTD:v(i)&&(r.state=S.DOCTYPE_QUOTED,r.q=i));continue;case S.DOCTYPE_QUOTED:r.doctype+=i,i===r.q&&(r.q="",r.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:r.doctype+=i,"]"===i?r.state=S.DOCTYPE:v(i)&&(r.state=S.DOCTYPE_DTD_QUOTED,r.q=i);continue;case S.DOCTYPE_DTD_QUOTED:r.doctype+=i,i===r.q&&(r.state=S.DOCTYPE_DTD,r.q="");continue;case S.COMMENT:"-"===i?r.state=S.COMMENT_ENDING:r.comment+=i;continue;case S.COMMENT_ENDING:"-"===i?(r.state=S.COMMENT_ENDED,r.comment=x(r.opt,r.comment),r.comment&&M(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+i,r.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==i?(P(r,"Malformed comment"), // allow in non-strict mode, // which is a comment of " blah -- bloo " r.comment+="--"+i,r.state=S.COMMENT):r.state=S.TEXT;continue;case S.CDATA:"]"===i?r.state=S.CDATA_ENDING:r.cdata+=i;continue;case S.CDATA_ENDING:"]"===i?r.state=S.CDATA_ENDING_2:(r.cdata+="]"+i,r.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===i?(r.cdata&&M(r,"oncdata",r.cdata),M(r,"onclosecdata"),r.cdata="",r.state=S.TEXT):"]"===i?r.cdata+="]":(r.cdata+="]]"+i,r.state=S.CDATA);continue;case S.PROC_INST:"?"===i?r.state=S.PROC_INST_ENDING:m(i)?r.state=S.PROC_INST_BODY:r.procInstName+=i;continue;case S.PROC_INST_BODY:if(!r.procInstBody&&m(i))continue;"?"===i?r.state=S.PROC_INST_ENDING:r.procInstBody+=i;continue;case S.PROC_INST_ENDING:">"===i?(M(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=S.TEXT):(r.procInstBody+="?"+i,r.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:b(h,i)?r.tagName+=i:(C(r),">"===i?j(r):"/"===i?r.state=S.OPEN_TAG_SLASH:(m(i)||P(r,"Invalid character in tag name"),r.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===i?(j(r,!0),I(r)):(P(r,"Forward-slash in opening tag not followed by >"),r.state=S.ATTRIB);continue;case S.ATTRIB: // haven't read the attribute name yet. if(m(i))continue;">"===i?j(r):"/"===i?r.state=S.OPEN_TAG_SLASH:b(f,i)?(r.attribName=i,r.attribValue="",r.state=S.ATTRIB_NAME):P(r,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===i?r.state=S.ATTRIB_VALUE:">"===i?(P(r,"Attribute without value"),r.attribValue=r.attribName,W(r),j(r)):m(i)?r.state=S.ATTRIB_NAME_SAW_WHITE:b(h,i)?r.attribName+=i:P(r,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===i)r.state=S.ATTRIB_VALUE;else{if(m(i))continue;P(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",M(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===i?j(r):b(f,i)?(r.attribName=i,r.state=S.ATTRIB_NAME):(P(r,"Invalid attribute name"),r.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(m(i))continue;v(i)?(r.q=i,r.state=S.ATTRIB_VALUE_QUOTED):(P(r,"Unquoted attribute value"),r.state=S.ATTRIB_VALUE_UNQUOTED,r.attribValue=i);continue;case S.ATTRIB_VALUE_QUOTED:if(i!==r.q){"&"===i?r.state=S.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=i;continue}W(r),r.q="",r.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:m(i)?r.state=S.ATTRIB:">"===i?j(r):"/"===i?r.state=S.OPEN_TAG_SLASH:b(f,i)?(P(r,"No whitespace between attributes"),r.attribName=i,r.attribValue="",r.state=S.ATTRIB_NAME):P(r,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(!g(i)){"&"===i?r.state=S.ATTRIB_VALUE_ENTITY_U:r.attribValue+=i;continue}W(r),">"===i?j(r):r.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(r.tagName)">"===i?I(r):b(h,i)?r.tagName+=i:r.script?(r.script+=""===i?I(r):P(r,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:var c,d;switch(r.state){case S.TEXT_ENTITY:c=S.TEXT,d="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:c=S.ATTRIB_VALUE_QUOTED,d="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:c=S.ATTRIB_VALUE_UNQUOTED,d="attribValue"}";"===i?(r[d]+=O(r),r.entity="",r.state=c):b(r.entity.length?y:p,i)?r.entity+=i:(P(r,"Invalid character in entity name"),r[d]+="&"+r.entity+i,r.entity="",r.state=c);continue;default:throw new Error(r,"Unknown state: "+r.state)}// while r.position>=r.bufferCheckPosition&&function(t){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),a=0,i=0,o=n.length;ir) // Text/cdata nodes can get big, and since they're buffered, // we can get here under normal conditions. // Avoid issues by emitting the text node now, // so at least it won't get any bigger. switch(n[i]){case"textNode":k(t);break;case"cdata":M(t,"oncdata",t.cdata),t.cdata="";break;case"script":M(t,"onscript",t.script),t.script="";break;default:T(t,"Max buffer length exceeded: "+n[i])}a=Math.max(a,s)} // schedule the next check for the earliest possible buffer overrun. var u=e.MAX_BUFFER_LENGTH-a;t.bufferCheckPosition=u+t.position}(r);return r} /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */ /* istanbul ignore next */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;k(e=this),""!==e.cdata&&(M(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(M(e,"onscript",e.script),e.script="")}};try{t=r(2830).Stream}catch(V){t=function(){}}var i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function o(e,r){if(!(this instanceof o))return new o(e,r);t.apply(this),this._parser=new a(e,r),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e), // if didn't throw, then means error was handled. // go ahead and clear error, so we can write again. n._parser.error=null},this._decoder=null,i.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(t.prototype,{constructor:{value:o}}),o.prototype.write=function(e){if("function"===typeof Buffer&&"function"===typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=r(2553)/* .StringDecoder */.s;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,r){var n=this;return n._parser["on"+e]||-1===i.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),t.prototype.on.call(n,e,r)} // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits.; var s="[CDATA[",u="DOCTYPE",l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/2000/xmlns/",d={xml:l,xmlns:c},f=/[:_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]/,h=/[:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_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]/,y=/[#:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function m(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function v(e){return'"'===e||"'"===e}function g(e){return">"===e||m(e)}function b(e,t){return e.test(t)}function w(e,t){return!b(e,t)}var S=0;for(var L in e.STATE={BEGIN:S++,// leading byte order mark or whitespace BEGIN_WHITESPACE:S++,// leading whitespace TEXT:S++,// general stuff TEXT_ENTITY:S++,// & and such. OPEN_WAKA:S++,// < SGML_DECL:S++,// SCRIPT:S++,//