@mattilsynet/design 2.2.25 → 2.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/mtds/analytics/analytics.js +3 -1
  2. package/mtds/analytics/analytics.js.map +1 -1
  3. package/mtds/atlas/atlas-element.d.ts +1 -0
  4. package/mtds/atlas/atlas-element.js +14 -6
  5. package/mtds/atlas/atlas-element.js.map +1 -1
  6. package/mtds/atlas/atlas-marker.js +9 -5
  7. package/mtds/atlas/atlas-marker.js.map +1 -1
  8. package/mtds/atlas/atlas-matgeo.d.ts +11 -3
  9. package/mtds/atlas/atlas-matgeo.js +38 -16
  10. package/mtds/atlas/atlas-matgeo.js.map +1 -1
  11. package/mtds/atlas/atlas-wms.d.ts +17 -0
  12. package/mtds/atlas/atlas-wms.js +39 -0
  13. package/mtds/atlas/atlas-wms.js.map +1 -0
  14. package/mtds/atlas/atlas.css.js +12 -6
  15. package/mtds/atlas/atlas.css.js.map +1 -1
  16. package/mtds/atlas/atlas.d.ts +10 -1
  17. package/mtds/atlas/atlas.js +5 -0
  18. package/mtds/atlas/atlas.js.map +1 -1
  19. package/mtds/atlas/atlas.stories.d.ts +1 -0
  20. package/mtds/atlas.iife.js +16 -10
  21. package/mtds/atlas.js +3 -1
  22. package/mtds/atlas.js.map +1 -1
  23. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +35 -0
  24. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -0
  25. package/mtds/external/@turf/helpers/dist/esm/index.js +40 -0
  26. package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -0
  27. package/mtds/external/@turf/invariant/dist/esm/index.js +28 -0
  28. package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -0
  29. package/mtds/external/point-in-polygon-hao/dist/esm/index.js +56 -0
  30. package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -0
  31. package/mtds/external/robust-predicates/esm/orient2d.js +168 -0
  32. package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -0
  33. package/mtds/external/robust-predicates/esm/util.js +91 -0
  34. package/mtds/external/robust-predicates/esm/util.js.map +1 -0
  35. package/mtds/index.iife.js +9 -9
  36. package/mtds/package.json.js +1 -1
  37. package/mtds/popover/popover-observer.js +16 -6
  38. package/mtds/popover/popover-observer.js.map +1 -1
  39. package/mtds/react-atlas.js +3 -1
  40. package/mtds/react-atlas.js.map +1 -1
  41. package/mtds/styles.css +62 -62
  42. package/package.json +8 -6
package/mtds/atlas.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import { MTDSAtlasElement } from "./atlas/atlas-element.js";
2
2
  import { MTDSAtlasMarkerElement } from "./atlas/atlas-marker.js";
3
3
  import { MTDSAtlasMatgeoElement } from "./atlas/atlas-matgeo.js";
4
+ import { MTDSAtlasWMSElement } from "./atlas/atlas-wms.js";
4
5
  import { default as default2 } from "./external/leaflet/dist/leaflet-src.js";
5
6
  export {
6
7
  default2 as L,
7
8
  MTDSAtlasElement,
8
9
  MTDSAtlasMarkerElement,
9
- MTDSAtlasMatgeoElement
10
+ MTDSAtlasMatgeoElement,
11
+ MTDSAtlasWMSElement
10
12
  };
11
13
  //# sourceMappingURL=atlas.js.map
