/*! * Copyright (c) 2017 TurfJS * turf.(http://turfjs.org) * github: https://github.com/Turfjs/turf * license: MIT * version: 4.6.1 */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.turf=t()}}(function(){var t;return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n||t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=u&&l===a.length-1);l++){if(u>=e){var c=e-u;if(c){var h=o(a[l],a[l-1])-180;return s(a[l],c,h,n)}return r(a[l])}u+=i(a[l],a[l+1],n)}return r(a[a.length-1])}},{"@turf/bearing":3,"@turf/destination":5,"@turf/distance":8,"@turf/helpers":11}],3:[function(t,e,n){function i(t,e,n){if(!0===n)return r(t,e);var i=Math.PI/180,s=180/Math.PI,a=o(t),u=o(e),l=i*a[0],c=i*u[0],h=i*a[1],f=i*u[1],p=Math.sin(c-l)*Math.cos(f),d=Math.cos(h)*Math.sin(f)-Math.sin(h)*Math.cos(f)*Math.cos(c-l);return s*Math.atan2(p,d)}function r(t,e){var n=i(e,t);return n=(n+180)%360}var o=t("@turf/invariant").getCoord;e.exports=i},{"@turf/invariant":4}],4:[function(t,e,n){function i(t){if(!t)throw new Error("obj is required");var e=r(t);if(e.length>1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")}function r(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return o(e),e;throw new Error("No valid coordinates")}function o(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&t[0].length)return o(t[0]);throw new Error("coordinates must only contain numbers")}function s(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function a(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function u(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(void 0===t||null===t)throw new Error("radians is required");var n=b[e||"kilometers"];if(!n)throw new Error("units is invalid");return t*n}function g(t,e){if(void 0===t||null===t)throw new Error("distance is required");var n=b[e||"kilometers"];if(!n)throw new Error("units is invalid");return t/n}function v(t,e){return m(g(t,e))}function y(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function m(t){if(null===t||void 0===t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null===t||void 0===t)throw new Error("distance is required");if(!(t>=0))throw new Error("distance must be a positive number");return d(g(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var i=I[e||"meters"];if(!i)throw new Error("invalid original units");var r=I[n||"kilometers"];if(!r)throw new Error("invalid final units");return t/i*r}var b={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,centimeters:6373e5,centimetres:6373e5,kilometers:6373,kilometres:6373,feet:20908792.65},I={kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,centimetres:1e4,millimeter:1e6,acres:247105e-9,miles:3.86e-7,yards:1.195990046,feet:10.763910417,inches:1550.003100006};e.exports={feature:i,geometry:r,featureCollection:u,geometryCollection:f,point:o,multiPoint:c,lineString:a,multiLineString:l,polygon:s,multiPolygon:h,radiansToDistance:d,distanceToRadians:g,distanceToDegrees:v,radians2degrees:m,degrees2radians:x,bearingToAngle:y,convertDistance:E,convertArea:w,round:p}},{}],7:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],8:[function(t,e,n){var i=t("@turf/invariant").getCoord,r=t("@turf/helpers").radiansToDistance;e.exports=function(t,e,n){var o=Math.PI/180,s=i(t),a=i(e),u=o*(a[1]-s[1]),l=o*(a[0]-s[0]),c=o*s[1],h=o*a[1],f=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(h);return r(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),n)}},{"@turf/helpers":9,"@turf/invariant":10}],9:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],10:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],11:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],12:[function(t,e,n){var i=t("@mapbox/geojson-area").geometry,r=t("@turf/meta").geomReduce;e.exports=function(t){return r(t,function(t,e){return t+i(e)},0)}},{"@mapbox/geojson-area":13,"@turf/meta":14}],13:[function(t,e,n){function i(t){var e,n=0;switch(t.type){case"Polygon":return r(t.coordinates);case"MultiPolygon":for(e=0;e0){e+=Math.abs(o(t[0]));for(var n=1;n2){for(l=0;l0&&(r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0]),n.push(r))}return n}function r(t){return t.geometry?t.geometry.type:t.type}var o=t("@turf/helpers"),s=t("lineclip"),a=t("@turf/invariant").getCoords,u=o.lineString,l=o.multiLineString,c=o.polygon,h=o.multiPolygon;e.exports=function(t,e){var n=r(t),o=a(t),f=t.properties;switch(n){case"LineString":case"MultiLineString":var p=[];return"LineString"===n&&(o=[o]),o.forEach(function(t){s(t,e,p)}),1===p.length?u(p[0],f):l(p,f);case"Polygon":return c(i(o,e),f);case"MultiPolygon":return h(o.map(function(t){return i(t,e)}),f);default:throw new Error("geometry "+n+" not supported")}}},{"@turf/helpers":17,"@turf/invariant":18,lineclip:19}],17:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],18:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],19:[function(t,e,n){"use strict";function i(t,e,n){var i,r,a,u,l,c=t.length,h=s(t[0],e),f=[];for(n||(n=[]),i=1;ie[2]&&(n|=2),t[1]e[3]&&(n|=8),n}e.exports=i,i.polyline=i,i.polygon=r},{}],20:[function(t,e,n){var i=t("@turf/helpers").polygon;e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],o=[t[2],t[1]];return i([[e,o,r,n,e]])}},{"@turf/helpers":21}],21:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],22:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]t&&(e.push(i),n=r)}return e},i.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},i.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*n),r=(this.length-1)*n-i;return function(t,e,n,i,r){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:r.x*o[0]+i.x*o[1]+n.x*o[2]+e.x*o[3],y:r.y*o[0]+i.y*o[1]+n.y*o[2]+e.y*o[3],z:r.z*o[0]+i.z*o[1]+n.z*o[2]+e.z*o[3]}}(r,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e.exports=i},{}],29:[function(t,e,n){var i=t("@turf/invariant"),r=i.getCoords;e.exports=function(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,i,o=r(t),s=0,a=1;a0}},{"@turf/invariant":30}],30:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],31:[function(t,e,n){function i(t,e){var n,i=!1;for(n=0;n0}function o(t,e,n){for(var i=!1,r=0;r=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]e[0])&&(!(t[2]e[1])&&!(t[3]t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function r(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var o=t("@turf/invariant"),s=o.getCoord,a=o.getCoords;e.exports=function(t,e,n){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=s(t),u=a(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===r(o,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h0)for(var n=0;n0}function s(t,e){return c(e,t)}function a(t,e){for(var n=!1,i=!1,r=t.coordinates[0].length,o=0;o=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1] line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var r=n[0][0],o=n[0][1],s=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],f=i[1][0],p=i[1][1],d=(p-h)*(s-r)-(f-c)*(u-o),g=(f-c)*(o-h)-(p-h)*(r-c),v=(s-r)*(o-h)-(u-o)*(r-c);if(0===d)return null;var y=g/d,m=v/d;if(y>=0&&y<=1&&m>=0&&m<=1){return l([r+y*(s-r),o+y*(u-o)])}return null}var r=t("@turf/meta"),o=t("geojson-rbush"),s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("@turf/line-segment"),l=s.point,c=r.featureEach,h=s.featureCollection;e.exports=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=s.feature(t)),"LineString"===e.type&&(e=s.feature(e)),"Feature"===t.type&&"Feature"===e.type&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var l=i(t,e);return l&&r.push(l),h(r)}var f=o();return f.load(u(e)),c(u(t),function(t){c(f.search(t),function(e){var o=i(t,e);if(o){var s=a(o).join(",");n[s]||(n[s]=!0,r.push(o))}})}),h(r)}},{"@turf/helpers":44,"@turf/invariant":45,"@turf/line-segment":46,"@turf/meta":50,"geojson-rbush":51}],43:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]r?n:r,i>o?i:o]}var s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("@turf/meta").flattenEach,l=s.lineString,c=s.featureCollection;e.exports=function(t){if(!t)throw new Error("geojson is required");var e=[];return u(t,function(t){i(t,e)}),c(e)}},{"@turf/helpers":47,"@turf/invariant":48,"@turf/meta":49}],47:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],48:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],49:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],50:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],51:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/helpers").featureCollection,o=t("@turf/meta").featureEach,s=t("rbush");e.exports=function(t){var e=s(t);return e.insert=function(t){return t.bbox=t.bbox?t.bbox:i(t),s.prototype.insert.call(this,t)},e.load=function(t){var e=[];return o(t,function(t){t.bbox=t.bbox?t.bbox:i(t),e.push(t)}),s.prototype.load.call(this,e)},e.remove=function(t){return s.prototype.remove.call(this,t)},e.clear=function(){return s.prototype.clear.call(this)},e.search=function(t){var e=s.prototype.search.call(this,this.toBBox(t));return r(e)},e.collides=function(t){return s.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=s.prototype.all.call(this);return r(t)},e.toJSON=function(){return s.prototype.toJSON.call(this)},e.fromJSON=function(t){return s.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e=t.bbox?t.bbox:i(t);return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}},{"@turf/bbox":43,"@turf/helpers":44,"@turf/meta":50,rbush:53}],52:[function(t,e,n){"use strict";function i(t,e,n,s,a){for(n=n||0,s=s||t.length-1,a=a||o;s>n;){if(s-n>600){var u=s-n+1,l=e-n+1,c=Math.log(u),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1);i(t,e,Math.max(n,Math.floor(e-l*h/u+f)),Math.min(s,Math.floor(e+(u-l)*h/u+f)),a)}var p=t[e],d=n,g=s;for(r(t,n,e),a(t[s],p)>0&&r(t,n,s);d0;)g--}0===a(t[n],p)?r(t,n,g):(g++,r(t,g,s)),g<=e&&(n=g+1),e<=g&&(s=g-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e){return te?1:0}e.exports=i},{}],53:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,n,i,r){for(var o,s=[e,n];s.length;)n=s.pop(),e=s.pop(),n-e<=i||(o=e+Math.ceil((n-e)/i/2)*i,m(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var m=t("quickselect");i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!g(t,e))return n;for(var r,o,s,a,u=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=v(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,a,u,l,h,f;for(l=h=1/0,i=e;i<=n-e;i++)r=s(t,0,i,this.toBBox),o=s(t,i,n,this.toBBox),a=p(r,o),u=c(r)+c(o),a=e;r--)o=t.children[r],a(c,t.leaf?u(o):o),f+=h(c);return f},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():o(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},{quickselect:52}],54:[function(t,e,n){function i(t,e){return t.length>1?u(t,e):a(t[0],e)}function r(t){return t.geometry?t.geometry.type:t.type}var o=t("@turf/invariant").getCoords,s=t("@turf/helpers"),a=s.lineString,u=s.multiLineString,l=s.featureCollection;e.exports=function(t,e){var n=r(t),s=o(t);if(e=e||t.properties||{},!s.length)throw new Error("polygon must contain coordinates");switch(n){case"Polygon":return i(s,e);case"MultiPolygon":var a=[];return s.forEach(function(t){a.push(i(t,e))}),l(a);default:throw new Error("geom "+n+" not supported")}}},{"@turf/helpers":55,"@turf/invariant":56}],55:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],56:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],57:[function(t,e,n){function i(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!l(t.coordinates,e.coordinates);case"LineString":return!r(e,t);case"Polygon":return!c(t,e)}break;case"LineString":switch(e.type){case"Point":return!r(t,e);case"LineString":return!o(t,e);case"Polygon":return!s(e,t)}break;case"Polygon":switch(e.type){case"Point":return!c(e,t);case"LineString":return!s(t,e);case"Polygon":return!a(e,t)}}}function r(t,e){for(var n=0;n0}function s(t,e){return f(e,p(t)).features.length>0}function a(t,e){for(var n=0;n=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}function l(t,e){return t[0]===e[0]&&t[1]===e[1]}var c=t("@turf/inside"),h=t("@turf/meta").flattenEach,f=t("@turf/line-intersect"),p=t("@turf/polygon-to-linestring");e.exports=function(t,e){var n;return h(t,function(t){h(e,function(e){if(!1===n)return!1;n=i(t.geometry,e.geometry)})}),n}},{"@turf/inside":58,"@turf/line-intersect":60,"@turf/meta":72,"@turf/polygon-to-linestring":73}],58:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":59,dup:34}],59:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],60:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":62,"@turf/invariant":63,"@turf/line-segment":64,"@turf/meta":68,dup:42,"geojson-rbush":69}],61:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":68,dup:43}],62:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],63:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],64:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":65,"@turf/invariant":66,"@turf/meta":67,dup:46}],65:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],66:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],67:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],68:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],69:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":61,"@turf/helpers":62,"@turf/meta":68,dup:51,rbush:71}],70:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],71:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:70}],72:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],73:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{"@turf/helpers":74,"@turf/invariant":75,dup:54}],74:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],75:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],76:[function(t,e,n){var i=t("geojson-equality"),r=t("@turf/clean-coords"),o=t("@turf/invariant"),s=o.getGeomType;e.exports=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return s(t)===s(e)&&new i({precision:6}).compare(r(t),r(e))}},{"@turf/clean-coords":77,"@turf/invariant":80,"geojson-equality":84}],77:[function(t,e,n){function i(t,e,n){var i={type:e,coordinates:n};return t.bbox&&(i.bbox=t.bbox),i}function r(t,e,n){var r=u.feature(i(t.geometry,e,n),t.properties);return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r}function o(t){var e=c(t);if(2===e.length&&!s(e[0],e[1]))return e;var n,i,r,o=[],u=e.length-1;o.push(e[0]);for(var l=1;l=Math.abs(f)?h>0?o<=i&&i<=a:a<=i&&i<=o:f>0?s<=r&&r<=u:u<=r&&r<=s)}var u=t("@turf/helpers"),l=t("@turf/invariant"),c=l.getCoords,h=l.getGeomType;e.exports=function(t,e){if(!t)throw new Error("geojson is required");var n=h(t),s=[];switch(n){case"LineString":s=o(t);break;case"MultiLineString":case"Polygon":c(t).forEach(function(t){s.push(o(t))});break;case"MultiPolygon":c(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(o(t))}),s.push(e)});break;case"Point":return t;case"MultiPoint":var a={};c(t).forEach(function(t){var e=t.join("-");a.hasOwnProperty(e)||(s.push(t),a[e]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?!0===e?(t.coordinates=s,t):i(t,n,s):!0===e?(t.geometry.coordinates=s,t):r(t,n,s)}},{"@turf/helpers":78,"@turf/invariant":79}],78:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],79:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],80:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],81:[function(t,e,n){function i(t){return null===t||void 0===t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function o(t,e,n){var o,c;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(u(t))return!!u(e)&&(t=s.call(t),e=s.call(e),l(t,e,n));if(r(t)){if(!r(e))return!1;if(t.length!==e.length)return!1;for(o=0;o=0;o--)if(h[o]!=f[o])return!1;for(o=h.length-1;o>=0;o--)if(c=h[o],!l(t[c],e[c],n))return!1;return typeof t==typeof e}var s=Array.prototype.slice,a=t("./lib/keys.js"),u=t("./lib/is_arguments.js"),l=e.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:o(t,e,n))}},{"./lib/is_arguments.js":82,"./lib/keys.js":83}],82:[function(t,e,n){function i(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();n=e.exports=o?i:r,n.supported=i,n.unsupported=r},{}],83:[function(t,e,n){function i(t){var e=[];for(var n in t)e.push(n);return e}n=e.exports="function"==typeof Object.keys?Object.keys:i,n.shim=i},{}],84:[function(t,e,n){function i(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})}function r(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function o(t,e){return s(t,e,{strict:!0})}var s=t("deep-equal"),a=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:o};a.prototype.compare=function(t,e){if(t.type!==e.type||!r(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,o=i(t),s=i(e);return o.every(function(t){return this.some(function(e){return n.compare(t,e)})},s)}}return!1},a.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=0&&(n=[].concat(t.slice(i,t.length),t.slice(1,i+1))),n},a.prototype.comparePath=function(t,e){var n=this;return t.every(function(t,e){return n.compareCoord(t,this[e])},e)},a.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length),r=this;return n.every(function(t){return this.some(function(e){return r.compareLine(t,e,1,!0)})},i)}return!1},a.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},a.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},a.prototype.removePseudo=function(t){return t},e.exports=a},{"deep-equal":81}],85:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/invariant"),o=t("@turf/line-overlap"),s=t("@turf/line-intersect"),a=t("geojson-equality"),u=i.coordAll,l=i.segmentEach,c=r.getGeomType;e.exports=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=c(t);if(n!==c(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new a({precision:6}).compare(t,e))return!1;var i=0;switch(n){case"MultiPoint":var r=u(t),h=u(e);r.forEach(function(t){h.forEach(function(e){t[0]===e[0]&&t[1]===e[1]&&i++})});break;case"LineString":case"MultiLineString":l(t,function(t){l(e,function(e){o(t,e).features.length&&i++})});break;case"Polygon":case"MultiPolygon":l(t,function(t){l(e,function(e){s(t,e).features.length&&i++})})}return i>0}},{"@turf/invariant":86,"@turf/line-intersect":87,"@turf/line-overlap":99,"@turf/meta":114,"geojson-equality":118}],86:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],87:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":89,"@turf/invariant":90,"@turf/line-segment":91,"@turf/meta":95,dup:42,"geojson-rbush":96}],88:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":95,dup:43}],89:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],90:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],91:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":92,"@turf/invariant":93,"@turf/meta":94,dup:46}],92:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],93:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],94:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],95:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],96:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":88,"@turf/helpers":89,"@turf/meta":95,dup:51,rbush:98}],97:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],98:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:97}],99:[function(t,e,n){function i(t,e){var n=o(e),i=o(t),r=i[0],s=i[i.length-1];return a(n[0],r)?t.geometry.coordinates.unshift(n[1]):a(n[0],s)?t.geometry.coordinates.push(n[1]):a(n[1],r)?t.geometry.coordinates.unshift(n[0]):a(n[1],s)&&t.geometry.coordinates.push(n[0]),t}var r=t("@turf/line-segment"),o=t("@turf/invariant").getCoords,s=t("geojson-rbush"),a=t("deep-equal"),u=t("@turf/helpers").featureCollection,l=t("@turf/meta").featureEach;e.exports=function(t,e){var n=[],c=s();c.load(r(t));var h;return l(r(e),function(t){var e=!1;l(c.search(t),function(n){if(!1===e){var r=o(t).sort(),s=o(n).sort();a(r,s)&&(e=!0,h=h?i(h,t):t)}}),!1===e&&h&&(n.push(h),h=void 0)}),h&&n.push(h),u(n)}},{"@turf/helpers":101,"@turf/invariant":102,"@turf/line-segment":103,"@turf/meta":107,"deep-equal":108,"geojson-rbush":111}],100:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":107,dup:43}],101:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],102:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],103:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":104,"@turf/invariant":105,"@turf/meta":106,dup:46}],104:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],105:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],106:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],107:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],108:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{"./lib/is_arguments.js":109,"./lib/keys.js":110,dup:81}],109:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],110:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],111:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":100,"@turf/helpers":101,"@turf/meta":107,dup:51,rbush:113}],112:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],113:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:112}],114:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],115:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{"./lib/is_arguments.js":116,"./lib/keys.js":117,dup:81}],116:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],117:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],118:[function(t,e,n){arguments[4][84][0].apply(n,arguments)},{"deep-equal":115,dup:84}],119:[function(t,e,n){function i(t,e,n,i){var r=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==r*a-o*s&&(i?"start"===i?Math.abs(s)>=Math.abs(a)?s>0?t[0]0?t[1]=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]0?t[1]<=n[1]&&n[1]=Math.abs(a)?s>0?t[0]0?t[1]=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var r=t("@turf/invariant").getCoords;e.exports=function(t,e,n){for(var o=r(t),s=r(e),a=0;a=0?(o>=N?10:o>=C?5:o>=S?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=N?10:o>=C?5:o>=S?2:1)}function r(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=N?r*=10:o>=C?r*=5:o>=S&&(r*=2),ee?1:t>=e?0:NaN},a=function(t){return 1===t.length&&(t=e(t)),{left:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)<0?i=o+1:r=o}return i},right:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)>0?r=o:i=o+1}return i}}},u=a(s),l=u.right,c=u.left,h=function(t,e){null==e&&(e=n);for(var i=0,r=t.length-1,o=t[0],s=new Array(r<0?0:r);it?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},g=function(t,e){var n,i,r=t.length,o=0,s=-1,a=0,u=0;if(null==e)for(;++s1)return u/(o-1)},v=function(t,e){var n=g(t,e);return n?Math.sqrt(n):n},y=function(t,e){var n,i,r,o=t.length,s=-1;if(null==e){for(;++s=n)for(i=r=n;++sn&&(i=n),r=n)for(i=r=n;++sn&&(i=n),r0)for(t=Math.ceil(t/s),e=Math.floor(e/s),o=new Array(r=Math.ceil(e-t+1));++uf;)p.pop(),--d;var g,v=new Array(d+1);for(o=0;o<=d;++o)g=v[o]=[],g.x0=o>0?p[o-1]:h,g.x1=o=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),s=+n(t[o],o,t);return s+(+n(t[o+1],o+1,t)-s)*(r-o)}},T=function(t,e,n){return t=E.call(t,d).sort(s),Math.ceil((n-e)/(2*(P(t,.75)-P(t,.25))*Math.pow(t.length,-1/3)))},O=function(t,e,n){return Math.ceil((n-e)/(3.5*v(t)*Math.pow(t.length,-1/3)))},_=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o=n)for(i=n;++oi&&(i=n)}else for(;++o=n)for(i=n;++oi&&(i=n);return i},A=function(t,e){var n,i=t.length,r=i,o=-1,s=0;if(null==e)for(;++o=0;)for(i=t[r],e=i.length;--e>=0;)n[--s]=i[e];return n},q=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o=n)for(i=n;++on&&(i=n)}else for(;++o=n)for(i=n;++on&&(i=n);return i},k=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},G=function(t,e){if(n=t.length){var n,i,r=0,o=0,a=t[o];for(null==e&&(e=s);++r1?0:t<-1?Be:Math.acos(t)}function o(t){return t>1?ze:t<-1?-ze:Math.asin(t)}function s(t){return(t=en(t/2))*t}function a(){}function u(t,e){t&&an.hasOwnProperty(t.type)&&an[t.type](t,e)}function l(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r=0?1:-1,r=i*n,o=Ze(e),s=en(e),a=fe*s,u=he*o+a*Ze(r),l=a*i*en(r);ln.add(Je(l,u)),ce=t,he=o,fe=s}function g(t){return[Je(t[1],t[0]),o(t[2])]}function v(t){var e=t[0],n=t[1],i=Ze(n);return[i*Ze(e),i*en(e),en(n)]}function y(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function m(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function x(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function E(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function w(t){var e=rn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function b(t,e){we.push(be=[pe=t,ge=t]),eve&&(ve=e)}function I(t,e){var n=v([t*Ue,e*Ue]);if(Ee){var i=m(Ee,n),r=[i[1],-i[0],0],o=m(r,i);w(o),o=g(o);var s,a=t-ye,u=a>0?1:-1,l=o[0]*Ye*u,c=We(a)>180;c^(u*yeve&&(ve=s):(l=(l+360)%360-180,c^(u*yeve&&(ve=e))),c?tR(pe,ge)&&(ge=t):R(t,ge)>R(pe,ge)&&(pe=t):ge>=pe?(tge&&(ge=t)):t>ye?R(pe,t)>R(pe,ge)&&(ge=t):R(t,ge)>R(pe,ge)&&(pe=t)}else we.push(be=[pe=t,ge=t]);eve&&(ve=e),Ee=n,ye=t}function N(){dn.point=I}function C(){be[0]=pe,be[1]=ge,dn.point=b,Ee=null}function S(t,e){if(Ee){var n=t-ye;pn.add(We(n)>180?n+(n>0?360:-360):n)}else me=t,xe=e;hn.point(t,e),I(t,e)}function M(){hn.lineStart()}function L(){S(me,xe),hn.lineEnd(),We(pn)>je&&(pe=-(ge=180)),be[0]=pe,be[1]=ge,Ee=null}function R(t,e){return(e-=t)<0?e+360:e}function P(t,e){return t[0]-e[0]}function T(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eBe?t-Xe:t<-Be?t+Xe:t,e]}function V(t,e,n){return(t%=Xe)?e||n?xn(Y(t),U(e,n)):Y(t):e||n?U(e,n):z}function X(t){return function(e,n){return e+=t,[e>Be?e-Xe:e<-Be?e+Xe:e,n]}}function Y(t){var e=X(t);return e.invert=X(-t),e}function U(t,e){function n(t,e){var n=Ze(e),u=Ze(t)*n,l=en(t)*n,c=en(e),h=c*i+u*r;return[Je(l*s-h*a,u*i-c*r),o(h*s+l*a)]}var i=Ze(t),r=en(t),s=Ze(e),a=en(e);return n.invert=function(t,e){var n=Ze(e),u=Ze(t)*n,l=en(t)*n,c=en(e),h=c*s-l*a;return[Je(l*s+c*a,u*i+h*r),o(h*i-u*r)]},n}function W(t,e,n,i,r,o){if(n){var s=Ze(e),a=en(e),u=i*n;null==r?(r=e+i*Xe,o=e-u/2):(r=H(s,r),o=H(s,o),(i>0?ro)&&(r+=i*Xe));for(var l,c=r;i>0?c>o:c0)do{u.point(0===c||3===c?t:i,c>1?r:n)}while((c=(c+s+4)%4)!==h);else u.point(o[0],o[1])}function a(e,r){return We(e[0]-t)0?0:3:We(e[0]-i)0?2:1:We(e[1]-n)0?1:0:r>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){function l(t,e){o(t,e)&&M.point(t,e)}function c(){for(var e=0,n=0,i=y.length;nr&&(h-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(h-o)*(r-s)<(f-s)*(t-o)&&--e;return e}function h(){M=L,v=[],y=[],S=!0}function f(){var t=c(),n=S&&t,i=(v=e.merge(v)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),i&&Fn(v,u,t,s,a),a.polygonEnd()),M=a,v=y=m=null}function p(){R.point=g,y&&y.push(m=[]),C=!0,N=!1,b=I=NaN}function d(){v&&(g(x,E),w&&N&&L.rejoin(),v.push(L.result())),R.point=l,N&&M.lineEnd()}function g(e,s){var a=o(e,s);if(y&&m.push([e,s]),C)x=e,E=s,w=a,C=!1,a&&(M.lineStart(),M.point(e,s));else if(a&&N)M.point(e,s);else{var u=[b=Math.max(kn,Math.min(qn,b)),I=Math.max(kn,Math.min(qn,I))],l=[e=Math.max(kn,Math.min(qn,e)),s=Math.max(kn,Math.min(qn,s))];An(u,l,t,n,i,r)?(N||(M.lineStart(),M.point(u[0],u[1])),M.point(l[0],l[1]),a||M.lineEnd(),S=!1):a&&(M.lineStart(),M.point(e,s),S=!1)}b=e,I=s,N=a}var v,y,m,x,E,w,b,I,N,C,S,M=a,L=_n(),R={point:l,lineStart:p,lineEnd:d,polygonStart:h,polygonEnd:f};return R}}function Q(){Vn.point=tt,Vn.lineEnd=$}function $(){Vn.point=Vn.lineEnd=a}function tt(t,e){t*=Ue,e*=Ue,En=t,wn=en(e),bn=Ze(e),Vn.point=et}function et(t,e){t*=Ue,e*=Ue;var n=en(e),i=Ze(e),r=We(t-En),o=Ze(r),s=en(r),a=i*s,u=bn*n-wn*i*o,l=wn*n+bn*i*o;zn.add(Je(rn(a*a+u*u),l)),En=t,wn=n,bn=i}function nt(t,e){return!(!t||!Jn.hasOwnProperty(t.type))&&Jn[t.type](t,e)}function it(t,e){return 0===Wn(t,e)}function rt(t,e){var n=Wn(t[0],t[1]);return Wn(t[0],e)+Wn(e,t[1])<=n+je}function ot(t,e){return!!Bn(t.map(st),at(e))}function st(t){return t=t.map(at),t.pop(),t}function at(t){return[t[0]*Ue,t[1]*Ue]}function ut(t,n,i){var r=e.range(t,n-je,i).concat(n);return function(t){return r.map(function(e){return[t,e]})}}function lt(t,n,i){var r=e.range(t,n-je,i).concat(n);return function(t){return r.map(function(e){return[e,t]})}}function ct(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return e.range(Ke(s/y)*y,o,y).map(p).concat(e.range(Ke(c/m)*m,l,m).map(d)).concat(e.range(Ke(r/g)*g,i,g).filter(function(t){return We(t%y)>je}).map(h)).concat(e.range(Ke(u/v)*v,a,v).filter(function(t){return We(t%m)>je}).map(f))}var i,r,o,s,a,u,l,c,h,f,p,d,g=10,v=g,y=90,m=360,x=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[p(s).concat(d(l).slice(1),p(o).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.extentMajor(e).extentMinor(e):t.extentMinor()},t.extentMajor=function(e){return arguments.length?(s=+e[0][0],o=+e[1][0],c=+e[0][1],l=+e[1][1],s>o&&(e=s,s=o,o=e),c>l&&(e=c,c=l,l=e),t.precision(x)):[[s,c],[o,l]]},t.extentMinor=function(e){return arguments.length?(r=+e[0][0],i=+e[1][0],u=+e[0][1],a=+e[1][1],r>i&&(e=r,r=i,i=e),u>a&&(e=u,u=a,a=e),t.precision(x)):[[r,u],[i,a]]},t.step=function(e){return arguments.length?t.stepMajor(e).stepMinor(e):t.stepMinor()},t.stepMajor=function(e){return arguments.length?(y=+e[0],m=+e[1],t):[y,m]},t.stepMinor=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.precision=function(e){return arguments.length?(x=+e,h=ut(u,a,90),f=lt(r,i,x),p=ut(c,l,90),d=lt(s,o,x),t):x},t.extentMajor([[-180,-90+je],[180,90-je]]).extentMinor([[-180,-80-je],[180,80+je]])}function ht(){return ct()()}function ft(){ei.point=pt}function pt(t,e){ei.point=dt,In=Cn=t,Nn=Sn=e}function dt(t,e){ti.add(Sn*t-Cn*e),Cn=t,Sn=e}function gt(){dt(In,Nn)}function vt(t,e){tri&&(ri=t),eoi&&(oi=e)}function yt(t,e){ai+=t,ui+=e,++li}function mt(){vi.point=xt}function xt(t,e){vi.point=Et,yt(Rn=t,Pn=e)}function Et(t,e){var n=t-Rn,i=e-Pn,r=rn(n*n+i*i);ci+=r*(Rn+t)/2,hi+=r*(Pn+e)/2,fi+=r,yt(Rn=t,Pn=e)}function wt(){vi.point=yt}function bt(){vi.point=Nt}function It(){Ct(Mn,Ln)}function Nt(t,e){vi.point=Ct,yt(Mn=Rn=t,Ln=Pn=e)}function Ct(t,e){var n=t-Rn,i=e-Pn,r=rn(n*n+i*i);ci+=r*(Rn+t)/2,hi+=r*(Pn+e)/2,fi+=r,r=Pn*t-Rn*e,pi+=r*(Rn+t),di+=r*(Pn+e),gi+=3*r,yt(Rn=t,Pn=e)}function St(t){this._context=t}function Mt(t,e){Ii.point=Lt,mi=Ei=t,xi=wi=e}function Lt(t,e){Ei-=t,wi-=e,bi.add(rn(Ei*Ei+wi*wi)),Ei=t,wi=e}function Rt(){this._string=[]}function Pt(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Tt(t){return t.length>1}function Ot(t,e){return((t=t.x)[0]<0?t[1]-ze-je:ze-t[1])-((e=e.x)[0]<0?e[1]-ze-je:ze-e[1])}function _t(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Be:-Be,u=We(o-n);We(u-Be)0?ze:-ze),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(o,i),e=0):r!==a&&u>=Be&&(We(n-r)je?He((en(e)*(o=Ze(i))*en(n)-en(i)*(r=Ze(e))*en(t))/(r*o*s)):(e+i)/2}function Dt(t,e,n,i){var r;if(null==t)r=n*ze,i.point(-Be,r),i.point(0,r),i.point(Be,r),i.point(Be,0),i.point(Be,-r),i.point(0,-r),i.point(-Be,-r),i.point(-Be,0),i.point(-Be,r);else if(We(t[0]-e[0])>je){var o=t[0]4*e&&v--){var w=a+p,b=u+d,I=l+g,N=rn(w*w+b*b+I*I),C=o(I/=N),S=We(We(I)-1)e||We((m*P+x*T)/E-.5)>.3||a*p+u*d+l*g2?t[2]%360*Ue:0,r()):[w*Ye,b*Ye,I*Ye]},e.precision=function(t){return arguments.length?(R=Ti(i,L=t*t),o()):rn(L)},e.fitExtent=function(t,n){return kt(e,t,n)},e.fitSize=function(t,n){return Gt(e,t,n)},function(){return s=t.apply(this,arguments),e.invert=s.invert&&n,r()}}function Xt(t){var e=0,n=Be/3,i=Vt(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Ue,n=t[1]*Ue):[e*Ye,n*Ye]},r}function Yt(t){function e(t,e){return[t*n,en(e)/n]}var n=Ze(t);return e.invert=function(t,e){return[t/n,o(e*n)]},e}function Ut(t,e){function n(t,e){var n=rn(s-2*r*en(e))/r;return[n*en(t*=r),a-n*Ze(t)]}var i=en(t),r=(i+en(e))/2;if(We(r)0?e<-ze+je&&(e=-ze+je):e>ze-je&&(e=ze-je);var n=o/tn(Qt(e),r);return[n*en(r*t),o-n*Ze(r*t)]}var i=Ze(t),r=t===e?en(t):$e(i/Ze(e))/$e(Qt(e)/Qt(t)),o=i*tn(Qt(t),r)/r;return r?(n.invert=function(t,e){var n=o-e,i=nn(r)*rn(t*t+n*n);return[Je(t,We(n))/r*nn(n),2*He(tn(o/i,1/r))-ze]},n):Zt}function te(t,e){return[t,e]}function ee(t,e){function n(t,e){var n=o-e,i=r*t;return[n*en(i),o-n*Ze(i)]}var i=Ze(t),r=t===e?en(t):(i-Ze(e))/(e-t),o=i/r+t;return We(r)0?1:t<0?-1:0},rn=Math.sqrt,on=Math.tan,sn={Feature:function(t,e){u(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++ije?ve=90:pn<-je&&(de=-90),be[0]=pe,be[1]=ge}},gn=function(t){var e,n,i,r,o,s,a;if(ve=ge=-(pe=de=1/0),we=[],un(t,dn),n=we.length){for(we.sort(P),e=1,i=we[0],o=[i];eR(i[0],i[1])&&(i[1]=r[1]),R(r[0],i[1])>R(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,e=0,i=o[n];e<=n;i=r,++e)r=o[e],(a=R(i[1],r[0]))>s&&(s=a,pe=r[0],ge=i[1])}return we=be=null,pe===1/0||de===1/0?[[NaN,NaN],[NaN,NaN]]:[[pe,de],[ge,ve]]},vn={sphere:a,point:O,lineStart:A,lineEnd:q,polygonStart:function(){vn.lineStart=k,vn.lineEnd=G},polygonEnd:function(){vn.lineStart=A,vn.lineEnd=q}},yn=function(t){Ie=Ne=Ce=Se=Me=Le=Re=Pe=Te=Oe=_e=0,un(t,vn);var e=Te,n=Oe,i=_e,r=e*e+n*n+i*i;return r<1e-12&&(e=Le,n=Re,i=Pe,Ne2?t[2]*Ue:0),e.invert=function(e){return e=t.invert(e[0]*Ue,e[1]*Ue),e[0]*=Ye,e[1]*=Ye,e},e},On=function(){function t(t,e){n.push(t=i(t,e)),t[0]*=Ye,t[1]*=Ye}function e(){var t=r.apply(this,arguments),e=o.apply(this,arguments)*Ue,u=s.apply(this,arguments)*Ue;return n=[],i=V(-t[0]*Ue,-t[1]*Ue,0).invert,W(a,e,u,1),t={type:"Polygon",coordinates:[n]},n=i=null,t}var n,i,r=mn([0,0]),o=mn(90),s=mn(6),a={point:t};return e.center=function(t){return arguments.length?(r="function"==typeof t?t:mn([+t[0],+t[1]]),e):r},e.radius=function(t){return arguments.length?(o="function"==typeof t?t:mn(+t),e):o},e.precision=function(t){return arguments.length?(s="function"==typeof t?t:mn(+t),e):s},e},_n=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:a,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},An=function(t,e,n,i,r,o){var s,a=t[0],u=t[1],l=e[0],c=e[1],h=0,f=1,p=l-a,d=c-u;if(s=n-a,p||!(s>0)){if(s/=p,p<0){if(s0){if(s>f)return;s>h&&(h=s)}if(s=r-a,p||!(s<0)){if(s/=p,p<0){if(s>f)return;s>h&&(h=s)}else if(p>0){if(s0)){if(s/=d,d<0){if(s0){if(s>f)return;s>h&&(h=s)}if(s=o-u,d||!(s<0)){if(s/=d,d<0){if(s>f)return;s>h&&(h=s)}else if(d>0){if(s0&&(t[0]=a+h*p,t[1]=u+h*d),f<1&&(e[0]=a+f*p,e[1]=u+f*d),!0}}}}},Dn=function(t,e){return We(t[0]-e[0])=0;--o)r.point((c=l[o])[0],c[1]);else i(f.x,f.p.x,-1,r);f=f.p}f=f.o,l=f.z,p=!p}while(!f.v);r.lineEnd()}}},qn=1e9,kn=-qn,Gn=function(){var t,e,n,i=0,r=0,o=960,s=500;return n={stream:function(n){return t&&e===n?t:t=K(i,r,o,s)(e=n)},extent:function(a){return arguments.length?(i=+a[0][0],r=+a[0][1],o=+a[1][0],s=+a[1][1],t=e=null,n):[[i,r],[o,s]]}}},jn=ae(),Bn=function(t,e){var n=e[0],i=e[1],r=[en(n),-Ze(n),0],s=0,a=0;jn.reset();for(var u=0,l=t.length;u=0?1:-1,L=M*S,R=L>Be,P=g*N;if(jn.add(Je(P*M*en(L),y*C+P*Ze(L))),s+=R?S+M*Xe:S,R^p>=n^b>=n){var T=m(v(f),v(E));w(T);var O=m(r,T);w(O);var _=(R^S>=0?-1:1)*o(O[2]);(i>_||i===_&&(T[0]||T[1]))&&(a+=R^S>=0?1:-1)}}return(s<-je||s0){for(w||(s.polygonStart(),w=!0),s.lineStart(),t=0;t1&&2&r&&o.push(o.pop().concat(o.shift())),g.push(o.filter(Tt))}var d,g,v,y=n(s),m=o.invert(r[0],r[1]),x=_n(),E=n(x),w=!1,b={point:a,lineStart:l,lineEnd:c,polygonStart:function(){b.point=h,b.lineStart=f,b.lineEnd=p,g=[],d=[]},polygonEnd:function(){b.point=a,b.lineStart=l,b.lineEnd=c,g=e.merge(g);var t=Bn(d,m);g.length?(w||(s.polygonStart(),w=!0),Fn(g,Ot,t,i,s)):t&&(w||(s.polygonStart(),w=!0),s.lineStart(),i(null,null,1,s),s.lineEnd()),w&&(s.polygonEnd(),w=!1),g=d=null},sphere:function(){s.polygonStart(),s.lineStart(),i(null,null,1,s),s.lineEnd(),s.polygonEnd()}};return b}},Si=Ci(function(){return!0},_t,Dt,[-Be,-ze]),Mi=function(t,e){function n(n,i,r,o){W(o,t,e,r,n,i)}function i(t,e){return Ze(t)*Ze(e)>a}function r(t){var e,n,r,a,c;return{lineStart:function(){a=r=!1,c=1},point:function(h,f){var p,d=[h,f],g=i(h,f),v=u?g?0:s(h,f):g?s(h+(h<0?Be:-Be),f):0;if(!e&&(a=r=g)&&t.lineStart(),g!==r&&(!(p=o(e,d))||Dn(e,p)||Dn(d,p))&&(d[0]+=je,d[1]+=je,g=i(d[0],d[1])),g!==r)c=0,g?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(l&&e&&u^g){var y;v&n||!(y=o(d,e,!0))||(c=0,u?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Dn(e,d)||t.point(d[0],d[1]),e=d,r=g,n=v},lineEnd:function(){r&&t.lineEnd(),e=null},clean:function(){return c|(a&&r)<<1}}}function o(t,e,n){var i=v(t),r=v(e),o=[1,0,0],s=m(i,r),u=y(s,s),l=s[0],c=u-l*l;if(!c)return!n&&t;var h=a*u/c,f=-a*l/c,p=m(o,s),d=E(o,h);x(d,E(s,f));var w=p,b=y(d,w),I=y(w,w),N=b*b-I*(y(d,d)-1);if(!(N<0)){var C=rn(N),S=E(w,(-b-C)/I);if(x(S,d),S=g(S),!n)return S;var M,L=t[0],R=e[0],P=t[1],T=e[1];R0^S[1]<(We(S[0]-L)Be^(L<=S[0]&&S[0]<=R)){var D=E(w,(-b+C)/I);return x(D,d),[S,g(D)]}}}function s(e,n){var i=u?t:Be-t,r=0;return e<-i?r|=1:e>i&&(r|=2),n<-i?r|=4:n>i&&(r|=8),r}var a=Ze(t),u=a>0,l=We(a)>je;return Ci(i,r,n,u?[0,-t]:[-Be,t-Be])},Li=function(t){return{stream:Ft(t)}};qt.prototype={constructor:qt,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ri=16,Pi=Ze(30*Ue),Ti=function(t,e){return+e?Bt(t,e):jt(t)},Oi=Ft({point:function(t,e){this.stream.point(t*Ue,e*Ue)}}),_i=function(){return Xt(Ut).scale(155.424).center([0,33.6442])},Ai=function(){return _i().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},Di=function(){function t(t){var e=t[0],n=t[1];return a=null,r.point(e,n),a||(o.point(e,n),a)||(s.point(e,n),a)}function e(){return n=i=null,t}var n,i,r,o,s,a,u=Ai(),l=_i().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=_i().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){a=[t,e]}};return t.invert=function(t){var e=u.scale(),n=u.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?l:r>=.166&&r<.234&&i>=-.214&&i<-.115?c:u).invert(t)},t.stream=function(t){return n&&i===t?n:n=Wt([u.stream(i=t),l.stream(t),c.stream(t)])},t.precision=function(t){return arguments.length?(u.precision(t),l.precision(t),c.precision(t),e()):u.precision()},t.scale=function(e){return arguments.length?(u.scale(e),l.scale(.35*e),c.scale(e),t.translate(u.translate())):u.scale()},t.translate=function(t){if(!arguments.length)return u.translate();var n=u.scale(),i=+t[0],a=+t[1];return r=u.translate(t).clipExtent([[i-.455*n,a-.238*n],[i+.455*n,a+.238*n]]).stream(h), o=l.translate([i-.307*n,a+.201*n]).clipExtent([[i-.425*n+je,a+.12*n+je],[i-.214*n-je,a+.234*n-je]]).stream(h),s=c.translate([i-.205*n,a+.212*n]).clipExtent([[i-.214*n+je,a+.166*n+je],[i-.115*n-je,a+.234*n-je]]).stream(h),e()},t.fitExtent=function(e,n){return kt(t,e,n)},t.fitSize=function(e,n){return Gt(t,e,n)},t.scale(1070)},Fi=Ht(function(t){return rn(2/(1+t))});Fi.invert=Jt(function(t){return 2*o(t/2)});var qi=function(){return zt(Fi).scale(124.75).clipAngle(179.999)},ki=Ht(function(t){return(t=r(t))&&t/en(t)});ki.invert=Jt(function(t){return t});var Gi=function(){return zt(ki).scale(79.4188).clipAngle(179.999)};Zt.invert=function(t,e){return[t,2*He(Qe(e))-ze]};var ji=function(){return Kt(Zt).scale(961/Xe)},Bi=function(){return Xt($t).scale(109.5).parallels([30,30])};te.invert=te;var zi=function(){return zt(te).scale(152.63)},Vi=function(){return Xt(ee).scale(131.154).center([0,13.9389])};ne.invert=Jt(He);var Xi=function(){return zt(ne).scale(144.049).clipAngle(60)},Yi=function(){function t(){return r=o=null,s}var e,n,i,r,o,s,a=1,u=0,l=0,c=1,h=1,f=Qn,p=null,d=Qn;return s={stream:function(t){return r&&o===t?r:r=f(d(o=t))},clipExtent:function(r){return arguments.length?(d=null==r?(p=e=n=i=null,Qn):K(p=+r[0][0],e=+r[0][1],n=+r[1][0],i=+r[1][1]),t()):null==p?null:[[p,e],[n,i]]},scale:function(e){return arguments.length?(f=ie((a=+e)*c,a*h,u,l),t()):a},translate:function(e){return arguments.length?(f=ie(a*c,a*h,u=+e[0],l=+e[1]),t()):[u,l]},reflectX:function(e){return arguments.length?(f=ie(a*(c=e?-1:1),a*h,u,l),t()):c<0},reflectY:function(e){return arguments.length?(f=ie(a*c,a*(h=e?-1:1),u,l),t()):h<0},fitExtent:function(t,e){return kt(s,t,e)},fitSize:function(t,e){return Gt(s,t,e)}}};re.invert=Jt(o);var Ui=function(){return zt(re).scale(249.5).clipAngle(90+je)};oe.invert=Jt(function(t){return 2*He(t)});var Wi=function(){return zt(oe).scale(250).clipAngle(142)};se.invert=function(t,e){return[-e,2*He(Qe(t))-ze]};var Hi=function(){var t=Kt(se),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90]).scale(159.155)};t.geoArea=fn,t.geoBounds=gn,t.geoCentroid=yn,t.geoCircle=On,t.geoClipExtent=Gn,t.geoContains=Zn,t.geoDistance=Wn,t.geoGraticule=ct,t.geoGraticule10=ht,t.geoInterpolate=Kn,t.geoLength=Xn,t.geoPath=Ni,t.geoAlbers=Ai,t.geoAlbersUsa=Di,t.geoAzimuthalEqualArea=qi,t.geoAzimuthalEqualAreaRaw=Fi,t.geoAzimuthalEquidistant=Gi,t.geoAzimuthalEquidistantRaw=ki,t.geoConicConformal=Bi,t.geoConicConformalRaw=$t,t.geoConicEqualArea=_i,t.geoConicEqualAreaRaw=Ut,t.geoConicEquidistant=Vi,t.geoConicEquidistantRaw=ee,t.geoEquirectangular=zi,t.geoEquirectangularRaw=te,t.geoGnomonic=Xi,t.geoGnomonicRaw=ne,t.geoIdentity=Yi,t.geoProjection=zt,t.geoProjectionMutator=Vt,t.geoMercator=ji,t.geoMercatorRaw=Zt,t.geoOrthographic=Ui,t.geoOrthographicRaw=re,t.geoStereographic=Wi,t.geoStereographicRaw=oe,t.geoTransverseMercator=Hi,t.geoTransverseMercatorRaw=se,t.geoRotation=Tn,t.geoStream=un,t.geoTransform=Li,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":128}],130:[function(e,n,i){!function(e,r){"object"==typeof i&&void 0!==n?r(i):"function"==typeof t&&t.amd?t(["exports"],r):r(e.jsts=e.jsts||{})}(this,function(t){"use strict";function e(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function n(){}function i(){}function r(){}function o(){}function s(){}function a(){}function u(){}function l(t){this.name="RuntimeException",this.message=t,this.stack=(new Error).stack,Error.call(this,t)}function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function h(){if(0===arguments.length)l.call(this);else if(1===arguments.length){var t=arguments[0];l.call(this,t)}}function f(){}function p(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)p.call(this,0,0);else if(1===arguments.length){var t=arguments[0];p.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];p.call(this,e,n,p.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.x=i,this.y=r,this.z=o}}function d(){if(this.dimensionsToTest=2,0===arguments.length)d.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new i("only 2 or 3 dimensions may be specified");this.dimensionsToTest=t}}function g(){}function v(){}function y(t){this.message=t||""}function m(){}function x(t){this.message=t||""}function E(t){this.message=t||""}function w(){this.array_=[],arguments[0]instanceof v&&this.addAll(arguments[0])}function b(){if(w.apply(this),0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}function I(){if(this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof I){var e=arguments[0];this.init(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(r,o,s,a)}}function N(){}function C(){N.call(this,"Projective point not representable on the Cartesian plane.")}function S(){}function M(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}function L(){}function R(t){this.str=t}function P(t){this.value=t}function T(){}function O(){if(this.hi=0,this.lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof O){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];O.call(this,O.parse(n))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}function _(){}function A(){}function D(){}function F(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof F&&arguments[1]instanceof F){var i=arguments[0],r=arguments[1];this.x=i.y*r.w-r.y*i.w,this.y=r.x*i.w-i.x*r.w,this.w=i.x*r.y-r.x*i.y}else if(arguments[0]instanceof p&&arguments[1]instanceof p){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2];this.x=a,this.y=u,this.w=l}else if(4===arguments.length){var c=arguments[0],h=arguments[1],f=arguments[2],d=arguments[3],g=c.y-h.y,v=h.x-c.x,y=c.x*h.y-h.x*c.y,m=f.y-d.y,x=d.x-f.x,E=f.x*d.y-d.x*f.y;this.x=v*E-x*y,this.y=m*y-g*E,this.w=g*x-m*v}}function q(){}function k(){}function G(){this.envelope=null,this.factory=null,this.SRID=null,this.userData=null;var t=arguments[0];this.factory=t,this.SRID=t.getSRID()}function j(){}function B(){}function z(){}function V(){}function X(){}function Y(){}function U(){}function W(){}function H(){}function J(){}function Z(){}function K(){}function Q(){this.array_=[],arguments[0]instanceof v&&this.addAll(arguments[0])}function $(t){return null==t?$o:t.color}function tt(t){return null==t?null:t.parent}function et(t,e){null!==t&&(t.color=e)}function nt(t){return null==t?null:t.left}function it(t){return null==t?null:t.right}function rt(){this.root_=null,this.size_=0}function ot(){}function st(){}function at(){this.array_=[],arguments[0]instanceof v&&this.addAll(arguments[0])}function ut(){}function lt(){}function ct(){}function ht(){}function ft(){this.geometries=null;var t=arguments[0],e=arguments[1];if(G.call(this,e),null===t&&(t=[]),G.hasNullElements(t))throw new i("geometries must not contain null elements");this.geometries=t}function pt(){var t=arguments[0],e=arguments[1];ft.call(this,t,e)}function dt(){if(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length){var t=arguments[0];dt.call(this,t,B.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.geom=e,this.geomFact=e.getFactory(),this.bnRule=n}}function gt(){this.count=null}function vt(){}function yt(){}function mt(){}function xt(){}function Et(){}function wt(){}function bt(){}function It(){}function Nt(){this.points=null;var t=arguments[0],e=arguments[1];G.call(this,e),this.init(t)}function Ct(){}function St(){this.coordinates=null;var t=arguments[0],e=arguments[1];G.call(this,e),this.init(t)}function Mt(){}function Lt(){this.shell=null,this.holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(G.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),G.hasNullElements(e))throw new i("holes must not contain null elements");if(t.isEmpty()&&G.hasNonEmptyElements(e))throw new i("shell is empty but holes are not");this.shell=t,this.holes=e}function Rt(){var t=arguments[0],e=arguments[1];ft.call(this,t,e)}function Pt(){if(arguments[0]instanceof p&&arguments[1]instanceof ne){var t=arguments[0],e=arguments[1];Pt.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if(M(arguments[0],A)&&arguments[1]instanceof ne){var n=arguments[0],i=arguments[1];Nt.call(this,n,i),this.validateConstruction()}}function Tt(){var t=arguments[0],e=arguments[1];ft.call(this,t,e)}function Ot(){if(this.factory=null,this.isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.factory=t}}function _t(){}function At(){}function Dt(){}function Ft(){}function qt(){if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];qt.call(this,t,3)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.coordinates=new Array(e).fill(null);for(var n=0;n-1}function zt(t){return this.has(t)?this._values[es]:void 0}function Vt(t,e){if(this.objectOnly&&e!==Object(e))throw new TypeError("Invalid value used as weak collection key");if(e!==e||0===e)for(es=t.length;es--&&!Gt(t[es],e););else es=t.indexOf(e);return es>-1}function Xt(t){return Vt.call(this,this._keys,t)}function Yt(t,e){return this.has(t)?this._values[es]=e:this._values[this._keys.push(t)-1]=e,this}function Ut(){(this._keys||0).length=this._values.length=0}function Wt(){return Zt(this._itp,this._keys)}function Ht(){return Zt(this._itp,this._values)}function Jt(){return Zt(this._itp,this._keys,this._values)}function Zt(t,e,n){var i=[0],r=!1;return t.push(i),{next:function(){var o,s=i[0];return!r&&s1,"Node capacity must be greater than 1"),this.nodeCapacity=t}}function Ge(){}function je(){}function Be(){if(0===arguments.length)Be.call(this,Be.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];ke.call(this,t)}}function ze(){var t=arguments[0];Fe.call(this,t)}function Ve(){}function Xe(){this.segString=null,this.coord=null,this.segmentIndex=null,this.segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.segString=t,this.coord=new p(e),this.segmentIndex=n,this.segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}function Ye(){this.nodeMap=new rt,this.edge=null;var t=arguments[0];this.edge=t}function Ue(){this.nodeList=null,this.edge=null,this.nodeIt=null,this.currNode=null,this.nextNode=null,this.currSegIndex=0;var t=arguments[0];this.nodeList=t,this.edge=t.getEdge(),this.nodeIt=t.iterator(),this.readNextNode()}function We(){}function He(){this.nodeList=new Ye(this),this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function Je(){this.tempEnv1=new I,this.tempEnv2=new I,this.overlapSeg1=new ce,this.overlapSeg2=new ce}function Ze(){this.pts=null,this.start=null,this.end=null,this.env=null,this.context=null,this.id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.pts=t,this.start=e,this.end=n,this.context=i}function Ke(){}function Qe(){}function $e(){}function tn(){if(this.segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function en(){if(this.monoChains=new w,this.index=new Be,this.idCounter=0,this.nodedSegStrings=null,this.nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];tn.call(this,t)}}function nn(){Je.apply(this),this.si=null;var t=arguments[0];this.si=t}function rn(){if(this.pt=null,1===arguments.length){var t=arguments[0];l.call(this,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];l.call(this,rn.msgWithCoord(e,n)),this.name="TopologyException",this.pt=new p(n)}}function on(){}function sn(){this.findAllIntersections=!1,this.isCheckEndSegmentsOnly=!1,this.li=null,this.interiorIntersection=null,this.intSegments=null,this.intersections=new w,this.intersectionCount=0,this.keepIntersections=!0;var t=arguments[0];this.li=t,this.interiorIntersection=null}function an(){this.li=new se,this.segStrings=null,this.findAllIntersections=!1,this.segInt=null,this._isValid=!0;var t=arguments[0];this.segStrings=t}function un(){this.nv=null;var t=arguments[0];this.nv=new an(un.toSegmentStrings(t))}function ln(){this.mapOp=null;var t=arguments[0];this.mapOp=t}function cn(){}function hn(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.init(1),this.location[cn.ON]=e}else if(arguments[0]instanceof hn){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var i=0;i=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this.arg=new Array(2).fill(null),this.arg[0]=new Qn(0,i,o),this.arg[1]=new Qn(1,r,o)}}function ti(){this.pts=null,this._orientation=null;var t=arguments[0];this.pts=t,this._orientation=ti.orientation(t)}function ei(){this.edges=new w,this.ocaMap=new rt}function ni(){this.ptLocator=new Me,this.geomFact=null,this.resultGeom=null,this.graph=null,this.edgeList=new ei,this.resultPolyList=new w,this.resultLineList=new w,this.resultPointList=new w;var t=arguments[0],e=arguments[1];$n.call(this,t,e),this.graph=new bn(new Pn),this.geomFact=t.getFactory()}function ii(){this.geom=new Array(2).fill(null),this.snapTolerance=null,this.cbr=null;var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e,this.computeSnapTolerance()}function ri(){this.geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e}function oi(){this.factory=null,this.interiorPoint=null,this.maxWidth=0;var t=arguments[0];this.factory=t.getFactory(),this.add(t)}function si(){this.poly=null,this.centreY=null,this.hiY=r.MAX_VALUE,this.loY=-r.MAX_VALUE;var t=arguments[0];this.poly=t,this.hiY=t.getEnvelopeInternal().getMaxY(),this.loY=t.getEnvelopeInternal().getMinY(),this.centreY=oi.avg(this.loY,this.hiY)}function ai(){this.centroid=null,this.minDistance=r.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null===this.interiorPoint&&this.addEndpoints(t)}function ui(){this.centroid=null,this.minDistance=r.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.add(t)}function li(){this.tempEnv1=new I,this.selectedSegment=new ce}function ci(){this.items=new w,this.subnode=[null,null]}function hi(){if(this.min=null,this.max=null,0===arguments.length)this.min=0,this.max=0;else if(1===arguments.length){var t=arguments[0];this.init(t.min,t.max)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.init(e,n)}}function fi(){}function pi(t,e){var n,i,r,o,s={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}},a={32:8,64:11}[t];if(o||(n=e<0||1/e<0,isFinite(e)||(o=s[t],n&&(o.d+=1<=2;)i++,r/=2;for(;r<1&&i>0;)i--,r*=2;i<=0&&(r/=2),32===t&&i>254&&(o={d:n?255:127,c:128,b:0,a:0},i=Math.pow(2,a)-1,r=0)}return i}function di(){this.pt=0,this.level=0,this.interval=null;var t=arguments[0];this.computeKey(t)}function gi(){ci.apply(this),this.interval=null,this.centre=null,this.level=null;var t=arguments[0],e=arguments[1];this.interval=t,this.level=e,this.centre=(t.getMin()+t.getMax())/2}function vi(){}function yi(){ci.apply(this)}function mi(){this.root=null,this.minExtent=1,this.root=new yi}function xi(){}function Ei(){this.ring=null,this.tree=null,this.crossings=0, this.interval=new hi;var t=arguments[0];this.ring=t,this.buildIndex()}function wi(){li.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function bi(){}function Ii(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}function Ni(){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0;var t=arguments[0];this.input=t}function Ci(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new ce,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var t=arguments[0];Ci.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isConvex=n}}function Si(){this.inputGeom=null,this.distanceTolerance=null;var t=arguments[0];this.inputGeom=t}function Mi(){me.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function Li(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function Ri(){this._isMarked=!1;var t=arguments[0];Li.call(this,t)}function Pi(){this.vertexMap=new $t}function Ti(){this._isStart=!1;var t=arguments[0];Ri.call(this,t)}function Oi(){Pi.apply(this)}function _i(){this.result=null,this.factory=null,this.graph=null,this.lines=new w,this.nodeEdgeStack=new de,this.ringStartEdge=null,this.graph=new Oi}function Ai(){this.items=new w,this.subnode=new Array(4).fill(null)}function Di(){this.pt=new p,this.level=0,this.env=null;var t=arguments[0];this.computeKey(t)}function Fi(){Ai.apply(this),this.env=null,this.centrex=null,this.centrey=null,this.level=null;var t=arguments[0],e=arguments[1];this.env=t,this.level=e,this.centrex=(t.getMinX()+t.getMaxX())/2,this.centrey=(t.getMinY()+t.getMaxY())/2}function qi(){Ai.apply(this)}function ki(){this.root=null,this.minExtent=1,this.root=new qi}function Gi(t){this.geometryFactory=t||new ne}function ji(t){this.geometryFactory=t||new ne,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Gi(this.geometryFactory)}function Bi(){this.parser=new Gi(this.geometryFactory)}function zi(t){this.geometryFactory=t||new ne,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ie(this.geometryFactory)}function Vi(t){return[t.x,t.y]}function Xi(t,e){this.geometryFactory=t||new ne,this.ol=e||"undefined"!=typeof ol&&ol}function Yi(){if(this.noder=null,this.scaleFactor=null,this.offsetX=null,this.offsetY=null,this.isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];Yi.call(this,t,e,0,0)}else if(4===arguments.length){var n=arguments[0],i=arguments[1];arguments[2],arguments[3],this.noder=n,this.scaleFactor=i,this.isScaled=!this.isIntegerPrecision()}}function Ui(){if(this.inputGeom=null,this.isClosedEndpointsInInterior=!0,this.nonSimpleLocation=null,1===arguments.length){var t=arguments[0];this.inputGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isClosedEndpointsInInterior=!n.isInBoundary(2)}}function Wi(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Hi(){if(this.quadrantSegments=Hi.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=Hi.CAP_ROUND,this.joinStyle=Hi.JOIN_ROUND,this.mitreLimit=Hi.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=Hi.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(r),this.setJoinStyle(o),this.setMitreLimit(s)}}function Ji(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function Zi(){this.array_=[]}function Ki(){this.finder=null,this.dirEdgeList=new w,this.nodes=new w,this.rightMostCoord=null,this.env=null,this.finder=new Ji}function Qi(){this.inputLine=null,this.distanceTol=null,this.isDeleted=null,this.angleOrientation=le.COUNTERCLOCKWISE;var t=arguments[0];this.inputLine=t}function $i(){this.ptList=null,this.precisionModel=null,this.minimimVertexDistance=0,this.ptList=new w}function tr(){this.maxCurveSegmentError=0,this.filletAngleQuantum=null,this.closingSegLengthFactor=1,this.segList=null,this.distance=0,this.precisionModel=null,this.bufParams=null,this.li=null,this.s0=null,this.s1=null,this.s2=null,this.seg0=new ce,this.seg1=new ce,this.offset0=new ce,this.offset1=new ce,this.side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.precisionModel=t,this.bufParams=e,this.li=new se,this.filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Hi.JOIN_ROUND&&(this.closingSegLengthFactor=tr.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function er(){this.distance=0,this.precisionModel=null,this.bufParams=null;var t=arguments[0],e=arguments[1];this.precisionModel=t,this.bufParams=e}function nr(){this.subgraphs=null,this.seg=new ce,this.cga=new le;var t=arguments[0];this.subgraphs=t}function ir(){this.upwardSeg=null,this.leftDepth=null;var t=arguments[0],e=arguments[1];this.upwardSeg=new ce(t),this.leftDepth=e}function rr(){this.inputGeom=null,this.distance=null,this.curveBuilder=null,this.curveList=new w;var t=arguments[0],e=arguments[1],n=arguments[2];this.inputGeom=t,this.distance=e,this.curveBuilder=n}function or(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.hasInterior=!1,this.properIntersectionPoint=null,this.li=null,this.isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this.li=t}function sr(){this.bufParams=null,this.workingPrecisionModel=null,this.workingNoder=null,this.geomFact=null,this.graph=null,this.edgeList=new ei;var t=arguments[0];this.bufParams=t}function ar(){this.li=new se,this.segStrings=null;var t=arguments[0];this.segStrings=t}function ur(){this.li=null,this.pt=null,this.originalPt=null,this.ptScaled=null,this.p0Scaled=null,this.p1Scaled=null,this.scaleFactor=null,this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,this.corner=new Array(4).fill(null),this.safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=n,e<=0)throw new i("Scale factor must be non-zero");1!==e&&(this.pt=new p(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new p,this.p1Scaled=new p),this.initCorners(this.pt)}function lr(){this.index=null;var t=arguments[0];this.index=t}function cr(){li.apply(this),this.hotPixel=null,this.parentEdge=null,this.hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.hotPixel=t,this.parentEdge=e,this.hotPixelVertexIndex=n}function hr(){this.li=null,this.interiorIntersections=null;var t=arguments[0];this.li=t,this.interiorIntersections=new w}function fr(){this.pm=null,this.li=null,this.scaleFactor=null,this.noder=null,this.pointSnapper=null,this.nodedSegStrings=null;var t=arguments[0];this.pm=t,this.li=new se,this.li.setPrecisionModel(t),this.scaleFactor=t.getScale()}function pr(){if(this.argGeom=null,this.distance=null,this.bufParams=new Hi,this.resultGeometry=null,this.saveException=null,1===arguments.length){var t=arguments[0];this.argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.argGeom=e,this.bufParams=n}}function dr(){this.comps=null;var t=arguments[0];this.comps=t}function gr(){if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];gr.call(this,t,gr.INSIDE_AREA,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.component=n,this.segIndex=i,this.pt=r}}function vr(){this.pts=null;var t=arguments[0];this.pts=t}function yr(){this.locations=null;var t=arguments[0];this.locations=t}function mr(){if(this.geom=null,this.terminateDistance=0,this.ptLocator=new Me,this.minDistanceLocation=null,this.minDistance=r.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];mr.call(this,t,e,0)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this.geom=new Array(2).fill(null),this.geom[0]=n,this.geom[1]=i,this.terminateDistance=o}}function xr(){this.factory=null,this.directedEdges=new w,this.coordinates=null;var t=arguments[0];this.factory=t}function Er(){this._isMarked=!1,this._isVisited=!1,this.data=null}function wr(){Er.apply(this),this.parentEdge=null,this.from=null,this.to=null,this.p0=null,this.p1=null,this.sym=null,this.edgeDirection=null,this.quadrant=null,this.angle=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.from=t,this.to=e,this.edgeDirection=i,this.p0=t.getCoordinate(),this.p1=n;var r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y;this.quadrant=Ke.quadrant(r,o),this.angle=Math.atan2(o,r)}function br(){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];wr.call(this,t,e,n,i)}function Ir(){if(Er.apply(this),this.dirEdge=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.setDirectedEdges(t,e)}}function Nr(){this.outEdges=new w,this.sorted=!1}function Cr(){if(Er.apply(this),this.pt=null,this.deStar=null,1===arguments.length){var t=arguments[0];Cr.call(this,t,new Nr)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pt=e,this.deStar=n}}function Sr(){Ir.apply(this),this.line=null;var t=arguments[0];this.line=t}function Mr(){this.nodeMap=new rt}function Lr(){this.edges=new Q,this.dirEdges=new Q,this.nodeMap=new Mr}function Rr(){Lr.apply(this)}function Pr(){this.graph=new Rr,this.mergedLineStrings=null,this.factory=null,this.edgeStrings=null}function Tr(){this.edgeRing=null,this.next=null,this.label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];wr.call(this,t,e,n,i)}function Or(){Ir.apply(this),this.line=null;var t=arguments[0];this.line=t}function _r(){this.geometryFactory=new ne,this.geomGraph=null,this.disconnectedRingcoord=null;var t=arguments[0];this.geomGraph=t}function Ar(){}function Dr(){if(this.edgeEnds=new w,1===arguments.length){var t=arguments[0];Dr.call(this,null,t)}else if(2===arguments.length){var e=(arguments[0],arguments[1]);xn.call(this,e.getEdge(),e.getCoordinate(),e.getDirectedCoordinate(),new fn(e.getLabel())),this.insert(e)}}function Fr(){Ln.apply(this)}function qr(){var t=arguments[0],e=arguments[1];yn.call(this,t,e)}function kr(){wn.apply(this)}function Gr(){this.nodes=new mn(new kr)}function jr(){this.li=new se,this.geomGraph=null,this.nodeGraph=new Gr,this.invalidPoint=null;var t=arguments[0];this.geomGraph=t}function Br(){this.graph=null,this.rings=new w,this.totalEnv=new I,this.index=null,this.nestedPt=null;var t=arguments[0];this.graph=t}function zr(){if(this.errorType=null,this.pt=null,1===arguments.length){var t=arguments[0];zr.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.errorType=e,null!==n&&(this.pt=n.copy())}}function Vr(){this.parentGeometry=null,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null;var t=arguments[0];this.parentGeometry=t}function Xr(){this.factory=null,this.deList=new w,this.lowestEdge=null,this.ring=null,this.ringPts=null,this.holes=null,this.shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;var t=arguments[0];this.factory=t}function Yr(){}function Ur(){Lr.apply(this),this.factory=null;var t=arguments[0];this.factory=t}function Wr(){if(this.lineStringAdder=new Hr(this),this.graph=null,this.dangles=new w,this.cutEdges=new w,this.invalidRingLines=new w,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)Wr.call(this,!1);else if(1===arguments.length){var t=arguments[0];this.extractOnlyPolygonal=t}}function Hr(){this.p=null;var t=arguments[0];this.p=t}function Jr(){this.li=new se,this.ptLocator=new Me,this.arg=null,this.nodes=new mn(new kr),this.im=null,this.isolatedEdges=new w,this.invalidPoint=null;var t=arguments[0];this.arg=t}function Zr(){this.rectEnv=null;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal()}function Kr(){this.li=new se,this.rectEnv=null,this.diagUp0=null,this.diagUp1=null,this.diagDown0=null,this.diagDown1=null;var t=arguments[0];this.rectEnv=t,this.diagUp0=new p(t.getMinX(),t.getMinY()),this.diagUp1=new p(t.getMaxX(),t.getMaxY()),this.diagDown0=new p(t.getMinX(),t.getMaxY()),this.diagDown1=new p(t.getMaxX(),t.getMinY())}function Qr(){this._isDone=!1}function $r(){this.rectangle=null,this.rectEnv=null;var t=arguments[0];this.rectangle=t,this.rectEnv=t.getEnvelopeInternal()}function to(){Qr.apply(this),this.rectEnv=null,this._intersects=!1;var t=arguments[0];this.rectEnv=t}function eo(){Qr.apply(this),this.rectSeq=null,this.rectEnv=null,this._containsPoint=!1;var t=arguments[0];this.rectSeq=t.getExteriorRing().getCoordinateSequence(),this.rectEnv=t.getEnvelopeInternal()}function no(){Qr.apply(this),this.rectEnv=null,this.rectIntersector=null,this.hasIntersection=!1,this.p0=new p,this.p1=new p;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal(),this.rectIntersector=new Kr(this.rectEnv)}function io(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];$n.call(this,t,e),this._relate=new Jr(this.arg)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];$n.call(this,n,i,r),this._relate=new Jr(this.arg)}}function ro(){this.geomFactory=null,this.skipEmpty=!1,this.inputGeoms=null;var t=arguments[0];this.geomFactory=ro.extractFactory(t),this.inputGeoms=t}function oo(){this.pointGeom=null,this.otherGeom=null,this.geomFact=null;var t=arguments[0],e=arguments[1];this.pointGeom=t,this.otherGeom=e,this.geomFact=e.getFactory()}function so(){this.sortIndex=-1,this.comps=null;var t=arguments[0],e=arguments[1];this.sortIndex=t,this.comps=e}function ao(){this.inputPolys=null,this.geomFactory=null;var t=arguments[0];this.inputPolys=t,null===this.inputPolys&&(this.inputPolys=new w)}function uo(){if(this.polygons=new w,this.lines=new w,this.points=new w,this.geomFact=null,1===arguments.length){if(M(arguments[0],v)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof G){var e=arguments[0];this.extract(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.geomFact=i,this.extract(n)}}function lo(){Ot.CoordinateOperation.apply(this),this.targetPM=null,this.removeCollapsed=!0;var t=arguments[0],e=arguments[1];this.targetPM=t,this.removeCollapsed=e}function co(){this.targetPM=null,this.removeCollapsed=!0,this.changePrecisionModel=!1,this.isPointwise=!1;var t=arguments[0];this.targetPM=t}function ho(){this.pts=null,this.usePt=null,this.distanceTolerance=null,this.seg=new ce;var t=arguments[0];this.pts=t}function fo(){this.inputGeom=null,this.distanceTolerance=null,this.isEnsureValidTopology=!0;var t=arguments[0];this.inputGeom=t}function po(){me.apply(this),this.isEnsureValidTopology=!0,this.distanceTolerance=null;var t=arguments[0],e=arguments[1];this.isEnsureValidTopology=t,this.distanceTolerance=e}function go(){if(this.parent=null,this.index=null,2===arguments.length){var t=arguments[0],e=arguments[1];go.call(this,t,e,null,-1)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=arguments[3];ce.call(this,n,i),this.parent=r,this.index=o}}function vo(){if(this.parentLine=null,this.segs=null,this.resultSegs=new w,this.minimumSize=null,1===arguments.length){var t=arguments[0];vo.call(this,t,2)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.parentLine=e,this.minimumSize=n,this.init()}}function yo(){this.index=new ki}function mo(){this.querySeg=null,this.items=new w;var t=arguments[0];this.querySeg=t}function xo(){this.li=new se,this.inputIndex=new yo,this.outputIndex=new yo,this.line=null,this.linePts=null,this.distanceTolerance=0;var t=arguments[0],e=arguments[1];this.inputIndex=t,this.outputIndex=e}function Eo(){this.inputIndex=new yo,this.outputIndex=new yo,this.distanceTolerance=0}function wo(){this.inputGeom=null,this.lineSimplifier=new Eo,this.linestringMap=null;var t=arguments[0];this.inputGeom=t}function bo(){me.apply(this),this.linestringMap=null;var t=arguments[0];this.linestringMap=t}function Io(){this.tps=null;var t=arguments[0];this.tps=t}function No(){this.seg=null,this.segLen=null,this.splitPt=null,this.minimumLen=0;var t=arguments[0];this.seg=t,this.segLen=t.getLength()}function Co(){}function So(){}function Mo(){}function Lo(){if(this.p=null,1===arguments.length){var t=arguments[0];this.p=new p(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p=new p(e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this.p=new p(i,r,o)}}function Ro(){this._isOnConstraint=null,this.constraint=null;var t=arguments[0];Lo.call(this,t)}function Po(){this._rot=null,this.vertex=null,this.next=null,this.data=null}function To(){this.subdiv=null,this.isUsingTolerance=!1;var t=arguments[0];this.subdiv=t,this.isUsingTolerance=t.getTolerance()>0}function Oo(){}function _o(){this.subdiv=null,this.lastEdge=null;var t=arguments[0];this.subdiv=t,this.init()}function Ao(){if(this.seg=null,1===arguments.length){if("string"==typeof arguments[0]){var t=arguments[0];l.call(this,t)}else if(arguments[0]instanceof ce){var e=arguments[0];l.call(this,"Locate failed to converge (at edge: "+e+"). Possible causes include invalid Subdivision topology or very close sites"),this.seg=new ce(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];l.call(this,Ao.msgWithSpatial(n,i)),this.seg=new ce(i)}}function Do(){}function Fo(){this.visitedKey=0,this.quadEdges=new w,this.startingEdge=null,this.tolerance=null,this.edgeCoincidenceTolerance=null,this.frameVertex=new Array(3).fill(null),this.frameEnv=null,this.locator=null,this.seg=new ce,this.triEdges=new Array(3).fill(null);var t=arguments[0],e=arguments[1];this.tolerance=e,this.edgeCoincidenceTolerance=e/Fo.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this.startingEdge=this.initSubdiv(),this.locator=new _o(this)}function qo(){}function ko(){this.triList=new w}function Go(){this.triList=new w}function jo(){this.coordList=new b,this.triCoords=new w}function Bo(){if(this.ls=null,this.data=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.ls=new ce(t,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.ls=new ce(n,i),this.data=r}else if(6===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5];Bo.call(this,new p(o,s,a),new p(u,l,c))}else if(7===arguments.length){var h=arguments[0],f=arguments[1],d=arguments[2],g=arguments[3],v=arguments[4],y=arguments[5],m=arguments[6];Bo.call(this,new p(h,f,d),new p(g,v,y),m)}}function zo(){}function Vo(){if(this.p=null,this.data=null,this.left=null,this.right=null,this.count=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.p=new p(t),this.left=null,this.right=null,this.count=1,this.data=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.p=new p(n,i),this.left=null,this.right=null,this.count=1,this.data=r}}function Xo(){if(this.root=null,this.numberOfNodes=null,this.tolerance=null,0===arguments.length)Xo.call(this,0);else if(1===arguments.length){var t=arguments[0];this.tolerance=t}}function Yo(){this.tolerance=null,this.matchNode=null,this.matchDist=0,this.p=null;var t=arguments[0],e=arguments[1];this.p=t,this.tolerance=e}function Uo(){this.initialVertices=null,this.segVertices=null,this.segments=new w,this.subdiv=null,this.incDel=null,this.convexHull=null,this.splitFinder=new So,this.kdt=null,this.vertexFactory=null,this.computeAreaEnv=null,this.splitPt=null,this.tolerance=null;var t=arguments[0],e=arguments[1];this.initialVertices=new w(t),this.tolerance=e,this.kdt=new Xo(e)}function Wo(){this.siteCoords=null,this.tolerance=0,this.subdiv=null}function Ho(){this.siteCoords=null,this.constraintLines=null,this.tolerance=0,this.subdiv=null,this.constraintVertexMap=new rt}function Jo(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null}function Zo(){}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments?parseInt(Number(arguments[1]),10)||0:0;i=i<0?Math.max(n+i,0):Math.min(i,n);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(r=r<0?Math.max(n+arguments[2],0):Math.min(r,n);ie.x?1:this.ye.y?1:0},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return f.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}},copy:function(){return new p(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},distance:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+p.hashCode(this.x),t=37*t+p.hashCode(this.y)},setCoordinate:function(t){this.x=t.x,this.y=t.y,this.z=t.z},interfaces_:function(){return[o,s,u]},getClass:function(){return p}}),p.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=r.doubleToLongBits(t);return Math.trunc(e^e>>>32)}},e(d.prototype,{compare:function(t,e){var n=t,i=e,r=d.compare(n.x,i.x);if(0!==r)return r;var o=d.compare(n.y,i.y);return 0!==o?o:this.dimensionsToTest<=2?0:d.compare(n.z,i.z)},interfaces_:function(){return[a]},getClass:function(){return d}}),d.compare=function(t,e){return te?1:r.isNaN(t)?r.isNaN(e)?0:-1:r.isNaN(e)?1:0},p.DimensionalComparator=d,p.serialVersionUID=0x5cbf2c235c7e5800,p.NULL_ORDINATE=r.NaN,p.X=0,p.Y=1,p.Z=2,g.prototype.hasNext=function(){},g.prototype.next=function(){},g.prototype.remove=function(){},v.prototype.add=function(){},v.prototype.addAll=function(){},v.prototype.isEmpty=function(){},v.prototype.iterator=function(){},v.prototype.size=function(){},v.prototype.toArray=function(){},v.prototype.remove=function(){},y.prototype=new Error,y.prototype.name="IndexOutOfBoundsException",m.prototype=Object.create(v.prototype),m.prototype.constructor=m,m.prototype.get=function(){},m.prototype.set=function(){},m.prototype.isEmpty=function(){},x.prototype=new Error,x.prototype.name="NoSuchElementException",E.prototype=new Error,E.prototype.name="OperationNotSupported",w.prototype=Object.create(m.prototype),w.prototype.constructor=w,w.prototype.ensureCapacity=function(){},w.prototype.interfaces_=function(){return[m,v]},w.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},w.prototype.clear=function(){this.array_=[]},w.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},w.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},w.prototype.iterator=function(){return new Ko(this)},w.prototype.get=function(t){if(t<0||t>=this.size())throw new y;return this.array_[t]},w.prototype.isEmpty=function(){return 0===this.array_.length},w.prototype.size=function(){return this.array_.length},w.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1){var o=this.get(this.size()-1);if(o.equals2D(i))return null}w.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];return this.add(s,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1],c=arguments[2];if(c)for(var h=0;h=0;h--)this.add(u[h],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof p){var f=arguments[0],d=arguments[1],g=arguments[2];if(!g){var v=this.size();if(v>0){if(f>0){var y=this.get(f-1);if(y.equals2D(d))return null}if(fI&&(N=-1);for(var h=b;h!==I;h+=N)this.add(x[h],E);return!0}},closeRing:function(){this.size()>0&&this.add(new p(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return b}}),b.coordArrayType=new Array(0).fill(null),e(I.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(t){if(!(t instanceof I))return!1;var e=t;return this.isNull()?e.isNull():this.maxx===e.getMaxX()&&this.maxy===e.getMaxY()&&this.minx===e.getMinX()&&this.miny===e.getMinY()},intersection:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new I;var e=this.minx>t.minx?this.minx:t.minx,n=this.miny>t.miny?this.miny:t.miny;return new I(e,this.maxx=this.minx&&e.getMaxX()<=this.maxx&&e.getMinY()>=this.miny&&e.getMaxY()<=this.maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&n>=this.minx&&n<=this.maxx&&i>=this.miny&&i<=this.maxy}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t.minx>this.maxx||t.maxxthis.maxy||t.maxythis.maxx||nthis.maxy||ithis.maxx&&(this.maxx=e.maxx),e.minythis.maxy&&(this.maxy=e.maxy))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this.minx=n,this.maxx=n,this.miny=i,this.maxy=i):(nthis.maxx&&(this.maxx=n),ithis.maxy&&(this.maxy=i))}},minExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te.minx?1:this.minye.miny?1:this.maxxe.maxx?1:this.maxye.maxy?1:0},translate:function(t,e){return this.isNull()?null:void this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},expandBy:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1] ;if(this.isNull())return null;this.minx-=e,this.maxx+=e,this.miny-=n,this.maxy+=n,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof p){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},centre:function(){return this.isNull()?null:new p((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof I){var e=arguments[0];this.minx=e.minx,this.maxx=e.maxx,this.miny=e.miny,this.maxy=e.maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];rt.maxx&&(e=this.minx-t.maxx);var n=0;return this.maxyt.maxy&&(n=this.miny-t.maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+p.hashCode(this.minx),t=37*t+p.hashCode(this.maxx),t=37*t+p.hashCode(this.miny),t=37*t+p.hashCode(this.maxy)},interfaces_:function(){return[o,u]},getClass:function(){return I}}),I.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(l>u||cu||cn?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],o=arguments[2];return io?o:i}},L.wrap=function(t,e){return t<0?e- -t%e:t%e},L.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],i=r;return o>i&&(i=o),s>i&&(i=s),a>i&&(i=a),i}},L.average=function(t,e){return(t+e)/2},L.LOG_10=Math.log(10),R.prototype.append=function(t){this.str+=t},R.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},R.prototype.toString=function(t){return this.str},P.prototype.intValue=function(){return this.value},P.prototype.compareTo=function(t){return this.valuet?1:0},P.isNaN=function(t){return Number.isNaN(t)},T.isWhitespace=function(t){return t<=32&&t>=0||127==t},T.toUpperCase=function(t){return t.toUpperCase()},e(O.prototype,{le:function(t){return this.hi9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(O.valueOf(l)).multiply(O.TEN),c&&n.selfAdd(O.TEN);var f=!0,p=O.magnitude(n.hi);if(p<0&&Math.abs(p)>=a-u&&(f=!1),!f)break}return e[0]=i,s.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},equals:function(){if(1===arguments.length){var t=arguments[0];return this.hi===t.hi&&this.lo===t.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t.hi,-t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(t){return this.le(t)?this:t},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfDivide(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null,c=null,h=null;return u=this.hi/n,l=O.SPLIT*u,r=l-u,h=O.SPLIT*n,r=l-r,o=u-r,s=h-n,c=u*n,s=h-s,a=n-s,h=r*s-c+r*a+o*s+o*a,l=(this.hi-c-h+this.lo-u*i)/n,h=u+l,this.hi=h,this.lo=u-h+l,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){if(arguments[0]instanceof O){var t=arguments[0],e=null,n=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this.hi/t.hi,a=O.SPLIT*s,e=a-s,l=O.SPLIT*t.hi,e=a-e,n=s-e,i=l-t.hi,u=s*t.hi,i=l-i,o=t.hi-i,l=e*i-u+e*o+n*i+n*o,a=(this.hi-u-l+this.lo-s*t.lo)/t.hi,l=s+a;return new O(l,s-l+a)}if("number"==typeof arguments[0]){var c=arguments[0];return r.isNaN(c)?O.createNaN():O.copy(this).selfDivide(c,0)}},ge:function(t){return this.hi>t.hi||this.hi===t.hi&&this.lo>=t.lo},pow:function(t){if(0===t)return O.valueOf(1);var e=new O(this),n=O.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},ceil:function(){if(this.isNaN())return O.NaN;var t=Math.ceil(this.hi),e=0;return t===this.hi&&(e=Math.ceil(this.lo)),new O(t,e)},compareTo:function(t){var e=t;return this.hie.hi?1:this.loe.lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},max:function(t){return this.ge(t)?this:t},sqrt:function(){if(this.isZero())return O.valueOf(0);if(this.isNegative())return O.NaN;var t=1/Math.sqrt(this.hi),e=this.hi*t,n=O.valueOf(e),i=this.subtract(n.sqr()),r=i.hi*(.5*t);return n.add(r)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfAdd(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,i=null,r=null,o=null,s=null,a=null;return r=this.hi+e,s=r-this.hi,o=r-s,o=e-s+(this.hi-o),a=o+this.lo,n=r+a,i=a+(r-n),this.hi=n+i,this.lo=i+(n-this.hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],n=null,i=null,c=null,h=null,r=null,o=null,s=null,a=null;r=this.hi+u,c=this.lo+l,s=r-this.hi,a=c-this.lo,o=r-s,h=c-a,o=u-s+(this.hi-o),h=l-a+(this.lo-h),s=o+c,n=r+s,i=s+(r-n),s=h+i;var f=n+s,p=s+(n-f);return this.hi=f,this.lo=p,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfMultiply(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null;u=O.SPLIT*this.hi,r=u-this.hi,l=O.SPLIT*n,r=u-r,o=this.hi-r,s=l-n,u=this.hi*n,s=l-s,a=n-s,l=r*s-u+r*a+o*s+o*a+(this.hi*i+this.lo*n);var c=u+l;r=u-c;var h=l+r;return this.hi=c,this.lo=h,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return O.NaN;var t=Math.floor(this.hi),e=0;return t===this.hi&&(e=Math.floor(this.lo)),new O(t,e)},negate:function(){return this.isNaN()?this:new O(-this.hi,-this.lo)},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}},multiply:function(){if(arguments[0]instanceof O){var t=arguments[0];return t.isNaN()?O.createNaN():O.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return r.isNaN(e)?O.createNaN():O.copy(this).selfMultiply(e,0)}},isNaN:function(){return r.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var t=O.magnitude(this.hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+O.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length,s=O.stringOfChar("0",o);r=n+s+".0"}return this.isNegative()?"-"+r:r},reciprocal:function(){var t=null,e=null,n=null,i=null,r=null,o=null,s=null,a=null;r=1/this.hi,o=O.SPLIT*r,t=o-r,a=O.SPLIT*this.hi,t=o-t,e=r-t,n=a-this.hi,s=r*this.hi,n=a-n,i=this.hi-n,a=t*n-s+t*i+e*n+e*i,o=(1-s-a-r*this.lo)/this.hi;var u=r+o;return new O(u,r-u+o)},toSciNotation:function(){if(this.isZero())return O.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=O.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new IllegalStateException("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},abs:function(){return this.isNaN()?O.NaN:this.isNegative()?this.negate():new O(this)},isPositive:function(){return this.hi>0||0===this.hi&&this.lo>0},lt:function(t){return this.hit.hi||this.hi===t.hi&&this.lo>t.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?O.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return this.hi>0?1:this.hi<0?-1:this.lo>0?1:this.lo<0?-1:0},interfaces_:function(){return[u,o,s]},getClass:function(){return O}}),O.sqr=function(t){return O.valueOf(t).selfMultiply(t)},O.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return O.parse(t)}if("number"==typeof arguments[0]){return new O(arguments[0])}},O.sqrt=function(t){return O.valueOf(t).sqrt()},O.parse=function(t){for(var e=0,n=t.length;T.isWhitespace(t.charAt(e));)e++;var i=!1;if(e=n);){var l=t.charAt(e);if(e++,T.isDigit(l)){var c=l-"0";o.selfMultiply(O.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=P.parseInt(h)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+h+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var f=o,p=s-a-u;if(0===p)f=o;else if(p>0){var d=O.TEN.pow(p);f=o.divide(d)}else if(p<0){var d=O.TEN.pow(-p);f=o.multiply(d)}return i?f.negate():f},O.createNaN=function(){return new O(r.NaN,r.NaN)},O.copy=function(t){return new O(t)},O.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=e&&(i+=1),i},O.stringOfChar=function(t,e){for(var n=new R,i=0;i0){if(o<=0)return _.signum(s);i=r+o}else{if(!(r<0))return _.signum(s);if(o>=0)return _.signum(s);i=-r-o}var a=_.DP_SAFE_EPSILON*i;return s>=a||-s>=a?_.signum(s):2},_.signum=function(t){return t>0?1:t<0?-1:0},_.DP_SAFE_EPSILON=1e-15,e(A.prototype,{setOrdinate:function(t,e,n){},size:function(){},getOrdinate:function(t,e){},getCoordinate:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},getCoordinateCopy:function(t){},getDimension:function(){},getX:function(t){},clone:function(){},expandEnvelope:function(t){},copy:function(){},getY:function(t){},toCoordinateArray:function(){},interfaces_:function(){return[s]},getClass:function(){return A}}),A.X=0,A.Y=1,A.Z=2,A.M=3,D.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;s0},interfaces_:function(){return[B]},getClass:function(){return V}}),e(X.prototype,{isInBoundary:function(t){return t>1},interfaces_:function(){return[B]},getClass:function(){return X}}),e(Y.prototype,{isInBoundary:function(t){return 1===t},interfaces_:function(){return[B]},getClass:function(){return Y}}),B.Mod2BoundaryNodeRule=z,B.EndPointBoundaryNodeRule=V,B.MultiValentEndPointBoundaryNodeRule=X,B.MonoValentEndPointBoundaryNodeRule=Y,B.MOD2_BOUNDARY_RULE=new z,B.ENDPOINT_BOUNDARY_RULE=new V,B.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new X,B.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new Y,B.OGC_SFS_BOUNDARY_RULE=B.MOD2_BOUNDARY_RULE,e(U.prototype,{interfaces_:function(){return[]},getClass:function(){return U}}),U.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},U.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},U.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},U.extract=function(t,e,n){e=L.clamp(e,0,t.length),n=L.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),ni.length)return 1;if(0===n.length)return 0;var r=U.compare(n,i);return U.isEqualReversed(n,i)?0:r},OLDcompare:function(t,e){var n=t,i=e;if(n.lengthi.length)return 1;if(0===n.length)return 0;for(var r=U.increasingDirection(n),o=U.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},rt.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:$o,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do{if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:$o,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},rt.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!=this.root_&&1==t.parent.color;)if(tt(t)==nt(tt(tt(t)))){var e=it(tt(tt(t)));1==$(e)?(et(tt(t),$o),et(e,$o),et(tt(tt(t)),1),t=tt(tt(t))):(t==it(tt(t))&&(t=tt(t),this.rotateLeft(t)),et(tt(t),$o),et(tt(tt(t)),1),this.rotateRight(tt(tt(t))))}else{var e=nt(tt(tt(t)));1==$(e)?(et(tt(t),$o),et(e,$o),et(tt(tt(t)),1),t=tt(tt(t))):(t==nt(tt(t))&&(t=tt(t),this.rotateRight(t)),et(tt(t),$o),et(tt(tt(t)),1),this.rotateLeft(tt(tt(t))))}this.root_.color=$o},rt.prototype.values=function(){var t=new w,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=rt.successor(e));)t.add(e.value);return t},rt.prototype.entrySet=function(){var t=new Q,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=rt.successor(e));)t.add(e);return t},rt.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left==t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},rt.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right==t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},rt.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},rt.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var e=t.parent,n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e},rt.prototype.size=function(){return this.size_},e(ot.prototype,{interfaces_:function(){return[]},getClass:function(){return ot}}),st.prototype=new K,at.prototype=new st,at.prototype.contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=r.substring(0,o);i.add(s),r=r.substring(o+n),o=r.indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),u=0;u0)for(var o=r;o0&&i.append(" ");for(var o=0;o0&&i.append(","),i.append(bt.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},It.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?It.createClosedRing(t,e,4):e.getOrdinate(0,A.X)===e.getOrdinate(n-1,A.X)&&e.getOrdinate(0,A.Y)===e.getOrdinate(n-1,A.Y)?e:It.createClosedRing(t,e,n+1)},It.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();It.copy(e,0,i,0,r);for(var o=r;o0&&It.reverse(this.points),null}},getCoordinate:function(){return this.isEmpty()?null:this.points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?lt.FALSE:0},isClosed:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return le.computeLength(this.points)},getNumPoints:function(){return this.points.size()},reverse:function(){var t=this.points.copy();return It.reverse(t),this.getFactory().createLineString(t)},compareToSameClass:function(){if(1===arguments.length){for(var t=arguments[0],e=t,n=0,i=0;n= 2)");this.points=t},isCoordinate:function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new Pt(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return Pt}}),Pt.MINIMUM_VALID_SIZE=4,Pt.serialVersionUID=-0x3b229e262367a600,c(Tt,ft),e(Tt.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ft.prototype.equalsExact.call(this,t,e)}return ft.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},interfaces_:function(){return[_t]},getClass:function(){return Dt}}),e(Ft.prototype,{edit:function(t,e){return t instanceof Pt?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Nt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof St?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},interfaces_:function(){return[_t]},getClass:function(){return Ft}}),Ot.NoOpGeometryOperation=At,Ot.CoordinateOperation=Dt,Ot.CoordinateSequenceOperation=Ft,e(qt.prototype,{setOrdinate:function(t,e,n){switch(e){case A.X:this.coordinates[t].x=n;break;case A.Y:this.coordinates[t].y=n;break;case A.Z:this.coordinates[t].z=n;break;default:throw new i("invalid ordinateIndex")}},size:function(){return this.coordinates.length},getOrdinate:function(t,e){switch(e){case A.X:return this.coordinates[t].x;case A.Y:return this.coordinates[t].y;case A.Z:return this.coordinates[t].z}return r.NaN},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this.coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this.coordinates[e].x,n.y=this.coordinates[e].y,n.z=this.coordinates[e].z}},getCoordinateCopy:function(t){return new p(this.coordinates[t])},getDimension:function(){return this.dimension},getX:function(t){return this.coordinates[t].x},clone:function(){for(var t=new Array(this.size()).fill(null),e=0;e0){var t=new R(17*this.coordinates.length);t.append("("),t.append(this.coordinates[0]);for(var e=1;e3&&(e=3),e<2?new qt(t):new qt(t,e)}},interfaces_:function(){return[q,u]},getClass:function(){return kt}}),kt.instance=function(){return kt.instanceObject},kt.serialVersionUID=-0x38e49fa6cf6f2e00,kt.instanceObject=new kt;var es,ns=Object.defineProperty,is=function(t,e){function n(t){return this&&this.constructor===n?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=e,void(t&&jt.call(this,t))):new n(t)}return e||ns(t,"size",{get:Kt}),t.constructor=n,n.prototype=t,n}({delete:Bt,has:Xt,get:zt,set:Yt,keys:Wt,values:Ht,entries:Jt,forEach:Qt,clear:Ut}),rs="undefined"!=typeof Map&&Map.prototype.values?Map:is;$t.prototype=new J,$t.prototype.get=function(t){return this.map_.get(t)||null},$t.prototype.put=function(t,e){return this.map_.set(t,e),e},$t.prototype.values=function(){for(var t=new w,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},$t.prototype.entrySet=function(){var t=new Q;return this.map_.entries().forEach(function(e){return t.add(e)}),t},$t.prototype.size=function(){return this.map_.size()},e(te.prototype,{equals:function(t){if(!(t instanceof te))return!1;var e=t;return this.modelType===e.modelType&&this.scale===e.scale},compareTo:function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new P(n).compareTo(new P(i))},getScale:function(){return this.scale},isFloating:function(){return this.modelType===te.FLOATING||this.modelType===te.FLOATING_SINGLE},getType:function(){return this.modelType},toString:function(){var t="UNKNOWN";return this.modelType===te.FLOATING?t="Floating":this.modelType===te.FLOATING_SINGLE?t="Floating-Single":this.modelType===te.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},makePrecise:function(){if("number"==typeof arguments[0]){var t=arguments[0];if(r.isNaN(t))return t;if(this.modelType===te.FLOATING_SINGLE){return t}return this.modelType===te.FIXED?Math.round(t*this.scale)/this.scale:t}if(arguments[0]instanceof p){var e=arguments[0];if(this.modelType===te.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},getMaximumSignificantDigits:function(){var t=16;return this.modelType===te.FLOATING?t=16:this.modelType===te.FLOATING_SINGLE?t=6:this.modelType===te.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},setScale:function(t){this.scale=Math.abs(t)},interfaces_:function(){return[u,o]},getClass:function(){return te}}),te.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},e(ee.prototype,{readResolve:function(){return ee.nameToTypeMap.get(this.name)},toString:function(){return this.name},interfaces_:function(){return[u]},getClass:function(){return ee}}),ee.serialVersionUID=-552860263173159e4,ee.nameToTypeMap=new $t,te.Type=ee,te.serialVersionUID=0x6bee6404e9a25c00,te.FIXED=new ee("FIXED"),te.FLOATING=new ee("FLOATING"),te.FLOATING_SINGLE=new ee("FLOATING SINGLE"),te.maximumPreciseValue=9007199254740992,e(ne.prototype,{toGeometry:function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new p(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new p(t.getMinX(),t.getMinY()),new p(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new p(t.getMinX(),t.getMinY()),new p(t.getMinX(),t.getMaxY()),new p(t.getMaxX(),t.getMaxY()),new p(t.getMaxX(),t.getMinY()),new p(t.getMinX(),t.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){return new Nt(arguments[0],this)}}},createMultiLineString:function(){if(0===arguments.length)return new pt(null,this);if(1===arguments.length){return new pt(arguments[0],this)}},buildGeometry:function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(ne.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Lt)return this.createMultiPolygon(ne.toPolygonArray(t));if(a instanceof Nt)return this.createMultiLineString(ne.toLineStringArray(t));if(a instanceof St)return this.createMultiPoint(ne.toPointArray(t));f.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},createMultiPointFromCoords:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(M(arguments[0],A)){return new St(arguments[0],this)}}},getCoordinateSequenceFactory:function(){return this.coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Lt(null,null,this);if(1===arguments.length){if(M(arguments[0],A)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Pt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return new Lt(i,r,this)}},getSRID:function(){return this.SRID}, createGeometryCollection:function(){if(0===arguments.length)return new ft(null,this);if(1===arguments.length){return new ft(arguments[0],this)}},createGeometry:function(t){return new Ot(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return arguments[1],this.coordinateSequenceFactory.create(t)}}})},getPrecisionModel:function(){return this.precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){return new Pt(arguments[0],this)}}},createMultiPolygon:function(){if(0===arguments.length)return new Tt(null,this);if(1===arguments.length){return new Tt(arguments[0],this)}},createMultiPoint:function(){if(0===arguments.length)return new Rt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){return new Rt(arguments[0],this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;in?(this.intLineIndex[t][0]=0,this.intLineIndex[t][1]=1):(this.intLineIndex[t][0]=1,this.intLineIndex[t][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(t){this.precisionModel=t},isInteriorIntersection:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;er?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=i>r?s:a)||t.equals(e)||(o=Math.max(s,a))}return f.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},oe.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return f.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},oe.DONT_INTERSECT=0,oe.DO_INTERSECT=1,oe.COLLINEAR=2,oe.NO_INTERSECTION=0,oe.POINT_INTERSECTION=1,oe.COLLINEAR_INTERSECTION=2,c(se,oe),e(se.prototype,{isInSegmentEnvelopes:function(t){var e=new I(this.inputLines[0][0],this.inputLines[0][1]),n=new I(this.inputLines[1][0],this.inputLines[1][1]);return e.contains(t)&&n.contains(t)},computeIntersection:function(){if(3!==arguments.length)return oe.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];return this._isProper=!1,I.intersects(e,n,t)&&0===le.orientationIndex(e,n,t)&&0===le.orientationIndex(n,e,t)?(this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this.result=oe.POINT_INTERSECTION,null):void(this.result=oe.NO_INTERSECTION)},normalizeToMinimum:function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},safeHCoordinateIntersection:function(t,e,n,i){var r=null;try{r=F.intersection(t,e,n,i)}catch(o){if(!(o instanceof C))throw o;r=se.nearestEndpoint(t,e,n,i)}return r},intersection:function(t,e,n,i){var r=this.intersectionWithNormalization(t,e,n,i);return this.isInSegmentEnvelopes(r)||(r=new p(se.nearestEndpoint(t,e,n,i))),null!==this.precisionModel&&this.precisionModel.makePrecise(r),r},smallestInAbsValue:function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)1e-4&&D.out.println("Distance = "+r.distance(o))},intersectionWithNormalization:function(t,e,n,i){var r=new p(t),o=new p(e),s=new p(n),a=new p(i),u=new p;this.normalizeToEnvCentre(r,o,s,a,u);var l=this.safeHCoordinateIntersection(r,o,s,a);return l.x+=u.x,l.y+=u.y,l},computeCollinearIntersection:function(t,e,n,i){var r=I.intersects(t,e,n),o=I.intersects(t,e,i),s=I.intersects(n,i,t),a=I.intersects(n,i,e);return r&&o?(this.intPt[0]=n,this.intPt[1]=i,oe.COLLINEAR_INTERSECTION):s&&a?(this.intPt[0]=t,this.intPt[1]=e,oe.COLLINEAR_INTERSECTION):r&&s?(this.intPt[0]=n,this.intPt[1]=t,!n.equals(t)||o||a?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):r&&a?(this.intPt[0]=n,this.intPt[1]=e,!n.equals(e)||o||s?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):o&&s?(this.intPt[0]=i,this.intPt[1]=t,!i.equals(t)||r||a?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):o&&a?(this.intPt[0]=i,this.intPt[1]=e,!i.equals(e)||r||s?oe.COLLINEAR_INTERSECTION:oe.POINT_INTERSECTION):oe.NO_INTERSECTION},normalizeToEnvCentre:function(t,e,n,i,r){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.xi.x?n.x:i.x,f=n.y>i.y?n.y:i.y,p=o>l?o:l,d=ac?s:c,v=u0&&o>0||r<0&&o<0)return oe.NO_INTERSECTION;var s=le.orientationIndex(n,i,t),a=le.orientationIndex(n,i,e);return s>0&&a>0||s<0&&a<0?oe.NO_INTERSECTION:0===r&&0===o&&0===s&&0===a?this.computeCollinearIntersection(t,e,n,i):(0===r||0===o||0===s||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(i)?this.intPt[0]=t:e.equals2D(n)||e.equals2D(i)?this.intPt[0]=e:0===r?this.intPt[0]=new p(n):0===o?this.intPt[0]=new p(i):0===s?this.intPt[0]=new p(t):0===a&&(this.intPt[0]=new p(e))):(this._isProper=!0,this.intPt[0]=this.intersection(t,e,n,i)),oe.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return se}}),se.nearestEndpoint=function(t,e,n,i){var r=t,o=le.distancePointLine(t,n,i),s=le.distancePointLine(e,n,i);return s0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(0=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),0=n))return-r;r=-r,t=-t,n=-n}for(;;){if(a+=1,s=Math.floor(n/t),n-=s*t,(i-=s*e)<0)return-r;if(i>e)return r;if(t>n+n){if(ei+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if(s=Math.floor(t/n),t-=s*n,(e-=s*i)<0)return r;if(e>i)return-r;if(n>t+t){if(ie+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},e(ue.prototype,{countSegment:function(t,e){if(t.xi&&(n=e.x,i=t.x),this.p.x>=n&&this.p.x<=i&&(this.isPointOnSegment=!0),null}if(t.y>this.p.y&&e.y<=this.p.y||e.y>this.p.y&&t.y<=this.p.y){var r=t.x-this.p.x,o=t.y-this.p.y,s=e.x-this.p.x,a=e.y-this.p.y,u=ae.signOfDet2x2(r,o,s,a);if(0===u)return this.isPointOnSegment=!0,null;a0&&this.crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==S.EXTERIOR},getLocation:function(){return this.isPointOnSegment?S.BOUNDARY:this.crossingCount%2==1?S.INTERIOR:S.EXTERIOR},isOnSegment:function(){return this.isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return ue}}),ue.locatePointInRing=function(){if(arguments[0]instanceof p&&M(arguments[1],A)){for(var t=arguments[0],e=arguments[1],n=new ue(t),i=new p,r=new p,o=1;o1||u<0||u>1)&&(r=!0)}}else r=!0;return r?L.min(le.distancePointLine(t,n,i),le.distancePointLine(e,n,i),le.distancePointLine(n,t,e),le.distancePointLine(i,t,e)):0},le.isPointInRing=function(t,e){return le.locatePointInRing(t,e)!==S.EXTERIOR},le.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new p;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;sn.y&&(n=s,r=o)}var a=r;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==r);var u=r;do{u=(u+1)%e}while(t[u].equals2D(n)&&u!==r);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=le.computeOrientation(l,n,c);return 0===h?l.x>c.x:h>0},le.locatePointInRing=function(t,e){return ue.locatePointInRing(t,e)},le.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},le.computeOrientation=function(t,e,n){return le.orientationIndex(t,e,n)},le.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new i("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return s.distance(u);var h=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},le.isOnLine=function(t,e){for(var n=new se,i=1;i=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof p){var i=arguments[0];return le.orientationIndex(this.p0,this.p1,i)}},toGeometry:function(t){return t.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(t){if(!(t instanceof ce))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},intersection:function(t){var e=new se;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},project:function(){if(arguments[0]instanceof p){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new p(t);var e=this.projectionFactor(t),n=new p;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof ce){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1)return null;if(r<=0&&o<=0)return null;var s=this.project(i.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new ce(s,a)}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(t){return 0===t?this.p0:this.p1},distancePerpendicular:function(t){return le.distancePointLinePerpendicular(t,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return ce.midPoint(this.p0,this.p1)},projectionFactor:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;return i<=0?r.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i},closestPoints:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),i=r.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);(o=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||r.isNaN(e))&&(e=1),e},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){if(arguments[0]instanceof ce){var t=arguments[0];return le.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof p){var e=arguments[0];return le.distancePointLine(e,this.p0,this.p1)}},pointAlong:function(t){var e=new p;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},hashCode:function(){var t=java.lang.Double.doubleToLongBits(this.p0.x);t^=31*java.lang.Double.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=java.lang.Double.doubleToLongBits(this.p1.x);return n^=31*java.lang.Double.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},interfaces_:function(){return[o,u]},getClass:function(){return ce}}),ce.midPoint=function(t,e){return new p((t.x+e.x)/2,(t.y+e.y)/2)},ce.serialVersionUID=0x2d2172135f411c00,e(he.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return(he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])||he.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||he.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||he.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))&&this.matrix[S.EXTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===lt.FALSE},isCoveredBy:function(){return(he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])||he.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||he.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||he.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))&&this.matrix[S.INTERIOR][S.EXTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===lt.FALSE},set:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e=0&&e>=0&&this.setAtLeast(t,e,n)},isWithin:function(){return he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.INTERIOR][S.EXTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===lt.FALSE},isTouches:function(t,e){return t>e?this.isTouches(e,t):(t===lt.A&&e===lt.A||t===lt.L&&e===lt.L||t===lt.L&&e===lt.A||t===lt.P&&e===lt.A||t===lt.P&&e===lt.L)&&this.matrix[S.INTERIOR][S.INTERIOR]===lt.FALSE&&(he.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||he.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||he.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))},isOverlaps:function(t,e){return t===lt.P&&e===lt.P||t===lt.A&&e===lt.A?he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&he.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR])&&he.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]):t===lt.L&&e===lt.L&&1===this.matrix[S.INTERIOR][S.INTERIOR]&&he.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR])&&he.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR])},isEquals:function(t,e){return t===e&&he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.INTERIOR][S.EXTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===lt.FALSE},toString:function(){for(var t=new R("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,lt.toDimensionSymbol(this.matrix[e][n]));return t.toString()},setAll:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.matrix[e][n]=t},get:function(t,e){return this.matrix[t][e]},transpose:function(){var t=this.matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=t,t=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=t,t=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=t,this},matches:function(t){if(9!==t.length)throw new i("Should be length 9: "+t);for(var e=0;e<3;e++)for(var n=0;n<3;n++)if(!he.matches(this.matrix[e][n],t.charAt(3*e+n)))return!1;return!0},add:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))},isDisjoint:function(){return this.matrix[S.INTERIOR][S.INTERIOR]===lt.FALSE&&this.matrix[S.INTERIOR][S.BOUNDARY]===lt.FALSE&&this.matrix[S.BOUNDARY][S.INTERIOR]===lt.FALSE&&this.matrix[S.BOUNDARY][S.BOUNDARY]===lt.FALSE},isCrosses:function(t,e){return t===lt.P&&e===lt.L||t===lt.P&&e===lt.A||t===lt.L&&e===lt.A?he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&he.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR]):t===lt.L&&e===lt.P||t===lt.A&&e===lt.P||t===lt.A&&e===lt.L?he.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&he.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]):t===lt.L&&e===lt.L&&0===this.matrix[S.INTERIOR][S.INTERIOR]},interfaces_:function(){return[s]},getClass:function(){return he}}),he.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return e===lt.SYM_DONTCARE||e===lt.SYM_TRUE&&(t>=0||t===lt.TRUE)||e===lt.SYM_FALSE&&t===lt.FALSE||e===lt.SYM_P&&t===lt.P||e===lt.SYM_L&&t===lt.L||e===lt.SYM_A&&t===lt.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var n=arguments[0],i=arguments[1];return new he(n).matches(i)}},he.isTrue=function(t){return t>=0||t===lt.TRUE};var us=Object.freeze({Coordinate:p,CoordinateList:b,Envelope:I,LineSegment:ce,GeometryFactory:ne,Geometry:G,Point:St,LineString:Nt,LinearRing:Pt,Polygon:Lt,GeometryCollection:ft,MultiPoint:Rt,MultiLineString:pt,MultiPolygon:Tt,Dimension:lt,IntersectionMatrix:he,PrecisionModel:te});e(fe.prototype,{addPoint:function(t){this.ptCount+=1,this.ptCentSum.x+=t.x,this.ptCentSum.y+=t.y},setBasePoint:function(t){null===this.areaBasePt&&(this.areaBasePt=t)},addLineSegments:function(t){for(var e=0,n=0;n0&&this.addPoint(t[0])},addHole:function(t){for(var e=le.isCCW(t),n=0;n0)t.x=this.cg3.x/3/this.areasum2,t.y=this.cg3.y/3/this.areasum2;else if(this.totalLength>0)t.x=this.lineCentSum.x/this.totalLength,t.y=this.lineCentSum.y/this.totalLength;else{if(!(this.ptCount>0))return null;t.x=this.ptCentSum.x/this.ptCount,t.y=this.ptCentSum.y/this.ptCount}return t},addShell:function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!le.isCCW(t),n=0;n=this.size())throw new IndexOutOfBoundsException;return this.array_[t]},de.prototype.push=function(t){return this.array_.push(t),t},de.prototype.pop=function(t){if(0===this.array_.length)throw new pe;return this.array_.pop()},de.prototype.peek=function(){if(0===this.array_.length)throw new pe;return this.array_[this.array_.length-1]},de.prototype.empty=function(){return 0===this.array_.length},de.prototype.isEmpty=function(){return this.empty()},de.prototype.search=function(t){return this.array_.indexOf(t)},de.prototype.size=function(){return this.array_.length},de.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e50&&(t=this.reduce(this.inputPts));var e=this.preSort(t),n=this.grahamScan(e),i=this.toCoordinateArray(n);return this.lineOrPolygon(i)},padArray3:function(t){for(var e=new Array(3).fill(null),n=0;ne[2].y&&(e[2]=t[i]),t[i].x+t[i].y>e[3].x+e[3].y&&(e[3]=t[i]),t[i].x>e[4].x&&(e[4]=t[i]),t[i].x-t[i].y>e[5].x-e[5].y&&(e[5]=t[i]),t[i].y0;)e=n.pop();e=n.push(e),e=n.push(t[i])}return e=n.push(t[0]),n},interfaces_:function(){return[]},getClass:function(){return ve}}),ve.extractCoordinates=function(t){var e=new ge;return t.apply(e),e.getCoordinates()},e(ye.prototype,{compare:function(t,e){var n=t,i=e;return ye.polarCompare(this.origin,n,i)},interfaces_:function(){return[a]},getClass:function(){return ye}}),ye.polarCompare=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-t.x,s=n.y-t.y,a=le.computeOrientation(t,e,n);if(a===le.COUNTERCLOCKWISE)return 1;if(a===le.CLOCKWISE)return-1;var u=i*i+r*r,l=o*o+s*s;return ul?1:0},ve.RadialComparator=ye,e(me.prototype,{transformPoint:function(t,e){return this.factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},transformPolygon:function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof Pt&&!i.isEmpty()||(n=!1);for(var r=new w,o=0;o0&&i<4&&!this.preserveType?this.factory.createLineString(n):this.factory.createLinearRing(n)},interfaces_:function(){return[]},getClass:function(){return me}}),e(xe.prototype,{snapVertices:function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i=0&&t.add(o+1,new p(r),!1)}},findSegmentIndexToSnap:function(t,e){for(var n=r.MAX_VALUE,i=-1,o=0;oe&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(Ee.computeOverlaySnapTolerance(r),Ee.computeOverlaySnapTolerance(o))}},Ee.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Ee.SNAP_PRECISION_FACTOR},Ee.snapToSelf=function(t,e,n){return new Ee(t).snapToSelf(e,n)},Ee.SNAP_PRECISION_FACTOR=1e-9,c(we,me),e(we.prototype,{snapLine:function(t,e){var n=new xe(t,this.snapTolerance);return n.setAllowSnappingToSourceVertices(this.isSelfSnap),n.snapTo(e)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this.snapPts);return this.factory.getCoordinateSequenceFactory().create(i)},interfaces_:function(){return[]},getClass:function(){return we}}),e(be.prototype,{getCommon:function(){return r.longBitsToDouble(this.commonBits)},add:function(t){var e=r.doubleToLongBits(t);return this.isFirst?(this.commonBits=e,this.commonSignExp=be.signExpBits(this.commonBits),this.isFirst=!1,null):be.signExpBits(e)!==this.commonSignExp?(this.commonBits=0,null):(this.commonMantissaBitsCount=be.numCommonMostSigMantissaBits(this.commonBits,e),void(this.commonBits=be.zeroLowerBits(this.commonBits,64-(12+this.commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],e=r.longBitsToDouble(t),n=Long.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64);return o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]"}},interfaces_:function(){return[]},getClass:function(){return be}}),be.getBit=function(t,e){return 0!=(t&1<>52},be.zeroLowerBits=function(t,e){return t&~((1<=0;i--){if(be.getBit(t,i)!==be.getBit(e,i))return n;n++}return 52},e(Ie.prototype,{addCommonBits:function(t){var e=new Ce(this.commonCoord);t.apply(e),t.geometryChanged()},removeCommonBits:function(t){if(0===this.commonCoord.x&&0===this.commonCoord.y)return t;var e=new p(this.commonCoord);e.x=-e.x,e.y=-e.y;var n=new Ce(e);return t.apply(n),t.geometryChanged(),t},getCommonCoordinate:function(){return this.commonCoord},add:function(t){t.apply(this.ccFilter),this.commonCoord=this.ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return Ie}}),e(Ne.prototype,{filter:function(t){this.commonBitsX.add(t.x),this.commonBitsY.add(t.y)},getCommonCoordinate:function(){return new p(this.commonBitsX.getCommon(),this.commonBitsY.getCommon())},interfaces_:function(){return[j]},getClass:function(){return Ne}}),e(Ce.prototype,{filter:function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[ht]},getClass:function(){return Ce}}),Ie.CommonCoordinateFilter=Ne,Ie.Translater=Ce,e(Se.prototype,{next:function(){if(this.atStart)return this.atStart=!1,Se.isAtomic(this.parent)&&this.index++,this.parent;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return this.subcollectionIterator.next();this.subcollectionIterator=null}if(this.index>=this.max)throw new x;var t=this.parent.getGeometryN(this.index++);return t instanceof ft?(this.subcollectionIterator=new Se(t),this.subcollectionIterator.next()):t},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){if(this.atStart)return!0;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return!0;this.subcollectionIterator=null}return!(this.index>=this.max)},interfaces_:function(){return[g]},getClass:function(){return Se}}),Se.isAtomic=function(t){return!(t instanceof ft)},e(Me.prototype,{locateInternal:function(){if(arguments[0]instanceof p&&arguments[1]instanceof Lt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return S.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===S.EXTERIOR)return S.EXTERIOR;if(i===S.BOUNDARY)return S.BOUNDARY;for(var r=0;r0||this.isIn?S.INTERIOR:S.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return Me}}),e(Le.prototype,{interfaces_:function(){return[]},getClass:function(){return Le}}),Le.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new i("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof p&&arguments[1]instanceof p){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(0===a&&0===u)throw new i("Cannot compute the octant for two identical points "+o);return Le.octant(a,u)}},e(Re.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(t){},isClosed:function(){},setData:function(t){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return Re}}),e(Pe.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(t){return this.pts[t]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(t){return t===this.pts.length-1?-1:Le.octant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},getData:function(){return this.data},toString:function(){return re.toLineString(new qt(this.pts))},interfaces_:function(){return[Re]},getClass:function(){return Pe}}),e(Te.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return Te}}),e(Oe.prototype,{getItem:function(){return this.item},getBounds:function(){return this.bounds},interfaces_:function(){return[Te,u]},getClass:function(){return Oe}}),e(_e.prototype,{poll:function(){if(this.isEmpty())return null;var t=this.items.get(1);return this.items.set(1,this.items.get(this._size)),this._size-=1,this.reorder(1),t},size:function(){return this._size},reorder:function(t){for(var e=null,n=this.items.get(t);2*t<=this._size&&(e=2*t,e!==this._size&&this.items.get(e+1).compareTo(this.items.get(e))<0&&e++,this.items.get(e).compareTo(n)<0);t=e)this.items.set(t,this.items.get(e));this.items.set(t,n)},clear:function(){this._size=0,this.items.clear()},isEmpty:function(){return 0===this._size},add:function(t){this.items.add(null),this._size+=1;var e=this._size;for(this.items.set(0,t);t.compareTo(this.items.get(Math.trunc(e/2)))<0;e/=2)this.items.set(e,this.items.get(Math.trunc(e/2)));this.items.set(e,t)},interfaces_:function(){return[]},getClass:function(){return _e}}),e(Ae.prototype,{visitItem:function(t){},interfaces_:function(){return[]},getClass:function(){return Ae}}),e(De.prototype,{insert:function(t,e){},remove:function(t,e){},query:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return De}}),e(Fe.prototype,{getLevel:function(){return this.level},size:function(){return this.childBoundables.size()},getChildBoundables:function(){return this.childBoundables},addChildBoundable:function(t){f.isTrue(null===this.bounds),this.childBoundables.add(t)},isEmpty:function(){return this.childBoundables.isEmpty()},getBounds:function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},interfaces_:function(){return[Te,u]},getClass:function(){return Fe}}),Fe.serialVersionUID=0x5a1e55ec41369800;var ls={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return ls.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?ut.sort(n,e):ut.sort(n);for(var i=t.iterator(),r=0,o=n.length;rqe.area(this.boundable2)?(this.expand(this.boundable1,this.boundable2,t,e),null):(this.expand(this.boundable2,this.boundable1,t,e),null);if(n)return this.expand(this.boundable1,this.boundable2,t,e),null;if(r)return this.expand(this.boundable2,this.boundable1,t,e),null;throw new i("neither boundable is composite")},isLeaves:function(){return!(qe.isComposite(this.boundable1)||qe.isComposite(this.boundable2))},compareTo:function(t){var e=t;return this._distancee._distance?1:0},expand:function(t,e,n,i){for(var r=t.getChildBoundables(),o=r.iterator();o.hasNext();){var s=o.next(),a=new qe(s,e,this.itemDistance);a.getDistance()-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Fe?this.boundablesAtLevel(n,s,r):(f.isTrue(s instanceof Oe),-1===n&&r.add(s))}return null}},query:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new w;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query(t,this.root,e),e)}if(2===arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this.root.getBounds(),n)&&this.query(n,this.root,i)}else if(3===arguments.length)if(M(arguments[2],Ae)&&arguments[0]instanceof Object&&arguments[1]instanceof Fe)for(var r=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;ue&&(e=r)}}return e+1}},createParentBoundables:function(t,e){f.isTrue(!t.isEmpty());var n=new w;n.add(this.createNode(e));var i=new w(t);ls.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},isEmpty:function(){return this.built?this.root.isEmpty():this.itemBoundables.isEmpty()},interfaces_:function(){return[u]},getClass:function(){return ke}}),ke.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new w,i=0;i0;){var h=c.poll(),f=h.getDistance();if(f>=u)break;h.isLeaves()?(u=f,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var p=arguments[0],d=arguments[1],g=arguments[2],v=new Oe(p,d),e=new qe(this.getRoot(),v,g);return this.nearestNeighbour(e)[0]}},interfaces_:function(){return[De,u]},getClass:function(){return Be}}),Be.centreX=function(t){return Be.avg(t.getMinX(),t.getMaxX())},Be.avg=function(t,e){return(t+e)/2},Be.centreY=function(t){return Be.avg(t.getMinY(),t.getMaxY())},c(ze,Fe),e(ze.prototype,{computeBounds:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new I(n.getBounds()):t.expandToInclude(n.getBounds())}return t},interfaces_:function(){return[]},getClass:function(){return ze}}),Be.STRtreeNode=ze,Be.serialVersionUID=0x39920f7d5f261e0,Be.xComparator={interfaces_:function(){return[a]},compare:function(t,e){return ke.compareDoubles(Be.centreX(t.getBounds()),Be.centreX(e.getBounds()))}},Be.yComparator={interfaces_:function(){return[a]},compare:function(t,e){return ke.compareDoubles(Be.centreY(t.getBounds()),Be.centreY(e.getBounds()))}},Be.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(t,e){return t.intersects(e)}},Be.DEFAULT_NODE_CAPACITY=10,e(Ve.prototype,{interfaces_:function(){return[]},getClass:function(){return Ve}}),Ve.relativeSign=function(t,e){return te?1:0},Ve.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Ve.relativeSign(e.x,n.x),r=Ve.relativeSign(e.y,n.y);switch(t){case 0:return Ve.compareValue(i,r);case 1:return Ve.compareValue(r,i);case 2:return Ve.compareValue(r,-i);case 3:return Ve.compareValue(-i,r);case 4:return Ve.compareValue(-i,-r);case 5:return Ve.compareValue(-r,-i);case 6:return Ve.compareValue(-r,i);case 7:return Ve.compareValue(i,-r)}return f.shouldNeverReachHere("invalid octant value"),0},Ve.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0},e(Xe.prototype,{getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},compareTo:function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Ve.compare(this.segmentOctant,this.coord,e.coord)},isEndPoint:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},isInterior:function(){return this._isInterior},interfaces_:function(){return[o]},getClass:function(){return Xe}}),e(Ye.prototype,{getSplitCoordinates:function(){var t=new b;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},addCollapsedNodes:function(){var t=new w;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this.edge.getCoordinate(n),n)}},print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},findCollapsesFromExistingVertices:function(t){for(var e=0;ee?t:e;return 0===n&&3===i?3:n},Ke.isInHalfPlane=function(t,e){return e===Ke.SE?t===Ke.SE||t===Ke.SW:t===e||t===e+1},Ke.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new i("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ke.NE:Ke.SE:e>=0?Ke.NW:Ke.SW}if(arguments[0]instanceof p&&arguments[1]instanceof p){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new i("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ke.NE:Ke.SE:r.y>=n.y?Ke.NW:Ke.SW}},Ke.NE=0,Ke.NW=1,Ke.SW=2,Ke.SE=3,e(Qe.prototype,{interfaces_:function(){return[]},getClass:function(){return Qe}}),Qe.getChainStartIndices=function(t){var e=0,n=new w;n.add(new P(e));do{var i=Qe.findChainEnd(t,e);n.add(new P(i)),e=i}while(e=t.length-1)return t.length-1;for(var i=Ke.quadrant(t[n],t[n+1]),r=e+1;rn.getId()&&(n.computeOverlaps(o,t),this.nOverlaps++),this.segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return en}}),c(nn,Je),e(nn.prototype,{overlap:function(){if(4!==arguments.length)return Je.prototype.overlap.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3],r=t.getContext(),o=n.getContext();this.si.processIntersections(r,e,o,i)},interfaces_:function(){return[]},getClass:function(){return nn}}),en.SegmentOverlapAction=nn,c(rn,l),e(rn.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return rn}}),rn.msgWithCoord=function(t,e){return null!==e?t+" [ "+e+" ]":t},e(on.prototype,{processIntersections:function(t,e,n,i){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return on}}),e(sn.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(t){this.isCheckEndSegmentsOnly=t},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(t){this.findAllIntersections=t},setKeepIntersections:function(t){this.keepIntersections=t},processIntersections:function(t,e,n,i){if(!this.findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this.isCheckEndSegmentsOnly){if(!(this.isEndSegment(t,e)||this.isEndSegment(n,i)))return null}var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=new Array(4).fill(null),this.intSegments[0]=r,this.intSegments[1]=o,this.intSegments[2]=s,this.intSegments[3]=a,this.interiorIntersection=this.li.getIntersection(0),this.keepIntersections&&this.intersections.add(this.interiorIntersection),this.intersectionCount++)},isEndSegment:function(t,e){return 0===e||e>=t.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return!this.findAllIntersections&&null!==this.interiorIntersection},interfaces_:function(){return[on]},getClass:function(){return sn}}),sn.createAllIntersectionsFinder=function(t){var e=new sn(t);return e.setFindAllIntersections(!0),e},sn.createAnyIntersectionFinder=function(t){return new sn(t)},sn.createIntersectionCounter=function(t){var e=new sn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},e(an.prototype,{execute:function(){return null!==this.segInt?null:void this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(t){this.findAllIntersections=t},checkInteriorIntersections:function(){this._isValid=!0,this.segInt=new sn(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var t=new en;if(t.setSegmentIntersector(this.segInt),t.computeNodes(this.segStrings),this.segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new rn(this.getErrorMessage(),this.segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var t=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+re.toLineString(t[0],t[1])+" and "+re.toLineString(t[2],t[3])},interfaces_:function(){return[]},getClass:function(){return an}}),an.computeIntersections=function(t){var e=new an(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},e(un.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return un}}),un.toSegmentStrings=function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Pe(i.getCoordinates(),i))}return e},un.checkValid=function(t){new un(t).checkValid()},e(ln.prototype,{map:function(t){for(var e=new w,n=0;nthis.location.length){var e=new Array(3).fill(null);e[cn.ON]=this.location[cn.ON],e[cn.LEFT]=S.NONE,e[cn.RIGHT]=S.NONE,this.location=e}for(var n=0;n1&&t.append(S.toLocationSymbol(this.location[cn.LEFT])),t.append(S.toLocationSymbol(this.location[cn.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[cn.RIGHT])),t.toString()},setLocations:function(t,e,n){this.location[cn.ON]=t,this.location[cn.LEFT]=e,this.location[cn.RIGHT]=n},get:function(t){return t1},isAnyNull:function(){for(var t=0;tthis.maxNodeDegree&&(this.maxNodeDegree=n),t=this.getNext(t)}while(t!==this.startDe);this.maxNodeDegree*=2},addPoints:function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var o=r;o=0;o--)this.pts.add(i[o])}},isHole:function(){return this._isHole},setInResult:function(){var t=this.startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this.startDe)},containsPoint:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!le.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this.holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},addHole:function(t){this.holes.add(t)},isShell:function(){return null===this.shell},getLabel:function(){return this.label},getEdges:function(){return this.edges},getMaxNodeDegree:function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},getShell:function(){return this.shell},mergeLabel:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=e.getLocation(n,cn.RIGHT);if(i===S.NONE)return null;if(this.label.getLocation(n)===S.NONE)return this.label.setLocation(n,i),null}},setShell:function(t){this.shell=t,null!==t&&t.addHole(this)},toPolygon:function(t){for(var e=new Array(this.holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return vn}}),c(yn,vn),e(yn.prototype,{isIncidentEdgeInResult:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){if(t.next().getEdge().isInResult())return!0}return!1},isIsolated:function(){return 1===this.label.getGeometryCount()},getCoordinate:function(){return this.coord},print:function(t){t.println("node "+this.coord+" lbl: "+this.label)},computeIM:function(t){},computeMergedLocation:function(t,e){var n=S.NONE;if(n=this.label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==S.BOUNDARY&&(n=i)}return n},setLabel:function(){if(2!==arguments.length)return vn.prototype.setLabel.apply(this,arguments);var t=arguments[0],e=arguments[1];null===this.label?this.label=new fn(t,e):this.label.setLocation(t,e)},getEdges:function(){return this.edges},mergeLabel:function(){if(arguments[0]instanceof yn){var t=arguments[0];this.mergeLabel(t.label)}else if(arguments[0]instanceof fn)for(var e=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(e,n),r=this.label.getLocation(n);r===S.NONE&&this.label.setLocation(n,i)}},add:function(t){this.edges.insert(t),t.setNode(this)},setLabelBoundary:function(t){if(null===this.label)return null;var e=S.NONE;null!==this.label&&(e=this.label.getLocation(t));var n=null;switch(e){case S.BOUNDARY:n=S.INTERIOR;break;case S.INTERIOR:n=S.BOUNDARY;break;default:n=S.BOUNDARY}this.label.setLocation(t,n)},interfaces_:function(){return[]},getClass:function(){return yn}}),e(mn.prototype,{find:function(t){return this.nodeMap.get(t)},addNode:function(){if(arguments[0]instanceof p){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof yn){var n=arguments[0],e=this.nodeMap.get(n.getCoordinate());return null===e?(this.nodeMap.put(n.getCoordinate(),n),n):(e.mergeLabel(n),e)}},print:function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(t){for(var e=new w,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===S.BOUNDARY&&e.add(i)}return e},add:function(t){var e=t.getCoordinate();this.addNode(e).add(t)},interfaces_:function(){return[]},getClass:function(){return mn}}),e(xn.prototype,{compareDirection:function(t){return this.dx===t.dx&&this.dy===t.dy?0:this.quadrant>t.quadrant?1:this.quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else i.add(o)}return i},containsPoint:function(t){for(var e=this.shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},buildMaximalEdgeRings:function(t){for(var e=new w,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new gn(i,this.geometryFactory);e.add(r),r.setInResult()}}return e},placePolygonHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},getPolygons:function(){return this.computePolygons(this.shellList)},findEdgeRingContaining:function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(i)&&le.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},findShell:function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return f.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];bn.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new w,o=this.buildMinimalEdgeRings(i,this.shellList,r);this.sortShellsAndHoles(o,this.shellList,r),this.placeFreeHoles(this.shellList,r)}},interfaces_:function(){return[]},getClass:function(){return In}}),e(Nn.prototype,{collectLines:function(t){for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this.lineEdgesList),this.collectBoundaryTouchEdge(n,t,this.lineEdgesList)}},labelIsolatedLine:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.op.getArgGeometry(e));t.getLabel().setLocation(e,n)},build:function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this.resultLineList},collectLineEdge:function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!ni.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},findCoveredLineEdges:function(){for(var t=this.op.getGraph().getNodes().iterator();t.hasNext();){t.next().getEdges().findCoveredLineEdges()}for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getEdge();if(n.isLineEdge()&&!i.isCoveredSet()){var r=this.op.isCoveredByA(n.getCoordinate());i.setCovered(r)}}},labelIsolatedLines:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},buildLines:function(t){for(var e=this.lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=(n.getLabel(),this.geometryFactory.createLineString(n.getCoordinates()));this.resultLineList.add(i),n.setInResult(!0)}},collectBoundaryTouchEdge:function(t,e,n){var i=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(f.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(ni.isResultOfOp(i,e)&&e===ni.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return Nn}}),e(Cn.prototype,{filterCoveredNodeToPoint:function(t){var e=t.getCoordinate();if(!this.op.isCoveredByLA(e)){ var n=this.geometryFactory.createPoint(e);this.resultPointList.add(n)}},extractNonCoveredResultNodes:function(t){for(var e=this.op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==ni.INTERSECTION)){var i=n.getLabel();ni.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return Cn}}),e(Sn.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return Sn}}),e(Mn.prototype,{locate:function(t){return Mn.locate(t,this.geom)},interfaces_:function(){return[Sn]},getClass:function(){return Mn}}),Mn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&le.isPointInRing(t,e.getCoordinates())},Mn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Mn.isPointInRing(t,n))return!1;for(var i=0;i=0;n--){var i=this.edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},computeDepths:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=(t.getLabel(),t.getDepth(cn.LEFT)),i=t.getDepth(cn.RIGHT),r=this.computeDepths(e+1,this.edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new rn("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=a,l=o;l=0;r--){var o=this.resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this.SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this.SCANNING_FOR_INCOMING}}i===this.LINKING_TO_OUTGOING&&(f.isTrue(null!==e,"found null for first outgoing dirEdge"),f.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},getOutgoingDegree:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){var n=e.next();n.isInResult()&&t++}return t}if(1===arguments.length){for(var i=arguments[0],t=0,e=this.iterator();e.hasNext();){var n=e.next();n.getEdgeRing()===i&&t++}return t}},getLabel:function(){return this.label},findCoveredLineEdges:function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=S.INTERIOR;break}if(i.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var r=t,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();n.isLineEdge()?n.getEdge().setCovered(r===S.INTERIOR):(n.isInResult()&&(r=S.EXTERIOR),i.isInResult()&&(r=S.INTERIOR))}},computeLabelling:function(t){Ln.prototype.computeLabelling.call(this,t),this.label=new fn(S.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge(),r=i.getLabel(),o=0;o<2;o++){var s=r.getLocation(o);s!==S.INTERIOR&&s!==S.BOUNDARY||this.label.setLocation(o,S.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Rn}}),c(Pn,wn),e(Pn.prototype,{createNode:function(t){return new yn(t,new Rn)},interfaces_:function(){return[]},getClass:function(){return Pn}}),e(Tn.prototype,{computeIntersections:function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},interfaces_:function(){return[]},getClass:function(){return Tn}}),e(On.prototype,{isDelete:function(){return this.eventType===On.DELETE},setDeleteEventIndex:function(t){this.deleteEventIndex=t},getObject:function(){return this.obj},compareTo:function(t){var e=t;return this.xValuee.xValue?1:this.eventTypee.eventType?1:0},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===On.INSERT},isSameLabel:function(t){return null!==this.label&&this.label===t.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[o]},getClass:function(){return On}}),On.INSERT=1,On.DELETE=2,e(_n.prototype,{interfaces_:function(){return[]},getClass:function(){return _n}}),e(An.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this.li.getIntersectionNum()){if(An.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(t){this.isDoneWhenProperInt=t},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),r=i.getCoordinate();if(t.isIntersection(r))return!0}return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},setBoundaryNodes:function(t,e){this.bdyNodes=new Array(2).fill(null),this.bdyNodes[0]=t,this.bdyNodes[1]=e},addIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&(this.recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this.includeProper&&this.li.isProper()||(t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).copy(),this.hasProper=!0,this.isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))},interfaces_:function(){return[]},getClass:function(){return An}}),An.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},c(Dn,_n),e(Dn.prototype,{prepareEvents:function(){ls.sort(this.events);for(var t=0;te||this.maxo?1:0},interfaces_:function(){return[a]},getClass:function(){return qn}}),Fn.NodeComparator=qn,c(kn,Fn),e(kn.prototype,{query:function(t,e,n){return this.intersects(t,e)?void n.visitItem(this.item):null},interfaces_:function(){return[]},getClass:function(){return kn}}),c(Gn,Fn),e(Gn.prototype,{buildExtent:function(t,e){this.min=Math.min(t.min,e.min),this.max=Math.max(t.max,e.max)},query:function(t,e,n){return this.intersects(t,e)?(null!==this.node1&&this.node1.query(t,e,n),void(null!==this.node2&&this.node2.query(t,e,n))):null},interfaces_:function(){return[]},getClass:function(){return Gn}}),e(jn.prototype,{buildTree:function(){ls.sort(this.leaves,new IntervalRTreeNode.NodeComparator);for(var t=this.leaves,e=null,n=new w;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},insert:function(t,e,n){if(null!==this.root)throw new IllegalStateException("Index cannot be added to once it has been queried");this.leaves.add(new kn(t,e,n))},query:function(t,e,n){this.init(),this.root.query(t,e,n)},buildRoot:function(){return null!==this.root?null:void(this.root=this.buildTree())},printNode:function(t){D.out.println(re.toLineString(new p(t.min,this.level),new p(t.max,this.level)))},init:function(){return null!==this.root?null:void this.buildRoot()},buildLevel:function(t,e){this.level++,e.clear();for(var n=0;n0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new p(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new Kn(o,new fn(this.edge.label))},add:function(t,e,n){var i=new Un(t,e,n),r=this.nodeMap.get(i);return null!==r?r:(this.nodeMap.put(i,i),i)},isIntersection:function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},interfaces_:function(){return[]},getClass:function(){return Wn}}),e(Hn.prototype,{getChainStartIndices:function(t){var e=0,n=new w;n.add(new P(e));do{var i=this.findChainEnd(t,e);n.add(new P(i)),e=i}while(en?e:n},getMinX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(i=1),this.depth[t][n]=i}}},getDelta:function(t){return this.depth[t][cn.RIGHT]-this.depth[t][cn.LEFT]},getLocation:function(t,e){return this.depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var i=t.getLocation(e,n);i!==S.EXTERIOR&&i!==S.INTERIOR||(this.isNull(e,n)?this.depth[e][n]=Zn.depthAtLocation(i):this.depth[e][n]+=Zn.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];s===S.INTERIOR&&this.depth[r][o]++}},interfaces_:function(){return[]},getClass:function(){return Zn}}),Zn.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:Zn.NULL_VALUE},Zn.NULL_VALUE=-1,c(Kn,vn),e(Kn.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new Kn(t,fn.toLineLabel(this.label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(t){this._isIsolated=t},setName:function(t){this.name=t},equals:function(t){if(!(t instanceof Kn))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,i=!0,r=this.pts.length,o=0;o0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},print:function(t){t.print("edge "+this.name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this.label+" "+this.depthDelta)},computeIM:function(t){Kn.updateIM(this.label,t)},isCollapsed:function(){return!!this.label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this.depthDelta},getNumPoints:function(){return this.pts.length},printReverse:function(t){t.print("edge "+this.name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},getMonotoneChainEdge:function(){return null===this.mce&&(this.mce=new Jn(this)),this.mce},getEnvelope:function(){if(null===this.env){this.env=new I;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this.label+" "+this.depthDelta),t.toString()},isPointwiseEqual:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e=2,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,e[0]),this.insertBoundaryPoint(this.argIndex,e[e.length-1])},getInvalidPoint:function(){return this.invalidPoint},getBoundaryPoints:function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},getBoundaryNodes:function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},addSelfIntersectionNode:function(t,e,n){return this.isBoundaryNode(t,e)?null:void(n===S.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n))},addPolygonRing:function(t,e,n){if(t.isEmpty())return null;var i=U.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this.invalidPoint=i[0],null;var r=e,o=n;le.isCCW(i)&&(r=n,o=e);var s=new Kn(i,new fn(this.argIndex,S.BOUNDARY,r,o));this.lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this.argIndex,i[0],S.BOUNDARY)},insertPoint:function(t,e,n){var i=this.nodes.addNode(e),r=i.getLabel();null===r?i.label=new fn(t,n):r.setLocation(t,n)},createEdgeSetIntersector:function(){return new Dn},addSelfIntersectionNodes:function(t){for(var e=this.edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},add:function(){if(1!==arguments.length)return bn.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof Tt&&(this.useBoundaryDeterminationRule=!1),t instanceof Lt)this.addPolygon(t);else if(t instanceof Nt)this.addLineString(t);else if(t instanceof St)this.addPoint(t);else if(t instanceof Rt)this.addCollection(t);else if(t instanceof pt)this.addCollection(t);else if(t instanceof Tt)this.addCollection(t);else{if(!(t instanceof ft))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},addCollection:function(t){for(var e=0;e50?(null===this.areaPtLocator&&(this.areaPtLocator=new Vn(this.parentGeom)),this.areaPtLocator.locate(t)):this.ptLocator.locate(t,this.parentGeom)},findEdge:function(){if(1===arguments.length){var t=arguments[0];return this.lineEdgeMap.get(t)}return bn.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return Qn}}),Qn.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},e($n.prototype,{getArgGeometry:function(t){return this.arg[t].getGeometry()},setComputationPrecision:function(t){this.resultPrecisionModel=t,this.li.setPrecisionModel(this.resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return $n}}),e(ti.prototype,{compareTo:function(t){var e=t;return ti.compareOriented(this.pts,this._orientation,e.pts,e._orientation)},interfaces_:function(){return[o]},getClass:function(){return ti}}),ti.orientation=function(t){return 1===U.increasingDirection(t)},ti.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,u=e?0:t.length-1,l=i?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;u+=r,l+=o;var h=u===s,f=l===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}},e(ei.prototype,{print:function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")},addAll:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},findEdgeIndex:function(t){for(var e=0;ethis.maxWidth)&&(this.interiorPoint=e,this.maxWidth=n)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function(){if(arguments[0]instanceof ft){var t=arguments[0];if(t.isEmpty())return t;for(var e=t.getGeometryN(0),n=1;ne.getEnvelopeInternal().getWidth()&&(e=t.getGeometryN(n));return e}if(arguments[0]instanceof G){var i=arguments[0];return i instanceof ft?this.widestGeometry(i):i}},horizontalBisector:function(t){var e=t.getEnvelopeInternal(),n=si.getBisectorY(t);return this.factory.createLineString([new p(e.getMinX(),n),new p(e.getMaxX(),n)])},add:function(t){if(t instanceof Lt)this.addPolygon(t);else if(t instanceof ft)for(var e=t,n=0;nthis.loY&&(this.loY=t):t>this.centreY&&tt&&(t=n)}return t+1},nodeSize:function(){for(var t=0,e=0;e<2;e++)null!==this.subnode[e]&&(t+=this.subnode[e].nodeSize());return t+1},add:function(t){this.items.add(t)},interfaces_:function(){return[]},getClass:function(){return ci}}),ci.getSubnodeIndex=function(t,e){var n=-1;return t.min>=e&&(n=1),t.max<=e&&(n=0),n},e(hi.prototype,{expandToInclude:function(t){t.max>this.max&&(this.max=t.max),t.minn||this.max=this.min&&e<=this.max}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return n>=this.min&&i<=this.max}},init:function(t,e){this.min=t,this.max=e,t>e&&(this.min=e,this.max=t)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return hi}}),fi.exponent=function(t){return pi(64,t)-1023},fi.powerOf2=function(t){return Math.pow(2,t)},e(di.prototype,{getInterval:function(){return this.interval},getLevel:function(){return this.level},computeKey:function(t){for(this.level=di.computeLevel(t),this.interval=new hi,this.computeInterval(this.level,t);!this.interval.contains(t);)this.level+=1,this.computeInterval(this.level,t)},computeInterval:function(t,e){var n=fi.powerOf2(t);this.pt=Math.floor(e.getMin()/n)*n,this.interval.init(this.pt,this.pt+n)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return di}}),di.computeLevel=function(t){var e=t.getWidth();return fi.exponent(e)+1},c(gi,ci),e(gi.prototype,{getInterval:function(){return this.interval},find:function(t){var e=ci.getSubnodeIndex(t,this.centre);if(-1===e)return this;if(null!==this.subnode[e]){return this.subnode[e].find(t)}return this},insert:function(t){f.isTrue(null===this.interval||this.interval.contains(t.interval));var e=ci.getSubnodeIndex(t.interval,this.centre);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insert(t),this.subnode[e]=n}},isSearchMatch:function(t){return t.overlaps(this.interval)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getNode:function(t){var e=ci.getSubnodeIndex(t,this.centre);if(-1!==e){return this.getSubnode(e).getNode(t)}return this},createSubnode:function(t){var e=0,n=0;switch(t){case 0:e=this.interval.getMin(),n=this.centre;break;case 1:e=this.centre,n=this.interval.getMax()}return new gi(new hi(e,n),this.level-1)},interfaces_:function(){return[]},getClass:function(){return gi}}),gi.createNode=function(t){var e=new di(t);return new gi(e.getInterval(),e.getLevel())},gi.createExpanded=function(t,e){var n=new hi(e);null!==t&&n.expandToInclude(t.interval);var i=gi.createNode(n);return null!==t&&i.insert(t),i},e(vi.prototype,{interfaces_:function(){return[]},getClass:function(){return vi}});vi.isZeroWidth=function(t,e){var n=e-t;if(0===n)return!0;var i=Math.max(Math.abs(t),Math.abs(e)),r=n/i;return fi.exponent(r)<=vi.MIN_BINARY_EXPONENT},vi.MIN_BINARY_EXPONENT=-50,c(yi,ci),e(yi.prototype,{insert:function(t,e){var n=ci.getSubnodeIndex(t,yi.origin);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getInterval().contains(t)){var r=gi.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){f.isTrue(t.getInterval().contains(e));var i=vi.isZeroWidth(e.getMin(),e.getMax()),r=null;r=i?t.find(e):t.getNode(e),r.add(n)},interfaces_:function(){return[]},getClass:function(){return yi}}),yi.origin=0,e(mi.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=mi.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];return this.query(new hi(t,t))}if(arguments[0]instanceof hi){var e=arguments[0],n=new w;return this.query(e,n),n}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.root.addAllItemsFromOverlapping(i,r)}},iterator:function(){var t=new w;return this.root.addAllItems(t),t.iterator()},remove:function(t,e){var n=mi.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e0&&(this.minExtent=e)},depth:function(){return null!==this.root?this.root.depth():0},nodeSize:function(){return null!==this.root?this.root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return mi}}),mi.ensureExtent=function(t,e){var n=t.getMin(),i=t.getMax();return n!==i?t:(n===i&&(n-=e/2,i=n+e/2),new hi(n,i))},e(xi.prototype,{isInside:function(t){},interfaces_:function(){return[]},getClass:function(){return xi}}),e(Ei.prototype,{testLineSegment:function(t,e){var n=null,i=null,r=null,o=null,s=e.p0,a=e.p1;n=s.x-t.x,i=s.y-t.y,r=a.x-t.x,o=a.y-t.y,(i>0&&o<=0||o>0&&i<=0)&&0Math.PI;)t-=bi.PI_TIMES_2;for(;t<=-Math.PI;)t+=bi.PI_TIMES_2;return t},bi.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},bi.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},bi.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},bi.interiorAngle=function(t,e,n){var i=bi.angle(e,t),r=bi.angle(e,n);return Math.abs(r-i)},bi.normalizePositive=function(t){if(t<0){for(;t<0;)t+=bi.PI_TIMES_2;t>=bi.PI_TIMES_2&&(t=0)}else{for(;t>=bi.PI_TIMES_2;)t-=bi.PI_TIMES_2;t<0&&(t=0)}return t},bi.angleBetween=function(t,e,n){var i=bi.angle(e,t),r=bi.angle(e,n);return bi.diff(i,r)},bi.diff=function(t,e){var n=null;return n=tMath.PI&&(n=2*Math.PI-n),n},bi.toRadians=function(t){return t*Math.PI/180},bi.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?bi.COUNTERCLOCKWISE:n<0?bi.CLOCKWISE:bi.NONE},bi.angleBetweenOriented=function(t,e,n){var i=bi.angle(e,t),r=bi.angle(e,n),o=r-i;return o<=-Math.PI?o+bi.PI_TIMES_2:o>Math.PI?o-bi.PI_TIMES_2:o},bi.PI_TIMES_2=2*Math.PI,bi.PI_OVER_2=Math.PI/2,bi.PI_OVER_4=Math.PI/4,bi.COUNTERCLOCKWISE=le.COUNTERCLOCKWISE,bi.CLOCKWISE=le.CLOCKWISE,bi.NONE=le.COLLINEAR,e(Ii.prototype,{area:function(){return Ii.area(this.p0,this.p1,this.p2)},signedArea:function(){return Ii.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(t){if(null===t)throw new i("Supplied point is null.");return Ii.interpolateZ(t,this.p0,this.p1,this.p2)},longestSideLength:function(){return Ii.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return Ii.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return Ii.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return Ii.area3D(this.p0,this.p1,this.p2)},centroid:function(){return Ii.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return Ii.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return Ii}}),Ii.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Ii.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Ii.det=function(t,e,n,i){return t*i-e*n},Ii.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,u=n.y-o,l=i.y-o,c=s*l-a*u,h=t.x-r,f=t.y-o,p=(l*h-a*f)/c,d=(-u*h+s*f)/c;return e.z+p*(n.z-e.z)+d*(i.z-e.z)},Ii.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},Ii.isAcute=function(t,e,n){return!!bi.isAcute(t,e,n)&&!!bi.isAcute(e,n,t)&&!!bi.isAcute(n,t,e)},Ii.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,u=e.y-r,l=2*Ii.det(o,s,a,u);return new p(i-Ii.det(s,o*o+s*s,u,a*a+u*u)/l,r+Ii.det(o,o*o+s*s,a,a*a+u*u)/l)},Ii.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y;return new F(new F(t.x+n/2,t.y+i/2,1),new F(t.x-i+n/2,t.y+n+i/2,1))},Ii.angleBisector=function(t,e,n){var i=e.distance(t),r=e.distance(n),o=i/(i+r),s=n.x-t.x,a=n.y-t.y;return new p(t.x+o*s,t.y+o*a)},Ii.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=r*u-o*a,c=o*s-i*u,h=i*a-r*s,f=l*l+c*c+h*h;return Math.sqrt(f)/2},Ii.centroid=function(t,e,n){return new p((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)},Ii.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o;return new p((i*t.x+r*e.x+o*n.x)/s,(i*t.y+r*e.y+o*n.y)/s)},e(Ni.prototype,{getRadius:function(){return this.compute(),this.radius},getDiameter:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var t=this.extremalPts[0],e=this.extremalPts[1];return this.input.getFactory().createLineString([t,e])},getExtremalPoints:function(){return this.compute(),this.extremalPts},computeCirclePoints:function(){if(this.input.isEmpty())return this.extremalPts=new Array(0).fill(null),null;if(1===this.input.getNumPoints()){var t=this.input.getCoordinates();return this.extremalPts=[new p(t[0])],null}var e=this.input.convexHull(),n=e.getCoordinates(),t=n;if(n[0].equals2D(n[n.length-1])&&(t=new Array(n.length-1).fill(null),U.copyDeep(n,0,t,0,n.length-1)),t.length<=2)return this.extremalPts=U.copyDeep(t),null;for(var i=Ni.lowestPoint(t),r=Ni.pointWitMinAngleWithX(t,i),o=0;o=i;)i=r,o=s,s=Ci.nextIndex(t,o),r=e.distancePerpendicular(t[s]);return ii&&(i=u),us&&(s=l),l=t.length&&(e=0),e},Ci.computeC=function(t,e,n){return t*n.y-e*n.x},Ci.getMinimumDiameter=function(t){return new Ci(t).getDiameter()},Ci.getMinimumRectangle=function(t){return new Ci(t).getMinimumRectangle()},Ci.computeSegmentForLine=function(t,e,n){var i=null,r=null;return Math.abs(e)>Math.abs(t)?(i=new p(0,n/e),r=new p(1,n/e-t/e)):(i=new p(n/t,0),r=new p(n/t-e/t,1)),new ce(i,r)};var cs=Object.freeze({Centroid:fe,CGAlgorithms:le,ConvexHull:ve,InteriorPointArea:oi,InteriorPointLine:ai,InteriorPointPoint:ui,RobustLineIntersector:se,MCPointInRing:Ei,MinimumBoundingCircle:Ni,MinimumDiameter:Ci});e(Si.prototype,{getResultGeometry:function(){return new Mi(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(t){if(t<=0)throw new i("Tolerance must be positive");this.distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return Si}}),Si.densifyPoints=function(t,e,n){for(var i=new ce,r=new b,o=0;o1)for(var u=s/a,l=1;ls?1:ot&&(t=n)}return t+1},isEmpty:function(){var t=!0;this.items.isEmpty()||(t=!1);for(var e=0;e<4;e++)null!==this.subnode[e]&&(this.subnode[e].isEmpty()||(t=!1));return t},add:function(t){this.items.add(t)},interfaces_:function(){return[u]},getClass:function(){return Ai}}),Ai.getSubnodeIndex=function(t,e,n){var i=-1;return t.getMinX()>=e&&(t.getMinY()>=n&&(i=3),t.getMaxY()<=n&&(i=1)),t.getMaxX()<=e&&(t.getMinY()>=n&&(i=2),t.getMaxY()<=n&&(i=0)),i},e(Di.prototype,{getLevel:function(){return this.level},computeKey:function(){if(1===arguments.length){var t=arguments[0];for(this.level=Di.computeQuadLevel(t),this.env=new I,this.computeKey(this.level,t);!this.env.contains(t);)this.level+=1,this.computeKey(this.level,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=fi.powerOf2(e);this.pt.x=Math.floor(n.getMinX()/i)*i,this.pt.y=Math.floor(n.getMinY()/i)*i,this.env.init(this.pt.x,this.pt.x+i,this.pt.y,this.pt.y+i)}},getEnvelope:function(){return this.env},getCentre:function(){return new p((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Di}}),Di.computeQuadLevel=function(t){var e=t.getWidth(),n=t.getHeight(),i=e>n?e:n;return fi.exponent(i)+1},c(Fi,Ai),e(Fi.prototype,{find:function(t){var e=Ai.getSubnodeIndex(t,this.centrex,this.centrey);if(-1===e)return this;if(null!==this.subnode[e]){return this.subnode[e].find(t)}return this},isSearchMatch:function(t){return this.env.intersects(t)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getEnvelope:function(){return this.env},getNode:function(t){var e=Ai.getSubnodeIndex(t,this.centrex,this.centrey);if(-1!==e){return this.getSubnode(e).getNode(t)}return this},createSubnode:function(t){var e=0,n=0,i=0,r=0;switch(t){case 0:e=this.env.getMinX(),n=this.centrex,i=this.env.getMinY(),r=this.centrey;break;case 1:e=this.centrex,n=this.env.getMaxX(),i=this.env.getMinY(),r=this.centrey;break;case 2:e=this.env.getMinX(),n=this.centrex,i=this.centrey,r=this.env.getMaxY();break;case 3:e=this.centrex,n=this.env.getMaxX(),i=this.centrey,r=this.env.getMaxY()}return new Fi(new I(e,n,i,r),this.level-1)},insertNode:function(t){f.isTrue(null===this.env||this.env.contains(t.env));var e=Ai.getSubnodeIndex(t.env,this.centrex,this.centrey);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insertNode(t),this.subnode[e]=n}},interfaces_:function(){return[]},getClass:function(){return Fi}}),Fi.createNode=function(t){var e=new Di(t);return new Fi(e.getEnvelope(),e.getLevel())},Fi.createExpanded=function(t,e){var n=new I(e);null!==t&&n.expandToInclude(t.env);var i=Fi.createNode(n);return null!==t&&i.insertNode(t),i},c(qi,Ai),e(qi.prototype,{insert:function(t,e){var n=Ai.getSubnodeIndex(t,qi.origin.x,qi.origin.y);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getEnvelope().contains(t)){var r=Fi.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){f.isTrue(t.getEnvelope().contains(e));var i=vi.isZeroWidth(e.getMinX(),e.getMaxX()),r=vi.isZeroWidth(e.getMinY(),e.getMaxY()),o=null;o=i||r?t.find(e):t.getNode(e),o.add(n)},interfaces_:function(){return[]},getClass:function(){return qi}}),qi.origin=new p(0,0),e(ki.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=ki.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){var t=arguments[0],e=new zn;return this.query(t,e),e.getItems()}if(2===arguments.length){var n=arguments[0],i=arguments[1];this.root.visit(n,i)}},queryAll:function(){var t=new w;return this.root.addAllItems(t),t},remove:function(t,e){var n=ki.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e0&&(this.minExtent=e);var n=t.getHeight();n0&&(this.minExtent=n)},depth:function(){return null!==this.root?this.root.depth():0},isEmpty:function(){return null===this.root},interfaces_:function(){return[De,u]},getClass:function(){return ki}}),ki.ensureExtent=function(t,e){var n=t.getMinX(),i=t.getMaxX(),r=t.getMinY(),o=t.getMaxY();return n!==i&&r!==o?t:(n===i&&(n-=e/2,i=n+e/2),r===o&&(r-=e/2,o=r+e/2),new I(n,i,r,o))},ki.serialVersionUID=-0x678b60c967a25400;var ds=Object.freeze({Quadtree:ki}),gs=Object.freeze({STRtree:Be}),vs=Object.freeze({quadtree:ds,strtree:gs}),ys=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];e(Gi.prototype,{read:function(t){var e=void 0;e="string"==typeof t?JSON.parse(t):t;var n=e.type;if(!ms[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ys.indexOf(n)?ms[n].apply(this,[e.coordinates]):"GeometryCollection"===n?ms[n].apply(this,[e.geometries]):ms[n].apply(this,[e])},write:function(t){var e=t.getGeometryType();if(!xs[e])throw new Error("Geometry is not supported");return xs[e].apply(this,[t])}});var ms={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!ms[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=ms.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n0&&this.minIndexthis.minCoord.y&&n.y>this.minCoord.y&&i===le.CLOCKWISE&&(r=!0),r&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length)return-1;if(i[e].y===i[e+1].y)return-1;var r=cn.LEFT;return i[e].ythis.minCoord.x)&&(this.minDe=t,this.minIndex=n,this.minCoord=e[n])},findRightmostEdgeAtNode:function(){var t=this.minDe.getNode(),e=t.getEdges();this.minDe=e.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},findEdge:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}f.isTrue(0!==this.minIndex||this.minCoord.equals(this.minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this.minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this.orientedDe=this.minDe,this.getRightmostSide(this.minDe,this.minIndex)===cn.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Ji}}),Zi.prototype.addLast=function(t){this.array_.push(t)},Zi.prototype.removeFirst=function(){return this.array_.shift()},Zi.prototype.isEmpty=function(){return 0===this.array_.length},e(Ki.prototype,{clearVisitedEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new rn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();i.setVisited(!0),this.copySymDepths(i)}},computeDepth:function(t){this.clearVisitedEdges();var e=this.finder.getEdge();e.getNode(),e.getLabel(),e.setEdgeDepths(cn.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},create:function(t){this.addReachable(t),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(cn.RIGHT)>=1&&e.getDepth(cn.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},computeDepths:function(t){var e=new Q,n=new Zi,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.getEdges().iterator();o.hasNext();){var s=o.next(),a=s.getSym();if(!a.isVisited()){var u=a.getNode();e.contains(u)||(n.addLast(u),e.add(u))}}}},compareTo:function(t){var e=t;return this.rightMostCoord.xe.rightMostCoord.x?1:0},getEnvelope:function(){if(null===this.env){for(var t=new I,e=this.dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),r=0;r=0;n--)this.addPt(t[n])},isRedundant:function(t){if(this.ptList.size()<1)return!1;var e=this.ptList.get(this.ptList.size()-1);return t.distance(e)=2&&this.ptList.get(this.ptList.size()-2),t.equals(e)?null:void this.ptList.add(t)},setMinimumVertexDistance:function(t){this.minimimVertexDistance=t},interfaces_:function(){return[]},getClass:function(){return $i}}),$i.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),e(tr.prototype,{addNextSegment:function(t,e){if(this.s0=this.s1,this.s1=this.s2,this.s2=t,this.seg0.setCoordinates(this.s0,this.s1),this.computeOffsetSegment(this.seg0,this.side,this.distance,this.offset0),this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1),this.s1.equals(this.s2))return null;var n=le.computeOrientation(this.s0,this.s1,this.s2),i=n===le.CLOCKWISE&&this.side===cn.LEFT||n===le.COUNTERCLOCKWISE&&this.side===cn.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},addLineEndCap:function(t,e){var n=new ce(t,e),i=new ce;this.computeOffsetSegment(n,cn.LEFT,this.distance,i);var r=new ce;this.computeOffsetSegment(n,cn.RIGHT,this.distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this.bufParams.getEndCapStyle()){case Hi.CAP_ROUND:this.segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,le.CLOCKWISE,this.distance),this.segList.addPt(r.p1);break;case Hi.CAP_FLAT:this.segList.addPt(i.p1),this.segList.addPt(r.p1);break;case Hi.CAP_SQUARE:var u=new p ;u.x=Math.abs(this.distance)*Math.cos(a),u.y=Math.abs(this.distance)*Math.sin(a);var l=new p(i.p1.x+u.x,i.p1.y+u.y),c=new p(r.p1.x+u.x,r.p1.y+u.y);this.segList.addPt(l),this.segList.addPt(c)}},getCoordinates:function(){return this.segList.getCoordinates()},addMitreJoin:function(t,e,n,i){var r=!0,o=null;try{o=F.intersection(e.p0,e.p1,n.p0,n.p1);(i<=0?1:o.distance(t)/Math.abs(i))>this.bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof C))throw t;o=new p(0,0),r=!1}r?this.segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this.bufParams.getMitreLimit())},addFilletCorner:function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);i===le.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this.segList.addPt(e),this.addFilletArc(t,a,c,i,r),this.segList.addPt(n)},addOutsideTurn:function(t,e){return this.offset0.p1.distance(this.offset1.p0)0){var n=new p((this.closingSegLengthFactor*this.offset0.p1.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset0.p1.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(n);var i=new p((this.closingSegLengthFactor*this.offset1.p0.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset1.p0.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(i)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},createCircle:function(t){var e=new p(t.x+this.distance,t.y);this.segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},addBevelJoin:function(t,e){this.segList.addPt(t.p1),this.segList.addPt(e.p0)},init:function(t){this.distance=t,this.maxCurveSegmentError=t*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new $i,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(t*tr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(t){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2),this.li.getIntersectionNum()>=2&&(this.bufParams.getJoinStyle()===Hi.JOIN_BEVEL||this.bufParams.getJoinStyle()===Hi.JOIN_MITRE?(t&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,le.CLOCKWISE,this.distance))},closeRing:function(){this.segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return tr}}),tr.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,tr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,tr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,tr.MAX_CLOSING_SEG_LEN_FACTOR=80,e(er.prototype,{getOffsetCurve:function(t,e){if(this.distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&U.reverse(o),o},computeSingleSidedBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){n.addSegments(t,!0);var r=Qi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],cn.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{n.addSegments(t,!1);var a=Qi.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],cn.LEFT),n.addFirstSegment();for(var s=2;s<=u;s++)n.addNextSegment(a[s],!0)}n.addLastSegment(),n.closeRing()},computeRingBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);e===cn.RIGHT&&(i=-i);var r=Qi.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},computeLineBufferCurve:function(t,e){var n=this.simplifyTolerance(this.distance),i=Qi.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],cn.LEFT);for(var o=2;o<=r;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var s=Qi.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],cn.LEFT);for(var o=a-2;o>=0;o--)e.addNextSegment(s[o],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},computePointCurve:function(t,e){switch(this.bufParams.getEndCapStyle()){case Hi.CAP_ROUND:e.createCircle(t);break;case Hi.CAP_SQUARE:e.createSquare(t)}},getLineCurve:function(t,e){if(this.distance=e,e<0&&!this.bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this.bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);return i.getCoordinates()},getBufferParameters:function(){return this.bufParams},simplifyTolerance:function(t){return t*this.bufParams.getSimplifyFactor()},getRingCurve:function(t,e,n){if(this.distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return er.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},computeOffsetCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){var r=Qi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],cn.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{var a=Qi.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],cn.LEFT),n.addFirstSegment();for(var s=2;s<=u;s++)n.addNextSegment(a[s],!0)}n.addLastSegment()},getSegGen:function(t){return new tr(this.precisionModel,this.bufParams,t)},interfaces_:function(){return[]},getClass:function(){return er}}),er.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;nr.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if(M(arguments[2],m)&&arguments[0]instanceof p&&arguments[1]instanceof En)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),n=0;nthis.seg.p1.y&&this.seg.reverse();var l=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(lthis.seg.p1.y||le.computeOrientation(this.seg.p0,this.seg.p1,o)===le.RIGHT)){var c=s.getDepth(cn.LEFT);this.seg.p0.equals(u[n])||(c=s.getDepth(cn.RIGHT));var h=new ir(this.seg,c);a.add(h)}}else if(M(arguments[2],m)&&arguments[0]instanceof p&&M(arguments[1],m))for(var f=arguments[0],d=arguments[1],g=arguments[2],n=d.iterator();n.hasNext();){var v=n.next();v.isForward()&&this.findStabbedSegments(f,v,g)}},getDepth:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:ls.min(e).leftDepth},interfaces_:function(){return[]},getClass:function(){return nr}}),e(ir.prototype,{compareTo:function(t){var e=t;if(this.upwardSeg.minX()>=e.upwardSeg.maxX())return 1;if(this.upwardSeg.maxX()<=e.upwardSeg.minX())return-1;var n=this.upwardSeg.orientationIndex(e.upwardSeg);return 0!==n?n:(n=-1*e.upwardSeg.orientationIndex(this.upwardSeg),0!==n?n:this.upwardSeg.compareTo(e.upwardSeg))},compareX:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[o]},getClass:function(){return ir}}),nr.DepthSegment=ir,e(rr.prototype,{addPoint:function(t){if(this.distance<=0)return null;var e=t.getCoordinates(),n=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},addPolygon:function(t){var e=this.distance,n=cn.LEFT;this.distance<0&&(e=-this.distance,n=cn.RIGHT);var i=t.getExteriorRing(),r=U.removeRepeatedPoints(i.getCoordinates());if(this.distance<0&&this.isErodedCompletely(i,this.distance))return null;if(this.distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,S.EXTERIOR,S.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this.distance)||this.addPolygonRing(a,e,cn.opposite(n),S.INTERIOR,S.EXTERIOR)}},isTriangleErodedCompletely:function(t,e){var n=new Ii(t[0],t[1],t[2]),i=n.inCentre();return le.distancePointLine(i,n.p0,n.p1)=Pt.MINIMUM_VALID_SIZE&&le.isCCW(t)&&(o=r,s=i,n=cn.opposite(n));var a=this.curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},add:function(t){if(t.isEmpty())return null;if(t instanceof Lt)this.addPolygon(t);else if(t instanceof Nt)this.addLineString(t);else if(t instanceof St)this.addPoint(t);else if(t instanceof Rt)this.addCollection(t);else if(t instanceof pt)this.addCollection(t);else if(t instanceof Tt)this.addCollection(t);else{if(!(t instanceof ft))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},isErodedCompletely:function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},addCollection:function(t){for(var e=0;ei||this.maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return f.isTrue(!(s&&a),"Found bad envelope test"),a},initCorners:function(t){this.minx=t.x-.5,this.maxx=t.x+.5,this.miny=t.y-.5,this.maxy=t.y+.5,this.corner[0]=new p(this.maxx,this.maxy),this.corner[1]=new p(this.minx,this.maxy),this.corner[2]=new p(this.minx,this.miny),this.corner[3]=new p(this.maxx,this.miny)},intersects:function(t,e){return 1===this.scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this.p0Scaled),this.copyScaled(e,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},scale:function(t){return Math.round(t*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var t=ur.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new I(this.originalPt.x-t,this.originalPt.x+t,this.originalPt.y-t,this.originalPt.y+t)}return this.safeEnv},intersectsPixelClosure:function(t,e){return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),!!(this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.hasIntersection()))))},intersectsToleranceSquare:function(t,e){var n=!1,i=!1;return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),!!(this.li.isProper()||(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.isProper()||(this.li.hasIntersection()&&(n=!0),this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.isProper()||(this.li.hasIntersection()&&(i=!0),this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.isProper()||n&&i||t.equals(this.pt)||e.equals(this.pt)))))},addSnappedNode:function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},interfaces_:function(){return[]},getClass:function(){return ur}}),ur.SAFE_ENV_EXPANSION_FACTOR=.75,e(lr.prototype,{snap:function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2],r=e.getSafeEnvelope(),o=new cr(e,n,i);return this.index.query(r,{interfaces_:function(){return[Ae]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return lr}}),c(cr,li),e(cr.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return li.prototype.select.apply(this,arguments);var t=arguments[0],e=arguments[1],n=t.getContext();return null!==this.parentEdge&&n===this.parentEdge&&e===this.hotPixelVertexIndex?null:void(this._isNodeAdded=this.hotPixel.addSnappedNode(n,e))},interfaces_:function(){return[]},getClass:function(){return cr}}),lr.HotPixelSnapAction=cr,e(hr.prototype,{processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var u=0;u=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof rn))throw t;this.saveException=t}if(null!==this.resultGeometry)return null}throw this.saveException}if(1===arguments.length){var e=arguments[0],n=pr.precisionScaleFactor(this.argGeom,this.distance,e),i=new te(n);this.bufferFixedPrecision(i)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this.resultGeometry)return null;var t=this.argGeom.getFactory().getPrecisionModel();t.getType()===te.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},setQuadrantSegments:function(t){this.bufParams.setQuadrantSegments(t)},bufferOriginalPrecision:function(){try{var t=new sr(this.bufParams);this.resultGeometry=t.buffer(this.argGeom,this.distance)}catch(t){if(!(t instanceof l))throw t;this.saveException=t}},getResultGeometry:function(t){return this.distance=t,this.computeGeometry(),this.resultGeometry},setEndCapStyle:function(t){this.bufParams.setEndCapStyle(t)},interfaces_:function(){return[]},getClass:function(){return pr}}),pr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new pr(t),i=n.getResultGeometry(e);return i}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&"number"==typeof arguments[1]){var r=arguments[0],o=arguments[1],s=arguments[2],a=new pr(r);a.setQuadrantSegments(s);var i=a.getResultGeometry(o);return i}if(arguments[2]instanceof Hi&&arguments[0]instanceof G&&"number"==typeof arguments[1]){var u=arguments[0],l=arguments[1],c=arguments[2],a=new pr(u,c),i=a.getResultGeometry(l);return i}}else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3],a=new pr(h);a.setQuadrantSegments(p),a.setEndCapStyle(d);var i=a.getResultGeometry(f);return i}},pr.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=L.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,s=r+2*o,a=Math.trunc(Math.log(s)/Math.log(10)+1),u=n-a;return Math.pow(10,u)},pr.CAP_ROUND=Hi.CAP_ROUND,pr.CAP_BUTT=Hi.CAP_FLAT,pr.CAP_FLAT=Hi.CAP_FLAT,pr.CAP_SQUARE=Hi.CAP_SQUARE,pr.MAX_PRECISION_DIGITS=12;var bs=Object.freeze({BufferOp:pr,BufferParameters:Hi});e(dr.prototype,{filter:function(t){t instanceof Lt&&this.comps.add(t)},interfaces_:function(){return[ct]},getClass:function(){return dr}}),dr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return dr.getPolygons(t,new w)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Lt?n.add(e):e instanceof ft&&e.apply(new dr(n)),n}},e(gr.prototype,{isInsideArea:function(){return this.segIndex===gr.INSIDE_AREA},getCoordinate:function(){return this.pt},getGeometryComponent:function(){return this.component},getSegmentIndex:function(){return this.segIndex},interfaces_:function(){return[]},getClass:function(){return gr}}),gr.INSIDE_AREA=-1,e(vr.prototype,{filter:function(t){t instanceof St&&this.pts.add(t)},interfaces_:function(){return[ct]},getClass:function(){return vr}}),vr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof St?ls.singletonList(t):vr.getPoints(t,new w)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof St?n.add(e):e instanceof ft&&e.apply(new vr(n)),n}},e(yr.prototype,{filter:function(t){(t instanceof St||t instanceof Nt||t instanceof Lt)&&this.locations.add(new gr(t,0,t.getCoordinate()))},interfaces_:function(){return[ct]},getClass:function(){return yr}}),yr.getLocations=function(t){var e=new w;return t.apply(new yr(e)),e},e(mr.prototype,{computeContainmentDistance:function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this.minDistance<=this.terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=dr.getPolygons(this.geom[e]);if(r.size()>0){var o=yr.getLocations(this.geom[i]);if(this.computeContainmentDistance(o,r,n),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[i]=n[0],this.minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&M(arguments[0],m)&&M(arguments[1],m)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;lthis.minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;othis.minDistance)return null;for(var i=l.getCoordinates(),f=c.getCoordinates(),o=0;ot&&U.reverse(this.coordinates)}return this.coordinates},toLineString:function(){return this.factory.createLineString(this.getCoordinates())},add:function(t){this.directedEdges.add(t)},interfaces_:function(){return[]},getClass:function(){return xr}}),e(Er.prototype,{setVisited:function(t){this._isVisited=t},isMarked:function(){return this._isMarked},setData:function(t){this.data=t},getData:function(){return this.data},setMarked:function(t){this._isMarked=t},getContext:function(){return this.data},isVisited:function(){return this._isVisited},setContext:function(t){this.data=t},interfaces_:function(){return[]},getClass:function(){return Er}}),Er.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},Er.setVisited=function(t,e){for(;t.hasNext();){t.next().setVisited(e)}},Er.setMarked=function(t,e){for(;t.hasNext();){t.next().setMarked(e)}},c(wr,Er),e(wr.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(t){return this.quadrant>t.quadrant?1:this.quadrant=t.getNumPoints()&&null===i)return null;var o=t.getCoordinate(r);null!==i&&i.segmentIndex===n.segmentIndex&&(o=i.coord);var s=new xn(t,n.coord,o,new fn(t.getLabel()));e.add(s)},createEdgeEndForPrev:function(t,e,n,i){var r=n.segmentIndex;if(0===n.dist){if(0===r)return null;r--}var o=t.getCoordinate(r);null!==i&&i.segmentIndex>=r&&(o=i.coord);var s=new fn(t.getLabel());s.flip();var a=new xn(t,n.coord,o,s);e.add(a)},computeEdgeEnds:function(){if(1===arguments.length){for(var t=arguments[0],e=new w,n=t;n.hasNext();){var i=n.next();this.computeEdgeEnds(i,e)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1],s=r.getEdgeIntersectionList();s.addEndpoints();var a=s.iterator(),u=null,l=null;if(!a.hasNext())return null;var c=a.next();do{u=l,l=c,c=null,a.hasNext()&&(c=a.next()),null!==l&&(this.createEdgeEndForPrev(r,o,l,u),this.createEdgeEndForNext(r,o,l,c))}while(null!==l)}},interfaces_:function(){return[]},getClass:function(){return Ar}}),c(Dr,xn),e(Dr.prototype,{insert:function(t){this.edgeEnds.add(t)},print:function(t){t.println("EdgeEndBundle--\x3e Label: "+this.label);for(var e=this.iterator();e.hasNext();){e.next().print(t),t.println()}},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(t,e){for(var n=0,i=!1,r=this.iterator();r.hasNext();){var o=r.next(),s=o.getLabel().getLocation(t);s===S.BOUNDARY&&n++,s===S.INTERIOR&&(i=!0)}var s=S.NONE;i&&(s=S.INTERIOR),n>0&&(s=Qn.determineBoundary(e,n)),this.label.setLocation(t,s)},computeLabelSide:function(t,e){for(var n=this.iterator();n.hasNext();){var i=n.next();if(i.getLabel().isArea()){var r=i.getLabel().getLocation(t,e);if(r===S.INTERIOR)return this.label.setLocation(t,e,S.INTERIOR),null;r===S.EXTERIOR&&this.label.setLocation(t,e,S.EXTERIOR)}}},getLabel:function(){return this.label},computeLabelSides:function(t){this.computeLabelSide(t,cn.LEFT),this.computeLabelSide(t,cn.RIGHT)},updateIM:function(t){Kn.updateIM(this.label,t)},computeLabel:function(t){for(var e=!1,n=this.iterator();n.hasNext();){n.next().getLabel().isArea()&&(e=!0)}this.label=e?new fn(S.NONE,S.NONE,S.NONE):new fn(S.NONE);for(var i=0;i<2;i++)this.computeLabelOn(i,t),e&&this.computeLabelSides(i)},interfaces_:function(){return[]},getClass:function(){return Dr}}),c(Fr,Ln),e(Fr.prototype,{updateIM:function(t){for(var e=this.iterator();e.hasNext();){e.next().updateIM(t)}},insert:function(t){var e=this.edgeMap.get(t);null===e?(e=new Dr(t),this.insertEdgeEnd(t,e)):e.insert(t)},interfaces_:function(){return[]},getClass:function(){return Fr}}),c(qr,yn),e(qr.prototype,{updateIMFromEdges:function(t){this.edges.updateIM(t)},computeIM:function(t){t.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return qr}}),c(kr,wn),e(kr.prototype,{createNode:function(t){return new qr(t,new Fr)},interfaces_:function(){return[]},getClass:function(){return kr}}),e(Gr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},getNodeIterator:function(){return this.nodes.iterator()},copyNodesAndLabels:function(t,e){for(var n=t.getNodeIterator();n.hasNext();){var i=n.next();this.nodes.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},build:function(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);var e=new Ar,n=e.computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(n)},computeIntersectionNodes:function(t,e){for(var n=t.getEdgeIterator();n.hasNext();)for(var i=n.next(),r=i.getLabel().getLocation(e),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var s=o.next(),a=this.nodes.addNode(s.coord);r===S.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,S.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Gr}}),e(jr.prototype,{isNodeEdgeAreaLabelsConsistent:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();){var e=t.next();if(!e.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=e.getCoordinate().copy(),!1}return!0},getInvalidPoint:function(){return this.invalidPoint},hasDuplicateRings:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();)for(var e=t.next(),n=e.getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdgeEnds().size()>1)return this.invalidPoint=i.getEdge().getCoordinate(0),!0}return!1},isNodeConsistentArea:function(){var t=this.geomGraph.computeSelfNodes(this.li,!0,!0);return t.hasProperIntersection()?(this.invalidPoint=t.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return jr}}),e(Br.prototype,{buildIndex:function(){this.index=new Be;for(var t=0;t=1&&(e=t.getCoordinateN(0)),this.validErr=new zr(zr.RING_NOT_CLOSED,e)}},checkShellsNotNested:function(t,e){for(var n=0;n=0;i--)n.add(t[i],!1)},Xr.findEdgeRingContaining=function(t,e){for(var n=t.getRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getRing(),c=l.getEnvelopeInternal();if(!c.equals(i)&&c.contains(i)){r=U.ptNotInList(n.getCoordinates(),l.getCoordinates());var h=!1;le.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u,s=o.getRing().getEnvelopeInternal())}}return o},e(Yr.prototype,{compare:function(t,e){var n=t,i=e;return n.getRing().getEnvelope().compareTo(i.getRing().getEnvelope())},interfaces_:function(){return[a]},getClass:function(){return Yr}}),Xr.EnvelopeComparator=Yr,c(Ur,Lr),e(Ur.prototype,{findEdgeRing:function(t){var e=new Xr(this.factory);return e.build(t),e},computeDepthParity:function(){if(0===arguments.length)for(;;){return null}else 1===arguments.length&&arguments[0]},computeNextCWEdges:function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();Ur.computeNextCWEdges(e)}},addEdge:function(t){if(t.isEmpty())return null;var e=U.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new Tr(r,o,e[1],!0),a=new Tr(o,r,e[e.length-2],!1),u=new Or(t);u.setDirectedEdges(s,a),this.add(u)},deleteCutEdges:function(){this.computeNextCWEdges(),Ur.findLabeledEdgeRings(this.dirEdges);for(var t=new w,e=this.dirEdges.iterator();e.hasNext();){var n=e.next();if(!n.isMarked()){var i=n.getSym();if(n.getLabel()===i.getLabel()){n.setMarked(!0),i.setMarked(!0);var r=n.getEdge();t.add(r.getLine())}}}return t},getEdgeRings:function(){this.computeNextCWEdges(),Ur.label(this.dirEdges,-1);var t=Ur.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(t);for(var e=new w,n=this.dirEdges.iterator();n.hasNext();){var i=n.next();if(!i.isMarked()&&!i.isInRing()){var r=this.findEdgeRing(i);e.add(r)}}return e},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new Cr(t),this.add(e)),e},convertMaximalToMinimalEdgeRings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel(),r=Ur.findIntersectionNodes(n,i);if(null!==r)for(var o=r.iterator();o.hasNext();){var s=o.next();Ur.computeNextCCWEdges(s,i)}}},deleteDangles:function(){for(var t=this.findNodesOfDegree(1),e=new Q,n=new de,i=t.iterator();i.hasNext();)n.push(i.next());for(;!n.isEmpty();){var r=n.pop();Ur.deleteAllEdges(r);for(var o=r.getOutEdges().getEdges(),i=o.iterator();i.hasNext();){var s=i.next();s.setMarked(!0);var a=s.getSym();null!==a&&a.setMarked(!0);var u=s.getEdge();e.add(u.getLine());var l=s.getToNode();1===Ur.getDegreeNonDeleted(l)&&n.push(l)}}return e},interfaces_:function(){return[]},getClass:function(){return Ur}}),Ur.findLabeledEdgeRings=function(t){for(var e=new w,n=1,i=t.iterator();i.hasNext();){var r=i.next();if(!(r.isMarked()||r.getLabel()>=0)){e.add(r);var o=Xr.findDirEdgesInRing(r);Ur.label(o,n),n++}}return e},Ur.getDegreeNonDeleted=function(t){for(var e=t.getOutEdges().getEdges(),n=0,i=e.iterator();i.hasNext();){i.next().isMarked()||n++}return n},Ur.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges(),n=e.iterator();n.hasNext();){var i=n.next();i.setMarked(!0);var r=i.getSym();null!==r&&r.setMarked(!0)}},Ur.label=function(t,e){ for(var n=t.iterator();n.hasNext();){n.next().setLabel(e)}},Ur.computeNextCWEdges=function(t){for(var e=t.getOutEdges(),n=null,i=null,r=e.getEdges().iterator();r.hasNext();){var o=r.next();if(!o.isMarked()){if(null===n&&(n=o),null!==i){var s=i.getSym();s.setNext(o)}i=o}}if(null!==i){var s=i.getSym();s.setNext(n)}},Ur.computeNextCCWEdges=function(t,e){for(var n=t.getOutEdges(),i=null,r=null,o=n.getEdges(),s=o.size()-1;s>=0;s--){var a=o.get(s),u=a.getSym(),l=null;a.getLabel()===e&&(l=a);var c=null;u.getLabel()===e&&(c=u),null===l&&null===c||(null!==c&&(r=c),null!==l&&(null!==r&&(r.setNext(l),r=null),null===i&&(i=l)))}null!==r&&(f.isTrue(null!==i),r.setNext(i))},Ur.getDegree=function(t,e){for(var n=t.getOutEdges().getEdges(),i=0,r=n.iterator();r.hasNext();){r.next().getLabel()===e&&i++}return i},Ur.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();Ur.getDegree(r,e)>1&&(null===i&&(i=new w),i.add(r)),n=n.getNext(),f.isTrue(null!==n,"found null DE in ring"),f.isTrue(n===t||!n.isInRing(),"found DE already in ring")}while(n!==t);return i},e(Wr.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new ne),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection(ne.toGeometryArray(this.polyList))},getInvalidRingLines:function(){return this.polygonize(),this.invalidRingLines},findValidRings:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isValid()?e.add(r):n.add(r.getLineString())}},polygonize:function(){if(null!==this.polyList)return null;if(this.polyList=new w,null===this.graph)return null;this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var t=this.graph.getEdgeRings(),e=new w;this.invalidRingLines=new w,this.isCheckingRingsValid?this.findValidRings(t,e,this.invalidRingLines):e=t,this.findShellsAndHoles(e),Wr.assignHolesToShells(this.holeList,this.shellList),ls.sort(this.shellList,new Xr.EnvelopeComparator);var n=!0;this.extractOnlyPolygonal&&(Wr.findDisjointShells(this.shellList),n=!1),this.polyList=Wr.extractPolygons(this.shellList,n)},getDangles:function(){return this.polygonize(),this.dangles},getCutEdges:function(){return this.polygonize(),this.cutEdges},getPolygons:function(){return this.polygonize(),this.polyList},add:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}else if(arguments[0]instanceof Nt){var i=arguments[0];this.geomFactory=i.getFactory(),null===this.graph&&(this.graph=new Ur(this.geomFactory)),this.graph.addEdge(i)}else if(arguments[0]instanceof G){var r=arguments[0];r.apply(this.lineStringAdder)}},setCheckRingsValid:function(t){this.isCheckingRingsValid=t},findShellsAndHoles:function(t){this.holeList=new w,this.shellList=new w;for(var e=t.iterator();e.hasNext();){var n=e.next();n.computeHole(),n.isHole()?this.holeList.add(n):this.shellList.add(n)}},interfaces_:function(){return[]},getClass:function(){return Wr}}),Wr.findOuterShells=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getOuterHole();null===i||i.isProcessed()||(n.setIncluded(!0),i.setProcessed(!0))}},Wr.extractPolygons=function(t,e){for(var n=new w,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Wr.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Wr.assignHoleToShell(i,e)}},Wr.assignHoleToShell=function(t,e){var n=Xr.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Wr.findDisjointShells=function(t){Wr.findOuterShells(t);var e=null;do{e=!1;for(var n=t.iterator();n.hasNext();){var i=n.next();i.isIncludedSet()||(i.updateIncluded(),i.isIncludedSet()||(e=!0))}}while(e)},e(Hr.prototype,{filter:function(t){t instanceof Nt&&this.p.add(t)},interfaces_:function(){return[k]},getClass:function(){return Hr}}),Wr.LineStringAdder=Hr;var Ss=Object.freeze({Polygonizer:Wr});e(Jr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},computeProperIntersectionIM:function(t,e){var n=this.arg[0].getGeometry().getDimension(),i=this.arg[1].getGeometry().getDimension(),r=t.hasProperIntersection(),o=t.hasProperInteriorIntersection();2===n&&2===i?r&&e.setAtLeast("212101212"):2===n&&1===i?(r&&e.setAtLeast("FFF0FFFF2"),o&&e.setAtLeast("1FFFFF1FF")):1===n&&2===i?(r&&e.setAtLeast("F0FFFFFF2"),o&&e.setAtLeast("1F1FFFFFF")):1===n&&1===i&&o&&e.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(t,e){for(var n=this.arg[t].getEdgeIterator();n.hasNext();){var i=n.next();i.isIsolated()&&(this.labelIsolatedEdge(i,e,this.arg[e].getGeometry()),this.isolatedEdges.add(i))}},labelIsolatedEdge:function(t,e,n){if(n.getDimension()>0){var i=this.ptLocator.locate(t.getCoordinate(),n);t.getLabel().setAllLocations(e,i)}else t.getLabel().setAllLocations(e,S.EXTERIOR)},computeIM:function(){var t=new he;if(t.set(S.EXTERIOR,S.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(t),t;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var e=this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(e,t);var n=new Ar,i=n.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(i);var r=n.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(r),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(t),t},labelNodeEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){t.next().getEdges().computeLabelling(this.arg)}},copyNodesAndLabels:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next();this.nodes.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},labelIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this.nodes.find(o.coord);s.getLabel().isNull(t)&&(i===S.BOUNDARY?s.setLabelBoundary(t):s.setLabel(t,S.INTERIOR))}},labelIsolatedNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setAllLocations(e,n)},computeIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this.nodes.addNode(o.coord);i===S.BOUNDARY?s.setLabelBoundary(t):s.getLabel().isNull(t)&&s.setLabel(t,S.INTERIOR)}},labelIsolatedNodes:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next(),n=e.getLabel();f.isTrue(n.getGeometryCount()>0,"node with empty label found"),e.isIsolated()&&(n.isNull(0)?this.labelIsolatedNode(e,0):this.labelIsolatedNode(e,1))}},updateIM:function(t){for(var e=this.isolatedEdges.iterator();e.hasNext();){e.next().updateIM(t)}for(var n=this.nodes.iterator();n.hasNext();){var i=n.next();i.updateIM(t),i.updateIMFromEdges(t)}},computeDisjointIM:function(t){var e=this.arg[0].getGeometry();e.isEmpty()||(t.set(S.INTERIOR,S.EXTERIOR,e.getDimension()),t.set(S.BOUNDARY,S.EXTERIOR,e.getBoundaryDimension()));var n=this.arg[1].getGeometry();n.isEmpty()||(t.set(S.EXTERIOR,S.INTERIOR,n.getDimension()),t.set(S.EXTERIOR,S.BOUNDARY,n.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return Jr}}),e(Zr.prototype,{isContainedInBoundary:function(t){if(t instanceof Lt)return!1;if(t instanceof St)return this.isPointContainedInBoundary(t);if(t instanceof Nt)return this.isLineStringContainedInBoundary(t);for(var e=0;e0){var i=t;t=e,e=i}var r=!1;return e.y>t.y&&(r=!0),r?this.li.computeIntersection(t,e,this.diagDown0,this.diagDown1):this.li.computeIntersection(t,e,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return Kr}}),e(Qr.prototype,{applyTo:function(t){for(var e=0;e=this.rectEnv.getMinX()&&e.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):e.getMinY()>=this.rectEnv.getMinY()&&e.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return to}}),c(eo,Qr),e(eo.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(t){if(!(t instanceof Lt))return null;var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;for(var n=new p,i=0;i<4;i++)if(this.rectSeq.getCoordinate(i,n),e.contains(n)&&Mn.containsPointInPolygon(n,t))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return eo}}),c(no,Qr),e(no.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return!0===this.hasIntersection},visit:function(t){var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;var n=Bn.getLines(t);this.checkIntersectionWithLineStrings(n)},checkIntersectionWithLineStrings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();if(this.checkIntersectionWithSegments(n),this.hasIntersection)return null}},checkIntersectionWithSegments:function(t){for(var e=t.getCoordinateSequence(),n=1;n=t.size()?null:t.get(e)},ao.union=function(t){return new ao(t).union()},ao.STRTREE_NODE_CAPACITY=4,e(uo.prototype,{unionNoOpt:function(t){var e=this.geomFact.createPoint();return ri.overlayOp(t,e,ni.UNION)},unionWithNull:function(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)},extract:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.extract(n)}else if(arguments[0]instanceof G){var i=arguments[0];null===this.geomFact&&(this.geomFact=i.getFactory()),so.extract(i,G.SORTINDEX_POLYGON,this.polygons),so.extract(i,G.SORTINDEX_LINESTRING,this.lines),so.extract(i,G.SORTINDEX_POINT,this.points)}},union:function(){if(null===this.geomFact)return null;var t=null;if(this.points.size()>0){var e=this.geomFact.buildGeometry(this.points);t=this.unionNoOpt(e)}var n=null;if(this.lines.size()>0){var i=this.geomFact.buildGeometry(this.lines);n=this.unionNoOpt(i)}var r=null;this.polygons.size()>0&&(r=ao.union(this.polygons));var o=this.unionWithNull(n,r),s=null;return s=null===t?o:null===o?t:oo.union(t,o),null===s?this.geomFact.createGeometryCollection():s},interfaces_:function(){return[]},getClass:function(){return uo}}),uo.union=function(){if(1===arguments.length){if(M(arguments[0],v)){var t=arguments[0],e=new uo(t);return e.union()}if(arguments[0]instanceof G){var n=arguments[0],e=new uo(n);return e.union()}}else if(2===arguments.length){var i=arguments[0],r=arguments[1],e=new uo(i,r);return e.union()}};var Ls=Object.freeze({UnaryUnionOp:uo}),Rs=Object.freeze({IsValidOp:Vr,ConsistentAreaTester:jr}),Ps=Object.freeze({BoundaryOp:dt,IsSimpleOp:Ui,buffer:bs,distance:Is,linemerge:Ns,overlay:Cs,polygonize:Ss,relate:Ms,union:Ls,valid:Rs});c(lo,Ot.CoordinateOperation),e(lo.prototype,{editCoordinates:function(t,e){if(0===t.length)return null;for(var n=new Array(t.length).fill(null),i=0;i=2&&(n=!0),e.edit(t,new lo(this.targetPM,n))},changePM:function(t,e){return this.createEditor(t.getFactory(),e).edit(t,new Ot.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(t){this.removeCollapsed=t},createFactory:function(t,e){return new ne(e,t.getSRID(),t.getCoordinateSequenceFactory())},setChangePrecisionModel:function(t){this.changePrecisionModel=t},reduce:function(t){var e=this.reducePointwise(t);return this.isPointwise?e:M(e,Mt)?e.isValid()?e:this.fixPolygonalTopology(e):e},setPointwise:function(t){this.isPointwise=t},createEditor:function(t,e){return t.getPrecisionModel()===e?new Ot:new Ot(this.createFactory(t,e))},interfaces_:function(){return[]},getClass:function(){return co}}),co.reduce=function(t,e){return new co(e).reduce(t)},co.reducePointwise=function(t,e){var n=new co(e);return n.setPointwise(!0),n.reduce(t)};var Ts=Object.freeze({GeometryPrecisionReducer:co});e(ho.prototype,{simplifySection:function(t,e){if(t+1===e)return null;this.seg.p0=this.pts[t],this.seg.p1=this.pts[e];for(var n=-1,i=t,r=t+1;rn&&(n=o,i=r)}if(n<=this.distanceTolerance)for(var r=t+1;rthis.distanceTolerance&&(o=!1);var u=new ce;if(u.p0=this.linePts[t],u.p1=this.linePts[e],i[0]=t,i[1]=e,this.hasBadIntersection(this.line,i,u)&&(o=!1),o){var r=this.flatten(t,e);return this.line.addToResult(r),null}this.simplifySection(t,a,n),this.simplifySection(a,e,n)},hasBadOutputIntersection:function(t){for(var e=this.outputIndex.query(t),n=e.iterator();n.hasNext();){var i=n.next();if(this.hasInteriorIntersection(i,t))return!0}return!1},findFurthestPoint:function(t,e,n,i){var r=new ce;r.p0=t[e],r.p1=t[n];for(var o=-1,s=e,a=e+1;ao&&(o=l,s=a)}return i[0]=o,s},simplify:function(t){this.line=t,this.linePts=t.getParentCoordinates(),this.simplifySection(0,this.linePts.length-1,0)},remove:function(t,e,n){for(var i=e;i=e[0]&&ir&&(u=r),o.setMinimumLength(u),o.splitAt(s),o.getSplitPoint()},interfaces_:function(){return[Co]},getClass:function(){return So}}),So.projectedSplitPoint=function(t,e){return t.getLineSegment().project(e)},e(Mo.prototype,{interfaces_:function(){return[]},getClass:function(){return Mo}}),Mo.triArea=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)},Mo.isInCircleDDNormalized=function(t,e,n,i){var r=O.valueOf(t.x).selfSubtract(i.x),o=O.valueOf(t.y).selfSubtract(i.y),s=O.valueOf(e.x).selfSubtract(i.x),a=O.valueOf(e.y).selfSubtract(i.y),u=O.valueOf(n.x).selfSubtract(i.x),l=O.valueOf(n.y).selfSubtract(i.y),c=r.multiply(a).selfSubtract(s.multiply(o)),h=s.multiply(l).selfSubtract(u.multiply(a)),f=u.multiply(o).selfSubtract(r.multiply(l)),p=r.multiply(r).selfAdd(o.multiply(o)),d=s.multiply(s).selfAdd(a.multiply(a)),g=u.multiply(u).selfAdd(l.multiply(l)) ;return p.selfMultiply(h).selfAdd(d.selfMultiply(f)).selfAdd(g.selfMultiply(c)).doubleValue()>0},Mo.checkRobustInCircle=function(t,e,n,i){var r=Mo.isInCircleNonRobust(t,e,n,i),o=Mo.isInCircleDDSlow(t,e,n,i),s=Mo.isInCircleCC(t,e,n,i),a=Ii.circumcentre(t,e,n);D.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===o&&r===s||(D.out.println("inCircle robustness failure (double result = "+r+", DD result = "+o+", CC result = "+s+")"),D.out.println(re.toLineString(new qt([t,e,n,i]))),D.out.println("Circumcentre = "+re.toPoint(a)+" radius = "+t.distance(a)),D.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)),D.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),D.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),D.out.println())},Mo.isInCircleDDFast=function(t,e,n,i){var r=O.sqr(t.x).selfAdd(O.sqr(t.y)).selfMultiply(Mo.triAreaDDFast(e,n,i)),o=O.sqr(e.x).selfAdd(O.sqr(e.y)).selfMultiply(Mo.triAreaDDFast(t,n,i)),s=O.sqr(n.x).selfAdd(O.sqr(n.y)).selfMultiply(Mo.triAreaDDFast(t,e,i)),a=O.sqr(i.x).selfAdd(O.sqr(i.y)).selfMultiply(Mo.triAreaDDFast(t,e,n));return r.selfSubtract(o).selfAdd(s).selfSubtract(a).doubleValue()>0},Mo.isInCircleCC=function(t,e,n,i){var r=Ii.circumcentre(t,e,n),o=t.distance(r);return i.distance(r)-o<=0},Mo.isInCircleNormalized=function(t,e,n,i){var r=t.x-i.x,o=t.y-i.y,s=e.x-i.x,a=e.y-i.y,u=n.x-i.x,l=n.y-i.y;return(r*r+o*o)*(s*l-u*a)+(s*s+a*a)*(u*o-r*l)+(u*u+l*l)*(r*a-s*o)>0},Mo.isInCircleDDSlow=function(t,e,n,i){var r=O.valueOf(i.x),o=O.valueOf(i.y),s=O.valueOf(t.x),a=O.valueOf(t.y),u=O.valueOf(e.x),l=O.valueOf(e.y),c=O.valueOf(n.x),h=O.valueOf(n.y),f=s.multiply(s).add(a.multiply(a)).multiply(Mo.triAreaDDSlow(u,l,c,h,r,o)),p=u.multiply(u).add(l.multiply(l)).multiply(Mo.triAreaDDSlow(s,a,c,h,r,o)),d=c.multiply(c).add(h.multiply(h)).multiply(Mo.triAreaDDSlow(s,a,u,l,r,o)),g=r.multiply(r).add(o.multiply(o)).multiply(Mo.triAreaDDSlow(s,a,u,l,c,h));return f.subtract(p).add(d).subtract(g).doubleValue()>0},Mo.isInCircleNonRobust=function(t,e,n,i){return(t.x*t.x+t.y*t.y)*Mo.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*Mo.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*Mo.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*Mo.triArea(t,e,n)>0},Mo.isInCircleRobust=function(t,e,n,i){return Mo.isInCircleNormalized(t,e,n,i)},Mo.triAreaDDSlow=function(t,e,n,i,r,o){return n.subtract(t).multiply(o.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},Mo.triAreaDDFast=function(t,e,n){var i=O.valueOf(e.x).selfSubtract(t.x).selfMultiply(O.valueOf(n.y).selfSubtract(t.y)),r=O.valueOf(e.y).selfSubtract(t.y).selfMultiply(O.valueOf(n.x).selfSubtract(t.x));return i.selfSubtract(r)},e(Lo.prototype,{circleCenter:function(t,e){var n=new Lo(this.getX(),this.getY()),i=this.bisector(n,t),r=this.bisector(t,e),o=new F(i,r),s=null;try{s=new Lo(o.getX(),o.getY())}catch(i){if(!(i instanceof C))throw i;D.err.println("a: "+n+" b: "+t+" c: "+e),D.err.println(i)}return s},dot:function(t){return this.p.x*t.getX()+this.p.y*t.getY()},magn:function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},getZ:function(){return this.p.z},bisector:function(t,e){var n=e.getX()-t.getX(),i=e.getY()-t.getY();return new F(new F(t.getX()+n/2,t.getY()+i/2,1),new F(t.getX()-i+n/2,t.getY()+n+i/2,1))},equals:function(){if(1===arguments.length){var t=arguments[0];return this.p.x===t.getX()&&this.p.y===t.getY()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.p.distance(e.getCoordinate())0},getX:function(){return this.p.x},crossProduct:function(t){return this.p.x*t.getY()-this.p.y*t.getX()},setZ:function(t){this.p.z=t},times:function(t){return new Lo(t*this.p.x,t*this.p.y)},cross:function(){return new Lo(this.p.y,-this.p.x)},leftOf:function(t){return this.isCCW(t.orig(),t.dest())},toString:function(){return"POINT ("+this.p.x+" "+this.p.y+")"},sub:function(t){return new Lo(this.p.x-t.getX(),this.p.y-t.getY())},getY:function(){return this.p.y},classify:function(t,e){var n=this,i=e.sub(t),r=n.sub(t),o=i.crossProduct(r);return o>0?Lo.LEFT:o<0?Lo.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?Lo.BEHIND:i.magn()n?10*e:10*n,this.frameVertex[0]=new Lo((t.getMaxX()+t.getMinX())/2,t.getMaxY()+i),this.frameVertex[1]=new Lo(t.getMinX()-i,t.getMinY()-i),this.frameVertex[2]=new Lo(t.getMaxX()+i,t.getMinY()-i),this.frameEnv=new I(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},getTriangleCoordinates:function(t){var e=new jo;return this.visitTriangles(e,t),e.getTriangles()},getVertices:function(t){for(var e=new Q,n=this.quadEdges.iterator();n.hasNext();){var i=n.next(),r=i.orig();!t&&this.isFrameVertex(r)||e.add(r);var o=i.dest();!t&&this.isFrameVertex(o)||e.add(o)}return e},fetchTriangleToVisit:function(t,e,n,i){var r=t,o=0,s=!1;do{this.triEdges[o]=r,this.isFrameEdge(r)&&(s=!0);var a=r.sym();i.contains(a)||e.push(a),i.add(r),o++,r=r.lNext()}while(r!==t);return s&&!n?null:this.triEdges},getEdges:function(){if(0===arguments.length)return this.quadEdges;if(1===arguments.length){for(var t=arguments[0],e=this.getPrimaryEdges(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createLineString([o.orig().getCoordinate(),o.dest().getCoordinate()])}return t.createMultiLineString(n)}},getVertexUniqueEdges:function(t){for(var e=new w,n=new Q,i=this.quadEdges.iterator();i.hasNext();){var r=i.next(),o=r.orig();n.contains(o)||(n.add(o),!t&&this.isFrameVertex(o)||e.add(r));var s=r.sym(),a=s.orig();n.contains(a)||(n.add(a),!t&&this.isFrameVertex(a)||e.add(s))}return e},getTriangleEdges:function(t){var e=new ko;return this.visitTriangles(e,t),e.getTriangleEdges()},getPrimaryEdges:function(t){this.visitedKey++;var e=new w,n=new de;n.push(this.startingEdge);for(var i=new Q;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=r.getPrimary();!t&&this.isFrameEdge(o)||e.add(o),n.push(r.oNext()),n.push(r.sym().oNext()),i.add(r),i.add(r.sym())}}return e},delete:function(t){Po.splice(t,t.oPrev()),Po.splice(t.sym(),t.sym().oPrev());var e=t.sym(),n=t.rot(),i=t.rot().sym();this.quadEdges.remove(t),this.quadEdges.remove(e),this.quadEdges.remove(n),this.quadEdges.remove(i),t.delete(),e.delete(),n.delete(),i.delete()},locateFromEdge:function(t,e){for(var n=0,i=this.quadEdges.size(),r=e;;){if(++n>i)throw new Ao(r.toLineSegment());if(t.equals(r.orig())||t.equals(r.dest()))break;if(t.rightOf(r))r=r.sym();else if(t.rightOf(r.oNext())){if(t.rightOf(r.dPrev()))break;r=r.dPrev()}else r=r.oNext()}return r},getTolerance:function(){return this.tolerance},getVoronoiCellPolygons:function(t){this.visitTriangles(new qo,!0);for(var e=new w,n=this.getVertexUniqueEdges(!1),i=n.iterator();i.hasNext();){var r=i.next();e.add(this.getVoronoiCellPolygon(r,t))}return e},getVoronoiDiagram:function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(ne.toGeometryArray(e))},getTriangles:function(t){for(var e=this.getTriangleCoordinates(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createPolygon(t.createLinearRing(o),null)}return t.createGeometryCollection(n)},insertSite:function(t){var e=this.locate(t);if(t.equals(e.orig(),this.tolerance)||t.equals(e.dest(),this.tolerance))return e;var n=this.makeEdge(e.orig(),t);Po.splice(n,e);var i=n;do{n=this.connect(e,n.sym()),e=n.oPrev()}while(e.lNext()!==i);return i},locate:function(){if(1===arguments.length){if(arguments[0]instanceof Lo){var t=arguments[0];return this.locator.locate(t)}if(arguments[0]instanceof p){var e=arguments[0];return this.locator.locate(new Lo(e))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.locator.locate(new Lo(n));if(null===r)return null;var o=r;r.dest().getCoordinate().equals2D(n)&&(o=r.sym());var s=o;do{if(s.dest().getCoordinate().equals2D(i))return s;s=s.oNext()}while(s!==o);return null}},interfaces_:function(){return[]},getClass:function(){return Fo}}),Fo.getTriangleEdges=function(t,e){if(e[0]=t,e[1]=e[0].lNext(),e[2]=e[1].lNext(),e[2].lNext()!==e[0])throw new i("Edges do not form a triangle")},e(qo.prototype,{visit:function(t){for(var e=t[0].orig().getCoordinate(),n=t[1].orig().getCoordinate(),i=t[2].orig().getCoordinate(),r=Ii.circumcentre(e,n,i),o=new Lo(r),s=0;s<3;s++)t[s].rot().setOrig(o)},interfaces_:function(){return[Do]},getClass:function(){return qo}}),e(ko.prototype,{getTriangleEdges:function(){return this.triList},visit:function(t){this.triList.add(t.clone())},interfaces_:function(){return[Do]},getClass:function(){return ko}}),e(Go.prototype,{visit:function(t){this.triList.add([t[0].orig(),t[1].orig(),t[2].orig()])},getTriangleVertices:function(){return this.triList},interfaces_:function(){return[Do]},getClass:function(){return Go}}),e(jo.prototype,{checkTriangleSize:function(t){t.length>=2?re.toLineString(t[0],t[1]):t.length>=1&&re.toPoint(t[0])},visit:function(t){this.coordList.clear();for(var e=0;e<3;e++){var n=t[e].orig();this.coordList.add(n.getCoordinate())}if(this.coordList.size()>0){this.coordList.closeRing();var i=this.coordList.toCoordinateArray();if(4!==i.length)return null;this.triCoords.add(i)}},getTriangles:function(){return this.triCoords},interfaces_:function(){return[Do]},getClass:function(){return jo}}),Fo.TriangleCircumcentreVisitor=qo,Fo.TriangleEdgesListVisitor=ko,Fo.TriangleVertexListVisitor=Go,Fo.TriangleCoordinatesVisitor=jo,Fo.EDGE_COINCIDENCE_TOL_FACTOR=1e3,e(Bo.prototype,{getLineSegment:function(){return this.ls},getEndZ:function(){return this.ls.getCoordinate(1).z},getStartZ:function(){return this.ls.getCoordinate(0).z},intersection:function(t){return this.ls.intersection(t.getLineSegment())},getStart:function(){return this.ls.getCoordinate(0)},getEnd:function(){return this.ls.getCoordinate(1)},getEndY:function(){return this.ls.getCoordinate(1).y},getStartX:function(){return this.ls.getCoordinate(0).x},equalsTopo:function(t){return this.ls.equalsTopo(t.getLineSegment())},getStartY:function(){return this.ls.getCoordinate(0).y},setData:function(t){this.data=t},getData:function(){return this.data},getEndX:function(){return this.ls.getCoordinate(1).x},toString:function(){return this.ls.toString()},interfaces_:function(){return[]},getClass:function(){return Bo}}),e(zo.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return zo}}),e(Vo.prototype,{isRepeated:function(){return this.count>1},getRight:function(){return this.right},getCoordinate:function(){return this.p},setLeft:function(t){this.left=t},getX:function(){return this.p.x},getData:function(){return this.data},getCount:function(){return this.count},getLeft:function(){return this.left},getY:function(){return this.p.y},increment:function(){this.count=this.count+1},setRight:function(t){this.right=t},interfaces_:function(){return[]},getClass:function(){return Vo}}),e(Xo.prototype,{insert:function(){if(1===arguments.length){var t=arguments[0];return this.insert(t,null)}if(2===arguments.length){var e=arguments[0],n=arguments[1];if(null===this.root)return this.root=new Vo(e,n),this.root;if(this.tolerance>0){var i=this.findBestMatchNode(e);if(null!==i)return i.increment(),i}return this.insertExact(e,n)}},query:function(){var t=arguments,e=this;if(1===arguments.length){var n=arguments[0],i=new w;return this.query(n,i),i}if(2===arguments.length)if(arguments[0]instanceof I&&M(arguments[1],m))!function(){var n=t[0],i=t[1];e.queryNode(e.root,n,!0,{interfaces_:function(){return[zo]},visit:function(t){i.add(t)}})}();else if(arguments[0]instanceof I&&M(arguments[1],zo)){var r=arguments[0],o=arguments[1];this.queryNode(this.root,r,!0,o)}},queryNode:function(t,e,n,i){if(null===t)return null;var r=null,o=null,s=null;n?(r=e.getMinX(),o=e.getMaxX(),s=t.getX()):(r=e.getMinY(),o=e.getMaxY(),s=t.getY());var a=r0&&te)&&mr.isWithinDistance(this,t,e)},distance:function(t){return mr.distance(this,t)},isEquivalentClass:function(t){return this.getClass()===t.getClass()}});t.version="1.3.0 (6e65adb)",t.algorithm=cs,t.densify=hs,t.dissolve=fs,t.geom=us,t.geomgraph=ps,t.index=vs,t.io=Es,t.noding=ws,t.operation=Ps,t.precision=Ts,t.simplify=Os,t.triangulate=As,Object.defineProperty(t,"__esModule",{value:!0})})},{}],131:[function(t,e,n){function i(t,e){switch(t.geometry?t.geometry.type:t.type){case"Point":return r(u(t),e);case"Polygon":var n=[];l(t,function(t){n.push(t)});var c,h,f,p,d,g,v,y,m=a(t,e),x=m.geometry.coordinates,E=0,w=0,b=0,I=n.map(function(t){return[t[0]-x[0],t[1]-x[1]]});for(c=0;c=3){for(var s=[],a=0;a0)-(t<0)},n.abs=function(t){var e=t>>31;return(t^e)-e},n.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,n=(t>255)<<3,t>>>=n,e|=n,n=(t>15)<<2,t>>>=n,e|=n,n=(t>3)<<1,t>>>=n,(e|=n)|t>>1},n.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},n.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},n.countTrailingZeros=i,n.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},n.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},n.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,i=e,r=7;for(n>>>=1;n;n>>>=1)i<<=1,i|=1&n,--r;t[e]=i<>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},n.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},n.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},n.interleave3=function(t,e,n){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,n&=1023,n=4278190335&(n|n<<16),n=251719695&(n|n<<8),n=3272356035&(n|n<<4),n=1227133513&(n|n<<2),t|n<<2},n.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},n.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>i(t)+1}},{}],140:[function(t,e,n){"use strict";function i(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var n=t[0].length;return 0===n?[]:1===n?r(t):2===n?o(t):s(t,n)}var r=t("./lib/ch1d"),o=t("./lib/ch2d"),s=t("./lib/chnd");e.exports=i},{"./lib/ch1d":141,"./lib/ch2d":142,"./lib/chnd":143}],141:[function(t,e,n){"use strict";function i(t){for(var e=0,n=0,i=1;it[n][0]&&(n=i);return en?[[n],[e]]:[[e]]}e.exports=i},{}],142:[function(t,e,n){"use strict";function i(t){var e=r(t),n=e.length;if(n<=2)return[];for(var i=new Array(n),o=e[n-1],s=0;s=e[u]&&(a+=1);o[s]=a}}return t}function o(t,e){try{return s(t,!0)}catch(l){var n=a(t);if(n.length<=e)return[];var o=i(t,n),u=s(o,!0);return r(u,n)}}e.exports=o;var s=t("incremental-convex-hull"),a=t("affine-hull")},{"affine-hull":138,"incremental-convex-hull":144}],144:[function(t,e,n){"use strict";function i(t,e,n){this.vertices=t,this.adjacent=e,this.boundary=n,this.lastVisited=-1}function r(t,e,n){this.vertices=t,this.cell=e,this.index=n}function o(t,e){return c(t.vertices,e.vertices)}function s(t){for(var e=["function orient(){var tuple=this.tuple;return test("],n=0;n<=t;++n)n>0&&e.push(","),e.push("tuple[",n,"]");e.push(")}return orient");var i=new Function("test",e.join("")),r=l[t+1];return r||(r=l),i(r)}function a(t,e,n){this.dimension=t,this.vertices=e,this.simplices=n,this.interior=n.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var i=0;i<=t;++i)this.tuple[i]=this.vertices[i];var r=h[t];r||(r=h[t]=s(t)),this.orient=r}function u(t,e){var n=t.length;if(0===n)throw new Error("Must have at least d+1 points");var r=t[0].length;if(n<=r)throw new Error("Must input at least d+1 points");var o=t.slice(0,r+1),s=l.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var u=new Array(r+1),c=0;c<=r;++c)u[c]=c;s<0&&(u[0]=1,u[1]=0);for(var h=new i(u,new Array(r+1),!1),f=h.adjacent,p=new Array(r+2),c=0;c<=r;++c){for(var d=u.slice(),g=0;g<=r;++g)g===c&&(d[g]=-1);var v=d[0];d[0]=d[1],d[1]=v;var y=new i(d,new Array(r+1),!0);f[c]=y,p[c]=y}p[r+1]=h;for(var c=0;c<=r;++c)for(var d=f[c].vertices,m=f[c].adjacent,g=0;g<=r;++g){var x=d[g];if(x<0)m[g]=h;else for(var E=0;E<=r;++E)f[E].vertices.indexOf(x)<0&&(m[g]=f[E])}for(var w=new a(r,o,p),b=!!e,c=r+1;c0;){t=s.pop();for(var a=(t.vertices,t.adjacent),u=0;u<=n;++u){var l=a[u];if(l.boundary&&!(l.lastVisited<=-i)){for(var c=l.vertices,h=0;h<=n;++h){var f=c[h];r[h]=f<0?e:o[f]}var p=this.orient();if(p>0)return l;l.lastVisited=-i,0===p&&s.push(l)}}}return null},f.walk=function(t,e){var n=this.vertices.length-1,i=this.dimension,r=this.vertices,o=this.tuple,s=e?this.interior.length*Math.random()|0:this.interior.length-1,a=this.interior[s];t:for(;!a.boundary;){for(var u=a.vertices,l=a.adjacent,c=0;c<=i;++c)o[c]=r[u[c]];a.lastVisited=n;for(var c=0;c<=i;++c){var h=l[c];if(!(h.lastVisited>=n)){var f=o[c];o[c]=t;var p=this.orient();if(o[c]=f,p<0){a=h;continue t}h.boundary?h.lastVisited=-n:h.lastVisited=n}}return}return a},f.addPeaks=function(t,e){var n=this.vertices.length-1,s=this.dimension,a=this.vertices,u=this.tuple,l=this.interior,c=this.simplices,h=[e];e.lastVisited=n,e.vertices[e.vertices.indexOf(-1)]=n,e.boundary=!1,l.push(e);for(var f=[];h.length>0;){var e=h.pop(),p=e.vertices,d=e.adjacent,g=p.indexOf(n);if(!(g<0))for(var v=0;v<=s;++v)if(v!==g){var y=d[v];if(y.boundary&&!(y.lastVisited>=n)){var m=y.vertices;if(y.lastVisited!==-n){for(var x=0,E=0;E<=s;++E)m[E]<0?(x=E,u[E]=t):u[E]=a[m[E]];var w=this.orient();if(w>0){m[x]=n,y.boundary=!1,l.push(y),h.push(y),y.lastVisited=n;continue}y.lastVisited=-n}var b=y.adjacent,I=p.slice(),N=d.slice(),C=new i(I,N,!0);c.push(C);var S=b.indexOf(e);if(!(S<0)){b[S]=C,N[g]=y,I[v]=-1,N[v]=e,d[v]=C,C.flip();for(var E=0;E<=s;++E){var M=I[E];if(!(M<0||M===n)){for(var L=new Array(s-1),R=0,P=0;P<=s;++P){var T=I[P];T<0||P===E||(L[R++]=T)}f.push(new r(L,C,E))}}}}}}f.sort(o);for(var v=0;v+1=0?s[u++]=a[c]:l=1&c;if(l===(1&t)){var h=s[0];s[0]=s[1],s[1]=h}e.push(s)}}return e}},{"robust-orientation":146,"simplicial-complex":150}],145:[function(t,e,n){"use strict";function i(t){var e=t.length;if(e<3){for(var n=new Array(e),i=0;i1&&r(t[s[c-2]],t[s[c-1]],l)<=0;)c-=1,s.pop();for(s.push(u),c=a.length;c>1&&r(t[a[c-2]],t[a[c-1]],l)>=0;)c-=1,a.pop();a.push(u)}for(var n=new Array(a.length+s.length-2),h=0,i=0,f=s.length;i0;--p)n[h++]=a[p];return n}e.exports=i;var r=t("robust-orientation")[3]},{"robust-orientation":146}],146:[function(t,e,n){"use strict";function i(t,e){for(var n=new Array(t.length-1),i=1;i>1;return["sum(",s(t.slice(0,e)),",",s(t.slice(e)),")"].join("")}function a(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n0){if(o<=0)return s;i=r+o}else{if(!(r<0))return s;if(o>=0)return s;i=-(r+o)}var a=3.3306690738754716e-16*i;return s>=a||s<=-a?s:g(t,e,n)},function(t,e,n,i){var r=t[0]-i[0],o=e[0]-i[0],s=n[0]-i[0],a=t[1]-i[1],u=e[1]-i[1],l=n[1]-i[1],c=t[2]-i[2],h=e[2]-i[2],f=n[2]-i[2],p=o*l,d=s*u,g=s*a,y=r*l,m=r*u,x=o*a,E=c*(p-d)+h*(g-y)+f*(m-x),w=(Math.abs(p)+Math.abs(d))*Math.abs(c)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(m)+Math.abs(x))*Math.abs(f),b=7.771561172376103e-16*w;return E>b||-E>b?E:v(t,e,n,i)}];!function(){for(;y.length<=d;)y.push(u(y.length));for(var t=[],n=["slow"],i=0;i<=d;++i)t.push("a"+i),n.push("o"+i);for(var r=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],i=2;i<=d;++i)r.push("case ",i,":return o",i,"(",t.slice(0,i).join(),");");r.push("}var s=new Array(arguments.length);for(var i=0;i=r?(o=p,(c+=1)=r?(o=p,(c+=1)>1,a=s(t[o],e);a<=0?(0===a&&(r=o),n=o+1):a>0&&(i=o-1)}return r}function h(t,e){for(var n=new Array(t.length),i=0,r=n.length;i=t.length||0!==s(t[g],o))break}return n}function f(t,e){if(!e)return h(l(d(t,0)),t,0);for(var n=new Array(e),i=0;i>>c&1&&l.push(r[c]);e.push(l)}return u(e)}function d(t,e){if(e<0)return[];for(var n=[],i=(1<0))throw new Error("Invalid maxDistance");if(!(void 0===i||null===i||Math.sign(i)>0))throw new Error("Invalid minPoints");t=r(t,!0),i=i||3;var o=new a.DBSCAN,s=o.run(l(t),h(e,n),i,u),f=-1;return s.forEach(function(e){f++,e.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=f,n.properties.dbscan="core"})}),o.noise.forEach(function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"}),t}},{"@turf/clone":177,"@turf/distance":178,"@turf/helpers":181,"@turf/invariant":182,"@turf/meta":183,"density-clustering":188}],177:[function(t,e,n){arguments[4][175][0].apply(n,arguments)},{dup:175}],178:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":179,"@turf/invariant":180,dup:8}],179:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],180:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],181:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],182:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],183:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],184:[function(t,e,n){function i(t,e,n,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,i)}i.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var r=0;r=this.minPts&&(e=this._mergeArrays(e,r))}1!==this._assigned[i]&&this._addToCluster(i,t)}},i.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},i.prototype._regionQuery=function(t){for(var e=[],n=0;n0){for(var u=0;u=0);return t},i.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,i=0;i=this.minPts)return n}},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],i=0,r=this.dataset.length;ir&&(n=i):ei&&(e=i),!1!==n&&void 0!==n||(t=r(t,!0));var s=a(t),c=s.slice(0,e),h=o(s,e,c),f={};return h.centroids.forEach(function(t,e){f[e]=t}),u(t,function(t,e){var n=h.idxs[e];t.properties.cluster=n,t.properties.centroid=f[n]}),t}},{"./skmeans":193,"@turf/clone":190,"@turf/invariant":191,"@turf/meta":192}],190:[function(t,e,n){arguments[4][175][0].apply(n,arguments)},{dup:175}],191:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],192:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],193:[function(t,e,n){function i(t,e,n){for(var i=t.length,r=0,o=0;o0;i.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,i.push(a))}if(i.length0,u={},l=t[Math.floor(Math.random()*s)],c=a?l.join("_"):""+l;for(o.push(l),u[c]=!0;o.length0;if(n)u="kmrand"==n?o(t,e):"kmpp"==n?s(t,e):n;else for(var m={};u.lengthd&&(d=t[c].y);var g,v=f-h,y=d-p,m=v>y?v:y,x=.5*(f+h),E=.5*(d+p),w=[new i({x:x-20*m,y:E-m,__sentinel:!0},{x:x,y:E+20*m,__sentinel:!0},{x:x+20*m,y:E-m,__sentinel:!0})],b=[],I=[];for(c=t.length;c--;){for(I.length=0,g=w.length;g--;)v=t[c].x-w[g].x,v>0&&v*v>w[g].r?(b.push(w[g]),w.splice(g,1)):(y=t[c].y-w[g].y,v*v+y*y>w[g].r||(I.push(w[g].a,w[g].b,w[g].b,w[g].c,w[g].c,w[g].a),w.splice(g,1)));for(o(I),g=I.length;g;)n=I[--g],e=I[--g],s=t[c],a=n.x-e.x,u=n.y-e.y,l=2*(a*(s.y-n.y)-u*(s.x-n.x)),Math.abs(l)>1e-12&&w.push(new i(e,n,s))}for(Array.prototype.push.apply(b,w),c=b.length;c--;)(b[c].a.__sentinel||b[c].b.__sentinel||b[c].c.__sentinel)&&b.splice(c,1);return b}var a=t("@turf/helpers"),u=a.polygon,l=a.featureCollection;e.exports=function(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return l(s(t.features.map(function(t){var i={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?i.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,i.z=t.geometry.coordinates[2]),i})).map(function(t){var e=[t.a.x,t.a.y],i=[t.b.x,t.b.y],r=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),i.push(t.b.z),r.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},u([[e,i,r,e]],o)}))}},{"@turf/helpers":211}],211:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],212:[function(t,e,n){var i=t("jsts");e.exports=function(){for(var t=new i.io.GeoJSONReader,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n1)return t;return;case"MultiPolygon":var e=[];if(u(t,function(t){o(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}var r=t("jsts"),o=t("@turf/area"),s=t("@turf/helpers").feature,a=t("@turf/invariant").getGeom,u=t("@turf/meta").flattenEach;e.exports=function(t,e){var n=a(t),o=a(e),u=t.properties||{};if(n=i(n),o=i(o),n){if(!o)return s(n,u);var l=new r.io.GeoJSONReader,c=l.read(n),h=l.read(o),f=c.difference(h);if(!f.isEmpty()){var p=new r.io.GeoJSONWriter,d=p.write(f);return s(d,u)}}}},{"@turf/area":237,"@turf/helpers":241,"@turf/invariant":242,"@turf/meta":243,jsts:244}],237:[function(t,e,n){arguments[4][12][0].apply(n,arguments)},{"@mapbox/geojson-area":238,"@turf/meta":239,dup:12}],238:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{dup:13,wgs84:240}],239:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],240:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],241:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],242:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],243:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],244:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],245:[function(t,e,n){function i(t){if(null===t||void 0===t)throw new Error("No polygon was passed");t.geometry.type="LineString";var e=[].concat.apply([],t.geometry.coordinates);return t.geometry.coordinates=e,t}var r=t("@turf/union"),o=t("turf-overlaps"),s=t("@turf/bbox"),a=t("rbush"),u=t("geojson-utils"),l=t("get-closest");e.exports=function(t,e){for(var n=[],c=[],h=new a,f=0;f0&&0!==b)if(b>n[n.length-1])b-=n.length;else{var I=l.greaterNumber(b,n);0!==I&&(b-=I)}if(b!==g){var N=t.features[b];if(void 0===typeof e||N.properties[e]===v.properties[e]){var C=o(v,N);if(!C){var S=JSON.stringify(v),M=JSON.stringify(N),L=i(JSON.parse(S)),R=i(JSON.parse(M));C=u.lineStringsIntersect(L.geometry,R.geometry)}C&&(t.features[g]=r(v,N),n.push(x[w].origIndexPosition),n.sort(function(t,e){return t-e}),h.remove(x[w]),t.features.splice(b,1),m.origIndexPosition=g,h.remove(m,function(t,e){return t.origIndexPosition===e.origIndexPosition}),E=!0)}}}if(E){var P=s(v);h.insert({minX:P[0],minY:P[1],maxX:P[2],maxY:P[3],origIndexPosition:g}),g--}}return t}},{"@turf/bbox":246,"@turf/union":248,"geojson-utils":250,"get-closest":251,rbush:253,"turf-overlaps":255}],246:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":247,dup:22}],247:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],248:[function(t,e,n){arguments[4][212][0].apply(n,arguments)},{dup:212,jsts:249}],249:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],250:[function(t,e,n){!function(){function t(t){for(var e=[],n=[],i=0;ie!=i[o][0]>e&&t<(i[o][1]-i[r][1])*(e-i[r][0])/(i[o][0]-i[r][0])+i[r][1]&&(s=!s);return s}var i=this.gju={};void 0!==e&&e.exports&&(e.exports=i),i.lineStringsIntersect=function(t,e){for(var n=[],i=0;i<=t.coordinates.length-2;++i)for(var r=0;r<=e.coordinates.length-2;++r){var o={x:t.coordinates[i][1],y:t.coordinates[i][0]},s={x:t.coordinates[i+1][1],y:t.coordinates[i+1][0]},a={x:e.coordinates[r][1],y:e.coordinates[r][0]},u={x:e.coordinates[r+1][1],y:e.coordinates[r+1][0]},l=(u.x-a.x)*(o.y-a.y)-(u.y-a.y)*(o.x-a.x),c=(s.x-o.x)*(o.y-a.y)-(s.y-o.y)*(o.x-a.x),h=(u.y-a.y)*(s.x-o.x)-(u.x-a.x)*(s.y-o.y);if(0!=h){var f=l/h,p=c/h;0<=f&&f<=1&&0<=p&&p<=1&&n.push({type:"Point",coordinates:[o.x+f*(s.x-o.x),o.y+f*(s.y-o.y)]})}}return 0==n.length&&(n=!1),n},i.pointInBoundingBox=function(t,e){return!(t.coordinates[1]e[1][0]||t.coordinates[0]e[1][1])},i.pointInPolygon=function(e,r){for(var o="Polygon"==r.type?[r.coordinates]:r.coordinates,s=!1,a=0;an)return!1}return!0},i.area=function(t){for(var e,n,i=0,r=t.coordinates[0],o=r.length-1,s=0;s0;)if(o=I[i-1],s=N[i-1],i--,s-o>1){for(f=t[s].lng()-t[o].lng(),p=t[s].lat()-t[o].lat(),Math.abs(f)>180&&(f=360-Math.abs(f)),f*=Math.cos(w*(t[s].lat()+t[o].lat())),d=f*f+p*p,a=o+1,u=o,c=-1;a180&&(g=360-Math.abs(g)),g*=Math.cos(w*(t[a].lat()+t[o].lat())),y=g*g+v*v,m=t[a].lng()-t[s].lng(),x=t[a].lat()-t[s].lat(),Math.abs(m)>180&&(m=360-Math.abs(m)),m*=Math.cos(w*(t[a].lat()+t[s].lat())),E=m*m+x*x,(l=y>=d+E?E:E>=d+y?y:(g*p-v*f)*(g*p-v*f)/d)>c&&(u=a,c=l);c=0&&(void 0===r||s0}},{}],255:[function(t,e,n){function i(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return s([n,r,o,n])!=s([i,r,o,i])&&s([n,i,r,n])!=s([n,i,o,n])}function r(t,e){for(var n=0;nd&&(y>f&&vf&&yc&&(c=m)}var x=[];if(l&&c0&&Math.abs(b-n[w-1][0])>d){var I=parseFloat(n[w-1][0]),N=parseFloat(n[w-1][1]),C=parseFloat(n[w][0]),S=parseFloat(n[w][1]);if(I>-180&&I-180&&n[w-1][0]f&&I<180&&-180===C&&w+1f&&n[w-1][0]<180){E.push([180,n[w][1]]),w++,E.push([n[w][0],n[w][1]]);continue}if(If){var M=I;I=C,C=M;var L=N;N=S,S=L}if(I>f&&C=180&&If?180:-180,P]),E=[],E.push([n[w-1][0]>f?-180:180,P]),x.push(E)}else E=[],x.push(E);E.push([b,n[w][1]])}else E.push([n[w][0],n[w][1]])}}else{var T=[];x.push(T);for(var O=0;Ow/2;T&&(P-=w/4);for(var O=l([]),_=0;_t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}var r=t("@turf/invariant");e.exports=function(t,e){var n=r.getCoord(t),o=e.geometry.coordinates;"Polygon"===e.geometry.type&&(o=[o]);for(var s=0,a=!1;s1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")}function r(t){if(!t)throw new Error("No obj passed");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return o(e),e;throw new Error("No valid coordinates")}function o(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(t[0].length)return o(t[0]);throw new Error("coordinates must only contain numbers")}function s(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function a(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function u(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")}function r(t){if(!t)throw new Error("No obj passed");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return o(e),e;throw new Error("No valid coordinates")}function o(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&t[0].length)return o(t[0]);throw new Error("coordinates must only contain numbers")}function s(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function a(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function u(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var i=0;i is required");if(t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error(" must be a Feature or Geometry Object")}function c(t){return l(t).type}e.exports={geojsonType:s,collectionOf:u,featureOf:a,getCoord:i,getCoords:r,containsNumber:o,getGeom:l,getGeomType:c}},{}],351:[function(t,e,n){function i(t,e,n){var r,o,s,a,u,l,c,h,f,p,d=0,g=0,v="FeatureCollection"===t.type,y="Feature"===t.type,m=v?t.features.length:1;for(r=0;r-1}function i(t,n,i){for(var r=t.length-1,o=t[0].length-1,s={rows:r,cols:o,cells:[]},a=n+Math.abs(i),u=0;ua?128:64,c|=fa?32:16,c|=pa?8:4,c|=da?2:1;var g=+c,v=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+f+p+d)/4;v=y>a?2:y0?(c=156,v=4):c=152:33===c?v>0?(c=139,v=4):c=137:72===c?v>0?(c=99,v=4):c=98:132===c&&(v>0?(c=39,v=4):c=38)}if(0!=c&&170!=c){var m,x,E,w,b,I,N,C;m=x=E=w=b=I=N=C=.5;var S=[];1===c?(E=1-e(n,p,d),C=1-e(n,h,d),S.push(Rt[c])):169===c?(E=e(a,d,p),C=e(a,d,h),S.push(Rt[c])):4===c?(I=1-e(n,f,p),w=e(n,d,p),S.push(Mt[c])):166===c?(I=e(a,p,f),w=1-e(a,p,d),S.push(Mt[c])):16===c?(b=e(n,p,f),x=e(n,h,f),S.push(St[c])):154===c?(b=1-e(a,f,p),x=1-e(a,f,h),S.push(St[c])):64===c?(N=e(n,d,h),m=1-e(n,f,h),S.push(Tt[c])):106===c?(N=1-e(a,h,d),m=e(a,h,f),S.push(Tt[c])):168===c?(w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),S.push(Lt[c]),S.push(Rt[c])):2===c?(w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),S.push(Lt[c]),S.push(Rt[c])):162===c?(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),S.push(Lt[c]),S.push(Rt[c])):8===c?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),S.push(St[c]),S.push(Mt[c])):138===c?(b=1-e(n,f,p),I=1-e(a,f,p),m=1-e(a,f,h),x=1-e(n,f,h),S.push(St[c]),S.push(Mt[c])):32===c?(b=e(a,p,f),I=e(n,p,f),m=e(n,h,f),x=e(a,h,f),S.push(St[c]),S.push(Mt[c])):42===c?(C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f),S.push(Pt[c]),S.push(Tt[c])):128===c&&(C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Pt[c]),S.push(Tt[c])),5===c?(I=1-e(n,f,p),C=1-e(n,h,d),S.push(Mt[c])):165===c?(I=e(a,p,f),C=e(a,d,h),S.push(Mt[c])):20===c?(w=e(n,d,p),x=e(n,h,f),S.push(Lt[c])):150===c?(w=1-e(a,p,d),x=1-e(a,f,h),S.push(Lt[c])):80===c?(b=e(n,p,f),N=e(n,d,h),S.push(St[c])):90===c?(b=1-e(a,f,p),N=1-e(a,h,d),S.push(St[c])):65===c?(E=1-e(n,p,d),m=1-e(n,f,h),S.push(Rt[c])):105===c?(E=e(a,d,p),m=e(a,h,f),S.push(Rt[c])):160===c?(b=e(a,p,f),I=e(n,p,f),C=e(n,d,h),N=e(a,d,h),S.push(St[c]),S.push(Mt[c])):10===c?(b=1-e(n,f,p),I=1-e(a,f,p),C=1-e(a,h,d),N=1-e(n,h,d),S.push(St[c]),S.push(Mt[c])):130===c?(w=1-e(n,p,d),E=1-e(a,p,d),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Lt[c]),S.push(Rt[c])):40===c?(w=e(a,d,p),E=e(n,d,p),m=e(n,h,f),x=e(a,h,f),S.push(Lt[c]),S.push(Rt[c])):101===c?(I=e(a,p,f),m=e(a,h,f),S.push(Mt[c])):69===c?(I=1-e(n,f,p),m=1-e(n,f,h),S.push(Mt[c])):149===c?(C=e(a,d,h),x=1-e(a,f,h),S.push(Pt[c])):21===c?(C=1-e(n,h,d),x=e(n,h,f),S.push(Pt[c])):86===c?(w=1-e(a,p,d),N=1-e(a,h,d),S.push(Lt[c])):84===c?(w=e(n,d,p),N=e(n,d,h),S.push(Lt[c])):89===c?(b=1-e(a,f,p),E=e(a,d,p),S.push(Rt[c])):81===c?(b=e(n,p,f),E=1-e(n,p,d),S.push(Rt[c])):96===c?(b=e(a,p,f),I=e(n,p,f),N=e(n,d,h),m=e(a,h,f),S.push(St[c]),S.push(Mt[c])):74===c?(b=1-e(n,f,p),I=1-e(a,f,p),N=1-e(a,h,d),m=1-e(n,f,h),S.push(St[c]),S.push(Mt[c])):24===c?(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),x=e(n,h,f),S.push(St[c]),S.push(Rt[c])):146===c?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),x=1-e(a,f,h),S.push(St[c]),S.push(Rt[c])):6===c?(I=1-e(n,f,p),w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),S.push(Mt[c]),S.push(Lt[c])):164===c?(I=e(a,p,f),w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),S.push(Mt[c]),S.push(Lt[c])):129===c?(E=1-e(n,p,d),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Rt[c]),S.push(Pt[c])):41===c?(E=e(a,d,p),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f),S.push(Rt[c]),S.push(Pt[c])):66===c?(w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),m=1-e(n,f,h),S.push(Lt[c]),S.push(Rt[c])):104===c?(w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),m=e(a,h,f),S.push(Rt[c]),S.push(Ot[c])):144===c?(b=e(n,p,f),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h),S.push(St[c]),S.push(Tt[c])):26===c?(b=1-e(a,f,p),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f),S.push(St[c]),S.push(Tt[c])):36===c?(I=e(a,p,f),w=e(n,d,p),m=e(n,h,f),x=e(a,h,f),S.push(Mt[c]),S.push(Lt[c])):134===c?(I=1-e(n,f,p),w=1-e(a,p,d),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Mt[c]),S.push(Lt[c])):9===c?(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),C=1-e(n,h,d),S.push(St[c]),S.push(Mt[c])):161===c?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),C=e(a,d,h),S.push(St[c]),S.push(Mt[c])):37===c?(I=e(a,p,f),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f),S.push(Mt[c]),S.push(Pt[c])):133===c?(I=1-e(n,f,p),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h),S.push(Mt[c]),S.push(Pt[c])):148===c?(w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h),S.push(Lt[c]),S.push(Tt[c])):22===c?(w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f),S.push(Lt[c]),S.push(Tt[c])):82===c?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),S.push(St[c]),S.push(Rt[c])):88===c?(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),S.push(St[c]),S.push(Rt[c])):73===c?(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),m=1-e(n,f,h),S.push(St[c]),S.push(Mt[c])):97===c?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),m=e(a,h,f),S.push(St[c]),S.push(Mt[c])):145===c?(b=e(n,p,f),E=1-e(n,p,d),C=e(a,d,h),x=1-e(a,f,h),S.push(St[c]),S.push(Pt[c])):25===c?(b=1-e(a,f,p),E=e(a,d,p),C=1-e(n,h,d),x=e(n,h,f),S.push(St[c]),S.push(Pt[c])):70===c?(I=1-e(n,f,p),w=1-e(a,p,d),N=1-e(a,h,d),m=1-e(n,f,h),S.push(Mt[c]),S.push(Lt[c])):100===c?(I=e(a,p,f),w=e(n,d,p),N=e(n,d,h),m=e(a,h,f),S.push(Mt[c]),S.push(Lt[c])):34===c?(0===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Pt[c]),S.push(Tt[c])):35===c?(4===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Rt[c]),S.push(Tt[c])):136===c?(0===v?(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)):(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)),S.push(St[c]),S.push(Mt[c]),S.push(Pt[c]),S.push(Tt[c])):153===c?(0===v?(b=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Rt[c])):102===c?(0===v?(I=1-e(n,f,p),w=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(Mt[c]),S.push(Tt[c])):155===c?(4===v?(b=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Pt[c])):103===c?(4===v?(I=1-e(n,f,p),w=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(Mt[c]),S.push(Lt[c])):152===c?(0===v?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Lt[c]),S.push(Rt[c])):156===c?(4===v?(b=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),x=e(n,h,f)):(b=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),C=e(n,d,h),N=e(a,d,h),x=1-e(a,f,h)),S.push(St[c]),S.push(Rt[c]),S.push(Tt[c])):137===c?(0===v?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)):(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)),S.push(St[c]),S.push(Mt[c]),S.push(Rt[c])):139===c?(4===v?(b=e(a,p,f),I=e(n,p,f),E=1-e(n,p,d),C=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)):(b=1-e(n,f,p),I=1-e(a,f,p),E=e(a,d,p),C=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)),S.push(St[c]),S.push(Mt[c]),S.push(Pt[c])):98===c?(0===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Tt[c])):99===c?(4===v?(b=1-e(n,f,p),I=1-e(a,f,p),w=e(a,d,p),E=e(n,d,p),N=e(n,d,h),m=1-e(n,f,h)):(b=e(a,p,f),I=e(n,p,f),w=1-e(n,p,d),E=1-e(a,p,d),N=1-e(a,h,d),m=e(a,h,f)),S.push(St[c]),S.push(Mt[c]),S.push(Rt[c])):38===c?(0===v?(I=1-e(n,f,p),w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(Mt[c]),S.push(Pt[c]),S.push(Tt[c])):39===c?(4===v?(I=1-e(n,f,p),w=e(n,d,p),C=e(n,d,h),N=e(a,d,h),m=1-e(a,f,h),x=1-e(n,f,h)):(I=e(a,p,f),w=1-e(a,p,d),C=1-e(a,h,d),N=1-e(n,h,d),m=e(n,h,f),x=e(a,h,f)),S.push(Mt[c]),S.push(Lt[c]),S.push(Tt[c])):85===c&&(b=1,I=0,w=1,E=0,C=0,N=1,m=0,x=1),(m<0||m>1||x<0||x>1||b<0||b>1||w<0||w>1||C<0||C>1||N<0||N>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+h+","+f+","+p+","+d+" "+v+" "+m+" "+x+" "+b+" "+I+" "+w+" "+E+" "+C+" "+N),s.cells[u][l]={cval:c,cval_real:g,flipped:v,topleft:m, topright:x,righttop:b,rightbottom:I,bottomright:w,bottomleft:E,leftbottom:C,lefttop:N,edges:S}}}}}return s}function r(t){for(var e=[],n=t.rows,i=t.cols,r=[],s=0;s0){var c=t.cells[s][l],h=a(c),f=null,p=l,d=s;null!==h&&r.push([h.p[0]+p,h.p[1]+d]);do{if(null===(f=u(t.cells[d][p],h.x,h.y,h.o)))break;if(r.push([f.p[0]+p,f.p[1]+d]),p+=f.x,d+=f.y,h=f,d<0||d>=n||p<0||p>=i||void 0===t.cells[d][p]){p-=f.x,d-=f.y;var g=o(t,p,d,f.x,f.y,f.o);if(null===g)break;g.path.forEach(function(t){r.push(t)}),p=g.i,d=g.j,h=g}}while(void 0!==t.cells[d][p]&&t.cells[d][p].edges.length>0);e.push(r),r=[],t.cells[s][l].edges.length>0&&l--}return e}function o(t,e,n,i,r,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+i,l=n+r,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=r,u-=i,s=t.cells[l][u],a=s.cval_real,-1===r)if(0===o)if(a&g)c.push([u,l]),i=-1,r=0,o=0;else{if(!(a&d)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+1,l]),i=1,r=0,o=0}else{if(!(a&g)){if(a&d){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+s.bottomleft,l]),i=0,r=1,o=0,h=!0;break}c.push([u,l]),i=-1,r=0,o=0}else if(1===r)if(0===o){if(!(a&p)){if(a&f){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+s.topright,l+1]),i=0,r=-1,o=1,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}else c.push([u+1,l+1]),i=1,r=0,o=1;else if(-1===i)if(0===o){if(!(a&f)){if(a&g){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+s.lefttop]),i=1,r=0,o=1,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}else{if(!(a&f)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),i=0,r=1,o=0}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&d)){c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}else{if(!(a&d)){if(a&p){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1;break}c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else if(s=t.cells[l][u],a=s.cval_real,-1===i)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])i=0,r=-1,o=1;else{if(!(a&g)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&f)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===i){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])i=0,r=1,o=0;else{if(!(a&p)){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}}else if(-1===r){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])i=1,r=0,o=1;else{if(!(a&d)){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])i=-1,r=0,o=0;else{if(!(a&f)){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}}if(u+=i,l+=r,u===e&&l===n)break}return{path:c,i:u,j:l,x:i,y:r,o:o}}function s(t,e){delete t.edges[e];for(var n=e+1;n0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&p?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&d?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&g?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&p?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&d?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&g?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&g?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&f?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&g?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&f?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&f?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&g?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&f?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&f?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&p?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&f?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&p?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}function u(t,e,n,i){var r,o,a,u,l,c=t.cval;switch(e){case-1:switch(i){case 0:r=Mt[c],a=C[c],u=S[c],l=M[c];break;default:r=St[c],a=b[c],u=I[c],l=N[c]}break;case 1:switch(i){case 0:r=Pt[c],a=q[c],u=k[c],l=G[c];break;default:r=Tt[c],a=A[c],u=D[c],l=F[c]}break;default:switch(n){case-1:switch(i){case 0:r=Ot[c],a=v[c],u=y[c],l=m[c];break;default:r=_t[c],a=x[c],u=E[c],l=w[c]}break;case 1:switch(i){case 0:r=Rt[c],a=L[c],u=R[c],l=P[c];break;default:r=Lt[c],a=T[c],u=O[c],l=_[c]}}}if(o=t.edges.indexOf(r),void 0===t.edges[o])return null;switch(s(t,o),c=t.cval_real,r){case 0:c&p?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:c&d?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:c&d?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:c&g?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:c&p?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:c&d?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:c&d?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:c&g?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:c&d?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:c&g?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:c&g?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:c&f?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:c&d?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:c&g?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:c&g?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:c&f?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:c&d?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:c&f?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:c&g?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:c&f?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:c&f?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:c&p?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:c&f?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:c&p?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==a&&void 0!==u&&void 0!==l||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+a+" "+u+" "+l)),{p:[e,n],x:a,y:u,o:l}}function l(t){var e=[],i=0;return t.cells.forEach(function(t,r){t.forEach(function(t,o){if(void 0!==t){var s=At[t.cval](t);"object"==typeof s&&n(s)?"object"==typeof s[0]&&n(s[0])?"object"==typeof s[0][0]&&n(s[0][0])?s.forEach(function(t){t.forEach(function(t){t[0]+=o,t[1]+=r}),e[i++]=t}):(s.forEach(function(t){t[0]+=o,t[1]+=r}),e[i++]=s):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}var c={successCallback:null,verbose:!1,polygons:!1},h={},f=64,p=16,d=4,g=1,v=[],y=[],m=[],x=[],E=[],w=[],b=[],I=[],N=[],C=[],S=[],M=[],L=[],R=[],P=[],T=[],O=[],_=[],A=[],D=[],F=[],q=[],k=[],G=[];b[85]=C[85]=-1,I[85]=S[85]=0,N[85]=M[85]=1,A[85]=q[85]=1,D[85]=k[85]=0,F[85]=G[85]=1,v[85]=x[85]=0,y[85]=E[85]=-1,m[85]=P[85]=0,T[85]=L[85]=0,O[85]=R[85]=1,w[85]=_[85]=1,q[1]=q[169]=0,k[1]=k[169]=-1,G[1]=G[169]=0,L[1]=L[169]=-1,R[1]=R[169]=0,P[1]=P[169]=0,C[4]=C[166]=0,S[4]=S[166]=-1,M[4]=M[166]=1,T[4]=T[166]=1,O[4]=O[166]=0,_[4]=_[166]=0,b[16]=b[154]=0,I[16]=I[154]=1,N[16]=N[154]=1,x[16]=x[154]=1,E[16]=E[154]=0,w[16]=w[154]=1,A[64]=A[106]=0,D[64]=D[106]=1,F[64]=F[106]=0,v[64]=v[106]=-1,y[64]=y[106]=0,m[64]=m[106]=1,A[2]=A[168]=0,D[2]=D[168]=-1,F[2]=F[168]=1,q[2]=q[168]=0,k[2]=k[168]=-1,G[2]=G[168]=0,L[2]=L[168]=-1,R[2]=R[168]=0,P[2]=P[168]=0,T[2]=T[168]=-1,O[2]=O[168]=0,_[2]=_[168]=1,b[8]=b[162]=0,I[8]=I[162]=-1,N[8]=N[162]=0,C[8]=C[162]=0,S[8]=S[162]=-1,M[8]=M[162]=1,L[8]=L[162]=1,R[8]=R[162]=0,P[8]=P[162]=1,T[8]=T[162]=1,O[8]=O[162]=0,_[8]=_[162]=0,b[32]=b[138]=0,I[32]=I[138]=1,N[32]=N[138]=1,C[32]=C[138]=0,S[32]=S[138]=1,M[32]=M[138]=0,v[32]=v[138]=1,y[32]=y[138]=0,m[32]=m[138]=0,x[32]=x[138]=1,E[32]=E[138]=0,w[32]=w[138]=1,q[128]=q[42]=0,k[128]=k[42]=1,G[128]=G[42]=1,A[128]=A[42]=0,D[128]=D[42]=1,F[128]=F[42]=0,v[128]=v[42]=-1,y[128]=y[42]=0,m[128]=m[42]=1,x[128]=x[42]=-1,E[128]=E[42]=0,w[128]=w[42]=0,C[5]=C[165]=-1,S[5]=S[165]=0,M[5]=M[165]=0,q[5]=q[165]=1,k[5]=k[165]=0,G[5]=G[165]=0,T[20]=T[150]=0,O[20]=O[150]=1,_[20]=_[150]=1,x[20]=x[150]=0,E[20]=E[150]=-1,w[20]=w[150]=1,b[80]=b[90]=-1,I[80]=I[90]=0,N[80]=N[90]=1,A[80]=A[90]=1,D[80]=D[90]=0,F[80]=F[90]=1,L[65]=L[105]=0,R[65]=R[105]=1,P[65]=P[105]=0,v[65]=v[105]=0,y[65]=y[105]=-1,m[65]=m[105]=0,b[160]=b[10]=-1,I[160]=I[10]=0,N[160]=N[10]=1,C[160]=C[10]=-1,S[160]=S[10]=0,M[160]=M[10]=0,q[160]=q[10]=1,k[160]=k[10]=0,G[160]=G[10]=0,A[160]=A[10]=1,D[160]=D[10]=0,F[160]=F[10]=1,T[130]=T[40]=0,O[130]=O[40]=1,_[130]=_[40]=1,L[130]=L[40]=0,R[130]=R[40]=1,P[130]=P[40]=0,v[130]=v[40]=0,y[130]=y[40]=-1,m[130]=m[40]=0,x[130]=x[40]=0,E[130]=E[40]=-1,w[130]=w[40]=1,C[37]=C[133]=0,S[37]=S[133]=1,M[37]=M[133]=1,q[37]=q[133]=0,k[37]=k[133]=1,G[37]=G[133]=0,v[37]=v[133]=-1,y[37]=y[133]=0,m[37]=m[133]=0,x[37]=x[133]=1,E[37]=E[133]=0,w[37]=w[133]=0,T[148]=T[22]=-1,O[148]=O[22]=0,_[148]=_[22]=0,q[148]=q[22]=0,k[148]=k[22]=-1,G[148]=G[22]=1,A[148]=A[22]=0,D[148]=D[22]=1,F[148]=F[22]=1,x[148]=x[22]=-1,E[148]=E[22]=0,w[148]=w[22]=1,b[82]=b[88]=0,I[82]=I[88]=-1,N[82]=N[88]=1,T[82]=T[88]=1,O[82]=O[88]=0,_[82]=_[88]=1,L[82]=L[88]=-1,R[82]=R[88]=0,P[82]=P[88]=1,A[82]=A[88]=0,D[82]=D[88]=-1,F[82]=F[88]=0,b[73]=b[97]=0,I[73]=I[97]=1,N[73]=N[97]=0,C[73]=C[97]=0,S[73]=S[97]=-1,M[73]=M[97]=0,L[73]=L[97]=1,R[73]=R[97]=0,P[73]=P[97]=0,v[73]=v[97]=1,y[73]=y[97]=0,m[73]=m[97]=1,b[145]=b[25]=0,I[145]=I[25]=-1,N[145]=N[25]=0,L[145]=L[25]=1,R[145]=R[25]=0,P[145]=P[25]=1,q[145]=q[25]=0,k[145]=k[25]=1,G[145]=G[25]=1,x[145]=x[25]=-1,E[145]=E[25]=0,w[145]=w[25]=0,C[70]=C[100]=0,S[70]=S[100]=1,M[70]=M[100]=0,T[70]=T[100]=-1,O[70]=O[100]=0,_[70]=_[100]=1,A[70]=A[100]=0,D[70]=D[100]=-1;F[70]=F[100]=1,v[70]=v[100]=1,y[70]=y[100]=0,m[70]=m[100]=0,C[101]=C[69]=0,S[101]=S[69]=1,M[101]=M[69]=0,v[101]=v[69]=1,y[101]=y[69]=0,m[101]=m[69]=0,q[149]=q[21]=0,k[149]=k[21]=1,G[149]=G[21]=1,x[149]=x[21]=-1,E[149]=E[21]=0,w[149]=w[21]=0,T[86]=T[84]=-1,O[86]=O[84]=0,_[86]=_[84]=1,A[86]=A[84]=0,D[86]=D[84]=-1,F[86]=F[84]=1,b[89]=b[81]=0,I[89]=I[81]=-1,N[89]=N[81]=0,L[89]=L[81]=1,R[89]=R[81]=0,P[89]=P[81]=1,b[96]=b[74]=0,I[96]=I[74]=1,N[96]=N[74]=0,C[96]=C[74]=-1,S[96]=S[74]=0,M[96]=M[74]=1,A[96]=A[74]=1,D[96]=D[74]=0,F[96]=F[74]=0,v[96]=v[74]=1,y[96]=y[74]=0,m[96]=m[74]=1,b[24]=b[146]=0,I[24]=I[146]=-1,N[24]=N[146]=1,T[24]=T[146]=1,O[24]=O[146]=0,_[24]=_[146]=1,L[24]=L[146]=0,R[24]=R[146]=1,P[24]=P[146]=1,x[24]=x[146]=0,E[24]=E[146]=-1,w[24]=w[146]=0,C[6]=C[164]=-1,S[6]=S[164]=0,M[6]=M[164]=1,T[6]=T[164]=-1,O[6]=O[164]=0,_[6]=_[164]=0,q[6]=q[164]=0,k[6]=k[164]=-1,G[6]=G[164]=1,A[6]=A[164]=1,D[6]=D[164]=0,F[6]=F[164]=0,L[129]=L[41]=0,R[129]=R[41]=1,P[129]=P[41]=1,q[129]=q[41]=0,k[129]=k[41]=1,G[129]=G[41]=0,v[129]=v[41]=-1,y[129]=y[41]=0,m[129]=m[41]=0,x[129]=x[41]=0,E[129]=E[41]=-1,w[129]=w[41]=0,T[66]=T[104]=0,O[66]=O[104]=1,_[66]=_[104]=0,L[66]=L[104]=-1,R[66]=R[104]=0,P[66]=P[104]=1,A[66]=A[104]=0,D[66]=D[104]=-1,F[66]=F[104]=0,v[66]=v[104]=0,y[66]=y[104]=-1,m[66]=m[104]=1,b[144]=b[26]=-1,I[144]=I[26]=0,N[144]=N[26]=0,q[144]=q[26]=1,k[144]=k[26]=0,G[144]=G[26]=1,A[144]=A[26]=0,D[144]=D[26]=1,F[144]=F[26]=1,x[144]=x[26]=-1,E[144]=E[26]=0,w[144]=w[26]=1,C[36]=C[134]=0,S[36]=S[134]=1,M[36]=M[134]=1,T[36]=T[134]=0,O[36]=O[134]=1,_[36]=_[134]=0,v[36]=v[134]=0,y[36]=y[134]=-1,m[36]=m[134]=1,x[36]=x[134]=1,E[36]=E[134]=0,w[36]=w[134]=0,b[9]=b[161]=-1,I[9]=I[161]=0,N[9]=N[161]=0,C[9]=C[161]=0,S[9]=S[161]=-1,M[9]=M[161]=0,L[9]=L[161]=1,R[9]=R[161]=0,P[9]=P[161]=0,q[9]=q[161]=1,k[9]=k[161]=0,G[9]=G[161]=1,b[136]=0,I[136]=1,N[136]=1,C[136]=0,S[136]=1,M[136]=0,T[136]=-1,O[136]=0,_[136]=1,L[136]=-1,R[136]=0,P[136]=0,q[136]=0,k[136]=-1,G[136]=0,A[136]=0,D[136]=-1,F[136]=1,v[136]=1,y[136]=0,m[136]=0,x[136]=1,E[136]=0,w[136]=1,b[34]=0,I[34]=-1,N[34]=0,C[34]=0,S[34]=-1,M[34]=1,T[34]=1,O[34]=0,_[34]=0,L[34]=1,R[34]=0,P[34]=1,q[34]=0,k[34]=1,G[34]=1,A[34]=0,D[34]=1,F[34]=0,v[34]=-1,y[34]=0,m[34]=1,x[34]=-1,E[34]=0,w[34]=0,b[35]=0,I[35]=1,N[35]=1,C[35]=0,S[35]=-1,M[35]=1,T[35]=1,O[35]=0,_[35]=0,L[35]=-1,R[35]=0,P[35]=0,q[35]=0,k[35]=-1,G[35]=0,A[35]=0,D[35]=1,F[35]=0,v[35]=-1,y[35]=0,m[35]=1,x[35]=1,E[35]=0,w[35]=1,b[153]=0,I[153]=1,N[153]=1,L[153]=-1;R[153]=0,P[153]=0,q[153]=0,k[153]=-1,G[153]=0,x[153]=1,E[153]=0,w[153]=1,C[102]=0,S[102]=-1,M[102]=1,T[102]=1,O[102]=0,_[102]=0,A[102]=0,D[102]=1,F[102]=0,v[102]=-1,y[102]=0,m[102]=1,b[155]=0,I[155]=-1,N[155]=0,L[155]=1,R[155]=0,P[155]=1,q[155]=0,k[155]=1,G[155]=1,x[155]=-1,E[155]=0,w[155]=0,C[103]=0,S[103]=1,M[103]=0,T[103]=-1,O[103]=0,_[103]=1,A[103]=0,D[103]=-1,F[103]=1,v[103]=1,y[103]=0,m[103]=0,b[152]=0,I[152]=1,N[152]=1,T[152]=-1,O[152]=0,_[152]=1,L[152]=-1,R[152]=0,P[152]=0,q[152]=0,k[152]=-1,G[152]=0,A[152]=0,D[152]=-1,F[152]=1,x[152]=1,E[152]=0,w[152]=1,b[156]=0,I[156]=-1,N[156]=1,T[156]=1,O[156]=0,_[156]=1,L[156]=-1,R[156]=0,P[156]=0,q[156]=0,k[156]=-1,G[156]=0,A[156]=0,D[156]=1,F[156]=1,x[156]=-1,E[156]=0,w[156]=1,b[137]=0,I[137]=1,N[137]=1,C[137]=0,S[137]=1,M[137]=0,L[137]=-1,R[137]=0,P[137]=0,q[137]=0,k[137]=-1,G[137]=0,v[137]=1,y[137]=0,m[137]=0,x[137]=1,E[137]=0,w[137]=1,b[139]=0,I[139]=1,N[139]=1,C[139]=0,S[139]=-1,M[139]=0,L[139]=1,R[139]=0,P[139]=0,q[139]=0,k[139]=1,G[139]=0,v[139]=-1,y[139]=0,m[139]=0,x[139]=1,E[139]=0,w[139]=1,b[98]=0,I[98]=-1,N[98]=0,C[98]=0,S[98]=-1,M[98]=1,T[98]=1,O[98]=0,_[98]=0,L[98]=1,R[98]=0,P[98]=1,A[98]=0,D[98]=1,F[98]=0,v[98]=-1,y[98]=0,m[98]=1,b[99]=0,I[99]=1,N[99]=0,C[99]=0,S[99]=-1,M[99]=1,T[99]=1,O[99]=0,_[99]=0,L[99]=-1,R[99]=0,P[99]=1,A[99]=0,D[99]=-1,F[99]=0,v[99]=1,y[99]=0,m[99]=1,C[38]=0,S[38]=-1,M[38]=1,T[38]=1,O[38]=0,_[38]=0,q[38]=0,k[38]=1,G[38]=1,A[38]=0,D[38]=1,F[38]=0,v[38]=-1,y[38]=0,m[38]=1,x[38]=-1,E[38]=0,w[38]=0,C[39]=0,S[39]=1,M[39]=1,T[39]=-1,O[39]=0,_[39]=0,q[39]=0,k[39]=-1,G[39]=1,A[39]=0,D[39]=1,F[39]=0,v[39]=-1,y[39]=0,m[39]=1,x[39]=1,E[39]=0,w[39]=0;var j=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},B=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},z=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},V=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},X=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Y=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},U=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},W=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},H=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},J=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Z=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},K=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Q=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},$=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},tt=function(){return[[0,0],[0,1],[1,1],[1,0]]},et=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},nt=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},it=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},rt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},ot=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},st=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},at=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},ut=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},lt=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},ct=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},ht=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},ft=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},pt=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},dt=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},gt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},vt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},yt=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},mt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},xt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Et=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},wt=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},bt=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},It=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Nt=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ct=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},St=[],Mt=[],Lt=[],Rt=[],Pt=[],Tt=[],Ot=[],_t=[];Rt[1]=Pt[1]=18,Rt[169]=Pt[169]=18,Lt[4]=Mt[4]=12,Lt[166]=Mt[166]=12,St[16]=_t[16]=4,St[154]=_t[154]=4,Tt[64]=Ot[64]=22,Tt[106]=Ot[106]=22,Lt[2]=Tt[2]=17,Rt[2]=Pt[2]=18,Lt[168]=Tt[168]=17,Rt[168]=Pt[168]=18,St[8]=Rt[8]=9,Mt[8]=Lt[8]=12,St[162]=Rt[162]=9,Mt[162]=Lt[162]=12,St[32]=_t[32]=4,Mt[32]=Ot[32]=1,St[138]=_t[138]=4,Mt[138]=Ot[138]=1,Pt[128]=_t[128]=21,Tt[128]=Ot[128]=22,Pt[42]=_t[42]=21,Tt[42]=Ot[42]=22,Mt[5]=Pt[5]=14,Mt[165]=Pt[165]=14,Lt[20]=_t[20]=6,Lt[150]=_t[150]=6,St[80]=Tt[80]=11,St[90]=Tt[90]=11,Rt[65]=Ot[65]=3,Rt[105]=Ot[105]=3,St[160]=Tt[160]=11,Mt[160]=Pt[160]=14,St[10]=Tt[10]=11,Mt[10]=Pt[10]=14,Lt[130]=_t[130]=6,Rt[130]=Ot[130]=3,Lt[40]=_t[40]=6,Rt[40]=Ot[40]=3,Mt[101]=Ot[101]=1,Mt[69]=Ot[69]=1,Pt[149]=_t[149]=21,Pt[21]=_t[21]=21,Lt[86]=Tt[86]=17,Lt[84]=Tt[84]=17,St[89]=Rt[89]=9,St[81]=Rt[81]=9,St[96]=Ot[96]=0,Mt[96]=Tt[96]=15,St[74]=Ot[74]=0,Mt[74]=Tt[74]=15,St[24]=Lt[24]=8,Rt[24]=_t[24]=7,St[146]=Lt[146]=8,Rt[146]=_t[146]=7,Mt[6]=Tt[6]=15,Lt[6]=Pt[6]=16,Mt[164]=Tt[164]=15,Lt[164]=Pt[164]=16,Rt[129]=_t[129]=7,Pt[129]=Ot[129]=20,Rt[41]=_t[41]=7,Pt[41]=Ot[41]=20,Lt[66]=Ot[66]=2,Rt[66]=Tt[66]=19,Lt[104]=Ot[104]=2,Rt[104]=Tt[104]=19,St[144]=Pt[144]=10,Tt[144]=_t[144]=23,St[26]=Pt[26]=10,Tt[26]=_t[26]=23,Mt[36]=_t[36]=5,Lt[36]=Ot[36]=2,Mt[134]=_t[134]=5,Lt[134]=Ot[134]=2,St[9]=Pt[9]=10,Mt[9]=Rt[9]=13,St[161]=Pt[161]=10,Mt[161]=Rt[161]=13,Mt[37]=_t[37]=5,Pt[37]=Ot[37]=20,Mt[133]=_t[133]=5,Pt[133]=Ot[133]=20,Lt[148]=Pt[148]=16,Tt[148]=_t[148]=23,Lt[22]=Pt[22]=16,Tt[22]=_t[22]=23,St[82]=Lt[82]=8,Rt[82]=Tt[82]=19,St[88]=Lt[88]=8,Rt[88]=Tt[88]=19,St[73]=Ot[73]=0,Mt[73]=Rt[73]=13,St[97]=Ot[97]=0,Mt[97]=Rt[97]=13,St[145]=Rt[145]=9,Pt[145]=_t[145]=21,St[25]=Rt[25]=9,Pt[25]=_t[25]=21,Mt[70]=Ot[70]=1,Lt[70]=Tt[70]=17,Mt[100]=Ot[100]=1,Lt[100]=Tt[100]=17,St[34]=Rt[34]=9,Mt[34]=Lt[34]=12,Pt[34]=_t[34]=21,Tt[34]=Ot[34]=22,St[136]=_t[136]=4,Mt[136]=Ot[136]=1,Lt[136]=Tt[136]=17,Rt[136]=Pt[136]=18,St[35]=_t[35]=4,Mt[35]=Lt[35]=12,Rt[35]=Pt[35]=18,Tt[35]=Ot[35]=22,St[153]=_t[153]=4,Rt[153]=Pt[153]=18,Mt[102]=Lt[102]=12,Tt[102]=Ot[102]=22,St[155]=Rt[155]=9,Pt[155]=_t[155]=23,Mt[103]=Ot[103]=1,Lt[103]=Tt[103]=17,St[152]=_t[152]=4,Lt[152]=Tt[152]=17,Rt[152]=Pt[152]=18,St[156]=Lt[156]=8,Rt[156]=Pt[156]=18,Tt[156]=_t[156]=23,St[137]=_t[137]=4,Mt[137]=Ot[137]=1,Rt[137]=Pt[137]=18,St[139]=_t[139]=4,Mt[139]=Rt[139]=13,Pt[139]=Ot[139]=20,St[98]=Rt[98]=9,Mt[98]=Lt[98]=12,Tt[98]=Ot[98]=22,St[99]=Ot[99]=0,Mt[99]=Lt[99]=12,Rt[99]=Tt[99]=19,Mt[38]=Lt[38]=12,Pt[38]=_t[38]=21,Tt[38]=Ot[38]=22,Mt[39]=_t[39]=5,Lt[39]=Pt[39]=16,Tt[39]=Ot[39]=22;var At=[];return At[1]=At[169]=j,At[4]=At[166]=B,At[16]=At[154]=z,At[64]=At[106]=V,At[168]=At[2]=X,At[162]=At[8]=Y,At[138]=At[32]=U,At[42]=At[128]=W,At[5]=At[165]=H,At[20]=At[150]=J,At[80]=At[90]=Z,At[65]=At[105]=K,At[160]=At[10]=Q,At[130]=At[40]=$,At[85]=tt,At[101]=At[69]=et,At[149]=At[21]=nt,At[86]=At[84]=it,At[89]=At[81]=rt,At[96]=At[74]=ot,At[24]=At[146]=st,At[6]=At[164]=at,At[129]=At[41]=ut,At[66]=At[104]=lt,At[144]=At[26]=ct,At[36]=At[134]=ht,At[9]=At[161]=ft,At[37]=At[133]=pt,At[148]=At[22]=dt,At[82]=At[88]=gt,At[73]=At[97]=vt,At[145]=At[25]=yt,At[70]=At[100]=mt,At[34]=function(t){return[W(t),Y(t)]},At[35]=xt,At[136]=function(t){return[U(t),X(t)]},At[153]=function(t){return[z(t),j(t)]},At[102]=function(t){return[B(t),V(t)]},At[155]=Et,At[103]=wt,At[152]=function(t){return[z(t),X(t)]},At[156]=bt,At[137]=function(t){return[U(t),j(t)]},At[139]=It,At[98]=function(t){return[Y(t),V(t)]},At[99]=Nt,At[38]=function(t){return[B(t),W(t)]},At[39]=Ct,t})},{}],353:[function(e,n,i){!function(e,i){"function"==typeof t&&t.amd?t([],function(){return{isoContours:i()}}):"object"==typeof n&&n.exports?n.exports={isoContours:i()}:e.MarchingSquaresJS={isoContours:i(),isoBands:e.MarchingSquaresJS?e.MarchingSquaresJS.isoBands:null}}(this,function(){function t(t,e,i){i=i||{};for(var r=Object.keys(l),o=0;o=n?8:0,u|=c>=n?4:0,u|=h>=n?2:0,u|=f>=n?1:0;var p=!1;if(5===u||10===u){var d=(l+c+h+f)/4;5===u&&d=0;p--)if(Math.abs(e[p][0][0]-h)<=1e-7&&Math.abs(e[p][0][1]-f)<=1e-7){for(var d=l.path.length-2;d>=0;--d)e[p].unshift(l.path[d]);c=!0;break}c||(e[n++]=l.path)}})}),e}function u(t,e,n){var i,r,a,u=t.length,l=[],c=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],h=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],f=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"],p=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],d=(t[e][n],t[e][n]),g=d.cval,a=f[g],v=s(d,a);l.push([n+v[0],e+v[1]]),a=p[g],v=s(d,a),l.push([n+v[0],e+v[1]]),o(d);for(var y=n+c[g],m=e+h[g],x=g;y>=0&&m>=0&&m=0&&l<=1&&(p.onLine1=!0),c>=0&&c<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}var r=t("@turf/helpers").point;e.exports=function(t){var e,n,o={type:"FeatureCollection",features:[]};if(n="Feature"===t.type?t.geometry:t,"LineString"===n.type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;nd&&v.push(r(t,e,d,l).geometry.coordinates),s(v,f)}},{"@turf/circle":369,"@turf/destination":374,"@turf/helpers":377}],369:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"@turf/destination":370,"@turf/helpers":373,dup:167}],370:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":371,"@turf/invariant":372,dup:5}],371:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],372:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],373:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],374:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":375,"@turf/invariant":376,dup:5}],375:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],376:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],377:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],378:[function(t,e,n){function i(t,e,n,i){var s=o(t,n);if(s<=e)return i(t);for(var a=Math.floor(s/e)+1,u=0;u=p&&d===u.length-1);d++){if(p>e&&0===l.length){if(!(c=e-p))return l.push(u[d]),s(l);h=i(u[d],u[d-1])-180,f=o(u[d],c,h,a),l.push(f.geometry.coordinates)}if(p>=n)return(c=n-p)?(h=i(u[d],u[d-1])-180,f=o(u[d],c,h,a),l.push(f.geometry.coordinates),s(l)):(l.push(u[d]),s(l));if(p>=e&&l.push(u[d]),d===u.length-1)return s(l);p+=r(u[d],u[d+1],a)}return s(u[u.length-1])}},{"@turf/bearing":386,"@turf/destination":388,"@turf/distance":391,"@turf/helpers":394}],386:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":387,dup:3}],387:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],388:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":389,"@turf/invariant":390,dup:5}],389:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],390:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],391:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":392,"@turf/invariant":393,dup:8}],392:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],393:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],394:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],395:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],396:[function(t,e,n){arguments[4][380][0].apply(n,arguments)},{"@turf/distance":397,"@turf/meta":400,dup:380}],397:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":398,"@turf/invariant":399,dup:8}],398:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],399:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],400:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],401:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":403,"@turf/invariant":404,"@turf/line-segment":405,"@turf/meta":409,dup:42,"geojson-rbush":410}],402:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":409,dup:43}],403:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],404:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],405:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":406,"@turf/invariant":407,"@turf/meta":408,dup:46}],406:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],407:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],408:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],409:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],410:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":402,"@turf/helpers":403,"@turf/meta":409,dup:51,rbush:412}],411:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],412:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:411}],413:[function(t,e,n){function i(t,e,n){var i=[],o=f(e,n),s=a(t),l=[];return s.forEach(function(t,e){if(e!==s.length-1){var n=r(t,s[e+1],o);if(i.push(n),e>0){var a=i[e-1],c=u(n,a);!1!==c&&(a[1]=c,n[0]=c),l.push(a[0]),e===s.length-2&&(l.push(n[0]),l.push(n[1]))}2===s.length&&(l.push(n[0]),l.push(n[1]))}}),c(l,t.properties)}function r(t,e,n){var i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),r=t[0]+n*(e[1]-t[1])/i,o=e[0]+n*(e[1]-t[1])/i;return[[r,t[1]+n*(t[0]-e[0])/i],[o,e[1]+n*(t[0]-e[0])/i]]}var o=t("@turf/meta"),s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("./intersection"),l=o.flattenEach,c=s.lineString,h=s.multiLineString,f=s.distanceToDegrees;e.exports=function(t,e,n){if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");var r="Feature"===t.type?t.geometry.type:t.type,o=t.properties;switch(r){case"LineString":return i(t,e,n);case"MultiLineString":var s=[];return l(t,function(t){s.push(i(t,e,n).geometry.coordinates)}),h(s,o);default:throw new Error("geometry "+r+" is not supported")}}},{"./intersection":414,"@turf/helpers":415,"@turf/invariant":416,"@turf/meta":417}],414:[function(t,e,n){function i(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function r(t,e){return t[0]*e[1]-e[0]*t[1]}function o(t,e){return[t[0]+e[0],t[1]+e[1]]}function s(t,e){return[t[0]-e[0],t[1]-e[1]]}function a(t,e){return[t*e[0],t*e[1]]}function u(t,e){var n=t[0],u=i(t),l=e[0],c=i(e),h=r(u,c);return o(n,a(r(s(l,n),c)/h,u))}function l(t,e){return 0===r(i(t),i(e))}function c(t,e){return!l(t,e)&&u(t,e)}e.exports=c},{}],415:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],416:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],417:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],418:[function(t,e,n){arguments[4][99][0].apply(n,arguments)},{"@turf/helpers":420,"@turf/invariant":421,"@turf/line-segment":422,"@turf/meta":426,"deep-equal":427,dup:99,"geojson-rbush":430}],419:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":426,dup:43}],420:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],421:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],422:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":423,"@turf/invariant":424,"@turf/meta":425,dup:46}],423:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],424:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],425:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],426:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],427:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{"./lib/is_arguments.js":428,"./lib/keys.js":429,dup:81}],428:[function(t,e,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],429:[function(t,e,n){arguments[4][83][0].apply(n,arguments)},{dup:83}],430:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":419,"@turf/helpers":420,"@turf/meta":426,dup:51,rbush:432}],431:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],432:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:431}],433:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":434,"@turf/invariant":435,"@turf/meta":436,dup:46}],434:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],435:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],436:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],437:[function(t,e,n){arguments[4][385][0].apply(n,arguments)},{"@turf/bearing":438,"@turf/destination":440,"@turf/distance":443,"@turf/helpers":446,dup:385}],438:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":439,dup:3}],439:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],440:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":441,"@turf/invariant":442,dup:5}],441:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],442:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],443:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":444,"@turf/invariant":445,dup:8}],444:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],445:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],446:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],447:[function(t,e,n){var i=t("@turf/helpers").lineString,r=t("@turf/point-on-line");e.exports=function(t,e,n){var o;if("Feature"===n.type)o=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");o=n.coordinates}var s,a=r(n,t),u=r(n,e);s=a.properties.index<=u.properties.index?[a,u]:[u,a];for(var l=[s[0].geometry.coordinates],c=s[0].properties.index+1;c0&&(b=w.features[0],b.properties.dist=s(e,b,n),b.properties.location=a+s(d,b,n)),d.properties.dist1&&n.push(v(c)),E(n)}function o(t,e){var n,i;if(!e.features)throw new Error(" must contain features");return 1===e.features.length?e.features[0]:(m(e,function(e){var r=f(e,t),o=r.properties.dist;void 0===n?(i=e,n=o):o must be LineString");var n=y(e);if("FeatureCollection"===n)throw new Error(" cannot be a FeatureCollection");switch(c(e,6,3,!0),n){case"Point":return r(t,e);case"MultiPoint":return i(t,l(e));case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return i(t,d(t,e));default:throw new Error(" geometry type is not supported")}}},{"@turf/flatten":475,"@turf/helpers":478,"@turf/invariant":479,"@turf/line-intersect":480,"@turf/line-segment":492,"@turf/meta":496,"@turf/point-on-line":497,"@turf/truncate":521,"geojson-rbush":523}],474:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":496,dup:43}],475:[function(t,e,n){arguments[4][267][0].apply(n,arguments)},{"@turf/helpers":476,"@turf/meta":477,dup:267}],476:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],477:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],478:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],479:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],480:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":482,"@turf/invariant":483,"@turf/line-segment":484,"@turf/meta":488,dup:42,"geojson-rbush":489}],481:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":488,dup:43}],482:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],483:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],484:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":485,"@turf/invariant":486,"@turf/meta":487,dup:46}],485:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],486:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],487:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],488:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],489:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":481,"@turf/helpers":482,"@turf/meta":488,dup:51,rbush:491}],490:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],491:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:490}],492:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":493,"@turf/invariant":494,"@turf/meta":495,dup:46}],493:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],494:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],495:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],496:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],497:[function(t,e,n){arguments[4][449][0].apply(n,arguments)},{"@turf/bearing":498,"@turf/destination":500,"@turf/distance":503,"@turf/helpers":506,"@turf/invariant":507,"@turf/line-intersect":508,"@turf/meta":520,dup:449}],498:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":499,dup:3}],499:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],500:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":501,"@turf/invariant":502,dup:5}],501:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],502:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],503:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":504,"@turf/invariant":505,dup:8}],504:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],505:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],506:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],507:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],508:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":510,"@turf/invariant":511,"@turf/line-segment":512,"@turf/meta":516,dup:42,"geojson-rbush":517}],509:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":516,dup:43}],510:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],511:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],512:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":513,"@turf/invariant":514,"@turf/meta":515,dup:46}],513:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],514:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],515:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],516:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],517:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":509,"@turf/helpers":510,"@turf/meta":516,dup:51,rbush:519}],518:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],519:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:518}],520:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],521:[function(t,e,n){function i(t,e,n){t.length>n&&t.splice(n,t.length);for(var i=0;i is required");if("number"!=typeof e)throw new Error(" must be a number");if("number"!=typeof n)throw new Error(" must be a number");!1!==o&&void 0!==o||(t=JSON.parse(JSON.stringify(t)));var s=Math.pow(10,e);return r(t,function(t){i(t,s,n)}),t}},{"@turf/meta":522}],522:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],523:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":474,"@turf/helpers":478,"@turf/meta":496,dup:51,rbush:525}],524:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],525:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:524}],526:[function(t,e,n){function i(t,e,n,i){e=e||t.properties||{};var l=u(t),h=r(t);if(!l.length)throw new Error("line must contain coordinates");switch(h){case"LineString":return n&&(l=o(l)),c([l],e);case"MultiLineString":var p=[],d=0;return l.forEach(function(t){if(n&&(t=o(t)),i){var e=s(a(f(t)));e>d?(p.unshift(t),d=e):p.push(t)}else p.push(t)}),c(p,e);default:throw new Error("geometry type "+h+" is not supported")}}function r(t){return t.geometry?t.geometry.type:t.type}function o(t){var e=t[0],n=e[0],i=e[1],r=t[t.length-1],o=r[0],s=r[1];return n===o&&i===s||t.push(e),t}function s(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.abs(e-i)*Math.abs(n-r)}var a=t("@turf/bbox"),u=t("@turf/invariant").getCoords,l=t("@turf/helpers"),c=l.polygon,h=l.multiPolygon,f=l.lineString;e.exports=function(t,e,n,o){if(!t)throw new Error("lines is required");switch(n=void 0===n||n,o=void 0===o||o,r(t)){case"FeatureCollection":case"GeometryCollection":var s=[];return(t.features?t.features:t.geometries).forEach(function(t){s.push(u(i(t,{},n,o)))}),h(s,e)}return i(t,e,n,o)}},{"@turf/bbox":527,"@turf/helpers":529,"@turf/invariant":530}],527:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":528,dup:22}],528:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],529:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],530:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],531:[function(t,e,n){function i(t,e,n){var i=[];return i.push(t.geometry.coordinates[0]),p(e,function(t){i.push(t.geometry.coordinates[0])}),p(n,function(t){i.push(t.geometry.coordinates[0])}),h.polygon(i)}function r(t){var e=[],n=[];return p(t,function(t){var i=t.geometry.coordinates,r=i[0],o=i.slice(1);e.push(h.polygon([r])),o.forEach(function(t){n.push(h.polygon([t]))})}),[h.featureCollection(e),h.featureCollection(n)]}function o(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],n=t&&t.geometry.coordinates||e;return h.polygon(n)}function s(t){if(t.features.length<=1)return t;var e=u(t),n=[],i={};return p(t,function(t,r){if(i[r])return!0;for(e.remove({index:r},a),i[r]=!0;;){var o=f(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var u=s.map(function(t){return i[t.index]=!0,e.remove({index:t.index},a),t.geojson});u.push(t),t=c.apply(this,u)}if(0===s.length)break}n.push(t)}),h.featureCollection(n)}function a(t,e){return t.index===e.index}function u(t){var e=l(),n=[];return p(t,function(t,e){var i=f(t);n.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],geojson:t,index:e})}),e.load(n),e}var l=t("rbush"),c=t("@turf/union"),h=t("@turf/helpers"),f=t("@turf/bbox"),p=t("@turf/meta").flattenEach;e.exports=function(t,e){var n=o(e),a=r(t),u=a[0],l=a[1];return u=s(u),l=s(l),i(n,u,l)}},{"@turf/bbox":532,"@turf/helpers":534,"@turf/meta":535,"@turf/union":536,rbush:539}],532:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":533,dup:22}],533:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],534:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],535:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],536:[function(t,e,n){arguments[4][212][0].apply(n,arguments)},{dup:212,jsts:537}],537:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],538:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],539:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:538}],540:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],541:[function(t,e,n){var i=t("@turf/bearing"),r=t("@turf/destination"),o=t("@turf/distance");e.exports=function(t,e){var n=o(t,e,"miles"),s=i(t,e);return r(t,n/2,s,"miles")}},{"@turf/bearing":542,"@turf/destination":544,"@turf/distance":547}],542:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":543,dup:3}],543:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],544:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":545,"@turf/invariant":546,dup:5}],545:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],546:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],547:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":548,"@turf/invariant":549,dup:8}],548:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],549:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],550:[function(t,e,n){var i=t("@turf/distance");e.exports=function(t,e){for(var n,r=1/0,o=0;o0&&(o(e,c,a)||(a=c)),n>0&&i<=0&&(r(e,c,u)||(u=c)),n=i}return[a,u]}function r(t,e,n){return s(t,e,n)>=0}function o(t,e,n){return s(t,e,n)<=0}function s(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function a(t){return t.geometry?t.geometry.type:t.type}var u=t("@turf/invariant").getCoords,l=t("@turf/helpers"),c=l.featureCollection;e.exports=function(t,e){var n,r,o,h=u(t),f=u(e);switch(a(e)){case"Polygon":r=0,o=0,n=s(f[0][0],f[0][1],h);var p=i(f[0],h,n,void 0,r,o);r=p[0],o=p[1];break;case"MultiPolygon":r=0,o=0,n=s(f[0][0][0],f[0][0][1],h),f.forEach(function(t){var e=i(t[0],h,n,void 0,r,o);r=e[0],o=e[1]})}return c([l.point(r),l.point(o)])}},{"@turf/helpers":605,"@turf/invariant":606}],605:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],606:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],607:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{"@turf/helpers":608,"@turf/invariant":609,dup:54}],608:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],609:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],610:[function(t,e,n){var i=t("polygonize");e.exports=function(t){return i(t)}},{polygonize:622}], 611:[function(t,e,n){var i=t("@turf/helpers").polygon;e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],o=[t[2],t[1]];return i([[e,o,r,n,e]])}},{"@turf/helpers":614}],612:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function r(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var o=t("@turf/invariant"),s=o.getCoord,a=o.getCoords;e.exports=function(t,e,n){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=s(t),u=a(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===r(o,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h "+this.to.id+" }"}},{key:"toLineString",value:function(){return s([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return u(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}();e.exports=l},{"./util":623,"@turf/helpers":614}],619:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;nt.edges[e].from.coordinates[1]&&(e=i),e},0),n=(0===e?this.length:e)-1,i=(e+1)%this.length,r=s(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[i].from.coordinates);return 0===r?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:r>0}},{key:"toMultiPoint",value:function(){return h(this.edges.map(function(t){return t.from.coordinates}))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=f([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=d(this.toPolygon())}},{key:"inside",value:function(t){return g(t,this.toPolygon())}},{key:"length",get:function(){return this.edges.length}}],[{key:"findEdgeRingContaining",value:function(t,e){var n=t.getEnvelope(),i=void 0,r=void 0;return e.forEach(function(e){var o=e.getEnvelope();if(r&&(i=r.getEnvelope()),!a(o,n)&&u(o,n)){var s=t.map(function(t){return t.from.coordinates}).find(function(t){return!e.some(function(e){return l(t,e.from.coordinates)})});s&&e.inside(p(s))&&(r&&!u(i,o)||(r=e))}}),r}}]),t}();e.exports=v},{"./util":623,"@turf/envelope":613,"@turf/helpers":614,"@turf/inside":615}],620:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var o=function(){function t(t,e){for(var n=0;n=0;--o){var s=n[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),i||(i=u)))}r&&(r.next=i)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do{i.label=e,i=i.next}while(!n.isEqual(i));e++}}),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t;do{!function(){var i=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++i}),i>1&&e.push(n.from),n=n.next}()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new u;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e=this;t.getOuterEdges().forEach(function(t){return e.removeEdge(t)}),t.innerEdges.forEach(function(t){return e.removeEdge(t)}),delete this.nodes[t.id]}},{key:"removeEdge",value:function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()}}]),t}();e.exports=d},{"./Edge":618,"./EdgeRing":619,"./Node":621,"@turf/invariant":616,"@turf/meta":617}],621:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n=0&&r.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&r.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]==0&&r.coordinates[0]-t.coordinates[0]==0)return i.coordinates[1]-t.coordinates[1]>=0||r.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-r.coordinates[1]:r.coordinates[1]-i.coordinates[1];var o=s(t.coordinates,i.coordinates,r.coordinates);return o<0?1:o>0?-1:Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2)-(Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}]),t}();e.exports=a},{"./util":623}],622:[function(t,e,n){"use strict";var i=t("./Graph"),r=t("./EdgeRing"),o=t("@turf/helpers"),s=o.featureCollection;e.exports=function(t){var e=i.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],o=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):o.push(t)}),n.forEach(function(t){r.findEdgeRingContaining(t,o)&&o.push(t)}),s(o.map(function(t){return t.toPolygon()}))}},{"./EdgeRing":619,"./Graph":620,"@turf/helpers":614}],623:[function(t,e,n){"use strict";function i(t,e,n){var i=e[0]-t[0],r=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(i*s-o*r)}function r(t,e){var n=t.geometry.coordinates.map(function(t){return t[0]}),i=t.geometry.coordinates.map(function(t){return t[1]}),r=e.geometry.coordinates.map(function(t){return t[0]}),o=e.geometry.coordinates.map(function(t){return t[1]});return Math.max(null,n)===Math.max(null,r)&&Math.max(null,i)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,r)&&Math.min(null,i)===Math.min(null,o)}function o(t,e){return e.geometry.coordinates[0].every(function(e){return a(l(e),t)})}function s(t,e){return t[0]===e[0]&&t[1]===e[1]}var a=t("@turf/inside"),u=t("@turf/helpers"),l=u.point;e.exports={orientationIndex:i,envelopeIsEqual:r,envelopeContains:o,coordinatesEqual:s}},{"@turf/helpers":614,"@turf/inside":615}],624:[function(t,e,n){var i=t("geojson-random");e.exports=function(t,e,n){switch(n=n||{},e=e||1,t){case"point":case"points":case void 0:return i.point(e,n.bbox);case"polygon":case"polygons":return i.polygon(e,n.num_vertices,n.max_radial_length,n.bbox);default:throw new Error("Unknown type given: valid options are points and polygons")}}},{"geojson-random":625}],625:[function(t,e,n){function r(t){return t?c(t):[a(),u()]}function o(t){return function(e,n){return[e[0]+t[0],e[1]+t[1]]}}function s(){return Math.random()-.5}function a(){return 360*s()}function u(){return 180*s()}function l(t){return{type:"Point",coordinates:t||[a(),u()]}}function c(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}function h(t){return{type:"Polygon",coordinates:t}}function f(t){return{type:"Feature",geometry:t,properties:{}}}function p(t){return{type:"FeatureCollection",features:t}}e.exports=function(){throw new Error("call .point() or .polygon() instead")},e.exports.position=r,e.exports.point=function(t,e){var n=[];for(i=0;i0?t+n[e-1]:t}function u(t,e){t=2*t*Math.PI/d[d.length-1];var i=Math.random();c.push([i*n*Math.sin(t),i*n*Math.cos(t)])}"number"!=typeof e&&(e=10),"number"!=typeof n&&(n=10);var l=[];for(i=0;i is required");if("boolean"!=typeof e)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1!==n&&void 0!==n||(t=JSON.parse(JSON.stringify(t)));var r=[];switch(t.type){case"GeometryCollection":return c(t,function(t){i(t,e)}),t;case"FeatureCollection":return h(t,function(t){h(i(t,e),function(t){r.push(t)})}),l(r)}return i(t,e)}},{"@turf/helpers":627,"@turf/invariant":628,"@turf/meta":629,"turf-is-clockwise":630}],627:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],628:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],629:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],630:[function(t,e,n){arguments[4][254][0].apply(n,arguments)},{dup:254}],631:[function(t,e,n){var i=t("@turf/invariant").getCoord,r=t("geodesy").LatLonSpherical;e.exports=function(t,e,n){if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");var o,s=i(t),a=i(e),u=new r(s[1],s[0]),l=new r(a[1],a[0]);return o=n?l.rhumbBearingTo(u):u.rhumbBearingTo(l),o>180?-(360-o):o}},{"@turf/invariant":632,geodesy:639}],632:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],633:[function(t,e,n){"use strict";var i={};i.parseDMS=function(t){if("number"==typeof t&&isFinite(t))return Number(t);var e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;var n;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)},i.separator="",i.toDMS=function(t,e,n){if(isNaN(t))return null;if(void 0===e&&(e="dms"),void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="dms",n=0}t=Math.abs(t);var r,o,s,a;switch(e){default:case"d":case"deg":o=t.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":var u=(60*t).toFixed(n);o=Math.floor(u/60),s=(u%60).toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),s<10&&(s="0"+s),r=o+"°"+i.separator+s+"′";break;case"dms":case"deg+min+sec":var l=(3600*t).toFixed(n);o=Math.floor(l/3600),s=Math.floor(l/60)%60,a=(l%60).toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),s<10&&(s="0"+s),a<10&&(a="0"+a),r=o+"°"+i.separator+s+"′"+i.separator+a+"″"}return r},i.toLat=function(t,e,n){var r=i.toDMS(t,e,n);return null===r?"–":r.slice(1)+i.separator+(t<0?"S":"N")},i.toLon=function(t,e,n){var r=i.toDMS(t,e,n);return null===r?"–":r+i.separator+(t<0?"W":"E")},i.toBrng=function(t,e,n){t=(Number(t)+360)%360;var r=i.toDMS(t,e,n);return null===r?"–":r.replace("360","0")},i.compassPoint=function(t,e){void 0===e&&(e=3),t=(t%360+360)%360;var n;switch(e){case 1:switch(Math.round(4*t/360)%4){case 0:n="N";break;case 1:n="E";break;case 2:n="S";break;case 3:n="W"}break;case 2:switch(Math.round(8*t/360)%8){case 0:n="N";break;case 1:n="NE";break;case 2:n="E";break;case 3:n="SE";break;case 4:n="S";break;case 5:n="SW";break;case 6:n="W";break;case 7:n="NW"}break;case 3:switch(Math.round(16*t/360)%16){case 0:n="N";break;case 1:n="NNE";break;case 2:n="NE";break;case 3:n="ENE";break;case 4:n="E";break;case 5:n="ESE";break;case 6:n="SE";break;case 7:n="SSE";break;case 8:n="S";break;case 9:n="SSW";break;case 10:n="SW";break;case 11:n="WSW";break;case 12:n="W";break;case 13:n="WNW";break;case 14:n="NW";break;case 15:n="NNW"}break;default:throw new RangeError("Precision must be between 1 and 3")}return n},void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}),void 0!==e&&e.exports&&(e.exports=i)},{}],634:[function(t,e,n){"use strict";function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);void 0===n&&(n=i.datum.WGS84),this.lat=Number(t),this.lon=Number(e),this.datum=n}if(void 0!==e&&e.exports)var r=t("./vector3d.js");if(void 0!==e&&e.exports)var o=t("./dms.js");i.ellipsoid={WGS84:{a:6378137,b:6356752.31425,f:1/298.257223563},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Intl1924:{a:6378388,b:6356911.946,f:1/297},Bessel1841:{a:6377397.155,b:6356078.963,f:1/299.152815351}},i.datum={WGS84:{ellipsoid:i.ellipsoid.WGS84,transform:{tx:0,ty:0,tz:0,rx:0,ry:0,rz:0,s:0}},ITRF90:{ellipsoid:i.ellipsoid.GRS80,transform:{tx:-.06,ty:.517,tz:.223,rx:-.0183,ry:3e-4,rz:-.007,s:.011}},NAD83:{ellipsoid:i.ellipsoid.GRS80,transform:{tx:1.004,ty:-1.91,tz:-.515,rx:.0267,ry:34e-5,rz:.011,s:-.0015}},OSGB36:{ellipsoid:i.ellipsoid.Airy1830,transform:{tx:-446.448,ty:125.157,tz:-542.06,rx:-.1502,ry:-.247,rz:-.8421,s:20.4894}},ED50:{ellipsoid:i.ellipsoid.Intl1924,transform:{tx:89.5,ty:93.8,tz:123.1,rx:0,ry:0,rz:.156,s:-1.2}},Irl1975:{ellipsoid:i.ellipsoid.AiryModified,transform:{tx:-482.53,ty:130.596,tz:-564.557,rx:-1.042,ry:-.214,rz:-.631,s:-8.15}},TokyoJapan:{ellipsoid:i.ellipsoid.Bessel1841,transform:{tx:148,ty:-507,tz:-685,rx:0,ry:0,rz:0,s:0}}},i.prototype.convertDatum=function(t){var e,n=this;if(n.datum==i.datum.WGS84&&(e=t.transform),t==i.datum.WGS84){e={};for(var r in n.datum.transform)n.datum.transform.hasOwnProperty(r)&&(e[r]=-n.datum.transform[r])}return void 0===e&&(n=this.convertDatum(i.datum.WGS84),e=t.transform),n.toCartesian().applyTransform(e).toLatLonE(t)},i.prototype.toCartesian=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=this.datum.ellipsoid.a,i=this.datum.ellipsoid.f,o=Math.sin(t),s=Math.cos(t),a=Math.sin(e),u=Math.cos(e),l=2*i-i*i,c=n/Math.sqrt(1-l*o*o);return new r((c+0)*s*u,(c+0)*s*a,(c*(1-l)+0)*o)},r.prototype.toLatLonE=function(t){var e=this.x,n=this.y,r=this.z,o=t.ellipsoid.a,s=t.ellipsoid.b,a=t.ellipsoid.f,u=2*a-a*a,l=u/(1-u),c=Math.sqrt(e*e+n*n),h=Math.sqrt(c*c+r*r),f=s*r/(o*c)*(1+l*s/h),p=f/Math.sqrt(1+f*f),d=p/f,g=isNaN(d)?0:Math.atan2(r+l*s*p*p*p,c-u*o*d*d*d),v=Math.atan2(n,e),y=Math.sin(g);Math.cos(g),Math.sqrt(1-u*y*y);return new i(g.toDegrees(),v.toDegrees(),t)},r.prototype.applyTransform=function(t){var e=this.x,n=this.y,i=this.z,o=t.tx,s=t.ty,a=t.tz,u=(t.rx/3600).toRadians(),l=(t.ry/3600).toRadians(),c=(t.rz/3600).toRadians(),h=t.s/1e6+1;return new r(o+e*h-n*c+i*l,s+e*c+n*h-i*u,a-e*l+n*u+i*h)},i.prototype.toString=function(t,e){return o.toLat(this.lat,t,e)+", "+o.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0!==e&&e.exports&&(e.exports=i,e.exports.Vector3d=r)},{"./dms.js":633,"./vector3d.js":642}],635:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);this.lat=Number(t),this.lon=Number(e)}if(void 0!==e&&e.exports)var r=t("./dms");i.prototype.distanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=e,r=this.lat.toRadians(),o=this.lon.toRadians(),s=t.lat.toRadians(),a=t.lon.toRadians(),u=s-r,l=a-o,c=Math.sin(u/2)*Math.sin(u/2)+Math.cos(r)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2);return n*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))},i.prototype.bearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),o=Math.sin(r)*Math.cos(n),s=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r);return(Math.atan2(o,s).toDegrees()+360)%360},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return(t.bearingTo(this)+180)%360},i.prototype.midpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),s=Math.cos(r)*Math.cos(o),a=Math.cos(r)*Math.sin(o),u=Math.sqrt((Math.cos(e)+s)*(Math.cos(e)+s)+a*a),l=Math.sin(e)+Math.sin(r),c=Math.atan2(l,u),h=n+Math.atan2(a,Math.cos(e)+s);return new i(c.toDegrees(),(h.toDegrees()+540)%360-180)},i.prototype.intermediatePointTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=this.lat.toRadians(),r=this.lon.toRadians(),o=t.lat.toRadians(),s=t.lon.toRadians(),a=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r),h=Math.sin(o),f=Math.cos(o),p=Math.sin(s),d=Math.cos(s),g=o-n,v=s-r,y=Math.sin(g/2)*Math.sin(g/2)+Math.cos(n)*Math.cos(o)*Math.sin(v/2)*Math.sin(v/2),m=2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y)),x=Math.sin((1-e)*m)/Math.sin(m),E=Math.sin(e*m)/Math.sin(m),w=x*u*c+E*f*d,b=x*u*l+E*f*p,I=x*a+E*h,N=Math.atan2(I,Math.sqrt(w*w+b*b)),C=Math.atan2(b,w);return new i(N.toDegrees(),(C.toDegrees()+540)%360-180)},i.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=Number(e).toRadians(),s=this.lat.toRadians(),a=this.lon.toRadians(),u=Math.sin(s),l=Math.cos(s),c=Math.sin(r),h=Math.cos(r),f=Math.sin(o),p=Math.cos(o),d=u*h+l*c*p,g=Math.asin(d),v=f*c*l,y=h-u*d,m=a+Math.atan2(v,y);return new i(g.toDegrees(),(m.toDegrees()+540)%360-180)},i.intersection=function(t,e,n,r){if(!(t instanceof i))throw new TypeError("p1 is not LatLon object");if(!(n instanceof i))throw new TypeError("p2 is not LatLon object");var o=t.lat.toRadians(),s=t.lon.toRadians(),a=n.lat.toRadians(),u=n.lon.toRadians(),l=Number(e).toRadians(),c=Number(r).toRadians(),h=a-o,f=u-s,p=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(o)*Math.cos(a)*Math.sin(f/2)*Math.sin(f/2)));if(0==p)return null;var d=Math.acos((Math.sin(a)-Math.sin(o)*Math.cos(p))/(Math.sin(p)*Math.cos(o)));isNaN(d)&&(d=0);var g=Math.acos((Math.sin(o)-Math.sin(a)*Math.cos(p))/(Math.sin(p)*Math.cos(a))),v=Math.sin(u-s)>0?d:2*Math.PI-d,y=Math.sin(u-s)>0?2*Math.PI-g:g,m=(l-v+Math.PI)%(2*Math.PI)-Math.PI,x=(y-c+Math.PI)%(2*Math.PI)-Math.PI;if(0==Math.sin(m)&&0==Math.sin(x))return null;if(Math.sin(m)*Math.sin(x)<0)return null;var E=Math.acos(-Math.cos(m)*Math.cos(x)+Math.sin(m)*Math.sin(x)*Math.cos(p)),w=Math.atan2(Math.sin(p)*Math.sin(m)*Math.sin(x),Math.cos(x)+Math.cos(m)*Math.cos(E)),b=Math.asin(Math.sin(o)*Math.cos(w)+Math.cos(o)*Math.sin(w)*Math.cos(l)),I=Math.atan2(Math.sin(l)*Math.sin(w)*Math.cos(o),Math.cos(w)-Math.sin(o)*Math.sin(b)),N=s+I;return new i(b.toDegrees(),(N.toDegrees()+540)%360-180)},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(e instanceof i))throw new TypeError("pathEnd is not LatLon object");n=void 0===n?6371e3:Number(n);var r=t.distanceTo(this,n)/n,o=t.bearingTo(this).toRadians(),s=t.bearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(o-s))*n},i.prototype.maxLatitude=function(t){var e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()},i.crossingParallels=function(t,e,n){var i=Number(n).toRadians(),r=t.lat.toRadians(),o=t.lon.toRadians(),s=e.lat.toRadians(),a=e.lon.toRadians(),u=a-o,l=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.sin(u),c=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.cos(u)-Math.cos(r)*Math.sin(s)*Math.cos(i),h=Math.cos(r)*Math.cos(s)*Math.sin(i)*Math.sin(u);if(h*h>l*l+c*c)return null;var f=Math.atan2(-c,l),p=Math.acos(h/Math.sqrt(l*l+c*c)),d=o+f-p,g=o+f+p;return{lon1:(d.toDegrees()+540)%360-180,lon2:(g.toDegrees()+540)%360-180}},i.prototype.rhumbDistanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=e,r=this.lat.toRadians(),o=t.lat.toRadians(),s=o-r,a=Math.abs(t.lon-this.lon).toRadians();Math.abs(a)>Math.PI&&(a=a>0?-(2*Math.PI-a):2*Math.PI+a);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),l=Math.abs(u)>1e-11?s/u:Math.cos(r);return Math.sqrt(s*s+l*l*a*a)*n},i.prototype.rhumbBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();Math.abs(r)>Math.PI&&(r=r>0?-(2*Math.PI-r):2*Math.PI+r);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4));return(Math.atan2(r,o).toDegrees()+360)%360},i.prototype.rhumbDestinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=this.lat.toRadians(),s=this.lon.toRadians(),a=Number(e).toRadians(),u=r*Math.cos(a),l=o+u;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)),h=Math.abs(c)>1e-11?u/c:Math.cos(o),f=r*Math.sin(a)/h,p=s+f;return new i(l.toDegrees(),(p.toDegrees()+540)%360-180)},i.prototype.rhumbMidpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-n)>Math.PI&&(n+=2*Math.PI);var s=(e+r)/2,a=Math.tan(Math.PI/4+e/2),u=Math.tan(Math.PI/4+r/2),l=Math.tan(Math.PI/4+s/2),c=((o-n)*Math.log(l)+n*Math.log(u)-o*Math.log(a))/Math.log(u/a);return isFinite(c)||(c=(n+o)/2),i(s.toDegrees(),(c.toDegrees()+540)%360-180)},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e),i=t[0].equals(t[t.length-1]);i||t.push(t[0]);for(var r=t.length-1,o=0,s=0;s0?f:h}break;case"bearing+endpoint":d=Math.sign(o.cross(l).dot(h)),p=d>0?h:f;break;case"endpoint+bearing": g=Math.sign(s.cross(c).dot(h)),p=g>0?h:f;break;case"endpoint+endpoint":p=l.plus(c).plus(e.toVector()).plus(r.toVector()).dot(h)>0?h:f}return p.toLatLonS()},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),o=this.toVector();return((e instanceof i?t.toVector().cross(e.toVector()):t.greatCircle(Number(e))).angleTo(o)-Math.PI/2)*r},i.prototype.nearestPointOnSegment=function(t,e){var n=null;if(this.isBetween(t,e)){var i=this.toVector(),r=t.toVector(),o=e.toVector(),s=r.cross(o),a=i.cross(s);n=s.cross(a).toLatLonS()}else{n=this.distanceTo(t)=0&&c>=0},i.prototype.enclosedBy=function(t){var e=t[0].equals(t[t.length-1]);e||t.push(t[0]);for(var n=t.length-1,i=this.toVector(),r=[],o=0;oMath.PI;return e||t.pop(),a},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e);t[0].equals(t[t.length-1])||t.push(t[0]);var i=t.length-1;console.log("n",i);for(var r=[],o=0;o0?1:-1}),void 0!==e&&e.exports&&(e.exports=i,e.exports.Vector3d=r)},{"./dms.js":633,"./vector3d.js":642}],637:[function(t,e,n){"use strict";if(void 0!==e&&e.exports)var i=t("./latlon-ellipsoidal.js");i.prototype.distanceTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).distance}catch(t){return NaN}},i.prototype.initialBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).initialBearing}catch(t){return NaN}},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).finalBearing}catch(t){return NaN}},i.prototype.destinationPoint=function(t,e){return this.direct(Number(t),Number(e)).point},i.prototype.finalBearingOn=function(t,e){return this.direct(Number(t),Number(e)).finalBearing},i.prototype.direct=function(t,e){var n,r,o,s,a,u=this.lat.toRadians(),l=this.lon.toRadians(),c=e.toRadians(),h=t,f=this.datum.ellipsoid.a,p=this.datum.ellipsoid.b,d=this.datum.ellipsoid.f,g=Math.sin(c),v=Math.cos(c),y=(1-d)*Math.tan(u),m=1/Math.sqrt(1+y*y),x=y*m,E=Math.atan2(y,v),w=m*g,b=1-w*w,I=b*(f*f-p*p)/(p*p),N=1+I/16384*(4096+I*(I*(320-175*I)-768)),C=I/1024*(256+I*(I*(74-47*I)-128)),S=h/(p*N),M=0;do{n=Math.cos(2*E+S),r=Math.sin(S),o=Math.cos(S),s=C*r*(n+C/4*(o*(2*n*n-1)-C/6*n*(4*r*r-3)*(4*n*n-3))),a=S,S=h/(p*N)+s}while(Math.abs(S-a)>1e-12&&++M<200);if(M>=200)throw new Error("Formula failed to converge");var L=x*r-m*o*v,R=Math.atan2(x*o+m*r*v,(1-d)*Math.sqrt(w*w+L*L)),P=Math.atan2(r*g,m*o-x*r*v),T=d/16*b*(4+d*(4-3*b)),O=P-(1-T)*d*w*(S+T*r*(n+T*o*(2*n*n-1))),_=(l+O+3*Math.PI)%(2*Math.PI)-Math.PI,A=Math.atan2(w,-L);return A=(A+2*Math.PI)%(2*Math.PI),{point:new i(R.toDegrees(),_.toDegrees(),this.datum),finalBearing:A.toDegrees()}},i.prototype.inverse=function(t){var e,n,i,r,o,s,a,u,l,c,h,f=this,p=t,d=f.lat.toRadians(),g=f.lon.toRadians(),v=p.lat.toRadians(),y=p.lon.toRadians(),m=this.datum.ellipsoid.a,x=this.datum.ellipsoid.b,E=this.datum.ellipsoid.f,w=y-g,b=(1-E)*Math.tan(d),I=1/Math.sqrt(1+b*b),N=b*I,C=(1-E)*Math.tan(v),S=1/Math.sqrt(1+C*C),M=C*S,L=w,R=0;do{if(e=Math.sin(L),n=Math.cos(L),i=S*e*(S*e)+(I*M-N*S*n)*(I*M-N*S*n),0==(r=Math.sqrt(i)))return 0;o=N*M+I*S*n,s=Math.atan2(r,o),a=I*S*e/r,u=1-a*a,l=o-2*N*M/u,isNaN(l)&&(l=0),c=E/16*u*(4+E*(4-3*u)),h=L,L=w+(1-c)*E*a*(s+c*r*(l+c*o*(2*l*l-1)))}while(Math.abs(L-h)>1e-12&&++R<200);if(R>=200)throw new Error("Formula failed to converge");var P=u*(m*m-x*x)/(x*x),T=1+P/16384*(4096+P*(P*(320-175*P)-768)),O=P/1024*(256+P*(P*(74-47*P)-128)),_=O*r*(l+O/4*(o*(2*l*l-1)-O/6*l*(4*r*r-3)*(4*l*l-3))),A=x*T*(s-_),D=Math.atan2(S*e,I*M-N*S*n),F=Math.atan2(I*e,-N*S+I*M*n);return D=(D+2*Math.PI)%(2*Math.PI),F=(F+2*Math.PI)%(2*Math.PI),A=Number(A.toFixed(3)),{distance:A,initialBearing:D.toDegrees(),finalBearing:F.toDegrees()}},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0!==e&&e.exports&&(e.exports=i)},{"./latlon-ellipsoidal.js":634}],638:[function(t,e,n){"use strict";function i(t,e,n,r,s,a,u){if(!(this instanceof i))return new i(t,e,n,r,s,a,u);if(void 0===u&&(u=o.datum.WGS84),!(1<=t&&t<=60))throw new Error("Invalid MGRS grid reference (zone ‘"+t+"’)");if(1!=e.length)throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(-1==i.latBands.indexOf(e))throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(1!=n.length)throw new Error("Invalid MGRS grid reference (e100k ‘"+n+"’)");if(1!=r.length)throw new Error("Invalid MGRS grid reference (n100k ‘"+r+"’)");this.zone=Number(t),this.band=e,this.e100k=n,this.n100k=r,this.easting=Number(s),this.northing=Number(a),this.datum=u}if(void 0!==e&&e.exports)var r=t("./utm.js");if(void 0!==e&&e.exports)var o=t("./latlon-ellipsoidal.js");i.latBands="CDEFGHJKLMNPQRSTUVWXX",i.e100kLetters=["ABCDEFGH","JKLMNPQR","STUVWXYZ"],i.n100kLetters=["ABCDEFGHJKLMNPQRSTUV","FGHJKLMNPQRSTUVABCDE"],r.prototype.toMgrs=function(){if(isNaN(this.zone+this.easting+this.northing))throw new Error("Invalid UTM coordinate ‘"+this.toString()+"’");var t=this.zone,e=this.toLatLonE(),n=i.latBands.charAt(Math.floor(e.lat/8+10)),r=Math.floor(this.easting/1e5),o=i.e100kLetters[(t-1)%3].charAt(r-1),s=Math.floor(this.northing/1e5)%20,a=i.n100kLetters[(t-1)%2].charAt(s),u=this.easting%1e5,l=this.northing%1e5;return u=Number(u.toFixed(6)),l=Number(l.toFixed(6)),new i(t,n,o,a,u,l)},i.prototype.toUtm=function(){for(var t=this.zone,e=this.band,n=this.e100k,s=this.n100k,a=this.easting,u=this.northing,l=e>="N"?"N":"S",c=i.e100kLetters[(t-1)%3].indexOf(n)+1,h=1e5*c,f=i.n100kLetters[(t-1)%2].indexOf(s),p=1e5*f,d=8*(i.latBands.indexOf(e)-10),g=1e5*Math.floor(new o(d,0).toUtm().northing/1e5),v=0;v+p+u=5?l:(l+"00000").slice(0,5),c=c.length>=5?c:(c+"00000").slice(0,5),new i(r,o,a,u,l,c)},i.prototype.toString=function(t){if(t=void 0===t?10:Number(t),-1==[2,4,6,8,10].indexOf(t))throw new Error("Invalid precision ‘"+t+"’");var e=this.zone.pad(2),n=this.band,i=this.e100k,r=this.n100k,o=Math.floor(this.easting/Math.pow(10,5-t/2)),s=Math.floor(this.northing/Math.pow(10,5-t/2));return o=o.pad(t/2),s=s.pad(t/2),e+n+" "+i+r+" "+o+" "+s},void 0===Number.prototype.pad&&(Number.prototype.pad=function(t){for(var e=this.toString();e.length=1e-5);var y=Math.cos(g),m=Math.sin(g),x=s*u/Math.sqrt(1-h*m*m),E=s*u*(1-h)/Math.pow(1-h*m*m,1.5),w=x/E-1,b=Math.tan(g),I=b*b,N=I*I,C=N*I,S=1/y,M=x*x*x,L=M*x*x,R=L*x*x,P=b/(2*E*x),T=b/(24*E*M)*(5+3*I+w-9*I*w),O=b/(720*E*L)*(61+90*I+45*N),_=S/x,A=S/(6*M)*(x/E+2*I),D=S/(120*L)*(5+28*I+24*N),F=S/(5040*R)*(61+662*I+1320*N+720*C),q=n-4e5,k=q*q,G=k*q,j=k*k,B=G*k,z=j*k,V=B*k;g=g-P*k+T*j-O*z;var X=c+_*q-A*G+D*B-F*V,Y=new r(g.toDegrees(),X.toDegrees(),r.datum.OSGB36);return e!=r.datum.OSGB36&&(Y=Y.convertDatum(e)),Y},i.parse=function(t){t=String(t).trim();var e=t.match(/^(\d+),\s*(\d+)$/);if(e)return new i(e[1],e[2]);if(!(e=t.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i)))throw new Error("Invalid grid reference");var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;var o=(n-2)%5*5+r%5,s=19-5*Math.floor(n/5)-Math.floor(r/5),a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),o<0||o>6||s<0||s>12)throw new Error("Invalid grid reference");if(2!=a.length)throw new Error("Invalid grid reference");if(a[0].length!=a[1].length)throw new Error("Invalid grid reference");return a[0]=(a[0]+"00000").slice(0,5),a[1]=(a[1]+"00000").slice(0,5),new i(o+a[0],s+a[1])},i.prototype.toString=function(t){if(t=void 0===t?10:Number(t),isNaN(t))throw new Error("Invalid precision");var e=this.easting,n=this.northing;if(isNaN(e)||isNaN(n))throw new Error("Invalid grid reference");if(0==t)return e.pad(6)+","+n.pad(6);var i=Math.floor(e/1e5),r=Math.floor(n/1e5);if(i<0||i>6||r<0||r>12)return"";var o=19-r-(19-r)%5+Math.floor((i+10)/5),s=5*(19-r)%25+i%5;o>7&&o++,s>7&&s++;var a=String.fromCharCode(o+"A".charCodeAt(0),s+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),n=Math.floor(n%1e5/Math.pow(10,5-t/2)),a+" "+e.pad(t/2)+" "+n.pad(t/2)},void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}),void 0===Number.prototype.pad&&(Number.prototype.pad=function(t){for(var e=this.toString();e.length=3&&(t++,e+=6..toRadians()),32==t&&"X"==r&&this.lon<9&&(t--,e-=6..toRadians()),32==t&&"X"==r&&this.lon>=9&&(t++,e+=6..toRadians()),34==t&&"X"==r&&this.lon<21&&(t--,e-=6..toRadians()),34==t&&"X"==r&&this.lon>=21&&(t++,e+=6..toRadians()),36==t&&"X"==r&&this.lon<33&&(t--,e-=6..toRadians()),36==t&&"X"==r&&this.lon>=33&&(t++,e+=6..toRadians());for(var o=this.lat.toRadians(),s=this.lon.toRadians()-e,a=this.datum.ellipsoid.a,u=this.datum.ellipsoid.f,l=Math.sqrt(u*(2-u)),c=u/(2-u),h=c*c,f=c*h,p=c*f,d=c*p,g=c*d,v=Math.cos(s),y=Math.sin(s),m=Math.tan(s),x=Math.tan(o),E=Math.sinh(l*Math.atanh(l*x/Math.sqrt(1+x*x))),w=x*Math.sqrt(1+E*E)-E*Math.sqrt(1+x*x),b=Math.atan2(w,v),I=Math.asinh(y/Math.sqrt(w*w+v*v)),N=a/(1+c)*(1+.25*h+1/64*p+1/256*g),C=[null,.5*c-2/3*h+5/16*f+41/180*p-127/288*d+7891/37800*g,13/48*h-.6*f+557/1440*p+281/630*d-1983433/1935360*g,61/240*f-103/140*p+15061/26880*d+167603/181440*g,49561/161280*p-179/168*d+6601661/7257600*g,34729/80640*d-3418889/1995840*g,.6650675310896665*g],S=b,M=1;M<=6;M++)S+=C[M]*Math.sin(2*M*b)*Math.cosh(2*M*I);for(var L=I,M=1;M<=6;M++)L+=C[M]*Math.cos(2*M*b)*Math.sinh(2*M*I);for(var R=.9996*N*L,P=.9996*N*S,T=1,M=1;M<=6;M++)T+=2*M*C[M]*Math.cos(2*M*b)*Math.cosh(2*M*I);for(var O=0,M=1;M<=6;M++)O+=2*M*C[M]*Math.sin(2*M*b)*Math.sinh(2*M*I);var _=Math.atan(w/Math.sqrt(1+w*w)*m),A=Math.atan2(O,T),D=_+A,F=Math.sin(o),q=Math.sqrt(1-l*l*F*F)*Math.sqrt(1+x*x)/Math.sqrt(w*w+v*v),k=N/a*Math.sqrt(T*T+O*O),G=.9996*q*k;R+=5e5,P<0&&(P+=1e7),R=Number(R.toFixed(6)),P=Number(P.toFixed(6));var j=Number(D.toDegrees().toFixed(9)),B=Number(G.toFixed(12));return new i(t,this.lat>=0?"N":"S",R,P,this.datum,j,B)},i.prototype.toLatLonE=function(){var t=this.zone,e=this.hemisphere,n=this.easting,i=this.northing;if(isNaN(t)||isNaN(n)||isNaN(i))throw new Error("Invalid coordinate");var o=this.datum.ellipsoid.a,s=this.datum.ellipsoid.f;n-=5e5,i="S"==e?i-1e7:i;for(var a=Math.sqrt(s*(2-s)),u=s/(2-s),l=u*u,c=u*l,h=u*c,f=u*h,p=u*f,d=o/(1+u)*(1+.25*l+1/64*h+1/256*p),g=n/(.9996*d),v=i/(.9996*d),y=[null,.5*u-2/3*l+37/96*c-1/360*h-81/512*f+96199/604800*p,1/48*l+1/15*c-437/1440*h+46/105*f-1118711/3870720*p,17/480*c-37/840*h-209/4480*f+5569/90720*p,4397/161280*h-11/504*f-830251/7257600*p,4583/161280*f-108847/3991680*p,.03233083094085698*p],m=v,x=1;x<=6;x++)m-=y[x]*Math.sin(2*x*v)*Math.cosh(2*x*g);for(var E=g,x=1;x<=6;x++)E-=y[x]*Math.cos(2*x*v)*Math.sinh(2*x*g);var w=Math.sinh(E),b=Math.sin(m),I=Math.cos(m),N=b/Math.sqrt(w*w+I*I),C=N;do{var S=Math.sinh(a*Math.atanh(a*C/Math.sqrt(1+C*C))),M=C*Math.sqrt(1+S*S)-S*Math.sqrt(1+C*C),L=(N-M)/Math.sqrt(1+M*M)*(1+(1-a*a)*C*C)/((1-a*a)*Math.sqrt(1+C*C));C+=L}while(Math.abs(L)>1e-12);for(var R=C,P=Math.atan(R),T=Math.atan2(w,I),O=1,x=1;x<=6;x++)O-=2*x*y[x]*Math.cos(2*x*v)*Math.cosh(2*x*g);for(var _=0,x=1;x<=6;x++)_+=2*x*y[x]*Math.sin(2*x*v)*Math.sinh(2*x*g);var A=Math.atan(Math.tan(m)*Math.tanh(E)),D=Math.atan2(_,O),F=A+D,q=Math.sin(P),k=Math.sqrt(1-a*a*q*q)*Math.sqrt(1+R*R)*Math.sqrt(w*w+I*I),G=d/o/Math.sqrt(O*O+_*_),j=.9996*k*G;T+=(6*(t-1)-180+3).toRadians();var B=Number(P.toDegrees().toFixed(11)),z=Number(T.toDegrees().toFixed(11)),V=Number(F.toDegrees().toFixed(9)),X=Number(j.toFixed(12)),Y=new r(B,z,this.datum);return Y.convergence=V,Y.scale=X,Y},i.parse=function(t,e){if(void 0===e&&(e=r.datum.WGS84),null==(t=t.trim().match(/\S+/g))||4!=t.length)throw new Error("Invalid UTM coordinate ‘"+t+"’");return new i(t[0],t[1],t[2],t[3],e)},i.prototype.toString=function(t){t=Number(t||0);var e=this.zone<10?"0"+this.zone:this.zone,n=this.hemisphere,i=this.easting,r=this.northing;return isNaN(e)||!n.match(/[NS]/)||isNaN(i)||isNaN(r)?"":e+" "+n+" "+i.toFixed(t)+" "+r.toFixed(t)},void 0===Math.sinh&&(Math.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2}),void 0===Math.cosh&&(Math.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2}),void 0===Math.tanh&&(Math.tanh=function(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}),void 0===Math.asinh&&(Math.asinh=function(t){return Math.log(t+Math.sqrt(1+t*t))}),void 0===Math.atanh&&(Math.atanh=function(t){return Math.log((1+t)/(1-t))/2}),void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}),void 0!==e&&e.exports&&(e.exports=i)},{"./latlon-ellipsoidal.js":634}],642:[function(t,e,n){"use strict";function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);this.x=Number(t),this.y=Number(e),this.z=Number(n)}i.prototype.plus=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.x+t.x,this.y+t.y,this.z+t.z)},i.prototype.minus=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.x-t.x,this.y-t.y,this.z-t.z)},i.prototype.times=function(t){return t=Number(t),new i(this.x*t,this.y*t,this.z*t)},i.prototype.dividedBy=function(t){return t=Number(t),new i(this.x/t,this.y/t,this.z/t)},i.prototype.dot=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z},i.prototype.cross=function(t){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},i.prototype.negate=function(){return new i(-this.x,-this.y,-this.z)},i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},i.prototype.unit=function(){var t=this.length();return 1==t?this:0==t?this:new i(this.x/t,this.y/t,this.z/t)},i.prototype.angleTo=function(t,e){if(!(t instanceof i))throw new TypeError("v is not Vector3d object");var n=this.cross(t).length(),r=this.dot(t);if(void 0!==e){if(!(e instanceof i))throw new TypeError("vSign is not Vector3d object");n=this.cross(t).dot(e)<0?-n:n}return Math.atan2(n,r)},i.prototype.rotateAround=function(t,e){if(!(t instanceof i))throw new TypeError("axis is not Vector3d object");for(var n=this.unit(),r=[n.x,n.y,n.z],o=t.unit(),s=Math.sin(e),a=Math.cos(e),u=[[o.x*o.x*(1-a)+a,o.x*o.y*(1-a)-o.z*s,o.x*o.z*(1-a)+o.y*s],[o.y*o.x*(1-a)+o.z*s,o.y*o.y*(1-a)+a,o.y*o.z*(1-a)-o.x*s],[o.z*o.x*(1-a)-o.y*s,o.z*o.y*(1-a)+o.x*s,o.z*o.z*(1-a)+a]],l=[0,0,0],c=0;c<3;c++)for(var h=0;h<3;h++)l[c]+=u[c][h]*r[h];return new i(l[0],l[1],l[2])},i.prototype.toString=function(t){var e=void 0===t?3:Number(t);return"["+this.x.toFixed(e)+","+this.y.toFixed(e)+","+this.z.toFixed(e)+"]"},void 0!==e&&e.exports&&(e.exports=i)},{}],643:[function(t,e,n){var i=t("@turf/helpers"),r=t("@turf/invariant").getCoord,o=t("geodesy").LatLonSpherical,s=i.point,a=i.radiansToDistance,u=i.distanceToRadians;e.exports=function(t,e,n,i){if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");i=i||"kilometers";var l=a(u(e,i),"meters"),c=r(t),h=new o(c[1],c[0]),f=h.rhumbDestinationPoint(l,n);return f.lon+=f.lon-c[0]>180?-360:c[0]-f.lon>180?360:0,s([f.lon,f.lat])}},{"@turf/helpers":644,"@turf/invariant":645,geodesy:652}],644:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],645:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],646:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],647:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":646,"./vector3d.js":655,dup:634}],648:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":646,dup:635}],649:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":646,"./vector3d.js":655,dup:636}],650:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,dup:637}],651:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,"./utm.js":654,dup:638}],652:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":646,"./latlon-ellipsoidal.js":647,"./latlon-spherical.js":648,"./latlon-vectors.js":649,"./latlon-vincenty.js":650,"./mgrs.js":651,"./osgridref.js":653,"./utm.js":654,"./vector3d.js":655,dup:639}],653:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,dup:640}],654:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":647,dup:641}],655:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],656:[function(t,e,n){var i=t("@turf/helpers"),r=t("@turf/invariant").getCoord,o=t("geodesy").LatLonSpherical,s=i.radiansToDistance,a=i.distanceToRadians;e.exports=function(t,e,n){if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");n=n||"kilometers";var i=r(t),u=r(e),l=new o(i[1],i[0]),c=new o(u[1],u[0]);c[0]+=c[0]-l[0]>180?-360:l[0]-c[0]>180?360:0;var h=l.rhumbDistanceTo(c);return s(a(h,"meters"),n)}},{"@turf/helpers":657,"@turf/invariant":658,geodesy:665}],657:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],658:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],659:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],660:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":659,"./vector3d.js":668,dup:634}],661:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":659,dup:635}],662:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":659,"./vector3d.js":668,dup:636}],663:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,dup:637}],664:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,"./utm.js":667,dup:638}],665:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":659,"./latlon-ellipsoidal.js":660,"./latlon-spherical.js":661,"./latlon-vectors.js":662,"./latlon-vincenty.js":663,"./mgrs.js":664,"./osgridref.js":666,"./utm.js":667,"./vector3d.js":668,dup:639}],666:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,dup:640}],667:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":660,dup:641}],668:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],669:[function(t,e,n){function i(t,e){for(var n,i,r=t.slice(0),o=t.length,s=o-e;o-- >s;)i=Math.floor((o+1)*Math.random()),n=r[i],r[i]=r[o],r[o]=n;return r.slice(s)}var r=t("@turf/helpers").featureCollection;e.exports=function(t,e){return r(i(t.features,e))}},{"@turf/helpers":670}],670:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],671:[function(t,e,n){function i(t){var e=t%360;return e<0&&(e+=360),e}var r=t("@turf/circle"),o=t("@turf/meta").coordEach,s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=s.polygon,l=t("@turf/line-arc");e.exports=function(t,e,n,s,c,h){if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===s||null===s)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if(c=c||64,i(n)===i(s))return r(t,e,c,h);var f=a(t),p=l(t,e,n,s,c,h),d=[[f]];return o(p,function(t){d[0].push(t)}),d[0].push(f),u(d)}},{"@turf/circle":672,"@turf/helpers":677,"@turf/invariant":678,"@turf/line-arc":679,"@turf/meta":689}],672:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"@turf/destination":673,"@turf/helpers":676,dup:167}],673:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":674,"@turf/invariant":675,dup:5}],674:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],675:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],676:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],677:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],678:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],679:[function(t,e,n){arguments[4][368][0].apply(n,arguments)},{"@turf/circle":680,"@turf/destination":685,"@turf/helpers":688,dup:368}],680:[function(t,e,n){arguments[4][167][0].apply(n,arguments)},{"@turf/destination":681,"@turf/helpers":684,dup:167}],681:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":682,"@turf/invariant":683,dup:5}],682:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],683:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],684:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],685:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":686,"@turf/invariant":687,dup:5}],686:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],687:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],688:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],689:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],690:[function(t,e,n){function i(t,e,n){return"LineString"===t.geometry.type?{type:"LineString",coordinates:s(t.geometry.coordinates,e,n)}:"MultiLineString"===t.geometry.type?{type:"MultiLineString",coordinates:t.geometry.coordinates.map(function(t){return s(t,e,n)})}:"Polygon"===t.geometry.type?{type:"Polygon",coordinates:a(t.geometry.coordinates,e,n)}:"MultiPolygon"===t.geometry.type?{type:"MultiPolygon",coordinates:t.geometry.coordinates.map(function(t){return a(t,e,n)})}:t}function r(t){return!(t.length<3)&&(3!==t.length||t[2][0]!==t[0][0]||t[2][1]!==t[0][1])}function o(t,e){return{type:"Feature",geometry:t,properties:e}}function s(t,e,n){return u(t.map(function(t){return{x:t[0],y:t[1],z:t[2]}}),e,n).map(function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]})}function a(t,e,n){return t.map(function(t){var i=t.map(function(t){return{x:t[0],y:t[1]}});if(i.length<4)throw new Error("Invalid polygon");for(var o=u(i,e,n).map(function(t){return[t.x,t.y]});!r(o);)e-=.01*e,o=u(i,e,n).map(function(t){return[t.x,t.y]});return o[o.length-1][0]===o[0][0]&&o[o.length-1][1]===o[0][1]||o.push(o[0]),o})}var u=t("simplify-js"),l=["LineString","MultiLineString","Polygon","MultiPolygon"];e.exports=function(t,e,n){return"Feature"===t.type?o(i(t,e,n),t.properties):"FeatureCollection"===t.type?{type:"FeatureCollection",features:t.features.map(function(t){var r=i(t,e,n);return l.indexOf(r.type)>-1?o(r,t.properties):r})}:"GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(function(t){return l.indexOf(t.type)>-1?i({type:"Feature",geometry:t},e,n):t})}:t}},{"simplify-js":691}],691:[function(e,n,i){!function(){"use strict";function e(t,e){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}function i(t,e,n){var i=e.x,r=e.y,o=n.x-i,s=n.y-r;if(0!==o||0!==s){var a=((t.x-i)*o+(t.y-r)*s)/(o*o+s*s);a>1?(i=n.x,r=n.y):a>0&&(i+=o*a,r+=s*a)}return o=t.x-i,s=t.y-r,o*o+s*s}function r(t,n){for(var i,r=t[0],o=[r],s=1,a=t.length;sn&&(o.push(i),r=i);return r!==i&&o.push(i),o}function o(t,e){var n,r,o,s,a=t.length,u="undefined"!=typeof Uint8Array?Uint8Array:Array,l=new u(a),c=0,h=a-1,f=[],p=[];for(l[c]=l[h]=1;h;){for(r=0,n=c+1;nr&&(s=n,r=o);r>e&&(l[s]=1,f.push(c,s,s,h)),h=f.pop(),c=f.pop()}for(n=0;n=i(t.slice(0,2),[e,o])){var s=(n+o)/2;return[e,s-(r-e)/2,r,s+(r-e)/2]}var a=(e+r)/2;return[a-(o-n)/2,n,a+(o-n)/2,o]}},{"@turf/distance":700}],700:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":701,"@turf/invariant":702,dup:8}],701:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],702:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],703:[function(t,e,n){var i=t("@turf/inside");e.exports=function(t,e,n,r){return t=JSON.parse(JSON.stringify(t)),e=JSON.parse(JSON.stringify(e)),t.features.forEach(function(t){t.properties||(t.properties={}),e.features.forEach(function(e){if(void 0===t.properties[r]){i(t,e)&&(t.properties[r]=e.properties[n])}})}),t}},{"@turf/inside":704}],704:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":705,dup:34}],705:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],706:[function(t,e,n){function i(t){var e=r(t),n=s(e.vertices,e.holes,2),i=[],a=[];n.forEach(function(t,i){var r=n[i];a.push([e.vertices[2*r],e.vertices[2*r+1]])});for(var u=0;u0&&(i+=t[r-1].length,n.holes.push(i))}return n}var o=t("@turf/helpers").polygon,s=t("earcut");e.exports=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=i(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(i(t))}),e}},{"@turf/helpers":707,earcut:708}],707:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],708:[function(t,e,n){"use strict";function i(t,e,n){n=n||2;var i=e&&e.length,o=i?e[0]*n:t.length,a=r(t,0,o,n,!0),u=[];if(!a)return u;var l,c,f,p,d,g,v;if(i&&(a=h(t,e,a,n)),t.length>80*n){l=f=t[0],c=p=t[1];for(var y=n;yf&&(f=d),g>p&&(p=g);v=Math.max(f-l,p-c)}return s(a,u,n,l,c,v),u}function r(t,e,n,i,r){var o,s;if(r===T(t,e,n,i)>0)for(o=e;o=e;o-=i)s=L(o,t[o],t[o+1],s);return s&&b(s,s.next)&&(R(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!b(i,i.next)&&0!==w(i.prev,i,i.next))i=i.next;else{if(R(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e} function s(t,e,n,i,r,h,f){if(t){!f&&h&&g(t,i,r,h);for(var p,d,v=t;t.prev!==t.next;)if(p=t.prev,d=t.next,h?u(t,i,r,h):a(t))e.push(p.i/n),e.push(t.i/n),e.push(d.i/n),R(t),t=d.next,v=d.next;else if((t=d)===v){f?1===f?(t=l(t,e,n),s(t,e,n,i,r,h,2)):2===f&&c(t,e,n,i,r,h):s(o(t),e,n,i,r,h,1);break}}}function a(t){var e=t.prev,n=t,i=t.next;if(w(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(x(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&w(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(t,e,n,i){var r=t.prev,o=t,s=t.next;if(w(r,o,s)>=0)return!1;for(var a=r.xo.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,c=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=y(a,u,e,n,i),f=y(l,c,e,n,i),p=t.nextZ;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&x(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&x(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!b(r,o)&&I(r,i,i.next,o)&&C(r,o)&&C(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),R(i),R(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,n,i,r,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&E(u,l)){var c=M(u,l);return u=o(u,u.next),c=o(c,c.next),s(u,e,n,i,r,a),void s(c,e,n,i,r,a)}l=l.next}u=u.next}while(u!==t)}function h(t,e,n,i){var s,a,u,l,c,h=[];for(s=0,a=e.length;s=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s){if(s=a,a===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x=i.x&&i.x>=c&&x(on.x)&&C(i,t)&&(n=i,f=u),i=i.next;return n}function g(t,e,n,i){var r=t;do{null===r.z&&(r.z=y(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,v(r)}function v(t){var e,n,i,r,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e0||u>0&&i;)0===a?(r=i,i=i.nextZ,u--):0!==u&&i?n.z<=i.z?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,u--):(r=n,n=n.nextZ,a--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return t}function y(t,e,n,i,r){return t=32767*(t-n)/r,e=32767*(e-i)/r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function m(t){var e=t,n=t;do{e.x=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function E(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!N(t,e)&&C(t,e)&&C(e,t)&&S(t,e)}function w(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function I(t,e,n,i){return!!(b(t,e)&&b(n,i)||b(t,i)&&b(n,e))||w(t,e,n)>0!=w(t,e,i)>0&&w(n,i,t)>0!=w(n,i,e)>0}function N(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&I(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function C(t,e){return w(t.prev,t,t.next)<0?w(t,e,t.next)>=0&&w(t,t.prev,e)>=0:w(t,e,t.prev)<0||w(t,t.next,e)<0}function S(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function M(t,e){var n=new P(t.i,t.x,t.y),i=new P(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function L(t,e,n,i){var r=new P(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function R(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function P(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,n,i){for(var r=0,o=e,s=n-i;o0&&(i+=t[r-1].length,n.holes.push(i))}return n}},{}],709:[function(t,e,n){arguments[4][210][0].apply(n,arguments)},{"@turf/helpers":710,dup:210}],710:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],711:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/centroid"),o=t("@turf/invariant"),s=t("@turf/rhumb-bearing"),a=t("@turf/rhumb-distance"),u=t("@turf/rhumb-destination"),l=i.coordEach,c=o.getCoords;e.exports=function(t,e,n,i){if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e?t:(n||(n=r(t)),!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t))),l(t,function(t){var i=s(n,t),r=i+e,o=a(n,t),l=c(u(n,o,r));t[0]=l[0],t[1]=l[1]}),t)}},{"@turf/centroid":712,"@turf/invariant":715,"@turf/meta":716,"@turf/rhumb-bearing":717,"@turf/rhumb-destination":729,"@turf/rhumb-distance":742}],712:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":713,"@turf/meta":714,dup:132}],713:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],714:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],715:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],716:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],717:[function(t,e,n){arguments[4][631][0].apply(n,arguments)},{"@turf/invariant":718,dup:631,geodesy:725}],718:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],719:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],720:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":719,"./vector3d.js":728,dup:634}],721:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":719,dup:635}],722:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":719,"./vector3d.js":728,dup:636}],723:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,dup:637}],724:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,"./utm.js":727,dup:638}],725:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":719,"./latlon-ellipsoidal.js":720,"./latlon-spherical.js":721,"./latlon-vectors.js":722,"./latlon-vincenty.js":723,"./mgrs.js":724,"./osgridref.js":726,"./utm.js":727,"./vector3d.js":728,dup:639}],726:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,dup:640}],727:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":720,dup:641}],728:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],729:[function(t,e,n){arguments[4][643][0].apply(n,arguments)},{"@turf/helpers":730,"@turf/invariant":731,dup:643,geodesy:738}],730:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],731:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],732:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],733:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":732,"./vector3d.js":741,dup:634}],734:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":732,dup:635}],735:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":732,"./vector3d.js":741,dup:636}],736:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,dup:637}],737:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,"./utm.js":740,dup:638}],738:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":732,"./latlon-ellipsoidal.js":733,"./latlon-spherical.js":734,"./latlon-vectors.js":735,"./latlon-vincenty.js":736,"./mgrs.js":737,"./osgridref.js":739,"./utm.js":740,"./vector3d.js":741,dup:639}],739:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,dup:640}],740:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":733,dup:641}],741:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],742:[function(t,e,n){arguments[4][656][0].apply(n,arguments)},{"@turf/helpers":743,"@turf/invariant":744,dup:656,geodesy:751}],743:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],744:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],745:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],746:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":745,"./vector3d.js":754,dup:634}],747:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":745,dup:635}],748:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":745,"./vector3d.js":754,dup:636}],749:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,dup:637}],750:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,"./utm.js":753,dup:638}],751:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":745,"./latlon-ellipsoidal.js":746,"./latlon-spherical.js":747,"./latlon-vectors.js":748,"./latlon-vincenty.js":749,"./mgrs.js":750,"./osgridref.js":752,"./utm.js":753,"./vector3d.js":754,dup:639}],752:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,dup:640}],753:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":746,dup:641}],754:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],755:[function(t,e,n){function i(t,e,n){var i="Point"===t.type||t.geometry&&"Point"===t.geometry.type;return n=r(t,n),1===e||i?t:(g(t,function(t){var i=f(n,t),r=h(n,t),o=i*e,s=m(p(n,o,r));t[0]=s[0],t[1]=s[1],3===t.length&&(t[2]*=e)}),t)}function r(t,e){if(void 0!==e&&null!==e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return y(e);var n=t.bbox?t.bbox:l(t),i=n[0],r=n[1],o=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return d([i,r]);case"se":case"southeast":case"eastsouth":case"bottomright":return d([o,r]);case"nw":case"northwest":case"westnorth":case"topleft":return d([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return d([o,a]);case"center":return s(t);case void 0:case null:case"centroid":return u(t);default:throw new Error("invalid origin")}}var o=t("@turf/meta"),s=t("@turf/center"),a=t("@turf/helpers"),u=t("@turf/centroid"),l=t("@turf/bbox"),c=t("@turf/invariant"),h=t("@turf/rhumb-bearing"),f=t("@turf/rhumb-distance"),p=t("@turf/rhumb-destination"),d=a.point,g=o.coordEach,v=o.featureEach,y=c.getCoord,m=c.getCoords;e.exports=function(t,e,n,r){if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(n)||"object"==typeof n;return!0!==r&&(t=JSON.parse(JSON.stringify(t))),"FeatureCollection"!==t.type||o?i(t,e,n):(v(t,function(r,o){t.features[o]=i(r,e,n)}),t)}},{"@turf/bbox":756,"@turf/center":758,"@turf/centroid":762,"@turf/helpers":765,"@turf/invariant":766,"@turf/meta":767,"@turf/rhumb-bearing":768,"@turf/rhumb-destination":780,"@turf/rhumb-distance":793}],756:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":757,dup:22}],757:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],758:[function(t,e,n){arguments[4][122][0].apply(n,arguments)},{"@turf/bbox":759,"@turf/helpers":761,dup:122}],759:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":760,dup:22}],760:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],761:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],762:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":763,"@turf/meta":764,dup:132}],763:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],764:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],765:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],766:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],767:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],768:[function(t,e,n){arguments[4][631][0].apply(n,arguments)},{"@turf/invariant":769,dup:631,geodesy:776}],769:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],770:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],771:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":770,"./vector3d.js":779,dup:634}],772:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":770,dup:635}],773:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":770,"./vector3d.js":779,dup:636}],774:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,dup:637}],775:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,"./utm.js":778,dup:638}],776:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":770,"./latlon-ellipsoidal.js":771,"./latlon-spherical.js":772,"./latlon-vectors.js":773,"./latlon-vincenty.js":774,"./mgrs.js":775,"./osgridref.js":777,"./utm.js":778,"./vector3d.js":779,dup:639}],777:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,dup:640}],778:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":771,dup:641}],779:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],780:[function(t,e,n){arguments[4][643][0].apply(n,arguments)},{"@turf/helpers":781,"@turf/invariant":782,dup:643,geodesy:789}],781:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],782:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],783:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],784:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":783,"./vector3d.js":792,dup:634}],785:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":783,dup:635}],786:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":783,"./vector3d.js":792,dup:636}],787:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,dup:637}],788:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,"./utm.js":791,dup:638}],789:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":783,"./latlon-ellipsoidal.js":784,"./latlon-spherical.js":785,"./latlon-vectors.js":786,"./latlon-vincenty.js":787,"./mgrs.js":788,"./osgridref.js":790,"./utm.js":791,"./vector3d.js":792,dup:639}],790:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,dup:640}],791:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":784,dup:641}],792:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],793:[function(t,e,n){arguments[4][656][0].apply(n,arguments)},{"@turf/helpers":794,"@turf/invariant":795,dup:656,geodesy:802}],794:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],795:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],796:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],797:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":796,"./vector3d.js":805,dup:634}],798:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":796,dup:635}],799:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":796,"./vector3d.js":805,dup:636}],800:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,dup:637}],801:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,"./utm.js":804,dup:638}],802:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":796,"./latlon-ellipsoidal.js":797,"./latlon-spherical.js":798,"./latlon-vectors.js":799,"./latlon-vincenty.js":800,"./mgrs.js":801,"./osgridref.js":803,"./utm.js":804,"./vector3d.js":805,dup:639}],803:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,dup:640}],804:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":797,dup:641}],805:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],806:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/invariant"),o=t("@turf/rhumb-destination"),s=i.coordEach,a=r.getCoords;e.exports=function(t,e,n,i,r,u){if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(r&&"number"!=typeof r&&isNaN(r))throw new Error("zTranslation is not a number");if(r=void 0!==r?r:0,0===e&&0===r)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==u&&void 0!==u||(t=JSON.parse(JSON.stringify(t))),s(t,function(t){var s=a(o(t,e,n,i));t[0]=s[0],t[1]=s[1],r&&3===t.length&&(t[2]+=r)}),t}},{"@turf/invariant":807,"@turf/meta":808,"@turf/rhumb-destination":809}],807:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],808:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],809:[function(t,e,n){arguments[4][643][0].apply(n,arguments)},{"@turf/helpers":810,"@turf/invariant":811,dup:643,geodesy:818}],810:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],811:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],812:[function(t,e,n){arguments[4][633][0].apply(n,arguments)},{dup:633}],813:[function(t,e,n){arguments[4][634][0].apply(n,arguments)},{"./dms.js":812,"./vector3d.js":821,dup:634}],814:[function(t,e,n){arguments[4][635][0].apply(n,arguments)},{"./dms":812,dup:635}],815:[function(t,e,n){arguments[4][636][0].apply(n,arguments)},{"./dms.js":812,"./vector3d.js":821,dup:636}],816:[function(t,e,n){arguments[4][637][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,dup:637}],817:[function(t,e,n){arguments[4][638][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,"./utm.js":820,dup:638}],818:[function(t,e,n){arguments[4][639][0].apply(n,arguments)},{"./dms.js":812,"./latlon-ellipsoidal.js":813,"./latlon-spherical.js":814,"./latlon-vectors.js":815,"./latlon-vincenty.js":816,"./mgrs.js":817,"./osgridref.js":819,"./utm.js":820,"./vector3d.js":821,dup:639}],819:[function(t,e,n){arguments[4][640][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,dup:640}],820:[function(t,e,n){arguments[4][641][0].apply(n,arguments)},{"./latlon-ellipsoidal.js":813,dup:641}],821:[function(t,e,n){arguments[4][642][0].apply(n,arguments)},{dup:642}],822:[function(t,e,n){arguments[4][332][0].apply(n,arguments)},{"@turf/distance":823,"@turf/helpers":826,dup:332}],823:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":824,"@turf/invariant":825,dup:8}],824:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],825:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],826:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],827:[function(t,e,n){arguments[4][521][0].apply(n,arguments)},{"@turf/meta":828,dup:521}],828:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],829:[function(t,e,n){arguments[4][212][0].apply(n,arguments)},{dup:212,jsts:830}],830:[function(t,e,n){arguments[4][130][0].apply(n,arguments)},{dup:130}],831:[function(t,e,n){var i=t("simplepolygon"),r=t("@turf/flatten"),o=t("@turf/meta").featureEach,s=t("@turf/helpers").featureCollection;e.exports=function(t){var e=s([]);return o(t,function(t){"MultiPolygon"===t.geometry.type&&(t=r(t)),o(t,function(t){var n=i(t);o(n,function(n){n.properties=t.properties?t.properties:{},e.features.push(n)})})}),e}},{"@turf/flatten":834,"@turf/helpers":837,"@turf/meta":840,simplepolygon:847}],832:[function(t,e,n){arguments[4][13][0].apply(n,arguments)},{dup:13,wgs84:848}],833:[function(t,e,n){arguments[4][342][0].apply(n,arguments)},{"@mapbox/geojson-area":832,"@turf/meta":840,dup:342}],834:[function(t,e,n){arguments[4][267][0].apply(n,arguments)},{"@turf/helpers":835,"@turf/meta":836,dup:267}],835:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],836:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],837:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],838:[function(t,e,n){arguments[4][615][0].apply(n,arguments)},{"@turf/invariant":839,dup:615}],839:[function(t,e,n){arguments[4][350][0].apply(n,arguments)},{dup:350}],840:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],841:[function(t,e,n){(function(i){function r(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),e){var i="color: "+this.color;t.splice(1,0,i,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(r++,"%c"===t&&(o=r))}),t.splice(o,0,i)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?n.storage.removeItem("debug"):n.storage.debug=t}catch(t){}}function u(){var t;try{t=n.storage.debug}catch(t){}return!t&&void 0!==i&&"env"in i&&(t=i.env.DEBUG),t}n=e.exports=t("./debug"),n.log=s,n.formatArgs=o,n.save=a,n.load=u,n.useColors=r,n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},n.enable(u())}).call(this,t("_process"))},{"./debug":842,_process:853}],842:[function(t,e,n){function i(t){var e,i=0;for(e in t)i=(i<<5)-i+t.charCodeAt(e),i|=0;return n.colors[Math.abs(i)%n.colors.length]}function r(t){function e(){if(e.enabled){var t=e,i=+new Date,r=i-(l||i);t.diff=r,t.prev=l,t.curr=i,l=i;for(var o=new Array(arguments.length),s=0;s=1||d<=0||g>=1||g<=0)){var v=p,y=!l[v];y&&(l[v]=!0),e?u.push(e(p,t,n,s,c,d,r,o,h,f,g,y)):u.push(p)}}}function s(t,e){var n=a[t][e],i=a[t][e+1];if(n[0]100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*h;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=c?Math.round(t/c)+"d":t>=l?Math.round(t/l)+"h":t>=u?Math.round(t/u)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function o(t){return s(t,c,"day")||s(t,l,"hour")||s(t,u,"minute")||s(t,a,"second")||t+" ms"}function s(t,e,n){if(!(t0)return i(t);if("number"===n&&!1===isNaN(t))return e.long?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],845:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],846:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:845}],847:[function(t,e,n){function i(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function r(t){for(var e=0,n=0;n1)for(var e=0;eM[e.isect].coord?-1:1}),p("Initial state of the queue: "+JSON.stringify(D)),f("Setting up queue");for(var N=[];D.length>0;){var j=D.pop(),B=j.isect,z=j.parent,V=j.winding,X=N.length,Y=[M[B].coord];p("# Starting output ring number "+N.length+" with winding "+V+" from intersection "+B),B