package/mtds/atlas.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"atlas.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"atlas.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,35 @@
1
+ import pointInPolygon from "../../../../point-in-polygon-hao/dist/esm/index.js";
2
+ import { getCoord, getGeom } from "../../../invariant/dist/esm/index.js";
3
+ function booleanPointInPolygon(point, polygon, options = {}) {
4
+ if (!point) {
5
+ throw new Error("point is required");
6
+ }
7
+ if (!polygon) {
8
+ throw new Error("polygon is required");
9
+ }
10
+ const pt = getCoord(point);
11
+ const geom = getGeom(polygon);
12
+ const type = geom.type;
13
+ const bbox = polygon.bbox;
14
+ let polys = geom.coordinates;
15
+ if (bbox && inBBox(pt, bbox) === false) {
16
+ return false;
17
+ }
18
+ if (type === "Polygon") {
19
+ polys = [polys];
20
+ }
21
+ let result = false;
22
+ for (var i = 0; i < polys.length; ++i) {
23
+ const polyResult = pointInPolygon(pt, polys[i]);
24
+ if (polyResult === 0) return options.ignoreBoundary ? false : true;
25
+ else if (polyResult) result = true;
26
+ }
27
+ return result;
28
+ }
29
+ function inBBox(pt, bbox) {
30
+ return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];
31
+ }
32
+ export {
33
+ booleanPointInPolygon
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport pip from \"point-in-polygon-hao\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nfunction booleanPointInPolygon(point, polygon, options = {}) {\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n const pt = getCoord(point);\n const geom = getGeom(polygon);\n const type = geom.type;\n const bbox = polygon.bbox;\n let polys = geom.coordinates;\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n if (type === \"Polygon\") {\n polys = [polys];\n }\n let result = false;\n for (var i = 0; i < polys.length; ++i) {\n const polyResult = pip(pt, polys[i]);\n if (polyResult === 0) return options.ignoreBoundary ? false : true;\n else if (polyResult) result = true;\n }\n return result;\n}\nfunction inBBox(pt, bbox) {\n return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];\n}\nvar index_default = booleanPointInPolygon;\nexport {\n booleanPointInPolygon,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"names":["pip"],"mappings":";;AAGA,SAAS,sBAAsB,OAAO,SAAS,UAAU,CAAA,GAAI;AAC3D,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,mBAAmB;AAAA,EACrC;AACA,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AACA,QAAM,KAAK,SAAS,KAAK;AACzB,QAAM,OAAO,QAAQ,OAAO;AAC5B,QAAM,OAAO,KAAK;AAClB,QAAM,OAAO,QAAQ;AACrB,MAAI,QAAQ,KAAK;AACjB,MAAI,QAAQ,OAAO,IAAI,IAAI,MAAM,OAAO;AACtC,WAAO;AAAA,EACT;AACA,MAAI,SAAS,WAAW;AACtB,YAAQ,CAAC,KAAK;AAAA,EAChB;AACA,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,EAAE,GAAG;AACrC,UAAM,aAAaA,eAAI,IAAI,MAAM,CAAC,CAAC;AACnC,QAAI,eAAe,EAAG,QAAO,QAAQ,iBAAiB,QAAQ;AAAA,aACrD,WAAY,UAAS;AAAA,EAChC;AACA,SAAO;AACT;AACA,SAAS,OAAO,IAAI,MAAM;AACxB,SAAO,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC;AACpF;","x_google_ignoreList":[0]}
@@ -0,0 +1,40 @@
1
+ function feature(geom, properties, options = {}) {
2
+ const feat = { type: "Feature" };
3
+ if (options.id === 0 || options.id) {
4
+ feat.id = options.id;
5
+ }
6
+ if (options.bbox) {
7
+ feat.bbox = options.bbox;
8
+ }
9
+ feat.properties = {};
10
+ feat.geometry = geom;
11
+ return feat;
12
+ }
13
+ function point(coordinates, properties, options = {}) {
14
+ if (!coordinates) {
15
+ throw new Error("coordinates is required");
16
+ }
17
+ if (!Array.isArray(coordinates)) {
18
+ throw new Error("coordinates must be an Array");
19
+ }
20
+ if (coordinates.length < 2) {
21
+ throw new Error("coordinates must be at least 2 numbers long");
22
+ }
23
+ if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {
24
+ throw new Error("coordinates must contain numbers");
25
+ }
26
+ const geom = {
27
+ type: "Point",
28
+ coordinates
29
+ };
30
+ return feature(geom, properties, options);
31
+ }
32
+ function isNumber(num) {
33
+ return !isNaN(num) && num !== null && !Array.isArray(num);
34
+ }
35
+ export {
36
+ feature,
37
+ isNumber,
38
+ point
39
+ };
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/helpers/dist/esm/index.js"],"sourcesContent":["// index.ts\nvar earthRadius = 63710088e-1;\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: 360 / (2 * Math.PI),\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1e3,\n kilometres: earthRadius / 1e3,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1e3,\n millimetres: earthRadius * 1e3,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius * 1.0936\n};\nvar areaFactors = {\n acres: 247105e-9,\n centimeters: 1e4,\n centimetres: 1e4,\n feet: 10.763910417,\n hectares: 1e-4,\n inches: 1550.003100006,\n kilometers: 1e-6,\n kilometres: 1e-6,\n meters: 1,\n metres: 1,\n miles: 386e-9,\n nauticalmiles: 29155334959812285e-23,\n millimeters: 1e6,\n millimetres: 1e6,\n yards: 1.195990046\n};\nfunction feature(geom, properties, options = {}) {\n const feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\nfunction geometry(type, coordinates, _options = {}) {\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\nfunction point(coordinates, properties, options = {}) {\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n const geom = {\n type: \"Point\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction points(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return point(coords, properties);\n }),\n options\n );\n}\nfunction polygon(coordinates, properties, options = {}) {\n for (const ring of coordinates) {\n if (ring.length < 4) {\n throw new Error(\n \"Each LinearRing of a Polygon must have 4 or more Positions.\"\n );\n }\n if (ring[ring.length - 1].length !== ring[0].length) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n for (let j = 0; j < ring[ring.length - 1].length; j++) {\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n const geom = {\n type: \"Polygon\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction polygons(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return polygon(coords, properties);\n }),\n options\n );\n}\nfunction lineString(coordinates, properties, options = {}) {\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n const geom = {\n type: \"LineString\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction lineStrings(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return lineString(coords, properties);\n }),\n options\n );\n}\nfunction featureCollection(features, options = {}) {\n const fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\nfunction multiLineString(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiLineString\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction multiPoint(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiPoint\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction multiPolygon(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiPolygon\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction geometryCollection(geometries, properties, options = {}) {\n const geom = {\n type: \"GeometryCollection\",\n geometries\n };\n return feature(geom, properties, options);\n}\nfunction round(num, precision = 0) {\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n const multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\nfunction radiansToLength(radians, units = \"kilometers\") {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\nfunction lengthToRadians(distance, units = \"kilometers\") {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\nfunction bearingToAzimuth(bearing) {\n let angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\nfunction azimuthToBearing(angle) {\n angle = angle % 360;\n if (angle > 180) {\n return angle - 360;\n } else if (angle < -180) {\n return angle + 360;\n }\n return angle;\n}\nfunction radiansToDegrees(radians) {\n const normalisedRadians = radians % (2 * Math.PI);\n return normalisedRadians * 180 / Math.PI;\n}\nfunction degreesToRadians(degrees) {\n const normalisedDegrees = degrees % 360;\n return normalisedDegrees * Math.PI / 180;\n}\nfunction convertLength(length, originalUnit = \"kilometers\", finalUnit = \"kilometers\") {\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\nfunction convertArea(area, originalUnit = \"meters\", finalUnit = \"kilometers\") {\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n const startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n const finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return area / startFactor * finalFactor;\n}\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\nfunction isObject(input) {\n return input !== null && typeof input === \"object\" && !Array.isArray(input);\n}\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach((num) => {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\nexport {\n areaFactors,\n azimuthToBearing,\n bearingToAzimuth,\n convertArea,\n convertLength,\n degreesToRadians,\n earthRadius,\n factors,\n feature,\n featureCollection,\n geometry,\n geometryCollection,\n isNumber,\n isObject,\n lengthToDegrees,\n lengthToRadians,\n lineString,\n lineStrings,\n multiLineString,\n multiPoint,\n multiPolygon,\n point,\n points,\n polygon,\n polygons,\n radiansToDegrees,\n radiansToLength,\n round,\n validateBBox,\n validateId\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AAoCA,SAAS,QAAQ,MAAM,YAAY,UAAU,CAAA,GAAI;AAC/C,QAAM,OAAO,EAAE,MAAM,UAAS;AAC9B,MAAI,QAAQ,OAAO,KAAK,QAAQ,IAAI;AAClC,SAAK,KAAK,QAAQ;AAAA,EACpB;AACA,MAAI,QAAQ,MAAM;AAChB,SAAK,OAAO,QAAQ;AAAA,EACtB;AACA,OAAK,aAA2B,CAAA;AAChC,OAAK,WAAW;AAChB,SAAO;AACT;AAmBA,SAAS,MAAM,aAAa,YAAY,UAAU,CAAA,GAAI;AACpD,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AACA,MAAI,CAAC,MAAM,QAAQ,WAAW,GAAG;AAC/B,UAAM,IAAI,MAAM,8BAA8B;AAAA,EAChD;AACA,MAAI,YAAY,SAAS,GAAG;AAC1B,UAAM,IAAI,MAAM,6CAA6C;AAAA,EAC/D;AACA,MAAI,CAAC,SAAS,YAAY,CAAC,CAAC,KAAK,CAAC,SAAS,YAAY,CAAC,CAAC,GAAG;AAC1D,UAAM,IAAI,MAAM,kCAAkC;AAAA,EACpD;AACA,QAAM,OAAO;AAAA,IACX,MAAM;AAAA,IACN;AAAA,EACJ;AACE,SAAO,QAAQ,MAAM,YAAY,OAAO;AAC1C;AAoKA,SAAS,SAAS,KAAK;AACrB,SAAO,CAAC,MAAM,GAAG,KAAK,QAAQ,QAAQ,CAAC,MAAM,QAAQ,GAAG;AAC1D;","x_google_ignoreList":[0]}
@@ -0,0 +1,28 @@
1
+ function getCoord(coord) {
2
+ if (!coord) {
3
+ throw new Error("coord is required");
4
+ }
5
+ if (!Array.isArray(coord)) {
6
+ if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
7
+ return [...coord.geometry.coordinates];
8
+ }
9
+ if (coord.type === "Point") {
10
+ return [...coord.coordinates];
11
+ }
12
+ }
13
+ if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
14
+ return [...coord];
15
+ }
16
+ throw new Error("coord must be GeoJSON Point or an Array of numbers");
17
+ }
18
+ function getGeom(geojson) {
19
+ if (geojson.type === "Feature") {
20
+ return geojson.geometry;
21
+ }
22
+ return geojson;
23
+ }
24
+ export {
25
+ getCoord,
26
+ getGeom
27
+ };
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/invariant/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport { isNumber } from \"@turf/helpers\";\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" && coord.geometry !== null && coord.geometry.type === \"Point\") {\n return [...coord.geometry.coordinates];\n }\n if (coord.type === \"Point\") {\n return [...coord.coordinates];\n }\n }\n if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {\n return [...coord];\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\nfunction getCoords(coords) {\n if (Array.isArray(coords)) {\n return coords;\n }\n if (coords.type === \"Feature\") {\n if (coords.geometry !== null) {\n return coords.geometry.coordinates;\n }\n } else {\n if (coords.coordinates) {\n return coords.coordinates;\n }\n }\n throw new Error(\n \"coords must be GeoJSON Feature, Geometry Object or an Array\"\n );\n}\nfunction containsNumber(coordinates) {\n if (coordinates.length > 1 && isNumber(coordinates[0]) && isNumber(coordinates[1])) {\n return true;\n }\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\n return containsNumber(coordinates[0]);\n }\n throw new Error(\"coordinates must only contain numbers\");\n}\nfunction geojsonType(value, type, name) {\n if (!type || !name) {\n throw new Error(\"type and name required\");\n }\n if (!value || value.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + value.type\n );\n }\n}\nfunction featureOf(feature, type, name) {\n if (!feature) {\n throw new Error(\"No feature passed\");\n }\n if (!name) {\n throw new Error(\".featureOf() requires a name\");\n }\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\n \"Invalid input to \" + name + \", Feature with geometry required\"\n );\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type\n );\n }\n}\nfunction collectionOf(featureCollection, type, name) {\n if (!featureCollection) {\n throw new Error(\"No featureCollection passed\");\n }\n if (!name) {\n throw new Error(\".collectionOf() requires a name\");\n }\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\n throw new Error(\n \"Invalid input to \" + name + \", FeatureCollection required\"\n );\n }\n for (const feature of featureCollection.features) {\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\n \"Invalid input to \" + name + \", Feature with geometry required\"\n );\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type\n );\n }\n }\n}\nfunction getGeom(geojson) {\n if (geojson.type === \"Feature\") {\n return geojson.geometry;\n }\n return geojson;\n}\nfunction getType(geojson, _name) {\n if (geojson.type === \"FeatureCollection\") {\n return \"FeatureCollection\";\n }\n if (geojson.type === \"GeometryCollection\") {\n return \"GeometryCollection\";\n }\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\n return geojson.geometry.type;\n }\n return geojson.type;\n}\nexport {\n collectionOf,\n containsNumber,\n featureOf,\n geojsonType,\n getCoord,\n getCoords,\n getGeom,\n getType\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AAEA,SAAS,SAAS,OAAO;AACvB,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,mBAAmB;AAAA,EACrC;AACA,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AACzB,QAAI,MAAM,SAAS,aAAa,MAAM,aAAa,QAAQ,MAAM,SAAS,SAAS,SAAS;AAC1F,aAAO,CAAC,GAAG,MAAM,SAAS,WAAW;AAAA,IACvC;AACA,QAAI,MAAM,SAAS,SAAS;AAC1B,aAAO,CAAC,GAAG,MAAM,WAAW;AAAA,IAC9B;AAAA,EACF;AACA,MAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU,KAAK,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC,GAAG;AACrG,WAAO,CAAC,GAAG,KAAK;AAAA,EAClB;AACA,QAAM,IAAI,MAAM,oDAAoD;AACtE;AAgFA,SAAS,QAAQ,SAAS;AACxB,MAAI,QAAQ,SAAS,WAAW;AAC9B,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,56 @@
1
+ import { orient2d } from "../../../robust-predicates/esm/orient2d.js";
2
+ function pointInPolygon(p, polygon) {
3
+ var i;
4
+ var ii;
5
+ var k = 0;
6
+ var f;
7
+ var u1;
8
+ var v1;
9
+ var u2;
10
+ var v2;
11
+ var currentP;
12
+ var nextP;
13
+ var x = p[0];
14
+ var y = p[1];
15
+ var numContours = polygon.length;
16
+ for (i = 0; i < numContours; i++) {
17
+ ii = 0;
18
+ var contour = polygon[i];
19
+ var contourLen = contour.length - 1;
20
+ currentP = contour[0];
21
+ if (currentP[0] !== contour[contourLen][0] && currentP[1] !== contour[contourLen][1]) {
22
+ throw new Error("First and last coordinates in a ring must be the same");
23
+ }
24
+ u1 = currentP[0] - x;
25
+ v1 = currentP[1] - y;
26
+ for (ii; ii < contourLen; ii++) {
27
+ nextP = contour[ii + 1];
28
+ u2 = nextP[0] - x;
29
+ v2 = nextP[1] - y;
30
+ if (v1 === 0 && v2 === 0) {
31
+ if (u2 <= 0 && u1 >= 0 || u1 <= 0 && u2 >= 0) {
32
+ return 0;
33
+ }
34
+ } else if (v2 >= 0 && v1 <= 0 || v2 <= 0 && v1 >= 0) {
35
+ f = orient2d(u1, u2, v1, v2, 0, 0);
36
+ if (f === 0) {
37
+ return 0;
38
+ }
39
+ if (f > 0 && v2 > 0 && v1 <= 0 || f < 0 && v2 <= 0 && v1 > 0) {
40
+ k++;
41
+ }
42
+ }
43
+ currentP = nextP;
44
+ v1 = v2;
45
+ u1 = u2;
46
+ }
47
+ }
48
+ if (k % 2 === 0) {
49
+ return false;
50
+ }
51
+ return true;
52
+ }
53
+ export {
54
+ pointInPolygon as default
55
+ };
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/point-in-polygon-hao/dist/esm/index.js"],"sourcesContent":["import { orient2d } from 'robust-predicates';\n\nfunction pointInPolygon(p, polygon) {\n var i;\n var ii;\n var k = 0;\n var f;\n var u1;\n var v1;\n var u2;\n var v2;\n var currentP;\n var nextP;\n\n var x = p[0];\n var y = p[1];\n\n var numContours = polygon.length;\n for (i = 0; i < numContours; i++) {\n ii = 0;\n var contour = polygon[i];\n var contourLen = contour.length - 1;\n\n currentP = contour[0];\n if (currentP[0] !== contour[contourLen][0] &&\n currentP[1] !== contour[contourLen][1]) {\n throw new Error('First and last coordinates in a ring must be the same')\n }\n\n u1 = currentP[0] - x;\n v1 = currentP[1] - y;\n\n for (ii; ii < contourLen; ii++) {\n nextP = contour[ii + 1];\n\n u2 = nextP[0] - x;\n v2 = nextP[1] - y;\n\n if (v1 === 0 && v2 === 0) {\n if ((u2 <= 0 && u1 >= 0) || (u1 <= 0 && u2 >= 0)) { return 0 }\n } else if ((v2 >= 0 && v1 <= 0) || (v2 <= 0 && v1 >= 0)) {\n f = orient2d(u1, u2, v1, v2, 0, 0);\n if (f === 0) { return 0 }\n if ((f > 0 && v2 > 0 && v1 <= 0) || (f < 0 && v2 <= 0 && v1 > 0)) { k++; }\n }\n currentP = nextP;\n v1 = v2;\n u1 = u2;\n }\n }\n\n if (k % 2 === 0) { return false }\n return true\n}\n\nexport { pointInPolygon as default };\n"],"names":[],"mappings":";AAEA,SAAS,eAAe,GAAG,SAAS;AAChC,MAAI;AACJ,MAAI;AACJ,MAAI,IAAI;AACR,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,MAAI,IAAI,EAAE,CAAC;AACX,MAAI,IAAI,EAAE,CAAC;AAEX,MAAI,cAAc,QAAQ;AAC1B,OAAK,IAAI,GAAG,IAAI,aAAa,KAAK;AAC9B,SAAK;AACL,QAAI,UAAU,QAAQ,CAAC;AACvB,QAAI,aAAa,QAAQ,SAAS;AAElC,eAAW,QAAQ,CAAC;AACpB,QAAI,SAAS,CAAC,MAAM,QAAQ,UAAU,EAAE,CAAC,KACrC,SAAS,CAAC,MAAM,QAAQ,UAAU,EAAE,CAAC,GAAG;AACxC,YAAM,IAAI,MAAM,uDAAuD;AAAA,IAC3E;AAEA,SAAK,SAAS,CAAC,IAAI;AACnB,SAAK,SAAS,CAAC,IAAI;AAEnB,SAAK,IAAI,KAAK,YAAY,MAAM;AAC5B,cAAQ,QAAQ,KAAK,CAAC;AAEtB,WAAK,MAAM,CAAC,IAAI;AAChB,WAAK,MAAM,CAAC,IAAI;AAEhB,UAAI,OAAO,KAAK,OAAO,GAAG;AACtB,YAAK,MAAM,KAAK,MAAM,KAAO,MAAM,KAAK,MAAM,GAAI;AAAE,iBAAO;AAAA,QAAE;AAAA,MACjE,WAAY,MAAM,KAAK,MAAM,KAAO,MAAM,KAAK,MAAM,GAAI;AACrD,YAAI,SAAS,IAAI,IAAI,IAAI,IAAI,GAAG,CAAC;AACjC,YAAI,MAAM,GAAG;AAAE,iBAAO;AAAA,QAAE;AACxB,YAAK,IAAI,KAAK,KAAK,KAAK,MAAM,KAAO,IAAI,KAAK,MAAM,KAAK,KAAK,GAAI;AAAE;AAAA,QAAK;AAAA,MAC7E;AACA,iBAAW;AACX,WAAK;AACL,WAAK;AAAA,IACT;AAAA,EACJ;AAEA,MAAI,IAAI,MAAM,GAAG;AAAE,WAAO;AAAA,EAAM;AAChC,SAAO;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,168 @@
1
+ import { epsilon, vec, estimate, resulterrbound, splitter, sum } from "./util.js";
2
+ const ccwerrboundA = (3 + 16 * epsilon) * epsilon;
3
+ const ccwerrboundB = (2 + 12 * epsilon) * epsilon;
4
+ const ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;
5
+ const B = vec(4);
6
+ const C1 = vec(8);
7
+ const C2 = vec(12);
8
+ const D = vec(16);
9
+ const u = vec(4);
10
+ function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
11
+ let acxtail, acytail, bcxtail, bcytail;
12
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;
13
+ const acx = ax - cx;
14
+ const bcx = bx - cx;
15
+ const acy = ay - cy;
16
+ const bcy = by - cy;
17
+ s1 = acx * bcy;
18
+ c = splitter * acx;
19
+ ahi = c - (c - acx);
20
+ alo = acx - ahi;
21
+ c = splitter * bcy;
22
+ bhi = c - (c - bcy);
23
+ blo = bcy - bhi;
24
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
25
+ t1 = acy * bcx;
26
+ c = splitter * acy;
27
+ ahi = c - (c - acy);
28
+ alo = acy - ahi;
29
+ c = splitter * bcx;
30
+ bhi = c - (c - bcx);
31
+ blo = bcx - bhi;
32
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
33
+ _i = s0 - t0;
34
+ bvirt = s0 - _i;
35
+ B[0] = s0 - (_i + bvirt) + (bvirt - t0);
36
+ _j = s1 + _i;
37
+ bvirt = _j - s1;
38
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
39
+ _i = _0 - t1;
40
+ bvirt = _0 - _i;
41
+ B[1] = _0 - (_i + bvirt) + (bvirt - t1);
42
+ u3 = _j + _i;
43
+ bvirt = u3 - _j;
44
+ B[2] = _j - (u3 - bvirt) + (_i - bvirt);
45
+ B[3] = u3;
46
+ let det = estimate(4, B);
47
+ let errbound = ccwerrboundB * detsum;
48
+ if (det >= errbound || -det >= errbound) {
49
+ return det;
50
+ }
51
+ bvirt = ax - acx;
52
+ acxtail = ax - (acx + bvirt) + (bvirt - cx);
53
+ bvirt = bx - bcx;
54
+ bcxtail = bx - (bcx + bvirt) + (bvirt - cx);
55
+ bvirt = ay - acy;
56
+ acytail = ay - (acy + bvirt) + (bvirt - cy);
57
+ bvirt = by - bcy;
58
+ bcytail = by - (bcy + bvirt) + (bvirt - cy);
59
+ if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {
60
+ return det;
61
+ }
62
+ errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);
63
+ det += acx * bcytail + bcy * acxtail - (acy * bcxtail + bcx * acytail);
64
+ if (det >= errbound || -det >= errbound) return det;
65
+ s1 = acxtail * bcy;
66
+ c = splitter * acxtail;
67
+ ahi = c - (c - acxtail);
68
+ alo = acxtail - ahi;
69
+ c = splitter * bcy;
70
+ bhi = c - (c - bcy);
71
+ blo = bcy - bhi;
72
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
73
+ t1 = acytail * bcx;
74
+ c = splitter * acytail;
75
+ ahi = c - (c - acytail);
76
+ alo = acytail - ahi;
77
+ c = splitter * bcx;
78
+ bhi = c - (c - bcx);
79
+ blo = bcx - bhi;
80
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
81
+ _i = s0 - t0;
82
+ bvirt = s0 - _i;
83
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
84
+ _j = s1 + _i;
85
+ bvirt = _j - s1;
86
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
87
+ _i = _0 - t1;
88
+ bvirt = _0 - _i;
89
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
90
+ u3 = _j + _i;
91
+ bvirt = u3 - _j;
92
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
93
+ u[3] = u3;
94
+ const C1len = sum(4, B, 4, u, C1);
95
+ s1 = acx * bcytail;
96
+ c = splitter * acx;
97
+ ahi = c - (c - acx);
98
+ alo = acx - ahi;
99
+ c = splitter * bcytail;
100
+ bhi = c - (c - bcytail);
101
+ blo = bcytail - bhi;
102
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
103
+ t1 = acy * bcxtail;
104
+ c = splitter * acy;
105
+ ahi = c - (c - acy);
106
+ alo = acy - ahi;
107
+ c = splitter * bcxtail;
108
+ bhi = c - (c - bcxtail);
109
+ blo = bcxtail - bhi;
110
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
111
+ _i = s0 - t0;
112
+ bvirt = s0 - _i;
113
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
114
+ _j = s1 + _i;
115
+ bvirt = _j - s1;
116
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
117
+ _i = _0 - t1;
118
+ bvirt = _0 - _i;
119
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
120
+ u3 = _j + _i;
121
+ bvirt = u3 - _j;
122
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
123
+ u[3] = u3;
124
+ const C2len = sum(C1len, C1, 4, u, C2);
125
+ s1 = acxtail * bcytail;
126
+ c = splitter * acxtail;
127
+ ahi = c - (c - acxtail);
128
+ alo = acxtail - ahi;
129
+ c = splitter * bcytail;
130
+ bhi = c - (c - bcytail);
131
+ blo = bcytail - bhi;
132
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
133
+ t1 = acytail * bcxtail;
134
+ c = splitter * acytail;
135
+ ahi = c - (c - acytail);
136
+ alo = acytail - ahi;
137
+ c = splitter * bcxtail;
138
+ bhi = c - (c - bcxtail);
139
+ blo = bcxtail - bhi;
140
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
141
+ _i = s0 - t0;
142
+ bvirt = s0 - _i;
143
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
144
+ _j = s1 + _i;
145
+ bvirt = _j - s1;
146
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
147
+ _i = _0 - t1;
148
+ bvirt = _0 - _i;
149
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
150
+ u3 = _j + _i;
151
+ bvirt = u3 - _j;
152
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
153
+ u[3] = u3;
154
+ const Dlen = sum(C2len, C2, 4, u, D);
155
+ return D[Dlen - 1];
156
+ }
157
+ function orient2d(ax, ay, bx, by, cx, cy) {
158
+ const detleft = (ay - cy) * (bx - cx);
159
+ const detright = (ax - cx) * (by - cy);
160
+ const det = detleft - detright;
161
+ const detsum = Math.abs(detleft + detright);
162
+ if (Math.abs(det) >= ccwerrboundA * detsum) return det;
163
+ return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);
164
+ }
165
+ export {
166
+ orient2d
167
+ };
168
+ //# sourceMappingURL=orient2d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orient2d.js","sources":["../../../../node_modules/robust-predicates/esm/orient2d.js"],"sourcesContent":["import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n"],"names":[],"mappings":";AAEA,MAAM,gBAAgB,IAAI,KAAK,WAAW;AAC1C,MAAM,gBAAgB,IAAI,KAAK,WAAW;AAC1C,MAAM,gBAAgB,IAAI,KAAK,WAAW,UAAU;AAEpD,MAAM,IAAI,IAAI,CAAC;AACf,MAAM,KAAK,IAAI,CAAC;AAChB,MAAM,KAAK,IAAI,EAAE;AACjB,MAAM,IAAI,IAAI,EAAE;AAChB,MAAM,IAAI,IAAI,CAAC;AAEf,SAAS,cAAc,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,QAAQ;AACnD,MAAI,SAAS,SAAS,SAAS;AAC/B,MAAI,OAAO,GAAG,KAAK,KAAK,KAAK,KAAK,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;AAE9D,QAAM,MAAM,KAAK;AACjB,QAAM,MAAM,KAAK;AACjB,QAAM,MAAM,KAAK;AACjB,QAAM,MAAM,KAAK;AAEjB,OAAK,MAAM;AACX,MAAI,WAAW;AACf,QAAM,KAAK,IAAI;AACf,QAAM,MAAM;AACZ,MAAI,WAAW;AACf,QAAM,KAAK,IAAI;AACf,QAAM,MAAM;AACZ,OAAK,MAAM,OAAO,KAAK,MAAM,M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U;AAEtB,QAAM,SAAS,KAAK,IAAI,UAAU,QAAQ;AAC1C,MAAI,KAAK,IAAI,GAAG,KAAK,eAAe,OAAQ,QAAO;AAEnD,SAAO,CAAC,cAAc,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM;AACxD;","x_google_ignoreList":[0]}
@@ -0,0 +1,91 @@
1
+ const epsilon = 11102230246251565e-32;
2
+ const splitter = 134217729;
3
+ const resulterrbound = (3 + 8 * epsilon) * epsilon;
4
+ function sum(elen, e, flen, f, h) {
5
+ let Q, Qnew, hh, bvirt;
6
+ let enow = e[0];
7
+ let fnow = f[0];
8
+ let eindex = 0;
9
+ let findex = 0;
10
+ if (fnow > enow === fnow > -enow) {
11
+ Q = enow;
12
+ enow = e[++eindex];
13
+ } else {
14
+ Q = fnow;
15
+ fnow = f[++findex];
16
+ }
17
+ let hindex = 0;
18
+ if (eindex < elen && findex < flen) {
19
+ if (fnow > enow === fnow > -enow) {
20
+ Qnew = enow + Q;
21
+ hh = Q - (Qnew - enow);
22
+ enow = e[++eindex];
23
+ } else {
24
+ Qnew = fnow + Q;
25
+ hh = Q - (Qnew - fnow);
26
+ fnow = f[++findex];
27
+ }
28
+ Q = Qnew;
29
+ if (hh !== 0) {
30
+ h[hindex++] = hh;
31
+ }
32
+ while (eindex < elen && findex < flen) {
33
+ if (fnow > enow === fnow > -enow) {
34
+ Qnew = Q + enow;
35
+ bvirt = Qnew - Q;
36
+ hh = Q - (Qnew - bvirt) + (enow - bvirt);
37
+ enow = e[++eindex];
38
+ } else {
39
+ Qnew = Q + fnow;
40
+ bvirt = Qnew - Q;
41
+ hh = Q - (Qnew - bvirt) + (fnow - bvirt);
42
+ fnow = f[++findex];
43
+ }
44
+ Q = Qnew;
45
+ if (hh !== 0) {
46
+ h[hindex++] = hh;
47
+ }
48
+ }
49
+ }
50
+ while (eindex < elen) {
51
+ Qnew = Q + enow;
52
+ bvirt = Qnew - Q;
53
+ hh = Q - (Qnew - bvirt) + (enow - bvirt);
54
+ enow = e[++eindex];
55
+ Q = Qnew;
56
+ if (hh !== 0) {
57
+ h[hindex++] = hh;
58
+ }
59
+ }
60
+ while (findex < flen) {
61
+ Qnew = Q + fnow;
62
+ bvirt = Qnew - Q;
63
+ hh = Q - (Qnew - bvirt) + (fnow - bvirt);
64
+ fnow = f[++findex];
65
+ Q = Qnew;
66
+ if (hh !== 0) {
67
+ h[hindex++] = hh;
68
+ }
69
+ }
70
+ if (Q !== 0 || hindex === 0) {
71
+ h[hindex++] = Q;
72
+ }
73
+ return hindex;
74
+ }
75
+ function estimate(elen, e) {
76
+ let Q = e[0];
77
+ for (let i = 1; i < elen; i++) Q += e[i];
78
+ return Q;
79
+ }
80
+ function vec(n) {
81
+ return new Float64Array(n);
82
+ }
83
+ export {
84
+ epsilon,
85
+ estimate,
86
+ resulterrbound,
87
+ splitter,
88
+ sum,
89
+ vec
90
+ };
91
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sources":["../../../../node_modules/robust-predicates/esm/util.js"],"sourcesContent":["export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n"],"names":[],"mappings":"AAAY,MAAC,UAAU;AACX,MAAC,WAAW;AACZ,MAAC,kBAAkB,IAAI,IAAI,WAAW;AAG3C,SAAS,IAAI,MAAM,GAAG,MAAM,GAAG,GAAG;AACrC,MAAI,GAAG,MAAM,IAAI;AACjB,MAAI,OAAO,EAAE,CAAC;AACd,MAAI,OAAO,EAAE,CAAC;AACd,MAAI,SAAS;AACb,MAAI,SAAS;AACb,MAAK,OAAO,SAAW,OAAO,CAAC,MAAO;AAClC,QAAI;AACJ,WAAO,EAAE,EAAE,MAAM;AAAA,EACrB,OAAO;AACH,QAAI;AACJ,WAAO,EAAE,EAAE,MAAM;AAAA,EACrB;AACA,MAAI,SAAS;AACb,MAAI,SAAS,QAAQ,SAAS,MAAM;AAChC,QAAK,OAAO,SAAW,OAAO,CAAC,MAAO;AAClC,aAAO,OAAO;AACd,WAAK,KAAK,OAAO;AACjB,aAAO,EAAE,EAAE,MAAM;AAAA,IACrB,OAAO;AACH,aAAO,OAAO;AACd,WAAK,KAAK,OAAO;AACjB,aAAO,EAAE,EAAE,MAAM;AAAA,IACrB;AACA,QAAI;AACJ,QAAI,OAAO,GAAG;AACV,QAAE,QAAQ,IAAI;AAAA,IAClB;AACA,WAAO,SAAS,QAAQ,SAAS,MAAM;AACnC,UAAK,OAAO,SAAW,OAAO,CAAC,MAAO;AAClC,eAAO,IAAI;AACX,gBAAQ,OAAO;AACf,aAAK,KAAK,OAAO,UAAU,OAAO;AAClC,eAAO,EAAE,EAAE,MAAM;AAAA,MACrB,OAAO;AACH,eAAO,IAA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