1 |
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).turf=t()}}(function(){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<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!u.isNumber(e))throw new Error("distance must be a number");for(var r=0,l=0;l<i.length&&!(e>=r&&l===i.length-1);l++){if(r>=e){var c=e-r;if(c){var h=o(i[l],i[l-1])-180;return s(i[l],c,h,n)}return u.point(i[l])}r+=a(i[l],i[l+1],n)}return u.point(i[i.length-1])}var o=i(t("@turf/bearing")),s=i(t("@turf/destination")),a=i(t("@turf/distance")),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/destination":68,"@turf/distance":73,"@turf/helpers":79}],2:[function(t,e,n){"use strict";function i(t){return u.geomReduce(t,function(t,e){return t+r(e)},0)}function r(t){var e,n=0;switch(t.type){case"Polygon":return o(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=o(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)n+=r(t.geometries[e]);return n}}function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(s(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(s(t[n]))}return e}function s(t){var e,n,i,r,o,s,u=0,c=t.length;if(c>2){for(s=0;s<c;s++)s===c-2?(i=c-2,r=c-1,o=0):s===c-1?(i=c-1,r=0,o=1):(i=s,r=s+1,o=s+2),e=t[i],n=t[r],u+=(a(t[o][0])-a(e[0]))*Math.sin(a(n[1]));u=u*l*l/2}return u}function a(t){return t*Math.PI/180}var u=t("@turf/meta"),l=6378137;e.exports=i,e.exports.default=i},{"@turf/meta":105}],3:[function(t,e,n){"use strict";function i(t,e){var n=o(t),i=s.getCoords(t),l=t.properties;switch(n){case"LineString":case"MultiLineString":var c=[];return"LineString"===n&&(i=[i]),i.forEach(function(t){u(t,e,c)}),1===c.length?a.lineString(c[0],l):a.multiLineString(c,l);case"Polygon":return a.polygon(r(i,e),l);case"MultiPolygon":return a.multiPolygon(i.map(function(t){return r(t,e)}),l);default:throw new Error("geometry "+n+" not supported")}}function r(t,e){for(var n=[],i=0;i<t.length;i++){var r=u.polygon(t[i],e);r.length>0&&(r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1]||r.push(r[0]),r.length>=4&&n.push(r))}return n}function o(t){return t.geometry?t.geometry.type:t.type}var s=t("@turf/invariant"),a=t("@turf/helpers"),u=t("lineclip");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84,lineclip:4}],4:[function(t,e,n){"use strict";function i(t,e,n){var i,s,a,u,l,c=t.length,h=o(t[0],e),f=[];for(n||(n=[]),i=1;i<c;i++){for(s=t[i-1],u=l=o(a=t[i],e);;){if(!(h|u)){f.push(s),u!==l?(f.push(a),i<c-1&&(n.push(f),f=[])):i===c-1&&f.push(a);break}if(h&u)break;h?h=o(s=r(s,a,h,e),e):u=o(a=r(s,a,u,e),e)}h=l}return f.length&&n.push(f),n}function r(t,e,n,i){return 8&n?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:4&n?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:2&n?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:1&n?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function o(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}e.exports=i,i.polyline=i,i.polygon=function(t,e){var n,i,s,a,u,l,c;for(i=1;i<=8;i*=2){for(n=[],a=!(o(s=t[t.length-1],e)&i),u=0;u<t.length;u++)(c=!(o(l=t[u],e)&i))!==a&&n.push(r(s,l,i,e)),c&&n.push(l),s=l,a=c;if(!(t=n).length)break}return n}},{}],5:[function(t,e,n){"use strict";function i(t){var e=[t[0],t[1]],n=[t[0],t[3]],i=[t[2],t[3]],o=[t[2],t[1]];return r.polygon([[e,o,i,n,e]])}var r=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],6:[function(t,e,n){"use strict";function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}var r=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/meta":105}],7:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!s.isObject(n))throw new Error("options is invalid");if(!0===n.final)return r(t,e);var i=o.getCoord(t),a=o.getCoord(e),u=s.degreesToRadians(i[0]),l=s.degreesToRadians(a[0]),c=s.degreesToRadians(i[1]),h=s.degreesToRadians(a[1]),f=Math.sin(l-u)*Math.cos(h),g=Math.cos(c)*Math.sin(h)-Math.sin(c)*Math.cos(h)*Math.cos(l-u);return s.radiansToDegrees(Math.atan2(f,g))}function r(t,e){var n=i(e,t);return n=(n+180)%360}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],8:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!r.isObject(e))throw new Error("options is invalid");var n=e.resolution||1e4,i=e.sharpness||.85;if(!t)throw new Error("line is required");if(!r.isNumber(n))throw new Error("resolution must be an number");if(!r.isNumber(i))throw new Error("sharpness must be an number");for(var a=[],u=new s({points:o.getGeom(t).coordinates.map(function(t){return{x:t[0],y:t[1]}}),duration:n,sharpness:i}),l=0;l<u.duration;l+=10){var c=u.pos(l);Math.floor(l/100)%2==0&&a.push([c.x,c.y])}return r.lineString(a,t.properties)}var r=t("@turf/helpers"),o=t("@turf/invariant"),s=function(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(i=0;i<this.length;i++)this.points[i].z=this.points[i].z||0;for(i=0;i<this.length-1;i++){var e=this.points[i],n=this.points[i+1];this.centers.push({x:(e.x+n.x)/2,y:(e.y+n.y)/2,z:(e.z+n.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var i=0;i<this.centers.length-1;i++){var e=this.centers[i],n=this.centers[i+1],r=this.points[i+1].x-(this.centers[i].x+this.centers[i+1].x)/2,o=this.points[i+1].y-(this.centers[i].y+this.centers[i+1].y)/2,s=this.points[i+1].z-(this.centers[i].y+this.centers[i+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[i+1].x+this.sharpness*(this.centers[i].x+r),y:(1-this.sharpness)*this.points[i+1].y+this.sharpness*(this.centers[i].y+o),z:(1-this.sharpness)*this.points[i+1].z+this.sharpness*(this.centers[i].z+s)},{x:(1-this.sharpness)*this.points[i+1].x+this.sharpness*(this.centers[i+1].x+r),y:(1-this.sharpness)*this.points[i+1].y+this.sharpness*(this.centers[i+1].y+o),z:(1-this.sharpness)*this.points[i+1].z+this.sharpness*(this.centers[i+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};s.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var i=0;i<this.duration;i+=10){var r=this.pos(i);Math.sqrt((r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y)+(r.z-n.z)*(r.z-n.z))>t&&(e.push(i),n=r)}return e},s.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))}},s.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);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]}}((this.length-1)*n-i,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],9:[function(t,e,n){"use strict";function i(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.getCoords(t),s=0,a=1;a<o.length;)n=i||o[0],s+=((i=o[a])[0]-n[0])*(i[1]+n[1]),a++;return s>0}var r=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":84}],10:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=m.getType(t),i=m.getType(e),r=m.getGeom(t),f=m.getGeom(e),d=m.getCoords(t),_=m.getCoords(e);switch(n){case"Point":switch(i){case"Point":return g(d,_);default:throw new Error("feature2 "+i+" geometry not supported")}case"MultiPoint":switch(i){case"Point":return o(r,f);case"MultiPoint":return s(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"LineString":switch(i){case"Point":return v(f,r,{ignoreEndVertices:!0});case"LineString":return l(r,f);case"MultiPoint":return a(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"Polygon":switch(i){case"Point":return p(f,r,{ignoreBoundary:!0});case"LineString":return c(r,f);case"Polygon":return h(r,f);case"MultiPoint":return u(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function o(t,e){var n,i=!1;for(n=0;n<t.coordinates.length;n++)if(g(t.coordinates[n],e.coordinates)){i=!0;break}return i}function s(t,e){for(var n=0;n<e.coordinates.length;n++){for(var i=!1,r=0;r<t.coordinates.length;r++)if(g(e.coordinates[n],t.coordinates[r])){i=!0;break}if(!i)return!1}return!0}function a(t,e){for(var n=!1,i=0;i<e.coordinates.length;i++)if(v(e.coordinates[i],t,{ignoreEndVertices:!0})&&(n=!0),!v(e.coordinates[i],t))return!1;return!!n}function u(t,e){for(var n=0;n<e.coordinates.length;n++)if(!p(e.coordinates[n],t,{ignoreBoundary:!0}))return!1;return!0}function l(t,e){for(var n=!1,i=0;i<e.coordinates.length;i++)if(v({type:"Point",coordinates:e.coordinates[i]},t,{ignoreEndVertices:!0})&&(n=!0),!v({type:"Point",coordinates:e.coordinates[i]},t,{ignoreEndVertices:!1}))return!1;return n}function c(t,e){var n=!1,i=0;if(!f(_(t),_(e)))return!1;for(i;i<e.coordinates.length-1;i++){var r=d(e.coordinates[i],e.coordinates[i+1]);if(p({type:"Point",coordinates:r},t,{ignoreBoundary:!0})){n=!0;break}}return n}function h(t,e){if(!f(_(t),_(e)))return!1;for(var n=0;n<e.coordinates[0].length;n++)if(!p(e.coordinates[0][n],t))return!1;return!0}function f(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function g(t,e){return t[0]===e[0]&&t[1]===e[1]}function d(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var p=i(t("@turf/boolean-point-in-polygon")),_=i(t("@turf/bbox")),v=i(t("@turf/boolean-point-on-line")),m=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/boolean-point-in-polygon":24,"@turf/boolean-point-on-line":25,"@turf/invariant":84}],11:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=d.getType(t),i=d.getType(e),r=d.getGeom(t),l=d.getGeom(e);switch(n){case"MultiPoint":switch(i){case"LineString":return o(r,l);case"Polygon":return u(r,l);default:throw new Error("feature2 "+i+" geometry not supported")}case"LineString":switch(i){case"MultiPoint":return o(l,r);case"LineString":return s(r,l);case"Polygon":return a(r,l);default:throw new Error("feature2 "+i+" geometry not supported")}case"Polygon":switch(i){case"MultiPoint":return u(l,r);case"LineString":return a(l,r);default:throw new Error("feature2 "+i+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function o(t,e){for(var n=!1,i=!1,r=t.coordinates.length,o=0;o<r&&!n&&!i;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),l(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:i=!0}o++}return n&&i}function s(t,e){if(f(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var i=0;i<e.coordinates.length-1;i++){var r=!0;if(0!==i&&i!==e.coordinates.length-2||(r=!1),l(t.coordinates[n],t.coordinates[n+1],e.coordinates[i],r))return!0}return!1}function a(t,e){return f(t,g(e)).features.length>0}function u(t,e){for(var n=!1,i=!1,r=t.coordinates[0].length,o=0;o<r&&n&&i;)h(c.point(t.coordinates[0][o]),e)?n=!0:i=!0,o++;return i&&i}function l(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?Math.abs(s)>=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]<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 c=t("@turf/helpers"),h=i(t("@turf/boolean-point-in-polygon")),f=i(t("@turf/line-intersect")),g=i(t("@turf/polygon-to-line")),d=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/boolean-point-in-polygon":24,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-intersect":91,"@turf/polygon-to-line":116}],12:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n;return g.flattenEach(t,function(t){g.flattenEach(e,function(e){if(!1===n)return!1;n=o(t.geometry,e.geometry)})}),n}function o(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!h(t.coordinates,e.coordinates);case"LineString":return!s(e,t);case"Polygon":return!f(t,e)}break;case"LineString":switch(e.type){case"Point":return!s(t,e);case"LineString":return!a(t,e);case"Polygon":return!u(e,t)}break;case"Polygon":switch(e.type){case"Point":return!f(e,t);case"LineString":return!u(t,e);case"Polygon":return!l(e,t)}}}function s(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(c(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function a(t,e){return d(t,e).features.length>0}function u(t,e){return d(e,p(t)).features.length>0}function l(t,e){for(var n=0;n<t.coordinates[0].length;n++)if(f(t.coordinates[0][n],e))return!0;for(var i=0;i<e.coordinates[0].length;i++)if(f(e.coordinates[0][i],t))return!0;return!1}function c(t,e,n){var i=n[0]-t[0],r=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0==i*s-r*o&&(Math.abs(o)>=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 h(t,e){return t[0]===e[0]&&t[1]===e[1]}var f=i(t("@turf/boolean-point-in-polygon")),g=t("@turf/meta"),d=i(t("@turf/line-intersect")),p=i(t("@turf/polygon-to-line"));e.exports=r,e.exports.default=r},{"@turf/boolean-point-in-polygon":24,"@turf/line-intersect":91,"@turf/meta":105,"@turf/polygon-to-line":116}],13:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return o.getType(t)===o.getType(e)&&new s({precision:6}).compare(r(t),r(e))}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clean-coords")),o=t("@turf/invariant"),s=t("geojson-equality");e.exports=i,e.exports.default=i},{"@turf/clean-coords":35,"@turf/invariant":84,"geojson-equality":17}],14:[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<t.length;o++)if(t[o]!==e[o])return!1;return!0}try{var h=a(t),f=a(e)}catch(t){return!1}if(h.length!=f.length)return!1;for(h.sort(),f.sort(),o=h.length-1;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":15,"./lib/keys.js":16}],15:[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).supported=i,n.unsupported=r},{}],16:[function(t,e,n){function i(t){var e=[];for(var n in t)e.push(n);return e}(e.exports="function"==typeof Object.keys?Object.keys:i).shim=i},{}],17:[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<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},a.prototype.compareLine=function(t,e,n,i){if(!r(t,e))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?e:this.removePseudo(e);if(!i||this.compareCoord(o[0],s[0])||(s=this.fixStartIndex(s,o))){var a=this.compareCoord(o[n],s[n]);return this.direction||a?this.comparePath(o,s):!!this.compareCoord(o[n],s[s.length-(1+n)])&&this.comparePath(o.slice().reverse(),s)}},a.prototype.fixStartIndex=function(t,e){for(var n,i=-1,r=0;r<t.length;r++)if(this.compareCoord(t[r],e[0])){i=r;break}return i>=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":14}],18:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=s.getType(t);if(n!==s.getType(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new l({precision:6}).compare(t,e))return!1;var i=0;switch(n){case"MultiPoint":var r=o.coordAll(t),c=o.coordAll(e);r.forEach(function(t){c.forEach(function(e){t[0]===e[0]&&t[1]===e[1]&&i++})});break;case"LineString":case"MultiLineString":o.segmentEach(t,function(t){o.segmentEach(e,function(e){a(t,e).features.length&&i++})});break;case"Polygon":case"MultiPolygon":o.segmentEach(t,function(t){o.segmentEach(e,function(e){u(t,e).features.length&&i++})})}return i>0}var o=t("@turf/meta"),s=t("@turf/invariant"),a=i(t("@turf/line-overlap")),u=i(t("@turf/line-intersect")),l=t("geojson-equality");e.exports=r,e.exports.default=r},{"@turf/invariant":84,"@turf/line-intersect":91,"@turf/line-overlap":94,"@turf/meta":105,"geojson-equality":22}],19:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{"./lib/is_arguments.js":20,"./lib/keys.js":21,dup:14}],20:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],21:[function(t,e,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],22:[function(t,e,n){arguments[4][17][0].apply(n,arguments)},{"deep-equal":19,dup:17}],23:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==s(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==s(e,"line2"))throw new Error("line2 must be a LineString");for(var n=u(a(t)).features,i=u(a(e)).features,r=0;r<n.length;r++){var l=n[r].geometry.coordinates;if(!i[r])break;if(!o(l,i[r].geometry.coordinates))return!1}return!0}function o(t,e){return c.bearingToAzimuth(l(t[0],t[1]))===c.bearingToAzimuth(l(e[0],e[1]))}function s(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}var a=i(t("@turf/clean-coords")),u=i(t("@turf/line-segment")),l=i(t("@turf/rhumb-bearing")),c=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/clean-coords":35,"@turf/helpers":79,"@turf/line-segment":96,"@turf/rhumb-bearing":133}],24:[function(t,e,n){"use strict";function i(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var a=s.getCoord(t),u=s.getCoords(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===o(a,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h<u.length&&!f;h++)if(r(a,u[h][0],i)){for(var g=!1,d=1;d<u[h].length&&!g;)r(a,u[h][d],!i)&&(g=!0),d++;g||(f=!0)}return f}function r(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function o(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":84}],25:[function(t,e,n){"use strict";function i(t,e,n){var i=(n=n||{}).ignoreEndVertices;if(!s.isObject(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var a=o.getCoord(t),u=o.getCoords(e),l=0;l<u.length-1;l++){var c=!1;if(i&&(0===l&&(c="start"),l===u.length-2&&(c="end"),0===l&&l+1===u.length-1&&(c="both")),r(u[l],u[l+1],a,c))return!0}return!1}function r(t,e,n,i){var r=n[0],o=n[1],s=t[0],a=t[1],u=e[0],l=e[1],c=u-s,h=l-a;return 0==(n[0]-s)*h-(n[1]-a)*c&&(i?"start"===i?Math.abs(c)>=Math.abs(h)?c>0?s<r&&r<=u:u<=r&&r<s:h>0?a<o&&o<=l:l<=o&&o<a:"end"===i?Math.abs(c)>=Math.abs(h)?c>0?s<=r&&r<u:u<r&&r<=s:h>0?a<=o&&o<l:l<o&&o<=a:"both"===i?Math.abs(c)>=Math.abs(h)?c>0?s<r&&r<u:u<r&&r<s:h>0?a<o&&o<l:l<o&&o<a:void 0:Math.abs(c)>=Math.abs(h)?c>0?s<=r&&r<=u:u<=r&&r<=s:h>0?a<=o&&o<=l:l<=o&&o<=a)}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],26:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=m.getType(t),i=m.getType(e),r=m.getGeom(t),f=m.getGeom(e);switch(n){case"Point":switch(i){case"MultiPoint":return o(r,f);case"LineString":return _(r,f,{ignoreEndVertices:!0});case"Polygon":return v(r,f,{ignoreBoundary:!0});default:throw new Error("feature2 "+i+" geometry not supported")}case"MultiPoint":switch(i){case"MultiPoint":return s(r,f);case"LineString":return a(r,f);case"Polygon":return u(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"LineString":switch(i){case"LineString":return l(r,f);case"Polygon":return c(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}case"Polygon":switch(i){case"Polygon":return h(r,f);default:throw new Error("feature2 "+i+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function o(t,e){var n,i=!1;for(n=0;n<e.coordinates.length;n++)if(g(e.coordinates[n],t.coordinates)){i=!0;break}return i}function s(t,e){for(var n=0;n<t.coordinates.length;n++){for(var i=!1,r=0;r<e.coordinates.length;r++)g(t.coordinates[n],e.coordinates[r])&&(i=!0);if(!i)return!1}return!0}function a(t,e){for(var n=!1,i=0;i<t.coordinates.length;i++){if(!_(t.coordinates[i],e))return!1;n||(n=_(t.coordinates[i],e,{ignoreEndVertices:!0}))}return n}function u(t,e){for(var n=!0,i=0;i<t.coordinates.length;i++){var r=v(t.coordinates[1],e);if(!r){n=!1;break}r=v(t.coordinates[1],e,{ignoreBoundary:!0})}return n&&r}function l(t,e){for(var n=0;n<t.coordinates.length;n++)if(!_(t.coordinates[n],e))return!1;return!0}function c(t,e){if(!f(p(e),p(t)))return!1;for(var n=!1,i=0;i<t.coordinates.length-1;i++){if(!v(t.coordinates[i],e))return!1;if(n||(n=v(t.coordinates[i],e,{ignoreBoundary:!0})),!n){var r=d(t.coordinates[i],t.coordinates[i+1]);n=v(r,e,{ignoreBoundary:!0})}}return n}function h(t,e){var n=p(t);if(!f(p(e),n))return!1;for(var i=0;i<t.coordinates[0].length;i++)if(!v(t.coordinates[0][i],e))return!1;return!0}function f(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function g(t,e){return t[0]===e[0]&&t[1]===e[1]}function d(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var p=i(t("@turf/bbox")),_=i(t("@turf/boolean-point-on-line")),v=i(t("@turf/boolean-point-in-polygon")),m=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/boolean-point-in-polygon":24,"@turf/boolean-point-on-line":25,"@turf/invariant":84}],27:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){var i=(n=n||{}).units,r=n.steps||64;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");r=r||64,i=i||"kilometers";var s=[];switch(t.type){case"GeometryCollection":return d.geomEach(t,function(t){var n=o(t,e,i,r);n&&s.push(n)}),_.featureCollection(s);case"FeatureCollection":return d.featureEach(t,function(t){var n=o(t,e,i,r);n&&d.featureEach(n,function(t){t&&s.push(t)})}),_.featureCollection(s)}return o(t,e,i,r)}function o(t,e,n,i){var r=t.properties||{},c="Feature"===t.type?t.geometry:t;if("GeometryCollection"===c.type){var p=[];return d.geomEach(t,function(t){var r=o(t,e,n,i);r&&p.push(r)}),_.featureCollection(p)}var v,m=h(t),y=m[1]>50&&m[3]>50;v=y?{type:c.type,coordinates:a(c.coordinates,l(c))}:g.toMercator(c);var x=(new f.GeoJSONReader).read(v),E=_.radiansToLength(_.lengthToRadians(e,n),"meters"),w=f.BufferOp.bufferOp(x,E);if(w=(new f.GeoJSONWriter).write(w),!s(w.coordinates)){var b;return(b=y?{type:w.type,coordinates:u(w.coordinates,l(c))}:g.toWgs84(w)).geometry?b:_.feature(b,r)}}function s(t){return Array.isArray(t[0])?s(t[0]):isNaN(t[0])}function a(t,e){return"object"!=typeof t[0]?e(t):t.map(function(t){return a(t,e)})}function u(t,e){return"object"!=typeof t[0]?e.invert(t):t.map(function(t){return u(t,e)})}function l(t){var e=c(t).geometry.coordinates.reverse(),n=e.map(function(t){return-t});return p.geoTransverseMercator().center(e).rotate(n).scale(_.earthRadius)}var c=i(t("@turf/center")),h=i(t("@turf/bbox")),f=t("jsts-es"),g=t("@turf/projection"),d=t("@turf/meta"),p=t("d3-geo"),_=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/center":32,"@turf/helpers":79,"@turf/meta":105,"@turf/projection":130,"d3-geo":29,"jsts-es":30}],28:[function(t,e,n){!function(t,i){i("object"==typeof n&&void 0!==e?n:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t){return function(e,n){return s(t(e),n)}}function n(t,e){return[t,e]}function i(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=E?10:o>=w?5:o>=b?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=E?10:o>=w?5:o>=b?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>=E?r*=10:o>=w?r*=5:o>=b&&(r*=2),e<t?-r:r}function o(t){return t.length}var s=function(t,e){return t<e?-1:t>e?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<r;){var o=i+r>>>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<r;){var o=i+r>>>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){return null===t?NaN:+t},f=function(t,e){var n,i,r=t.length,o=0,s=-1,a=0,u=0;if(null==e)for(;++s<r;)isNaN(n=h(t[s]))||(u+=(i=n-a)*(n-(a+=i/++o)));else for(;++s<r;)isNaN(n=h(e(t[s],s,t)))||(u+=(i=n-a)*(n-(a+=i/++o)));if(o>1)return u/(o-1)},g=function(t,e){var n=f(t,e);return n?Math.sqrt(n):n},d=function(t,e){var n,i,r,o=t.length,s=-1;if(null==e){for(;++s<o;)if(null!=(n=t[s])&&n>=n)for(i=r=n;++s<o;)null!=(n=t[s])&&(i>n&&(i=n),r<n&&(r=n))}else for(;++s<o;)if(null!=(n=e(t[s],s,t))&&n>=n)for(i=r=n;++s<o;)null!=(n=e(t[s],s,t))&&(i>n&&(i=n),r<n&&(r=n));return[i,r]},p=Array.prototype,_=p.slice,v=p.map,m=function(t){return function(){return t}},y=function(t){return t},x=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o},E=Math.sqrt(50),w=Math.sqrt(10),b=Math.sqrt(2),I=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},C=function(t,e,n){if(null==n&&(n=h),i=t.length){if((e=+e)<=0||i<2)return+n(t[0],0,t);if(e>=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)}},N=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&i>n&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&i>n&&(i=n);return i},S=function(t){if(!(r=t.length))return[];for(var e=-1,n=N(t,o),i=new Array(n);++e<n;)for(var r,s=-1,a=i[e]=new Array(r);++s<r;)a[s]=t[s][e];return i};t.bisect=l,t.bisectRight=l,t.bisectLeft=c,t.ascending=s,t.bisector=a,t.cross=function(t,e,i){var r,o,s,a,u=t.length,l=e.length,c=new Array(u*l);for(null==i&&(i=n),r=s=0;r<u;++r)for(a=t[r],o=0;o<l;++o,++s)c[s]=i(a,e[o]);return c},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=g,t.extent=d,t.histogram=function(){function t(t){var o,s,a=t.length,u=new Array(a);for(o=0;o<a;++o)u[o]=e(t[o],o,t);var c=n(u),h=c[0],f=c[1],g=i(u,h,f);Array.isArray(g)||(g=r(h,f,g),g=x(Math.ceil(h/g)*g,Math.floor(f/g)*g,g));for(var d=g.length;g[0]<=h;)g.shift(),--d;for(;g[d-1]>f;)g.pop(),--d;var p,_=new Array(d+1);for(o=0;o<=d;++o)(p=_[o]=[]).x0=o>0?g[o-1]:h,p.x1=o<d?g[o]:f;for(o=0;o<a;++o)h<=(s=u[o])&&s<=f&&_[l(g,s,0,d)].push(t[o]);return _}var e=y,n=d,i=I;return t.value=function(n){return arguments.length?(e="function"==typeof n?n:m(n),t):e},t.domain=function(e){return arguments.length?(n="function"==typeof e?e:m([e[0],e[1]]),t):n},t.thresholds=function(e){return arguments.length?(i="function"==typeof e?e:m(Array.isArray(e)?_.call(e):e),t):i},t},t.thresholdFreedmanDiaconis=function(t,e,n){return t=v.call(t,h).sort(s),Math.ceil((n-e)/(2*(C(t,.75)-C(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,n){return Math.ceil((n-e)/(3.5*g(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=I,t.max=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&n>i&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&n>i&&(i=n);return i},t.mean=function(t,e){var n,i=t.length,r=i,o=-1,s=0;if(null==e)for(;++o<i;)isNaN(n=h(t[o]))?--r:s+=n;else for(;++o<i;)isNaN(n=h(e(t[o],o,t)))?--r:s+=n;if(r)return s/r},t.median=function(t,e){var n,i=t.length,r=-1,o=[];if(null==e)for(;++r<i;)isNaN(n=h(t[r]))||o.push(n);else for(;++r<i;)isNaN(n=h(e(t[r],r,t)))||o.push(n);return C(o.sort(s),.5)},t.merge=function(t){for(var e,n,i,r=t.length,o=-1,s=0;++o<r;)s+=t[o].length;for(n=new Array(s);--r>=0;)for(e=(i=t[r]).length;--e>=0;)n[--s]=i[e];return n},t.min=N,t.pairs=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);i<r;)s[i]=e(o,o=t[++i]);return s},t.permute=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},t.quantile=C,t.range=x,t.scan=function(t,e){if(n=t.length){var n,i,r=0,o=0,a=t[o];for(null==e&&(e=s);++r<n;)(e(i=t[r],a)<0||0!==e(a,a))&&(a=i,o=r);return 0===e(a,a)?o:void 0}},t.shuffle=function(t,e,n){for(var i,r,o=(null==n?t.length:n)-(e=null==e?0:+e);o;)r=Math.random()*o--|0,i=t[o+e],t[o+e]=t[r+e],t[r+e]=i;return t},t.sum=function(t,e){var n,i=t.length,r=-1,o=0;if(null==e)for(;++r<i;)(n=+t[r])&&(o+=n);else for(;++r<i;)(n=+e(t[r],r,t))&&(o+=n);return o},t.ticks=function(t,e,n){var r,o,s,a,u=-1;if(e=+e,t=+t,n=+n,t===e&&n>0)return[t];if((r=e<t)&&(o=t,t=e,e=o),0===(a=i(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),s=new Array(o=Math.ceil(e-t+1));++u<o;)s[u]=(t+u)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),s=new Array(o=Math.ceil(t-e+1));++u<o;)s[u]=(t-u)/a;return r&&s.reverse(),s},t.tickIncrement=i,t.tickStep=r,t.transpose=S,t.variance=f,t.zip=function(){return S(arguments)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],29:[function(t,e,n){!function(i,r){"object"==typeof n&&void 0!==e?r(n,t("d3-array")):r(i.d3=i.d3||{},i.d3)}(this,function(t,e){"use strict";function n(){this.reset()}function i(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}function r(t){return t>1?0:t<-1?Ge:Math.acos(t)}function o(t){return t>1?qe:t<-1?-qe:Math.asin(t)}function s(t){return(t=Ke(t/2))*t}function a(){}function u(t,e){t&&nn.hasOwnProperty(t.type)&&nn[t.type](t,e)}function l(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function c(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)l(t[n],e,1);e.polygonEnd()}function h(){an.point=g}function f(){d(re,oe)}function g(t,e){an.point=d,re=t,oe=e,se=t*=ze,ae=Ue(e=(e*=ze)/2+ke),ue=Ke(e)}function d(t,e){e=(e*=ze)/2+ke;var n=(t*=ze)-se,i=n>=0?1:-1,r=i*n,o=Ue(e),s=Ke(e),a=ue*s,u=ae*o+a*Ue(r),l=a*i*Ke(r);on.add(Ve(l,u)),se=t,ae=o,ue=s}function p(t){return[Ve(t[1],t[0]),o(t[2])]}function _(t){var e=t[0],n=t[1],i=Ue(n);return[i*Ue(e),i*Ke(e),Ke(n)]}function v(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 y(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function x(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function E(t){var e=$e(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function w(t,e){ve.push(me=[le=t,he=t]),e<ce&&(ce=e),e>fe&&(fe=e)}function b(t,e){var n=_([t*ze,e*ze]);if(_e){var i=m(_e,n),r=m([i[1],-i[0],0],i);E(r),r=p(r);var o,s=t-ge,a=s>0?1:-1,u=r[0]*je*a,l=Ye(s)>180;l^(a*ge<u&&u<a*t)?(o=r[1]*je)>fe&&(fe=o):(u=(u+360)%360-180,l^(a*ge<u&&u<a*t)?(o=-r[1]*je)<ce&&(ce=o):(e<ce&&(ce=e),e>fe&&(fe=e))),l?t<ge?M(le,t)>M(le,he)&&(he=t):M(t,he)>M(le,he)&&(le=t):he>=le?(t<le&&(le=t),t>he&&(he=t)):t>ge?M(le,t)>M(le,he)&&(he=t):M(t,he)>M(le,he)&&(le=t)}else ve.push(me=[le=t,he=t]);e<ce&&(ce=e),e>fe&&(fe=e),_e=n,ge=t}function I(){ln.point=b}function C(){me[0]=le,me[1]=he,ln.point=w,_e=null}function N(t,e){if(_e){var n=t-ge;un.add(Ye(n)>180?n+(n>0?360:-360):n)}else de=t,pe=e;an.point(t,e),b(t,e)}function S(){an.lineStart()}function L(){N(de,pe),an.lineEnd(),Ye(un)>Fe&&(le=-(he=180)),me[0]=le,me[1]=he,_e=null}function M(t,e){return(e-=t)<0?e+360:e}function P(t,e){return t[0]-e[0]}function R(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function O(t,e){t*=ze;var n=Ue(e*=ze);T(n*Ue(t),n*Ke(t),Ke(e))}function T(t,e,n){Ee+=(t-Ee)/++ye,we+=(e-we)/ye,be+=(n-be)/ye}function A(){cn.point=D}function D(t,e){t*=ze;var n=Ue(e*=ze);Oe=n*Ue(t),Te=n*Ke(t),Ae=Ke(e),cn.point=F,T(Oe,Te,Ae)}function F(t,e){t*=ze;var n=Ue(e*=ze),i=n*Ue(t),r=n*Ke(t),o=Ke(e),s=Ve($e((s=Te*o-Ae*r)*s+(s=Ae*i-Oe*o)*s+(s=Oe*r-Te*i)*s),Oe*i+Te*r+Ae*o);xe+=s,Ie+=s*(Oe+(Oe=i)),Ce+=s*(Te+(Te=r)),Ne+=s*(Ae+(Ae=o)),T(Oe,Te,Ae)}function G(){cn.point=O}function q(){cn.point=B}function k(){j(Pe,Re),cn.point=O}function B(t,e){Pe=t,Re=e,t*=ze,e*=ze,cn.point=j;var n=Ue(e);Oe=n*Ue(t),Te=n*Ke(t),Ae=Ke(e),T(Oe,Te,Ae)}function j(t,e){t*=ze;var n=Ue(e*=ze),i=n*Ue(t),r=n*Ke(t),s=Ke(e),a=Te*s-Ae*r,u=Ae*i-Oe*s,l=Oe*r-Te*i,c=$e(a*a+u*u+l*l),h=o(c),f=c&&-h/c;Se+=f*a,Le+=f*u,Me+=f*l,xe+=h,Ie+=h*(Oe+(Oe=i)),Ce+=h*(Te+(Te=r)),Ne+=h*(Ae+(Ae=s)),T(Oe,Te,Ae)}function z(t,e){return[t>Ge?t-Be:t<-Ge?t+Be:t,e]}function Y(t,e,n){return(t%=Be)?e||n?fn(V(t),U(e,n)):V(t):e||n?U(e,n):z}function X(t){return function(e,n){return e+=t,[e>Ge?e-Be:e<-Ge?e+Be:e,n]}}function V(t){var e=X(t);return e.invert=X(-t),e}function U(t,e){function n(t,e){var n=Ue(e),u=Ue(t)*n,l=Ke(t)*n,c=Ke(e),h=c*i+u*r;return[Ve(l*s-h*a,u*i-c*r),o(h*s+l*a)]}var i=Ue(t),r=Ke(t),s=Ue(e),a=Ke(e);return n.invert=function(t,e){var n=Ue(e),u=Ue(t)*n,l=Ke(t)*n,c=Ke(e),h=c*s-l*a;return[Ve(l*s+c*a,u*i+h*r),o(h*i-u*r)]},n}function H(t,e,n,i,r,o){if(n){var s=Ue(e),a=Ke(e),u=i*n;null==r?(r=e+i*Be,o=e-u/2):(r=W(s,r),o=W(s,o),(i>0?r<o:r>o)&&(r+=i*Be));for(var l,c=r;i>0?c>o:c<o;c-=u)l=p([s,-a*Ue(c),-a*Ke(c)]),t.point(l[0],l[1])}}function W(t,e){(e=_(e))[0]-=t,E(e);var n=r(-e[1]);return((-e[2]<0?-n:n)+Be-Fe)%Be}function J(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Z(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function K(t,n,i,r){function o(e,o){return t<=e&&e<=i&&n<=o&&o<=r}function s(e,o,s,u){var c=0,h=0;if(null==e||(c=a(e,s))!==(h=a(o,s))||l(e,o)<0^s>0)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 Ye(e[0]-t)<Fe?r>0?0:3:Ye(e[0]-i)<Fe?r>0?2:1:Ye(e[1]-n)<Fe?r>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)&&b.point(t,e)}function c(){for(var e=0,n=0,i=g.length;n<i;++n)for(var o,s,a=g[n],u=1,l=a.length,c=a[0],h=c[0],f=c[1];u<l;++u)o=h,s=f,h=(c=a[u])[0],f=c[1],s<=r?f>r&&(h-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(h-o)*(r-s)<(f-s)*(t-o)&&--e;return e}function h(e,s){var a=o(e,s);if(g&&d.push([e,s]),E)p=e,_=s,v=a,E=!1,a&&(b.lineStart(),b.point(e,s));else if(a&&x)b.point(e,s);else{var u=[m=Math.max(Pn,Math.min(Mn,m)),y=Math.max(Pn,Math.min(Mn,y))],l=[e=Math.max(Pn,Math.min(Mn,e)),s=Math.max(Pn,Math.min(Mn,s))];Nn(u,l,t,n,i,r)?(x||(b.lineStart(),b.point(u[0],u[1])),b.point(l[0],l[1]),a||b.lineEnd(),w=!1):a&&(b.lineStart(),b.point(e,s),w=!1)}m=e,y=s,x=a}var f,g,d,p,_,v,m,y,x,E,w,b=a,I=Cn(),C={point:l,lineStart:function(){C.point=h,g&&g.push(d=[]),E=!0,x=!1,m=y=NaN},lineEnd:function(){f&&(h(p,_),v&&x&&I.rejoin(),f.push(I.result())),C.point=l,x&&b.lineEnd()},polygonStart:function(){b=I,f=[],g=[],w=!0},polygonEnd:function(){var t=c(),n=w&&t,i=(f=e.merge(f)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),i&&Ln(f,u,t,s,a),a.polygonEnd()),b=a,f=g=d=null}};return C}}function Q(){An.point=An.lineEnd=a}function $(t,e){gn=t*=ze,dn=Ke(e*=ze),pn=Ue(e),An.point=tt}function tt(t,e){t*=ze;var n=Ke(e*=ze),i=Ue(e),r=Ye(t-gn),o=Ue(r),s=i*Ke(r),a=pn*n-dn*i*o,u=dn*n+pn*i*o;Tn.add(Ve($e(s*s+a*a),u)),gn=t,dn=n,pn=i}function et(t,e){return!(!t||!Bn.hasOwnProperty(t.type))&&Bn[t.type](t,e)}function nt(t,e){return 0===qn(t,e)}function it(t,e){var n=qn(t[0],t[1]);return qn(t[0],e)+qn(e,t[1])<=n+Fe}function rt(t,e){return!!On(t.map(ot),st(e))}function ot(t){return(t=t.map(st)).pop(),t}function st(t){return[t[0]*ze,t[1]*ze]}function at(t,n,i){var r=e.range(t,n-Fe,i).concat(n);return function(t){return r.map(function(e){return[t,e]})}}function ut(t,n,i){var r=e.range(t,n-Fe,i).concat(n);return function(t){return r.map(function(e){return[e,t]})}}function lt(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return e.range(He(s/v)*v,o,v).map(g).concat(e.range(He(c/m)*m,l,m).map(d)).concat(e.range(He(r/p)*p,i,p).filter(function(t){return Ye(t%v)>Fe}).map(h)).concat(e.range(He(u/_)*_,a,_).filter(function(t){return Ye(t%m)>Fe}).map(f))}var i,r,o,s,a,u,l,c,h,f,g,d,p=10,_=p,v=90,m=360,y=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[g(s).concat(d(l).slice(1),g(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(y)):[[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(y)):[[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?(v=+e[0],m=+e[1],t):[v,m]},t.stepMinor=function(e){return arguments.length?(p=+e[0],_=+e[1],t):[p,_]},t.precision=function(e){return arguments.length?(y=+e,h=at(u,a,90),f=ut(r,i,y),g=at(c,l,90),d=ut(s,o,y),t):y},t.extentMajor([[-180,-90+Fe],[180,90-Fe]]).extentMinor([[-180,-80-Fe],[180,80+Fe]])}function ct(){Xn.point=ht}function ht(t,e){Xn.point=ft,_n=mn=t,vn=yn=e}function ft(t,e){Yn.add(yn*t-mn*e),mn=t,yn=e}function gt(){ft(_n,vn)}function dt(t,e){Zn+=t,Kn+=e,++Qn}function pt(){oi.point=_t}function _t(t,e){oi.point=vt,dt(wn=t,bn=e)}function vt(t,e){var n=t-wn,i=e-bn,r=$e(n*n+i*i);$n+=r*(wn+t)/2,ti+=r*(bn+e)/2,ei+=r,dt(wn=t,bn=e)}function mt(){oi.point=dt}function yt(){oi.point=Et}function xt(){wt(xn,En)}function Et(t,e){oi.point=wt,dt(xn=wn=t,En=bn=e)}function wt(t,e){var n=t-wn,i=e-bn,r=$e(n*n+i*i);$n+=r*(wn+t)/2,ti+=r*(bn+e)/2,ei+=r,ni+=(r=bn*t-wn*e)*(wn+t),ii+=r*(bn+e),ri+=3*r,dt(wn=t,bn=e)}function bt(t){this._context=t}function It(t,e){fi.point=Ct,ai=li=t,ui=ci=e}function Ct(t,e){li-=t,ci-=e,hi.add($e(li*li+ci*ci)),li=t,ci=e}function Nt(){this._string=[]}function St(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Lt(t){return t.length>1}function Mt(t,e){return((t=t.x)[0]<0?t[1]-qe-Fe:qe-t[1])-((e=e.x)[0]<0?e[1]-qe-Fe:qe-e[1])}function Pt(t,e,n,i){var r,o,s=Ke(t-n);return Ye(s)>Fe?Xe((Ke(e)*(o=Ue(i))*Ke(n)-Ke(i)*(r=Ue(e))*Ke(t))/(r*o*s)):(e+i)/2}function Rt(t){return function(e){var n=new Ot;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Ot(){}function Tt(t,e,n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),rn(n,t.stream(Jn));var s=Jn.result(),a=Math.min(i/(s[1][0]-s[0][0]),r/(s[1][1]-s[0][1])),u=+e[0][0]+(i-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(r-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,l])}function At(t,e,n){return Tt(t,[[0,0],e],n)}function Dt(t){return Rt({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function Ft(t,e){function n(i,r,s,a,u,l,c,h,f,g,d,p,_,v){var m=c-i,y=h-r,x=m*m+y*y;if(x>4*e&&_--){var E=a+g,w=u+d,b=l+p,I=$e(E*E+w*w+b*b),C=o(b/=I),N=Ye(Ye(b)-1)<Fe||Ye(s-f)<Fe?(s+f)/2:Ve(w,E),S=t(N,C),L=S[0],M=S[1],P=L-i,R=M-r,O=y*P-m*R;(O*O/x>e||Ye((m*P+y*R)/x-.5)>.3||a*g+u*d+l*p<vi)&&(n(i,r,s,a,u,l,L,M,N,E/=I,w/=I,b,_,v),v.point(L,M),n(L,M,N,E,w,b,c,h,f,g,d,p,_,v))}}return function(e){function i(n,i){n=t(n,i),e.point(n[0],n[1])}function r(){m=NaN,b.point=o,e.lineStart()}function o(i,r){var o=_([i,r]),s=t(i,r);n(m,y,v,x,E,w,m=s[0],y=s[1],v=i,x=o[0],E=o[1],w=o[2],_i,e),e.point(m,y)}function s(){b.point=i,e.lineEnd()}function a(){r(),b.point=u,b.lineEnd=l}function u(t,e){o(c=t,e),h=m,f=y,g=x,d=E,p=w,b.point=o}function l(){n(m,y,v,x,E,w,h,f,c,g,d,p,_i,e),b.lineEnd=s,s()}var c,h,f,g,d,p,v,m,y,x,E,w,b={point:i,lineStart:r,lineEnd:s,polygonStart:function(){e.polygonStart(),b.lineStart=a},polygonEnd:function(){e.polygonEnd(),b.lineStart=r}};return b}}function Gt(t){return qt(function(){return t})()}function qt(t){function e(t){return t=c(t[0]*ze,t[1]*ze),[t[0]*_+a,u-t[1]*_]}function n(t){return(t=c.invert((t[0]-a)/_,(u-t[1])/_))&&[t[0]*je,t[1]*je]}function i(t,e){return t=s(t,e),[t[0]*_+a,u-t[1]*_]}function r(){c=fn(l=Y(E,w,b),s);var t=s(y,x);return a=v-t[0]*_,u=m+t[1]*_,o()}function o(){return d=p=null,e}var s,a,u,l,c,h,f,g,d,p,_=150,v=480,m=250,y=0,x=0,E=0,w=0,b=0,I=null,C=di,N=null,S=jn,L=.5,M=mi(i,L);return e.stream=function(t){return d&&p===t?d:d=yi(C(l,M(S(p=t))))},e.clipAngle=function(t){return arguments.length?(C=+t?pi(I=t*ze,6*ze):(I=null,di),o()):I*je},e.clipExtent=function(t){return arguments.length?(S=null==t?(N=h=f=g=null,jn):K(N=+t[0][0],h=+t[0][1],f=+t[1][0],g=+t[1][1]),o()):null==N?null:[[N,h],[f,g]]},e.scale=function(t){return arguments.length?(_=+t,r()):_},e.translate=function(t){return arguments.length?(v=+t[0],m=+t[1],r()):[v,m]},e.center=function(t){return arguments.length?(y=t[0]%360*ze,x=t[1]%360*ze,r()):[y*je,x*je]},e.rotate=function(t){return arguments.length?(E=t[0]%360*ze,w=t[1]%360*ze,b=t.length>2?t[2]%360*ze:0,r()):[E*je,w*je,b*je]},e.precision=function(t){return arguments.length?(M=mi(i,L=t*t),o()):$e(L)},e.fitExtent=function(t,n){return Tt(e,t,n)},e.fitSize=function(t,n){return At(e,t,n)},function(){return s=t.apply(this,arguments),e.invert=s.invert&&n,r()}}function kt(t){var e=0,n=Ge/3,i=qt(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*ze,n=t[1]*ze):[e*je,n*je]},r}function Bt(t){function e(t,e){return[t*n,Ke(e)/n]}var n=Ue(t);return e.invert=function(t,e){return[t/n,o(e*n)]},e}function jt(t,e){function n(t,e){var n=$e(s-2*r*Ke(e))/r;return[n*Ke(t*=r),a-n*Ue(t)]}var i=Ke(t),r=(i+Ke(e))/2;if(Ye(r)<Fe)return Bt(t);var s=1+i*(2*r-i),a=$e(s)/r;return n.invert=function(t,e){var n=a-e;return[Ve(t,Ye(n))/r*Qe(n),o((s-(t*t+n*n)*r*r)/(2*r))]},n}function zt(t){var e=t.length;return{point:function(n,i){for(var r=-1;++r<e;)t[r].point(n,i)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function Yt(t){return function(e,n){var i=Ue(e),r=Ue(n),o=t(i*r);return[o*r*Ke(e),o*Ke(n)]}}function Xt(t){return function(e,n){var i=$e(e*e+n*n),r=t(i),s=Ke(r),a=Ue(r);return[Ve(e*s,i*a),o(i&&n*s/i)]}}function Vt(t,e){return[t,Je(tn((qe+e)/2))]}function Ut(t){function e(){var e=Ge*a(),s=o(In(o.rotate()).invert([0,0]));return l(null==c?[[s[0]-e,s[1]-e],[s[0]+e,s[1]+e]]:t===Vt?[[Math.max(s[0]-e,c),n],[Math.min(s[0]+e,i),r]]:[[c,Math.max(s[1]-e,n)],[i,Math.min(s[1]+e,r)]])}var n,i,r,o=Gt(t),s=o.center,a=o.scale,u=o.translate,l=o.clipExtent,c=null;return o.scale=function(t){return arguments.length?(a(t),e()):a()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(s(t),e()):s()},o.clipExtent=function(t){return arguments.length?(null==t?c=n=i=r=null:(c=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),e()):null==c?null:[[c,n],[i,r]]},e()}function Ht(t){return tn((qe+t)/2)}function Wt(t,e){function n(t,e){o>0?e<-qe+Fe&&(e=-qe+Fe):e>qe-Fe&&(e=qe-Fe);var n=o/Ze(Ht(e),r);return[n*Ke(r*t),o-n*Ue(r*t)]}var i=Ue(t),r=t===e?Ke(t):Je(i/Ue(e))/Je(Ht(e)/Ht(t)),o=i*Ze(Ht(t),r)/r;return r?(n.invert=function(t,e){var n=o-e,i=Qe(r)*$e(t*t+n*n);return[Ve(t,Ye(n))/r*Qe(n),2*Xe(Ze(o/i,1/r))-qe]},n):Vt}function Jt(t,e){return[t,e]}function Zt(t,e){function n(t,e){var n=o-e,i=r*t;return[n*Ke(i),o-n*Ue(i)]}var i=Ue(t),r=t===e?Ke(t):(i-Ue(e))/(e-t),o=i/r+t;return Ye(r)<Fe?Jt:(n.invert=function(t,e){var n=o-e;return[Ve(t,Ye(n))/r*Qe(n),o-Qe(r)*$e(t*t+n*n)]},n)}function Kt(t,e){var n=Ue(e),i=Ue(t)*n;return[n*Ke(t)/i,Ke(e)/i]}function Qt(t,e,n,i){return 1===t&&1===e&&0===n&&0===i?jn:Rt({point:function(r,o){this.stream.point(r*t+n,o*e+i)}})}function $t(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),e*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function te(t,e){return[Ue(e)*Ke(t),Ke(e)]}function ee(t,e){var n=Ue(e),i=1+Ue(t)*n;return[n*Ke(t)/i,Ke(e)/i]}function ne(t,e){return[Je(tn((qe+e)/2)),-t]}var ie=function(){return new n};n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){i(De,t,this.t),i(this,De.s,this.s),this.s?this.t+=De.t:this.s=De.t},valueOf:function(){return this.s}};var re,oe,se,ae,ue,le,ce,he,fe,ge,de,pe,_e,ve,me,ye,xe,Ee,we,be,Ie,Ce,Ne,Se,Le,Me,Pe,Re,Oe,Te,Ae,De=new n,Fe=1e-6,Ge=Math.PI,qe=Ge/2,ke=Ge/4,Be=2*Ge,je=180/Ge,ze=Ge/180,Ye=Math.abs,Xe=Math.atan,Ve=Math.atan2,Ue=Math.cos,He=Math.ceil,We=Math.exp,Je=Math.log,Ze=Math.pow,Ke=Math.sin,Qe=Math.sign||function(t){return t>0?1:t<0?-1:0},$e=Math.sqrt,tn=Math.tan,en={Feature:function(t,e){u(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)u(n[i].geometry,e)}},nn={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){l(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)l(n[i],e,0)},Polygon:function(t,e){c(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)c(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)u(n[i],e)}},rn=function(t,e){t&&en.hasOwnProperty(t.type)?en[t.type](t,e):u(t,e)},on=ie(),sn=ie(),an={point:a,lineStart:a,lineEnd:a,polygonStart:function(){on.reset(),an.lineStart=h,an.lineEnd=f},polygonEnd:function(){var t=+on;sn.add(t<0?Be+t:t),this.lineStart=this.lineEnd=this.point=a},sphere:function(){sn.add(Be)}},un=ie(),ln={point:w,lineStart:I,lineEnd:C,polygonStart:function(){ln.point=N,ln.lineStart=S,ln.lineEnd=L,un.reset(),an.polygonStart()},polygonEnd:function(){an.polygonEnd(),ln.point=w,ln.lineStart=I,ln.lineEnd=C,on<0?(le=-(he=180),ce=-(fe=90)):un>Fe?fe=90:un<-Fe&&(ce=-90),me[0]=le,me[1]=he}},cn={sphere:a,point:O,lineStart:A,lineEnd:G,polygonStart:function(){cn.lineStart=q,cn.lineEnd=k},polygonEnd:function(){cn.lineStart=A,cn.lineEnd=G}},hn=function(t){return function(){return t}},fn=function(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n};z.invert=z;var gn,dn,pn,_n,vn,mn,yn,xn,En,wn,bn,In=function(t){function e(e){return e=t(e[0]*ze,e[1]*ze),e[0]*=je,e[1]*=je,e}return t=Y(t[0]*ze,t[1]*ze,t.length>2?t[2]*ze:0),e.invert=function(e){return e=t.invert(e[0]*ze,e[1]*ze),e[0]*=je,e[1]*=je,e},e},Cn=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}}},Nn=function(t,e,n,i,r,o){var s,a=t[0],u=t[1],l=0,c=1,h=e[0]-a,f=e[1]-u;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<l)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>l&&(l=s)}if(s=r-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>l&&(l=s)}else if(h>0){if(s<l)return;s<c&&(c=s)}if(s=i-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<c&&(c=s)}else if(f>0){if(s>c)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>c)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<c&&(c=s)}return l>0&&(t[0]=a+l*h,t[1]=u+l*f),c<1&&(e[0]=a+c*h,e[1]=u+c*f),!0}}}}},Sn=function(t,e){return Ye(t[0]-e[0])<Fe&&Ye(t[1]-e[1])<Fe},Ln=function(t,e,n,i,r){var o,s,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],s=t[e];if(Sn(i,s)){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);r.lineEnd()}else a.push(n=new J(i,t,null,!0)),u.push(n.o=new J(i,null,n,!1)),a.push(n=new J(s,t,null,!1)),u.push(n.o=new J(s,null,n,!0))}}),a.length){for(u.sort(e),Z(a),Z(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var f=h,g=!0;f.v;)if((f=f.n)===h)return;l=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(g)for(o=0,s=l.length;o<s;++o)r.point((c=l[o])[0],c[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(g)for(l=f.p.z,o=l.length-1;o>=0;--o)r.point((c=l[o])[0],c[1]);else i(f.x,f.p.x,-1,r);f=f.p}l=(f=f.o).z,g=!g}while(!f.v);r.lineEnd()}}},Mn=1e9,Pn=-Mn,Rn=ie(),On=function(t,e){var n=e[0],i=e[1],r=[Ke(n),-Ue(n),0],s=0,a=0;Rn.reset();for(var u=0,l=t.length;u<l;++u)if(h=(c=t[u]).length)for(var c,h,f=c[h-1],g=f[0],d=f[1]/2+ke,p=Ke(d),v=Ue(d),y=0;y<h;++y,g=w,p=I,v=C,f=x){var x=c[y],w=x[0],b=x[1]/2+ke,I=Ke(b),C=Ue(b),N=w-g,S=N>=0?1:-1,L=S*N,M=L>Ge,P=p*I;if(Rn.add(Ve(P*S*Ke(L),v*C+P*Ue(L))),s+=M?N+S*Be:N,M^g>=n^w>=n){var R=m(_(f),_(x));E(R);var O=m(r,R);E(O);var T=(M^N>=0?-1:1)*o(O[2]);(i>T||i===T&&(R[0]||R[1]))&&(a+=M^N>=0?1:-1)}}return(s<-Fe||s<Fe&&Rn<-Fe)^1&a},Tn=ie(),An={sphere:a,point:a,lineStart:function(){An.point=$,An.lineEnd=Q},lineEnd:a,polygonStart:a,polygonEnd:a},Dn=function(t){return Tn.reset(),rn(t,An),+Tn},Fn=[null,null],Gn={type:"LineString",coordinates:Fn},qn=function(t,e){return Fn[0]=t,Fn[1]=e,Dn(Gn)},kn={Feature:function(t,e){return et(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(et(n[i].geometry,e))return!0;return!1}},Bn={Sphere:function(){return!0},Point:function(t,e){return nt(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(nt(n[i],e))return!0;return!1},LineString:function(t,e){return it(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(it(n[i],e))return!0;return!1},Polygon:function(t,e){return rt(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(rt(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(et(n[i],e))return!0;return!1}},jn=function(t){return t},zn=ie(),Yn=ie(),Xn={point:a,lineStart:a,lineEnd:a,polygonStart:function(){Xn.lineStart=ct,Xn.lineEnd=gt},polygonEnd:function(){Xn.lineStart=Xn.lineEnd=Xn.point=a,zn.add(Ye(Yn)),Yn.reset()},result:function(){var t=zn/2;return zn.reset(),t}},Vn=1/0,Un=Vn,Hn=-Vn,Wn=Hn,Jn={point:function(t,e){t<Vn&&(Vn=t),t>Hn&&(Hn=t),e<Un&&(Un=e),e>Wn&&(Wn=e)},lineStart:a,lineEnd:a,polygonStart:a,polygonEnd:a,result:function(){var t=[[Vn,Un],[Hn,Wn]];return Hn=Wn=-(Un=Vn=1/0),t}},Zn=0,Kn=0,Qn=0,$n=0,ti=0,ei=0,ni=0,ii=0,ri=0,oi={point:dt,lineStart:pt,lineEnd:mt,polygonStart:function(){oi.lineStart=yt,oi.lineEnd=xt},polygonEnd:function(){oi.point=dt,oi.lineStart=pt,oi.lineEnd=mt},result:function(){var t=ri?[ni/ri,ii/ri]:ei?[$n/ei,ti/ei]:Qn?[Zn/Qn,Kn/Qn]:[NaN,NaN];return Zn=Kn=Qn=$n=ti=ei=ni=ii=ri=0,t}};bt.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Be)}},result:a};var si,ai,ui,li,ci,hi=ie(),fi={point:a,lineStart:function(){fi.point=It},lineEnd:function(){si&&Ct(ai,ui),fi.point=a},polygonStart:function(){si=!0},polygonEnd:function(){si=null},result:function(){var t=+hi;return hi.reset(),t}};Nt.prototype={_radius:4.5,_circle:St(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=St(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var gi=function(t,n,i,r){return function(o,s){function a(e,n){var i=o(e,n);t(e=i[0],n=i[1])&&s.point(e,n)}function u(t,e){var n=o(t,e);v.point(n[0],n[1])}function l(){w.point=u,v.lineStart()}function c(){w.point=a,v.lineEnd()}function h(t,e){_.push([t,e]);var n=o(t,e);x.point(n[0],n[1])}function f(){x.lineStart(),_=[]}function g(){h(_[0][0],_[0][1]),x.lineEnd();var t,e,n,i,r=x.clean(),o=y.result(),a=o.length;if(_.pop(),d.push(_),_=null,a)if(1&r){if(n=o[0],(e=n.length-1)>0){for(E||(s.polygonStart(),E=!0),s.lineStart(),t=0;t<e;++t)s.point((i=n[t])[0],i[1]);s.lineEnd()}}else a>1&&2&r&&o.push(o.pop().concat(o.shift())),p.push(o.filter(Lt))}var d,p,_,v=n(s),m=o.invert(r[0],r[1]),y=Cn(),x=n(y),E=!1,w={point:a,lineStart:l,lineEnd:c,polygonStart:function(){w.point=h,w.lineStart=f,w.lineEnd=g,p=[],d=[]},polygonEnd:function(){w.point=a,w.lineStart=l,w.lineEnd=c,p=e.merge(p);var t=On(d,m);p.length?(E||(s.polygonStart(),E=!0),Ln(p,Mt,t,i,s)):t&&(E||(s.polygonStart(),E=!0),s.lineStart(),i(null,null,1,s),s.lineEnd()),E&&(s.polygonEnd(),E=!1),p=d=null},sphere:function(){s.polygonStart(),s.lineStart(),i(null,null,1,s),s.lineEnd(),s.polygonEnd()}};return w}},di=gi(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Ge:-Ge,u=Ye(o-n);Ye(u-Ge)<Fe?(t.point(n,i=(i+s)/2>0?qe:-qe),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(o,i),e=0):r!==a&&u>=Ge&&(Ye(n-r)<Fe&&(n-=r*Fe),Ye(o-a)<Fe&&(o-=a*Fe),i=Pt(n,i,o,s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=o,i=s),r=a},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*qe,i.point(-Ge,r),i.point(0,r),i.point(Ge,r),i.point(Ge,0),i.point(Ge,-r),i.point(0,-r),i.point(-Ge,-r),i.point(-Ge,0),i.point(-Ge,r);else if(Ye(t[0]-e[0])>Fe){var o=t[0]<e[0]?Ge:-Ge;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(e[0],e[1])},[-Ge,-qe]),pi=function(t,e){function n(t,e){return Ue(t)*Ue(e)>o}function i(t,e,n){var i=[1,0,0],r=m(_(t),_(e)),s=v(r,r),a=r[0],u=s-a*a;if(!u)return!n&&t;var l=o*s/u,c=-o*a/u,h=m(i,r),f=x(i,l);y(f,x(r,c));var g=h,d=v(f,g),E=v(g,g),w=d*d-E*(v(f,f)-1);if(!(w<0)){var b=$e(w),I=x(g,(-d-b)/E);if(y(I,f),I=p(I),!n)return I;var C,N=t[0],S=e[0],L=t[1],M=e[1];S<N&&(C=N,N=S,S=C);var P=S-N,R=Ye(P-Ge)<Fe;if(!R&&M<L&&(C=L,L=M,M=C),R||P<Fe?R?L+M>0^I[1]<(Ye(I[0]-N)<Fe?L:M):L<=I[1]&&I[1]<=M:P>Ge^(N<=I[0]&&I[0]<=S)){var O=x(g,(-d+b)/E);return y(O,f),[I,p(O)]}}}function r(e,n){var i=s?t:Ge-t,r=0;return e<-i?r|=1:e>i&&(r|=2),n<-i?r|=4:n>i&&(r|=8),r}var o=Ue(t),s=o>0,a=Ye(o)>Fe;return gi(n,function(t){var e,o,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var g,d=[h,f],p=n(h,f),_=s?p?0:r(h,f):p?r(h+(h<0?Ge:-Ge),f):0;if(!e&&(l=u=p)&&t.lineStart(),p!==u&&(!(g=i(e,d))||Sn(e,g)||Sn(d,g))&&(d[0]+=Fe,d[1]+=Fe,p=n(d[0],d[1])),p!==u)c=0,p?(t.lineStart(),g=i(d,e),t.point(g[0],g[1])):(g=i(e,d),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(a&&e&&s^p){var v;_&o||!(v=i(d,e,!0))||(c=0,s?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!p||e&&Sn(e,d)||t.point(d[0],d[1]),e=d,u=p,o=_},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}},function(n,i,r,o){H(o,t,e,r,n,i)},s?[0,-t]:[-Ge,t-Ge])};Ot.prototype={constructor:Ot,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 _i=16,vi=Ue(30*ze),mi=function(t,e){return+e?Ft(t,e):Dt(t)},yi=Rt({point:function(t,e){this.stream.point(t*ze,e*ze)}}),xi=function(){return kt(jt).scale(155.424).center([0,33.6442])},Ei=function(){return xi().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},wi=Yt(function(t){return $e(2/(1+t))});wi.invert=Xt(function(t){return 2*o(t/2)});var bi=Yt(function(t){return(t=r(t))&&t/Ke(t)});bi.invert=Xt(function(t){return t});Vt.invert=function(t,e){return[t,2*Xe(We(e))-qe]};Jt.invert=Jt;Kt.invert=Xt(Xe);$t.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,s=o*o;i-=n=(i*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(Ye(n)>Fe&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]};te.invert=Xt(o);ee.invert=Xt(function(t){return 2*Xe(t)});ne.invert=function(t,e){return[-e,2*Xe(We(t))-qe]};t.geoArea=function(t){return sn.reset(),rn(t,an),2*sn},t.geoBounds=function(t){var e,n,i,r,o,s,a;if(fe=he=-(le=ce=1/0),ve=[],rn(t,ln),n=ve.length){for(ve.sort(P),e=1,o=[i=ve[0]];e<n;++e)R(i,(r=ve[e])[0])||R(i,r[1])?(M(i[0],r[1])>M(i[0],i[1])&&(i[1]=r[1]),M(r[0],i[1])>M(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(a=M(i[1],r[0]))>s&&(s=a,le=r[0],he=i[1])}return ve=me=null,le===1/0||ce===1/0?[[NaN,NaN],[NaN,NaN]]:[[le,ce],[he,fe]]},t.geoCentroid=function(t){ye=xe=Ee=we=be=Ie=Ce=Ne=Se=Le=Me=0,rn(t,cn);var e=Se,n=Le,i=Me,r=e*e+n*n+i*i;return r<1e-12&&(e=Ie,n=Ce,i=Ne,xe<Fe&&(e=Ee,n=we,i=be),(r=e*e+n*n+i*i)<1e-12)?[NaN,NaN]:[Ve(n,e)*je,o(i/$e(r))*je]},t.geoCircle=function(){function t(){var t=i.apply(this,arguments),a=r.apply(this,arguments)*ze,u=o.apply(this,arguments)*ze;return e=[],n=Y(-t[0]*ze,-t[1]*ze,0).invert,H(s,a,u,1),t={type:"Polygon",coordinates:[e]},e=n=null,t}var e,n,i=hn([0,0]),r=hn(90),o=hn(6),s={point:function(t,i){e.push(t=n(t,i)),t[0]*=je,t[1]*=je}};return t.center=function(e){return arguments.length?(i="function"==typeof e?e:hn([+e[0],+e[1]]),t):i},t.radius=function(e){return arguments.length?(r="function"==typeof e?e:hn(+e),t):r},t.precision=function(e){return arguments.length?(o="function"==typeof e?e:hn(+e),t):o},t},t.geoClipExtent=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]]}}},t.geoContains=function(t,e){return(t&&kn.hasOwnProperty(t.type)?kn[t.type]:et)(t,e)},t.geoDistance=qn,t.geoGraticule=lt,t.geoGraticule10=function(){return lt()()},t.geoInterpolate=function(t,e){var n=t[0]*ze,i=t[1]*ze,r=e[0]*ze,a=e[1]*ze,u=Ue(i),l=Ke(i),c=Ue(a),h=Ke(a),f=u*Ue(n),g=u*Ke(n),d=c*Ue(r),p=c*Ke(r),_=2*o($e(s(a-i)+u*c*s(r-n))),v=Ke(_),m=_?function(t){var e=Ke(t*=_)/v,n=Ke(_-t)/v,i=n*f+e*d,r=n*g+e*p,o=n*l+e*h;return[Ve(r,i)*je,Ve(o,$e(i*i+r*r))*je]}:function(){return[n*je,i*je]};return m.distance=_,m},t.geoLength=Dn,t.geoPath=function(t,e){function n(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),rn(t,i(r))),r.result()}var i,r,o=4.5;return n.area=function(t){return rn(t,i(Xn)),Xn.result()},n.measure=function(t){return rn(t,i(fi)),fi.result()},n.bounds=function(t){return rn(t,i(Jn)),Jn.result()},n.centroid=function(t){return rn(t,i(oi)),oi.result()},n.projection=function(e){return arguments.length?(i=null==e?(t=null,jn):(t=e).stream,n):t},n.context=function(t){return arguments.length?(r=null==t?(e=null,new Nt):new bt(e=t),"function"!=typeof o&&r.pointRadius(o),n):e},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),n):o},n.projection(t).context(e)},t.geoAlbers=Ei,t.geoAlbersUsa=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=Ei(),l=xi().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=xi().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=zt([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+Fe,a+.12*n+Fe],[i-.214*n-Fe,a+.234*n-Fe]]).stream(h),s=c.translate([i-.205*n,a+.212*n]).clipExtent([[i-.214*n+Fe,a+.166*n+Fe],[i-.115*n-Fe,a+.234*n-Fe]]).stream(h),e()},t.fitExtent=function(e,n){return Tt(t,e,n)},t.fitSize=function(e,n){return At(t,e,n)},t.scale(1070)},t.geoAzimuthalEqualArea=function(){return Gt(wi).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=wi,t.geoAzimuthalEquidistant=function(){return Gt(bi).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=bi,t.geoConicConformal=function(){return kt(Wt).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=Wt,t.geoConicEqualArea=xi,t.geoConicEqualAreaRaw=jt,t.geoConicEquidistant=function(){return kt(Zt).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=Zt,t.geoEquirectangular=function(){return Gt(Jt).scale(152.63)},t.geoEquirectangularRaw=Jt,t.geoGnomonic=function(){return Gt(Kt).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=Kt,t.geoIdentity=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=jn,g=null,d=jn;return s={stream:function(t){return r&&o===t?r:r=f(d(o=t))},clipExtent:function(r){return arguments.length?(d=null==r?(g=e=n=i=null,jn):K(g=+r[0][0],e=+r[0][1],n=+r[1][0],i=+r[1][1]),t()):null==g?null:[[g,e],[n,i]]},scale:function(e){return arguments.length?(f=Qt((a=+e)*c,a*h,u,l),t()):a},translate:function(e){return arguments.length?(f=Qt(a*c,a*h,u=+e[0],l=+e[1]),t()):[u,l]},reflectX:function(e){return arguments.length?(f=Qt(a*(c=e?-1:1),a*h,u,l),t()):c<0},reflectY:function(e){return arguments.length?(f=Qt(a*c,a*(h=e?-1:1),u,l),t()):h<0},fitExtent:function(t,e){return Tt(s,t,e)},fitSize:function(t,e){return At(s,t,e)}}},t.geoProjection=Gt,t.geoProjectionMutator=qt,t.geoMercator=function(){return Ut(Vt).scale(961/Be)},t.geoMercatorRaw=Vt,t.geoNaturalEarth1=function(){return Gt($t).scale(175.295)},t.geoNaturalEarth1Raw=$t,t.geoOrthographic=function(){return Gt(te).scale(249.5).clipAngle(90+Fe)},t.geoOrthographicRaw=te,t.geoStereographic=function(){return Gt(ee).scale(250).clipAngle(142)},t.geoStereographicRaw=ee,t.geoTransverseMercator=function(){var t=Ut(ne),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.geoTransverseMercatorRaw=ne,t.geoRotation=In,t.geoStream=rn,t.geoTransform=function(t){return{stream:Rt(t)}},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":28}],30:[function(t,e,n){"use strict";function i(){}function r(){}function o(){}function s(){}function a(){}function u(){}function l(){}function c(t){this.name="RuntimeException",this.message=t,this.stack=(new Error).stack,Error.call(this,t)}function h(){if(0===arguments.length)c.call(this);else if(1===arguments.length){var t=arguments[0];c.call(this,t)}}function f(){}function g(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)g.call(this,0,0);else if(1===arguments.length){var t=arguments[0];g.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];g.call(this,e,n,g.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 r("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}function p(){}function _(){}function v(t){this.message=t||""}function m(){}function y(t){this.message=t||""}function x(t){this.message=t||""}function E(){this.array_=[],arguments[0]instanceof _&&this.addAll(arguments[0])}function w(){if(E.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 b(){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 g){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof b){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 I(){}function C(){I.call(this,"Projective point not representable on the Cartesian plane.")}function N(){}function S(){}function L(t){this.str=t}function M(t){this.value=t}function P(){}function R(){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 R){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];R.call(this,R.parse(n))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}function O(){}function T(){}function A(){}function D(){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 D&&arguments[1]instanceof D){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 g&&arguments[1]instanceof g){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],p=c.y-h.y,_=h.x-c.x,v=c.x*h.y-h.x*c.y,m=f.y-d.y,y=d.x-f.x,x=f.x*d.y-d.x*f.y;this.x=_*x-y*v,this.y=m*v-p*x,this.w=p*y-m*_}}function F(){}function G(){}function q(){this._envelope=null,this._factory=null,this._SRID=null,this._userData=null;var t=arguments[0];this._factory=t,this._SRID=t.getSRID()}function k(){}function B(){}function j(){}function z(){}function Y(){}function X(){}function V(){}function U(){}function H(){}function W(){}function J(){}function Z(){}function K(){this.array_=[],arguments[0]instanceof _&&this.addAll(arguments[0])}function Q(t){return null==t?es:t.color}function $(t){return null==t?null:t.parent}function tt(t,e){null!==t&&(t.color=e)}function et(t){return null==t?null:t.left}function nt(t){return null==t?null:t.right}function it(){this.root_=null,this.size_=0}function rt(){}function ot(){}function st(){this.array_=[],arguments[0]instanceof _&&this.addAll(arguments[0])}function at(){}function ut(){}function lt(){}function ct(){}function ht(){this._geometries=null;var t=arguments[0],e=arguments[1];if(q.call(this,e),null===t&&(t=[]),q.hasNullElements(t))throw new r("geometries must not contain null elements");this._geometries=t}function ft(){var t=arguments[0],e=arguments[1];ht.call(this,t,e)}function gt(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0];gt.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 dt(){this.count=null}function pt(){}function _t(){}function vt(){}function mt(){}function yt(){}function xt(){}function Et(){}function wt(){this._points=null;var t=arguments[0],e=arguments[1];q.call(this,e),this.init(t)}function bt(){}function It(){this._coordinates=null;var t=arguments[0],e=arguments[1];q.call(this,e),this.init(t)}function Ct(){}function Nt(){this._shell=null,this._holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(q.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),q.hasNullElements(e))throw new r("holes must not contain null elements");if(t.isEmpty()&&q.hasNonEmptyElements(e))throw new r("shell is empty but holes are not");this._shell=t,this._holes=e}function St(){var t=arguments[0],e=arguments[1];ht.call(this,t,e)}function Lt(){if(arguments[0]instanceof g&&arguments[1]instanceof Vt){var t=arguments[0],e=arguments[1];Lt.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if($o(arguments[0],T)&&arguments[1]instanceof Vt){var n=arguments[0],i=arguments[1];wt.call(this,n,i),this.validateConstruction()}}function Mt(){var t=arguments[0],e=arguments[1];ht.call(this,t,e)}function Pt(){if(this._factory=null,this._isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._factory=t}}function Rt(){}function Ot(){}function Tt(){}function At(){}function Dt(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];Dt.call(this,t,3)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(a=0;a<e;a++)this._coordinates[a]=new g}else if($o(arguments[0],T)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(a=0;a<this._coordinates.length;a++)this._coordinates[a]=n.getCoordinateCopy(a)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1];this._coordinates=i,this._dimension=r,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=new Array(o).fill(null),this._dimension=s;for(var a=0;a<o;a++)this._coordinates[a]=new g}}function Ft(){}function Gt(t,e){return t===e||t!=t&&e!=e}function qt(t){this.add?t.forEach(this.add,this):t.forEach(function(t){this.set(t[0],t[1])},this)}function kt(t,e){if(this.objectOnly&&e!==Object(e))throw new TypeError("Invalid value used as weak collection key");if(e!=e||0===e)for(is=t.length;is--&&!Gt(t[is],e););else is=t.indexOf(e);return is>-1}function Bt(t,e,n){var i=[0],r=!1;return t.push(i),{next:function(){var o,s=i[0];return!r&&s<e.length?(o=n?[e[s],n[s]]:e[s],i[0]++):(r=!0,t.splice(t.indexOf(i),1)),{done:r,value:o}}}}function jt(){return this._values.length}function zt(){this.map_=new ss}function Yt(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=Yt.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Xt){var t=arguments[0];this._modelType=t,t===Yt.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var e=arguments[0];this._modelType=Yt.FIXED,this.setScale(e)}else if(arguments[0]instanceof Yt){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}function Xt(){this._name=null;var t=arguments[0];this._name=t,Xt.nameToTypeMap.put(t,this)}function Vt(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,0===arguments.length)Vt.call(this,new Yt,0);else if(1===arguments.length){if($o(arguments[0],F)){var t=arguments[0];Vt.call(this,new Yt,0,t)}else if(arguments[0]instanceof Yt){var e=arguments[0];Vt.call(this,e,0,Vt.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];Vt.call(this,n,i,Vt.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this._precisionModel=r,this._coordinateSequenceFactory=s,this._SRID=o}}function Ut(t){this.geometryFactory=t||new Vt}function Ht(t){this.parser=new Ut(t)}function Wt(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new g,this._intPt[1]=new g,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}function Jt(){Wt.apply(this)}function Zt(){}function Kt(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}function Qt(){}function $t(){if(this.p0=null,this.p1=null,0===arguments.length)$t.call(this,new g,new g);else if(1===arguments.length){var t=arguments[0];$t.call(this,t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0=e,this.p1=n}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];$t.call(this,new g(i,r),new g(o,s))}}function te(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(ut.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];te.call(this),this.set(t)}else if(arguments[0]instanceof te){var e=arguments[0];te.call(this),this._matrix[N.INTERIOR][N.INTERIOR]=e._matrix[N.INTERIOR][N.INTERIOR],this._matrix[N.INTERIOR][N.BOUNDARY]=e._matrix[N.INTERIOR][N.BOUNDARY],this._matrix[N.INTERIOR][N.EXTERIOR]=e._matrix[N.INTERIOR][N.EXTERIOR],this._matrix[N.BOUNDARY][N.INTERIOR]=e._matrix[N.BOUNDARY][N.INTERIOR],this._matrix[N.BOUNDARY][N.BOUNDARY]=e._matrix[N.BOUNDARY][N.BOUNDARY],this._matrix[N.BOUNDARY][N.EXTERIOR]=e._matrix[N.BOUNDARY][N.EXTERIOR],this._matrix[N.EXTERIOR][N.INTERIOR]=e._matrix[N.EXTERIOR][N.INTERIOR],this._matrix[N.EXTERIOR][N.BOUNDARY]=e._matrix[N.EXTERIOR][N.BOUNDARY],this._matrix[N.EXTERIOR][N.EXTERIOR]=e._matrix[N.EXTERIOR][N.EXTERIOR]}}function ee(){this._areaBasePt=null,this._triangleCent3=new g,this._areasum2=0,this._cg3=new g,this._lineCentSum=new g,this._totalLength=0,this._ptCount=0,this._ptCentSum=new g;var t=arguments[0];this._areaBasePt=null,this.add(t)}function ne(t){this.message=t||""}function ie(){this.array_=[]}function re(){this.treeSet=new st,this.list=new E}function oe(){if(this._geomFactory=null,this._inputPts=null,1===arguments.length){var t=arguments[0];oe.call(this,oe.extractCoordinates(t),t.getFactory())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._inputPts=re.filterCoordinates(e),this._geomFactory=n}}function se(){this._origin=null;var t=arguments[0];this._origin=t}function ae(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}function ue(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new $t,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof wt&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];ue.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=ue.isClosed(n),this._snapTolerance=i}}function le(){this._srcGeom=null;var t=arguments[0];this._srcGeom=t}function ce(){if(ae.apply(this),this._snapTolerance=null,this._snapPts=null,this._isSelfSnap=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._snapTolerance=t,this._snapPts=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._snapTolerance=n,this._snapPts=i,this._isSelfSnap=r}}function he(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null}function fe(){this._commonCoord=null,this._ccFilter=new ge}function ge(){this._commonBitsX=new he,this._commonBitsY=new he}function de(){this.trans=null;var t=arguments[0];this.trans=t}function pe(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()}function _e(){if(this._boundaryRule=B.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new r("Rule must be non-null");this._boundaryRule=t}}function ve(){}function me(){}function ye(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}function xe(){}function Ee(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}function we(){this._size=null,this._items=null,this._size=0,this._items=new E,this._items.add(null)}function be(){}function Ie(){}function Ce(){if(this._childBoundables=new E,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}function Ne(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()}function Se(){if(this._root=null,this._built=!1,this._itemBoundables=new E,this._nodeCapacity=null,0===arguments.length)Se.call(this,Se.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];f.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}function Le(){}function Me(){if(0===arguments.length)Me.call(this,Me.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Se.call(this,t)}}function Pe(){var t=arguments[0];Ce.call(this,t)}function Re(){}function Oe(){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 g(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}function Te(){this._nodeMap=new it,this._edge=null;var t=arguments[0];this._edge=t}function Ae(){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 De(){}function Fe(){this._nodeList=new Te(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}function Ge(){this.tempEnv1=new b,this.tempEnv2=new b,this._overlapSeg1=new $t,this._overlapSeg2=new $t}function qe(){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 Be(){}function je(){}function ze(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function Ye(){if(this._monoChains=new E,this._index=new Me,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];ze.call(this,t)}}function Xe(){Ge.apply(this),this._si=null;var t=arguments[0];this._si=t}function Ve(){if(this.pt=null,1===arguments.length){var t=arguments[0];c.call(this,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];c.call(this,Ve.msgWithCoord(e,n)),this.name="TopologyException",this.pt=new g(n)}}function Ue(){}function He(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new E,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}function We(){this._li=new Jt,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t}function Je(){this._nv=null;var t=arguments[0];this._nv=new We(Je.toSegmentStrings(t))}function Ze(){this._mapOp=null;var t=arguments[0];this._mapOp=t}function Ke(){}function Qe(){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[Ke.ON]=e}else if(arguments[0]instanceof Qe){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var i=0;i<this.location.length;i++)this.location[i]=n.location[i]}}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[Ke.ON]=r,this.location[Ke.LEFT]=o,this.location[Ke.RIGHT]=s}}function $e(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new Qe(t),this.elt[1]=new Qe(t)}else if(arguments[0]instanceof $e){var e=arguments[0];this.elt[0]=new Qe(e.elt[0]),this.elt[1]=new Qe(e.elt[1])}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.elt[0]=new Qe(N.NONE),this.elt[1]=new Qe(N.NONE),this.elt[n].setLocation(i)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Qe(r,o,s),this.elt[1]=new Qe(r,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2],c=arguments[3];this.elt[0]=new Qe(N.NONE,N.NONE,N.NONE),this.elt[1]=new Qe(N.NONE,N.NONE,N.NONE),this.elt[a].setLocations(u,l,c)}}function tn(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new E,this._pts=new E,this._label=new $e(N.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new E,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}function en(){var t=arguments[0],e=arguments[1];tn.call(this,t,e)}function nn(){var t=arguments[0],e=arguments[1];tn.call(this,t,e)}function rn(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}}function on(){rn.apply(this),this._coord=null,this._edges=null;var t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new $e(0,N.NONE)}function sn(){this.nodeMap=new it,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}function an(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];an.call(this,e,n,i,null)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];an.call(this,r),this.init(o,s),this._label=a}}function un(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999];var t=arguments[0],e=arguments[1];if(an.call(this,t),this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var n=t.getNumPoints()-1;this.init(t.getCoordinate(n),t.getCoordinate(n-1))}this.computeDirectedLabel()}function ln(){}function cn(){if(this._edges=new E,this._nodes=null,this._edgeEndList=new E,0===arguments.length)this._nodes=new sn(new ln);else if(1===arguments.length){var t=arguments[0];this._nodes=new sn(t)}}function hn(){this._geometryFactory=null,this._shellList=new E;var t=arguments[0];this._geometryFactory=t}function fn(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new E,this._resultLineList=new E;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n}function gn(){this._op=null,this._geometryFactory=null,this._resultPointList=new E;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}function dn(){}function pn(){this._geom=null;var t=arguments[0];this._geom=t}function _n(){this._edgeMap=new it,this._edgeList=null,this._ptInAreaLocation=[N.NONE,N.NONE]}function vn(){_n.apply(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}function mn(){ln.apply(this)}function yn(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}function xn(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var t=arguments[0],e=arguments[1];this._eventType=xn.DELETE,this._xValue=t,this._insertEvent=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._eventType=xn.INSERT,this._label=n,this._xValue=i,this._obj=r}}function En(){}function wn(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n}function bn(){En.apply(this),this.events=new E,this.nOverlaps=null}function In(){this._min=o.POSITIVE_INFINITY,this._max=o.NEGATIVE_INFINITY}function Cn(){}function Nn(){In.apply(this),this._item=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._min=t,this._max=e,this._item=n}function Sn(){In.apply(this),this._node1=null,this._node2=null;var t=arguments[0],e=arguments[1];this._node1=t,this._node2=e,this.buildExtent(this._node1,this._node2)}function Ln(){this._leaves=new E,this._root=null,this._level=0}function Mn(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}}function Pn(){this._items=new E}function Rn(){this._index=null;var t=arguments[0];if(!$o(t,Ct))throw new r("Argument must be Polygonal");this._index=new Tn(t)}function On(){this._counter=null;var t=arguments[0];this._counter=t}function Tn(){this._index=new Ln;var t=arguments[0];this.init(t)}function An(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new g(t),this.segmentIndex=e,this.dist=n}function Dn(){this._nodeMap=new it,this.edge=null;var t=arguments[0];this.edge=t}function Fn(){}function Gn(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new b,this.env2=new b;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Fn;this.startIndex=e.getChainStartIndices(this.pts)}function qn(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var e=0;e<3;e++)this._depth[t][e]=qn.NULL_VALUE}function kn(){if(rn.apply(this),this.pts=null,this._env=null,this.eiList=new Dn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new qn,this._depthDelta=0,1===arguments.length){var t=arguments[0];kn.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pts=e,this._label=n}}function Bn(){if(cn.apply(this),this._parentGeom=null,this._lineEdgeMap=new zt,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new _e,2===arguments.length){var t=arguments[0],e=arguments[1];Bn.call(this,t,e,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._argIndex=n,this._parentGeom=i,this._boundaryNodeRule=r,null!==i&&this.add(i)}}function jn(){if(this._li=new Jt,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Bn(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];jn.call(this,e,n,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];i.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Bn(0,i,o),this._arg[1]=new Bn(1,r,o)}}function zn(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=zn.orientation(t)}function Yn(){this._edges=new E,this._ocaMap=new it}function Xn(){this._ptLocator=new _e,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Yn,this._resultPolyList=new E,this._resultLineList=new E,this._resultPointList=new E;var t=arguments[0],e=arguments[1];jn.call(this,t,e),this._graph=new cn(new mn),this._geomFact=t.getFactory()}function Vn(){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 Un(){this._geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this._geom[0]=t,this._geom[1]=e}function Hn(){this._factory=null,this._interiorPoint=null,this._maxWidth=0;var t=arguments[0];this._factory=t.getFactory(),this.add(t)}function Wn(){this._poly=null,this._centreY=null,this._hiY=o.MAX_VALUE,this._loY=-o.MAX_VALUE;var t=arguments[0];this._poly=t,this._hiY=t.getEnvelopeInternal().getMaxY(),this._loY=t.getEnvelopeInternal().getMinY(),this._centreY=Hn.avg(this._loY,this._hiY)}function Jn(){this._centroid=null,this._minDistance=o.MAX_VALUE,this._interiorPoint=null;var t=arguments[0];this._centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null===this._interiorPoint&&this.addEndpoints(t)}function Zn(){this._centroid=null,this._minDistance=o.MAX_VALUE,this._interiorPoint=null;var t=arguments[0];this._centroid=t.getCentroid().getCoordinate(),this.add(t)}function Kn(){this.tempEnv1=new b,this.selectedSegment=new $t}function Qn(){this._items=new E,this._subnode=[null,null]}function $n(){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 ti(){}function ei(t,e){var n,i,r,o,s={32:8,64:11}[t];if(o||(n=e<0||1/e<0,isFinite(e)||(o={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}}[t],n&&(o.d+=1<<t/4-1),i=Math.pow(2,s)-1,r=0)),!o){for(i={32:127,64:1023}[t],r=Math.abs(e);r>=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,s)-1,r=0)}return i}function ni(){this._pt=0,this._level=0,this._interval=null;var t=arguments[0];this.computeKey(t)}function ii(){Qn.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 ri(){}function oi(){Qn.apply(this)}function si(){this._root=null,this._minExtent=1,this._root=new oi}function ai(){}function ui(){this._ring=null,this._tree=null,this._crossings=0,this._interval=new $n;var t=arguments[0];this._ring=t,this.buildIndex()}function li(){Kn.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function ci(){}function hi(){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 fi(){this._input=null,this._extremalPts=null,this._centre=null,this._radius=0;var t=arguments[0];this._input=t}function gi(){if(this._inputGeom=null,this._isConvex=null,this._convexHullPts=null,this._minBaseSeg=new $t,this._minWidthPt=null,this._minPtIndex=null,this._minWidth=0,1===arguments.length){var t=arguments[0];gi.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._inputGeom=e,this._isConvex=n}}function di(){this._inputGeom=null,this._distanceTolerance=null;var t=arguments[0];this._inputGeom=t}function pi(){ae.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function _i(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function vi(){this._isMarked=!1;var t=arguments[0];_i.call(this,t)}function mi(){this._vertexMap=new zt}function yi(){this._isStart=!1;var t=arguments[0];vi.call(this,t)}function xi(){mi.apply(this)}function Ei(){this._result=null,this._factory=null,this._graph=null,this._lines=new E,this._nodeEdgeStack=new ie,this._ringStartEdge=null,this._graph=new xi}function wi(){this._items=new E,this._subnode=new Array(4).fill(null)}function bi(){this._pt=new g,this._level=0,this._env=null;var t=arguments[0];this.computeKey(t)}function Ii(){wi.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 Ci(){wi.apply(this)}function Ni(){this._root=null,this._minExtent=1,this._root=new Ci}function Si(t){this.geometryFactory=t||new Vt}function Li(t){this.geometryFactory=t||new Vt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Si(this.geometryFactory)}function Mi(){this.parser=new Si(this.geometryFactory)}function Pi(t){this.geometryFactory=t||new Vt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Ut(this.geometryFactory)}function Ri(t){return[t.x,t.y]}function Oi(t,e){this.geometryFactory=t||new Vt,this.ol=e||"undefined"!=typeof ol&&ol}function Ti(){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];Ti.call(this,t,e,0,0)}else if(4===arguments.length){var n=arguments[0],i=arguments[1];this._noder=n,this._scaleFactor=i,this._isScaled=!this.isIntegerPrecision()}}function Ai(){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 Di(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Fi(){if(this._quadrantSegments=Fi.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=Fi.CAP_ROUND,this._joinStyle=Fi.JOIN_ROUND,this._mitreLimit=Fi.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=Fi.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 Gi(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}function qi(){this.array_=[]}function ki(){this._finder=null,this._dirEdgeList=new E,this._nodes=new E,this._rightMostCoord=null,this._env=null,this._finder=new Gi}function Bi(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Qt.COUNTERCLOCKWISE;var t=arguments[0];this._inputLine=t}function ji(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new E}function zi(){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 $t,this._seg1=new $t,this._offset0=new $t,this._offset1=new $t,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 Jt,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Fi.JOIN_ROUND&&(this._closingSegLengthFactor=zi.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function Yi(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}function Xi(){this._subgraphs=null,this._seg=new $t,this._cga=new Qt;var t=arguments[0];this._subgraphs=t}function Vi(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new $t(t),this._leftDepth=e}function Ui(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new E;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}function Hi(){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 Wi(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Yn;var t=arguments[0];this._bufParams=t}function Ji(){this._li=new Jt,this._segStrings=null;var t=arguments[0];this._segStrings=t}function Zi(){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 r("Scale factor must be non-zero");1!==e&&(this._pt=new g(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new g,this._p1Scaled=new g),this.initCorners(this._pt)}function Ki(){this._index=null;var t=arguments[0];this._index=t}function Qi(){Kn.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 $i(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new E}function tr(){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 Jt,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}function er(){if(this._argGeom=null,this._distance=null,this._bufParams=new Fi,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 nr(){this._comps=null;var t=arguments[0];this._comps=t}function ir(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];ir.call(this,t,ir.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 rr(){this._pts=null;var t=arguments[0];this._pts=t}function or(){this._locations=null;var t=arguments[0];this._locations=t}function sr(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new _e,this._minDistanceLocation=null,this._minDistance=o.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];sr.call(this,t,e,0)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=r}}function ar(){this._factory=null,this._directedEdges=new E,this._coordinates=null;var t=arguments[0];this._factory=t}function ur(){this._isMarked=!1,this._isVisited=!1,this._data=null}function lr(){ur.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 cr(){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];lr.call(this,t,e,n,i)}function hr(){if(ur.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 fr(){this._outEdges=new E,this._sorted=!1}function gr(){if(ur.apply(this),this._pt=null,this._deStar=null,1===arguments.length){var t=arguments[0];gr.call(this,t,new fr)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._pt=e,this._deStar=n}}function dr(){hr.apply(this),this._line=null;var t=arguments[0];this._line=t}function pr(){this._nodeMap=new it}function _r(){this._edges=new K,this._dirEdges=new K,this._nodeMap=new pr}function vr(){_r.apply(this)}function mr(){this._graph=new vr,this._mergedLineStrings=null,this._factory=null,this._edgeStrings=null}function yr(){this._edgeRing=null,this._next=null,this._label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];lr.call(this,t,e,n,i)}function xr(){hr.apply(this),this._line=null;var t=arguments[0];this._line=t}function Er(){this._geometryFactory=new Vt,this._geomGraph=null,this._disconnectedRingcoord=null;var t=arguments[0];this._geomGraph=t}function wr(){}function br(){if(this._edgeEnds=new E,1===arguments.length){var t=arguments[0];br.call(this,null,t)}else if(2===arguments.length){arguments[0];var e=arguments[1];an.call(this,e.getEdge(),e.getCoordinate(),e.getDirectedCoordinate(),new $e(e.getLabel())),this.insert(e)}}function Ir(){_n.apply(this)}function Cr(){var t=arguments[0],e=arguments[1];on.call(this,t,e)}function Nr(){ln.apply(this)}function Sr(){this._nodes=new sn(new Nr)}function Lr(){this._li=new Jt,this._geomGraph=null,this._nodeGraph=new Sr,this._invalidPoint=null;var t=arguments[0];this._geomGraph=t}function Mr(){this._graph=null,this._rings=new E,this._totalEnv=new b,this._index=null,this._nestedPt=null;var t=arguments[0];this._graph=t}function Pr(){if(this._errorType=null,this._pt=null,1===arguments.length){var t=arguments[0];Pr.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 Rr(){this._parentGeometry=null,this._isSelfTouchingRingFormingHoleValid=!1,this._validErr=null;var t=arguments[0];this._parentGeometry=t}function Or(){this._factory=null,this._deList=new E,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 Tr(){}function Ar(){_r.apply(this),this._factory=null;var t=arguments[0];this._factory=t}function Dr(){if(this._lineStringAdder=new Fr(this),this._graph=null,this._dangles=new E,this._cutEdges=new E,this._invalidRingLines=new E,this._holeList=null,this._shellList=null,this._polyList=null,this._isCheckingRingsValid=!0,this._extractOnlyPolygonal=null,this._geomFactory=null,0===arguments.length)Dr.call(this,!1);else if(1===arguments.length){var t=arguments[0];this._extractOnlyPolygonal=t}}function Fr(){this.p=null;var t=arguments[0];this.p=t}function Gr(){this._li=new Jt,this._ptLocator=new _e,this._arg=null,this._nodes=new sn(new Nr),this._im=null,this._isolatedEdges=new E,this._invalidPoint=null;var t=arguments[0];this._arg=t}function qr(){this._rectEnv=null;var t=arguments[0];this._rectEnv=t.getEnvelopeInternal()}function kr(){this._li=new Jt,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 g(t.getMinX(),t.getMinY()),this._diagUp1=new g(t.getMaxX(),t.getMaxY()),this._diagDown0=new g(t.getMinX(),t.getMaxY()),this._diagDown1=new g(t.getMaxX(),t.getMinY())}function Br(){this._isDone=!1}function jr(){this._rectangle=null,this._rectEnv=null;var t=arguments[0];this._rectangle=t,this._rectEnv=t.getEnvelopeInternal()}function zr(){Br.apply(this),this._rectEnv=null,this._intersects=!1;var t=arguments[0];this._rectEnv=t}function Yr(){Br.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 Xr(){Br.apply(this),this._rectEnv=null,this._rectIntersector=null,this._hasIntersection=!1,this._p0=new g,this._p1=new g;var t=arguments[0];this._rectEnv=t.getEnvelopeInternal(),this._rectIntersector=new kr(this._rectEnv)}function Vr(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];jn.call(this,t,e),this._relate=new Gr(this._arg)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];jn.call(this,n,i,r),this._relate=new Gr(this._arg)}}function Ur(){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null;var t=arguments[0];this._geomFactory=Ur.extractFactory(t),this._inputGeoms=t}function Hr(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new E)}function Wr(){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 Jr(){this._sortIndex=-1,this._comps=null;var t=arguments[0],e=arguments[1];this._sortIndex=t,this._comps=e}function Zr(){if(this._polygons=new E,this._lines=new E,this._points=new E,this._geomFact=null,1===arguments.length){if($o(arguments[0],_)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof q){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 Kr(){this._geomFactory=null,this._g0=null,this._g1=null,this._interacts0=null,this._interacts1=null;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e,this._geomFactory=t.getFactory(),this._interacts0=new Array(t.getNumGeometries()).fill(null),this._interacts1=new Array(e.getNumGeometries()).fill(null)}function Qr(){}function $r(){Pt.CoordinateOperation.apply(this),this._targetPM=null,this._removeCollapsed=!0;var t=arguments[0],e=arguments[1];this._targetPM=t,this._removeCollapsed=e}function to(){this._targetPM=null,this._removeCollapsed=!0,this._changePrecisionModel=!1,this._isPointwise=!1;var t=arguments[0];this._targetPM=t}function eo(){this._pts=null,this._usePt=null,this._distanceTolerance=null,this._seg=new $t;var t=arguments[0];this._pts=t}function no(){this._inputGeom=null,this._distanceTolerance=null,this._isEnsureValidTopology=!0;var t=arguments[0];this._inputGeom=t}function io(){ae.apply(this),this._isEnsureValidTopology=!0,this._distanceTolerance=null;var t=arguments[0],e=arguments[1];this._isEnsureValidTopology=t,this._distanceTolerance=e}function ro(){if(this._parent=null,this._index=null,2===arguments.length){var t=arguments[0],e=arguments[1];ro.call(this,t,e,null,-1)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=arguments[3];$t.call(this,n,i),this._parent=r,this._index=o}}function oo(){if(this._parentLine=null,this._segs=null,this._resultSegs=new E,this._minimumSize=null,1===arguments.length){var t=arguments[0];oo.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 so(){this._index=new Ni}function ao(){this._querySeg=null,this._items=new E;var t=arguments[0];this._querySeg=t}function uo(){this._li=new Jt,this._inputIndex=new so,this._outputIndex=new so,this._line=null,this._linePts=null,this._distanceTolerance=0;var t=arguments[0],e=arguments[1];this._inputIndex=t,this._outputIndex=e}function lo(){this._inputIndex=new so,this._outputIndex=new so,this._distanceTolerance=0}function co(){this._inputGeom=null,this._lineSimplifier=new lo,this._linestringMap=null;var t=arguments[0];this._inputGeom=t}function ho(){ae.apply(this),this._linestringMap=null;var t=arguments[0];this._linestringMap=t}function fo(){this.tps=null;var t=arguments[0];this.tps=t}function go(){this._seg=null,this._segLen=null,this._splitPt=null,this._minimumLen=0;var t=arguments[0];this._seg=t,this._segLen=t.getLength()}function po(){}function _o(){}function vo(){}function mo(){if(this._p=null,1===arguments.length){var t=arguments[0];this._p=new g(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._p=new g(e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._p=new g(i,r,o)}}function yo(){this._isOnConstraint=null,this._constraint=null;var t=arguments[0];mo.call(this,t)}function xo(){this._rot=null,this._vertex=null,this._next=null,this._data=null}function Eo(){this._subdiv=null,this._isUsingTolerance=!1;var t=arguments[0];this._subdiv=t,this._isUsingTolerance=t.getTolerance()>0}function wo(){}function bo(){this._subdiv=null,this._lastEdge=null;var t=arguments[0];this._subdiv=t,this.init()}function Io(){if(this._seg=null,1===arguments.length){if("string"==typeof arguments[0]){var t=arguments[0];c.call(this,t)}else if(arguments[0]instanceof $t){var e=arguments[0];c.call(this,"Locate failed to converge (at edge: "+e+"). Possible causes include invalid Subdivision topology or very close sites"),this._seg=new $t(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];c.call(this,Io.msgWithSpatial(n,i)),this._seg=new $t(i)}}function Co(){}function No(){this._visitedKey=0,this._quadEdges=new E,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 $t,this._triEdges=new Array(3).fill(null);var t=arguments[0],e=arguments[1];this._tolerance=e,this._edgeCoincidenceTolerance=e/No.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this._startingEdge=this.initSubdiv(),this._locator=new bo(this)}function So(){}function Lo(){this._triList=new E}function Mo(){this._triList=new E}function Po(){this._coordList=new w,this._triCoords=new E}function Ro(){if(this._ls=null,this._data=null,2===arguments.length){var t=arguments[0],e=arguments[1];this._ls=new $t(t,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._ls=new $t(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];Ro.call(this,new g(o,s,a),new g(u,l,c))}else if(7===arguments.length){var h=arguments[0],f=arguments[1],d=arguments[2],p=arguments[3],_=arguments[4],v=arguments[5],m=arguments[6];Ro.call(this,new g(h,f,d),new g(p,_,v),m)}}function Oo(){}function To(){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 g(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 g(n,i),this._left=null,this._right=null,this._count=1,this._data=r}}function Ao(){if(this._root=null,this._numberOfNodes=null,this._tolerance=null,0===arguments.length)Ao.call(this,0);else if(1===arguments.length){var t=arguments[0];this._tolerance=t}}function Do(){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 Fo(){this._initialVertices=null,this._segVertices=null,this._segments=new E,this._subdiv=null,this._incDel=null,this._convexHull=null,this._splitFinder=new _o,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 E(t),this._tolerance=e,this._kdt=new Ao(e)}function Go(){this._siteCoords=null,this._tolerance=0,this._subdiv=null}function qo(){this._siteCoords=null,this._constraintLines=null,this._tolerance=0,this._subdiv=null,this._constraintVertexMap=new it}function ko(){this._siteCoords=null,this._tolerance=0,this._subdiv=null,this._clipEnv=null,this._diagramEnv=null}function Bo(){if(this._componentIndex=0,this._segmentIndex=0,this._segmentFraction=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._componentIndex=t._componentIndex,this._segmentIndex=t._segmentIndex,this._segmentFraction=t._segmentFraction}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Bo.call(this,0,e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._componentIndex=i,this._segmentIndex=r,this._segmentFraction=o,this.normalize()}else if(4===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._componentIndex=s,this._segmentIndex=a,this._segmentFraction=u,l&&this.normalize()}}function jo(){if(this._linearGeom=null,this._numLines=null,this._currentLine=null,this._componentIndex=0,this._vertexIndex=0,1===arguments.length){var t=arguments[0];jo.call(this,t,0,0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];jo.call(this,e,n.getComponentIndex(),jo.segmentEndVertexIndex(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];if(!$o(i,rt))throw new r("Lineal geometry is required");this._linearGeom=i,this._numLines=i.getNumGeometries(),this._componentIndex=o,this._vertexIndex=s,this.loadCurrentLine()}}function zo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Yo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Xo(){this._geomFact=null,this._lines=new E,this._coordList=null,this._ignoreInvalidLines=!1,this._fixInvalidLines=!1,this._lastPt=null;var t=arguments[0];this._geomFact=t}function Vo(){this._line=null;var t=arguments[0];this._line=t}function Uo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t,this.checkGeometryType()}function Ho(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Wo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}function Jo(){this._linearGeom=null;var t=arguments[0];this._linearGeom=t}Object.defineProperty(n,"__esModule",{value:!0});var Zo=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};Zo(i.prototype,{interfaces_:function(){return[]},getClass:function(){return i}}),i.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},o.isNaN=function(t){return Number.isNaN(t)},o.doubleToLongBits=function(t){return t},o.longBitsToDouble=function(t){return t},o.isInfinite=function(t){return!Number.isFinite(t)},o.MAX_VALUE=Number.MAX_VALUE,c.prototype=Object.create(Error.prototype),c.prototype.constructor=Error;var Ko=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t};Ko(h,c),Zo(h.prototype,{interfaces_:function(){return[]},getClass:function(){return h}}),Zo(f.prototype,{interfaces_:function(){return[]},getClass:function(){return f}}),f.shouldNeverReachHere=function(){if(0===arguments.length)f.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new h("Should never reach here"+(null!==t?": "+t:""))}},f.isTrue=function(){if(1===arguments.length){var t=arguments[0];f.isTrue(t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!e)throw null===n?new h:new h(n)}},f.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];f.equals(t,e,null)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(!i.equals(n))throw new h("Expected "+n+" but encountered "+i+(null!==r?": "+r:""))}},Zo(g.prototype,{setOrdinate:function(t,e){switch(t){case g.X:this.x=e;break;case g.Y:this.y=e;break;case g.Z:this.z=e;break;default:throw new r("Invalid ordinate index: "+t)}},equals2D:function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!i.equalsWithTolerance(this.x,e.x,n)&&!!i.equalsWithTolerance(this.y,e.y,n)}},getOrdinate:function(t){switch(t){case g.X:return this.x;case g.Y:return this.y;case g.Z:return this.z}throw new r("Invalid ordinate index: "+t)},equals3D:function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||o.isNaN(this.z)&&o.isNaN(t.z))},equals:function(t){return t instanceof g&&this.equals2D(t)},equalInZ:function(t,e){return i.equalsWithTolerance(this.z,t.z,e)},compareTo:function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.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 g(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+g.hashCode(this.x),t=37*t+g.hashCode(this.y)},setCoordinate:function(t){this.x=t.x,this.y=t.y,this.z=t.z},interfaces_:function(){return[s,a,l]},getClass:function(){return g}}),g.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=o.doubleToLongBits(t);return Math.trunc(e^e>>>32)}},Zo(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[u]},getClass:function(){return d}}),d.compare=function(t,e){return t<e?-1:t>e?1:o.isNaN(t)?o.isNaN(e)?0:-1:o.isNaN(e)?1:0},g.DimensionalComparator=d,g.serialVersionUID=0x5cbf2c235c7e5800,g.NULL_ORDINATE=o.NaN,g.X=0,g.Y=1,g.Z=2,p.prototype.hasNext=function(){},p.prototype.next=function(){},p.prototype.remove=function(){},_.prototype.add=function(){},_.prototype.addAll=function(){},_.prototype.isEmpty=function(){},_.prototype.iterator=function(){},_.prototype.size=function(){},_.prototype.toArray=function(){},_.prototype.remove=function(){},(v.prototype=new Error).name="IndexOutOfBoundsException",(m.prototype=Object.create(_.prototype)).constructor=m,m.prototype.get=function(){},m.prototype.set=function(){},m.prototype.isEmpty=function(){},(y.prototype=new Error).name="NoSuchElementException",(x.prototype=new Error).name="OperationNotSupported",E.prototype=Object.create(m.prototype),E.prototype.constructor=E,E.prototype.ensureCapacity=function(){},E.prototype.interfaces_=function(){return[m,_]},E.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},E.prototype.clear=function(){this.array_=[]},E.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},E.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},E.prototype.iterator=function(){return new Qo(this)},E.prototype.get=function(t){if(t<0||t>=this.size())throw new v;return this.array_[t]},E.prototype.isEmpty=function(){return 0===this.array_.length},E.prototype.size=function(){return this.array_.length},E.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},E.prototype.remove=function(t){for(var e=!1,n=0,i=this.array_.length;n<i;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e};var Qo=function(t){this.arrayList_=t,this.position_=0};Qo.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new y;return this.arrayList_.get(this.position_++)},Qo.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},Qo.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},Qo.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},Ko(w,E),Zo(w.prototype,{getCoordinate:function(t){return this.get(t)},addAll:function(){if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=!1,i=t.iterator();i.hasNext();)this.add(i.next(),e),n=!0;return n}return E.prototype.addAll.apply(this,arguments)},clone:function(){for(var t=E.prototype.clone.call(this),e=0;e<this.size();e++)t.add(e,this.get(e).copy());return t},toCoordinateArray:function(){return this.toArray(w.coordArrayType)},add:function(){if(1===arguments.length){var t=arguments[0];E.prototype.add.call(this,t)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var e=arguments[0],n=arguments[1];return this.add(e,n,!0),!0}if(arguments[0]instanceof g&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;E.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var r=arguments[0],o=arguments[1];return this.add(r,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];if(arguments[2])for(v=0;v<s.length;v++)this.add(s[v],a);else for(v=s.length-1;v>=0;v--)this.add(s[v],a);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof g){var u=arguments[0],l=arguments[1];if(!arguments[2]){var c=this.size();if(c>0){if(u>0&&this.get(u-1).equals2D(l))return null;if(u<c&&this.get(u).equals2D(l))return null}}E.prototype.add.call(this,u,l)}}else if(4===arguments.length){var h=arguments[0],f=arguments[1],d=arguments[2],p=arguments[3],_=1;d>p&&(_=-1);for(var v=d;v!==p;v+=_)this.add(h[v],f);return!0}},closeRing:function(){this.size()>0&&this.add(new g(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return w}}),w.coordArrayType=new Array(0).fill(null),Zo(b.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(t){if(!(t instanceof b))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 b;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny;return new b(e,this._maxx<t._maxx?this._maxx:t._maxx,n,this._maxy<t._maxy?this._maxy:t._maxy)},isNull:function(){return this._maxx<this._minx},getMaxX:function(){return this._maxx},covers:function(){if(1===arguments.length){if(arguments[0]instanceof g){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof b){var e=arguments[0];return!this.isNull()&&!e.isNull()&&(e.getMinX()>=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 b){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof g){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},getMinY:function(){return this._miny},getMinX:function(){return this._minx},expandToInclude:function(){if(1===arguments.length){if(arguments[0]instanceof g){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof b){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._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):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},minExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},getWidth:function(){return this.isNull()?0:this._maxx-this._minx},compareTo:function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},translate:function(t,e){if(this.isNull())return null;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 b){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof g){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 g((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 g){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof b){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];r<o?(this._minx=r,this._maxx=o):(this._minx=o,this._maxx=r),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},getMaxY:function(){return this._maxy},distance:function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._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+g.hashCode(this._minx),t=37*t+g.hashCode(this._maxx),t=37*t+g.hashCode(this._miny),t=37*t+g.hashCode(this._maxy)},interfaces_:function(){return[s,l]},getClass:function(){return b}}),b.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.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)&&(!(c<a)&&(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(i.y,r.y),c=Math.max(i.y,r.y),!(l>u)&&!(c<a)))}},b.serialVersionUID=0x51845cd552189800,Ko(C,I),Zo(C.prototype,{interfaces_:function(){return[]},getClass:function(){return C}}),Zo(N.prototype,{interfaces_:function(){return[]},getClass:function(){return N}}),N.toLocationSymbol=function(t){switch(t){case N.EXTERIOR:return"e";case N.BOUNDARY:return"b";case N.INTERIOR:return"i";case N.NONE:return"-"}throw new r("Unknown location value: "+t)},N.INTERIOR=0,N.BOUNDARY=1,N.EXTERIOR=2,N.NONE=-1;var $o=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1};Zo(S.prototype,{interfaces_:function(){return[]},getClass:function(){return S}}),S.log10=function(t){var e=Math.log(t);return o.isInfinite(e)?e:o.isNaN(e)?e:e/S.LOG_10},S.min=function(t,e,n,i){var r=t;return e<r&&(r=e),n<r&&(r=n),i<r&&(r=i),r},S.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?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 i<r?r:i>o?o:i}},S.wrap=function(t,e){return t<0?e- -t%e:t%e},S.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return e>(a=t)&&(a=e),n>a&&(a=n),a}if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=i;return r>a&&(a=r),o>a&&(a=o),s>a&&(a=s),a}},S.average=function(t,e){return(t+e)/2},S.LOG_10=Math.log(10),L.prototype.append=function(t){this.str+=t},L.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},L.prototype.toString=function(t){return this.str},M.prototype.intValue=function(){return this.value},M.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},M.isNaN=function(t){return Number.isNaN(t)},P.isWhitespace=function(t){return t<=32&&t>=0||127==t},P.toUpperCase=function(t){return t.toUpperCase()},Zo(R.prototype,{le:function(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<=t._lo},extractSignificantDigits:function(t,e){var n=this.abs(),i=R.magnitude(n._hi),r=R.TEN.pow(i);(n=n.divide(r)).gt(R.TEN)?(n=n.divide(R.TEN),i+=1):n.lt(R.ONE)&&(n=n.multiply(R.TEN),i-=1);for(var o=i+1,s=new L,a=R.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(R.valueOf(l)).multiply(R.TEN),c&&n.selfAdd(R.TEN);var f=!0,g=R.magnitude(n._hi);if(g<0&&Math.abs(g)>=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 R){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 R){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 R){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=R.SPLIT*u,r=l-u,h=R.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 R){var t=arguments[0],e=null,n=null,i=null,r=null,s=null,a=null,u=null,l=null;return n=(s=this._hi/t._hi)-(e=(a=R.SPLIT*s)-(e=a-s)),l=e*(i=(l=R.SPLIT*t._hi)-(i=l-t._hi))-(u=s*t._hi)+e*(r=t._hi-i)+n*i+n*r,new R(l=s+(a=(this._hi-u-l+this._lo-s*t._lo)/t._hi),s-l+a)}if("number"==typeof arguments[0]){var c=arguments[0];return o.isNaN(c)?R.createNaN():R.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 R.valueOf(1);var e=new R(this),n=R.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 R.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new R(t,e)},compareTo:function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof R){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 R.valueOf(0);if(this.isNegative())return R.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=R.valueOf(e),i=this.subtract(n.sqr())._hi*(.5*t);return n.add(i)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof R){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,o=r-(s=r-this._hi),h=c-(a=c-this._lo);var f=(n=r+(s=(o=u-s+(this._hi-o))+c))+(s=(h=l-a+(this._lo-h))+(i=s+(r-n))),g=s+(n-f);return this._hi=f,this._lo=g,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof R){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;r=(u=R.SPLIT*this._hi)-this._hi,l=R.SPLIT*n,r=u-r,o=this._hi-r,s=l-n;var c=(u=this._hi*n)+(l=r*(s=l-s)-u+r*(a=n-s)+o*s+o*a+(this._hi*i+this._lo*n)),h=l+(r=u-c);return this._hi=c,this._lo=h,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return R.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new R(t,e)},negate:function(){return this.isNaN()?this:new R(-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 R){var t=arguments[0];return t.isNaN()?R.createNaN():R.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return o.isNaN(e)?R.createNaN():R.copy(this).selfMultiply(e,0)}},isNaN:function(){return o.isNaN(this._hi)},intValue:function(){return Math.trunc(this._hi)},toString:function(){var t=R.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."+R.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length;r=n+R.stringOfChar("0",o)+".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;e=(r=1/this._hi)-(t=(o=R.SPLIT*r)-(t=o-r)),n=(a=R.SPLIT*this._hi)-this._hi;var u=r+(o=(1-(s=r*this._hi)-(a=t*(n=a-n)-s+t*(i=this._hi-n)+e*n+e*i)-r*this._lo)/this._hi);return new R(u,r-u+o)},toSciNotation:function(){if(this.isZero())return R.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=R.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()?R.NaN:this.isNegative()?this.negate():new R(this)},isPositive:function(){return this._hi>0||0===this._hi&&this._lo>0},lt:function(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<t._lo},add:function(){if(arguments[0]instanceof R){var t=arguments[0];return R.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return R.copy(this).selfAdd(e)}},init:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof R){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},gt:function(t){return this._hi>t._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()?R.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[l,s,a]},getClass:function(){return R}}),R.sqr=function(t){return R.valueOf(t).selfMultiply(t)},R.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return R.parse(t)}if("number"==typeof arguments[0])return new R(arguments[0])},R.sqrt=function(t){return R.valueOf(t).sqrt()},R.parse=function(t){for(var e=0,n=t.length;P.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var r=t.charAt(e);"-"!==r&&"+"!==r||(e++,"-"===r&&(i=!0))}for(var o=new R,s=0,a=0,u=0;;){if(e>=n)break;var l=t.charAt(e);if(e++,P.isDigit(l)){var c=l-"0";o.selfMultiply(R.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=M.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,g=s-a-u;if(0===g)f=o;else if(g>0){d=R.TEN.pow(g);f=o.divide(d)}else if(g<0){var d=R.TEN.pow(-g);f=o.multiply(d)}return i?f.negate():f},R.createNaN=function(){return new R(o.NaN,o.NaN)},R.copy=function(t){return new R(t)},R.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},R.stringOfChar=function(t,e){for(var n=new L,i=0;i<e;i++)n.append(t);return n.toString()},R.PI=new R(3.141592653589793,1.2246467991473532e-16),R.TWO_PI=new R(6.283185307179586,2.4492935982947064e-16),R.PI_2=new R(1.5707963267948966,6.123233995736766e-17),R.E=new R(2.718281828459045,1.4456468917292502e-16),R.NaN=new R(o.NaN,o.NaN),R.EPS=1.23259516440783e-32,R.SPLIT=134217729,R.MAX_PRINT_DIGITS=32,R.TEN=R.valueOf(10),R.ONE=R.valueOf(1),R.SCI_NOT_EXPONENT_CHAR="E",R.SCI_NOT_ZERO="0.0E0",Zo(O.prototype,{interfaces_:function(){return[]},getClass:function(){return O}}),O.orientationIndex=function(t,e,n){var i=O.orientationIndexFilter(t,e,n);if(i<=1)return i;var r=R.valueOf(e.x).selfAdd(-t.x),o=R.valueOf(e.y).selfAdd(-t.y),s=R.valueOf(n.x).selfAdd(-e.x),a=R.valueOf(n.y).selfAdd(-e.y);return r.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},O.signOfDet2x2=function(t,e,n,i){return t.multiply(i).selfSubtract(e.multiply(n)).signum()},O.intersection=function(t,e,n,i){var r=R.valueOf(i.y).selfSubtract(n.y).selfMultiply(R.valueOf(e.x).selfSubtract(t.x)),o=R.valueOf(i.x).selfSubtract(n.x).selfMultiply(R.valueOf(e.y).selfSubtract(t.y)),s=r.subtract(o),a=R.valueOf(i.x).selfSubtract(n.x).selfMultiply(R.valueOf(t.y).selfSubtract(n.y)),u=R.valueOf(i.y).selfSubtract(n.y).selfMultiply(R.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u).selfDivide(s).doubleValue(),c=R.valueOf(t.x).selfAdd(R.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),h=R.valueOf(e.x).selfSubtract(t.x).selfMultiply(R.valueOf(t.y).selfSubtract(n.y)),f=R.valueOf(e.y).selfSubtract(t.y).selfMultiply(R.valueOf(t.x).selfSubtract(n.x)),d=h.subtract(f).selfDivide(s).doubleValue();return new g(c,R.valueOf(n.y).selfAdd(R.valueOf(i.y).selfSubtract(n.y).selfMultiply(d)).doubleValue())},O.orientationIndexFilter=function(t,e,n){var i=null,r=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=r-o;if(r>0){if(o<=0)return O.signum(s);i=r+o}else{if(!(r<0))return O.signum(s);if(o>=0)return O.signum(s);i=-r-o}var a=O.DP_SAFE_EPSILON*i;return s>=a||-s>=a?O.signum(s):2},O.signum=function(t){return t>0?1:t<0?-1:0},O.DP_SAFE_EPSILON=1e-15,Zo(T.prototype,{setOrdinate:function(t,e,n){},size:function(){},getOrdinate:function(t,e){},getCoordinate:function(){},getCoordinateCopy:function(t){},getDimension:function(){},getX:function(t){},clone:function(){},expandEnvelope:function(t){},copy:function(){},getY:function(t){},toCoordinateArray:function(){},interfaces_:function(){return[a]},getClass:function(){return T}}),T.X=0,T.Y=1,T.Z=2,T.M=3,A.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;s<e+r;s++)n[i+o]=t[s],o++},A.getProperty=function(t){return{"line.separator":"\n"}[t]},Zo(D.prototype,{getY:function(){var t=this.y/this.w;if(o.isNaN(t)||o.isInfinite(t))throw new C;return t},getX:function(){var t=this.x/this.w;if(o.isNaN(t)||o.isInfinite(t))throw new C;return t},getCoordinate:function(){var t=new g;return t.x=this.getX(),t.y=this.getY(),t},interfaces_:function(){return[]},getClass:function(){return D}}),D.intersection=function(t,e,n,i){var r=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,h=r*l-u*s,f=(s*c-l*a)/h,d=(u*a-r*c)/h;if(o.isNaN(f)||o.isInfinite(f)||o.isNaN(d)||o.isInfinite(d))throw new C;return new g(f,d)},Zo(F.prototype,{create:function(){1===arguments.length?arguments[0]instanceof Array||$o(arguments[0],T):arguments.length},interfaces_:function(){return[]},getClass:function(){return F}}),Zo(G.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return G}}),Zo(q.prototype,{isGeometryCollection:function(){return this.getSortIndex()===q.SORTINDEX_GEOMETRYCOLLECTION},getFactory:function(){return this._factory},getGeometryN:function(t){return this},getArea:function(){return 0},isRectangle:function(){return!1},equals:function(){if(arguments[0]instanceof q){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof q))return!1;var n=e;return this.equalsExact(n)}},equalsExact:function(t){return this===t||this.equalsExact(t,0)},geometryChanged:function(){this.apply(q.geometryChangedFilter)},geometryChangedAction:function(){this._envelope=null},equalsNorm:function(t){return null!==t&&this.norm().equalsExact(t.norm())},getLength:function(){return 0},getNumGeometries:function(){return 1},compareTo:function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=n;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(n,i)}},getUserData:function(){return this._userData},getSRID:function(){return this._SRID},getEnvelope:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},checkNotGeometryCollection:function(t){if(t.getSortIndex()===q.SORTINDEX_GEOMETRYCOLLECTION)throw new r("This method does not support GeometryCollection arguments")},equal:function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},norm:function(){var t=this.copy();return t.normalize(),t},getPrecisionModel:function(){return this._factory.getPrecisionModel()},getEnvelopeInternal:function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new b(this._envelope)},setSRID:function(t){this._SRID=t},setUserData:function(t){this._userData=t},compare:function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var r=n.next(),o=i.next(),s=r.compareTo(o);if(0!==s)return s}return n.hasNext()?1:i.hasNext()?-1:0},hashCode:function(){return this.getEnvelopeInternal().hashCode()},isGeometryCollectionOrDerived:function(){return this.getSortIndex()===q.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===q.SORTINDEX_MULTIPOINT||this.getSortIndex()===q.SORTINDEX_MULTILINESTRING||this.getSortIndex()===q.SORTINDEX_MULTIPOLYGON},interfaces_:function(){return[a,s,l]},getClass:function(){return q}}),q.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},q.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},q.serialVersionUID=0x799ea46522854c00,q.SORTINDEX_POINT=0,q.SORTINDEX_MULTIPOINT=1,q.SORTINDEX_LINESTRING=2,q.SORTINDEX_LINEARRING=3,q.SORTINDEX_MULTILINESTRING=4,q.SORTINDEX_POLYGON=5,q.SORTINDEX_MULTIPOLYGON=6,q.SORTINDEX_GEOMETRYCOLLECTION=7,q.geometryChangedFilter={interfaces_:function(){return[G]},filter:function(t){t.geometryChangedAction()}},Zo(k.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return k}}),Zo(B.prototype,{isInBoundary:function(t){},interfaces_:function(){return[]},getClass:function(){return B}}),Zo(j.prototype,{isInBoundary:function(t){return t%2==1},interfaces_:function(){return[B]},getClass:function(){return j}}),Zo(z.prototype,{isInBoundary:function(t){return t>0},interfaces_:function(){return[B]},getClass:function(){return z}}),Zo(Y.prototype,{isInBoundary:function(t){return t>1},interfaces_:function(){return[B]},getClass:function(){return Y}}),Zo(X.prototype,{isInBoundary:function(t){return 1===t},interfaces_:function(){return[B]},getClass:function(){return X}}),B.Mod2BoundaryNodeRule=j,B.EndPointBoundaryNodeRule=z,B.MultiValentEndPointBoundaryNodeRule=Y,B.MonoValentEndPointBoundaryNodeRule=X,B.MOD2_BOUNDARY_RULE=new j,B.ENDPOINT_BOUNDARY_RULE=new z,B.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new Y,B.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new X,B.OGC_SFS_BOUNDARY_RULE=B.MOD2_BOUNDARY_RULE,Zo(V.prototype,{interfaces_:function(){return[]},getClass:function(){return V}}),V.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},V.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(V.indexOf(i,e)<0)return i}return null},V.scroll=function(t,e){var n=V.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);A.arraycopy(t,n,i,0,t.length-n),A.arraycopy(t,0,i,t.length-n,n),A.arraycopy(i,0,t,0,t.length)},V.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(o=0;o<t.length;o++)if(!t[o].equals(e[o]))return!1;return!0}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(n===i)return!0;if(null===n||null===i)return!1;if(n.length!==i.length)return!1;for(var o=0;o<n.length;o++)if(0!==r.compare(n[o],i[o]))return!1;return!0}},V.intersection=function(t,e){for(var n=new w,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},V.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},V.removeRepeatedPoints=function(t){return V.hasRepeatedPoints(t)?new w(t,!1).toCoordinateArray():t},V.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var r=t[i];t[i]=t[e-i],t[e-i]=r}},V.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var i=new Array(e).fill(null);if(0===e)return i;for(var r=0,n=0;n<t.length;n++)null!==t[n]&&(i[r++]=t[n]);return i},V.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new g(t[n]);return e}if(5===arguments.length)for(var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],n=0;n<a;n++)o[s+n]=new g(i[r+n])},V.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e[t.length-n-1];if(0!==i.compareTo(r))return!1}return!0},V.envelope=function(t){for(var e=new b,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},V.toCoordinateArray=function(t){return t.toArray(V.coordArrayType)},V.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},V.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},V.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(0!==i)return i}return 1},V.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(0!==i)return i;n++}return n<e.length?-1:n<t.length?1:0},V.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},V.extract=function(t,e,n){e=S.clamp(e,0,t.length);var i=(n=S.clamp(n,-1,t.length))-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var r=new Array(i).fill(null);if(0===i)return r;for(var o=0,s=e;s<=n;s++)r[o++]=t[s];return r},Zo(U.prototype,{compare:function(t,e){return V.compare(t,e)},interfaces_:function(){return[u]},getClass:function(){return U}}),Zo(H.prototype,{compare:function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;var r=V.compare(n,i);return V.isEqualReversed(n,i)?0:r},OLDcompare:function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;for(var r=V.increasingDirection(n),o=V.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(i[a]);if(0!==l)return l;s+=r,a+=o}return 0},interfaces_:function(){return[u]},getClass:function(){return H}}),V.ForwardComparator=U,V.BidirectionalComparator=H,V.coordArrayType=new Array(0).fill(null),W.prototype.get=function(){},W.prototype.put=function(){},W.prototype.size=function(){},W.prototype.values=function(){},W.prototype.entrySet=function(){},J.prototype=new W,(Z.prototype=new _).contains=function(){},K.prototype=new Z,K.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},K.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},K.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},K.prototype.remove=function(t){throw new javascript.util.OperationNotSupported},K.prototype.size=function(){return this.array_.length},K.prototype.isEmpty=function(){return 0===this.array_.length},K.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},K.prototype.iterator=function(){return new ts(this)};var ts=function(t){this.hashSet_=t,this.position_=0};ts.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new y;return this.hashSet_.array_[this.position_++]},ts.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},ts.prototype.remove=function(){throw new x};var es=0;it.prototype=new J,it.prototype.get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},it.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:es,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:es,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},it.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!=this.root_&&1==t.parent.color;)if($(t)==et($($(t))))1==Q(e=nt($($(t))))?(tt($(t),es),tt(e,es),tt($($(t)),1),t=$($(t))):(t==nt($(t))&&(t=$(t),this.rotateLeft(t)),tt($(t),es),tt($($(t)),1),this.rotateRight($($(t))));else{var e=et($($(t)));1==Q(e)?(tt($(t),es),tt(e,es),tt($($(t)),1),t=$($(t))):(t==et($(t))&&(t=$(t),this.rotateRight(t)),tt($(t),es),tt($($(t)),1),this.rotateLeft($($(t))))}this.root_.color=es},it.prototype.values=function(){var t=new E,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=it.successor(e));)t.add(e.value);return t},it.prototype.entrySet=function(){var t=new K,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=it.successor(e));)t.add(e);return t},it.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}},it.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}},it.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},it.successor=function(t){if(null===t)return null;if(null!==t.right){for(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},it.prototype.size=function(){return this.size_},Zo(rt.prototype,{interfaces_:function(){return[]},getClass:function(){return rt}}),ot.prototype=new Z,st.prototype=new ot,st.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},st.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},st.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},st.prototype.remove=function(t){throw new x},st.prototype.size=function(){return this.array_.length},st.prototype.isEmpty=function(){return 0===this.array_.length},st.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},st.prototype.iterator=function(){return new ns(this)};var ns=function(t){this.treeSet_=t,this.position_=0};ns.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new y;return this.treeSet_.array_[this.position_++]},ns.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ns.prototype.remove=function(){throw new x},at.sort=function(){var t,e,n,i,r=arguments[0];if(1===arguments.length)return i=function(t,e){return t.compareTo(e)},void r.sort(i);if(2===arguments.length)n=arguments[1],i=function(t,e){return n.compare(t,e)},r.sort(i);else{if(3===arguments.length){(e=r.slice(arguments[1],arguments[2])).sort();var o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length));for(r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t]);return}if(4===arguments.length){for(e=r.slice(arguments[1],arguments[2]),n=arguments[3],i=function(t,e){return n.compare(t,e)},e.sort(i),o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length)),r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t]);return}}},at.asList=function(t){for(var e=new E,n=0,i=t.length;n<i;n++)e.add(t[n]);return e},Zo(ut.prototype,{interfaces_:function(){return[]},getClass:function(){return ut}}),ut.toDimensionSymbol=function(t){switch(t){case ut.FALSE:return ut.SYM_FALSE;case ut.TRUE:return ut.SYM_TRUE;case ut.DONTCARE:return ut.SYM_DONTCARE;case ut.P:return ut.SYM_P;case ut.L:return ut.SYM_L;case ut.A:return ut.SYM_A}throw new r("Unknown dimension value: "+t)},ut.toDimensionValue=function(t){switch(P.toUpperCase(t)){case ut.SYM_FALSE:return ut.FALSE;case ut.SYM_TRUE:return ut.TRUE;case ut.SYM_DONTCARE:return ut.DONTCARE;case ut.SYM_P:return ut.P;case ut.SYM_L:return ut.L;case ut.SYM_A:return ut.A}throw new r("Unknown dimension symbol: "+t)},ut.P=0,ut.L=1,ut.A=2,ut.FALSE=-1,ut.TRUE=-2,ut.DONTCARE=-3,ut.SYM_FALSE="F",ut.SYM_TRUE="T",ut.SYM_DONTCARE="*",ut.SYM_P="0",ut.SYM_L="1",ut.SYM_A="2",Zo(lt.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return lt}}),Zo(ct.prototype,{filter:function(t,e){},isDone:function(){},isGeometryChanged:function(){},interfaces_:function(){return[]},getClass:function(){return ct}}),Ko(ht,q),Zo(ht.prototype,{computeEnvelopeInternal:function(){for(var t=new b,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},getGeometryN:function(t){return this._geometries[t]},getSortIndex:function(){return q.SORTINDEX_GEOMETRYCOLLECTION},getCoordinates:function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var i=this._geometries[n].getCoordinates(),r=0;r<i.length;r++)t[++e]=i[r];return t},getArea:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._geometries.length!==n._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(n._geometries[i],e))return!1;return!0}return q.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();at.sort(this._geometries)},getCoordinate:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},getBoundaryDimension:function(){for(var t=ut.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},getDimension:function(){for(var t=ut.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},getLength:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},getNumPoints:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},getNumGeometries:function(){return this._geometries.length},reverse:function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=new st(at.asList(this._geometries)),n=new st(at.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var i=arguments[0],r=arguments[1],o=i,s=this.getNumGeometries(),a=o.getNumGeometries(),u=0;u<s&&u<a;){var l=this.getGeometryN(u),c=o.getGeometryN(u),h=l.compareToSameClass(c,r);if(0!==h)return h;u++}return u<s?1:u<a?-1:0}},apply:function(){if($o(arguments[0],k))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if($o(arguments[0],ct)){var n=arguments[0];if(0===this._geometries.length)return null;for(e=0;e<this._geometries.length&&(this._geometries[e].apply(n),!n.isDone());e++);n.isGeometryChanged()&&this.geometryChanged()}else if($o(arguments[0],lt)){var i=arguments[0];i.filter(this);for(e=0;e<this._geometries.length;e++)this._geometries[e].apply(i)}else if($o(arguments[0],G)){var r=arguments[0];r.filter(this);for(e=0;e<this._geometries.length;e++)this._geometries[e].apply(r)}},getBoundary:function(){return this.checkNotGeometryCollection(this),f.shouldNeverReachHere(),null},clone:function(){var t=q.prototype.clone.call(this);t._geometries=new Array(this._geometries.length).fill(null);for(var e=0;e<this._geometries.length;e++)t._geometries[e]=this._geometries[e].clone();return t},getGeometryType:function(){return"GeometryCollection"},copy:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new ht(t,this._factory)},isEmpty:function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},interfaces_:function(){return[]},getClass:function(){return ht}}),ht.serialVersionUID=-0x4f07bcb1f857d800,Ko(ft,ht),Zo(ft.prototype,{getSortIndex:function(){return q.SORTINDEX_MULTILINESTRING},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ht.prototype.equalsExact.call(this,t,e)}return ht.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return this.isClosed()?ut.FALSE:0},isClosed:function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},getDimension:function(){return 1},reverse:function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},getBoundary:function(){return new gt(this).getBoundary()},getGeometryType:function(){return"MultiLineString"},copy:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new ft(t,this._factory)},interfaces_:function(){return[rt]},getClass:function(){return ft}}),ft.serialVersionUID=0x7155d2ab4afa8000,Zo(gt.prototype,{boundaryMultiLineString:function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},getBoundary:function(){return this._geom instanceof wt?this.boundaryLineString(this._geom):this._geom instanceof ft?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},boundaryLineString:function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},getEmptyMultiPoint:function(){return this._geomFact.createMultiPoint()},computeBoundaryCoordinates:function(t){var e=new E;this._endpointMap=new it;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);0!==i.getNumPoints()&&(this.addEndpoint(i.getCoordinateN(0)),this.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(var r=this._endpointMap.entrySet().iterator();r.hasNext();){var o=r.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return V.toCoordinateArray(e)},addEndpoint:function(t){var e=this._endpointMap.get(t);null===e&&(e=new dt,this._endpointMap.put(t,e)),e.count++},interfaces_:function(){return[]},getClass:function(){return gt}}),gt.getBoundary=function(){if(1===arguments.length)return(t=new gt(arguments[0])).getBoundary();if(2===arguments.length){var t=new gt(arguments[0],arguments[1]);return t.getBoundary()}},Zo(dt.prototype,{interfaces_:function(){return[]},getClass:function(){return dt}}),Zo(xt.prototype,{interfaces_:function(){return[]},getClass:function(){return xt}}),xt.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return new String(n)},xt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new vt,n=new pt(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var i=arguments[0],r=arguments[1],o="",s=new yt(new _t(xt.getStackTrace(i))),a=0;a<r;a++)try{o+=s.readLine()+xt.NEWLINE}catch(t){if(!(t instanceof mt))throw t;f.shouldNeverReachHere()}return o}},xt.split=function(t,e){for(var n=e.length,i=new E,r=""+t,o=r.indexOf(e);o>=0;){var s=r.substring(0,o);i.add(s),o=(r=r.substring(o+n)).indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),u=0;u<a.length;u++)a[u]=i.get(u);return a},xt.toString=function(){if(1===arguments.length){var t=arguments[0];return xt.SIMPLE_ORDINATE_FORMAT.format(t)}},xt.spaces=function(t){return xt.chars(" ",t)},xt.NEWLINE=A.getProperty("line.separator"),xt.SIMPLE_ORDINATE_FORMAT=new function(){}("0.#"),Zo(Et.prototype,{interfaces_:function(){return[]},getClass:function(){return Et}}),Et.copyCoord=function(t,e,n,i){for(var r=Math.min(t.getDimension(),n.getDimension()),o=0;o<r;o++)n.setOrdinate(i,o,t.getOrdinate(e,o))},Et.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&(t.getOrdinate(0,T.X)===t.getOrdinate(e-1,T.X)&&t.getOrdinate(0,T.Y)===t.getOrdinate(e-1,T.Y))},Et.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var i=Math.min(t.getDimension(),e.getDimension()),r=0;r<n;r++)for(var s=0;s<i;s++){var a=t.getOrdinate(r,s),u=e.getOrdinate(r,s);if(t.getOrdinate(r,s)!==e.getOrdinate(r,s)&&(!o.isNaN(a)||!o.isNaN(u)))return!1}return!0},Et.extend=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();if(Et.copy(e,0,i,0,r),r>0)for(var o=r;o<n;o++)Et.copy(e,r-1,i,o,1);return i},Et.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)Et.swap(t,i,e-i)},Et.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var r=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,r)}},Et.copy=function(t,e,n,i,r){for(var o=0;o<r;o++)Et.copyCoord(t,e+o,n,i+o)},Et.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),i=new L;i.append("(");for(var r=0;r<e;r++){r>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(xt.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},Et.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Et.createClosedRing(t,e,4):e.getOrdinate(0,T.X)===e.getOrdinate(n-1,T.X)&&e.getOrdinate(0,T.Y)===e.getOrdinate(n-1,T.Y)?e:Et.createClosedRing(t,e,n+1)},Et.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();Et.copy(e,0,i,0,r);for(var o=r;o<n;o++)Et.copy(e,0,i,o,1);return i},Ko(wt,q),Zo(wt.prototype,{computeEnvelopeInternal:function(){return this.isEmpty()?new b:this._points.expandEnvelope(new b)},isRing:function(){return this.isClosed()&&this.isSimple()},getSortIndex:function(){return q.SORTINDEX_LINESTRING},getCoordinates:function(){return this._points.toCoordinateArray()},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._points.size()!==n._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),n._points.getCoordinate(i),e))return!1;return!0}return q.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Et.reverse(this._points),null}},getCoordinate:function(){return this.isEmpty()?null:this._points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?ut.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 Qt.computeLength(this._points)},getNumPoints:function(){return this._points.size()},reverse:function(){var t=this._points.copy();return Et.reverse(t),this.getFactory().createLineString(t)},compareToSameClass:function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var i=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==i)return i;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){t=arguments[0];return arguments[1].compare(this._points,t._points)}},apply:function(){if($o(arguments[0],k))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if($o(arguments[0],ct)){var n=arguments[0];if(0===this._points.size())return null;for(e=0;e<this._points.size()&&(n.filter(this._points,e),!n.isDone());e++);n.isGeometryChanged()&&this.geometryChanged()}else $o(arguments[0],lt)?arguments[0].filter(this):$o(arguments[0],G)&&arguments[0].filter(this)},getBoundary:function(){return new gt(this).getBoundary()},isEquivalentClass:function(t){return t instanceof wt},clone:function(){var t=q.prototype.clone.call(this);return t._points=this._points.clone(),t},getCoordinateN:function(t){return this._points.getCoordinate(t)},getGeometryType:function(){return"LineString"},copy:function(){return new wt(this._points.copy(),this._factory)},getCoordinateSequence:function(){return this._points},isEmpty:function(){return 0===this._points.size()},init:function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new r("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},isCoordinate:function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},getStartPoint:function(){return this.isEmpty()?null:this.getPointN(0)},getPointN:function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},interfaces_:function(){return[rt]},getClass:function(){return wt}}),wt.serialVersionUID=0x2b2b51ba435c8e00,Zo(bt.prototype,{interfaces_:function(){return[]},getClass:function(){return bt}}),Ko(It,q),Zo(It.prototype,{computeEnvelopeInternal:function(){if(this.isEmpty())return new b;var t=new b;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},getSortIndex:function(){return q.SORTINDEX_POINT},getCoordinates:function(){return this.isEmpty()?[]:[this.getCoordinate()]},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),e))}return q.prototype.equalsExact.apply(this,arguments)},normalize:function(){},getCoordinate:function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},getBoundaryDimension:function(){return ut.FALSE},getDimension:function(){return 0},getNumPoints:function(){return this.isEmpty()?0:1},reverse:function(){return this.copy()},getX:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x},compareToSameClass:function(){if(1===arguments.length){t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var t=arguments[0];return arguments[1].compare(this._coordinates,t._coordinates)}},apply:function(){if($o(arguments[0],k)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if($o(arguments[0],ct)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else $o(arguments[0],lt)?arguments[0].filter(this):$o(arguments[0],G)&&arguments[0].filter(this)},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},clone:function(){var t=q.prototype.clone.call(this);return t._coordinates=this._coordinates.clone(),t},getGeometryType:function(){return"Point"},copy:function(){return new It(this._coordinates.copy(),this._factory)},getCoordinateSequence:function(){return this._coordinates},getY:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y},isEmpty:function(){return 0===this._coordinates.size()},init:function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),f.isTrue(t.size()<=1),this._coordinates=t},isSimple:function(){return!0},interfaces_:function(){return[bt]},getClass:function(){return It}}),It.serialVersionUID=0x44077bad161cbc00,Zo(Ct.prototype,{interfaces_:function(){return[]},getClass:function(){return Ct}}),Ko(Nt,q),Zo(Nt.prototype,{computeEnvelopeInternal:function(){return this._shell.getEnvelopeInternal()},getSortIndex:function(){return q.SORTINDEX_POLYGON},getCoordinates:function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),i=0;i<n.length;i++)t[++e]=n[i];for(var r=0;r<this._holes.length;r++)for(var o=this._holes[r].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},getArea:function(){var t=0;t+=Math.abs(Qt.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(Qt.signedArea(this._holes[e].getCoordinateSequence()));return t},isRectangle:function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){if((o=t.getX(n))!==e.getMinX()&&o!==e.getMaxX())return!1;if((s=t.getY(n))!==e.getMinY()&&s!==e.getMaxY())return!1}for(var i=t.getX(0),r=t.getY(0),n=1;n<=4;n++){var o=t.getX(n),s=t.getY(n);if(o!==i===(s!==r))return!1;i=o,r=s}return!0},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t,i=this._shell,r=n._shell;if(!i.equalsExact(r,e))return!1;if(this._holes.length!==n._holes.length)return!1;for(var o=0;o<this._holes.length;o++)if(!this._holes[o].equalsExact(n._holes[o],e))return!1;return!0}return q.prototype.equalsExact.apply(this,arguments)},normalize:function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);at.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var i=new Array(e.getCoordinates().length-1).fill(null);A.arraycopy(e.getCoordinates(),0,i,0,i.length);var r=V.minCoordinate(e.getCoordinates());V.scroll(i,r),A.arraycopy(i,0,e.getCoordinates(),0,i.length),e.getCoordinates()[i.length]=i[0],Qt.isCCW(e.getCoordinates())===n&&V.reverse(e.getCoordinates())}},getCoordinate:function(){return this._shell.getCoordinate()},getNumInteriorRing:function(){return this._holes.length},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},getLength:function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},getNumPoints:function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},reverse:function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},convexHull:function(){return this.getExteriorRing().convexHull()},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var i=arguments[0],r=arguments[1],o=i,e=this._shell,n=o._shell,s=e.compareToSameClass(n,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=o.getNumInteriorRing(),l=0;l<a&&l<u;){var c=this.getInteriorRingN(l),h=o.getInteriorRingN(l),f=c.compareToSameClass(h,r);if(0!==f)return f;l++}return l<a?1:l<u?-1:0}},apply:function(){if($o(arguments[0],k)){var t=arguments[0];this._shell.apply(t);for(i=0;i<this._holes.length;i++)this._holes[i].apply(t)}else if($o(arguments[0],ct)){var e=arguments[0];if(this._shell.apply(e),!e.isDone())for(i=0;i<this._holes.length&&(this._holes[i].apply(e),!e.isDone());i++);e.isGeometryChanged()&&this.geometryChanged()}else if($o(arguments[0],lt))arguments[0].filter(this);else if($o(arguments[0],G)){var n=arguments[0];n.filter(this),this._shell.apply(n);for(var i=0;i<this._holes.length;i++)this._holes[i].apply(n)}},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},clone:function(){var t=q.prototype.clone.call(this);t._shell=this._shell.clone(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].clone();return t},getGeometryType:function(){return"Polygon"},copy:function(){for(var t=this._shell.copy(),e=new Array(this._holes.length).fill(null),n=0;n<e.length;n++)e[n]=this._holes[n].copy();return new Nt(t,e,this._factory)},getExteriorRing:function(){return this._shell},isEmpty:function(){return this._shell.isEmpty()},getInteriorRingN:function(t){return this._holes[t]},interfaces_:function(){return[Ct]},getClass:function(){return Nt}}),Nt.serialVersionUID=-0x307ffefd8dc97200,Ko(St,ht),Zo(St.prototype,{getSortIndex:function(){return q.SORTINDEX_MULTIPOINT},isValid:function(){return!0},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ht.prototype.equalsExact.call(this,t,e)}return ht.prototype.equalsExact.apply(this,arguments)},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this._geometries[t].getCoordinate()}return ht.prototype.getCoordinate.apply(this,arguments)},getBoundaryDimension:function(){return ut.FALSE},getDimension:function(){return 0},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},getGeometryType:function(){return"MultiPoint"},copy:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new St(t,this._factory)},interfaces_:function(){return[bt]},getClass:function(){return St}}),St.serialVersionUID=-0x6fb1ed4162e0fc00,Ko(Lt,wt),Zo(Lt.prototype,{getSortIndex:function(){return q.SORTINDEX_LINEARRING},getBoundaryDimension:function(){return ut.FALSE},isClosed:function(){return!!this.isEmpty()||wt.prototype.isClosed.call(this)},reverse:function(){var t=this._points.copy();return Et.reverse(t),this.getFactory().createLinearRing(t)},validateConstruction:function(){if(!this.isEmpty()&&!wt.prototype.isClosed.call(this))throw new r("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<Lt.MINIMUM_VALID_SIZE)throw new r("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new Lt(this._points.copy(),this._factory)},interfaces_:function(){return[]},getClass:function(){return Lt}}),Lt.MINIMUM_VALID_SIZE=4,Lt.serialVersionUID=-0x3b229e262367a600,Ko(Mt,ht),Zo(Mt.prototype,{getSortIndex:function(){return q.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ht.prototype.equalsExact.call(this,t,e)}return ht.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;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new E,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),i=0;i<n.getNumGeometries();i++)t.add(n.getGeometryN(i));var r=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(r))},getGeometryType:function(){return"MultiPolygon"},copy:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new Mt(t,this._factory)},interfaces_:function(){return[Ct]},getClass:function(){return Mt}}),Mt.serialVersionUID=-0x7a5aa1369171980,Zo(Pt.prototype,{setCopyUserData:function(t){this._isUserDataCopied=t},edit:function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},editInternal:function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof ht?this.editGeometryCollection(t,e):t instanceof Nt?this.editPolygon(t,e):t instanceof It?e.edit(t,this._factory):t instanceof wt?e.edit(t,this._factory):(f.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},editGeometryCollection:function(t,e){for(var n=e.edit(t,this._factory),i=new E,r=0;r<n.getNumGeometries();r++){var o=this.edit(n.getGeometryN(r),e);null===o||o.isEmpty()||i.add(o)}return n.getClass()===St?this._factory.createMultiPoint(i.toArray([])):n.getClass()===ft?this._factory.createMultiLineString(i.toArray([])):n.getClass()===Mt?this._factory.createMultiPolygon(i.toArray([])):this._factory.createGeometryCollection(i.toArray([]))},editPolygon:function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var i=this.edit(n.getExteriorRing(),e);if(null===i||i.isEmpty())return this._factory.createPolygon();for(var r=new E,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||r.add(s)}return this._factory.createPolygon(i,r.toArray([]))},interfaces_:function(){return[]},getClass:function(){return Pt}}),Pt.GeometryEditorOperation=Rt,Zo(Ot.prototype,{edit:function(t,e){return t},interfaces_:function(){return[Rt]},getClass:function(){return Ot}}),Zo(Tt.prototype,{edit:function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof Lt?e.createLinearRing(n):t instanceof wt?e.createLineString(n):t instanceof It?n.length>0?e.createPoint(n[0]):e.createPoint():t},interfaces_:function(){return[Rt]},getClass:function(){return Tt}}),Zo(At.prototype,{edit:function(t,e){return t instanceof Lt?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof wt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof It?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},interfaces_:function(){return[Rt]},getClass:function(){return At}}),Pt.NoOpGeometryOperation=Ot,Pt.CoordinateOperation=Tt,Pt.CoordinateSequenceOperation=At,Zo(Dt.prototype,{setOrdinate:function(t,e,n){switch(e){case T.X:this._coordinates[t].x=n;break;case T.Y:this._coordinates[t].y=n;break;case T.Z:this._coordinates[t].z=n;break;default:throw new r("invalid ordinateIndex")}},size:function(){return this._coordinates.length},getOrdinate:function(t,e){switch(e){case T.X:return this._coordinates[t].x;case T.Y:return this._coordinates[t].y;case T.Z:return this._coordinates[t].z}return o.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 g(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;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new Dt(t,this._dimension)},expandEnvelope:function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},copy:function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new Dt(t,this._dimension)},toString:function(){if(this._coordinates.length>0){var t=new L(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},getY:function(t){return this._coordinates[t].y},toCoordinateArray:function(){return this._coordinates},interfaces_:function(){return[T,l]},getClass:function(){return Dt}}),Dt.serialVersionUID=-0xcb44a778db18e00,Zo(Ft.prototype,{readResolve:function(){return Ft.instance()},create:function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new Dt(arguments[0]);if($o(arguments[0],T))return new Dt(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new Dt(t):new Dt(t,e)}},interfaces_:function(){return[F,l]},getClass:function(){return Ft}}),Ft.instance=function(){return Ft.instanceObject},Ft.serialVersionUID=-0x38e49fa6cf6f2e00,Ft.instanceObject=new Ft;var is,rs=Object.defineProperty,os=function(t,e){function n(t){if(!this||this.constructor!==n)return new n(t);this._keys=[],this._values=[],this._itp=[],this.objectOnly=e,t&&qt.call(this,t)}return e||rs(t,"size",{get:jt}),t.constructor=n,n.prototype=t,n}({delete:function(t){return this.has(t)&&(this._keys.splice(is,1),this._values.splice(is,1),this._itp.forEach(function(t){is<t[0]&&t[0]--})),is>-1},has:function(t){return kt.call(this,this._keys,t)},get:function(t){return this.has(t)?this._values[is]:void 0},set:function(t,e){return this.has(t)?this._values[is]=e:this._values[this._keys.push(t)-1]=e,this},keys:function(){return Bt(this._itp,this._keys)},values:function(){return Bt(this._itp,this._values)},entries:function(){return Bt(this._itp,this._keys,this._values)},forEach:function(t,e){for(var n=this.entries();;){var i=n.next();if(i.done)break;t.call(e,i.value[1],i.value[0],this)}},clear:function(){(this._keys||0).length=this._values.length=0}}),ss="undefined"!=typeof Map&&Map.prototype.values?Map:os;zt.prototype=new W,zt.prototype.get=function(t){return this.map_.get(t)||null},zt.prototype.put=function(t,e){return this.map_.set(t,e),e},zt.prototype.values=function(){for(var t=new E,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},zt.prototype.entrySet=function(){var t=new K;return this.map_.entries().forEach(function(e){return t.add(e)}),t},zt.prototype.size=function(){return this.map_.size()},Zo(Yt.prototype,{equals:function(t){if(!(t instanceof Yt))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 M(n).compareTo(new M(i))},getScale:function(){return this._scale},isFloating:function(){return this._modelType===Yt.FLOATING||this._modelType===Yt.FLOATING_SINGLE},getType:function(){return this._modelType},toString:function(){var t="UNKNOWN";return this._modelType===Yt.FLOATING?t="Floating":this._modelType===Yt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Yt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},makePrecise:function(){if("number"==typeof arguments[0]){var t=arguments[0];return o.isNaN(t)?t:this._modelType===Yt.FLOATING_SINGLE?t:this._modelType===Yt.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof g){var e=arguments[0];if(this._modelType===Yt.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},getMaximumSignificantDigits:function(){var t=16;return this._modelType===Yt.FLOATING?t=16:this._modelType===Yt.FLOATING_SINGLE?t=6:this._modelType===Yt.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[l,s]},getClass:function(){return Yt}}),Yt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Zo(Xt.prototype,{readResolve:function(){return Xt.nameToTypeMap.get(this._name)},toString:function(){return this._name},interfaces_:function(){return[l]},getClass:function(){return Xt}}),Xt.serialVersionUID=-552860263173159e4,Xt.nameToTypeMap=new zt,Yt.Type=Xt,Yt.serialVersionUID=0x6bee6404e9a25c00,Yt.FIXED=new Xt("FIXED"),Yt.FLOATING=new Xt("FLOATING"),Yt.FLOATING_SINGLE=new Xt("FLOATING SINGLE"),Yt.maximumPreciseValue=9007199254740992,Zo(Vt.prototype,{toGeometry:function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new g(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new g(t.getMinX(),t.getMinY()),new g(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new g(t.getMinX(),t.getMinY()),new g(t.getMinX(),t.getMaxY()),new g(t.getMaxX(),t.getMaxY()),new g(t.getMaxX(),t.getMinY()),new g(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($o(arguments[0],T))return new wt(arguments[0],this)}},createMultiLineString:function(){return 0===arguments.length?new ft(null,this):1===arguments.length?new ft(arguments[0],this):void 0},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(Vt.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Nt)return this.createMultiPolygon(Vt.toPolygonArray(t));if(a instanceof wt)return this.createMultiLineString(Vt.toLineStringArray(t));if(a instanceof It)return this.createMultiPoint(Vt.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 g){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if($o(arguments[0],T))return new It(arguments[0],this)}},getCoordinateSequenceFactory:function(){return this._coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Nt(null,null,this);if(1===arguments.length){if($o(arguments[0],T)){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 Lt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Nt(arguments[0],arguments[1],this)},getSRID:function(){return this._SRID},createGeometryCollection:function(){return 0===arguments.length?new ht(null,this):1===arguments.length?new ht(arguments[0],this):void 0},createGeometry:function(t){return new Pt(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return 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($o(arguments[0],T))return new Lt(arguments[0],this)}},createMultiPolygon:function(){return 0===arguments.length?new Mt(null,this):1===arguments.length?new Mt(arguments[0],this):void 0},createMultiPoint:function(){if(0===arguments.length)return new St(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new St(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if($o(arguments[0],T)){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;i<e.size();i++){var r=this.getCoordinateSequenceFactory().create(1,e.getDimension());Et.copy(e,i,r,0,1),n[i]=this.createPoint(r)}return this.createMultiPoint(n)}}},interfaces_:function(){return[l]},getClass:function(){return Vt}}),Vt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.getDefaultCoordinateSequenceFactory=function(){return Ft.instance()},Vt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Vt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Vt.serialVersionUID=-0x5ea75f2051eeb400;var as={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};Zo(Ut.prototype,{read:function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var r=as.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((r=as.emptyTypeStr.exec(t))[2]=void 0),r&&(n=r[1].toLowerCase(),i=r[2],ls[n]&&(e=ls[n].apply(this,[i]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},write:function(t){return this.extractGeometry(t)},extractGeometry:function(t){var e=t.getGeometryType().toLowerCase();if(!us[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+us[e].apply(this,[t])+")"}});var us={coordinate:function(t){return t.x+" "+t.y},point:function(t){return us.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+us.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,i=t._points._coordinates.length;n<i;++n)e.push(us.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,i=t._points._coordinates.length;n<i;++n)e.push(us.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+us.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+us.linestring.apply(this,[t._shell])+")");for(var n=0,i=t._holes.length;n<i;++n)e.push("("+us.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+us.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},ls={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(as.spaces);return this.geometryFactory.createPoint(new g(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(as.trimParens,"$1"),i.push(ls.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(i)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(as.spaces),i.push(new g(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(as.spaces),i.push(new g(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(as.parenComma),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(as.trimParens,"$1"),i.push(ls.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(i)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,i,r,o=t.trim().split(as.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(as.trimParens,"$1"),n=ls.linestring.apply(this,[e]),i=this.geometryFactory.createLinearRing(n._points),0===a?r=i:s.push(i);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(as.doubleParenComma),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(as.trimParens,"$1"),i.push(ls.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(i)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],i=0,r=e.length;i<r;++i)n.push(this.read(e[i]));return this.geometryFactory.createGeometryCollection(n)}};Zo(Ht.prototype,{write:function(t){return this.parser.write(t)}}),Zo(Ht,{toLineString:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}),Zo(Wt.prototype,{getIndexAlongSegment:function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},getTopologySummary:function(){var t=new L;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},computeIntersection:function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},getIntersectionNum:function(){return this._result},computeIntLineIndex:function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(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;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},getIntersection:function(t){return this._intPt[t]},isEndPoint:function(){return this.hasIntersection()&&!this._isProper},hasIntersection:function(){return this._result!==Wt.NO_INTERSECTION},getEdgeDistance:function(t,e){return Wt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},isCollinear:function(){return this._result===Wt.COLLINEAR_INTERSECTION},toString:function(){return Ht.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Ht.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},getEndpoint:function(t,e){return this._inputLines[t][e]},isIntersection:function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},getIntersectionAlongSegment:function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},interfaces_:function(){return[]},getClass:function(){return Wt}}),Wt.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=i>r?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},Wt.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},Wt.DONT_INTERSECT=0,Wt.DO_INTERSECT=1,Wt.COLLINEAR=2,Wt.NO_INTERSECTION=0,Wt.POINT_INTERSECTION=1,Wt.COLLINEAR_INTERSECTION=2,Ko(Jt,Wt),Zo(Jt.prototype,{isInSegmentEnvelopes:function(t){var e=new b(this._inputLines[0][0],this._inputLines[0][1]),n=new b(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},computeIntersection:function(){if(3!==arguments.length)return Wt.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,b.intersects(e,n,t)&&0===Qt.orientationIndex(e,n,t)&&0===Qt.orientationIndex(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=Wt.POINT_INTERSECTION,null;this._result=Wt.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=D.intersection(t,e,n,i)}catch(o){if(!(o instanceof C))throw o;r=Jt.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 g(Jt.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)<o&&(r=e,o=Math.abs(e)),Math.abs(n)<o&&(r=n,o=Math.abs(n)),Math.abs(i)<o&&(r=i),r},checkDD:function(t,e,n,i,r){var o=O.intersection(t,e,n,i),s=this.isInSegmentEnvelopes(o);A.out.println("DD in env = "+s+" --------------------- "+o),r.distance(o)>1e-4&&A.out.println("Distance = "+r.distance(o))},intersectionWithNormalization:function(t,e,n,i){var r=new g(t),o=new g(e),s=new g(n),a=new g(i),u=new g;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=b.intersects(t,e,n),o=b.intersects(t,e,i),s=b.intersects(n,i,t),a=b.intersects(n,i,e);return r&&o?(this._intPt[0]=n,this._intPt[1]=i,Wt.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=t,this._intPt[1]=e,Wt.COLLINEAR_INTERSECTION):r&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):r&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):o&&s?(this._intPt[0]=i,this._intPt[1]=t,!i.equals(t)||r||a?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||r||s?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):Wt.NO_INTERSECTION},normalizeToEnvCentre:function(t,e,n,i,r){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.x<i.x?n.x:i.x,c=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,g=((o>l?o:l)+(a<h?a:h))/2,d=((s>c?s:c)+(u<f?u:f))/2;r.x=g,r.y=d,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},computeIntersect:function(t,e,n,i){if(this._isProper=!1,!b.intersects(t,e,n,i))return Wt.NO_INTERSECTION;var r=Qt.orientationIndex(t,e,n),o=Qt.orientationIndex(t,e,i);if(r>0&&o>0||r<0&&o<0)return Wt.NO_INTERSECTION;var s=Qt.orientationIndex(n,i,t),a=Qt.orientationIndex(n,i,e);return s>0&&a>0||s<0&&a<0?Wt.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 g(n):0===o?this._intPt[0]=new g(i):0===s?this._intPt[0]=new g(t):0===a&&(this._intPt[0]=new g(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,i)),Wt.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return Jt}}),Jt.nearestEndpoint=function(t,e,n,i){var r=t,o=Qt.distancePointLine(t,n,i),s=Qt.distancePointLine(e,n,i);return s<o&&(o=s,r=e),(s=Qt.distancePointLine(n,t,e))<o&&(o=s,r=n),(s=Qt.distancePointLine(i,t,e))<o&&(o=s,r=i),r},Zo(Zt.prototype,{interfaces_:function(){return[]},getClass:function(){return Zt}}),Zt.orientationIndex=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return Zt.signOfDet2x2(i,r,o,s)},Zt.signOfDet2x2=function(t,e,n,i){var r=null,o=null,s=null;if(r=1,0===t||0===i)return 0===e||0===n?0:e>0?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<e?0<i?e<=i||(r=-r,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(r=-r,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):0<i?-e<=i?(r=-r,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),0<t){if(!(0<n))return r;if(!(t<=n))return r}else{if(0<n)return-r;if(!(t>=n))return-r;r=-r,t=-t,n=-n}for(;;){if(s=Math.floor(n/t),n-=s*t,(i-=s*e)<0)return-r;if(i>e)return r;if(t>n+n){if(e<i+i)return r}else{if(e>i+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(i<e+e)return-r}else{if(i>e+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},Zo(Kt.prototype,{countSegment:function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(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=Zt.signOfDet2x2(r,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==N.EXTERIOR},getLocation:function(){return this._isPointOnSegment?N.BOUNDARY:this._crossingCount%2==1?N.INTERIOR:N.EXTERIOR},isOnSegment:function(){return this._isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return Kt}}),Kt.locatePointInRing=function(){if(arguments[0]instanceof g&&$o(arguments[1],T)){for(var t=arguments[0],e=arguments[1],n=new Kt(t),i=new g,r=new g,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,r),n.countSegment(i,r),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof g&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],n=new Kt(s),o=1;o<a.length;o++){var i=a[o],r=a[o-1];if(n.countSegment(i,r),n.isOnSegment())return n.getLocation()}return n.getLocation()}},Zo(Qt.prototype,{interfaces_:function(){return[]},getClass:function(){return Qt}}),Qt.orientationIndex=function(t,e,n){return O.orientationIndex(t,e,n)},Qt.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var r=t[i].x-n,o=t[i+1].y;e+=r*(t[i-1].y-o)}return e/2}if($o(arguments[0],T)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new g,l=new g,c=new g;s.getCoordinate(0,l),s.getCoordinate(1,c);n=l.x;c.x-=n;for(var e=0,i=1;i<a-1;i++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(i+1,c),c.x-=n,e+=l.x*(u.y-c.y);return e/2}},Qt.distanceLineLine=function(t,e,n,i){if(t.equals(e))return Qt.distancePointLine(t,n,i);if(n.equals(i))return Qt.distancePointLine(i,t,e);var r=!1;if(b.intersects(t,e,n,i)){var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(0===o)r=!0;else{var s=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(r=!0)}}else r=!0;return r?S.min(Qt.distancePointLine(t,n,i),Qt.distancePointLine(e,n,i),Qt.distancePointLine(n,t,e),Qt.distancePointLine(i,t,e)):0},Qt.isPointInRing=function(t,e){return Qt.locatePointInRing(t,e)!==N.EXTERIOR},Qt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new g;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;s<e;s++){t.getCoordinate(s,i);var a=i.x,u=i.y,l=a-r,c=u-o;n+=Math.sqrt(l*l+c*c),r=a,o=u}return n},Qt.isCCW=function(t){var e=t.length-1;if(e<3)throw new r("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>n.y&&(n=s,i=o)}var a=i;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==i);var u=i;do{u=(u+1)%e}while(t[u].equals2D(n)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=Qt.computeOrientation(l,n,c);return 0===h?l.x>c.x:h>0},Qt.locatePointInRing=function(t,e){return Kt.locatePointInRing(t,e)},Qt.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)},Qt.computeOrientation=function(t,e,n){return Qt.orientationIndex(t,e,n)},Qt.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new r("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=Qt.distancePointLine(t,e[i],e[i+1]);o<n&&(n=o)}return n}if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=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)}},Qt.isOnLine=function(t,e){for(var n=new Jt,i=1;i<e.length;i++){var r=e[i-1],o=e[i];if(n.computeIntersection(t,r,o),n.hasIntersection())return!0}return!1},Qt.CLOCKWISE=-1,Qt.RIGHT=Qt.CLOCKWISE,Qt.COUNTERCLOCKWISE=1,Qt.LEFT=Qt.COUNTERCLOCKWISE,Qt.COLLINEAR=0,Qt.STRAIGHT=Qt.COLLINEAR,Zo($t.prototype,{minX:function(){return Math.min(this.p0.x,this.p1.x)},orientationIndex:function(){if(arguments[0]instanceof $t){var t=arguments[0],e=Qt.orientationIndex(this.p0,this.p1,t.p0),n=Qt.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof g){var i=arguments[0];return Qt.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 $t))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},intersection:function(t){var e=new Jt;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},project:function(){if(arguments[0]instanceof g){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new g(t);var e=this.projectionFactor(t),n=new g;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 $t){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 $t(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 Qt.distancePointLinePerpendicular(t,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return $t.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?o.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=o.MAX_VALUE,r=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);(r=a.distance(t.p1))<i&&(i=r,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);(r=u.distance(this.p0))<i&&(i=r,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return(r=l.distance(this.p1))<i&&(i=r,n[0]=this.p1,n[1]=l),n},closestPoint:function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},maxX:function(){return Math.max(this.p0.x,this.p1.x)},getLength:function(){return this.p0.distance(this.p1)},compareTo:function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},reverse:function(){var t=this.p0;this.p0=this.p1,this.p1=t},equalsTopo:function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)},lineIntersection:function(t){try{return D.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof C))throw t}return null},maxY:function(){return Math.max(this.p0.y,this.p1.y)},pointAlongOffset:function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(r*r+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");a=e*r/s,u=e*o/s}return new g(n-u,i+a)},setCoordinates:function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},segmentFraction:function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||o.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 $t){var t=arguments[0];return Qt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof g){var e=arguments[0];return Qt.distancePointLine(e,this.p0,this.p1)}},pointAlong:function(t){var e=new g;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[s,l]},getClass:function(){return $t}}),$t.midPoint=function(t,e){return new g((t.x+e.x)/2,(t.y+e.y)/2)},$t.serialVersionUID=0x2d2172135f411c00,Zo(te.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return(te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])||te.isTrue(this._matrix[N.INTERIOR][N.BOUNDARY])||te.isTrue(this._matrix[N.BOUNDARY][N.INTERIOR])||te.isTrue(this._matrix[N.BOUNDARY][N.BOUNDARY]))&&this._matrix[N.EXTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.BOUNDARY]===ut.FALSE},isCoveredBy:function(){return(te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])||te.isTrue(this._matrix[N.INTERIOR][N.BOUNDARY])||te.isTrue(this._matrix[N.BOUNDARY][N.INTERIOR])||te.isTrue(this._matrix[N.BOUNDARY][N.BOUNDARY]))&&this._matrix[N.INTERIOR][N.EXTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.EXTERIOR]===ut.FALSE},set:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),i=e%3;this._matrix[n][i]=ut.toDimensionValue(t.charAt(e))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this._matrix[r][o]=s}},isContains:function(){return te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&this._matrix[N.EXTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.BOUNDARY]===ut.FALSE},setAtLeast:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),i=e%3;this.setAtLeast(n,i,ut.toDimensionValue(t.charAt(e)))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this._matrix[r][o]<s&&(this._matrix[r][o]=s)}},setAtLeastIfValid:function(t,e,n){t>=0&&e>=0&&this.setAtLeast(t,e,n)},isWithin:function(){return te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&this._matrix[N.INTERIOR][N.EXTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.EXTERIOR]===ut.FALSE},isTouches:function(t,e){return t>e?this.isTouches(e,t):(t===ut.A&&e===ut.A||t===ut.L&&e===ut.L||t===ut.L&&e===ut.A||t===ut.P&&e===ut.A||t===ut.P&&e===ut.L)&&(this._matrix[N.INTERIOR][N.INTERIOR]===ut.FALSE&&(te.isTrue(this._matrix[N.INTERIOR][N.BOUNDARY])||te.isTrue(this._matrix[N.BOUNDARY][N.INTERIOR])||te.isTrue(this._matrix[N.BOUNDARY][N.BOUNDARY])))},isOverlaps:function(t,e){return t===ut.P&&e===ut.P||t===ut.A&&e===ut.A?te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&te.isTrue(this._matrix[N.INTERIOR][N.EXTERIOR])&&te.isTrue(this._matrix[N.EXTERIOR][N.INTERIOR]):t===ut.L&&e===ut.L&&(1===this._matrix[N.INTERIOR][N.INTERIOR]&&te.isTrue(this._matrix[N.INTERIOR][N.EXTERIOR])&&te.isTrue(this._matrix[N.EXTERIOR][N.INTERIOR]))},isEquals:function(t,e){return t===e&&(te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&this._matrix[N.INTERIOR][N.EXTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.EXTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.EXTERIOR][N.BOUNDARY]===ut.FALSE)},toString:function(){for(var t=new L("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,ut.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 r("Should be length 9: "+t);for(var e=0;e<3;e++)for(var n=0;n<3;n++)if(!te.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[N.INTERIOR][N.INTERIOR]===ut.FALSE&&this._matrix[N.INTERIOR][N.BOUNDARY]===ut.FALSE&&this._matrix[N.BOUNDARY][N.INTERIOR]===ut.FALSE&&this._matrix[N.BOUNDARY][N.BOUNDARY]===ut.FALSE},isCrosses:function(t,e){return t===ut.P&&e===ut.L||t===ut.P&&e===ut.A||t===ut.L&&e===ut.A?te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&te.isTrue(this._matrix[N.INTERIOR][N.EXTERIOR]):t===ut.L&&e===ut.P||t===ut.A&&e===ut.P||t===ut.A&&e===ut.L?te.isTrue(this._matrix[N.INTERIOR][N.INTERIOR])&&te.isTrue(this._matrix[N.EXTERIOR][N.INTERIOR]):t===ut.L&&e===ut.L&&0===this._matrix[N.INTERIOR][N.INTERIOR]},interfaces_:function(){return[a]},getClass:function(){return te}}),te.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return e===ut.SYM_DONTCARE||(e===ut.SYM_TRUE&&(t>=0||t===ut.TRUE)||(e===ut.SYM_FALSE&&t===ut.FALSE||(e===ut.SYM_P&&t===ut.P||(e===ut.SYM_L&&t===ut.L||e===ut.SYM_A&&t===ut.A))))}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var n=arguments[0],i=arguments[1];return new te(n).matches(i)}},te.isTrue=function(t){return t>=0||t===ut.TRUE},Zo(ee.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;n<t.length-1;n++){var i=t[n].distance(t[n+1]);if(0!==i){e+=i;var r=(t[n].x+t[n+1].x)/2;this._lineCentSum.x+=i*r;var o=(t[n].y+t[n+1].y)/2;this._lineCentSum.y+=i*o}}this._totalLength+=e,0===e&&t.length>0&&this.addPoint(t[0])},addHole:function(t){for(var e=Qt.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this._areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},getCentroid:function(){var t=new g;if(Math.abs(this._areasum2)>0)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=!Qt.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this._areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},addTriangle:function(t,e,n,i){var r=i?1:-1;ee.centroid3(t,e,n,this._triangleCent3);var o=ee.area2(t,e,n);this._cg3.x+=r*o*this._triangleCent3.x,this._cg3.y+=r*o*this._triangleCent3.y,this._areasum2+=r*o},add:function(){if(arguments[0]instanceof Nt){var t=arguments[0];this.addShell(t.getExteriorRing().getCoordinates());for(r=0;r<t.getNumInteriorRing();r++)this.addHole(t.getInteriorRingN(r).getCoordinates())}else if(arguments[0]instanceof q){var e=arguments[0];if(e.isEmpty())return null;if(e instanceof It)this.addPoint(e.getCoordinate());else if(e instanceof wt)this.addLineSegments(e.getCoordinates());else if(e instanceof Nt){var n=e;this.add(n)}else if(e instanceof ht)for(var i=e,r=0;r<i.getNumGeometries();r++)this.add(i.getGeometryN(r))}},interfaces_:function(){return[]},getClass:function(){return ee}}),ee.area2=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)},ee.centroid3=function(t,e,n,i){return i.x=t.x+e.x+n.x,i.y=t.y+e.y+n.y,null},ee.getCentroid=function(t){return new ee(t).getCentroid()},(ne.prototype=new Error).name="EmptyStackException",ie.prototype=new m,ie.prototype.add=function(t){return this.array_.push(t),!0},ie.prototype.get=function(t){if(t<0||t>=this.size())throw new IndexOutOfBoundsException;return this.array_[t]},ie.prototype.push=function(t){return this.array_.push(t),t},ie.prototype.pop=function(t){if(0===this.array_.length)throw new ne;return this.array_.pop()},ie.prototype.peek=function(){if(0===this.array_.length)throw new ne;return this.array_[this.array_.length-1]},ie.prototype.empty=function(){return 0===this.array_.length},ie.prototype.isEmpty=function(){return this.empty()},ie.prototype.search=function(t){return this.array_.indexOf(t)},ie.prototype.size=function(){return this.array_.length},ie.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},Zo(re.prototype,{filter:function(t){this.treeSet.contains(t)||(this.list.add(t),this.treeSet.add(t))},getCoordinates:function(){var t=new Array(this.list.size()).fill(null);return this.list.toArray(t)},interfaces_:function(){return[k]},getClass:function(){return re}}),re.filterCoordinates=function(t){for(var e=new re,n=0;n<t.length;n++)e.filter(t[n]);return e.getCoordinates()},Zo(oe.prototype,{preSort:function(t){for(var e=null,n=1;n<t.length;n++)(t[n].y<t[0].y||t[n].y===t[0].y&&t[n].x<t[0].x)&&(e=t[0],t[0]=t[n],t[n]=e);return at.sort(t,1,t.length,new se(t[0])),t},computeOctRing:function(t){var e=this.computeOctPts(t),n=new w;return n.add(e,!1),n.size()<3?null:(n.closeRing(),n.toCoordinateArray())},lineOrPolygon:function(t){if(3===(t=this.cleanRing(t)).length)return this._geomFactory.createLineString([t[0],t[1]]);var e=this._geomFactory.createLinearRing(t);return this._geomFactory.createPolygon(e,null)},cleanRing:function(t){f.equals(t[0],t[t.length-1]);for(var e=new E,n=null,i=0;i<=t.length-2;i++){var r=t[i],o=t[i+1];r.equals(o)||(null!==n&&this.isBetween(n,r,o)||(e.add(r),n=r))}e.add(t[t.length-1]);var s=new Array(e.size()).fill(null);return e.toArray(s)},isBetween:function(t,e,n){if(0!==Qt.computeOrientation(t,e,n))return!1;if(t.x!==n.x){if(t.x<=e.x&&e.x<=n.x)return!0;if(n.x<=e.x&&e.x<=t.x)return!0}if(t.y!==n.y){if(t.y<=e.y&&e.y<=n.y)return!0;if(n.y<=e.y&&e.y<=t.y)return!0}return!1},reduce:function(t){var e=this.computeOctRing(t);if(null===e)return t;for(var n=new st,i=0;i<e.length;i++)n.add(e[i]);for(i=0;i<t.length;i++)Qt.isPointInRing(t[i],e)||n.add(t[i]);var r=V.toCoordinateArray(n);return r.length<3?this.padArray3(r):r},getConvexHull:function(){if(0===this._inputPts.length)return this._geomFactory.createGeometryCollection(null);if(1===this._inputPts.length)return this._geomFactory.createPoint(this._inputPts[0]);if(2===this._inputPts.length)return this._geomFactory.createLineString(this._inputPts);var t=this._inputPts;this._inputPts.length>50&&(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;n<e.length;n++)n<t.length?e[n]=t[n]:e[n]=t[0];return e},computeOctPts:function(t){for(var e=new Array(8).fill(null),n=0;n<e.length;n++)e[n]=t[0];for(var i=1;i<t.length;i++)t[i].x<e[0].x&&(e[0]=t[i]),t[i].x-t[i].y<e[1].x-e[1].y&&(e[1]=t[i]),t[i].y>e[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].y<e[6].y&&(e[6]=t[i]),t[i].x+t[i].y<e[7].x+e[7].y&&(e[7]=t[i]);return e},toCoordinateArray:function(t){for(var e=new Array(t.size()).fill(null),n=0;n<t.size();n++){var i=t.get(n);e[n]=i}return e},grahamScan:function(t){var e=null,n=new ie;e=n.push(t[0]),e=n.push(t[1]),e=n.push(t[2]);for(var i=3;i<t.length;i++){for(e=n.pop();!n.empty()&&Qt.computeOrientation(n.peek(),e,t[i])>0;)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 oe}}),oe.extractCoordinates=function(t){var e=new re;return t.apply(e),e.getCoordinates()},Zo(se.prototype,{compare:function(t,e){var n=t,i=e;return se.polarCompare(this._origin,n,i)},interfaces_:function(){return[u]},getClass:function(){return se}}),se.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=Qt.computeOrientation(t,e,n);if(a===Qt.COUNTERCLOCKWISE)return 1;if(a===Qt.CLOCKWISE)return-1;var u=i*i+r*r,l=o*o+s*s;return u<l?-1:u>l?1:0},oe.RadialComparator=se,Zo(ae.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 Lt&&!i.isEmpty()||(n=!1);for(var r=new E,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof Lt||(n=!1),r.add(s))}if(n)return this._factory.createPolygon(i,r.toArray([]));var a=new E;return null!==i&&a.add(i),a.addAll(r),this._factory.buildGeometry(a)},createCoordinateSequence:function(t){return this._factory.getCoordinateSequenceFactory().create(t)},getInputGeometry:function(){return this._inputGeom},transformMultiLineString:function(t,e){for(var n=new E,i=0;i<t.getNumGeometries();i++){var r=this.transformLineString(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},transformCoordinates:function(t,e){return this.copy(t)},transformLineString:function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},transformMultiPoint:function(t,e){for(var n=new E,i=0;i<t.getNumGeometries();i++){var r=this.transformPoint(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},transformMultiPolygon:function(t,e){for(var n=new E,i=0;i<t.getNumGeometries();i++){var r=this.transformPolygon(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},copy:function(t){return t.copy()},transformGeometryCollection:function(t,e){for(var n=new E,i=0;i<t.getNumGeometries();i++){var r=this.transform(t.getGeometryN(i));null!==r&&(this._pruneEmptyGeometry&&r.isEmpty()||n.add(r))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Vt.toGeometryArray(n)):this._factory.buildGeometry(n)},transform:function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof It)return this.transformPoint(t,null);if(t instanceof St)return this.transformMultiPoint(t,null);if(t instanceof Lt)return this.transformLinearRing(t,null);if(t instanceof wt)return this.transformLineString(t,null);if(t instanceof ft)return this.transformMultiLineString(t,null);if(t instanceof Nt)return this.transformPolygon(t,null);if(t instanceof Mt)return this.transformMultiPolygon(t,null);if(t instanceof ht)return this.transformGeometryCollection(t,null);throw new r("Unknown Geometry subtype: "+t.getClass().getName())},transformLinearRing:function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},interfaces_:function(){return[]},getClass:function(){return ae}}),Zo(ue.prototype,{snapVertices:function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i<n;i++){var r=t.get(i),o=this.findSnapForVertex(r,e);null!==o&&(t.set(i,new g(o)),0===i&&this._isClosed&&t.set(t.size()-1,new g(o)))}},findSnapForVertex:function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},snapTo:function(t){var e=new w(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},snapSegments:function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var i=0;i<n;i++){var r=e[i],o=this.findSegmentIndexToSnap(r,t);o>=0&&t.add(o+1,new g(r),!1)}},findSegmentIndexToSnap:function(t,e){for(var n=o.MAX_VALUE,i=-1,r=0;r<e.size()-1;r++){if(this._seg.p0=e.get(r),this._seg.p1=e.get(r+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var s=this._seg.distance(t);s<this._snapTolerance&&s<n&&(n=s,i=r)}return i},setAllowSnappingToSourceVertices:function(t){this._allowSnappingToSourceVertices=t},interfaces_:function(){return[]},getClass:function(){return ue}}),ue.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])},Zo(le.prototype,{snapTo:function(t,e){return new ce(e,this.extractTargetCoordinates(t)).transform(this._srcGeom)},snapToSelf:function(t,e){var n=new ce(t,this.extractTargetCoordinates(this._srcGeom),!0).transform(this._srcGeom),i=n;return e&&$o(i,Ct)&&(i=n.buffer(0)),i},computeSnapTolerance:function(t){return this.computeMinimumSegmentLength(t)/10},extractTargetCoordinates:function(t){for(var e=new st,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},computeMinimumSegmentLength:function(t){for(var e=o.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},interfaces_:function(){return[]},getClass:function(){return le}}),le.snap=function(t,e,n){var i=new Array(2).fill(null),r=new le(t);i[0]=r.snapTo(e,n);var o=new le(e);return i[1]=o.snapTo(i[0],n),i},le.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=le.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Yt.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(le.computeOverlaySnapTolerance(r),le.computeOverlaySnapTolerance(o))}},le.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*le.SNAP_PRECISION_FACTOR},le.snapToSelf=function(t,e,n){return new le(t).snapToSelf(e,n)},le.SNAP_PRECISION_FACTOR=1e-9,Ko(ce,ae),Zo(ce.prototype,{snapLine:function(t,e){var n=new ue(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 ce}}),Zo(he.prototype,{getCommon:function(){return o.longBitsToDouble(this._commonBits)},add:function(t){var e=o.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=he.signExpBits(this._commonBits),this._isFirst=!1,null):he.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=he.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=he.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],e=o.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+Long.toBinaryString(t),i=n.substring(n.length-64);return i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]"}},interfaces_:function(){return[]},getClass:function(){return he}}),he.getBit=function(t,e){return 0!=(t&1<<e)?1:0},he.signExpBits=function(t){return t>>52},he.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},he.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(he.getBit(t,i)!==he.getBit(e,i))return n;n++}return 52},Zo(fe.prototype,{addCommonBits:function(t){var e=new de(this._commonCoord);t.apply(e),t.geometryChanged()},removeCommonBits:function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new g(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new de(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 fe}}),Zo(ge.prototype,{filter:function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},getCommonCoordinate:function(){return new g(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},interfaces_:function(){return[k]},getClass:function(){return ge}}),Zo(de.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[ct]},getClass:function(){return de}}),fe.CommonCoordinateFilter=ge,fe.Translater=de,Zo(pe.prototype,{next:function(){if(this._atStart)return this._atStart=!1,pe.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 y;var t=this._parent.getGeometryN(this._index++);return t instanceof ht?(this._subcollectionIterator=new pe(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[p]},getClass:function(){return pe}}),pe.isAtomic=function(t){return!(t instanceof ht)},Zo(_e.prototype,{locateInternal:function(){if(arguments[0]instanceof g&&arguments[1]instanceof Nt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return N.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===N.EXTERIOR)return N.EXTERIOR;if(i===N.BOUNDARY)return N.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,o);if(s===N.INTERIOR)return N.EXTERIOR;if(s===N.BOUNDARY)return N.BOUNDARY}return N.INTERIOR}if(arguments[0]instanceof g&&arguments[1]instanceof wt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return N.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?Qt.isOnLine(a,l)?N.INTERIOR:N.EXTERIOR:N.BOUNDARY}if(arguments[0]instanceof g&&arguments[1]instanceof It){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?N.INTERIOR:N.EXTERIOR}},locateInPolygonRing:function(t,e){return e.getEnvelopeInternal().intersects(t)?Qt.locatePointInRing(t,e.getCoordinates()):N.EXTERIOR},intersects:function(t,e){return this.locate(t,e)!==N.EXTERIOR},updateLocationInfo:function(t){t===N.INTERIOR&&(this._isIn=!0),t===N.BOUNDARY&&this._numBoundaries++},computeLocation:function(t,e){if(e instanceof It&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Nt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof ft)for(var n=e,i=0;i<n.getNumGeometries();i++){var r=n.getGeometryN(i);this.updateLocationInfo(this.locateInternal(t,r))}else if(e instanceof Mt)for(var o=e,i=0;i<o.getNumGeometries();i++){var s=o.getGeometryN(i);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof ht)for(var a=new pe(e);a.hasNext();){var u=a.next();u!==e&&this.computeLocation(t,u)}},locate:function(t,e){return e.isEmpty()?N.EXTERIOR:e instanceof wt?this.locateInternal(t,e):e instanceof Nt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?N.BOUNDARY:this._numBoundaries>0||this._isIn?N.INTERIOR:N.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return _e}}),Zo(ve.prototype,{interfaces_:function(){return[]},getClass:function(){return ve}}),ve.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 r("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof g&&arguments[1]instanceof g){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(0===a&&0===u)throw new r("Cannot compute the octant for two identical points "+o);return ve.octant(a,u)}},Zo(me.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(t){},isClosed:function(){},setData:function(t){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return me}}),Zo(ye.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:ve.octant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this._data=t},getData:function(){return this._data},toString:function(){return Ht.toLineString(new Dt(this._pts))},interfaces_:function(){return[me]},getClass:function(){return ye}}),Zo(xe.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return xe}}),Zo(Ee.prototype,{getItem:function(){return this._item},getBounds:function(){return this._bounds},interfaces_:function(){return[xe,l]},getClass:function(){return Ee}}),Zo(we.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)!==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 we}}),Zo(be.prototype,{visitItem:function(t){},interfaces_:function(){return[]},getClass:function(){return be}}),Zo(Ie.prototype,{insert:function(t,e){},remove:function(t,e){},query:function(){},interfaces_:function(){return[]},getClass:function(){return Ie}}),Zo(Ce.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[xe,l]},getClass:function(){return Ce}}),Ce.serialVersionUID=0x5a1e55ec41369800;var cs={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return cs.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?at.sort(n,e):at.sort(n);for(var i=t.iterator(),r=0,o=n.length;r<o;r++)i.next(),i.set(n[r])},singletonList:function(t){var e=new E;return e.add(t),e}};Zo(Ne.prototype,{expandToQueue:function(t,e){var n=Ne.isComposite(this._boundable1),i=Ne.isComposite(this._boundable2);if(n&&i)return Ne.area(this._boundable1)>Ne.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(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new r("neither boundable is composite")},isLeaves:function(){return!(Ne.isComposite(this._boundable1)||Ne.isComposite(this._boundable2))},compareTo:function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},expand:function(t,e,n,i){for(var r=t.getChildBoundables().iterator();r.hasNext();){var o=new Ne(r.next(),e,this._itemDistance);o.getDistance()<i&&n.add(o)}},getBoundable:function(t){return 0===t?this._boundable1:this._boundable2},getDistance:function(){return this._distance},distance:function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},interfaces_:function(){return[s]},getClass:function(){return Ne}}),Ne.area=function(t){return t.getBounds().getArea()},Ne.isComposite=function(t){return t instanceof Ce},Zo(Se.prototype,{getNodeCapacity:function(){return this._nodeCapacity},lastNode:function(t){return t.get(t.size()-1)},size:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ce?t+=this.size(n):n instanceof Ee&&(t+=1)}return t}},removeItem:function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof Ee&&r.getItem()===e&&(n=r)}return null!==n&&(t.getChildBoundables().remove(n),!0)},itemsTree:function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new E:t}if(1===arguments.length){for(var e=arguments[0],n=new E,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof Ce){var o=this.itemsTree(r);null!==o&&n.add(o)}else r instanceof Ee?n.add(r.getItem()):f.shouldNeverReachHere()}return n.size()<=0?null:n}},insert:function(t,e){f.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ee(t,e))},boundablesAtLevel:function(){if(1===arguments.length){var t=arguments[0],e=new E;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(f.isTrue(n>-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Ce?this.boundablesAtLevel(n,s,r):(f.isTrue(s instanceof Ee),-1===n&&r.add(s))}return null}},query:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new E;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($o(arguments[2],be)&&arguments[0]instanceof Object&&arguments[1]instanceof Ce)for(var r=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;u<a.size();u++){g=a.get(u);this.getIntersectsOp().intersects(g.getBounds(),r)&&(g instanceof Ce?this.query(r,g,s):g instanceof Ee?s.visitItem(g.getItem()):f.shouldNeverReachHere())}else if($o(arguments[2],m)&&arguments[0]instanceof Object&&arguments[1]instanceof Ce)for(var l=arguments[0],c=arguments[1],h=arguments[2],a=c.getChildBoundables(),u=0;u<a.size();u++){var g=a.get(u);this.getIntersectsOp().intersects(g.getBounds(),l)&&(g instanceof Ce?this.query(l,g,h):g instanceof Ee?h.add(g.getItem()):f.shouldNeverReachHere())}},build:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},getRoot:function(){return this.build(),this._root},remove:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=this.removeItem(i,r);if(o)return!0;for(var s=null,a=i.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&(u instanceof Ce&&(o=this.remove(n,u,r)))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&i.getChildBoundables().remove(s),o}},createHigherLevels:function(t,e){f.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},depth:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ce){var i=this.depth(n);i>t&&(t=i)}}return t+1}},createParentBoundables:function(t,e){f.isTrue(!t.isEmpty());var n=new E;n.add(this.createNode(e));var i=new E(t);cs.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[l]},getClass:function(){return Se}}),Se.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Se.IntersectsOp=function(){},Se.serialVersionUID=-0x35ef64c82d4c5400,Se.DEFAULT_NODE_CAPACITY=10,Zo(Le.prototype,{distance:function(t,e){},interfaces_:function(){return[]},getClass:function(){return Le}}),Ko(Me,Se),Zo(Me.prototype,{createParentBoundablesFromVerticalSlices:function(t,e){f.isTrue(t.length>0);for(var n=new E,i=0;i<t.length;i++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[i],e));return n},createNode:function(t){return new Pe(t)},size:function(){return 0===arguments.length?Se.prototype.size.call(this):Se.prototype.size.apply(this,arguments)},insert:function(){if(2!==arguments.length)return Se.prototype.insert.apply(this,arguments);var t=arguments[0],e=arguments[1];if(t.isNull())return null;Se.prototype.insert.call(this,t,e)},getIntersectsOp:function(){return Me.intersectsOp},verticalSlices:function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),i=new Array(e).fill(null),r=t.iterator(),o=0;o<e;o++){i[o]=new E;for(var s=0;r.hasNext()&&s<n;){var a=r.next();i[o].add(a),s++}}return i},query:function(){if(1===arguments.length){var t=arguments[0];return Se.prototype.query.call(this,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];Se.prototype.query.call(this,e,n)}else if(3===arguments.length)if($o(arguments[2],be)&&arguments[0]instanceof Object&&arguments[1]instanceof Ce){var i=arguments[0],r=arguments[1],o=arguments[2];Se.prototype.query.call(this,i,r,o)}else if($o(arguments[2],m)&&arguments[0]instanceof Object&&arguments[1]instanceof Ce){var s=arguments[0],a=arguments[1],u=arguments[2];Se.prototype.query.call(this,s,a,u)}},getComparator:function(){return Me.yComparator},createParentBoundablesFromVerticalSlice:function(t,e){return Se.prototype.createParentBoundables.call(this,t,e)},remove:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return Se.prototype.remove.call(this,t,e)}return Se.prototype.remove.apply(this,arguments)},depth:function(){return 0===arguments.length?Se.prototype.depth.call(this):Se.prototype.depth.apply(this,arguments)},createParentBoundables:function(t,e){f.isTrue(!t.isEmpty());var n=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new E(t);cs.sort(i,Me.xComparator);var r=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(r,e)},nearestNeighbour:function(){if(1===arguments.length){if($o(arguments[0],Le)){var t=arguments[0],e=new Ne(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof Ne){var n=arguments[0];return this.nearestNeighbour(n,o.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof Me&&$o(arguments[1],Le)){var i=arguments[0],r=arguments[1],e=new Ne(this.getRoot(),i.getRoot(),r);return this.nearestNeighbour(e)}if(arguments[0]instanceof Ne&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,l=new we;for(l.add(s);!l.isEmpty()&&a>0;){var c=l.poll(),h=c.getDistance();if(h>=a)break;c.isLeaves()?(a=h,u=c):c.expandToQueue(l,a)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],p=new Ee(f,g),e=new Ne(this.getRoot(),p,d);return this.nearestNeighbour(e)[0]}},interfaces_:function(){return[Ie,l]},getClass:function(){return Me}}),Me.centreX=function(t){return Me.avg(t.getMinX(),t.getMaxX())},Me.avg=function(t,e){return(t+e)/2},Me.centreY=function(t){return Me.avg(t.getMinY(),t.getMaxY())},Ko(Pe,Ce),Zo(Pe.prototype,{computeBounds:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new b(n.getBounds()):t.expandToInclude(n.getBounds())}return t},interfaces_:function(){return[]},getClass:function(){return Pe}}),Me.STRtreeNode=Pe,Me.serialVersionUID=0x39920f7d5f261e0,Me.xComparator={interfaces_:function(){return[u]},compare:function(t,e){return Se.compareDoubles(Me.centreX(t.getBounds()),Me.centreX(e.getBounds()))}},Me.yComparator={interfaces_:function(){return[u]},compare:function(t,e){return Se.compareDoubles(Me.centreY(t.getBounds()),Me.centreY(e.getBounds()))}},Me.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(t,e){return t.intersects(e)}},Me.DEFAULT_NODE_CAPACITY=10,Zo(Re.prototype,{interfaces_:function(){return[]},getClass:function(){return Re}}),Re.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Re.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Re.relativeSign(e.x,n.x),r=Re.relativeSign(e.y,n.y);switch(t){case 0:return Re.compareValue(i,r);case 1:return Re.compareValue(r,i);case 2:return Re.compareValue(r,-i);case 3:return Re.compareValue(-i,r);case 4:return Re.compareValue(-i,-r);case 5:return Re.compareValue(-r,-i);case 6:return Re.compareValue(-r,i);case 7:return Re.compareValue(i,-r)}return f.shouldNeverReachHere("invalid octant value"),0},Re.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0},Zo(Oe.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.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Re.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[s]},getClass:function(){return Oe}}),Zo(Te.prototype,{getSplitCoordinates:function(){var t=new w;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 E;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;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),i=(this._edge.getCoordinate(e+1),this._edge.getCoordinate(e+2));n.equals2D(i)&&t.add(new M(e+1))}},addEdgeCoordinates:function(t,e,n){var i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);n.add(new g(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));r&&n.add(new g(e.coord))},iterator:function(){return this._nodeMap.values().iterator()},addSplitEdges:function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},findCollapseIndex:function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,1===i&&(n[0]=t.segmentIndex+1,!0)},findCollapsesFromInsertedNodes:function(t){for(var e=new Array(1).fill(null),n=this.iterator(),i=n.next();n.hasNext();){var r=n.next();this.findCollapseIndex(i,r,e)&&t.add(new M(e[0])),i=r}},getEdge:function(){return this._edge},addEndpoints:function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},createSplitEdge:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new g(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return r&&(o[s]=new g(e.coord)),new Fe(o,this._edge.getData())},add:function(t,e){var n=new Oe(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return null!==i?(f.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},checkSplitEdgesCorrectness:function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new c("bad split edge start point at "+n);var i=t.get(t.size()-1).getCoordinates(),r=i[i.length-1];if(!r.equals2D(e[e.length-1]))throw new c("bad split edge end point at "+r)},interfaces_:function(){return[]},getClass:function(){return Te}}),Zo(Ae.prototype,{next:function(){return null===this._currNode?(this._currNode=this._nextNode,this._currSegIndex=this._currNode.segmentIndex,this.readNextNode(),this._currNode):null===this._nextNode?null:this._nextNode.segmentIndex===this._currNode.segmentIndex?(this._currNode=this._nextNode,this._currSegIndex=this._currNode.segmentIndex,this.readNextNode(),this._currNode):null},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){return null!==this._nextNode},readNextNode:function(){this._nodeIt.hasNext()?this._nextNode=this._nodeIt.next():this._nextNode=null},interfaces_:function(){return[p]},getClass:function(){return Ae}}),Zo(De.prototype,{addIntersection:function(t,e){},interfaces_:function(){return[me]},getClass:function(){return De}}),Zo(Fe.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:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this._data=t},safeOctant:function(t,e){return t.equals2D(e)?0:ve.octant(t,e)},getData:function(){return this._data},addIntersection:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=(arguments[2],arguments[3]),o=new g(n.getIntersection(r));this.addIntersection(o,i)}},toString:function(){return Ht.toLineString(new Dt(this._pts))},getNodeList:function(){return this._nodeList},addIntersectionNode:function(t,e){var n=e,i=n+1;if(i<this._pts.length){var r=this._pts[i];t.equals2D(r)&&(n=i)}return this._nodeList.add(t,n)},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[De]},getClass:function(){return Fe}}),Fe.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new E;return Fe.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],i=arguments[1],r=n.iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(i)},Zo(Ge.prototype,{overlap:function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},interfaces_:function(){return[]},getClass:function(){return Ge}}),Zo(qe.prototype,{getLineSegment:function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},computeSelect:function(t,e,n,i){var r=this._pts[e],o=this._pts[n];if(i.tempEnv1.init(r,o),n-e==1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,i),s<n&&this.computeSelect(t,s,n,i)},getCoordinates:function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},computeOverlaps:function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},setId:function(t){this._id=t},select:function(t,e){this.computeSelect(t,this._start,this._end,e)},getEnvelope:function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new b(t,e)}return this._env},getEndIndex:function(){return this._end},getStartIndex:function(){return this._start},getContext:function(){return this._context},getId:function(){return this._id},computeOverlapsInternal:function(t,e,n,i,r,o){var s=this._pts[t],a=this._pts[e],u=n._pts[i],l=n._pts[r];if(e-t==1&&r-i==1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((i+r)/2);t<c&&(i<h&&this.computeOverlapsInternal(t,c,n,i,h,o),h<r&&this.computeOverlapsInternal(t,c,n,h,r,o)),c<e&&(i<h&&this.computeOverlapsInternal(c,e,n,i,h,o),h<r&&this.computeOverlapsInternal(c,e,n,h,r,o))},interfaces_:function(){return[]},getClass:function(){return qe}}),Zo(ke.prototype,{interfaces_:function(){return[]},getClass:function(){return ke}}),ke.isNorthern=function(t){return t===ke.NE||t===ke.NW},ke.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},ke.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?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 r("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 g&&arguments[1]instanceof g){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new r("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?ke.NE:ke.SE:i.y>=n.y?ke.NW:ke.SW}},ke.NE=0,ke.NW=1,ke.SW=2,ke.SE=3,Zo(Be.prototype,{interfaces_:function(){return[]},getClass:function(){return Be}}),Be.getChainStartIndices=function(t){var e=0,n=new E;n.add(new M(e));do{var i=Be.findChainEnd(t,e);n.add(new M(i)),e=i}while(e<t.length-1);return Be.toIntArray(n)},Be.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=ke.quadrant(t[n],t[n+1]),r=e+1;r<t.length&&(t[r-1].equals2D(t[r])||ke.quadrant(t[r-1],t[r])===i);)r++;return r-1},Be.getChains=function(){if(1===arguments.length){var t=arguments[0];return Be.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],i=new E,r=Be.getChainStartIndices(e),o=0;o<r.length-1;o++){var s=new qe(e,r[o],r[o+1],n);i.add(s)}return i}},Be.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},Zo(je.prototype,{computeNodes:function(t){},getNodedSubstrings:function(){},interfaces_:function(){return[]},getClass:function(){return je}}),Zo(ze.prototype,{setSegmentIntersector:function(t){this._segInt=t},interfaces_:function(){return[je]},getClass:function(){return ze}}),Ko(Ye,ze),Zo(Ye.prototype,{getMonotoneChains:function(){return this._monoChains},getNodedSubstrings:function(){return Fe.getNodedSubstrings(this._nodedSegStrings)},getIndex:function(){return this._index},add:function(t){for(var e=Be.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},computeNodes:function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},intersectChains:function(){for(var t=new Xe(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),i=this._index.query(n.getEnvelope()).iterator();i.hasNext();){var r=i.next();if(r.getId()>n.getId()&&(n.computeOverlaps(r,t),this._nOverlaps++),this._segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return Ye}}),Ko(Xe,Ge),Zo(Xe.prototype,{overlap:function(){if(4!==arguments.length)return Ge.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 Xe}}),Ye.SegmentOverlapAction=Xe,Ko(Ve,c),Zo(Ve.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Ve}}),Ve.msgWithCoord=function(t,e){return null!==e?t+" [ "+e+" ]":t},Zo(Ue.prototype,{processIntersections:function(t,e,n,i){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return Ue}}),Zo(He.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&&!(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[Ue]},getClass:function(){return He}}),He.createAllIntersectionsFinder=function(t){var e=new He(t);return e.setFindAllIntersections(!0),e},He.createAnyIntersectionFinder=function(t){return new He(t)},He.createIntersectionCounter=function(t){var e=new He(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},Zo(We.prototype,{execute:function(){if(null!==this._segInt)return null;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 He(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Ye;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 Ve(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 "+Ht.toLineString(t[0],t[1])+" and "+Ht.toLineString(t[2],t[3])},interfaces_:function(){return[]},getClass:function(){return We}}),We.computeIntersections=function(t){var e=new We(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},Zo(Je.prototype,{checkValid:function(){this._nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return Je}}),Je.toSegmentStrings=function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next();e.add(new ye(i.getCoordinates(),i))}return e},Je.checkValid=function(t){new Je(t).checkValid()},Zo(Ze.prototype,{map:function(t){for(var e=new E,n=0;n<t.getNumGeometries();n++){var i=this._mapOp.map(t.getGeometryN(n));i.isEmpty()||e.add(i)}return t.getFactory().createGeometryCollection(Vt.toGeometryArray(e))},interfaces_:function(){return[]},getClass:function(){return Ze}}),Ze.map=function(t,e){return new Ze(e).map(t)},Zo(Ke.prototype,{interfaces_:function(){return[]},getClass:function(){return Ke}}),Ke.opposite=function(t){return t===Ke.LEFT?Ke.RIGHT:t===Ke.RIGHT?Ke.LEFT:t},Ke.ON=0,Ke.LEFT=1,Ke.RIGHT=2,Zo(Qe.prototype,{setAllLocations:function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},isNull:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==N.NONE)return!1;return!0},setAllLocationsIfNull:function(t){for(var e=0;e<this.location.length;e++)this.location[e]===N.NONE&&(this.location[e]=t)},isLine:function(){return 1===this.location.length},merge:function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ke.ON]=this.location[Ke.ON],e[Ke.LEFT]=N.NONE,e[Ke.RIGHT]=N.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===N.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},getLocations:function(){return this.location},flip:function(){if(this.location.length<=1)return null;var t=this.location[Ke.LEFT];this.location[Ke.LEFT]=this.location[Ke.RIGHT],this.location[Ke.RIGHT]=t},toString:function(){var t=new L;return this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ke.LEFT])),t.append(N.toLocationSymbol(this.location[Ke.ON])),this.location.length>1&&t.append(N.toLocationSymbol(this.location[Ke.RIGHT])),t.toString()},setLocations:function(t,e,n){this.location[Ke.ON]=t,this.location[Ke.LEFT]=e,this.location[Ke.RIGHT]=n},get:function(t){return t<this.location.length?this.location[t]:N.NONE},isArea:function(){return this.location.length>1},isAnyNull:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===N.NONE)return!0;return!1},setLocation:function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ke.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},init:function(t){this.location=new Array(t).fill(null),this.setAllLocations(N.NONE)},isEqualOnSide:function(t,e){return this.location[e]===t.location[e]},allPositionsEqual:function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},interfaces_:function(){return[]},getClass:function(){return Qe}}),Zo($e.prototype,{getGeometryCount:function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},setAllLocations:function(t,e){this.elt[t].setAllLocations(e)},isNull:function(t){return this.elt[t].isNull()},setAllLocationsIfNull:function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},isLine:function(t){return this.elt[t].isLine()},merge:function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Qe(t.elt[e]):this.elt[e].merge(t.elt[e])},flip:function(){this.elt[0].flip(),this.elt[1].flip()},getLocation:function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ke.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},toString:function(){var t=new L;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},isArea:function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},isAnyNull:function(t){return this.elt[t].isAnyNull()},setLocation:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ke.ON,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.elt[n].setLocation(i,r)}},isEqualOnSide:function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},allPositionsEqual:function(t,e){return this.elt[t].allPositionsEqual(e)},toLine:function(t){this.elt[t].isArea()&&(this.elt[t]=new Qe(this.elt[t].location[0]))},interfaces_:function(){return[]},getClass:function(){return $e}}),$e.toLineLabel=function(t){for(var e=new $e(N.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e},Zo(tn.prototype,{computeRing:function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=Qt.isCCW(this._ring.getCoordinates())},isIsolated:function(){return 1===this._label.getGeometryCount()},computePoints:function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ve("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ve("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var i=e.getLabel();f.isTrue(i.isArea()),this.mergeLabel(i),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},getLinearRing:function(){return this._ring},getCoordinate:function(t){return this._pts.get(t)},computeMaxNodeDegree:function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},addPoints:function(t,e,n){var i=t.getCoordinates();if(e){r=1;n&&(r=0);for(o=r;o<i.length;o++)this._pts.add(i[o])}else{var r=i.length-2;n&&(r=i.length-1);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(!Qt.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,Ke.RIGHT);if(i===N.NONE)return null;if(this._label.getLocation(n)===N.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<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},interfaces_:function(){return[]},getClass:function(){return tn}}),Ko(en,tn),Zo(en.prototype,{setEdgeRing:function(t,e){t.setMinEdgeRing(e)},getNext:function(t){return t.getNextMin()},interfaces_:function(){return[]},getClass:function(){return en}}),Ko(nn,tn),Zo(nn.prototype,{buildMinimalRings:function(){var t=new E,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new en(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},setEdgeRing:function(t,e){t.setEdgeRing(e)},linkDirectedEdgesForMinimalEdgeRings:function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},getNext:function(t){return t.getNext()},interfaces_:function(){return[]},getClass:function(){return nn}}),Zo(rn.prototype,{setVisited:function(t){this._isVisited=t},setInResult:function(t){this._isInResult=t},isCovered:function(){return this._isCovered},isCoveredSet:function(){return this._isCoveredSet},setLabel:function(t){this._label=t},getLabel:function(){return this._label},setCovered:function(t){this._isCovered=t,this._isCoveredSet=!0},updateIM:function(t){f.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return rn}}),Ko(on,rn),Zo(on.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=N.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==N.BOUNDARY&&(n=i)}return n},setLabel:function(){if(2!==arguments.length)return rn.prototype.setLabel.apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new $e(t,e):this._label.setLocation(t,e)},getEdges:function(){return this._edges},mergeLabel:function(){if(arguments[0]instanceof on){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof $e)for(var e=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(e,n);this._label.getLocation(n)===N.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=N.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case N.BOUNDARY:n=N.INTERIOR;break;case N.INTERIOR:default:n=N.BOUNDARY}this._label.setLocation(t,n)},interfaces_:function(){return[]},getClass:function(){return on}}),Zo(sn.prototype,{find:function(t){return this.nodeMap.get(t)},addNode:function(){if(arguments[0]instanceof g){var t=arguments[0];return null===(n=this.nodeMap.get(t))&&(n=this.nodeFact.createNode(t),this.nodeMap.put(t,n)),n}if(arguments[0]instanceof on){var e=arguments[0],n=this.nodeMap.get(e.getCoordinate());return null===n?(this.nodeMap.put(e.getCoordinate(),e),e):(n.mergeLabel(e),n)}},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 E,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===N.BOUNDARY&&e.add(i)}return e},add:function(t){var e=t.getCoordinate();this.addNode(e).add(t)},interfaces_:function(){return[]},getClass:function(){return sn}}),Zo(an.prototype,{compareDirection:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:Qt.computeOrientation(t._p0,t._p1,this._p1)},getDy:function(){return this._dy},getCoordinate:function(){return this._p0},setNode:function(t){this._node=t},print:function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),r=n.substring(i+1);t.print(" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},compareTo:function(t){var e=t;return this.compareDirection(e)},getDirectedCoordinate:function(){return this._p1},getDx:function(){return this._dx},getLabel:function(){return this._label},getEdge:function(){return this._edge},getQuadrant:function(){return this._quadrant},getNode:function(){return this._node},toString:function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},computeLabel:function(t){},init:function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=ke.quadrant(this._dx,this._dy),f.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},interfaces_:function(){return[s]},getClass:function(){return an}}),Ko(un,an),Zo(un.prototype,{getNextMin:function(){return this._nextMin},getDepth:function(t){return this._depth[t]},setVisited:function(t){this._isVisited=t},computeDirectedLabel:function(){this._label=new $e(this._edge.getLabel()),this._isForward||this._label.flip()},getNext:function(){return this._next},setDepth:function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Ve("assigned depths do not match",this.getCoordinate());this._depth[t]=e},isInteriorAreaEdge:function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ke.LEFT)===N.INTERIOR&&this._label.getLocation(e,Ke.RIGHT)===N.INTERIOR||(t=!1);return t},setNextMin:function(t){this._nextMin=t},print:function(t){an.prototype.print.call(this,t),t.print(" "+this._depth[Ke.LEFT]+"/"+this._depth[Ke.RIGHT]),t.print(" ("+this.getDepthDelta()+")"),this._isInResult&&t.print(" inResult")},setMinEdgeRing:function(t){this._minEdgeRing=t},isLineEdge:function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,N.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,N.EXTERIOR);return t&&e&&n},setEdgeRing:function(t){this._edgeRing=t},getMinEdgeRing:function(){return this._minEdgeRing},getDepthDelta:function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},setInResult:function(t){this._isInResult=t},getSym:function(){return this._sym},isForward:function(){return this._isForward},getEdge:function(){return this._edge},printEdge:function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},setSym:function(t){this._sym=t},setVisitedEdge:function(t){this.setVisited(t),this._sym.setVisited(t)},setEdgeDepths:function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var i=1;t===Ke.LEFT&&(i=-1);var r=Ke.opposite(t),o=e+n*i;this.setDepth(t,e),this.setDepth(r,o)},getEdgeRing:function(){return this._edgeRing},isInResult:function(){return this._isInResult},setNext:function(t){this._next=t},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return un}}),un.depthFactor=function(t,e){return t===N.EXTERIOR&&e===N.INTERIOR?1:t===N.INTERIOR&&e===N.EXTERIOR?-1:0},Zo(ln.prototype,{createNode:function(t){return new on(t,null)},interfaces_:function(){return[]},getClass:function(){return ln}}),Zo(cn.prototype,{printEdges:function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},find:function(t){return this._nodes.find(t)},addNode:function(){if(arguments[0]instanceof on){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof g){var e=arguments[0];return this._nodes.addNode(e)}},getNodeIterator:function(){return this._nodes.iterator()},linkResultDirectedEdges:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},debugPrintln:function(t){A.out.println(t)},isBoundaryNode:function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var i=n.getLabel();return null!==i&&i.getLocation(t)===N.BOUNDARY},linkAllDirectedEdges:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},matchInSameDirection:function(t,e,n,i){return!!t.equals(n)&&(Qt.computeOrientation(t,e,i)===Qt.COLLINEAR&&ke.quadrant(t,e)===ke.quadrant(n,i))},getEdgeEnds:function(){return this._edgeEndList},debugPrint:function(t){A.out.print(t)},getEdgeIterator:function(){return this._edges.iterator()},findEdgeInSameDirection:function(t,e){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),r=i.getCoordinates();if(this.matchInSameDirection(t,e,r[0],r[1]))return i;if(this.matchInSameDirection(t,e,r[r.length-1],r[r.length-2]))return i}return null},insertEdge:function(t){this._edges.add(t)},findEdgeEnd:function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},addEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var i=new un(n,!0),r=new un(n,!1);i.setSym(r),r.setSym(i),this.add(i),this.add(r)}},add:function(t){this._nodes.add(t),this._edgeEndList.add(t)},getNodes:function(){return this._nodes.values()},findEdge:function(t,e){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),r=i.getCoordinates();if(t.equals(r[0])&&e.equals(r[1]))return i}return null},interfaces_:function(){return[]},getClass:function(){return cn}}),cn.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()},Zo(hn.prototype,{sortShellsAndHoles:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()?n.add(r):e.add(r)}},computePolygons:function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next().toPolygon(this._geometryFactory);e.add(i)}return e},placeFreeHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(null===i.getShell()){var r=this.findEdgeRingContaining(i,t);if(null===r)throw new Ve("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(r)}}},buildMinimalEdgeRings:function(t,e,n){for(var i=new E,r=t.iterator();r.hasNext();){var o=r.next();if(o.getMaxNodeDegree()>2){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 E,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new nn(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)&&Qt.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];cn.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new E,o=this.buildMinimalEdgeRings(i,this._shellList,r);this.sortShellsAndHoles(o,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},interfaces_:function(){return[]},getClass:function(){return hn}}),Zo(fn.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()||!Xn.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(Xn.isResultOfOp(i,e)&&e===Xn.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return fn}}),Zo(gn.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===Xn.INTERSECTION))){var i=n.getLabel();Xn.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},interfaces_:function(){return[]},getClass:function(){return gn}}),Zo(dn.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return dn}}),Zo(pn.prototype,{locate:function(t){return pn.locate(t,this._geom)},interfaces_:function(){return[dn]},getClass:function(){return pn}}),pn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Qt.isPointInRing(t,e.getCoordinates())},pn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!pn.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var r=e.getInteriorRingN(i);if(pn.isPointInRing(t,r))return!1}return!0},pn.containsPoint=function(t,e){if(e instanceof Nt)return pn.containsPointInPolygon(t,e);if(e instanceof ht)for(var n=new pe(e);n.hasNext();){var i=n.next();if(i!==e&&pn.containsPoint(t,i))return!0}return!1},pn.locate=function(t,e){return e.isEmpty()?N.EXTERIOR:pn.containsPoint(t,e)?N.INTERIOR:N.EXTERIOR},Zo(_n.prototype,{getNextCW:function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},propagateSideLabels:function(t){for(var e=N.NONE,n=this.iterator();n.hasNext();)(o=(r=n.next()).getLabel()).isArea(t)&&o.getLocation(t,Ke.LEFT)!==N.NONE&&(e=o.getLocation(t,Ke.LEFT));if(e===N.NONE)return null;for(var i=e,n=this.iterator();n.hasNext();){var r=n.next(),o=r.getLabel();if(o.getLocation(t,Ke.ON)===N.NONE&&o.setLocation(t,Ke.ON,i),o.isArea(t)){var s=o.getLocation(t,Ke.LEFT),a=o.getLocation(t,Ke.RIGHT);if(a!==N.NONE){if(a!==i)throw new Ve("side location conflict",r.getCoordinate());s===N.NONE&&f.shouldNeverReachHere("found single null side (at "+r.getCoordinate()+")"),i=s}else f.isTrue(o.getLocation(t,Ke.LEFT)===N.NONE,"found single null side"),o.setLocation(t,Ke.RIGHT,i),o.setLocation(t,Ke.LEFT,i)}}},getCoordinate:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},print:function(t){A.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},isAreaLabelsConsistent:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},checkAreaLabelsConsistent:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel().getLocation(t,Ke.LEFT);f.isTrue(i!==N.NONE,"Found unlabelled area edge");for(var r=i,o=this.iterator();o.hasNext();){var s=o.next().getLabel();f.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Ke.LEFT),u=s.getLocation(t,Ke.RIGHT);if(a===u)return!1;if(u!==r)return!1;r=a}return!0},findIndex:function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},iterator:function(){return this.getEdges().iterator()},getEdges:function(){return null===this._edgeList&&(this._edgeList=new E(this._edgeMap.values())),this._edgeList},getLocation:function(t,e,n){return this._ptInAreaLocation[t]===N.NONE&&(this._ptInAreaLocation[t]=pn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},toString:function(){var t=new L;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},computeEdgeEndLabels:function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},computeLabelling:function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var i=(o=n.next()).getLabel(),r=0;r<2;r++)i.isLine(r)&&i.getLocation(r)===N.BOUNDARY&&(e[r]=!0);for(n=this.iterator();n.hasNext();)for(var o=n.next(),i=o.getLabel(),r=0;r<2;r++)if(i.isAnyNull(r)){var s=N.NONE;if(e[r])s=N.EXTERIOR;else{var a=o.getCoordinate();s=this.getLocation(r,a,t)}i.setAllLocationsIfNull(r,s)}},getDegree:function(){return this._edgeMap.size()},insertEdgeEnd:function(t,e){this._edgeMap.put(t,e),this._edgeList=null},interfaces_:function(){return[]},getClass:function(){return _n}}),Ko(vn,_n),Zo(vn.prototype,{linkResultDirectedEdges:function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,i=0;i<this._resultAreaEdgeList.size();i++){var r=this._resultAreaEdgeList.get(i),o=r.getSym();if(r.getLabel().isArea())switch(null===t&&r.isInResult()&&(t=r),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!r.isInResult())continue;e.setNext(r),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Ve("no outgoing dirEdge found",this.getCoordinate());f.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},insert:function(t){var e=t;this.insertEdgeEnd(e,e)},getRightmostEdge:function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var i=t.get(e-1),r=n.getQuadrant(),o=i.getQuadrant();return ke.isNorthern(r)&&ke.isNorthern(o)?n:ke.isNorthern(r)||ke.isNorthern(o)?0!==n.getDy()?n:0!==i.getDy()?i:(f.shouldNeverReachHere("found two horizontal edges incident on node"),null):i},print:function(t){A.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},getResultAreaEdges:function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new E;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},updateLabelling:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},linkAllDirectedEdges:function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=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(Ke.LEFT)),i=t.getDepth(Ke.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new Ve("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u<s;u++){var l=this._edgeList.get(u);l.getLabel();l.setEdgeDepths(Ke.RIGHT,a),a=l.getDepth(Ke.LEFT)}return a}},mergeSymLabels:function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},linkMinimalDirectedEdges:function(t){for(var e=null,n=null,i=this._SCANNING_FOR_INCOMING,r=this._resultAreaEdgeList.size()-1;r>=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();)(i=e.next()).isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],t=0,e=this.iterator();e.hasNext();){var i=e.next();i.getEdgeRing()===n&&t++}return t}},getLabel:function(){return this._label},findCoveredLineEdges:function(){for(var t=N.NONE,e=this.iterator();e.hasNext();){r=(i=e.next()).getSym();if(!i.isLineEdge()){if(i.isInResult()){t=N.INTERIOR;break}if(r.isInResult()){t=N.EXTERIOR;break}}}if(t===N.NONE)return null;for(var n=t,e=this.iterator();e.hasNext();){var i=e.next(),r=i.getSym();i.isLineEdge()?i.getEdge().setCovered(n===N.INTERIOR):(i.isInResult()&&(n=N.EXTERIOR),r.isInResult()&&(n=N.INTERIOR))}},computeLabelling:function(t){_n.prototype.computeLabelling.call(this,t),this._label=new $e(N.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),i=0;i<2;i++){var r=n.getLocation(i);r!==N.INTERIOR&&r!==N.BOUNDARY||this._label.setLocation(i,N.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return vn}}),Ko(mn,ln),Zo(mn.prototype,{createNode:function(t){return new on(t,new vn)},interfaces_:function(){return[]},getClass:function(){return mn}}),Zo(yn.prototype,{computeIntersections:function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},interfaces_:function(){return[]},getClass:function(){return yn}}),Zo(xn.prototype,{isDelete:function(){return this._eventType===xn.DELETE},setDeleteEventIndex:function(t){this._deleteEventIndex=t},getObject:function(){return this._obj},compareTo:function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},getInsertEvent:function(){return this._insertEvent},isInsert:function(){return this._eventType===xn.INSERT},isSameLabel:function(t){return null!==this._label&&this._label===t._label},getDeleteEventIndex:function(){return this._deleteEventIndex},interfaces_:function(){return[s]},getClass:function(){return xn}}),xn.INSERT=1,xn.DELETE=2,Zo(En.prototype,{interfaces_:function(){return[]},getClass:function(){return En}}),Zo(wn.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(wn.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().getCoordinate();if(t.isIntersection(i))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 wn}}),wn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},Ko(bn,En),Zo(bn.prototype,{prepareEvents:function(){cs.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},computeIntersections:function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof wn&&$o(arguments[0],m)&&$o(arguments[1],m)){var i=arguments[0],r=arguments[1],o=arguments[2];this.addEdges(i,i),this.addEdges(r,r),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&$o(arguments[0],m)&&arguments[1]instanceof wn){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},addEdge:function(t,e){for(var n=t.getMonotoneChainEdge(),i=n.getStartIndexes(),r=0;r<i.length-1;r++){var o=new yn(n,r),s=new xn(e,n.getMinX(r),o);this.events.add(s),this.events.add(new xn(n.getMaxX(r),s))}},processOverlaps:function(t,e,n,i){for(var r=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(r.computeIntersections(a,i),this.nOverlaps++)}}},addEdges:function(){if(1===arguments.length)for(n=arguments[0].iterator();n.hasNext();){i=n.next();this.addEdge(i,i)}else if(2===arguments.length)for(var t=arguments[0],e=arguments[1],n=t.iterator();n.hasNext();){var i=n.next();this.addEdge(i,e)}},interfaces_:function(){return[]},getClass:function(){return bn}}),Zo(In.prototype,{getMin:function(){return this._min},intersects:function(t,e){return!(this._min>e||this._max<t)},getMax:function(){return this._max},toString:function(){return Ht.toLineString(new g(this._min,0),new g(this._max,0))},interfaces_:function(){return[]},getClass:function(){return In}}),Zo(Cn.prototype,{compare:function(t,e){var n=t,i=e,r=(n._min+n._max)/2,o=(i._min+i._max)/2;return r<o?-1:r>o?1:0},interfaces_:function(){return[u]},getClass:function(){return Cn}}),In.NodeComparator=Cn,Ko(Nn,In),Zo(Nn.prototype,{query:function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},interfaces_:function(){return[]},getClass:function(){return Nn}}),Ko(Sn,In),Zo(Sn.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){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},interfaces_:function(){return[]},getClass:function(){return Sn}}),Zo(Ln.prototype,{buildTree:function(){cs.sort(this._leaves,new IntervalRTreeNode.NodeComparator);for(var t=this._leaves,e=null,n=new E;;){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 Nn(t,e,n))},query:function(t,e,n){this.init(),this._root.query(t,e,n)},buildRoot:function(){if(null!==this._root)return null;this._root=this.buildTree()},printNode:function(t){A.out.println(Ht.toLineString(new g(t._min,this._level),new g(t._max,this._level)))},init:function(){if(null!==this._root)return null;this.buildRoot()},buildLevel:function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(i);else{var r=new Sn(t.get(n),t.get(n+1));e.add(r)}}},interfaces_:function(){return[]},getClass:function(){return Ln}}),Zo(Mn.prototype,{filter:function(t){if(this._isForcedToLineString&&t instanceof Lt){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof wt&&this._lines.add(t)},setForceToLineString:function(t){this._isForcedToLineString=t},interfaces_:function(){return[G]},getClass:function(){return Mn}}),Mn.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Mn.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Mn.getLines(e,n))}},Mn.getLines=function(){if(1===arguments.length){var t=arguments[0];return Mn.getLines(t,!1)}if(2===arguments.length){if($o(arguments[0],_)&&$o(arguments[1],_)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){f=i.next();Mn.getLines(f,n)}return n}if(arguments[0]instanceof q&&"boolean"==typeof arguments[1]){var r=arguments[0],o=arguments[1],s=new E;return r.apply(new Mn(s,o)),s}if(arguments[0]instanceof q&&$o(arguments[1],_)){var a=arguments[0],u=arguments[1];return a instanceof wt?u.add(a):a.apply(new Mn(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&$o(arguments[0],_)&&$o(arguments[1],_)){for(var l=arguments[0],c=arguments[1],h=arguments[2],i=l.iterator();i.hasNext();){var f=i.next();Mn.getLines(f,c,h)}return c}if("boolean"==typeof arguments[2]&&arguments[0]instanceof q&&$o(arguments[1],_)){var g=arguments[0],d=arguments[1],p=arguments[2];return g.apply(new Mn(d,p)),d}}},Zo(Pn.prototype,{visitItem:function(t){this._items.add(t)},getItems:function(){return this._items},interfaces_:function(){return[be]},getClass:function(){return Pn}}),Zo(Rn.prototype,{locate:function(t){var e=new Kt(t),n=new On(e);return this._index.query(t.y,t.y,n),e.getLocation()},interfaces_:function(){return[dn]},getClass:function(){return Rn}}),Zo(On.prototype,{visitItem:function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},interfaces_:function(){return[be]},getClass:function(){return On}}),Zo(Tn.prototype,{init:function(t){for(var e=Mn.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},addLine:function(t){for(var e=1;e<t.length;e++){var n=new $t(t[e-1],t[e]),i=Math.min(n.p0.y,n.p1.y),r=Math.max(n.p0.y,n.p1.y);this._index.insert(i,r,n)}},query:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Pn;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._index.query(i,r,o)}},interfaces_:function(){return[]},getClass:function(){return Tn}}),Rn.SegmentVisitor=On,Rn.IntervalIndexedGeometry=Tn,Zo(An.prototype,{getSegmentIndex:function(){return this.segmentIndex},getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},compareTo:function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},isEndPoint:function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},toString:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},getDistance:function(){return this.dist},compare:function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},interfaces_:function(){return[s]},getClass:function(){return An}}),Zo(Dn.prototype,{print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},iterator:function(){return this._nodeMap.values().iterator()},addSplitEdges:function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},addEndpoints:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},createSplitEdge:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new g(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 $e(this.edge._label))},add:function(t,e,n){var i=new An(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 Dn}}),Zo(Fn.prototype,{getChainStartIndices:function(t){var e=0,n=new E;n.add(new M(e));do{var i=this.findChainEnd(t,e);n.add(new M(i)),e=i}while(e<t.length-1);return Fn.toIntArray(n)},findChainEnd:function(t,e){for(var n=ke.quadrant(t[e],t[e+1]),i=e+1;i<t.length&&ke.quadrant(t[i-1],t[i])===n;)i++;return i-1},interfaces_:function(){return[]},getClass:function(){return Fn}}),Fn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},Zo(Gn.prototype,{getCoordinates:function(){return this.pts},getMaxX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},getMinX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},computeIntersectsForChain:function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(6===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[r],h=this.pts[o],f=s.pts[a],g=s.pts[u];if(o-r==1&&u-a==1)return l.addIntersections(this.e,r,s.e,a),null;if(this.env1.init(c,h),this.env2.init(f,g),!this.env1.intersects(this.env2))return null;var d=Math.trunc((r+o)/2),p=Math.trunc((a+u)/2);r<d&&(a<p&&this.computeIntersectsForChain(r,d,s,a,p,l),p<u&&this.computeIntersectsForChain(r,d,s,p,u,l)),d<o&&(a<p&&this.computeIntersectsForChain(d,o,s,a,p,l),p<u&&this.computeIntersectsForChain(d,o,s,p,u,l))}},getStartIndexes:function(){return this.startIndex},computeIntersects:function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var i=0;i<t.startIndex.length-1;i++)this.computeIntersectsForChain(n,t,i,e)},interfaces_:function(){return[]},getClass:function(){return Gn}}),Zo(qn.prototype,{getDepth:function(t,e){return this._depth[t][e]},setDepth:function(t,e,n){this._depth[t][e]=n},isNull:function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==qn.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===qn.NULL_VALUE}if(2===arguments.length){var i=arguments[0],r=arguments[1];return this._depth[i][r]===qn.NULL_VALUE}},normalize:function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var i=0;this._depth[t][n]>e&&(i=1),this._depth[t][n]=i}}},getDelta:function(t){return this._depth[t][Ke.RIGHT]-this._depth[t][Ke.LEFT]},getLocation:function(t,e){return this._depth[t][e]<=0?N.EXTERIOR:N.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!==N.EXTERIOR&&i!==N.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=qn.depthAtLocation(i):this._depth[e][n]+=qn.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1];arguments[2]===N.INTERIOR&&this._depth[r][o]++}},interfaces_:function(){return[]},getClass:function(){return qn}}),qn.depthAtLocation=function(t){return t===N.EXTERIOR?0:t===N.INTERIOR?1:qn.NULL_VALUE},qn.NULL_VALUE=-1,Ko(kn,rn),Zo(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,$e.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;o<this.pts.length;o++)if(this.pts[o].equals2D(e.pts[o])||(n=!1),this.pts[o].equals2D(e.pts[--r])||(i=!1),!n&&!i)return!1;return!0},getCoordinate:function(){if(0===arguments.length)return this.pts.length>0?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;e<this.pts.length;e++)e>0&&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 Gn(this)),this._mce},getEnvelope:function(){if(null===this._env){this._env=new b;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},addIntersection:function(t,e,n,i){var r=new g(t.getIntersection(i)),o=e,s=t.getEdgeDistance(n,i),a=o+1;if(a<this.pts.length){var u=this.pts[a];r.equals2D(u)&&(o=a,s=0)}this.eiList.add(r,o,s)},toString:function(){var t=new L;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&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<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},setDepthDelta:function(t){this._depthDelta=t},getEdgeIntersectionList:function(){return this.eiList},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[]},getClass:function(){return kn}}),kn.updateIM=function(){if(2!==arguments.length)return rn.prototype.updateIM.apply(this,arguments);var t=arguments[0],e=arguments[1];e.setAtLeastIfValid(t.getLocation(0,Ke.ON),t.getLocation(1,Ke.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,Ke.LEFT),t.getLocation(1,Ke.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,Ke.RIGHT),t.getLocation(1,Ke.RIGHT),2))},Ko(Bn,cn),Zo(Bn.prototype,{insertBoundaryPoint:function(t,e){var n=this._nodes.addNode(e).getLabel(),i=1;N.NONE;n.getLocation(t,Ke.ON)===N.BOUNDARY&&i++;var r=Bn.determineBoundary(this._boundaryNodeRule,i);n.setLocation(t,r)},computeSelfNodes:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new wn(n,!0,!1);o.setIsDoneIfProperInt(r);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof Lt||this._parentGeom instanceof Nt||this._parentGeom instanceof Mt,u=i||!a;return s.computeIntersections(this._edges,o,u),this.addSelfIntersectionNodes(this._argIndex),o}},computeSplitEdges:function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},computeEdgeIntersections:function(t,e,n){var i=new wn(e,n,!0);return i.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,i),i},getGeometry:function(){return this._parentGeom},getBoundaryNodeRule:function(){return this._boundaryNodeRule},hasTooFewPoints:function(){return this._hasTooFewPoints},addPoint:function(){if(arguments[0]instanceof It){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,N.INTERIOR)}else if(arguments[0]instanceof g){var e=arguments[0];this.insertPoint(this._argIndex,e,N.INTERIOR)}},addPolygon:function(t){this.addPolygonRing(t.getExteriorRing(),N.EXTERIOR,N.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,N.INTERIOR,N.EXTERIOR)}},addEdge:function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],N.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],N.BOUNDARY)},addLineString:function(t){var e=V.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new kn(e,new $e(this._argIndex,N.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),f.isTrue(e.length>=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){if(this.isBoundaryNode(t,e))return null;n===N.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},addPolygonRing:function(t,e,n){if(t.isEmpty())return null;var i=V.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var r=e,o=n;Qt.isCCW(i)&&(r=n,o=e);var s=new kn(i,new $e(this._argIndex,N.BOUNDARY,r,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,i[0],N.BOUNDARY)},insertPoint:function(t,e,n){var i=this._nodes.addNode(e),r=i.getLabel();null===r?i._label=new $e(t,n):r.setLocation(t,n)},createEdgeSetIntersector:function(){return new bn},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 cn.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof Mt&&(this._useBoundaryDeterminationRule=!1),t instanceof Nt)this.addPolygon(t);else if(t instanceof wt)this.addLineString(t);else if(t instanceof It)this.addPoint(t);else if(t instanceof St)this.addCollection(t);else if(t instanceof ft)this.addCollection(t);else if(t instanceof Mt)this.addCollection(t);else{if(!(t instanceof ht))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},addCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},locate:function(t){return $o(this._parentGeom,Ct)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new Rn(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 cn.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return Bn}}),Bn.determineBoundary=function(t,e){return t.isInBoundary(e)?N.BOUNDARY:N.INTERIOR},Zo(jn.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 jn}}),Zo(zn.prototype,{compareTo:function(t){var e=t;return zn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},interfaces_:function(){return[s]},getClass:function(){return zn}}),zn.orientation=function(t){return 1===V.increasingDirection(t)},zn.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;var h=(u+=r)===s,f=(l+=o)===a;if(h&&!f)return-1;if(!h&&f)return 1;if(h&&f)return 0}},Zo(Yn.prototype,{print:function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r<i.length;r++)r>0&&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;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},iterator:function(){return this._edges.iterator()},getEdges:function(){return this._edges},get:function(t){return this._edges.get(t)},findEqualEdge:function(t){var e=new zn(t.getCoordinates());return this._ocaMap.get(e)},add:function(t){this._edges.add(t);var e=new zn(t.getCoordinates());this._ocaMap.put(e,t)},interfaces_:function(){return[]},getClass:function(){return Yn}}),Ko(Xn,jn),Zo(Xn.prototype,{insertUniqueEdge:function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new $e(t.getLabel())).flip();var r=e.getDepth();r.isNull()&&r.add(n),r.add(i),n.merge(i)}else this._edgeList.add(t)},getGraph:function(){return this._graph},cancelDuplicateResultEdges:function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},isCoveredByLA:function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},computeGeometry:function(t,e,n,i){var r=new E;return r.addAll(t),r.addAll(e),r.addAll(n),r.isEmpty()?Xn.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(r)},mergeSymLabels:function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},isCovered:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(this._ptLocator.locate(t,i)!==N.EXTERIOR)return!0}return!1},replaceCollapsedEdges:function(){for(var t=new E,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},updateNodeLabelling:function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},getResultGeometry:function(t){return this.computeOverlay(t),this._resultGeom},insertUniqueEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},computeOverlay:function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new E;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Je.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new hn(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var i=new fn(this,this._geomFact,this._ptLocator);this._resultLineList=i.build(t);var r=new gn(this,this._geomFact,this._ptLocator);this._resultPointList=r.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},labelIncompleteNode:function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},copyPoints:function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},findResultAreaEdges:function(t){for(var e=this._graph.getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getLabel();i.isArea()&&!n.isInteriorAreaEdge()&&Xn.isResultOfOp(i.getLocation(0,Ke.RIGHT),i.getLocation(1,Ke.RIGHT),t)&&n.setInResult(!0)}},computeLabelsFromDepths:function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),i=e.getDepth();if(!i.isNull()){i.normalize();for(var r=0;r<2;r++)n.isNull(r)||!n.isArea()||i.isNull(r)||(0===i.getDelta(r)?n.toLine(r):(f.isTrue(!i.isNull(r,Ke.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(r,Ke.LEFT,i.getLocation(r,Ke.LEFT)),f.isTrue(!i.isNull(r,Ke.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(r,Ke.RIGHT,i.getLocation(r,Ke.RIGHT))))}}},computeLabelling:function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},labelIncompleteNodes:function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},isCoveredByA:function(t){return!!this.isCovered(t,this._resultPolyList)},interfaces_:function(){return[]},getClass:function(){return Xn}}),Xn.overlayOp=function(t,e,n){return new Xn(t,e).getResultGeometry(n)},Xn.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Xn.createEmptyResult(Xn.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Ze.map(t,{interfaces_:function(){return[MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Un.overlayOp(t,e,Xn.INTERSECTION)},Xn.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Xn.createEmptyResult(Xn.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Un.overlayOp(t,e,Xn.SYMDIFFERENCE)},Xn.resultDimension=function(t,e,n){var i=e.getDimension(),r=n.getDimension(),o=-1;switch(t){case Xn.INTERSECTION:o=Math.min(i,r);break;case Xn.UNION:o=Math.max(i,r);break;case Xn.DIFFERENCE:o=i;break;case Xn.SYMDIFFERENCE:o=Math.max(i,r)}return o},Xn.createEmptyResult=function(t,e,n,i){var r=null;switch(Xn.resultDimension(t,e,n)){case-1:r=i.createGeometryCollection(new Array(0).fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon()}return r},Xn.difference=function(t,e){return t.isEmpty()?Xn.createEmptyResult(Xn.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Un.overlayOp(t,e,Xn.DIFFERENCE))},Xn.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),i=t.getLocation(1);return Xn.isResultOfOp(n,i,e)}if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];switch(r===N.BOUNDARY&&(r=N.INTERIOR),o===N.BOUNDARY&&(o=N.INTERIOR),s){case Xn.INTERSECTION:return r===N.INTERIOR&&o===N.INTERIOR;case Xn.UNION:return r===N.INTERIOR||o===N.INTERIOR;case Xn.DIFFERENCE:return r===N.INTERIOR&&o!==N.INTERIOR;case Xn.SYMDIFFERENCE:return r===N.INTERIOR&&o!==N.INTERIOR||r!==N.INTERIOR&&o===N.INTERIOR}return!1}},Xn.INTERSECTION=1,Xn.UNION=2,Xn.DIFFERENCE=3,Xn.SYMDIFFERENCE=4,Zo(Vn.prototype,{selfSnap:function(t){return new le(t).snapTo(t,this._snapTolerance)},removeCommonBits:function(t){this._cbr=new fe,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},prepareResult:function(t){return this._cbr.addCommonBits(t),t},getResultGeometry:function(t){var e=this.snap(this._geom),n=Xn.overlayOp(e[0],e[1],t);return this.prepareResult(n)},checkValid:function(t){t.isValid()||A.out.println("Snapped geometry is invalid")},computeSnapTolerance:function(){this._snapTolerance=le.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},snap:function(t){var e=this.removeCommonBits(t);return le.snap(e[0],e[1],this._snapTolerance)},interfaces_:function(){return[]},getClass:function(){return Vn}}),Vn.overlayOp=function(t,e,n){return new Vn(t,e).getResultGeometry(n)},Vn.union=function(t,e){return Vn.overlayOp(t,e,Xn.UNION)},Vn.intersection=function(t,e){return Vn.overlayOp(t,e,Xn.INTERSECTION)},Vn.symDifference=function(t,e){return Vn.overlayOp(t,e,Xn.SYMDIFFERENCE)},Vn.difference=function(t,e){return Vn.overlayOp(t,e,Xn.DIFFERENCE)},Zo(Un.prototype,{getResultGeometry:function(t){var e=null,n=!1,i=null;try{e=Xn.overlayOp(this._geom[0],this._geom[1],t);n=!0}catch(t){if(!(t instanceof c))throw t;i=t}if(!n)try{e=Vn.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof c?i:t}return e},interfaces_:function(){return[]},getClass:function(){return Un}}),Un.overlayOp=function(t,e,n){return new Un(t,e).getResultGeometry(n)},Un.union=function(t,e){return Un.overlayOp(t,e,Xn.UNION)},Un.intersection=function(t,e){return Un.overlayOp(t,e,Xn.INTERSECTION)},Un.symDifference=function(t,e){return Un.overlayOp(t,e,Xn.SYMDIFFERENCE)},Un.difference=function(t,e){return Un.overlayOp(t,e,Xn.DIFFERENCE)},Zo(Hn.prototype,{addPolygon:function(t){if(t.isEmpty())return null;var e=null,n=0,i=this.horizontalBisector(t);if(0===i.getLength())n=0,e=i.getCoordinate();else{var r=Un.overlayOp(i,t,Xn.INTERSECTION),o=this.widestGeometry(r);n=o.getEnvelopeInternal().getWidth(),e=Hn.centre(o.getEnvelopeInternal())}(null===this._interiorPoint||n>this._maxWidth)&&(this._interiorPoint=e,this._maxWidth=n)},getInteriorPoint:function(){return this._interiorPoint},widestGeometry:function(){if(arguments[0]instanceof ht){var t=arguments[0];if(t.isEmpty())return t;for(var e=t.getGeometryN(0),n=1;n<t.getNumGeometries();n++)t.getGeometryN(n).getEnvelopeInternal().getWidth()>e.getEnvelopeInternal().getWidth()&&(e=t.getGeometryN(n));return e}if(arguments[0]instanceof q){var i=arguments[0];return i instanceof ht?this.widestGeometry(i):i}},horizontalBisector:function(t){var e=t.getEnvelopeInternal(),n=Wn.getBisectorY(t);return this._factory.createLineString([new g(e.getMinX(),n),new g(e.getMaxX(),n)])},add:function(t){if(t instanceof Nt)this.addPolygon(t);else if(t instanceof ht)for(var e=t,n=0;n<e.getNumGeometries();n++)this.add(e.getGeometryN(n))},interfaces_:function(){return[]},getClass:function(){return Hn}}),Hn.centre=function(t){return new g(Hn.avg(t.getMinX(),t.getMaxX()),Hn.avg(t.getMinY(),t.getMaxY()))},Hn.avg=function(t,e){return(t+e)/2},Zo(Wn.prototype,{updateInterval:function(t){t<=this._centreY?t>this._loY&&(this._loY=t):t>this._centreY&&t<this._hiY&&(this._hiY=t)},getBisectorY:function(){this.process(this._poly.getExteriorRing());for(var t=0;t<this._poly.getNumInteriorRing();t++)this.process(this._poly.getInteriorRingN(t));return Hn.avg(this._hiY,this._loY)},process:function(t){for(var e=t.getCoordinateSequence(),n=0;n<e.size();n++){var i=e.getY(n);this.updateInterval(i)}},interfaces_:function(){return[]},getClass:function(){return Wn}}),Wn.getBisectorY=function(t){return new Wn(t).getBisectorY()},Hn.SafeBisectorFinder=Wn,Zo(Jn.prototype,{addEndpoints:function(){if(arguments[0]instanceof q){var t=arguments[0];if(t instanceof wt)this.addEndpoints(t.getCoordinates());else if(t instanceof ht)for(var e=t,n=0;n<e.getNumGeometries();n++)this.addEndpoints(e.getGeometryN(n))}else if(arguments[0]instanceof Array){var i=arguments[0];this.add(i[0]),this.add(i[i.length-1])}},getInteriorPoint:function(){return this._interiorPoint},addInterior:function(){if(arguments[0]instanceof q){var t=arguments[0];if(t instanceof wt)this.addInterior(t.getCoordinates());else if(t instanceof ht)for(var e=t,n=0;n<e.getNumGeometries();n++)this.addInterior(e.getGeometryN(n))}else if(arguments[0]instanceof Array)for(var i=arguments[0],n=1;n<i.length-1;n++)this.add(i[n])},add:function(t){var e=t.distance(this._centroid);e<this._minDistance&&(this._interiorPoint=new g(t),this._minDistance=e)},interfaces_:function(){return[]},getClass:function(){return Jn}}),Zo(Zn.prototype,{getInteriorPoint:function(){return this._interiorPoint},add:function(){if(arguments[0]instanceof q){var t=arguments[0];if(t instanceof It)this.add(t.getCoordinate());else if(t instanceof ht)for(var e=t,n=0;n<e.getNumGeometries();n++)this.add(e.getGeometryN(n))}else if(arguments[0]instanceof g){var i=arguments[0],r=i.distance(this._centroid);r<this._minDistance&&(this._interiorPoint=new g(i),this._minDistance=r)}},interfaces_:function(){return[]},getClass:function(){return Zn}}),Zo(Kn.prototype,{select:function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},interfaces_:function(){return[]},getClass:function(){return Kn}}),Zo(Qn.prototype,{hasChildren:function(){for(var t=0;t<2;t++)if(null!==this._subnode[t])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(t){t.addAll(this._items);for(var e=0;e<2;e++)null!==this._subnode[e]&&this._subnode[e].addAllItems(t);return t},size:function(){for(var t=0,e=0;e<2;e++)null!==this._subnode[e]&&(t+=this._subnode[e].size());return t+this._items.size()},addAllItemsFromOverlapping:function(t,e){if(null!==t&&!this.isSearchMatch(t))return null;e.addAll(this._items),null!==this._subnode[0]&&this._subnode[0].addAllItemsFromOverlapping(t,e),null!==this._subnode[1]&&this._subnode[1].addAllItemsFromOverlapping(t,e)},hasItems:function(){return!this._items.isEmpty()},remove:function(t,e){if(!this.isSearchMatch(t))return!1;for(var n=!1,i=0;i<2;i++)if(null!==this._subnode[i]&&(n=this._subnode[i].remove(t,e))){this._subnode[i].isPrunable()&&(this._subnode[i]=null);break}return n||(n=this._items.remove(e))},getItems:function(){return this._items},depth:function(){for(var t=0,e=0;e<2;e++)if(null!==this._subnode[e]){var n=this._subnode[e].depth();n>t&&(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 Qn}}),Qn.getSubnodeIndex=function(t,e){var n=-1;return t.min>=e&&(n=1),t.max<=e&&(n=0),n},Zo($n.prototype,{expandToInclude:function(t){t.max>this.max&&(this.max=t.max),t.min<this.min&&(this.min=t.min)},getWidth:function(){return this.max-this.min},overlaps:function(){if(1===arguments.length){var t=arguments[0];return this.overlaps(t.min,t.max)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!(this.min>n||this.max<e)}},getMin:function(){return this.min},toString:function(){return"["+this.min+", "+this.max+"]"},contains:function(){if(1===arguments.length){if(arguments[0]instanceof $n){var t=arguments[0];return this.contains(t.min,t.max)}if("number"==typeof arguments[0]){var e=arguments[0];return e>=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 $n}}),ti.exponent=function(t){return ei(64,t)-1023},ti.powerOf2=function(t){return Math.pow(2,t)},Zo(ni.prototype,{getInterval:function(){return this._interval},getLevel:function(){return this._level},computeKey:function(t){for(this._level=ni.computeLevel(t),this._interval=new $n,this.computeInterval(this._level,t);!this._interval.contains(t);)this._level+=1,this.computeInterval(this._level,t)},computeInterval:function(t,e){var n=ti.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 ni}}),ni.computeLevel=function(t){var e=t.getWidth();return ti.exponent(e)+1},Ko(ii,Qn),Zo(ii.prototype,{getInterval:function(){return this._interval},find:function(t){var e=Qn.getSubnodeIndex(t,this._centre);return-1===e?this:null!==this._subnode[e]?this._subnode[e].find(t):this},insert:function(t){f.isTrue(null===this._interval||this._interval.contains(t._interval));var e=Qn.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=Qn.getSubnodeIndex(t,this._centre);return-1!==e?this.getSubnode(e).getNode(t):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 ii(new $n(e,n),this._level-1)},interfaces_:function(){return[]},getClass:function(){return ii}}),ii.createNode=function(t){var e=new ni(t);return new ii(e.getInterval(),e.getLevel())},ii.createExpanded=function(t,e){var n=new $n(e);null!==t&&n.expandToInclude(t._interval);var i=ii.createNode(n);return null!==t&&i.insert(t),i},Zo(ri.prototype,{interfaces_:function(){return[]},getClass:function(){return ri}}),ri.isZeroWidth=function(t,e){var n=e-t;if(0===n)return!0;var i=Math.max(Math.abs(t),Math.abs(e));return ti.exponent(n/i)<=ri.MIN_BINARY_EXPONENT},ri.MIN_BINARY_EXPONENT=-50,Ko(oi,Qn),Zo(oi.prototype,{insert:function(t,e){var n=Qn.getSubnodeIndex(t,oi.origin);if(-1===n)return this.add(e),null;var i=this._subnode[n];if(null===i||!i.getInterval().contains(t)){var r=ii.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));(ri.isZeroWidth(e.getMin(),e.getMax())?t.find(e):t.getNode(e)).add(n)},interfaces_:function(){return[]},getClass:function(){return oi}}),oi.origin=0,Zo(si.prototype,{size:function(){return null!==this._root?this._root.size():0},insert:function(t,e){this.collectStats(t);var n=si.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 $n(t,t))}if(arguments[0]instanceof $n){var e=arguments[0],n=new E;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 E;return this._root.addAllItems(t),t.iterator()},remove:function(t,e){var n=si.ensureExtent(t,this._minExtent);return this._root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e<this._minExtent&&e>0&&(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 si}}),si.ensureExtent=function(t,e){var n=t.getMin(),i=t.getMax();return n!==i?t:(n===i&&(i=(n-=e/2)+e/2),new $n(n,i))},Zo(ai.prototype,{isInside:function(t){},interfaces_:function(){return[]},getClass:function(){return ai}}),Zo(ui.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)&&0<Zt.signOfDet2x2(n,i,r,o)/(o-i)&&this._crossings++},buildIndex:function(){this._tree=new si;for(var t=V.removeRepeatedPoints(this._ring.getCoordinates()),e=Be.getChains(t),n=0;n<e.size();n++){var i=e.get(n),r=i.getEnvelope();this._interval.min=r.getMinY(),this._interval.max=r.getMaxY(),this._tree.insert(this._interval,i)}},testMonotoneChain:function(t,e,n){n.select(t,e)},isInside:function(t){this._crossings=0;var e=new b(o.NEGATIVE_INFINITY,o.POSITIVE_INFINITY,t.y,t.y);this._interval.min=t.y,this._interval.max=t.y;for(var n=this._tree.query(this._interval),i=new li(this,t),r=n.iterator();r.hasNext();){var s=r.next();this.testMonotoneChain(e,i,s)}return this._crossings%2==1},interfaces_:function(){return[ai]},getClass:function(){return ui}}),Ko(li,Kn),Zo(li.prototype,{select:function(){if(1!==arguments.length)return Kn.prototype.select.apply(this,arguments);var t=arguments[0];this.mcp.testLineSegment(this.p,t)},interfaces_:function(){return[]},getClass:function(){return li}}),ui.MCSelecter=li,Zo(ci.prototype,{interfaces_:function(){return[]},getClass:function(){return ci}}),ci.toDegrees=function(t){return 180*t/Math.PI},ci.normalize=function(t){for(;t>Math.PI;)t-=ci.PI_TIMES_2;for(;t<=-Math.PI;)t+=ci.PI_TIMES_2;return t},ci.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)}},ci.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},ci.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},ci.interiorAngle=function(t,e,n){var i=ci.angle(e,t),r=ci.angle(e,n);return Math.abs(r-i)},ci.normalizePositive=function(t){if(t<0){for(;t<0;)t+=ci.PI_TIMES_2;t>=ci.PI_TIMES_2&&(t=0)}else{for(;t>=ci.PI_TIMES_2;)t-=ci.PI_TIMES_2;t<0&&(t=0)}return t},ci.angleBetween=function(t,e,n){var i=ci.angle(e,t),r=ci.angle(e,n);return ci.diff(i,r)},ci.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},ci.toRadians=function(t){return t*Math.PI/180},ci.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?ci.COUNTERCLOCKWISE:n<0?ci.CLOCKWISE:ci.NONE},ci.angleBetweenOriented=function(t,e,n){var i=ci.angle(e,t),r=ci.angle(e,n)-i;return r<=-Math.PI?r+ci.PI_TIMES_2:r>Math.PI?r-ci.PI_TIMES_2:r},ci.PI_TIMES_2=2*Math.PI,ci.PI_OVER_2=Math.PI/2,ci.PI_OVER_4=Math.PI/4,ci.COUNTERCLOCKWISE=Qt.COUNTERCLOCKWISE,ci.CLOCKWISE=Qt.CLOCKWISE,ci.NONE=Qt.COLLINEAR,Zo(hi.prototype,{area:function(){return hi.area(this.p0,this.p1,this.p2)},signedArea:function(){return hi.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(t){if(null===t)throw new r("Supplied point is null.");return hi.interpolateZ(t,this.p0,this.p1,this.p2)},longestSideLength:function(){return hi.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return hi.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return hi.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return hi.area3D(this.p0,this.p1,this.p2)},centroid:function(){return hi.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return hi.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return hi}}),hi.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)},hi.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},hi.det=function(t,e,n,i){return t*i-e*n},hi.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,g=(l*h-a*f)/c,d=(-u*h+s*f)/c;return e.z+g*(n.z-e.z)+d*(i.z-e.z)},hi.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},hi.isAcute=function(t,e,n){return!!ci.isAcute(t,e,n)&&(!!ci.isAcute(e,n,t)&&!!ci.isAcute(n,t,e))},hi.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*hi.det(o,s,a,u);return new g(i-hi.det(s,o*o+s*s,u,a*a+u*u)/l,r+hi.det(o,o*o+s*s,a,a*a+u*u)/l)},hi.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y;return new D(new D(t.x+n/2,t.y+i/2,1),new D(t.x-i+n/2,t.y+n+i/2,1))},hi.angleBisector=function(t,e,n){var i=e.distance(t),r=i/(i+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new g(t.x+r*o,t.y+r*s)},hi.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},hi.centroid=function(t,e,n){return new g((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)},hi.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o;return new g((i*t.x+r*e.x+o*n.x)/s,(i*t.y+r*e.y+o*n.y)/s)},Zo(fi.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()){e=this._input.getCoordinates();return this._extremalPts=[new g(e[0])],null}var t=this._input.convexHull().getCoordinates(),e=t;if(t[0].equals2D(t[t.length-1])&&(e=new Array(t.length-1).fill(null),V.copyDeep(t,0,e,0,t.length-1)),e.length<=2)return this._extremalPts=V.copyDeep(e),null;for(var n=fi.lowestPoint(e),i=fi.pointWitMinAngleWithX(e,n),r=0;r<e.length;r++){var o=fi.pointWithMinAngleWithSegment(e,n,i);if(ci.isObtuse(n,o,i))return this._extremalPts=[new g(n),new g(i)],null;if(ci.isObtuse(o,n,i))n=o;else{if(!ci.isObtuse(o,i,n))return this._extremalPts=[new g(n),new g(i),new g(o)],null;i=o}}f.shouldNeverReachHere("Logic failure in Minimum Bounding Circle algorithm!")},compute:function(){if(null!==this._extremalPts)return null;this.computeCirclePoints(),this.computeCentre(),null!==this._centre&&(this._radius=this._centre.distance(this._extremalPts[0]))},getFarthestPoints: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[this._extremalPts.length-1];return this._input.getFactory().createLineString([t,e])},getCircle:function(){if(this.compute(),null===this._centre)return this._input.getFactory().createPolygon();var t=this._input.getFactory().createPoint(this._centre);return 0===this._radius?t:t.buffer(this._radius)},getCentre:function(){return this.compute(),this._centre},computeCentre:function(){switch(this._extremalPts.length){case 0:this._centre=null;break;case 1:this._centre=this._extremalPts[0];break;case 2:this._centre=new g((this._extremalPts[0].x+this._extremalPts[1].x)/2,(this._extremalPts[0].y+this._extremalPts[1].y)/2);break;case 3:this._centre=hi.circumcentre(this._extremalPts[0],this._extremalPts[1],this._extremalPts[2])}},interfaces_:function(){return[]},getClass:function(){return fi}}),fi.pointWitMinAngleWithX=function(t,e){for(var n=o.MAX_VALUE,i=null,r=0;r<t.length;r++){var s=t[r];if(s!==e){var a=s.x-e.x,u=s.y-e.y;u<0&&(u=-u);var l=u/Math.sqrt(a*a+u*u);l<n&&(n=l,i=s)}}return i},fi.lowestPoint=function(t){for(var e=t[0],n=1;n<t.length;n++)t[n].y<e.y&&(e=t[n]);return e},fi.pointWithMinAngleWithSegment=function(t,e,n){for(var i=o.MAX_VALUE,r=null,s=0;s<t.length;s++){var a=t[s];if(a!==e&&a!==n){var u=ci.angleBetween(e,a,n);u<i&&(i=u,r=a)}}return r},Zo(gi.prototype,{getWidthCoordinate:function(){return this.computeMinimumDiameter(),this._minWidthPt},getSupportingSegment:function(){return this.computeMinimumDiameter(),this._inputGeom.getFactory().createLineString([this._minBaseSeg.p0,this._minBaseSeg.p1])},getDiameter:function(){if(this.computeMinimumDiameter(),null===this._minWidthPt)return this._inputGeom.getFactory().createLineString(null);var t=this._minBaseSeg.project(this._minWidthPt);return this._inputGeom.getFactory().createLineString([t,this._minWidthPt])},computeWidthConvex:function(t){this._convexHullPts=t instanceof Nt?t.getExteriorRing().getCoordinates():t.getCoordinates(),0===this._convexHullPts.length?(this._minWidth=0,this._minWidthPt=null,this._minBaseSeg=null):1===this._convexHullPts.length?(this._minWidth=0,this._minWidthPt=this._convexHullPts[0],this._minBaseSeg.p0=this._convexHullPts[0],this._minBaseSeg.p1=this._convexHullPts[0]):2===this._convexHullPts.length||3===this._convexHullPts.length?(this._minWidth=0,this._minWidthPt=this._convexHullPts[0],this._minBaseSeg.p0=this._convexHullPts[0],this._minBaseSeg.p1=this._convexHullPts[1]):this.computeConvexRingMinDiameter(this._convexHullPts)},computeConvexRingMinDiameter:function(t){this._minWidth=o.MAX_VALUE;for(var e=1,n=new $t,i=0;i<t.length-1;i++)n.p0=t[i],n.p1=t[i+1],e=this.findMaxPerpDistance(t,n,e)},computeMinimumDiameter:function(){if(null!==this._minWidthPt)return null;if(this._isConvex)this.computeWidthConvex(this._inputGeom);else{var t=new oe(this._inputGeom).getConvexHull();this.computeWidthConvex(t)}},getLength:function(){return this.computeMinimumDiameter(),this._minWidth},findMaxPerpDistance:function(t,e,n){for(var i=e.distancePerpendicular(t[n]),r=i,o=n,s=o;r>=i;)i=r,o=s,s=gi.nextIndex(t,o),r=e.distancePerpendicular(t[s]);return i<this._minWidth&&(this._minPtIndex=o,this._minWidth=i,this._minWidthPt=t[this._minPtIndex],this._minBaseSeg=new $t(e)),o},getMinimumRectangle:function(){if(this.computeMinimumDiameter(),0===this._minWidth)return this._minBaseSeg.p0.equals2D(this._minBaseSeg.p1)?this._inputGeom.getFactory().createPoint(this._minBaseSeg.p0):this._minBaseSeg.toGeometry(this._inputGeom.getFactory());for(var t=this._minBaseSeg.p1.x-this._minBaseSeg.p0.x,e=this._minBaseSeg.p1.y-this._minBaseSeg.p0.y,n=o.MAX_VALUE,i=-o.MAX_VALUE,r=o.MAX_VALUE,s=-o.MAX_VALUE,a=0;a<this._convexHullPts.length;a++){var u=gi.computeC(t,e,this._convexHullPts[a]);u>i&&(i=u),u<n&&(n=u);var l=gi.computeC(-e,t,this._convexHullPts[a]);l>s&&(s=l),l<r&&(r=l)}var c=gi.computeSegmentForLine(-t,-e,s),h=gi.computeSegmentForLine(-t,-e,r),f=gi.computeSegmentForLine(-e,t,i),g=gi.computeSegmentForLine(-e,t,n),d=f.lineIntersection(c),p=g.lineIntersection(c),_=g.lineIntersection(h),v=f.lineIntersection(h),m=this._inputGeom.getFactory().createLinearRing([d,p,_,v,d]);return this._inputGeom.getFactory().createPolygon(m,null)},interfaces_:function(){return[]},getClass:function(){return gi}}),gi.nextIndex=function(t,e){return++e>=t.length&&(e=0),e},gi.computeC=function(t,e,n){return t*n.y-e*n.x},gi.getMinimumDiameter=function(t){return new gi(t).getDiameter()},gi.getMinimumRectangle=function(t){return new gi(t).getMinimumRectangle()},gi.computeSegmentForLine=function(t,e,n){var i=null,r=null;return Math.abs(e)>Math.abs(t)?(i=new g(0,n/e),r=new g(1,n/e-t/e)):(i=new g(n/t,0),r=new g(n/t-e/t,1)),new $t(i,r)},Zo(di.prototype,{getResultGeometry:function(){return new pi(this._distanceTolerance).transform(this._inputGeom)},setDistanceTolerance:function(t){if(t<=0)throw new r("Tolerance must be positive");this._distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return di}}),di.densifyPoints=function(t,e,n){for(var i=new $t,r=new w,o=0;o<t.length-1;o++){i.p0=t[o],i.p1=t[o+1],r.add(i.p0,!1);var s=i.getLength(),a=Math.trunc(s/e)+1;if(a>1)for(var u=s/a,l=1;l<a;l++){var c=l*u/s,h=i.pointAlong(c);n.makePrecise(h),r.add(h,!1)}}return r.add(t[t.length-1],!1),r.toCoordinateArray()},di.densify=function(t,e){var n=new di(t);return n.setDistanceTolerance(e),n.getResultGeometry()},Ko(pi,ae),Zo(pi.prototype,{transformMultiPolygon:function(t,e){var n=ae.prototype.transformMultiPolygon.call(this,t,e);return this.createValidArea(n)},transformPolygon:function(t,e){var n=ae.prototype.transformPolygon.call(this,t,e);return e instanceof Mt?n:this.createValidArea(n)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=di.densifyPoints(n,this.distanceTolerance,e.getPrecisionModel());return e instanceof wt&&1===i.length&&(i=new Array(0).fill(null)),this._factory.getCoordinateSequenceFactory().create(i)},createValidArea:function(t){return t.buffer(0)},interfaces_:function(){return[]},getClass:function(){return pi}}),di.DensifyTransformer=pi,Zo(_i.prototype,{find:function(t){var e=this;do{if(null===e)return null;if(e.dest().equals2D(t))return e;e=e.oNext()}while(e!==this);return null},dest:function(){return this._sym._orig},oNext:function(){return this._sym._next},insert:function(t){if(this.oNext()===this)return this.insertAfter(t),null;var e=this.compareTo(t),n=this;do{var i=n.oNext();if(i.compareTo(t)!==e||i===this)return n.insertAfter(t),null;n=i}while(n!==this);f.shouldNeverReachHere()},insertAfter:function(t){f.equals(this._orig,t.orig());var e=this.oNext();this._sym.setNext(t),t.sym().setNext(e)},degree:function(){var t=0,e=this;do{t++,e=e.oNext()}while(e!==this);return t},equals:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this._orig.equals2D(t)&&this._sym._orig.equals(e)}},deltaY:function(){return this._sym._orig.y-this._orig.y},sym:function(){return this._sym},prev:function(){return this._sym.next()._sym},compareAngularDirection:function(t){var e=this.deltaX(),n=this.deltaY(),i=t.deltaX(),r=t.deltaY();if(e===i&&n===r)return 0;var o=ke.quadrant(e,n),s=ke.quadrant(i,r);return o>s?1:o<s?-1:Qt.computeOrientation(t._orig,t.dest(),this.dest())},prevNode:function(){for(var t=this;2===t.degree();)if((t=t.prev())===this)return null;return t},compareTo:function(t){var e=t;return this.compareAngularDirection(e)},next:function(){return this._next},setSym:function(t){this._sym=t},orig:function(){return this._orig},toString:function(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"},setNext:function(t){this._next=t},init:function(t){this.setSym(t),t.setSym(this),this.setNext(t),t.setNext(this)},deltaX:function(){return this._sym._orig.x-this._orig.x},interfaces_:function(){return[]},getClass:function(){return _i}}),_i.init=function(t,e){if(null!==t._sym||null!==e._sym||null!==t._next||null!==e._next)throw new IllegalStateException("Edges are already initialized");return t.init(e),t},_i.create=function(t,e){var n=new _i(t),i=new _i(e);return n.init(i),n},Ko(vi,_i),Zo(vi.prototype,{mark:function(){this._isMarked=!0},setMark:function(t){this._isMarked=t},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return vi}}),vi.setMarkBoth=function(t,e){t.setMark(e),t.sym().setMark(e)},vi.isMarked=function(t){return t.isMarked()},vi.setMark=function(t,e){t.setMark(e)},vi.markBoth=function(t){t.mark(),t.sym().mark()},vi.mark=function(t){t.mark()},Zo(mi.prototype,{insert:function(t,e,n){var i=this.create(t,e);null!==n?n.insert(i):this._vertexMap.put(t,i);var r=this._vertexMap.get(e);return null!==r?r.insert(i.sym()):this._vertexMap.put(e,i.sym()),i},create:function(t,e){var n=this.createEdge(t),i=this.createEdge(e);return _i.init(n,i),n},createEdge:function(t){return new _i(t)},addEdge:function(t,e){if(!mi.isValidEdge(t,e))return null;var n=this._vertexMap.get(t),i=null;return null!==n&&(i=n.find(e)),null!==i?i:this.insert(t,e,n)},getVertexEdges:function(){return this._vertexMap.values()},findEdge:function(t,e){var n=this._vertexMap.get(t);return null===n?null:n.find(e)},interfaces_:function(){return[]},getClass:function(){return mi}}),mi.isValidEdge=function(t,e){return 0!==e.compareTo(t)},Ko(yi,vi),Zo(yi.prototype,{setStart:function(){this._isStart=!0},isStart:function(){return this._isStart},interfaces_:function(){return[]},getClass:function(){return yi}}),Ko(xi,mi),Zo(xi.prototype,{createEdge:function(t){return new yi(t)},interfaces_:function(){return[]},getClass:function(){return xi}}),Zo(Ei.prototype,{addLine:function(t){this._lines.add(this._factory.createLineString(t.toCoordinateArray()))},updateRingStartEdge:function(t){return t.isStart()||(t=t.sym()).isStart()?null===this._ringStartEdge?(this._ringStartEdge=t,null):void(t.orig().compareTo(this._ringStartEdge.orig())<0&&(this._ringStartEdge=t)):null},getResult:function(){return null===this._result&&this.computeResult(),this._result},process:function(t){var e=t.prevNode();null===e&&(e=t),this.stackEdges(e),this.buildLines()},buildRing:function(t){var e=new w,n=t;for(e.add(n.orig().copy(),!1);2===n.sym().degree();){var i=n.next();if(i===t)break;e.add(i.orig().copy(),!1),n=i}e.add(n.dest().copy(),!1),this.addLine(e)},buildLine:function(t){var e=new w,n=t;for(this._ringStartEdge=null,vi.markBoth(n),e.add(n.orig().copy(),!1);2===n.sym().degree();){this.updateRingStartEdge(n);var i=n.next();if(i===t)return this.buildRing(this._ringStartEdge),null;e.add(i.orig().copy(),!1),n=i,vi.markBoth(n)}e.add(n.dest().copy(),!1),this.stackEdges(n.sym()),this.addLine(e)},stackEdges:function(t){var e=t;do{vi.isMarked(e)||this._nodeEdgeStack.add(e),e=e.oNext()}while(e!==t)},computeResult:function(){for(var t=this._graph.getVertexEdges().iterator();t.hasNext();){var e=t.next();vi.isMarked(e)||this.process(e)}this._result=this._factory.buildGeometry(this._lines)},buildLines:function(){for(;!this._nodeEdgeStack.empty();){var t=this._nodeEdgeStack.pop();vi.isMarked(t)||this.buildLine(t)}},add:function(){if(arguments[0]instanceof q)arguments[0].apply({interfaces_:function(){return[G]},filter:function(t){t instanceof wt&&this.add(t)}});else if($o(arguments[0],_))for(r=arguments[0].iterator();r.hasNext();){var t=r.next();this.add(t)}else if(arguments[0]instanceof wt){var e=arguments[0];null===this._factory&&(this._factory=e.getFactory());for(var n=e.getCoordinateSequence(),i=!1,r=1;r<n.size();r++){var o=this._graph.addEdge(n.getCoordinate(r-1),n.getCoordinate(r));null!==o&&(i||(o.setStart(),i=!0))}}},interfaces_:function(){return[]},getClass:function(){return Ei}}),Ei.dissolve=function(t){var e=new Ei;return e.add(t),e.getResult()},Zo(wi.prototype,{hasChildren:function(){for(var t=0;t<4;t++)if(null!==this._subnode[t])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(t){t.addAll(this._items);for(var e=0;e<4;e++)null!==this._subnode[e]&&this._subnode[e].addAllItems(t);return t},getNodeCount:function(){for(var t=0,e=0;e<4;e++)null!==this._subnode[e]&&(t+=this._subnode[e].size());return t+1},size:function(){for(var t=0,e=0;e<4;e++)null!==this._subnode[e]&&(t+=this._subnode[e].size());return t+this._items.size()},addAllItemsFromOverlapping:function(t,e){if(!this.isSearchMatch(t))return null;e.addAll(this._items);for(var n=0;n<4;n++)null!==this._subnode[n]&&this._subnode[n].addAllItemsFromOverlapping(t,e)},visitItems:function(t,e){for(var n=this._items.iterator();n.hasNext();)e.visitItem(n.next())},hasItems:function(){return!this._items.isEmpty()},remove:function(t,e){if(!this.isSearchMatch(t))return!1;for(var n=!1,i=0;i<4;i++)if(null!==this._subnode[i]&&(n=this._subnode[i].remove(t,e))){this._subnode[i].isPrunable()&&(this._subnode[i]=null);break}return n||(n=this._items.remove(e))},visit:function(t,e){if(!this.isSearchMatch(t))return null;this.visitItems(t,e);for(var n=0;n<4;n++)null!==this._subnode[n]&&this._subnode[n].visit(t,e)},getItems:function(){return this._items},depth:function(){for(var t=0,e=0;e<4;e++)if(null!==this._subnode[e]){var n=this._subnode[e].depth();n>t&&(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[l]},getClass:function(){return wi}}),wi.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},Zo(bi.prototype,{getLevel:function(){return this._level},computeKey:function(){if(1===arguments.length){var t=arguments[0];for(this._level=bi.computeQuadLevel(t),this._env=new b,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=ti.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 g((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 bi}}),bi.computeQuadLevel=function(t){var e=t.getWidth(),n=t.getHeight();return ti.exponent(e>n?e:n)+1},Ko(Ii,wi),Zo(Ii.prototype,{find:function(t){var e=wi.getSubnodeIndex(t,this._centrex,this._centrey);return-1===e?this:null!==this._subnode[e]?this._subnode[e].find(t):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=wi.getSubnodeIndex(t,this._centrex,this._centrey);return-1!==e?this.getSubnode(e).getNode(t):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 Ii(new b(e,n,i,r),this._level-1)},insertNode:function(t){f.isTrue(null===this._env||this._env.contains(t._env));var e=wi.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 Ii}}),Ii.createNode=function(t){var e=new bi(t);return new Ii(e.getEnvelope(),e.getLevel())},Ii.createExpanded=function(t,e){var n=new b(e);null!==t&&n.expandToInclude(t._env);var i=Ii.createNode(n);return null!==t&&i.insertNode(t),i},Ko(Ci,wi),Zo(Ci.prototype,{insert:function(t,e){var n=wi.getSubnodeIndex(t,Ci.origin.x,Ci.origin.y);if(-1===n)return this.add(e),null;var i=this._subnode[n];if(null===i||!i.getEnvelope().contains(t)){var r=Ii.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=ri.isZeroWidth(e.getMinX(),e.getMaxX()),r=ri.isZeroWidth(e.getMinY(),e.getMaxY());(i||r?t.find(e):t.getNode(e)).add(n)},interfaces_:function(){return[]},getClass:function(){return Ci}}),Ci.origin=new g(0,0),Zo(Ni.prototype,{size:function(){return null!==this._root?this._root.size():0},insert:function(t,e){this.collectStats(t);var n=Ni.ensureExtent(t,this._minExtent);this._root.insert(n,e)},query:function(){if(1===arguments.length){var t=arguments[0],e=new Pn;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 E;return this._root.addAllItems(t),t},remove:function(t,e){var n=Ni.ensureExtent(t,this._minExtent);return this._root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e<this._minExtent&&e>0&&(this._minExtent=e);var n=t.getHeight();n<this._minExtent&&n>0&&(this._minExtent=n)},depth:function(){return null!==this._root?this._root.depth():0},isEmpty:function(){return null===this._root},interfaces_:function(){return[Ie,l]},getClass:function(){return Ni}}),Ni.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&&(i=(n-=e/2)+e/2),r===o&&(o=(r-=e/2)+e/2),new b(n,i,r,o))},Ni.serialVersionUID=-0x678b60c967a25400;var hs=Object.freeze({Quadtree:Ni}),fs=Object.freeze({STRtree:Me}),gs=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];Zo(Si.prototype,{read:function(t){var e=void 0,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!ds[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==gs.indexOf(n)?ds[n].apply(this,[e.coordinates]):"GeometryCollection"===n?ds[n].apply(this,[e.geometries]):ds[n].apply(this,[e])},write:function(t){var e=t.getGeometryType();if(!ps[e])throw new Error("Geometry is not supported");return ps[e].apply(this,[t])}});var ds={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!ds[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=ds.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(new g(i[0],i[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new g(t[0],t[1]),new g(t[2],t[1]),new g(t[2],t[3]),new g(t[0],t[3]),new g(t[0],t[1])])},Point:function(t){var e=new g(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(ds.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=ds.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(ds.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=ds.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),i=[],r=1;r<t.length;++r){var o=t[r],s=ds.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);i.push(a)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(ds.Polygon.apply(this,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(this.read(i))}return this.geometryFactory.createGeometryCollection(e)}},ps={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:ps.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=ps.Point.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),i=0;i<n.length;++i){var r=n[i];e.push(ps.coordinate.apply(this,[r]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=ps.LineString.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=ps.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var i=0;i<t._holes.length;++i){var r=t._holes[i],o=ps.LineString.apply(this,[r]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=ps.Polygon.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=i.getGeometryType();e.push(ps[r].apply(this,[i]))}return{type:"GeometryCollection",geometries:e}}};Zo(Li.prototype,{read:function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Yt.FIXED&&this.reducePrecision(e),e},reducePrecision:function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])}}),Zo(Mi.prototype,{write:function(t){return this.parser.write(t)}}),Zo(Pi.prototype,{read:function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Yt.FIXED&&this.reducePrecision(e),e},reducePrecision:function(t){if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t._points)for(var e=0,n=t._points._coordinates.length;e<n;e++)this.precisionModel.makePrecise(t._points._coordinates[e]);else if(t._geometries)for(var i=0,r=t._geometries.length;i<r;i++)this.reducePrecision(t._geometries[i])}}),Zo(Oi.prototype,{read:function(t){var e=this.ol;return t instanceof e.geom.Point?this.convertFromPoint(t):t instanceof e.geom.LineString?this.convertFromLineString(t):t instanceof e.geom.LinearRing?this.convertFromLinearRing(t):t instanceof e.geom.Polygon?this.convertFromPolygon(t):t instanceof e.geom.MultiPoint?this.convertFromMultiPoint(t):t instanceof e.geom.MultiLineString?this.convertFromMultiLineString(t):t instanceof e.geom.MultiPolygon?this.convertFromMultiPolygon(t):t instanceof e.geom.GeometryCollection?this.convertFromCollection(t):void 0},convertFromPoint:function(t){var e=t.getCoordinates();return this.geometryFactory.createPoint(new g(e[0],e[1]))},convertFromLineString:function(t){return this.geometryFactory.createLineString(t.getCoordinates().map(function(t){return new g(t[0],t[1])}))},convertFromLinearRing:function(t){return this.geometryFactory.createLinearRing(t.getCoordinates().map(function(t){return new g(t[0],t[1])}))},convertFromPolygon:function(t){for(var e=t.getLinearRings(),n=null,i=[],r=0;r<e.length;r++){var o=this.convertFromLinearRing(e[r]);0===r?n=o:i.push(o)}return this.geometryFactory.createPolygon(n,i)},convertFromMultiPoint:function(t){var e=t.getPoints().map(function(t){return this.convertFromPoint(t)},this);return this.geometryFactory.createMultiPoint(e)},convertFromMultiLineString:function(t){var e=t.getLineStrings().map(function(t){return this.convertFromLineString(t)},this);return this.geometryFactory.createMultiLineString(e)},convertFromMultiPolygon:function(t){var e=t.getPolygons().map(function(t){return this.convertFromPolygon(t)},this);return this.geometryFactory.createMultiPolygon(e)},convertFromCollection:function(t){var e=t.getGeometries().map(function(t){return this.read(t)},this);return this.geometryFactory.createGeometryCollection(e)},write:function(t){return"Point"===t.getGeometryType()?this.convertToPoint(t.getCoordinate()):"LineString"===t.getGeometryType()?this.convertToLineString(t):"LinearRing"===t.getGeometryType()?this.convertToLinearRing(t):"Polygon"===t.getGeometryType()?this.convertToPolygon(t):"MultiPoint"===t.getGeometryType()?this.convertToMultiPoint(t):"MultiLineString"===t.getGeometryType()?this.convertToMultiLineString(t):"MultiPolygon"===t.getGeometryType()?this.convertToMultiPolygon(t):"GeometryCollection"===t.getGeometryType()?this.convertToCollection(t):void 0},convertToPoint:function(t){return new this.ol.geom.Point([t.x,t.y])},convertToLineString:function(t){var e=t.points.coordinates.map(Ri);return new this.ol.geom.LineString(e)},convertToLinearRing:function(t){var e=t.points.coordinates.map(Ri);return new this.ol.geom.LinearRing(e)},convertToPolygon:function(t){for(var e=[t.shell.points.coordinates.map(Ri)],n=0;n<t.holes.length;n++)e.push(t.holes[n].points.coordinates.map(Ri));return new this.ol.geom.Polygon(e)},convertToMultiPoint:function(t){return new this.ol.geom.MultiPoint(t.getCoordinates().map(Ri))},convertToMultiLineString:function(t){for(var e=[],n=0;n<t.geometries.length;n++)e.push(this.convertToLineString(t.geometries[n]).getCoordinates());return new this.ol.geom.MultiLineString(e)},convertToMultiPolygon:function(t){for(var e=[],n=0;n<t.geometries.length;n++)e.push(this.convertToPolygon(t.geometries[n]).getCoordinates());return new this.ol.geom.MultiPolygon(e)},convertToCollection:function(t){for(var e=[],n=0;n<t.geometries.length;n++){var i=t.geometries[n];e.push(this.write(i))}return new this.ol.geom.GeometryCollection(e)}}),Zo(Ti.prototype,{rescale:function(){if($o(arguments[0],_))for(n=arguments[0].iterator();n.hasNext();){var t=n.next();this.rescale(t.getCoordinates())}else if(arguments[0]instanceof Array){var e=arguments[0];2===e.length&&(new g(e[0]),new g(e[1]));for(var n=0;n<e.length;n++)e[n].x=e[n].x/this._scaleFactor+this._offsetX,e[n].y=e[n].y/this._scaleFactor+this._offsetY;2===e.length&&e[0].equals2D(e[1])&&A.out.println(e)}},scale:function(){if($o(arguments[0],_)){for(var t=arguments[0],e=new E,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Fe(this.scale(i.getCoordinates()),i.getData()))}return e}if(arguments[0]instanceof Array){for(var r=arguments[0],o=new Array(r.length).fill(null),n=0;n<r.length;n++)o[n]=new g(Math.round((r[n].x-this._offsetX)*this._scaleFactor),Math.round((r[n].y-this._offsetY)*this._scaleFactor),r[n].z);return V.removeRepeatedPoints(o)}},isIntegerPrecision:function(){return 1===this._scaleFactor},getNodedSubstrings:function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},computeNodes:function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},interfaces_:function(){return[je]},getClass:function(){return Ti}}),Zo(Ai.prototype,{isSimpleMultiPoint:function(t){if(t.isEmpty())return!0;for(var e=new st,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n).getCoordinate();if(e.contains(i))return this._nonSimpleLocation=i,!1;e.add(i)}return!0},isSimplePolygonal:function(t){for(var e=Mn.getLines(t).iterator();e.hasNext();){var n=e.next();if(!this.isSimpleLinearGeometry(n))return!1}return!0},hasClosedEndpointIntersection:function(t){for(var e=new it,n=t.getEdgeIterator();n.hasNext();){var i=n.next(),r=(i.getMaximumSegmentIndex(),i.isClosed()),o=i.getCoordinate(0);this.addEndpoint(e,o,r);var s=i.getCoordinate(i.getNumPoints()-1);this.addEndpoint(e,s,r)}for(n=e.values().iterator();n.hasNext();){var a=n.next();if(a.isClosed&&2!==a.degree)return this._nonSimpleLocation=a.getCoordinate(),!0}return!1},getNonSimpleLocation:function(){return this._nonSimpleLocation},isSimpleLinearGeometry:function(t){if(t.isEmpty())return!0;var e=new Bn(0,t),n=new Jt,i=e.computeSelfNodes(n,!0);return!i.hasIntersection()||(i.hasProperIntersection()?(this._nonSimpleLocation=i.getProperIntersectionPoint(),!1):!this.hasNonEndpointIntersection(e)&&(!this._isClosedEndpointsInInterior||!this.hasClosedEndpointIntersection(e)))},hasNonEndpointIntersection:function(t){for(var e=t.getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getMaximumSegmentIndex(),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next();if(!o.isEndPoint(i))return this._nonSimpleLocation=o.getCoordinate(),!0}return!1},addEndpoint:function(t,e,n){var i=t.get(e);null===i&&(i=new Di(e),t.put(e,i)),i.addEndpoint(n)},computeSimple:function(t){return this._nonSimpleLocation=null,!!t.isEmpty()||(t instanceof wt?this.isSimpleLinearGeometry(t):t instanceof ft?this.isSimpleLinearGeometry(t):t instanceof St?this.isSimpleMultiPoint(t):$o(t,Ct)?this.isSimplePolygonal(t):!(t instanceof ht)||this.isSimpleGeometryCollection(t))},isSimple:function(){return this._nonSimpleLocation=null,this.computeSimple(this._inputGeom)},isSimpleGeometryCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);if(!this.computeSimple(n))return!1}return!0},interfaces_:function(){return[]},getClass:function(){return Ai}}),Zo(Di.prototype,{addEndpoint:function(t){this.degree++,this.isClosed|=t},getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Di}}),Ai.EndpointInfo=Di,Zo(Fi.prototype,{getEndCapStyle:function(){return this._endCapStyle},isSingleSided:function(){return this._isSingleSided},setQuadrantSegments:function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Fi.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Fi.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Fi.JOIN_ROUND&&(this._quadrantSegments=Fi.DEFAULT_QUADRANT_SEGMENTS)},getJoinStyle:function(){return this._joinStyle},setJoinStyle:function(t){this._joinStyle=t},setSimplifyFactor:function(t){this._simplifyFactor=t<0?0:t},getSimplifyFactor:function(){return this._simplifyFactor},getQuadrantSegments:function(){return this._quadrantSegments},setEndCapStyle:function(t){this._endCapStyle=t},getMitreLimit:function(){return this._mitreLimit},setMitreLimit:function(t){this._mitreLimit=t},setSingleSided:function(t){this._isSingleSided=t},interfaces_:function(){return[]},getClass:function(){return Fi}}),Fi.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Fi.CAP_ROUND=1,Fi.CAP_FLAT=2,Fi.CAP_SQUARE=3,Fi.JOIN_ROUND=1,Fi.JOIN_MITRE=2,Fi.JOIN_BEVEL=3,Fi.DEFAULT_QUADRANT_SEGMENTS=8,Fi.DEFAULT_MITRE_LIMIT=5,Fi.DEFAULT_SIMPLIFY_FACTOR=.01,Zo(Gi.prototype,{getCoordinate:function(){return this._minCoord},getRightmostSide:function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},findRightmostEdgeAtVertex:function(){var t=this._minDe.getEdge().getCoordinates();f.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=Qt.computeOrientation(this._minCoord,n,e),r=!1;e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===Qt.COUNTERCLOCKWISE?r=!0:e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===Qt.CLOCKWISE&&(r=!0),r&&(this._minIndex=this._minIndex-1)},getRightmostSideOfSegment:function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var i=Ke.LEFT;return n[e].y<n[e+1].y&&(i=Ke.RIGHT),i},getEdge:function(){return this._orientedDe},checkForRightmostCoordinate:function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},findRightmostEdgeAtNode:function(){var t=this._minDe.getNode().getEdges();this._minDe=t.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)===Ke.LEFT&&(this._orientedDe=this._minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Gi}}),qi.prototype.addLast=function(t){this.array_.push(t)},qi.prototype.removeFirst=function(){return this.array_.shift()},qi.prototype.isEmpty=function(){return 0===this.array_.length},Zo(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();)if((i=n.next()).isVisited()||i.getSym().isVisited()){e=i;break}if(null===e)throw new Ve("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(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(Ke.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(Ke.RIGHT)>=1&&e.getDepth(Ke.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},computeDepths:function(t){var e=new K,n=new qi,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().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},compareTo:function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},getEnvelope:function(){if(null===this._env){for(var t=new b,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),i=0;i<n.length-1;i++)t.expandToInclude(n[i]);this._env=t}return this._env},addReachable:function(t){var e=new ie;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},copySymDepths:function(t){var e=t.getSym();e.setDepth(Ke.LEFT,t.getDepth(Ke.RIGHT)),e.setDepth(Ke.RIGHT,t.getDepth(Ke.LEFT))},add:function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();this._dirEdgeList.add(i);var r=i.getSym().getNode();r.isVisited()||e.push(r)}},getNodes:function(){return this._nodes},getDirectedEdges:function(){return this._dirEdgeList},interfaces_:function(){return[s]},getClass:function(){return ki}}),Zo(Bi.prototype,{isDeletable:function(t,e,n,i){var r=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(r,o,s)&&(!!this.isShallow(r,o,s,i)&&this.isShallowSampled(r,o,t,n,i))},deleteShallowConcavities:function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),i=!1;n<this._inputLine.length;){var r=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Bi.DELETE,r=!0,i=!0),t=r?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return i},isShallowConcavity:function(t,e,n,i){return Qt.computeOrientation(t,e,n)===this._angleOrientation&&Qt.distancePointLine(e,t,n)<i},isShallowSampled:function(t,e,n,i,r){var o=Math.trunc((i-n)/Bi.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<i;s+=o)if(!this.isShallow(t,e,this._inputLine[s],r))return!1;return!0},isConcave:function(t,e,n){var i=Qt.computeOrientation(t,e,n)===this._angleOrientation;return i},simplify:function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=Qt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},findNextNonDeletedIndex:function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Bi.DELETE;)e++;return e},isShallow:function(t,e,n,i){return Qt.distancePointLine(e,t,n)<i},collapseLine:function(){for(var t=new w,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Bi.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return Bi}}),Bi.simplify=function(t,e){return new Bi(t).simplify(e)},Bi.INIT=0,Bi.DELETE=1,Bi.KEEP=1,Bi.NUM_PTS_TO_CHECK=10,Zo(ji.prototype,{getCoordinates:function(){return this._ptList.toArray(ji.COORDINATE_ARRAY_TYPE)},setPrecisionModel:function(t){this._precisionModel=t},addPt:function(t){var e=new g(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},reverse:function(){},addPts:function(t,e){if(e)for(n=0;n<t.length;n++)this.addPt(t[n]);else for(var n=t.length-1;n>=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)<this._minimimVertexDistance},toString:function(){return(new Vt).createLineString(this.getCoordinates()).toString()},closeRing:function(){if(this._ptList.size()<1)return null;var t=new g(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(this._ptList.size()>=2&&this._ptList.get(this._ptList.size()-2),t.equals(e))return null;this._ptList.add(t)},setMinimumVertexDistance:function(t){this._minimimVertexDistance=t},interfaces_:function(){return[]},getClass:function(){return ji}}),ji.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),Zo(zi.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=Qt.computeOrientation(this._s0,this._s1,this._s2),i=n===Qt.CLOCKWISE&&this._side===Ke.LEFT||n===Qt.COUNTERCLOCKWISE&&this._side===Ke.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},addLineEndCap:function(t,e){var n=new $t(t,e),i=new $t;this.computeOffsetSegment(n,Ke.LEFT,this._distance,i);var r=new $t;this.computeOffsetSegment(n,Ke.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 Fi.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,Qt.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case Fi.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(r.p1);break;case Fi.CAP_SQUARE:var u=new g;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new g(i.p1.x+u.x,i.p1.y+u.y),c=new g(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=D.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 g(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===Qt.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){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*zi.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Fi.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Fi.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},createSquare:function(t){this._segList.addPt(new g(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new g(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new g(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new g(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},addSegments:function(t,e){this._segList.addPts(t,e)},addFirstSegment:function(){this._segList.addPt(this._offset1.p0)},addLastSegment:function(){this._segList.addPt(this._offset1.p1)},initSideSegments:function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},addLimitedMitreJoin:function(t,e,n,i){var r=this._seg0.p1,o=ci.angle(r,this._seg0.p0),s=(ci.angle(r,this._seg1.p1),ci.angleBetweenOriented(this._seg0.p0,r,this._seg1.p1)/2),a=ci.normalize(o+s),u=ci.normalize(a+Math.PI),l=i*n,c=n-l*Math.abs(Math.sin(s)),h=new $t(r,new g(r.x+l*Math.cos(u),r.y+l*Math.sin(u))),f=h.pointAlongOffset(1,c),d=h.pointAlongOffset(1,-c);this._side===Ke.LEFT?(this._segList.addPt(f),this._segList.addPt(d)):(this._segList.addPt(d),this._segList.addPt(f))},computeOffsetSegment:function(t,e,n,i){var r=e===Ke.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=r*n*o/a,l=r*n*s/a;i.p0.x=t.p0.x-l,i.p0.y=t.p0.y+u,i.p1.x=t.p1.x-l,i.p1.y=t.p1.y+u},addFilletArc:function(t,e,n,i,r){var o=i===Qt.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;var u=null;u=s/a;for(var l=0,c=new g;l<s;){var h=e+o*l;c.x=t.x+r*Math.cos(h),c.y=t.y+r*Math.sin(h),this._segList.addPt(c),l+=u}},addInsideTurn:function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*zi.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new g((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 g((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 g(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 ji,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*zi.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()===Fi.JOIN_BEVEL||this._bufParams.getJoinStyle()===Fi.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,Qt.CLOCKWISE,this._distance))},closeRing:function(){this._segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return zi}}),zi.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,zi.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,zi.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,zi.MAX_CLOSING_SEG_LEN_FACTOR=80,Zo(Yi.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&&V.reverse(o),o},computeSingleSidedBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var r=Bi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Ke.LEFT),n.addFirstSegment();for(u=o-2;u>=0;u--)n.addNextSegment(r[u],!0)}else{n.addSegments(t,!1);var s=Bi.simplify(t,i),a=s.length-1;n.initSideSegments(s[0],s[1],Ke.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},computeRingBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this._distance);e===Ke.RIGHT&&(i=-i);var r=Bi.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=Bi.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],Ke.LEFT);for(a=2;a<=r;a++)e.addNextSegment(i[a],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var o=Bi.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],Ke.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},computePointCurve:function(t,e){switch(this._bufParams.getEndCapStyle()){case Fi.CAP_ROUND:e.createCircle(t);break;case Fi.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 Yi.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=Bi.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Ke.LEFT),n.addFirstSegment();for(u=o-2;u>=0;u--)n.addNextSegment(r[u],!0)}else{var s=Bi.simplify(t,i),a=s.length-1;n.initSideSegments(s[0],s[1],Ke.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},getSegGen:function(t){return new zi(this._precisionModel,this._bufParams,t)},interfaces_:function(){return[]},getClass:function(){return Yi}}),Yi.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new g(t[n]);return e},Zo(Xi.prototype,{findStabbedSegments:function(){if(1===arguments.length){for(var t=arguments[0],e=new E,n=this._subgraphs.iterator();n.hasNext();){var i=n.next(),r=i.getEnvelope();t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if($o(arguments[2],m)&&arguments[0]instanceof g&&arguments[1]instanceof un){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),n=0;n<u.length-1;n++)if(this._seg.p0=u[n],this._seg.p1=u[n+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||Qt.computeOrientation(this._seg.p0,this._seg.p1,o)===Qt.RIGHT)){var l=s.getDepth(Ke.LEFT);this._seg.p0.equals(u[n])||(l=s.getDepth(Ke.RIGHT));var c=new Vi(this._seg,l);a.add(c)}}else if($o(arguments[2],m)&&arguments[0]instanceof g&&$o(arguments[1],m))for(var h=arguments[0],f=arguments[1],d=arguments[2],n=f.iterator();n.hasNext();){var p=n.next();p.isForward()&&this.findStabbedSegments(h,p,d)}},getDepth:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:cs.min(e)._leftDepth},interfaces_:function(){return[]},getClass:function(){return Xi}}),Zo(Vi.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:0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?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[s]},getClass:function(){return Vi}}),Xi.DepthSegment=Vi,Zo(Ui.prototype,{addPoint:function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},addPolygon:function(t){var e=this._distance,n=Ke.LEFT;this._distance<0&&(e=-this._distance,n=Ke.RIGHT);var i=t.getExteriorRing(),r=V.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,N.EXTERIOR,N.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=V.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ke.opposite(n),N.INTERIOR,N.EXTERIOR)}},isTriangleErodedCompletely:function(t,e){var n=new hi(t[0],t[1],t[2]),i=n.inCentre();return Qt.distancePointLine(i,n.p0,n.p1)<Math.abs(e)},addLineString:function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=V.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,N.EXTERIOR,N.INTERIOR)},addCurve:function(t,e,n){if(null===t||t.length<2)return null;var i=new Fe(t,new $e(0,N.BOUNDARY,e,n));this._curveList.add(i)},getCurves:function(){return this.add(this._inputGeom),this._curveList},addPolygonRing:function(t,e,n,i,r){if(0===e&&t.length<Lt.MINIMUM_VALID_SIZE)return null;var o=i,s=r;t.length>=Lt.MINIMUM_VALID_SIZE&&Qt.isCCW(t)&&(o=r,s=i,n=Ke.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 Nt)this.addPolygon(t);else if(t instanceof wt)this.addLineString(t);else if(t instanceof It)this.addPoint(t);else if(t instanceof St)this.addCollection(t);else if(t instanceof ft)this.addCollection(t);else if(t instanceof Mt)this.addCollection(t);else{if(!(t instanceof ht))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;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},interfaces_:function(){return[]},getClass:function(){return Ui}}),Zo(Hi.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(Hi.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this._properIntersectionPoint},hasProperInteriorIntersection:function(){return this._hasProperInterior},getLineIntersector:function(){return this._li},hasProperIntersection:function(){return this._hasProper},processIntersections: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.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},hasIntersection:function(){return this._hasIntersection},isDone:function(){return!1},hasInteriorIntersection:function(){return this._hasInterior},interfaces_:function(){return[Ue]},getClass:function(){return Hi}}),Hi.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},Zo(Wi.prototype,{setWorkingPrecisionModel:function(t){this._workingPrecisionModel=t},insertUniqueEdge:function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new $e(t.getLabel())).flip(),n.merge(i);var r=Wi.depthDelta(i),o=e.getDepthDelta()+r;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(Wi.depthDelta(t.getLabel()))},buildSubgraphs:function(t,e){for(var n=new E,i=t.iterator();i.hasNext();){var r=i.next(),o=r.getRightmostCoordinate(),s=new Xi(n).getDepth(o);r.computeDepth(s),r.findResultEdges(),n.add(r),e.add(r.getDirectedEdges(),r.getNodes())}},createSubgraphs:function(t){for(var e=new E,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var r=new ki;r.create(i),e.add(r)}}return cs.sort(e,cs.reverseOrder()),e},createEmptyResultGeometry:function(){return this._geomFact.createPolygon()},getNoder:function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new Ye,n=new Jt;return n.setPrecisionModel(t),e.setSegmentIntersector(new Hi(n)),e},buffer:function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new Ui(t,e,new Yi(n,this._bufParams)).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new cn(new mn),this._graph.addEdges(this._edgeList.getEdges());var r=this.createSubgraphs(this._graph),o=new hn(this._geomFact);this.buildSubgraphs(r,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},computeNodedEdges:function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var i=n.getNodedSubstrings().iterator();i.hasNext();){var r=i.next(),o=r.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=r.getData(),a=new kn(r.getCoordinates(),new $e(s));this.insertUniqueEdge(a)}}},setNoder:function(t){this._workingNoder=t},interfaces_:function(){return[]},getClass:function(){return Wi}}),Wi.depthDelta=function(t){var e=t.getLocation(0,Ke.LEFT),n=t.getLocation(0,Ke.RIGHT);return e===N.INTERIOR&&n===N.EXTERIOR?1:e===N.EXTERIOR&&n===N.INTERIOR?-1:0},Wi.convertSegStrings=function(t){for(var e=new Vt,n=new E;t.hasNext();){var i=t.next(),r=e.createLineString(i.getCoordinates());n.add(r)}return e.buildGeometry(n)},Zo(Ji.prototype,{checkEndPtVertexIntersections:function(){if(0===arguments.length)for(e=this._segStrings.iterator();e.hasNext();){i=(n=e.next()).getCoordinates();this.checkEndPtVertexIntersections(i[0],this._segStrings),this.checkEndPtVertexIntersections(i[i.length-1],this._segStrings)}else if(2===arguments.length)for(var t=arguments[0],e=arguments[1].iterator();e.hasNext();)for(var n=e.next(),i=n.getCoordinates(),r=1;r<i.length-1;r++)if(i[r].equals(t))throw new c("found endpt/interior pt intersection at index "+r+" :pt "+t)},checkInteriorIntersections:function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var i=n.next();this.checkInteriorIntersections(e,i)}else if(2===arguments.length)for(var r=arguments[0],o=arguments[1],s=r.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var l=0;l<a.length-1;l++)this.checkInteriorIntersections(r,u,o,l);else if(4===arguments.length){var h=arguments[0],f=arguments[1],g=arguments[2],d=arguments[3];if(h===g&&f===d)return null;var p=h.getCoordinates()[f],_=h.getCoordinates()[f+1],v=g.getCoordinates()[d],m=g.getCoordinates()[d+1];if(this._li.computeIntersection(p,_,v,m),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,p,_)||this.hasInteriorIntersection(this._li,v,m)))throw new c("found non-noded intersection at "+p+"-"+_+" and "+v+"-"+m)}},checkValid:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},checkCollapses:function(){if(0===arguments.length)for(n=this._segStrings.iterator();n.hasNext();){var t=n.next();this.checkCollapses(t)}else if(1===arguments.length)for(var e=arguments[0].getCoordinates(),n=0;n<e.length-2;n++)this.checkCollapse(e[n],e[n+1],e[n+2])},hasInteriorIntersection:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var r=t.getIntersection(i);if(!r.equals(e)&&!r.equals(n))return!0}return!1},checkCollapse:function(t,e,n){if(t.equals(n))throw new c("found non-noded collapse at "+Ji.fact.createLineString([t,e,n]))},interfaces_:function(){return[]},getClass:function(){return Ji}}),Ji.fact=new Vt,Zo(Zi.prototype,{intersectsScaled:function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>i||this._maxy<r||this._miny>o;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 g(this._maxx,this._maxy),this._corner[1]=new g(this._minx,this._maxy),this._corner[2]=new g(this._minx,this._miny),this._corner[3]=new g(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=Zi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new b(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 Zi}}),Zi.SAFE_ENV_EXPANSION_FACTOR=.75,Zo(Ki.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 Qi(e,n,i);return this._index.query(r,{interfaces_:function(){return[be]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return Ki}}),Ko(Qi,Kn),Zo(Qi.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return Kn.prototype.select.apply(this,arguments);var t=arguments[0],e=arguments[1],n=t.getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},interfaces_:function(){return[]},getClass:function(){return Qi}}),Ki.HotPixelSnapAction=Qi,Zo($i.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<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},isDone:function(){return!1},getInteriorIntersections:function(){return this._interiorIntersections},interfaces_:function(){return[Ue]},getClass:function(){return $i}}),Zo(tr.prototype,{checkCorrectness:function(t){var e=new Ji(Fe.getNodedSubstrings(t));try{e.checkValid()}catch(t){if(!(t instanceof I))throw t;t.printStackTrace()}},getNodedSubstrings:function(){return Fe.getNodedSubstrings(this._nodedSegStrings)},snapRound:function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},findInteriorIntersections:function(t,e){var n=new $i(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},computeVertexSnaps:function(){if($o(arguments[0],_))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof Fe)for(var n=arguments[0],i=n.getCoordinates(),r=0;r<i.length;r++){var o=new Zi(i[r],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,r)&&n.addIntersection(i[r],r)}},computeNodes:function(t){this._nodedSegStrings=t,this._noder=new Ye,this._pointSnapper=new Ki(this._noder.getIndex()),this.snapRound(t,this._li)},computeIntersectionSnaps:function(t){for(var e=t.iterator();e.hasNext();){var n=new Zi(e.next(),this._scaleFactor,this._li);this._pointSnapper.snap(n)}},interfaces_:function(){return[je]},getClass:function(){return tr}}),Zo(er.prototype,{bufferFixedPrecision:function(t){var e=new Ti(new tr(new Yt(1)),t.getScale()),n=new Wi(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},bufferReducedPrecision:function(){if(0===arguments.length){for(var t=er.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof Ve))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var e=arguments[0],n=new Yt(er.precisionScaleFactor(this._argGeom,this._distance,e));this.bufferFixedPrecision(n)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Yt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},setQuadrantSegments:function(t){this._bufParams.setQuadrantSegments(t)},bufferOriginalPrecision:function(){try{var t=new Wi(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof c))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 er}}),er.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return f=new er(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof q&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1],r=arguments[2];return(h=new er(n)).setQuadrantSegments(r),f=h.getResultGeometry(i)}if(arguments[2]instanceof Fi&&arguments[0]instanceof q&&"number"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return f=(h=new er(o,arguments[2])).getResultGeometry(s)}}else if(4===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2],c=arguments[3],h=new er(a);h.setQuadrantSegments(l),h.setEndCapStyle(c);var f=h.getResultGeometry(u);return f}},er.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=S.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(r)/Math.log(10)+1);return Math.pow(10,o)},er.CAP_ROUND=Fi.CAP_ROUND,er.CAP_BUTT=Fi.CAP_FLAT,er.CAP_FLAT=Fi.CAP_FLAT,er.CAP_SQUARE=Fi.CAP_SQUARE,er.MAX_PRECISION_DIGITS=12,Zo(nr.prototype,{filter:function(t){t instanceof Nt&&this._comps.add(t)},interfaces_:function(){return[lt]},getClass:function(){return nr}}),nr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return nr.getPolygons(t,new E)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Nt?n.add(e):e instanceof ht&&e.apply(new nr(n)),n}},Zo(ir.prototype,{isInsideArea:function(){return this._segIndex===ir.INSIDE_AREA},getCoordinate:function(){return this._pt},getGeometryComponent:function(){return this._component},getSegmentIndex:function(){return this._segIndex},interfaces_:function(){return[]},getClass:function(){return ir}}),ir.INSIDE_AREA=-1,Zo(rr.prototype,{filter:function(t){t instanceof It&&this._pts.add(t)},interfaces_:function(){return[lt]},getClass:function(){return rr}}),rr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof It?cs.singletonList(t):rr.getPoints(t,new E)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof It?n.add(e):e instanceof ht&&e.apply(new rr(n)),n}},Zo(or.prototype,{filter:function(t){(t instanceof It||t instanceof wt||t instanceof Nt)&&this._locations.add(new ir(t,0,t.getCoordinate()))},interfaces_:function(){return[lt]},getClass:function(){return or}}),or.getLocations=function(t){var e=new E;return t.apply(new or(e)),e},Zo(sr.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=nr.getPolygons(this._geom[e]);if(r.size()>0){var o=or.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&&$o(arguments[0],m)&&$o(arguments[1],m)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ir&&arguments[1]instanceof Nt){var f=arguments[0],g=arguments[1],d=arguments[2],p=f.getCoordinate();if(N.EXTERIOR!==this._ptLocator.locate(p,g))return this._minDistance=0,d[0]=f,d[1]=new ir(g,p),null}},computeMinDistanceLinesPoints:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this._minDistance<=this._terminateDistance)return null}},computeFacetDistance:function(){var t=new Array(2).fill(null),e=Mn.getLines(this._geom[0]),n=Mn.getLines(this._geom[1]),i=rr.getPoints(this._geom[0]),r=rr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(i,r,t),void this.updateMinDistance(t,!1))))},nearestLocations:function(){return this.computeMinDistance(),this._minDistanceLocation},updateMinDistance:function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},nearestPoints:function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},computeMinDistance:function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof wt&&arguments[1]instanceof It){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;o<i.length-1;o++){if((f=Qt.distancePointLine(r,i[o],i[o+1]))<this._minDistance){this._minDistance=f;var s=new $t(i[o],i[o+1]).closestPoint(r);n[0]=new ir(t,o,s),n[1]=new ir(e,0,r)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof wt&&arguments[1]instanceof wt){var a=arguments[0],u=arguments[1],l=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var i=a.getCoordinates(),c=u.getCoordinates(),o=0;o<i.length-1;o++)for(var h=0;h<c.length-1;h++){var f=Qt.distanceLineLine(i[o],i[o+1],c[h],c[h+1]);if(f<this._minDistance){this._minDistance=f;var g=new $t(i[o],i[o+1]),d=new $t(c[h],c[h+1]),p=g.closestPoints(d);l[0]=new ir(a,o,p[0]),l[1]=new ir(u,h,p[1])}if(this._minDistance<=this._terminateDistance)return null}}},computeMinDistancePoints:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o),a=r.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new ir(r,0,r.getCoordinate()),n[1]=new ir(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},distance:function(){if(null===this._geom[0]||null===this._geom[1])throw new r("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},computeMinDistanceLines:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this._minDistance<=this._terminateDistance)return null}},interfaces_:function(){return[]},getClass:function(){return sr}}),sr.distance=function(t,e){return new sr(t,e).distance()},sr.isWithinDistance=function(t,e,n){return new sr(t,e,n).distance()<=n},sr.nearestPoints=function(t,e){return new sr(t,e).nearestPoints()},Zo(ar.prototype,{getCoordinates:function(){if(null===this._coordinates){for(var t=0,e=0,n=new w,i=this._directedEdges.iterator();i.hasNext();){var r=i.next();r.getEdgeDirection()?t++:e++,n.add(r.getEdge().getLine().getCoordinates(),!1,r.getEdgeDirection())}this._coordinates=n.toCoordinateArray(),e>t&&V.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 ar}}),Zo(ur.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 ur}}),ur.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},ur.setVisited=function(t,e){for(;t.hasNext();)t.next().setVisited(e)},ur.setMarked=function(t,e){for(;t.hasNext();)t.next().setMarked(e)},Ko(lr,ur),Zo(lr.prototype,{isRemoved:function(){return null===this._parentEdge},compareDirection:function(t){return this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:Qt.computeOrientation(t._p0,t._p1,this._p1)},getCoordinate:function(){return this._from.getCoordinate()},print:function(t){var e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+this._angle)},getDirectionPt:function(){return this._p1},getAngle:function(){return this._angle},compareTo:function(t){var e=t;return this.compareDirection(e)},getFromNode:function(){return this._from},getSym:function(){return this._sym},setEdge:function(t){this._parentEdge=t},remove:function(){this._sym=null,this._parentEdge=null},getEdge:function(){return this._parentEdge},getQuadrant:function(){return this._quadrant},setSym:function(t){this._sym=t},getToNode:function(){return this._to},getEdgeDirection:function(){return this._edgeDirection},interfaces_:function(){return[s]},getClass:function(){return lr}}),lr.toEdges=function(t){for(var e=new E,n=t.iterator();n.hasNext();)e.add(n.next()._parentEdge);return e},Ko(cr,lr),Zo(cr.prototype,{getNext:function(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(f.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))},interfaces_:function(){return[]},getClass:function(){return cr}}),Ko(hr,ur),Zo(hr.prototype,{isRemoved:function(){return null===this._dirEdge},setDirectedEdges:function(t,e){this._dirEdge=[t,e],t.setEdge(this),e.setEdge(this),t.setSym(e),e.setSym(t),t.getFromNode().addOutEdge(t),e.getFromNode().addOutEdge(e)},getDirEdge:function(){if(Number.isInteger(arguments[0])){var t=arguments[0];return this._dirEdge[t]}if(arguments[0]instanceof gr){var e=arguments[0];return this._dirEdge[0].getFromNode()===e?this._dirEdge[0]:this._dirEdge[1].getFromNode()===e?this._dirEdge[1]:null}},remove:function(){this._dirEdge=null},getOppositeNode:function(t){return this._dirEdge[0].getFromNode()===t?this._dirEdge[0].getToNode():this._dirEdge[1].getFromNode()===t?this._dirEdge[1].getToNode():null},interfaces_:function(){return[]},getClass:function(){return hr}}),Zo(fr.prototype,{getNextEdge:function(t){var e=this.getIndex(t);return this._outEdges.get(this.getIndex(e+1))},getCoordinate:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},iterator:function(){return this.sortEdges(),this._outEdges.iterator()},sortEdges:function(){this._sorted||(cs.sort(this._outEdges),this._sorted=!0)},remove:function(t){this._outEdges.remove(t)},getEdges:function(){return this.sortEdges(),this._outEdges},getNextCWEdge:function(t){var e=this.getIndex(t);return this._outEdges.get(this.getIndex(e-1))},getIndex:function(){if(arguments[0]instanceof hr){var t=arguments[0];this.sortEdges();for(n=0;n<this._outEdges.size();n++)if((i=this._outEdges.get(n)).getEdge()===t)return n;return-1}if(arguments[0]instanceof lr){var e=arguments[0];this.sortEdges();for(var n=0;n<this._outEdges.size();n++){var i=this._outEdges.get(n);if(i===e)return n}return-1}if(Number.isInteger(arguments[0])){var r=arguments[0]%this._outEdges.size();return r<0&&(r+=this._outEdges.size()),r}},add:function(t){this._outEdges.add(t),this._sorted=!1},getDegree:function(){return this._outEdges.size()},interfaces_:function(){return[]},getClass:function(){return fr}}),Ko(gr,ur),Zo(gr.prototype,{isRemoved:function(){return null===this._pt},addOutEdge:function(t){this._deStar.add(t)},getCoordinate:function(){return this._pt},getOutEdges:function(){return this._deStar},remove:function(){if(0===arguments.length)this._pt=null;else if(1===arguments.length){var t=arguments[0];this._deStar.remove(t)}},getIndex:function(t){return this._deStar.getIndex(t)},getDegree:function(){return this._deStar.getDegree()},interfaces_:function(){return[]},getClass:function(){return gr}}),gr.getEdgesBetween=function(t,e){var n=new K(lr.toEdges(t.getOutEdges().getEdges())),i=lr.toEdges(e.getOutEdges().getEdges());return n.retainAll(i),n},Ko(dr,hr),Zo(dr.prototype,{getLine:function(){return this._line},interfaces_:function(){return[]},getClass:function(){return dr}}),Zo(pr.prototype,{find:function(t){return this._nodeMap.get(t)},iterator:function(){return this._nodeMap.values().iterator()},remove:function(t){return this._nodeMap.remove(t)},values:function(){return this._nodeMap.values()},add:function(t){return this._nodeMap.put(t.getCoordinate(),t),t},interfaces_:function(){return[]},getClass:function(){return pr}}),Zo(_r.prototype,{findNodesOfDegree:function(t){for(var e=new E,n=this.nodeIterator();n.hasNext();){var i=n.next();i.getDegree()===t&&e.add(i)}return e},dirEdgeIterator:function(){return this._dirEdges.iterator()},edgeIterator:function(){return this._edges.iterator()},remove:function(){if(arguments[0]instanceof hr){var t=arguments[0];this.remove(t.getDirEdge(0)),this.remove(t.getDirEdge(1)),this._edges.remove(t),t.remove()}else if(arguments[0]instanceof lr){var e=arguments[0];null!==(o=e.getSym())&&o.setSym(null),e.getFromNode().remove(e),e.remove(),this._dirEdges.remove(e)}else if(arguments[0]instanceof gr){for(var n=arguments[0],i=n.getOutEdges().getEdges().iterator();i.hasNext();){var r=i.next(),o=r.getSym();null!==o&&this.remove(o),this._dirEdges.remove(r);var s=r.getEdge();null!==s&&this._edges.remove(s)}this._nodeMap.remove(n.getCoordinate()),n.remove()}},findNode:function(t){return this._nodeMap.find(t)},getEdges:function(){return this._edges},nodeIterator:function(){return this._nodeMap.iterator()},contains:function(){if(arguments[0]instanceof hr){var t=arguments[0];return this._edges.contains(t)}if(arguments[0]instanceof lr){var e=arguments[0];return this._dirEdges.contains(e)}},add:function(){if(arguments[0]instanceof gr){var t=arguments[0];this._nodeMap.add(t)}else if(arguments[0]instanceof hr){var e=arguments[0];this._edges.add(e),this.add(e.getDirEdge(0)),this.add(e.getDirEdge(1))}else if(arguments[0]instanceof lr){var n=arguments[0];this._dirEdges.add(n)}},getNodes:function(){return this._nodeMap.values()},interfaces_:function(){return[]},getClass:function(){return _r}}),Ko(vr,_r),Zo(vr.prototype,{addEdge:function(t){if(t.isEmpty())return null;var e=V.removeRepeatedPoints(t.getCoordinates());if(e.length<=1)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new cr(r,o,e[1],!0),a=new cr(o,r,e[e.length-2],!1),u=new dr(t);u.setDirectedEdges(s,a),this.add(u)},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new gr(t),this.add(e)),e},interfaces_:function(){return[]},getClass:function(){return vr}}),Zo(mr.prototype,{buildEdgeStringsForUnprocessedNodes:function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next();e.isMarked()||(f.isTrue(2===e.getDegree()),this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}},buildEdgeStringsForNonDegree2Nodes:function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next();2!==e.getDegree()&&(this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}},buildEdgeStringsForObviousStartNodes:function(){this.buildEdgeStringsForNonDegree2Nodes()},getMergedLineStrings:function(){return this.merge(),this._mergedLineStrings},buildEdgeStringsStartingAt:function(t){for(var e=t.getOutEdges().iterator();e.hasNext();){var n=e.next();n.getEdge().isMarked()||this._edgeStrings.add(this.buildEdgeStringStartingWith(n))}},merge:function(){if(null!==this._mergedLineStrings)return null;ur.setMarked(this._graph.nodeIterator(),!1),ur.setMarked(this._graph.edgeIterator(),!1),this._edgeStrings=new E,this.buildEdgeStringsForObviousStartNodes(),this.buildEdgeStringsForIsolatedLoops(),this._mergedLineStrings=new E;for(var t=this._edgeStrings.iterator();t.hasNext();){var e=t.next();this._mergedLineStrings.add(e.toLineString())}},buildEdgeStringStartingWith:function(t){var e=new ar(this._factory),n=t;do{e.add(n),n.getEdge().setMarked(!0),n=n.getNext()}while(null!==n&&n!==t);return e},add:function(){if(arguments[0]instanceof q)arguments[0].apply({interfaces_:function(){return[G]},filter:function(t){t instanceof wt&&this.add(t)}});else if($o(arguments[0],_)){var t=arguments[0];this._mergedLineStrings=null;for(var e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}}else if(arguments[0]instanceof wt){var i=arguments[0];null===this._factory&&(this._factory=i.getFactory()),this._graph.addEdge(i)}},buildEdgeStringsForIsolatedLoops:function(){this.buildEdgeStringsForUnprocessedNodes()},interfaces_:function(){return[]},getClass:function(){return mr}}),Ko(yr,lr),Zo(yr.prototype,{getNext:function(){return this._next},isInRing:function(){return null!==this._edgeRing},setRing:function(t){this._edgeRing=t},setLabel:function(t){this._label=t},getLabel:function(){return this._label},setNext:function(t){this._next=t},getRing:function(){return this._edgeRing},interfaces_:function(){return[]},getClass:function(){return yr}}),Ko(xr,hr),Zo(xr.prototype,{getLine:function(){return this._line},interfaces_:function(){return[]},getClass:function(){return xr}}),Zo(Er.prototype,{visitInteriorRing:function(t,e){var n=t.getCoordinates(),i=n[0],r=Er.findDifferentPoint(n,i),o=e.findEdgeInSameDirection(i,r),s=e.findEdgeEnd(o),a=null;s.getLabel().getLocation(0,Ke.RIGHT)===N.INTERIOR?a=s:s.getSym().getLabel().getLocation(0,Ke.RIGHT)===N.INTERIOR&&(a=s.getSym()),f.isTrue(null!==a,"unable to find dirEdge with Interior on RHS"),this.visitLinkedDirectedEdges(a)},visitShellInteriors:function(t,e){if(t instanceof Nt){r=t;this.visitInteriorRing(r.getExteriorRing(),e)}if(t instanceof Mt)for(var n=t,i=0;i<n.getNumGeometries();i++){var r=n.getGeometryN(i);this.visitInteriorRing(r.getExteriorRing(),e)}},getCoordinate:function(){return this._disconnectedRingcoord},setInteriorEdgesInResult:function(t){for(var e=t.getEdgeEnds().iterator();e.hasNext();){var n=e.next();n.getLabel().getLocation(0,Ke.RIGHT)===N.INTERIOR&&n.setInResult(!0)}},visitLinkedDirectedEdges:function(t){var e=t,n=t;do{f.isTrue(null!==n,"found null Directed Edge"),n.setVisited(!0),n=n.getNext()}while(n!==e)},buildEdgeRings:function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&null===i.getEdgeRing()){var r=new nn(i,this._geometryFactory);r.linkDirectedEdgesForMinimalEdgeRings();var o=r.buildMinimalRings();e.addAll(o)}}return e},hasUnvisitedShellEdge:function(t){for(var e=0;e<t.size();e++){var n=t.get(e);if(!n.isHole()){var i=n.getEdges(),r=i.get(0);if(r.getLabel().getLocation(0,Ke.RIGHT)===N.INTERIOR)for(var o=0;o<i.size();o++)if(!(r=i.get(o)).isVisited())return this._disconnectedRingcoord=r.getCoordinate(),!0}}return!1},isInteriorsConnected:function(){var t=new E;this._geomGraph.computeSplitEdges(t);var e=new cn(new mn);e.addEdges(t),this.setInteriorEdgesInResult(e),e.linkResultDirectedEdges();var n=this.buildEdgeRings(e.getEdgeEnds());return this.visitShellInteriors(this._geomGraph.getGeometry(),e),!this.hasUnvisitedShellEdge(n)},interfaces_:function(){return[]},getClass:function(){return Er}}),Er.findDifferentPoint=function(t,e){for(var n=0;n<t.length;n++)if(!t[n].equals(e))return t[n];return null},Zo(wr.prototype,{createEdgeEndForNext:function(t,e,n,i){var r=n.segmentIndex+1;if(r>=t.getNumPoints()&&null===i)return null;var o=t.getCoordinate(r);null!==i&&i.segmentIndex===n.segmentIndex&&(o=i.coord);var s=new an(t,n.coord,o,new $e(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 $e(t.getLabel());s.flip();var a=new an(t,n.coord,o,s);e.add(a)},computeEdgeEnds:function(){if(1===arguments.length){for(var t=arguments[0],e=new E,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 wr}}),Ko(br,an),Zo(br.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();)(o=r.next().getLabel().getLocation(t))===N.BOUNDARY&&n++,o===N.INTERIOR&&(i=!0);var o=N.NONE;i&&(o=N.INTERIOR),n>0&&(o=Bn.determineBoundary(e,n)),this._label.setLocation(t,o)},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===N.INTERIOR)return this._label.setLocation(t,e,N.INTERIOR),null;r===N.EXTERIOR&&this._label.setLocation(t,e,N.EXTERIOR)}}},getLabel:function(){return this._label},computeLabelSides:function(t){this.computeLabelSide(t,Ke.LEFT),this.computeLabelSide(t,Ke.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 $e(N.NONE,N.NONE,N.NONE):new $e(N.NONE);for(var i=0;i<2;i++)this.computeLabelOn(i,t),e&&this.computeLabelSides(i)},interfaces_:function(){return[]},getClass:function(){return br}}),Ko(Ir,_n),Zo(Ir.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 br(t),this.insertEdgeEnd(t,e)):e.insert(t)},interfaces_:function(){return[]},getClass:function(){return Ir}}),Ko(Cr,on),Zo(Cr.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 Cr}}),Ko(Nr,ln),Zo(Nr.prototype,{createNode:function(t){return new Cr(t,new Ir)},interfaces_:function(){return[]},getClass:function(){return Nr}}),Zo(Sr.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 wr).computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(e)},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===N.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,N.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Sr}}),Zo(Lr.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().getEdges().iterator();e.hasNext();){var n=e.next();if(n.getEdgeEnds().size()>1)return this._invalidPoint=n.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 Lr}}),Zo(Mr.prototype,{buildIndex:function(){this._index=new Me;for(var t=0;t<this._rings.size();t++){var e=this._rings.get(t),n=e.getEnvelopeInternal();this._index.insert(n,e)}},getNestedPoint:function(){return this._nestedPt},isNonNested:function(){this.buildIndex();for(var t=0;t<this._rings.size();t++)for(var e=this._rings.get(t),n=e.getCoordinates(),i=this._index.query(e.getEnvelopeInternal()),r=0;r<i.size();r++){var o=i.get(r),s=o.getCoordinates();if(e!==o&&e.getEnvelopeInternal().intersects(o.getEnvelopeInternal())){var a=Rr.findPtNotNode(n,o,this._graph);if(null!==a&&Qt.isPointInRing(a,s))return this._nestedPt=a,!1}}return!0},add:function(t){this._rings.add(t),this._totalEnv.expandToInclude(t.getEnvelopeInternal())},interfaces_:function(){return[]},getClass:function(){return Mr}}),Zo(Pr.prototype,{getErrorType:function(){return this._errorType},getMessage:function(){return Pr.errMsg[this._errorType]},getCoordinate:function(){return this._pt},toString:function(){var t="";return null!==this._pt&&(t=" at or near point "+this._pt),this.getMessage()+t},interfaces_:function(){return[]},getClass:function(){return Pr}}),Pr.ERROR=0,Pr.REPEATED_POINT=1,Pr.HOLE_OUTSIDE_SHELL=2,Pr.NESTED_HOLES=3,Pr.DISCONNECTED_INTERIOR=4,Pr.SELF_INTERSECTION=5,Pr.RING_SELF_INTERSECTION=6,Pr.NESTED_SHELLS=7,Pr.DUPLICATE_RINGS=8,Pr.TOO_FEW_POINTS=9,Pr.INVALID_COORDINATE=10,Pr.RING_NOT_CLOSED=11,Pr.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"],Zo(Rr.prototype,{checkInvalidCoordinates:function(){if(arguments[0]instanceof Array){for(var t=arguments[0],e=0;e<t.length;e++)if(!Rr.isValid(t[e]))return this._validErr=new Pr(Pr.INVALID_COORDINATE,t[e]),null}else if(arguments[0]instanceof Nt){var n=arguments[0];if(this.checkInvalidCoordinates(n.getExteriorRing().getCoordinates()),null!==this._validErr)return null;for(e=0;e<n.getNumInteriorRing();e++)if(this.checkInvalidCoordinates(n.getInteriorRingN(e).getCoordinates()),null!==this._validErr)return null}},checkHolesNotNested:function(t,e){for(var n=new Mr(e),i=0;i<t.getNumInteriorRing();i++){var r=t.getInteriorRingN(i);n.add(r)}n.isNonNested()||(this._validErr=new Pr(Pr.NESTED_HOLES,n.getNestedPoint()))},checkConsistentArea:function(t){var e=new Lr(t);if(!e.isNodeConsistentArea())return this._validErr=new Pr(Pr.SELF_INTERSECTION,e.getInvalidPoint()),null;e.hasDuplicateRings()&&(this._validErr=new Pr(Pr.DUPLICATE_RINGS,e.getInvalidPoint()))},isValid:function(){return this.checkValid(this._parentGeometry),null===this._validErr},checkShellInsideHole:function(t,e,n){var i=t.getCoordinates(),r=e.getCoordinates(),o=Rr.findPtNotNode(i,e,n);if(null!==o&&!Qt.isPointInRing(o,r))return o;var s=Rr.findPtNotNode(r,t,n);return null!==s?Qt.isPointInRing(s,i)?s:null:(f.shouldNeverReachHere("points in shell and hole appear to be equal"),null)},checkNoSelfIntersectingRings:function(t){for(var e=t.getEdgeIterator();e.hasNext();){var n=e.next();if(this.checkNoSelfIntersectingRing(n.getEdgeIntersectionList()),null!==this._validErr)return null}},checkConnectedInteriors:function(t){var e=new Er(t);e.isInteriorsConnected()||(this._validErr=new Pr(Pr.DISCONNECTED_INTERIOR,e.getCoordinate()))},checkNoSelfIntersectingRing:function(t){for(var e=new st,n=!0,i=t.iterator();i.hasNext();){var r=i.next();if(n)n=!1;else{if(e.contains(r.coord))return this._validErr=new Pr(Pr.RING_SELF_INTERSECTION,r.coord),null;e.add(r.coord)}}},checkHolesInShell:function(t,e){for(var n=t.getExteriorRing(),i=new ui(n),r=0;r<t.getNumInteriorRing();r++){var o=t.getInteriorRingN(r),s=Rr.findPtNotNode(o.getCoordinates(),n,e);if(null===s)return null;if(!i.isInside(s))return this._validErr=new Pr(Pr.HOLE_OUTSIDE_SHELL,s),null}},checkTooFewPoints:function(t){if(t.hasTooFewPoints())return this._validErr=new Pr(Pr.TOO_FEW_POINTS,t.getInvalidPoint()),null},getValidationError:function(){return this.checkValid(this._parentGeometry),this._validErr},checkValid:function(){if(arguments[0]instanceof It){var t=arguments[0];this.checkInvalidCoordinates(t.getCoordinates())}else if(arguments[0]instanceof St){var e=arguments[0];this.checkInvalidCoordinates(e.getCoordinates())}else if(arguments[0]instanceof Lt){var n=arguments[0];if(this.checkInvalidCoordinates(n.getCoordinates()),null!==this._validErr)return null;if(this.checkClosedRing(n),null!==this._validErr)return null;u=new Bn(0,n);if(this.checkTooFewPoints(u),null!==this._validErr)return null;var i=new Jt;u.computeSelfNodes(i,!0,!0),this.checkNoSelfIntersectingRings(u)}else if(arguments[0]instanceof wt){var r=arguments[0];if(this.checkInvalidCoordinates(r.getCoordinates()),null!==this._validErr)return null;u=new Bn(0,r);this.checkTooFewPoints(u)}else if(arguments[0]instanceof Nt){var o=arguments[0];if(this.checkInvalidCoordinates(o),null!==this._validErr)return null;if(this.checkClosedRings(o),null!==this._validErr)return null;u=new Bn(0,o);if(this.checkTooFewPoints(u),null!==this._validErr)return null;if(this.checkConsistentArea(u),null!==this._validErr)return null;if(!this._isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(u),null!==this._validErr))return null;if(this.checkHolesInShell(o,u),null!==this._validErr)return null;if(this.checkHolesNotNested(o,u),null!==this._validErr)return null;this.checkConnectedInteriors(u)}else if(arguments[0]instanceof Mt){for(var s=arguments[0],a=0;a<s.getNumGeometries();a++){l=s.getGeometryN(a);if(this.checkInvalidCoordinates(l),null!==this._validErr)return null;if(this.checkClosedRings(l),null!==this._validErr)return null}var u=new Bn(0,s);if(this.checkTooFewPoints(u),null!==this._validErr)return null;if(this.checkConsistentArea(u),null!==this._validErr)return null;if(!this._isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(u),null!==this._validErr))return null;for(a=0;a<s.getNumGeometries();a++){l=s.getGeometryN(a);if(this.checkHolesInShell(l,u),null!==this._validErr)return null}for(a=0;a<s.getNumGeometries();a++){var l=s.getGeometryN(a);if(this.checkHolesNotNested(l,u),null!==this._validErr)return null}if(this.checkShellsNotNested(s,u),null!==this._validErr)return null;this.checkConnectedInteriors(u)}else if(arguments[0]instanceof ht)for(var c=arguments[0],a=0;a<c.getNumGeometries();a++){var h=c.getGeometryN(a);if(this.checkValid(h),null!==this._validErr)return null}else if(arguments[0]instanceof q){var f=arguments[0];if(this._validErr=null,f.isEmpty())return null;if(f instanceof It)this.checkValid(f);else if(f instanceof St)this.checkValid(f);else if(f instanceof Lt)this.checkValid(f);else if(f instanceof wt)this.checkValid(f);else if(f instanceof Nt)this.checkValid(f);else if(f instanceof Mt)this.checkValid(f);else{if(!(f instanceof ht))throw new UnsupportedOperationException(f.getClass().getName());this.checkValid(f)}}},setSelfTouchingRingFormingHoleValid:function(t){this._isSelfTouchingRingFormingHoleValid=t},checkShellNotNested:function(t,e,n){var i=t.getCoordinates(),r=e.getExteriorRing(),o=r.getCoordinates(),s=Rr.findPtNotNode(i,r,n);if(null===s)return null;if(!Qt.isPointInRing(s,o))return null;if(e.getNumInteriorRing()<=0)return this._validErr=new Pr(Pr.NESTED_SHELLS,s),null;for(var a=null,u=0;u<e.getNumInteriorRing();u++){var l=e.getInteriorRingN(u);if(null===(a=this.checkShellInsideHole(t,l,n)))return null}this._validErr=new Pr(Pr.NESTED_SHELLS,a)},checkClosedRings:function(t){if(this.checkClosedRing(t.getExteriorRing()),null!==this._validErr)return null;for(var e=0;e<t.getNumInteriorRing();e++)if(this.checkClosedRing(t.getInteriorRingN(e)),null!==this._validErr)return null},checkClosedRing:function(t){if(!t.isClosed()){var e=null;t.getNumPoints()>=1&&(e=t.getCoordinateN(0)),this._validErr=new Pr(Pr.RING_NOT_CLOSED,e)}},checkShellsNotNested:function(t,e){for(var n=0;n<t.getNumGeometries();n++)for(var i=t.getGeometryN(n).getExteriorRing(),r=0;r<t.getNumGeometries();r++)if(n!==r){var o=t.getGeometryN(r);if(this.checkShellNotNested(i,o,e),null!==this._validErr)return null}},interfaces_:function(){return[]},getClass:function(){return Rr}}),Rr.findPtNotNode=function(t,e,n){for(var i=n.findEdge(e).getEdgeIntersectionList(),r=0;r<t.length;r++){var o=t[r];if(!i.isIntersection(o))return o}return null},Rr.isValid=function(){if(arguments[0]instanceof q)return new Rr(arguments[0]).isValid();if(arguments[0]instanceof g){var t=arguments[0];return!o.isNaN(t.x)&&(!o.isInfinite(t.x)&&(!o.isNaN(t.y)&&!o.isInfinite(t.y)))}},Zo(Or.prototype,{isIncluded:function(){return this._isIncluded},getCoordinates:function(){if(null===this._ringPts){for(var t=new w,e=this._deList.iterator();e.hasNext();){var n=e.next(),i=n.getEdge();Or.addEdge(i.getLine().getCoordinates(),n.getEdgeDirection(),t)}this._ringPts=t.toCoordinateArray()}return this._ringPts},isIncludedSet:function(){return this._isIncludedSet},isValid:function(){return this.getCoordinates(),!(this._ringPts.length<=3)&&(this.getRing(),Rr.isValid(this._ring))},build:function(t){var e=t;do{this.add(e),e.setRing(this),e=e.getNext(),f.isTrue(null!==e,"found null DE in ring"),f.isTrue(e===t||!e.isInRing(),"found DE already in ring")}while(e!==t)},isOuterHole:function(){return!!this._isHole&&!this.hasShell()},getPolygon:function(){var t=null;if(null!==this._holes){t=new Array(this._holes.size()).fill(null);for(var e=0;e<this._holes.size();e++)t[e]=this._holes.get(e)}return this._factory.createPolygon(this._ring,t)},isHole:function(){return this._isHole},isProcessed:function(){return this._isProcessed},addHole:function(){if(arguments[0]instanceof Lt){var t=arguments[0];null===this._holes&&(this._holes=new E),this._holes.add(t)}else if(arguments[0]instanceof Or){var e=arguments[0];e.setShell(this);var n=e.getRing();null===this._holes&&(this._holes=new E),this._holes.add(n)}},setIncluded:function(t){this._isIncluded=t,this._isIncludedSet=!0},getOuterHole:function(){if(this.isHole())return null;for(var t=0;t<this._deList.size();t++){var e=this._deList.get(t).getSym().getRing();if(e.isOuterHole())return e}return null},computeHole:function(){var t=this.getRing();this._isHole=Qt.isCCW(t.getCoordinates())},hasShell:function(){return null!==this._shell},isOuterShell:function(){return null!==this.getOuterHole()},getLineString:function(){return this.getCoordinates(),this._factory.createLineString(this._ringPts)},toString:function(){return Ht.toLineString(new Dt(this.getCoordinates()))},getShell:function(){return this.isHole()?this._shell:this},add:function(t){this._deList.add(t)},getRing:function(){if(null!==this._ring)return this._ring;this.getCoordinates(),this._ringPts.length<3&&A.out.println(this._ringPts);try{this._ring=this._factory.createLinearRing(this._ringPts)}catch(t){if(!(t instanceof I))throw t;A.out.println(this._ringPts)}return this._ring},updateIncluded:function(){if(this.isHole())return null;for(var t=0;t<this._deList.size();t++){var e=this._deList.get(t).getSym().getRing().getShell();if(null!==e&&e.isIncludedSet())return this.setIncluded(!e.isIncluded()),null}},setShell:function(t){this._shell=t},setProcessed:function(t){this._isProcessed=t},interfaces_:function(){return[]},getClass:function(){return Or}}),Or.findDirEdgesInRing=function(t){var e=t,n=new E;do{n.add(e),e=e.getNext(),f.isTrue(null!==e,"found null DE in ring"),f.isTrue(e===t||!e.isInRing(),"found DE already in ring")}while(e!==t);return n},Or.addEdge=function(t,e,n){if(e)for(i=0;i<t.length;i++)n.add(t[i],!1);else for(var i=t.length-1;i>=0;i--)n.add(t[i],!1)},Or.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=V.ptNotInList(n.getCoordinates(),l.getCoordinates());var h=!1;Qt.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(s=(o=u).getRing().getEnvelopeInternal())}}return o},Zo(Tr.prototype,{compare:function(t,e){var n=e;return t.getRing().getEnvelope().compareTo(n.getRing().getEnvelope())},interfaces_:function(){return[u]},getClass:function(){return Tr}}),Or.EnvelopeComparator=Tr,Ko(Ar,_r),Zo(Ar.prototype,{findEdgeRing:function(t){var e=new Or(this._factory);return e.build(t),e},computeDepthParity:function(){if(0===arguments.length)for(;;){return null}else arguments.length},computeNextCWEdges:function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();Ar.computeNextCWEdges(e)}},addEdge:function(t){if(t.isEmpty())return null;var e=V.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 yr(r,o,e[1],!0),a=new yr(o,r,e[e.length-2],!1),u=new xr(t);u.setDirectedEdges(s,a),this.add(u)},deleteCutEdges:function(){this.computeNextCWEdges(),Ar.findLabeledEdgeRings(this._dirEdges);for(var t=new E,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(),Ar.label(this._dirEdges,-1);var t=Ar.findLabeledEdgeRings(this._dirEdges);this.convertMaximalToMinimalEdgeRings(t);for(var e=new E,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 gr(t),this.add(e)),e},convertMaximalToMinimalEdgeRings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel(),r=Ar.findIntersectionNodes(n,i);if(null!==r)for(var o=r.iterator();o.hasNext();){var s=o.next();Ar.computeNextCCWEdges(s,i)}}},deleteDangles:function(){for(var t=this.findNodesOfDegree(1),e=new K,n=new ie,i=t.iterator();i.hasNext();)n.push(i.next());for(;!n.isEmpty();){var r=n.pop();Ar.deleteAllEdges(r);for(i=r.getOutEdges().getEdges().iterator();i.hasNext();){var o=i.next();o.setMarked(!0);var s=o.getSym();null!==s&&s.setMarked(!0);var a=o.getEdge();e.add(a.getLine());var u=o.getToNode();1===Ar.getDegreeNonDeleted(u)&&n.push(u)}}return e},interfaces_:function(){return[]},getClass:function(){return Ar}}),Ar.findLabeledEdgeRings=function(t){for(var e=new E,n=1,i=t.iterator();i.hasNext();){var r=i.next();if(!r.isMarked()&&!(r.getLabel()>=0)){e.add(r);var o=Or.findDirEdgesInRing(r);Ar.label(o,n),n++}}return e},Ar.getDegreeNonDeleted=function(t){for(var e=0,n=t.getOutEdges().getEdges().iterator();n.hasNext();)n.next().isMarked()||e++;return e},Ar.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges().iterator();e.hasNext();){var n=e.next();n.setMarked(!0);var i=n.getSym();null!==i&&i.setMarked(!0)}},Ar.label=function(t,e){for(var n=t.iterator();n.hasNext();)n.next().setLabel(e)},Ar.computeNextCWEdges=function(t){for(var e=null,n=null,i=t.getOutEdges().getEdges().iterator();i.hasNext();){var r=i.next();r.isMarked()||(null===e&&(e=r),null!==n&&(o=n.getSym()).setNext(r),n=r)}if(null!==n){var o=n.getSym();o.setNext(e)}},Ar.computeNextCCWEdges=function(t,e){for(var n=null,i=null,r=t.getOutEdges().getEdges(),o=r.size()-1;o>=0;o--){var s=r.get(o),a=s.getSym(),u=null;s.getLabel()===e&&(u=s);var l=null;a.getLabel()===e&&(l=a),null===u&&null===l||(null!==l&&(i=l),null!==u&&(null!==i&&(i.setNext(u),i=null),null===n&&(n=u)))}null!==i&&(f.isTrue(null!==n),i.setNext(n))},Ar.getDegree=function(t,e){for(var n=0,i=t.getOutEdges().getEdges().iterator();i.hasNext();)i.next().getLabel()===e&&n++;return n},Ar.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();Ar.getDegree(r,e)>1&&(null===i&&(i=new E),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},Zo(Dr.prototype,{getGeometry:function(){return null===this._geomFactory&&(this._geomFactory=new Vt),this.polygonize(),this._extractOnlyPolygonal?this._geomFactory.buildGeometry(this._polyList):this._geomFactory.createGeometryCollection(Vt.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 E,null===this._graph)return null;this._dangles=this._graph.deleteDangles(),this._cutEdges=this._graph.deleteCutEdges();var t=this._graph.getEdgeRings(),e=new E;this._invalidRingLines=new E,this._isCheckingRingsValid?this.findValidRings(t,e,this._invalidRingLines):e=t,this.findShellsAndHoles(e),Dr.assignHolesToShells(this._holeList,this._shellList),cs.sort(this._shellList,new Or.EnvelopeComparator);var n=!0;this._extractOnlyPolygonal&&(Dr.findDisjointShells(this._shellList),n=!1),this._polyList=Dr.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($o(arguments[0],_))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.add(e)}else if(arguments[0]instanceof wt){var n=arguments[0];this._geomFactory=n.getFactory(),null===this._graph&&(this._graph=new Ar(this._geomFactory)),this._graph.addEdge(n)}else arguments[0]instanceof q&&arguments[0].apply(this._lineStringAdder)},setCheckRingsValid:function(t){this._isCheckingRingsValid=t},findShellsAndHoles:function(t){this._holeList=new E,this._shellList=new E;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 Dr}}),Dr.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))}},Dr.extractPolygons=function(t,e){for(var n=new E,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Dr.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Dr.assignHoleToShell(i,e)}},Dr.assignHoleToShell=function(t,e){var n=Or.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Dr.findDisjointShells=function(t){Dr.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)},Zo(Fr.prototype,{filter:function(t){t instanceof wt&&this.p.add(t)},interfaces_:function(){return[G]},getClass:function(){return Fr}}),Dr.LineStringAdder=Fr,Zo(Gr.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,N.EXTERIOR)},computeIM:function(){var t=new te;if(t.set(N.EXTERIOR,N.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 wr,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===N.BOUNDARY?s.setLabelBoundary(t):s.setLabel(t,N.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===N.BOUNDARY?s.setLabelBoundary(t):s.getLabel().isNull(t)&&s.setLabel(t,N.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(N.INTERIOR,N.EXTERIOR,e.getDimension()),t.set(N.BOUNDARY,N.EXTERIOR,e.getBoundaryDimension()));var n=this._arg[1].getGeometry();n.isEmpty()||(t.set(N.EXTERIOR,N.INTERIOR,n.getDimension()),t.set(N.EXTERIOR,N.BOUNDARY,n.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return Gr}}),Zo(qr.prototype,{isContainedInBoundary:function(t){if(t instanceof Nt)return!1;if(t instanceof It)return this.isPointContainedInBoundary(t);if(t instanceof wt)return this.isLineStringContainedInBoundary(t);for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);if(!this.isContainedInBoundary(n))return!1}return!0},isLineSegmentContainedInBoundary:function(t,e){if(t.equals(e))return this.isPointContainedInBoundary(t);if(t.x===e.x){if(t.x===this._rectEnv.getMinX()||t.x===this._rectEnv.getMaxX())return!0}else if(t.y===e.y&&(t.y===this._rectEnv.getMinY()||t.y===this._rectEnv.getMaxY()))return!0;return!1},isLineStringContainedInBoundary:function(t){for(var e=t.getCoordinateSequence(),n=new g,i=new g,r=0;r<e.size()-1;r++)if(e.getCoordinate(r,n),e.getCoordinate(r+1,i),!this.isLineSegmentContainedInBoundary(n,i))return!1;return!0},isPointContainedInBoundary:function(){if(arguments[0]instanceof It){var t=arguments[0];return this.isPointContainedInBoundary(t.getCoordinate())}if(arguments[0]instanceof g){var e=arguments[0];return e.x===this._rectEnv.getMinX()||e.x===this._rectEnv.getMaxX()||e.y===this._rectEnv.getMinY()||e.y===this._rectEnv.getMaxY()}},contains:function(t){return!!this._rectEnv.contains(t.getEnvelopeInternal())&&!this.isContainedInBoundary(t)},interfaces_:function(){return[]},getClass:function(){return qr}}),qr.contains=function(t,e){return new qr(t).contains(e)},Zo(kr.prototype,{intersects:function(t,e){var n=new b(t,e);if(!this._rectEnv.intersects(n))return!1;if(this._rectEnv.intersects(t))return!0;if(this._rectEnv.intersects(e))return!0;if(t.compareTo(e)>0){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}}),Zo(Br.prototype,{applyTo:function(t){for(var e=0;e<t.getNumGeometries()&&!this._isDone;e++){var n=t.getGeometryN(e);if(n instanceof ht)this.applyTo(n);else if(this.visit(n),this.isDone())return this._isDone=!0,null}},interfaces_:function(){return[]},getClass:function(){return Br}}),Zo(jr.prototype,{intersects:function(t){if(!this._rectEnv.intersects(t.getEnvelopeInternal()))return!1;var e=new zr(this._rectEnv);if(e.applyTo(t),e.intersects())return!0;var n=new Yr(this._rectangle);if(n.applyTo(t),n.containsPoint())return!0;var i=new Xr(this._rectangle);return i.applyTo(t),!!i.intersects()},interfaces_:function(){return[]},getClass:function(){return jr}}),jr.intersects=function(t,e){return new jr(t).intersects(e)},Ko(zr,Br),Zo(zr.prototype,{isDone:function(){return!0===this._intersects},visit:function(t){var e=t.getEnvelopeInternal();return this._rectEnv.intersects(e)?this._rectEnv.contains(e)?(this._intersects=!0,null):e.getMinX()>=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 zr}}),Ko(Yr,Br),Zo(Yr.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(t){if(!(t instanceof Nt))return null;var e=t.getEnvelopeInternal();if(!this._rectEnv.intersects(e))return null;for(var n=new g,i=0;i<4;i++)if(this._rectSeq.getCoordinate(i,n),e.contains(n)&&pn.containsPointInPolygon(n,t))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return Yr}}),Ko(Xr,Br),Zo(Xr.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=Mn.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<e.size();n++)if(e.getCoordinate(n-1,this._p0),e.getCoordinate(n,this._p1),this._rectIntersector.intersects(this._p0,this._p1))return this._hasIntersection=!0,null},interfaces_:function(){return[]},getClass:function(){return Xr}}),Ko(Vr,jn),Zo(Vr.prototype,{getIntersectionMatrix:function(){return this._relate.computeIM()},interfaces_:function(){return[]},getClass:function(){return Vr}}),Vr.covers=function(t,e){return!!t.getEnvelopeInternal().covers(e.getEnvelopeInternal())&&(!!t.isRectangle()||Vr.relate(t,e).isCovers())},Vr.intersects=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&(t.isRectangle()?jr.intersects(t,e):e.isRectangle()?jr.intersects(e,t):Vr.relate(t,e).isIntersects())},Vr.touches=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&Vr.relate(t,e).isTouches(t.getDimension(),e.getDimension())},Vr.within=function(t,e){return e.contains(t)},Vr.coveredBy=function(t,e){return Vr.covers(e,t)},Vr.relate=function(){if(2===arguments.length)return r=(i=new Vr(arguments[0],arguments[1])).getIntersectionMatrix();if(3===arguments.length){if("string"==typeof arguments[2]&&arguments[0]instanceof q&&arguments[1]instanceof q){var t=arguments[0],e=arguments[1],n=arguments[2];return Vr.relateWithCheck(t,e).matches(n)}if($o(arguments[2],B)&&arguments[0]instanceof q&&arguments[1]instanceof q){var i=new Vr(arguments[0],arguments[1],arguments[2]),r=i.getIntersectionMatrix();return r}}},Vr.overlaps=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&Vr.relate(t,e).isOverlaps(t.getDimension(),e.getDimension())},Vr.disjoint=function(t,e){return!t.intersects(e)},Vr.relateWithCheck=function(t,e){return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Vr.relate(t,e)},Vr.crosses=function(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&Vr.relate(t,e).isCrosses(t.getDimension(),e.getDimension())},Vr.contains=function(t,e){return!!t.getEnvelopeInternal().contains(e.getEnvelopeInternal())&&(t.isRectangle()?qr.contains(t,e):Vr.relate(t,e).isContains())},Zo(Ur.prototype,{extractElements:function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);this._skipEmpty&&i.isEmpty()||e.add(i)}},combine:function(){for(var t=new E,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},interfaces_:function(){return[]},getClass:function(){return Ur}}),Ur.combine=function(){if(1===arguments.length)return(o=new Ur(arguments[0])).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return(o=new Ur(Ur.createList(t,e))).combine()}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new Ur(Ur.createList(n,i,r));return o.combine()}},Ur.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ur.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return(o=new E).add(t),o.add(e),o}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new E;return o.add(n),o.add(i),o.add(r),o}},Zo(Hr.prototype,{reduceToGeometries:function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next(),r=null;$o(i,m)?r=this.unionTree(i):i instanceof q&&(r=i),e.add(r)}return e},extractByEnvelope:function(t,e,n){for(var i=new E,r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},unionOptimized:function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i))return Ur.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var r=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,r)},union:function(){if(null===this._inputPolys)throw new IllegalStateException("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Me(Hr.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree();return this.unionTree(i)},binaryUnion:function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){o=Hr.getGeometry(e,n);return this.unionSafe(o,null)}if(i-n==2)return this.unionSafe(Hr.getGeometry(e,n),Hr.getGeometry(e,n+1));var r=Math.trunc((i+n)/2),o=this.binaryUnion(e,n,r),s=this.binaryUnion(e,r,i);return this.unionSafe(o,s)}},repeatedUnion:function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e=null===e?i.copy():e.union(i)}return e},unionSafe:function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},unionActual:function(t,e){return Hr.restrictToPolygons(t.union(e))},unionTree:function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},unionUsingEnvelopeIntersection:function(t,e,n){var i=new E,r=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),s=this.unionActual(r,o);return i.add(s),Ur.combine(i)},bufferUnion:function(){if(1===arguments.length){var t=arguments[0];return o=(r=(i=t.get(0).getFactory()).buildGeometry(t)).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=e.getFactory(),r=i.createGeometryCollection([e,n]),o=r.buffer(0);return o}},interfaces_:function(){return[]},getClass:function(){return Hr}}),Hr.restrictToPolygons=function(t){if($o(t,Ct))return t;var e=nr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(Vt.toPolygonArray(e))},Hr.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Hr.union=function(t){return new Hr(t).union()},Hr.STRTREE_NODE_CAPACITY=4,Zo(Wr.prototype,{union:function(){for(var t=new _e,e=new st,n=0;n<this._pointGeom.getNumGeometries();n++){var i=this._pointGeom.getGeometryN(n).getCoordinate();t.locate(i,this._otherGeom)===N.EXTERIOR&&e.add(i)}if(0===e.size())return this._otherGeom;var r=null,o=V.toCoordinateArray(e);return r=1===o.length?this._geomFact.createPoint(o[0]):this._geomFact.createMultiPointFromCoords(o),Ur.combine(r,this._otherGeom)},interfaces_:function(){return[]},getClass:function(){return Wr}}),Wr.union=function(t,e){return new Wr(t,e).union()},Zo(Jr.prototype,{filter:function(t){-1!==this._sortIndex&&t.getSortIndex()!==this._sortIndex||this._comps.add(t)},interfaces_:function(){return[lt]},getClass:function(){return Jr}}),Jr.extract=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return Jr.extract(t,e,new E)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];return n.getSortIndex()===i?r.add(n):n instanceof ht&&n.apply(new Jr(i,r)),r}},Zo(Zr.prototype,{unionNoOpt:function(t){var e=this._geomFact.createPoint();return Un.overlayOp(t,e,Xn.UNION)},unionWithNull:function(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)},extract:function(){if($o(arguments[0],_))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.extract(e)}else if(arguments[0]instanceof q){var n=arguments[0];null===this._geomFact&&(this._geomFact=n.getFactory()),Jr.extract(n,q.SORTINDEX_POLYGON,this._polygons),Jr.extract(n,q.SORTINDEX_LINESTRING,this._lines),Jr.extract(n,q.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=Hr.union(this._polygons));var o=this.unionWithNull(n,r),s=null;return s=null===t?o:null===o?t:Wr.union(t,o),null===s?this._geomFact.createGeometryCollection():s},interfaces_:function(){return[]},getClass:function(){return Zr}}),Zr.union=function(){if(1===arguments.length){if($o(arguments[0],_))return(t=new Zr(arguments[0])).union();if(arguments[0]instanceof q)return(t=new Zr(arguments[0])).union()}else if(2===arguments.length){var t=new Zr(arguments[0],arguments[1]);return t.union()}},Zo(Kr.prototype,{extractElements:function(t,e,n){for(var i=new E,r=0;r<t.getNumGeometries();r++){var o=t.getGeometryN(r);e[r]===n&&i.add(o)}return this._geomFactory.buildGeometry(i)},computeInteracting:function(){if(0===arguments.length)for(i=0;i<this._g0.getNumGeometries();i++){var t=this._g0.getGeometryN(i);this._interacts0[i]=this.computeInteracting(t)}else if(1===arguments.length){for(var e=arguments[0],n=!1,i=0;i<this._g1.getNumGeometries();i++){var r=this._g1.getGeometryN(i).getEnvelopeInternal().intersects(e.getEnvelopeInternal());r&&(this._interacts1[i]=!0),r&&(n=!0)}return n}},union:function(){this.computeInteracting();var t=this.extractElements(this._g0,this._interacts0,!0),e=this.extractElements(this._g1,this._interacts1,!0);(t.isEmpty()||e.isEmpty())&&A.out.println("found empty!");var n=t.union(e),i=this.extractElements(this._g0,this._interacts0,!1),r=this.extractElements(this._g1,this._interacts1,!1);return Ur.combine(n,i,r)},bufferUnion:function(t,e){return t.getFactory().createGeometryCollection([t,e]).buffer(0)},interfaces_:function(){return[]},getClass:function(){return Kr}}),Kr.union=function(t,e){return new Kr(t,e).union()},Zo(Qr.prototype,{interfaces_:function(){return[]},getClass:function(){return Qr}}),Qr.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Xn.createEmptyResult(Xn.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Un.overlayOp(t,e,Xn.UNION)},Ko($r,Pt.CoordinateOperation),Zo($r.prototype,{editCoordinates:function(t,e){if(0===t.length)return null;for(var n=new Array(t.length).fill(null),i=0;i<t.length;i++){var r=new g(t[i]);this._targetPM.makePrecise(r),n[i]=r}var o=new w(n,!1).toCoordinateArray(),s=0;e instanceof wt&&(s=2),e instanceof Lt&&(s=4);var a=n;return this._removeCollapsed&&(a=null),o.length<s?a:o},interfaces_:function(){return[]},getClass:function(){return $r}}),Zo(to.prototype,{fixPolygonalTopology:function(t){var e=t;this._changePrecisionModel||(e=this.changePM(t,this._targetPM));var n=e.buffer(0),i=n;return this._changePrecisionModel||(i=this.changePM(n,t.getPrecisionModel())),i},reducePointwise:function(t){var e=null;e=this._changePrecisionModel?new Pt(this.createFactory(t.getFactory(),this._targetPM)):new Pt;var n=this._removeCollapsed;return t.getDimension()>=2&&(n=!0),e.edit(t,new $r(this._targetPM,n))},changePM:function(t,e){return this.createEditor(t.getFactory(),e).edit(t,new Pt.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(t){this._removeCollapsed=t},createFactory:function(t,e){return new Vt(e,t.getSRID(),t.getCoordinateSequenceFactory())},setChangePrecisionModel:function(t){this._changePrecisionModel=t},reduce:function(t){var e=this.reducePointwise(t);return this._isPointwise?e:$o(e,Ct)?e.isValid()?e:this.fixPolygonalTopology(e):e},setPointwise:function(t){this._isPointwise=t},createEditor:function(t,e){return t.getPrecisionModel()===e?new Pt:new Pt(this.createFactory(t,e))},interfaces_:function(){return[]},getClass:function(){return to}}),to.reduce=function(t,e){return new to(e).reduce(t)},to.reducePointwise=function(t,e){var n=new to(e);return n.setPointwise(!0),n.reduce(t)},Zo(eo.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;r<e;r++){var o=this._seg.distance(this._pts[r]);o>n&&(n=o,i=r)}if(n<=this._distanceTolerance)for(r=t+1;r<e;r++)this._usePt[r]=!1;else this.simplifySection(t,i),this.simplifySection(i,e)},setDistanceTolerance:function(t){this._distanceTolerance=t},simplify:function(){this._usePt=new Array(this._pts.length).fill(null);for(e=0;e<this._pts.length;e++)this._usePt[e]=!0;this.simplifySection(0,this._pts.length-1);for(var t=new w,e=0;e<this._pts.length;e++)this._usePt[e]&&t.add(new g(this._pts[e]));return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return eo}}),eo.simplify=function(t,e){var n=new eo(t);return n.setDistanceTolerance(e),n.simplify()},Zo(no.prototype,{setEnsureValid:function(t){this._isEnsureValidTopology=t},getResultGeometry:function(){return this._inputGeom.isEmpty()?this._inputGeom.copy():new io(this._isEnsureValidTopology,this._distanceTolerance).transform(this._inputGeom)},setDistanceTolerance:function(t){if(t<0)throw new r("Tolerance must be non-negative");this._distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return no}}),no.simplify=function(t,e){var n=new no(t);return n.setDistanceTolerance(e),n.getResultGeometry()},Ko(io,ae),Zo(io.prototype,{transformPolygon:function(t,e){if(t.isEmpty())return null;var n=ae.prototype.transformPolygon.call(this,t,e);return e instanceof Mt?n:this.createValidArea(n)},createValidArea:function(t){return this._isEnsureValidTopology?t.buffer(0):t},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=null;return i=0===n.length?new Array(0).fill(null):eo.simplify(n,this._distanceTolerance),this._factory.getCoordinateSequenceFactory().create(i)},transformMultiPolygon:function(t,e){var n=ae.prototype.transformMultiPolygon.call(this,t,e);return this.createValidArea(n)},transformLinearRing:function(t,e){var n=e instanceof Nt,i=ae.prototype.transformLinearRing.call(this,t,e);return!n||i instanceof Lt?i:null},interfaces_:function(){return[]},getClass:function(){return io}}),no.DPTransformer=io,Ko(ro,$t),Zo(ro.prototype,{getIndex:function(){return this._index},getParent:function(){return this._parent},interfaces_:function(){return[]},getClass:function(){return ro}}),Zo(oo.prototype,{addToResult:function(t){this._resultSegs.add(t)},asLineString:function(){return this._parentLine.getFactory().createLineString(oo.extractCoordinates(this._resultSegs))},getResultSize:function(){var t=this._resultSegs.size();return 0===t?0:t+1},getParent:function(){return this._parentLine},getSegment:function(t){return this._segs[t]},getParentCoordinates:function(){return this._parentLine.getCoordinates()},getMinimumSize:function(){return this._minimumSize},asLinearRing:function(){return this._parentLine.getFactory().createLinearRing(oo.extractCoordinates(this._resultSegs))},getSegments:function(){return this._segs},init:function(){var t=this._parentLine.getCoordinates();this._segs=new Array(t.length-1).fill(null);for(var e=0;e<t.length-1;e++){var n=new ro(t[e],t[e+1],this._parentLine,e);this._segs[e]=n}},getResultCoordinates:function(){return oo.extractCoordinates(this._resultSegs)},interfaces_:function(){return[]},getClass:function(){return oo}}),oo.extractCoordinates=function(t){for(var e=new Array(t.size()+1).fill(null),n=null,i=0;i<t.size();i++)n=t.get(i),e[i]=n.p0;return e[e.length-1]=n.p1,e},Zo(so.prototype,{remove:function(t){this._index.remove(new b(t.p0,t.p1),t)},add:function(){if(arguments[0]instanceof oo)for(var t=arguments[0].getSegments(),e=0;e<t.length;e++){var n=t[e];this.add(n)}else if(arguments[0]instanceof $t){var i=arguments[0];this._index.insert(new b(i.p0,i.p1),i)}},query:function(t){var e=new b(t.p0,t.p1),n=new ao(t);return this._index.query(e,n),n.getItems()},interfaces_:function(){return[]},getClass:function(){return so}}),Zo(ao.prototype,{visitItem:function(t){var e=t;b.intersects(e.p0,e.p1,this._querySeg.p0,this._querySeg.p1)&&this._items.add(t)},getItems:function(){return this._items},interfaces_:function(){return[be]},getClass:function(){return ao}}),Zo(uo.prototype,{flatten:function(t,e){var n=new $t(this._linePts[t],this._linePts[e]);return this.remove(this._line,t,e),this._outputIndex.add(n),n},hasBadIntersection:function(t,e,n){return!!this.hasBadOutputIntersection(n)||!!this.hasBadInputIntersection(t,e,n)},setDistanceTolerance:function(t){this._distanceTolerance=t},simplifySection:function(t,e,n){n+=1;var i=new Array(2).fill(null);if(t+1===e){u=this._line.getSegment(t);return this._line.addToResult(u),null}var r=!0;this._line.getResultSize()<this._line.getMinimumSize()&&n+1<this._line.getMinimumSize()&&(r=!1);var o=new Array(1).fill(null),s=this.findFurthestPoint(this._linePts,t,e,o);o[0]>this._distanceTolerance&&(r=!1);var a=new $t;if(a.p0=this._linePts[t],a.p1=this._linePts[e],i[0]=t,i[1]=e,this.hasBadIntersection(this._line,i,a)&&(r=!1),r){var u=this.flatten(t,e);return this._line.addToResult(u),null}this.simplifySection(t,s,n),this.simplifySection(s,e,n)},hasBadOutputIntersection:function(t){for(var e=this._outputIndex.query(t).iterator();e.hasNext();){var n=e.next();if(this.hasInteriorIntersection(n,t))return!0}return!1},findFurthestPoint:function(t,e,n,i){var r=new $t;r.p0=t[e],r.p1=t[n];for(var o=-1,s=e,a=e+1;a<n;a++){var u=t[a],l=r.distance(u);l>o&&(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<n;i++){var r=t.getSegment(i);this._inputIndex.remove(r)}},hasInteriorIntersection:function(t,e){return this._li.computeIntersection(t.p0,t.p1,e.p0,e.p1),this._li.isInteriorIntersection()},hasBadInputIntersection:function(t,e,n){for(var i=this._inputIndex.query(n).iterator();i.hasNext();){var r=i.next();if(this.hasInteriorIntersection(r,n)){if(uo.isInLineSection(t,e,r))continue;return!0}}return!1},interfaces_:function(){return[]},getClass:function(){return uo}}),uo.isInLineSection=function(t,e,n){if(n.getParent()!==t.getParent())return!1;var i=n.getIndex();return i>=e[0]&&i<e[1]},Zo(lo.prototype,{setDistanceTolerance:function(t){this._distanceTolerance=t},simplify:function(t){for(e=t.iterator();e.hasNext();)this._inputIndex.add(e.next());for(var e=t.iterator();e.hasNext();){var n=new uo(this._inputIndex,this._outputIndex);n.setDistanceTolerance(this._distanceTolerance),n.simplify(e.next())}},interfaces_:function(){return[]},getClass:function(){return lo}}),Zo(co.prototype,{getResultGeometry:function(){return this._inputGeom.isEmpty()?this._inputGeom.copy():(this._linestringMap=new zt,this._inputGeom.apply(new fo(this)),this._lineSimplifier.simplify(this._linestringMap.values()),new ho(this._linestringMap).transform(this._inputGeom))},setDistanceTolerance:function(t){if(t<0)throw new r("Tolerance must be non-negative");this._lineSimplifier.setDistanceTolerance(t)},interfaces_:function(){return[]},getClass:function(){return co}}),co.simplify=function(t,e){var n=new co(t);return n.setDistanceTolerance(e),n.getResultGeometry()},Ko(ho,ae),Zo(ho.prototype,{transformCoordinates:function(t,e){if(0===t.size())return null;if(e instanceof wt){var n=this._linestringMap.get(e);return this.createCoordinateSequence(n.getResultCoordinates())}return ae.prototype.transformCoordinates.call(this,t,e)},interfaces_:function(){return[]},getClass:function(){return ho}}),Zo(fo.prototype,{filter:function(t){if(t instanceof wt){var e=t;if(e.isEmpty())return null;var n=new oo(e,e.isClosed()?4:2);this.tps._linestringMap.put(e,n)}},interfaces_:function(){return[G]},getClass:function(){return fo}}),co.LineStringTransformer=ho,co.LineStringMapBuilderFilter=fo,Zo(go.prototype,{splitAt:function(){if(1===arguments.length){var t=arguments[0],e=this._minimumLen/this._segLen;if(t.distance(this._seg.p0)<this._minimumLen)return this._splitPt=this._seg.pointAlong(e),null;if(t.distance(this._seg.p1)<this._minimumLen)return this._splitPt=go.pointAlongReverse(this._seg,e),null;this._splitPt=t}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.getConstrainedLength(n)/this._segLen;i.equals2D(this._seg.p0)?this._splitPt=this._seg.pointAlong(r):this._splitPt=go.pointAlongReverse(this._seg,r)}},setMinimumLength:function(t){this._minimumLen=t},getConstrainedLength:function(t){return t<this._minimumLen?this._minimumLen:t},getSplitPoint:function(){return this._splitPt},interfaces_:function(){return[]},getClass:function(){return go}}),go.pointAlongReverse=function(t,e){var n=new g;return n.x=t.p1.x-e*(t.p1.x-t.p0.x),n.y=t.p1.y-e*(t.p1.y-t.p0.y),n},Zo(po.prototype,{findSplitPoint:function(t,e){},interfaces_:function(){return[]},getClass:function(){return po}}),Zo(_o.prototype,{findSplitPoint:function(t,e){var n=t.getLineSegment(),i=n.getLength()/2,r=new go(n),o=_o.projectedSplitPoint(t,e),s=2*o.distance(e)*.8;return s>i&&(s=i),r.setMinimumLength(s),r.splitAt(o),r.getSplitPoint()},interfaces_:function(){return[po]},getClass:function(){return _o}}),_o.projectedSplitPoint=function(t,e){return t.getLineSegment().project(e)},Zo(vo.prototype,{interfaces_:function(){return[]},getClass:function(){return vo}}),vo.triArea=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)},vo.isInCircleDDNormalized=function(t,e,n,i){var r=R.valueOf(t.x).selfSubtract(i.x),o=R.valueOf(t.y).selfSubtract(i.y),s=R.valueOf(e.x).selfSubtract(i.x),a=R.valueOf(e.y).selfSubtract(i.y),u=R.valueOf(n.x).selfSubtract(i.x),l=R.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)),g=r.multiply(r).selfAdd(o.multiply(o)),d=s.multiply(s).selfAdd(a.multiply(a)),p=u.multiply(u).selfAdd(l.multiply(l));return g.selfMultiply(h).selfAdd(d.selfMultiply(f)).selfAdd(p.selfMultiply(c)).doubleValue()>0},vo.checkRobustInCircle=function(t,e,n,i){var r=vo.isInCircleNonRobust(t,e,n,i),o=vo.isInCircleDDSlow(t,e,n,i),s=vo.isInCircleCC(t,e,n,i),a=hi.circumcentre(t,e,n);A.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===o&&r===s||(A.out.println("inCircle robustness failure (double result = "+r+", DD result = "+o+", CC result = "+s+")"),A.out.println(Ht.toLineString(new Dt([t,e,n,i]))),A.out.println("Circumcentre = "+Ht.toPoint(a)+" radius = "+t.distance(a)),A.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)),A.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),A.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),A.out.println())},vo.isInCircleDDFast=function(t,e,n,i){var r=R.sqr(t.x).selfAdd(R.sqr(t.y)).selfMultiply(vo.triAreaDDFast(e,n,i)),o=R.sqr(e.x).selfAdd(R.sqr(e.y)).selfMultiply(vo.triAreaDDFast(t,n,i)),s=R.sqr(n.x).selfAdd(R.sqr(n.y)).selfMultiply(vo.triAreaDDFast(t,e,i)),a=R.sqr(i.x).selfAdd(R.sqr(i.y)).selfMultiply(vo.triAreaDDFast(t,e,n));return r.selfSubtract(o).selfAdd(s).selfSubtract(a).doubleValue()>0},vo.isInCircleCC=function(t,e,n,i){var r=hi.circumcentre(t,e,n),o=t.distance(r);return i.distance(r)-o<=0},vo.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},vo.isInCircleDDSlow=function(t,e,n,i){var r=R.valueOf(i.x),o=R.valueOf(i.y),s=R.valueOf(t.x),a=R.valueOf(t.y),u=R.valueOf(e.x),l=R.valueOf(e.y),c=R.valueOf(n.x),h=R.valueOf(n.y),f=s.multiply(s).add(a.multiply(a)).multiply(vo.triAreaDDSlow(u,l,c,h,r,o)),g=u.multiply(u).add(l.multiply(l)).multiply(vo.triAreaDDSlow(s,a,c,h,r,o)),d=c.multiply(c).add(h.multiply(h)).multiply(vo.triAreaDDSlow(s,a,u,l,r,o)),p=r.multiply(r).add(o.multiply(o)).multiply(vo.triAreaDDSlow(s,a,u,l,c,h));return f.subtract(g).add(d).subtract(p).doubleValue()>0},vo.isInCircleNonRobust=function(t,e,n,i){return(t.x*t.x+t.y*t.y)*vo.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*vo.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*vo.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*vo.triArea(t,e,n)>0},vo.isInCircleRobust=function(t,e,n,i){return vo.isInCircleNormalized(t,e,n,i)},vo.triAreaDDSlow=function(t,e,n,i,r,o){return n.subtract(t).multiply(o.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},vo.triAreaDDFast=function(t,e,n){var i=R.valueOf(e.x).selfSubtract(t.x).selfMultiply(R.valueOf(n.y).selfSubtract(t.y)),r=R.valueOf(e.y).selfSubtract(t.y).selfMultiply(R.valueOf(n.x).selfSubtract(t.x));return i.selfSubtract(r)},Zo(mo.prototype,{circleCenter:function(t,e){var n=new mo(this.getX(),this.getY()),i=new D(this.bisector(n,t),this.bisector(t,e)),r=null;try{r=new mo(i.getX(),i.getY())}catch(i){if(!(i instanceof C))throw i;A.err.println("a: "+n+" b: "+t+" c: "+e),A.err.println(i)}return r},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 D(new D(t.getX()+n/2,t.getY()+i/2,1),new D(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())<n}},getCoordinate:function(){return this._p},isInCircle:function(t,e,n){return vo.isInCircleRobust(t._p,e._p,n._p,this._p)},interpolateZValue:function(t,e,n){var i=t.getX(),r=t.getY(),o=e.getX()-i,s=n.getX()-i,a=e.getY()-r,u=n.getY()-r,l=o*u-s*a,c=this.getX()-i,h=this.getY()-r,f=(u*c-s*h)/l,g=(-a*c+o*h)/l;return t.getZ()+f*(e.getZ()-t.getZ())+g*(n.getZ()-t.getZ())},midPoint:function(t){return new mo((this._p.x+t.getX())/2,(this._p.y+t.getY())/2,(this._p.z+t.getZ())/2)},rightOf:function(t){return this.isCCW(t.dest(),t.orig())},isCCW:function(t,e){return(t._p.x-this._p.x)*(e._p.y-this._p.y)-(t._p.y-this._p.y)*(e._p.x-this._p.x)>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 mo(t*this._p.x,t*this._p.y)},cross:function(){return new mo(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 mo(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?mo.LEFT:o<0?mo.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?mo.BEHIND:i.magn()<r.magn()?mo.BEYOND:t.equals(n)?mo.ORIGIN:e.equals(n)?mo.DESTINATION:mo.BETWEEN},sum:function(t){return new mo(this._p.x+t.getX(),this._p.y+t.getY())},distance:function(t,e){return Math.sqrt(Math.pow(e.getX()-t.getX(),2)+Math.pow(e.getY()-t.getY(),2))},circumRadiusRatio:function(t,e){var n=this.circleCenter(t,e),i=this.distance(n,t),r=this.distance(this,t),o=this.distance(t,e);return o<r&&(r=o),(o=this.distance(e,this))<r&&(r=o),i/r},interfaces_:function(){return[]},getClass:function(){return mo}}),mo.interpolateZ=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=e.distance(n),r=t.distance(e),o=n.z-e.z;return e.z+o*(r/i)}if(4===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3],c=a.x,h=a.y,f=u.x-c,g=l.x-c,d=u.y-h,p=l.y-h,_=f*p-g*d,v=s.x-c,m=s.y-h,y=(p*v-g*m)/_,x=(-d*v+f*m)/_;return a.z+y*(u.z-a.z)+x*(l.z-a.z)}},mo.LEFT=0,mo.RIGHT=1,mo.BEYOND=2,mo.BEHIND=3,mo.BETWEEN=4,mo.ORIGIN=5,mo.DESTINATION=6,Ko(yo,mo),Zo(yo.prototype,{getConstraint:function(){return this._constraint},setOnConstraint:function(t){this._isOnConstraint=t},merge:function(t){t._isOnConstraint&&(this._isOnConstraint=!0,this._constraint=t._constraint)},isOnConstraint:function(){return this._isOnConstraint},setConstraint:function(t){this._isOnConstraint=!0,this._constraint=t},interfaces_:function(){return[]},getClass:function(){return yo}}),Zo(xo.prototype,{equalsNonOriented:function(t){return!!this.equalsOriented(t)||!!this.equalsOriented(t.sym())},toLineSegment:function(){return new $t(this._vertex.getCoordinate(),this.dest().getCoordinate())},dest:function(){return this.sym().orig()},oNext:function(){return this._next},equalsOriented:function(t){return!(!this.orig().getCoordinate().equals2D(t.orig().getCoordinate())||!this.dest().getCoordinate().equals2D(t.dest().getCoordinate()))},dNext:function(){return this.sym().oNext().sym()},lPrev:function(){return this._next.sym()},rPrev:function(){return this.sym().oNext()},rot:function(){return this._rot},oPrev:function(){return this._rot._next._rot},sym:function(){return this._rot._rot},setOrig:function(t){this._vertex=t},lNext:function(){return this.invRot().oNext().rot()},getLength:function(){return this.orig().getCoordinate().distance(this.dest().getCoordinate())},invRot:function(){return this._rot.sym()},setDest:function(t){this.sym().setOrig(t)},setData:function(t){this._data=t},getData:function(){return this._data},delete:function(){this._rot=null},orig:function(){return this._vertex},rNext:function(){return this._rot._next.invRot()},toString:function(){var t=this._vertex.getCoordinate(),e=this.dest().getCoordinate();return Ht.toLineString(t,e)},isLive:function(){return null!==this._rot},getPrimary:function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},dPrev:function(){return this.invRot().oNext().invRot()},setNext:function(t){this._next=t},interfaces_:function(){return[]},getClass:function(){return xo}}),xo.makeEdge=function(t,e){var n=new xo,i=new xo,r=new xo,o=new xo;n._rot=i,i._rot=r,r._rot=o,o._rot=n,n.setNext(n),i.setNext(o),r.setNext(r),o.setNext(i);var s=n;return s.setOrig(t),s.setDest(e),s},xo.swap=function(t){var e=t.oPrev(),n=t.sym().oPrev();xo.splice(t,e),xo.splice(t.sym(),n),xo.splice(t,e.lNext()),xo.splice(t.sym(),n.lNext()),t.setOrig(e.dest()),t.setDest(n.dest())},xo.splice=function(t,e){var n=t.oNext().rot(),i=e.oNext().rot(),r=e.oNext(),o=t.oNext(),s=i.oNext(),a=n.oNext();t.setNext(r),e.setNext(o),n.setNext(s),i.setNext(a)},xo.connect=function(t,e){var n=xo.makeEdge(t.dest(),e.orig());return xo.splice(n,t.lNext()),xo.splice(n.sym(),e),n},Zo(Eo.prototype,{insertSite:function(t){var e=this._subdiv.locate(t);if(this._subdiv.isVertexOfEdge(e,t))return e;this._subdiv.isOnEdge(e,t.getCoordinate())&&(e=e.oPrev(),this._subdiv.delete(e.oNext()));var n=this._subdiv.makeEdge(e.orig(),t);xo.splice(n,e);var i=n;do{e=(n=this._subdiv.connect(e,n.sym())).oPrev()}while(e.lNext()!==i);for(;;){var r=e.oPrev();if(r.dest().rightOf(e)&&t.isInCircle(e.orig(),r.dest(),e.dest()))xo.swap(e),e=e.oPrev();else{if(e.oNext()===i)return n;e=e.oNext().lPrev()}}},insertSites:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertSite(n)}},interfaces_:function(){return[]},getClass:function(){return Eo}}),Zo(wo.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return wo}}),Zo(bo.prototype,{init:function(){this._lastEdge=this.findEdge()},locate:function(t){this._lastEdge.isLive()||this.init();var e=this._subdiv.locateFromEdge(t,this._lastEdge);return this._lastEdge=e,e},findEdge:function(){return this._subdiv.getEdges().iterator().next()},interfaces_:function(){return[wo]},getClass:function(){return bo}}),Ko(Io,c),Zo(Io.prototype,{getSegment:function(){return this._seg},interfaces_:function(){return[]},getClass:function(){return Io}}),Io.msgWithSpatial=function(t,e){return null!==e?t+" [ "+e+" ]":t},Zo(Co.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return Co}}),Zo(No.prototype,{getTriangleVertices:function(t){var e=new Mo;return this.visitTriangles(e,t),e.getTriangleVertices()},isFrameVertex:function(t){return!!t.equals(this._frameVertex[0])||(!!t.equals(this._frameVertex[1])||!!t.equals(this._frameVertex[2]))},isVertexOfEdge:function(t,e){return!(!e.equals(t.orig(),this._tolerance)&&!e.equals(t.dest(),this._tolerance))},connect:function(t,e){var n=xo.connect(t,e);return this._quadEdges.add(n),n},getVoronoiCellPolygon:function(t,e){var n=new E,i=t;do{var r=t.rot().orig().getCoordinate();n.add(r),t=t.oPrev()}while(t!==i);var o=new w;o.addAll(n,!1),o.closeRing(),o.size()<4&&(A.out.println(o),o.add(o.get(o.size()-1),!0));var s=o.toCoordinateArray(),a=e.createPolygon(e.createLinearRing(s),null),u=i.orig();return a.setUserData(u.getCoordinate()),a},setLocator:function(t){this._locator=t},initSubdiv:function(){var t=this.makeEdge(this._frameVertex[0],this._frameVertex[1]),e=this.makeEdge(this._frameVertex[1],this._frameVertex[2]);xo.splice(t.sym(),e);var n=this.makeEdge(this._frameVertex[2],this._frameVertex[0]);return xo.splice(e.sym(),n),xo.splice(n.sym(),t),t},isFrameBorderEdge:function(t){var e=new Array(3).fill(null);No.getTriangleEdges(t,e);var n=new Array(3).fill(null);No.getTriangleEdges(t.sym(),n);var i=t.lNext().dest();if(this.isFrameVertex(i))return!0;var r=t.sym().lNext().dest();return!!this.isFrameVertex(r)},makeEdge:function(t,e){var n=xo.makeEdge(t,e);return this._quadEdges.add(n),n},visitTriangles:function(t,e){this._visitedKey++;var n=new ie;n.push(this._startingEdge);for(var i=new K;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=this.fetchTriangleToVisit(r,n,e,i);null!==o&&t.visit(o)}}},isFrameEdge:function(t){return!(!this.isFrameVertex(t.orig())&&!this.isFrameVertex(t.dest()))},isOnEdge:function(t,e){return this._seg.setCoordinates(t.orig().getCoordinate(),t.dest().getCoordinate()),this._seg.distance(e)<this._edgeCoincidenceTolerance},getEnvelope:function(){return new b(this._frameEnv)},createFrame:function(t){var e=t.getWidth(),n=t.getHeight(),i=0;i=e>n?10*e:10*n,this._frameVertex[0]=new mo((t.getMaxX()+t.getMinX())/2,t.getMaxY()+i),this._frameVertex[1]=new mo(t.getMinX()-i,t.getMinY()-i),this._frameVertex[2]=new mo(t.getMaxX()+i,t.getMinY()-i),this._frameEnv=new b(this._frameVertex[0].getCoordinate(),this._frameVertex[1].getCoordinate()),this._frameEnv.expandToInclude(this._frameVertex[2].getCoordinate())},getTriangleCoordinates:function(t){var e=new Po;return this.visitTriangles(e,t),e.getTriangles()},getVertices:function(t){for(var e=new K,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 E,n=new K,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 Lo;return this.visitTriangles(e,t),e.getTriangleEdges()},getPrimaryEdges:function(t){this._visitedKey++;var e=new E,n=new ie;n.push(this._startingEdge);for(var i=new K;!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){xo.splice(t,t.oPrev()),xo.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 Io(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 So,!0);for(var e=new E,n=this.getVertexUniqueEdges(!1).iterator();n.hasNext();){var i=n.next();e.add(this.getVoronoiCellPolygon(i,t))}return e},getVoronoiDiagram:function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(Vt.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);xo.splice(n,e);var i=n;do{e=(n=this.connect(e,n.sym())).oPrev()}while(e.lNext()!==i);return i},locate:function(){if(1===arguments.length){if(arguments[0]instanceof mo){var t=arguments[0];return this._locator.locate(t)}if(arguments[0]instanceof g){var e=arguments[0];return this._locator.locate(new mo(e))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this._locator.locate(new mo(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 No}}),No.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 r("Edges do not form a triangle")},Zo(So.prototype,{visit:function(t){for(var e=t[0].orig().getCoordinate(),n=t[1].orig().getCoordinate(),i=t[2].orig().getCoordinate(),r=new mo(hi.circumcentre(e,n,i)),o=0;o<3;o++)t[o].rot().setOrig(r)},interfaces_:function(){return[Co]},getClass:function(){return So}}),Zo(Lo.prototype,{getTriangleEdges:function(){return this._triList},visit:function(t){this._triList.add(t.clone())},interfaces_:function(){return[Co]},getClass:function(){return Lo}}),Zo(Mo.prototype,{visit:function(t){this._triList.add([t[0].orig(),t[1].orig(),t[2].orig()])},getTriangleVertices:function(){return this._triList},interfaces_:function(){return[Co]},getClass:function(){return Mo}}),Zo(Po.prototype,{checkTriangleSize:function(t){t.length>=2?Ht.toLineString(t[0],t[1]):t.length>=1&&Ht.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[Co]},getClass:function(){return Po}}),No.TriangleCircumcentreVisitor=So,No.TriangleEdgesListVisitor=Lo,No.TriangleVertexListVisitor=Mo,No.TriangleCoordinatesVisitor=Po,No.EDGE_COINCIDENCE_TOL_FACTOR=1e3,Zo(Ro.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 Ro}}),Zo(Oo.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return Oo}}),Zo(To.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 To}}),Zo(Ao.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 To(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(){if(1===arguments.length){var t=arguments[0],e=new E;return this.query(t,e),e}if(2===arguments.length)if(arguments[0]instanceof b&&$o(arguments[1],m)){var n=arguments[0],i=arguments[1];this.queryNode(this._root,n,!0,{interfaces_:function(){return[Oo]},visit:function(t){i.add(t)}})}else if(arguments[0]instanceof b&&$o(arguments[1],Oo)){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=s<=o;r<s&&this.queryNode(t.getLeft(),e,!n,i),e.contains(t.getCoordinate())&&i.visit(t),a&&this.queryNode(t.getRight(),e,!n,i)},findBestMatchNode:function(t){var e=new Do(t,this._tolerance);return this.query(e.queryEnvelope(),e),e.getNode()},isEmpty:function(){return null===this._root},insertExact:function(t,e){for(var n=this._root,i=this._root,r=!0,o=!0;null!==n;){if(null!==n&&t.distance(n.getCoordinate())<=this._tolerance)return n.increment(),n;i=n,n=(o=r?t.x<n.getX():t.y<n.getY())?n.getLeft():n.getRight(),r=!r}this._numberOfNodes=this._numberOfNodes+1;var s=new To(t,e);return o?i.setLeft(s):i.setRight(s),s},interfaces_:function(){return[]},getClass:function(){return Ao}}),Ao.toCoordinates=function(){if(1===arguments.length){var t=arguments[0];return Ao.toCoordinates(t,!1)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],i=new w,r=e.iterator();r.hasNext();)for(var o=r.next(),s=n?o.getCount():1,a=0;a<s;a++)i.add(o.getCoordinate(),!0);return i.toCoordinateArray()}},Zo(Do.prototype,{visit:function(t){var e=this._p.distance(t.getCoordinate());if(!(e<=this._tolerance))return null;var n=!1;(null===this._matchNode||e<this._matchDist||null!==this._matchNode&&e===this._matchDist&&t.getCoordinate().compareTo(this._matchNode.getCoordinate())<1)&&(n=!0),n&&(this._matchNode=t,this._matchDist=e)},queryEnvelope:function(){var t=new b(this._p);return t.expandBy(this._tolerance),t},getNode:function(){return this._matchNode},interfaces_:function(){return[Oo]},getClass:function(){return Do}}),Ao.BestMatchVisitor=Do,Zo(Fo.prototype,{getInitialVertices:function(){return this._initialVertices},getKDT:function(){return this._kdt},enforceConstraints:function(){this.addConstraintVertices();var t=0,e=0;do{e=this.enforceGabriel(this._segments),t++}while(e>0&&t<Fo.MAX_SPLIT_ITER)},insertSites:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertSite(n)}},getVertexFactory:function(){return this._vertexFactory},getPointArray:function(){for(var t=new Array(this._initialVertices.size()+this._segVertices.size()).fill(null),e=0,n=this._initialVertices.iterator();n.hasNext();){r=n.next();t[e++]=r.getCoordinate()}for(var i=this._segVertices.iterator();i.hasNext();){var r=i.next();t[e++]=r.getCoordinate()}return t},setConstraints:function(t,e){this._segments=t,this._segVertices=e},computeConvexHull:function(){var t=new Vt,e=new oe(this.getPointArray(),t);this._convexHull=e.getConvexHull()},addConstraintVertices:function(){this.computeConvexHull(),this.insertSites(this._segVertices)},findNonGabrielPoint:function(t){var e=t.getStart(),n=t.getEnd(),i=new g((e.x+n.x)/2,(e.y+n.y)/2),r=e.distance(i),s=new b(i);s.expandBy(r);for(var a=this._kdt.query(s),u=null,l=o.MAX_VALUE,c=a.iterator();c.hasNext();){var h=c.next().getCoordinate();if(!h.equals2D(e)&&!h.equals2D(n)){var f=i.distance(h);if(f<r){var d=f;(null===u||d<l)&&(u=h,l=d)}}}return u},getConstraintSegments:function(){return this._segments},setSplitPointFinder:function(t){this._splitFinder=t},getConvexHull:function(){return this._convexHull},getTolerance:function(){return this._tolerance},enforceGabriel:function(t){for(var e=new E,n=0,i=new E,r=t.iterator();r.hasNext();){var o=r.next(),s=this.findNonGabrielPoint(o);if(null!==s){this._splitPt=this._splitFinder.findSplitPoint(o,s);var a=this.createVertex(this._splitPt,o),u=(this.insertSite(a),new Ro(o.getStartX(),o.getStartY(),o.getStartZ(),a.getX(),a.getY(),a.getZ(),o.getData())),l=new Ro(a.getX(),a.getY(),a.getZ(),o.getEndX(),o.getEndY(),o.getEndZ(),o.getData());e.add(u),e.add(l),i.add(o),n+=1}}return t.removeAll(i),t.addAll(e),n},createVertex:function(){if(1===arguments.length){var t=arguments[0],e=null;return e=null!==this._vertexFactory?this._vertexFactory.createVertex(t,null):new yo(t)}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=null;return(e=null!==this._vertexFactory?this._vertexFactory.createVertex(n,i):new yo(n)).setOnConstraint(!0),e}},getSubdivision:function(){return this._subdiv},computeBoundingBox:function(){var t=Fo.computeVertexEnvelope(this._initialVertices),e=Fo.computeVertexEnvelope(this._segVertices),n=new b(t);n.expandToInclude(e);var i=.2*n.getWidth(),r=.2*n.getHeight(),o=Math.max(i,r);this._computeAreaEnv=new b(n),this._computeAreaEnv.expandBy(o)},setVertexFactory:function(t){this._vertexFactory=t},formInitialDelaunay:function(){this.computeBoundingBox(),this._subdiv=new No(this._computeAreaEnv,this._tolerance),this._subdiv.setLocator(new bo(this._subdiv)),this._incDel=new Eo(this._subdiv),this.insertSites(this._initialVertices)},insertSite:function(){if(arguments[0]instanceof yo){var t=arguments[0],e=this._kdt.insert(t.getCoordinate(),t);if(e.isRepeated()){var n=e.getData();return n.merge(t),n}return this._incDel.insertSite(t),t}if(arguments[0]instanceof g){var i=arguments[0];this.insertSite(this.createVertex(i))}},interfaces_:function(){return[]},getClass:function(){return Fo}}),Fo.computeVertexEnvelope=function(t){for(var e=new b,n=t.iterator();n.hasNext();){var i=n.next();e.expandToInclude(i.getCoordinate())}return e},Fo.MAX_SPLIT_ITER=99,Zo(Go.prototype,{create:function(){if(null!==this._subdiv)return null;var t=Go.envelope(this._siteCoords),e=Go.toVertices(this._siteCoords);this._subdiv=new No(t,this._tolerance),new Eo(this._subdiv).insertSites(e)},setTolerance:function(t){this._tolerance=t},setSites:function(){if(arguments[0]instanceof q){var t=arguments[0];this._siteCoords=Go.extractUniqueCoordinates(t)}else if($o(arguments[0],_)){var e=arguments[0];this._siteCoords=Go.unique(V.toCoordinateArray(e))}},getEdges:function(t){return this.create(),this._subdiv.getEdges(t)},getSubdivision:function(){return this.create(),this._subdiv},getTriangles:function(t){return this.create(),this._subdiv.getTriangles(t)},interfaces_:function(){return[]},getClass:function(){return Go}}),Go.extractUniqueCoordinates=function(t){if(null===t)return new w;var e=t.getCoordinates();return Go.unique(e)},Go.envelope=function(t){for(var e=new b,n=t.iterator();n.hasNext();){var i=n.next();e.expandToInclude(i)}return e},Go.unique=function(t){var e=V.copyDeep(t);return at.sort(e),new w(e,!1)},Go.toVertices=function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next();e.add(new mo(i))}return e},Zo(qo.prototype,{createSiteVertices:function(t){for(var e=new E,n=t.iterator();n.hasNext();){var i=n.next();this._constraintVertexMap.containsKey(i)||e.add(new yo(i))}return e},create:function(){if(null!==this._subdiv)return null;var t=Go.envelope(this._siteCoords),e=new E;null!==this._constraintLines&&(t.expandToInclude(this._constraintLines.getEnvelopeInternal()),this.createVertices(this._constraintLines),e=qo.createConstraintSegments(this._constraintLines));var n=new Fo(this.createSiteVertices(this._siteCoords),this._tolerance);n.setConstraints(e,new E(this._constraintVertexMap.values())),n.formInitialDelaunay(),n.enforceConstraints(),this._subdiv=n.getSubdivision()},setTolerance:function(t){this._tolerance=t},setConstraints:function(t){this._constraintLines=t},setSites:function(t){this._siteCoords=Go.extractUniqueCoordinates(t)},getEdges:function(t){return this.create(),this._subdiv.getEdges(t)},getSubdivision:function(){return this.create(),this._subdiv},getTriangles:function(t){return this.create(),this._subdiv.getTriangles(t)},createVertices:function(t){for(var e=t.getCoordinates(),n=0;n<e.length;n++){var i=new yo(e[n]);this._constraintVertexMap.put(e[n],i)}},interfaces_:function(){return[]},getClass:function(){return qo}}),qo.createConstraintSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=Mn.getLines(t),n=new E,i=e.iterator();i.hasNext();){var r=i.next();qo.createConstraintSegments(r,n)}return n}if(2===arguments.length)for(var o=arguments[0],s=arguments[1],a=o.getCoordinates(),i=1;i<a.length;i++)s.add(new Ro(a[i-1],a[i]))},Zo(ko.prototype,{create:function(){if(null!==this._subdiv)return null;var t=Go.envelope(this._siteCoords);this._diagramEnv=t;var e=Math.max(this._diagramEnv.getWidth(),this._diagramEnv.getHeight());this._diagramEnv.expandBy(e),null!==this._clipEnv&&this._diagramEnv.expandToInclude(this._clipEnv);var n=Go.toVertices(this._siteCoords);this._subdiv=new No(t,this._tolerance),new Eo(this._subdiv).insertSites(n)},getDiagram:function(t){this.create();var e=this._subdiv.getVoronoiDiagram(t);return ko.clipGeometryCollection(e,this._diagramEnv)},setTolerance:function(t){this._tolerance=t},setSites:function(){if(arguments[0]instanceof q){var t=arguments[0];this._siteCoords=Go.extractUniqueCoordinates(t)}else if($o(arguments[0],_)){var e=arguments[0];this._siteCoords=Go.unique(V.toCoordinateArray(e))}},setClipEnvelope:function(t){this._clipEnv=t},getSubdivision:function(){return this.create(),this._subdiv},interfaces_:function(){return[]},getClass:function(){return ko}}),ko.clipGeometryCollection=function(t,e){for(var n=t.getFactory().toGeometry(e),i=new E,r=0;r<t.getNumGeometries();r++){var o=t.getGeometryN(r),s=null;e.contains(o.getEnvelopeInternal())?s=o:e.intersects(o.getEnvelopeInternal())&&(s=n.intersection(o)).setUserData(o.getUserData()),null===s||s.isEmpty()||i.add(s)}return t.getFactory().createGeometryCollection(Vt.toGeometryArray(i))};var _s=Object.freeze({Vertex:mo});Zo(Bo.prototype,{getSegmentIndex:function(){return this._segmentIndex},getComponentIndex:function(){return this._componentIndex},isEndpoint:function(t){var e=t.getGeometryN(this._componentIndex).getNumPoints()-1;return this._segmentIndex>=e||this._segmentIndex===e&&this._segmentFraction>=1},isValid:function(t){if(this._componentIndex<0||this._componentIndex>=t.getNumGeometries())return!1;var e=t.getGeometryN(this._componentIndex);return!(this._segmentIndex<0||this._segmentIndex>e.getNumPoints())&&((this._segmentIndex!==e.getNumPoints()||0===this._segmentFraction)&&!(this._segmentFraction<0||this._segmentFraction>1))},normalize:function(){this._segmentFraction<0&&(this._segmentFraction=0),this._segmentFraction>1&&(this._segmentFraction=1),this._componentIndex<0&&(this._componentIndex=0,this._segmentIndex=0,this._segmentFraction=0),this._segmentIndex<0&&(this._segmentIndex=0,this._segmentFraction=0),1===this._segmentFraction&&(this._segmentFraction=0,this._segmentIndex+=1)},toLowest:function(t){var e=t.getGeometryN(this._componentIndex).getNumPoints()-1;return this._segmentIndex<e?this:new Bo(this._componentIndex,e,1,!1)},getCoordinate:function(t){var e=t.getGeometryN(this._componentIndex),n=e.getCoordinateN(this._segmentIndex);if(this._segmentIndex>=e.getNumPoints()-1)return n;var i=e.getCoordinateN(this._segmentIndex+1);return Bo.pointAlongSegmentByFraction(n,i,this._segmentFraction)},getSegmentFraction:function(){return this._segmentFraction},getSegment:function(t){var e=t.getGeometryN(this._componentIndex),n=e.getCoordinateN(this._segmentIndex);return this._segmentIndex>=e.getNumPoints()-1?new $t(e.getCoordinateN(e.getNumPoints()-2),n):new $t(n,e.getCoordinateN(this._segmentIndex+1))},clamp:function(t){if(this._componentIndex>=t.getNumGeometries())return this.setToEnd(t),null;if(this._segmentIndex>=t.getNumPoints()){var e=t.getGeometryN(this._componentIndex);this._segmentIndex=e.getNumPoints()-1,this._segmentFraction=1}},setToEnd:function(t){this._componentIndex=t.getNumGeometries()-1;var e=t.getGeometryN(this._componentIndex);this._segmentIndex=e.getNumPoints()-1,this._segmentFraction=1},compareTo:function(t){var e=t;return this._componentIndex<e._componentIndex?-1:this._componentIndex>e._componentIndex?1:this._segmentIndex<e._segmentIndex?-1:this._segmentIndex>e._segmentIndex?1:this._segmentFraction<e._segmentFraction?-1:this._segmentFraction>e._segmentFraction?1:0},clone:function(){return new Bo(this._componentIndex,this._segmentIndex,this._segmentFraction)},toString:function(){return"LinearLoc["+this._componentIndex+", "+this._segmentIndex+", "+this._segmentFraction+"]"},isOnSameSegment:function(t){return this._componentIndex===t._componentIndex&&(this._segmentIndex===t._segmentIndex||(t._segmentIndex-this._segmentIndex==1&&0===t._segmentFraction||this._segmentIndex-t._segmentIndex==1&&0===this._segmentFraction))},snapToVertex:function(t,e){if(this._segmentFraction<=0||this._segmentFraction>=1)return null;var n=this.getSegmentLength(t),i=this._segmentFraction*n,r=n-i;i<=r&&i<e?this._segmentFraction=0:r<=i&&r<e&&(this._segmentFraction=1)},compareLocationValues:function(t,e,n){return this._componentIndex<t?-1:this._componentIndex>t?1:this._segmentIndex<e?-1:this._segmentIndex>e?1:this._segmentFraction<n?-1:this._segmentFraction>n?1:0},getSegmentLength:function(t){var e=t.getGeometryN(this._componentIndex),n=this._segmentIndex;this._segmentIndex>=e.getNumPoints()-1&&(n=e.getNumPoints()-2);var i=e.getCoordinateN(n),r=e.getCoordinateN(n+1);return i.distance(r)},isVertex:function(){return this._segmentFraction<=0||this._segmentFraction>=1},interfaces_:function(){return[s]},getClass:function(){return Bo}}),Bo.getEndLocation=function(t){var e=new Bo;return e.setToEnd(t),e},Bo.pointAlongSegmentByFraction=function(t,e,n){return n<=0?t:n>=1?e:new g((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y,(e.z-t.z)*n+t.z)},Bo.compareLocationValues=function(t,e,n,i,r,o){return t<i?-1:t>i?1:e<r?-1:e>r?1:n<o?-1:n>o?1:0},Zo(jo.prototype,{getComponentIndex:function(){return this._componentIndex},getLine:function(){return this._currentLine},getVertexIndex:function(){return this._vertexIndex},getSegmentEnd:function(){return this._vertexIndex<this.getLine().getNumPoints()-1?this._currentLine.getCoordinateN(this._vertexIndex+1):null},next:function(){if(!this.hasNext())return null;this._vertexIndex++,this._vertexIndex>=this._currentLine.getNumPoints()&&(this._componentIndex++,this.loadCurrentLine(),this._vertexIndex=0)},loadCurrentLine:function(){if(this._componentIndex>=this._numLines)return this._currentLine=null,null;this._currentLine=this._linearGeom.getGeometryN(this._componentIndex)},getSegmentStart:function(){return this._currentLine.getCoordinateN(this._vertexIndex)},isEndOfLine:function(){return!(this._componentIndex>=this._numLines)&&!(this._vertexIndex<this._currentLine.getNumPoints()-1)},hasNext:function(){return!(this._componentIndex>=this._numLines)&&!(this._componentIndex===this._numLines-1&&this._vertexIndex>=this._currentLine.getNumPoints())},interfaces_:function(){return[]},getClass:function(){return jo}}),jo.segmentEndVertexIndex=function(t){return t.getSegmentFraction()>0?t.getSegmentIndex()+1:t.getSegmentIndex()},Zo(zo.prototype,{indexOf:function(t){return this.indexOfFromStart(t,null)},indexOfFromStart:function(t,e){for(var n=o.MAX_VALUE,i=0,r=0,s=-1,a=new $t,u=new jo(this._linearGeom);u.hasNext();u.next())if(!u.isEndOfLine()){a.p0=u.getSegmentStart(),a.p1=u.getSegmentEnd();var l=a.distance(t),c=a.segmentFraction(t),h=u.getComponentIndex(),f=u.getVertexIndex();l<n&&(null===e||e.compareLocationValues(h,f,c)<0)&&(i=h,r=f,s=c,n=l)}return n===o.MAX_VALUE?new Bo(e):new Bo(i,r,s)},indexOfAfter:function(t,e){if(null===e)return this.indexOf(t);var n=Bo.getEndLocation(this._linearGeom);if(n.compareTo(e)<=0)return n;var i=this.indexOfFromStart(t,e);return f.isTrue(i.compareTo(e)>=0,"computed location is before specified minimum location"),i},interfaces_:function(){return[]},getClass:function(){return zo}}),zo.indexOf=function(t,e){return new zo(t).indexOf(e)},zo.indexOfAfter=function(t,e,n){return new zo(t).indexOfAfter(e,n)},Zo(Yo.prototype,{indicesOf:function(t){var e=t.getGeometryN(0).getCoordinateN(0),n=t.getGeometryN(t.getNumGeometries()-1),i=n.getCoordinateN(n.getNumPoints()-1),r=new zo(this._linearGeom),o=new Array(2).fill(null);return o[0]=r.indexOf(e),0===t.getLength()?o[1]=o[0].clone():o[1]=r.indexOfAfter(i,o[0]),o},interfaces_:function(){return[]},getClass:function(){return Yo}}),Yo.indicesOf=function(t,e){return new Yo(t).indicesOf(e)},Zo(Xo.prototype,{getGeometry:function(){return this.endLine(),this._geomFact.buildGeometry(this._lines)},getLastCoordinate:function(){return this._lastPt},endLine:function(){if(null===this._coordList)return null;if(this._ignoreInvalidLines&&this._coordList.size()<2)return this._coordList=null,null;var t=this._coordList.toCoordinateArray(),e=t;this._fixInvalidLines&&(e=this.validCoordinateSequence(t)),this._coordList=null;var n=null;try{n=this._geomFact.createLineString(e)}catch(t){if(!(t instanceof r))throw t;if(!this._ignoreInvalidLines)throw t}null!==n&&this._lines.add(n)},setFixInvalidLines:function(t){this._fixInvalidLines=t},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];null===this._coordList&&(this._coordList=new w),this._coordList.add(e,n),this._lastPt=e}},setIgnoreInvalidLines:function(t){this._ignoreInvalidLines=t},validCoordinateSequence:function(t){return t.length>=2?t:[t[0],t[0]]},interfaces_:function(){return[]},getClass:function(){return Xo}}),Zo(Vo.prototype,{computeLinear:function(t,e){var n=new Xo(this._line.getFactory());n.setFixInvalidLines(!0),t.isVertex()||n.add(t.getCoordinate(this._line));for(var i=new jo(this._line,t);i.hasNext()&&!(e.compareLocationValues(i.getComponentIndex(),i.getVertexIndex(),0)<0);i.next()){var r=i.getSegmentStart();n.add(r),i.isEndOfLine()&&n.endLine()}return e.isVertex()||n.add(e.getCoordinate(this._line)),n.getGeometry()},computeLine:function(t,e){var n=this._line.getCoordinates(),i=new w,r=t.getSegmentIndex();t.getSegmentFraction()>0&&(r+=1);var o=e.getSegmentIndex();1===e.getSegmentFraction()&&(o+=1),o>=n.length&&(o=n.length-1),t.isVertex()||i.add(t.getCoordinate(this._line));for(var s=r;s<=o;s++)i.add(n[s]);e.isVertex()||i.add(e.getCoordinate(this._line)),i.size()<=0&&i.add(t.getCoordinate(this._line));var a=i.toCoordinateArray();return a.length<=1&&(a=[a[0],a[0]]),this._line.getFactory().createLineString(a)},extract:function(t,e){return e.compareTo(t)<0?this.reverse(this.computeLinear(e,t)):this.computeLinear(t,e)},reverse:function(t){return t instanceof wt?t.reverse():t instanceof ft?t.reverse():(f.shouldNeverReachHere("non-linear geometry encountered"),null)},interfaces_:function(){return[]},getClass:function(){return Vo}}),Vo.extract=function(t,e,n){return new Vo(t).extract(e,n)},Zo(Uo.prototype,{clampIndex:function(t){var e=t.clone();return e.clamp(this._linearGeom),e},project:function(t){return zo.indexOf(this._linearGeom,t)},checkGeometryType:function(){if(!(this._linearGeom instanceof wt||this._linearGeom instanceof ft))throw new r("Input geometry must be linear")},extractPoint:function(){if(1===arguments.length)return arguments[0].getCoordinate(this._linearGeom);if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.toLowest(this._linearGeom);return n.getSegment(this._linearGeom).pointAlongOffset(n.getSegmentFraction(),e)}},isValidIndex:function(t){return t.isValid(this._linearGeom)},getEndIndex:function(){return Bo.getEndLocation(this._linearGeom)},getStartIndex:function(){return new Bo},indexOfAfter:function(t,e){return zo.indexOfAfter(this._linearGeom,t,e)},extractLine:function(t,e){return Vo.extract(this._linearGeom,t,e)},indexOf:function(t){return zo.indexOf(this._linearGeom,t)},indicesOf:function(t){return Yo.indicesOf(this._linearGeom,t)},interfaces_:function(){return[]},getClass:function(){return Uo}}),Zo(Ho.prototype,{indexOf:function(t){return this.indexOfFromStart(t,-1)},indexOfFromStart:function(t,e){for(var n=o.MAX_VALUE,i=e,r=0,s=new $t,a=new jo(this._linearGeom);a.hasNext();){if(!a.isEndOfLine()){s.p0=a.getSegmentStart(),s.p1=a.getSegmentEnd();var u=s.distance(t),l=this.segmentNearestMeasure(s,t,r);u<n&&l>e&&(i=l,n=u),r+=s.getLength()}a.next()}return i},indexOfAfter:function(t,e){if(e<0)return this.indexOf(t);var n=this._linearGeom.getLength();if(n<e)return n;var i=this.indexOfFromStart(t,e);return f.isTrue(i>=e,"computed index is before specified minimum index"),i},segmentNearestMeasure:function(t,e,n){var i=t.projectionFactor(e);return i<=0?n:i<=1?n+i*t.getLength():n+t.getLength()},interfaces_:function(){return[]},getClass:function(){return Ho}}),Ho.indexOf=function(t,e){return new Ho(t).indexOf(e)},Ho.indexOfAfter=function(t,e,n){return new Ho(t).indexOfAfter(e,n)},Zo(Wo.prototype,{getLength:function(t){for(var e=0,n=new jo(this._linearGeom);n.hasNext();){if(!n.isEndOfLine()){var i=n.getSegmentStart(),r=n.getSegmentEnd().distance(i);if(t.getComponentIndex()===n.getComponentIndex()&&t.getSegmentIndex()===n.getVertexIndex())return e+r*t.getSegmentFraction();e+=r}n.next()}return e},resolveHigher:function(t){if(!t.isEndpoint(this._linearGeom))return t;var e=t.getComponentIndex();if(e>=this._linearGeom.getNumGeometries()-1)return t;do{e++}while(e<this._linearGeom.getNumGeometries()-1&&0===this._linearGeom.getGeometryN(e).getLength());return new Bo(e,0,0)},getLocation:function(){if(1===arguments.length){var t=arguments[0];return this.getLocation(t,!0)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=e;e<0&&(i=this._linearGeom.getLength()+e);var r=this.getLocationForward(i);return n?r:this.resolveHigher(r)}},getLocationForward:function(t){if(t<=0)return new Bo;for(var e=0,n=new jo(this._linearGeom);n.hasNext();){if(n.isEndOfLine()){if(e===t)return new Bo(s=n.getComponentIndex(),a=n.getVertexIndex(),0)}else{var i=n.getSegmentStart(),r=n.getSegmentEnd().distance(i);if(e+r>t){var o=(t-e)/r,s=n.getComponentIndex(),a=n.getVertexIndex();return new Bo(s,a,o)}e+=r}n.next()}return Bo.getEndLocation(this._linearGeom)},interfaces_:function(){return[]},getClass:function(){return Wo}}),Wo.getLength=function(t,e){return new Wo(t).getLength(e)},Wo.getLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return(o=new Wo(t)).getLocation(e)}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new Wo(n);return o.getLocation(i,r)}},Zo(Jo.prototype,{clampIndex:function(t){var e=this.positiveIndex(t),n=this.getStartIndex();if(e<n)return n;var i=this.getEndIndex();return e>i?i:e},locationOf:function(){if(1===arguments.length){var t=arguments[0];return Wo.getLocation(this._linearGeom,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return Wo.getLocation(this._linearGeom,e,n)}},project:function(t){return Ho.indexOf(this._linearGeom,t)},positiveIndex:function(t){return t>=0?t:this._linearGeom.getLength()+t},extractPoint:function(){if(1===arguments.length){var t=arguments[0];return(i=Wo.getLocation(this._linearGeom,t)).getCoordinate(this._linearGeom)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=Wo.getLocation(this._linearGeom,e),r=i.toLowest(this._linearGeom);return r.getSegment(this._linearGeom).pointAlongOffset(r.getSegmentFraction(),n)}},isValidIndex:function(t){return t>=this.getStartIndex()&&t<=this.getEndIndex()},getEndIndex:function(){return this._linearGeom.getLength()},getStartIndex:function(){return 0},indexOfAfter:function(t,e){return Ho.indexOfAfter(this._linearGeom,t,e)},extractLine:function(t,e){new Uo(this._linearGeom);var n=this.clampIndex(t),i=this.clampIndex(e),r=n===i,o=this.locationOf(n,r),s=this.locationOf(i);return Vo.extract(this._linearGeom,o,s)},indexOf:function(t){return Ho.indexOf(this._linearGeom,t)},indicesOf:function(t){var e=Yo.indicesOf(this._linearGeom,t);return[Wo.getLength(this._linearGeom,e[0]),Wo.getLength(this._linearGeom,e[1])]},interfaces_:function(){return[]},getClass:function(){return Jo}}),n.Coordinate=g,n.CoordinateList=w,n.Envelope=b,n.LineSegment=$t,n.GeometryFactory=Vt,n.Geometry=q,n.Point=It,n.LineString=wt,n.LinearRing=Lt,n.Polygon=Nt,n.GeometryCollection=ht,n.MultiPoint=St,n.MultiLineString=ft,n.MultiPolygon=Mt,n.Dimension=ut,n.IntersectionMatrix=te,n.PrecisionModel=Yt,n.Centroid=ee,n.CGAlgorithms=Qt,n.ConvexHull=oe,n.InteriorPointArea=Hn,n.InteriorPointLine=Jn,n.InteriorPointPoint=Zn,n.RobustLineIntersector=Jt,n.MCPointInRing=ui,n.MinimumBoundingCircle=fi,n.MinimumDiameter=gi,n.Densifier=di,n.LineDissolver=Ei,n.GeometryGraph=Bn,n.quadtree=hs,n.strtree=fs,n.GeoJSONReader=Li,n.GeoJSONWriter=Mi,n.OL3Parser=Oi,n.WKTReader=Pi,n.WKTWriter=Ht,n.BoundaryOp=gt,n.IsSimpleOp=Ai,n.BufferOp=er,n.BufferParameters=Fi,n.DistanceOp=sr,n.LineMerger=mr,n.OverlayOp=Xn,n.Polygonizer=Dr,n.RelateOp=Vr,n.CascadedPolygonUnion=Hr,n.PointGeometryUnion=Wr,n.UnaryUnionOp=Zr,n.UnionInteracting=Kr,n.UnionOp=Qr,n.IsValidOp=Rr,n.ConsistentAreaTester=Lr,n.GeometryPrecisionReducer=to,n.DouglasPeuckerSimplifier=no,n.TopologyPreservingSimplifier=co,n.ConformingDelaunayTriangulationBuilder=qo,n.DelaunayTriangulationBuilder=Go,n.VoronoiDiagramBuilder=ko,n.quadedge=_s,n.LengthIndexedLine=Jo,n.LengthLocationMap=Wo,n.LinearGeometryBuilder=Xo,n.LinearIterator=jo,n.LinearLocation=Bo,n.LocationIndexedLine=Uo},{}],31:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){switch(u.getType(t)){case"Point":return t;case"Polygon":var n=[];l.coordEach(t,function(t){n.push(t)});var i,c,h,f,g,d,p,_,v=s(t,e),m=v.geometry.coordinates,y=0,x=0,E=0,w=n.map(function(t){return[t[0]-m[0],t[1]-m[1]]});for(i=0;i<n.length-1;i++)f=(c=w[i])[0],d=c[1],g=(h=w[i+1])[0],E+=_=f*(p=h[1])-g*d,y+=(f+g)*_,x+=(d+p)*_;if(0===E)return v;var b=1/(6*(.5*E));return a.point([m[0]+b*y,m[1]+b*x],e);default:var I=o(t);return I?r(I,e):s(t,e)}}var o=i(t("@turf/convex")),s=i(t("@turf/centroid")),a=t("@turf/helpers"),u=t("@turf/invariant"),l=t("@turf/meta");e.exports=r,e.exports.default=r},{"@turf/centroid":33,"@turf/convex":55,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],32:[function(t,e,n){"use strict";function i(t,e){var n=r(t),i=(n[0]+n[2])/2,s=(n[1]+n[3])/2;return o.point([i,s],e)}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/bbox")),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/bbox":6,"@turf/helpers":79}],33:[function(t,e,n){"use strict";function i(t,e){var n=0,i=0,s=0;return r.coordEach(t,function(t){n+=t[0],i+=t[1],s++},!0),o.point([n/s,i/s],e)}var r=t("@turf/meta"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],34:[function(t,e,n){"use strict";function i(t,e,n){var i=(n=n||{}).steps||64,s=n.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be a number");i=i||64,s=s||t.properties||{};for(var a=[],u=0;u<i;u++)a.push(r(t,e,-360*u/i,n).geometry.coordinates);return a.push(a[0]),o.polygon([a],s)}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/destination")),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/destination":68,"@turf/helpers":79}],35:[function(t,e,n){"use strict";function i(t,e){var n="object"==typeof e?e.mutate:e;if(!t)throw new Error("geojson is required");var i=u.getType(t),o=[];switch(i){case"LineString":o=r(t);break;case"MultiLineString":case"Polygon":u.getCoords(t).forEach(function(t){o.push(r(t))});break;case"MultiPolygon":u.getCoords(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(r(t))}),o.push(e)});break;case"Point":return t;case"MultiPoint":var s={};u.getCoords(t).forEach(function(t){var e=t.join("-");s.hasOwnProperty(e)||(o.push(t),s[e]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=o,t):{type:i,coordinates:o}:!0===n?(t.geometry.coordinates=o,t):a.feature({type:i,coordinates:o},t.properties,t.bbox,t.id)}function r(t){var e=u.getCoords(t);if(2===e.length&&!o(e[0],e[1]))return e;var n,i,r,a=[],l=e.length-1;a.push(e[0]);for(var c=1;c<l;c++)n=e[c-1],i=e[c],s(n,r=e[c+1],i)||a.push(i);return a.push(r),a}function o(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(t,e,n){var i=n[0],r=n[1],o=t[0],s=t[1],a=e[0],u=e[1],l=a-o,c=u-s;return 0===(i-o)*c-(r-s)*l&&(Math.abs(l)>=Math.abs(c)?l>0?o<=i&&i<=a:a<=i&&i<=o:c>0?s<=r&&r<=u:u<=r&&r<=s)}var a=t("@turf/helpers"),u=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],36:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return r(t);case"FeatureCollection":return s(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return a(t);default:throw new Error("unknown GeoJSON type")}}function r(t){var e={type:"Feature"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}}),e.properties=o(t.properties),e.geometry=a(t.geometry),e}function o(t){var e={};return t?(Object.keys(t).forEach(function(n){var i=t[n];"object"==typeof i?(i.length&&(e[n]=i.map(function(t){return t})),e[n]=o(i)):e[n]=i}),e):e}function s(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return r(t)}),e}function a(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return a(t)}),e):(e.coordinates=u(t.coordinates),e)}function u(t){return"object"!=typeof t[0]?t.slice():t.map(function(t){return u(t)})}e.exports=i,e.exports.default=i},{}],37:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.minPoints,r=n.units;if(l.collectionOf(t,"Point","Input must contain Points"),null===e||void 0===e)throw new Error("maxDistance is required");if(!(Math.sign(e)>0))throw new Error("Invalid maxDistance");if(!(void 0===i||null===i||Math.sign(i)>0))throw new Error("Invalid minPoints");t=o(t,!0),i=i||3;var h=new c.DBSCAN,f=-1;return h.run(a.coordAll(t),u.convertLength(e,r),i,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"})}),h.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}var o=i(t("@turf/clone")),s=i(t("@turf/distance")),a=t("@turf/meta"),u=t("@turf/helpers"),l=t("@turf/invariant"),c=t("density-clustering");e.exports=r,e.exports.default=r},{"@turf/clone":36,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"density-clustering":42}],38:[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._datasetLength;r++)if(1!==this._visited[r]){this._visited[r]=1;var o=this._regionQuery(r);if(o.length<this.minPts)this.noise.push(r);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(r,s),this._expandCluster(s,o)}}return this.clusters},i.prototype._init=function(t,e,n,i){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),i&&(this.distance=i)},i.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var i=e[n];if(1!==this._visited[i]){this._visited[i]=1;var r=this._regionQuery(i);r.length>=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;n<this._datasetLength;n++)this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n);return e},i.prototype._mergeArrays=function(t,e){for(var n=e.length,i=0;i<n;i++){var r=e[i];t.indexOf(r)<0&&t.push(r)}return t},i.prototype._euclideanDistance=function(t,e){for(var n=0,i=Math.min(t.length,e.length);i--;)n+=(t[i]-e[i])*(t[i]-e[i]);return Math.sqrt(n)},void 0!==e&&e.exports&&(e.exports=i)},{}],39:[function(t,e,n){function i(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}i.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},i.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var r=!0;r;){r=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(c),a=0,u=0;u<c;u++)s[u]=0;for(var l=0;l<n;l++){var c=this.dataset[l].length;if(o===this.assignments[l]){for(u=0;u<c;u++)s[u]+=this.dataset[l][u];a++}}if(a>0){for(u=0;u<c;u++)s[u]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),r=!0}}return this.getClusters()},i.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},i.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,i=0;i<n;i++)(t=this.argmin(this.dataset[i],this.centroids,this.distance))!=this.assignments[i]&&(this.assignments[i]=t,e=!0);return e},i.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)void 0===e[t=this.assignments[n]]&&(e[t]=[]),e[t].push(n);return e},i.prototype.argmin=function(t,e,n){for(var i,r=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(i=n(t,e[a]))<r&&(r=i,o=a);return o},i.prototype.distance=function(t,e){for(var n=0,i=Math.min(t.length,e.length);i--;){var r=t[i]-e[i];n+=r*r}return Math.sqrt(n)},void 0!==e&&e.exports&&(e.exports=i)},{}],40:[function(t,e,n){function i(t,e,n,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,i)}if(void 0!==e&&e.exports)var r=t("./PriorityQueue.js");i.prototype.run=function(t,e,n,i){this._init(t,e,n,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var u=new r(null,null,"asc"),l=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,l,u),this._expandCluster(a,u))}return this.clusters},i.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var i=this._orderedList[e],r=this._reachability[i];t.push([i,r])}return t},i.prototype._init=function(t,e,n,i){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),i&&(this.distance=i)},i.prototype._updateQueue=function(t,e,n){var i=this;this._coreDistance=this._distanceToCore(t),e.forEach(function(e){if(void 0===i._processed[e]){var r=i.distance(i.dataset[t],i.dataset[e]),o=Math.max(i._coreDistance,r);void 0===i._reachability[e]?(i._reachability[e]=o,n.insert(e,o)):o<i._reachability[e]&&(i._reachability[e]=o,n.remove(e),n.insert(e,o))}})},i.prototype._expandCluster=function(t,e){for(var n=e.getElements(),i=0,r=n.length;i<r;i++){var o=n[i];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},i.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++)if(this._regionQuery(t,n).length>=this.minPts)return n},i.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],i=0,r=this.dataset.length;i<r;i++)this.distance(this.dataset[t],this.dataset[i])<e&&n.push(i);return n},i.prototype._euclideanDistance=function(t,e){for(var n=0,i=Math.min(t.length,e.length);i--;)n+=(t[i]-e[i])*(t[i]-e[i]);return Math.sqrt(n)},void 0!==e&&e.exports&&(e.exports=i)},{"./PriorityQueue.js":41}],41:[function(t,e,n){function i(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}i.prototype.insert=function(t,e){for(var n=this._queue.length,i=n;i--;){var r=this._priorities[i];"desc"===this._sorting?e>r&&(n=i):e<r&&(n=i)}this._insertAt(t,e,n)},i.prototype.remove=function(t){for(var e=this._queue.length;e--;)if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}},i.prototype.forEach=function(t){this._queue.forEach(t)},i.prototype.getElements=function(){return this._queue},i.prototype.getElementPriority=function(t){return this._priorities[t]},i.prototype.getPriorities=function(){return this._priorities},i.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},i.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var i=0;i<t.length;i++)this.insert(t[i],e[i])}n&&(this._sorting=n)},i.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},void 0!==e&&e.exports&&(e.exports=i)},{}],42:[function(t,e,n){void 0!==e&&e.exports&&(e.exports={DBSCAN:t("./DBSCAN.js"),KMEANS:t("./KMEANS.js"),OPTICS:t("./OPTICS.js"),PriorityQueue:t("./PriorityQueue.js")})},{"./DBSCAN.js":38,"./KMEANS.js":39,"./OPTICS.js":40,"./PriorityQueue.js":41}],43:[function(t,e,n){"use strict";function i(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var n=e.numberOfClusters,i=e.mutate;o.collectionOf(t,"Point","Input must contain Points");var u=t.features.length;(n=n||Math.round(Math.sqrt(u/2)))>u&&(n=u),!1!==i&&void 0!==i||(t=r(t,!0));var l=s.coordAll(t),c=l.slice(0,n),h=a(l,n,c),f={};return h.centroids.forEach(function(t,e){f[e]=t}),s.featureEach(t,function(t,e){var n=h.idxs[e];t.properties.cluster=n,t.properties.centroid=f[n]}),t}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clone")),o=t("@turf/invariant"),s=t("@turf/meta"),a=t("skmeans");e.exports=i,e.exports.default=i},{"@turf/clone":36,"@turf/invariant":84,"@turf/meta":105,skmeans:46}],44:[function(t,e,n){"use strict";e.exports={eudist:function(t,e,n){for(var i=t.length,r=0,o=0;o<i;o++){var s=(t[o]||0)-(e[o]||0);r+=s*s}return n?Math.sqrt(r):r},mandist:function(t,e,n){for(var i=t.length,r=0,o=0;o<i;o++)r+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(r):r},dist:function(t,e,n){var i=Math.abs(t-e);return n?i:i*i}}},{}],45:[function(t,e,n){"use strict";var i=t("./distance.js"),r=i.eudist,o=i.dist;e.exports={kmrand:function(t,e){for(var n={},i=[],r=e<<2,o=t.length,s=t[0].length>0;i.length<e&&r-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,i.push(a))}if(i.length<e)throw new Error("Error initializating clusters");return i},kmpp:function(t,e){var n=t[0].length?r:o,i=[],s=t.length,a=t[0].length>0,u=t[Math.floor(Math.random()*s)],l=a?u.join("_"):""+u;for(i.push(u),{}[l]=!0;i.length<e;){for(var c=[],h=i.length,f=0,g=[],d=0;d<s;d++){for(var p=1/0,_=0;_<h;_++){var v=n(t[d],i[_]);v<=p&&(p=v)}c[d]=p}for(var m=0;m<s;m++)f+=c[m];for(var y=0;y<s;y++)g[y]={i:y,v:t[y],pr:c[y]/f,cs:0};g.sort(function(t,e){return t.pr-e.pr}),g[0].cs=g[0].pr;for(var x=1;x<s;x++)g[x].cs=g[x-1].cs+g[x].pr;for(var E=Math.random(),w=0;w<s-1&&g[w++].cs<E;);i.push(g[w-1].v)}return i}}},{"./distance.js":44}],46:[function(t,e,n){"use strict";function i(t,e,n){n=n||[];for(var i=0;i<t;i++)n[i]=e;return n}var r=t("./distance.js"),o=t("./kinit.js"),s=r.eudist,a=(r.mandist,r.dist,o.kmrand),u=o.kmpp,l=1e4;e.exports=function(t,e,n,r){var o=[],c=[],h=[],f=[],g=!1,d=r||l,p=t.length,_=t[0].length,v=_>0,m=[];if(n)o="kmrand"==n?a(t,e):"kmpp"==n?u(t,e):n;else for(var y={};o.length<e;){var x=Math.floor(Math.random()*p);y[x]||(y[x]=!0,o.push(t[x]))}do{i(e,0,m);for(var E=0;E<p;E++){for(var w=1/0,b=0,I=0;I<e;I++)(f=v?s(t[E],o[I]):Math.abs(t[E]-o[I]))<=w&&(w=f,b=I);h[E]=b,m[b]++}for(var C=[],c=[],N=0;N<e;N++)C[N]=v?i(_,0,C[N]):0,c[N]=o[N];if(v){for(var S=0;S<e;S++)o[S]=[];for(var L=0;L<p;L++)for(var M=C[h[L]],P=t[L],R=0;R<_;R++)M[R]+=P[R];g=!0;for(var O=0;O<e;O++){for(var T=o[O],A=C[O],D=c[O],F=m[O],G=0;G<_;G++)T[G]=A[G]/F||0;if(g)for(var q=0;q<_;q++)if(D[q]!=T[q]){g=!1;break}}}else{for(var k=0;k<p;k++)C[h[k]]+=t[k];for(var B=0;B<e;B++)o[B]=C[B]/m[B]||0;g=!0;for(var j=0;j<e;j++)if(c[j]!=o[j]){g=!1;break}}g=g||--d<=0}while(!g);return{it:l-d,k:e,idxs:h,centroids:o}}},{"./distance.js":44,"./kinit.js":45}],47:[function(t,e,n){"use strict";function i(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("property is required");for(var i=r(t,e),o=Object.keys(i),s=0;s<o.length;s++){for(var a=o[s],l=i[a],c=[],h=0;h<l.length;h++)c.push(t.features[l[h]]);n(u.featureCollection(c),a,s)}}function r(t,e){var n={};return a.featureEach(t,function(t,i){var r=t.properties||{};if(r.hasOwnProperty(e)){var o=r[e];n.hasOwnProperty(o)?n[o].push(i):n[o]=[i]}}),n}function o(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return t.hasOwnProperty(e);if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(!o(t,e[i]))return!1;return!0}return s(t,e)}function s(t,e){for(var n=Object.keys(e),i=0;i<n.length;i++){var r=n[i];if(t[r]!==e[r])return!1}return!0}Object.defineProperty(n,"__esModule",{value:!0});var a=t("@turf/meta"),u=t("@turf/helpers");n.getCluster=function(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("filter is required");var n=[];return a.featureEach(t,function(t){o(t.properties,e)&&n.push(t)}),u.featureCollection(n)},n.clusterEach=i,n.clusterReduce=function(t,e,n,r){var o=r;return i(t,e,function(t,e,i){o=0===i&&void 0===r?t:n(o,t,e,i)}),o},n.createBins=r,n.applyFilter=o,n.propertiesContainsFilter=s,n.filterProperties=function(t,e){if(!e)return{};if(!e.length)return{};for(var n={},i=0;i<e.length;i++){var r=e[i];t.hasOwnProperty(r)&&(n[r]=t[r])}return n}},{"@turf/helpers":79,"@turf/meta":105}],48:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){var r=a(6),u=e.features.map(function(t){return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:t.properties[n]}});return r.load(u),t.features.forEach(function(t){t.properties||(t.properties={});var e=o(t),n=[];r.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}).forEach(function(e){s([e.minX,e.minY],t)&&n.push(e.property)}),t.properties[i]=n}),t}var o=i(t("@turf/bbox")),s=i(t("@turf/boolean-point-in-polygon")),a=t("rbush");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/boolean-point-in-polygon":24,rbush:50}],49:[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 g=t[e],d=n,p=s;for(r(t,n,e),a(t[s],g)>0&&r(t,n,s);d<p;){for(r(t,d,p),d++,p--;a(t[d],g)<0;)d++;for(;a(t[p],g)>0;)p--}0===a(t[n],g)?r(t,n,p):r(t,++p,s),p<=e&&(n=p+1),e<=p&&(s=p-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e){return t<e?-1:t>e?1:0}e.exports=i},{}],50:[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<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=_(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],a(r,t.leaf?i(o):o);return r}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function g(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function d(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,n,i,r){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=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(!p(t,e))return n;for(var r,o,s,a,u=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],p(t,a=e.leaf?i(s):s)&&(e.leaf?n.push(s):d(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!p(t,e))return!1;for(var i,r,o,s,a=[];e;){for(i=0,r=e.children.length;i<r;i++)if(o=e.children[i],s=e.leaf?n(o):o,p(t,s)){if(e.leaf||d(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=_([]),this},remove:function(t,e){if(!t)return this;for(var n,i,o,s,a=this.data,u=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),i=l[l.length-1],n=c.pop(),s=!0),a.leaf&&-1!==(o=r(t,a.children,e)))return a.children.splice(o,1),l.push(a),this._condense(l),this;s||a.leaf||!d(a,u)?i?(n++,a=i.children[n],s=!1):a=null:(l.push(a),c.push(n),n=0,i=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:u,compareMinY:l,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,i){var r,s=n-e+1,a=this._maxEntries;if(s<=a)return r=_(t.slice(e,n+1)),o(r,this.toBBox),r;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(r=_([])).leaf=!1,r.height=i;var u,l,c,h,f=Math.ceil(s/a),g=f*Math.ceil(Math.sqrt(a));for(v(t,e,n,g,this.compareMinX),u=e;u<=n;u+=g)for(v(t,u,c=Math.min(u+g-1,n),f,this.compareMinY),l=u;l<=c;l+=f)h=Math.min(l+f-1,c),r.children.push(this._build(t,l,h,i-1));return o(r,this.toBBox),r},_chooseSubtree:function(t,e,n,i){for(var r,o,s,a,u,l,h,g;;){if(i.push(e),e.leaf||i.length-1===n)break;for(h=g=1/0,r=0,o=e.children.length;r<o;r++)u=c(s=e.children[r]),(l=f(t,s)-u)<g?(g=l,h=u<h?u:h,a=s):l===g&&u<h&&(h=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var i=this.toBBox,r=n?t:i(t),o=[],s=this._chooseSubtree(r,this.data,e,o);for(s.children.push(t),a(s,r);e>=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=_(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=_([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++)a=g(r=s(t,0,i,this.toBBox),o=s(t,i,n,this.toBBox)),u=c(r)+c(o),a<l?(l=a,f=i,h=u<h?u:h):a===l&&u<h&&(h=u,f=i);return f},_chooseSplitAxis:function(t,e,n){var i=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},_allDistMargin:function(t,e,n,i){t.children.sort(i);var r,o,u=this.toBBox,l=s(t,0,e,u),c=s(t,n-e,n,u),f=h(l)+h(c);for(r=e;r<n-e;r++)o=t.children[r],a(l,t.leaf?u(o):o),f+=h(l);for(r=n-e-1;r>=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).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:49}],51:[function(t,e,n){"use strict";function i(t){function e(t,e,i){i?n[e].coordinates=n[e].coordinates.concat(t.geometry.coordinates):n[e].coordinates.push(t.geometry.coordinates),n[e].properties.push(t.properties)}var n={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(n).reduce(function(t,e){return t[e.replace("Multi","")]=e,t},{});return o.featureEach(t,function(t){t.geometry&&(n[t.geometry.type]?e(t,t.geometry.type,!0):i[t.geometry.type]&&e(t,i[t.geometry.type],!1))}),r.featureCollection(Object.keys(n).filter(function(t){return n[t].coordinates.length}).sort().map(function(t){var e={type:t,coordinates:n[t].coordinates},i={collectedProperties:n[t].properties};return r.feature(e,i)}))}var r=t("@turf/helpers"),o=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],52:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==d.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=g(t));var i=[],r=p.lineReduce(t,function(t,e){var n=s(t,e);return n||(i.push(t),e)});return r&&i.push(r),i.length?1===i.length?i[0]:_.multiLineString(i.map(function(t){return t.coordinates})):null}function o(t){return t[0].toString()+","+t[1].toString()}function s(t,e){var n,i=t.geometry.coordinates,r=e.geometry.coordinates,s=o(i[0]),a=o(i[i.length-1]),u=o(r[0]),l=o(r[r.length-1]);if(s===l)n=r.concat(i.slice(1));else if(u===a)n=i.concat(r.slice(1));else if(s===u)n=i.slice(1).reverse().concat(r);else{if(a!==l)return null;n=i.concat(r.reverse().slice(1))}return _.lineString(n)}function a(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==d.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=g(t));var i=[];p.flattenEach(t,function(t){i.push(t.geometry)});var r=m.topology({geoms:_.geometryCollection(i).geometry});return v.merge(r,r.objects.geoms.geometries)}function u(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==d.getType(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=g(t));var i=l(t);if(!i)throw new Error("geojson must be homogenous");switch(i){case"LineString":return r(t,e);case"Polygon":return a(t,e);default:throw new Error(i+" is not supported")}}function l(t){var e={};p.flattenEach(t,function(t){e[t.geometry.type]=!0});var n=Object.keys(e);return 1===n.length?n[0]:null}function c(t,e){if(e=e||{},!_.isObject(e))throw new Error("options is invalid");if(!t)throw new Error("points is required");var n=e.maxEdge||1/0;if(!_.isNumber(n))throw new Error("maxEdge is invalid");var i=h(t),r=f(i);if(r.features=r.features.filter(function(t){var i=t.geometry.coordinates[0][0],r=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=y(i,r,e),a=y(r,o,e),u=y(i,o,e);return s<=n&&a<=n&&u<=n}),r.features.length<1)return null;var o=u(r,e);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),_.feature(o)}function h(t){var e=[],n={};return p.featureEach(t,function(t){if(t.geometry){var i=t.geometry.coordinates.join("-");n.hasOwnProperty(i)||(e.push(t),n[i]=!0)}}),_.featureCollection(e)}var f=i(t("@turf/tin")),g=i(t("@turf/clone")),d=t("@turf/invariant"),p=t("@turf/meta"),_=t("@turf/helpers"),v=t("topojson-client"),m=t("topojson-server"),y=i(t("@turf/distance"));e.exports=c,e.exports.default=c},{"@turf/clone":36,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/tin":146,"topojson-client":53,"topojson-server":54}],53:[function(t,e,n){!function(t,i){i("object"==typeof n&&void 0!==e?n:t.topojson=t.topojson||{})}(this,function(t){"use strict";function e(t,e){var i=e.id,r=e.bbox,o=null==e.properties?{}:e.properties,s=n(t,e);return null==i&&null==r?{type:"Feature",properties:o,geometry:s}:null==r?{type:"Feature",id:i,properties:o,geometry:s}:{type:"Feature",id:i,bbox:r,properties:o,geometry:s}}function n(t,e){function n(t,e){e.length&&e.pop();for(var n=h[t<0?~t:t],i=0,r=n.length;i<r;++i)e.push(l(n[i],i));t<0&&c(e,r)}function i(t){return l(t)}function r(t){for(var e=[],i=0,r=t.length;i<r;++i)n(t[i],e);return e.length<2&&e.push(e[0]),e}function o(t){for(var e=r(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(o)}function a(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(a)};case"Point":e=i(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(i);break;case"LineString":e=r(t.arcs);break;case"MultiLineString":e=t.arcs.map(r);break;case"Polygon":e=s(t.arcs);break;case"MultiPolygon":e=t.arcs.map(s);break;default:return null}return{type:n,coordinates:e}}var l=u(t.transform),h=t.arcs;return a(e)}function i(t,e,n){var i,o,s;if(arguments.length>1)i=r(t,e,n);else for(o=0,i=new Array(s=t.arcs.length);o<s;++o)i[o]=o;return{type:"MultiLineString",arcs:h(t,i)}}function r(t,e,n){function i(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:u})}function r(t){t.forEach(i)}function o(t){t.forEach(r)}function s(t){t.forEach(o)}function a(t){switch(u=t,t.type){case"GeometryCollection":t.geometries.forEach(a);break;case"LineString":r(t.arcs);break;case"MultiLineString":case"Polygon":o(t.arcs);break;case"MultiPolygon":s(t.arcs)}}var u,l=[],c=[];return a(e),c.forEach(null==n?function(t){l.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}function o(t){for(var e,n=-1,i=t.length,r=t[i-1],o=0;++n<i;)e=r,r=t[n],o+=e[0]*r[1]-e[1]*r[0];return Math.abs(o)}function s(t,e){function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Polygon":r(t.arcs);break;case"MultiPolygon":t.arcs.forEach(r)}}function r(t){t.forEach(function(e){e.forEach(function(e){(a[e=e<0?~e:e]||(a[e]=[])).push(t)})}),u.push(t)}function s(e){return o(n(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var a={},u=[],l=[];return e.forEach(i),u.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,l.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){a[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),u.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:l.map(function(e){var n,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){a[t<0?~t:t].length<2&&i.push(t)})})}),i=h(t,i),(n=i.length)>1)for(var r,o,u=1,l=s(i[0]);u<n;++u)(r=s(i[u]))>l&&(o=i[0],i[0]=i[u],i[u]=o,l=r);return i})}}var a=function(t){return t},u=function(t){if(null==t)return a;var e,n,i=t.scale[0],r=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*i+o,c[1]=(n+=t[1])*r+s;u<l;)c[u]=t[u],++u;return c}},l=function(t){function e(t){(t=r(t))[0]<o&&(o=t[0]),t[0]>a&&(a=t[0]),t[1]<s&&(s=t[1]),t[1]>l&&(l=t[1])}function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var i,r=u(t.transform),o=1/0,s=o,a=-o,l=-o;t.arcs.forEach(function(t){for(var e,n=-1,i=t.length;++n<i;)(e=r(t[n],n))[0]<o&&(o=e[0]),e[0]>a&&(a=e[0]),e[1]<s&&(s=e[1]),e[1]>l&&(l=e[1])});for(i in t.objects)n(t.objects[i]);return[o,s,a,l]},c=function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n},h=function(t,e){function n(e){var n,i=t.arcs[e<0?~e:e],r=i[0];return t.transform?(n=[0,0],i.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=i[i.length-1],e<0?[n,r]:[r,n]}function i(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){r[t<0?~t:t]=1}),a.push(i)}}var r={},o={},s={},a=[],u=-1;return e.forEach(function(n,i){var r,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=e[++u],e[u]=n,e[i]=r)}),e.forEach(function(t){var e,i,r=n(t),a=r[0],u=r[1];if(e=s[a])if(delete s[e.end],e.push(t),e.end=u,i=o[u]){delete o[i.start];var l=i===e?e:e.concat(i);o[l.start=e.start]=s[l.end=i.end]=l}else o[e.start]=s[e.end]=e;else if(e=o[u])if(delete o[e.start],e.unshift(t),e.start=a,i=s[a]){delete s[i.end];var c=i===e?e:i.concat(e);o[c.start=i.start]=s[c.end=e.end]=c}else o[e.start]=s[e.end]=e;else o[(e=[t]).start=a]=s[e.end=u]=e}),i(s,o),i(o,s),e.forEach(function(t){r[t<0?~t:t]||a.push([t])}),a},f=function(t,e){for(var n=0,i=t.length;n<i;){var r=n+i>>>1;t[r]<e?n=r+1:i=r}return n},g=function(t){if(null==t)return a;var e,n,i=t.scale[0],r=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,l=t.length,c=new Array(l),h=Math.round((t[0]-o)/i),f=Math.round((t[1]-s)/r);for(c[0]=h-e,e=h,c[1]=f-n,n=f;u<l;)c[u]=t[u],++u;return c}};t.bbox=l,t.feature=function(t,n){return"GeometryCollection"===n.type?{type:"FeatureCollection",features:n.geometries.map(function(n){return e(t,n)})}:e(t,n)},t.mesh=function(t){return n(t,i.apply(this,arguments))},t.meshArcs=i,t.merge=function(t){return n(t,s.apply(this,arguments))},t.mergeArcs=s,t.neighbors=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var n=r[t];n?n.push(e):r[t]=[e]})}function n(t,n){t.forEach(function(t){e(t,n)})}function i(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){i(t,e)}):t.type in s&&s[t.type](t.arcs,e)}var r={},o=t.map(function(){return[]}),s={LineString:e,MultiLineString:n,Polygon:n,MultiPolygon:function(t,e){t.forEach(function(t){n(t,e)})}};t.forEach(i);for(var a in r)for(var u=r[a],l=u.length,c=0;c<l;++c)for(var h=c+1;h<l;++h){var g,d=u[c],p=u[h];(g=o[d])[a=f(g,p)]!==p&&g.splice(a,0,p),(g=o[p])[a=f(g,d)]!==d&&g.splice(a,0,d)}return o},t.quantize=function(t,e){function n(t){return f(t)}function i(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(i)};break;case"Point":e={type:"Point",coordinates:n(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(n)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}if(t.transform)throw new Error("already quantized");if(e&&e.scale)c=t.bbox;else{if(!((r=Math.floor(e))>=2))throw new Error("n must be 鈮�2");var r,o=(c=t.bbox||l(t))[0],s=c[1],a=c[2],u=c[3];e={scale:[a-o?(a-o)/(r-1):1,u-s?(u-s)/(r-1):1],translate:[o,s]}}var c,h,f=g(e),d=t.objects,p={};for(h in d)p[h]=i(d[h]);return{type:"Topology",bbox:c,transform:e,objects:p,arcs:t.arcs.map(function(t){var e,n=0,i=1,r=t.length,o=new Array(r);for(o[0]=f(t[0],0);++n<r;)((e=f(t[n],n))[0]||e[1])&&(o[i++]=e);return 1===i&&(o[i++]=[0,0]),o.length=i,o})}},t.transform=u,t.untransform=g,Object.defineProperty(t,"__esModule",{value:!0})})},{}],54:[function(t,e,n){!function(t,i){i("object"==typeof n&&void 0!==e?n:t.topojson=t.topojson||{})}(this,function(t){"use strict";function e(t,e,i,r){n(t,e,i),n(t,e,e+r),n(t,e+r,i)}function n(t,e,n){for(var i,r=e+(n---e>>1);e<r;++e,--n)i=t[e],t[e]=t[n],t[n]=i}function i(t){return null==t?{type:null}:("FeatureCollection"===t.type?r:"Feature"===t.type?o:s)(t)}function r(t){var e={type:"GeometryCollection",geometries:t.features.map(o)};return null!=t.bbox&&(e.bbox=t.bbox),e}function o(t){var e,n=s(t.geometry);null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox);for(e in t.properties){n.properties=t.properties;break}return n}function s(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(s)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}function a(t){var e,n=t[0],i=t[1];return i<n&&(e=n,n=i,i=e),n+31*i}function u(t,e){var n,i=t[0],r=t[1],o=e[0],s=e[1];return r<i&&(n=i,i=r,r=n),s<o&&(n=o,o=s,s=n),i===o&&r===s}var l=function(t){function e(t){null!=t&&l.hasOwnProperty(t.type)&&l[t.type](t)}function n(t){var e=t[0],n=t[1];e<o&&(o=e),e>a&&(a=e),n<s&&(s=n),n>u&&(u=n)}function i(t){t.forEach(n)}function r(t){t.forEach(i)}var o=1/0,s=1/0,a=-1/0,u=-1/0,l={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){i(t.arcs)},MultiLineString:function(t){t.arcs.forEach(i)},Polygon:function(t){t.arcs.forEach(i)},MultiPolygon:function(t){t.arcs.forEach(r)}};for(var c in t)e(t[c]);return a>=o&&u>=s?[o,s,a,u]:void 0},c=function(t,e,n,i,r){3===arguments.length&&(i=Array,r=null);for(var o=new i(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),s=t-1,a=0;a<t;++a)o[a]=r;return{add:function(i){for(var a=e(i)&s,u=o[a],l=0;u!=r;){if(n(u,i))return!0;if(++l>=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=i,!0},has:function(i){for(var a=e(i)&s,u=o[a],l=0;u!=r;){if(n(u,i))return!0;if(++l>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var i=o[e];i!=r&&t.push(i)}return t}}},h=function(t,e,n,i,r,o){3===arguments.length&&(i=o=Array,r=null);for(var s=new i(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=new o(t),u=t-1,l=0;l<t;++l)s[l]=r;return{set:function(i,o){for(var l=e(i)&u,c=s[l],h=0;c!=r;){if(n(c,i))return a[l]=o;if(++h>=t)throw new Error("full hashmap");c=s[l=l+1&u]}return s[l]=i,a[l]=o,o},maybeSet:function(i,o){for(var l=e(i)&u,c=s[l],h=0;c!=r;){if(n(c,i))return a[l];if(++h>=t)throw new Error("full hashmap");c=s[l=l+1&u]}return s[l]=i,a[l]=o,o},get:function(i,o){for(var l=e(i)&u,c=s[l],h=0;c!=r;){if(n(c,i))return a[l];if(++h>=t)break;c=s[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e<n;++e){var i=s[e];i!=r&&t.push(i)}return t}}},f=function(t,e){return t[0]===e[0]&&t[1]===e[1]},g=new ArrayBuffer(16),d=new Float64Array(g),p=new Uint32Array(g),_=function(t){d[0]=t[0],d[1]=t[1];var e=p[0]^p[1];return 2147483647&(e=e<<5^e>>7^p[2]^p[3])},v=function(t){function e(t,e,n,i){if(p[n]!==t){p[n]=t;var r=v[n];if(r>=0){var o=m[n];r===e&&o===i||r===i&&o===e||(++x,y[n]=1)}else v[n]=e,m[n]=i}}function n(t){return _(u[t])}function i(t,e){return f(u[t],u[e])}var r,o,s,a,u=t.coordinates,l=t.lines,g=t.rings,d=function(){for(var t=h(1.4*u.length,n,i,Int32Array,-1,Int32Array),e=new Int32Array(u.length),r=0,o=u.length;r<o;++r)e[r]=t.maybeSet(r,r);return e}(),p=new Int32Array(u.length),v=new Int32Array(u.length),m=new Int32Array(u.length),y=new Int8Array(u.length),x=0;for(r=0,o=u.length;r<o;++r)p[r]=v[r]=m[r]=-1;for(r=0,o=l.length;r<o;++r){var E=l[r],w=E[0],b=E[1];for(s=d[w],a=d[++w],++x,y[s]=1;++w<=b;)e(r,s,s=a,a=d[w]);++x,y[a]=1}for(r=0,o=u.length;r<o;++r)p[r]=-1;for(r=0,o=g.length;r<o;++r){var I=g[r],C=I[0]+1,N=I[1];for(e(r,d[N-1],s=d[C-1],a=d[C]);++C<=N;)e(r,s,s=a,a=d[C])}p=v=m=null;var S,L=c(1.4*x,_,f);for(r=0,o=u.length;r<o;++r)y[S=d[r]]&&L.add(u[S]);return L},m=function(t){var n,i,r,o=v(t),s=t.coordinates,a=t.lines,u=t.rings;for(i=0,r=a.length;i<r;++i)for(var l=a[i],c=l[0],h=l[1];++c<h;)o.has(s[c])&&(n={0:c,1:l[1]},l[1]=c,l=l.next=n);for(i=0,r=u.length;i<r;++i)for(var f=u[i],g=f[0],d=g,p=f[1],_=o.has(s[g]);++d<p;)o.has(s[d])&&(_?(n={0:d,1:f[1]},f[1]=d,f=f.next=n):(e(s,g,p,p-d),s[p]=s[g],_=!0,d=g));return t},y=function(t){function e(t){var e,r,o,s,a,u,l,c;if(o=m.get(e=g[t[0]]))for(l=0,c=o.length;l<c;++l)if(s=o[l],n(s,t))return t[0]=s[0],void(t[1]=s[1]);if(a=m.get(r=g[t[1]]))for(l=0,c=a.length;l<c;++l)if(u=a[l],i(u,t))return t[1]=u[0],void(t[0]=u[1]);o?o.push(t):m.set(e,[t]),a?a.push(t):m.set(r,[t]),y.push(t)}function n(t,e){var n=t[0],i=e[0],r=t[1];if(n-r!=i-e[1])return!1;for(;n<=r;++n,++i)if(!f(g[n],g[i]))return!1;return!0}function i(t,e){var n=t[0],i=e[0],r=t[1],o=e[1];if(n-r!=i-o)return!1;for(;n<=r;++n,--o)if(!f(g[n],g[o]))return!1;return!0}function r(t,e){var n=t[0],i=e[0],r=t[1]-n;if(r!==e[1]-i)return!1;for(var o=s(t),a=s(e),u=0;u<r;++u)if(!f(g[n+(u+o)%r],g[i+(u+a)%r]))return!1;return!0}function o(t,e){var n=t[0],i=e[0],r=t[1],o=e[1],a=r-n;if(a!==o-i)return!1;for(var u=s(t),l=a-s(e),c=0;c<a;++c)if(!f(g[n+(c+u)%a],g[o-(c+l)%a]))return!1;return!0}function s(t){for(var e=t[0],n=t[1],i=e,r=i,o=g[i];++i<n;){var s=g[i];(s[0]<o[0]||s[0]===o[0]&&s[1]<o[1])&&(r=i,o=s)}return r-e}var a,u,l,c,g=t.coordinates,d=t.lines,p=t.rings,v=d.length+p.length;for(delete t.lines,delete t.rings,l=0,c=d.length;l<c;++l)for(a=d[l];a=a.next;)++v;for(l=0,c=p.length;l<c;++l)for(u=p[l];u=u.next;)++v;var m=h(2*v*1.4,_,f),y=t.arcs=[];for(l=0,c=d.length;l<c;++l){a=d[l];do{e(a)}while(a=a.next)}for(l=0,c=p.length;l<c;++l)if((u=p[l]).next)do{e(u)}while(u=u.next);else!function(t){var e,n,i,a,u;if(n=m.get(e=g[t[0]]))for(a=0,u=n.length;a<u;++a){if(i=n[a],r(i,t))return t[0]=i[0],void(t[1]=i[1]);if(o(i,t))return t[0]=i[1],void(t[1]=i[0])}if(n=m.get(e=g[t[0]+s(t)]))for(a=0,u=n.length;a<u;++a){if(i=n[a],r(i,t))return t[0]=i[0],void(t[1]=i[1]);if(o(i,t))return t[0]=i[1],void(t[1]=i[0])}n?n.push(t):m.set(e,[t]),y.push(t)}(u);return t},x=function(t){for(var e=-1,n=t.length;++e<n;){for(var i,r,o=t[e],s=0,a=1,u=o.length,l=o[0],c=l[0],h=l[1];++s<u;)i=(l=o[s])[0],r=l[1],i===c&&r===h||(o[a++]=[i-c,r-h],c=i,h=r);1===a&&(o[a++]=[0,0]),o.length=a}return t},E=function(t){function e(t){t&&l.hasOwnProperty(t.type)&&l[t.type](t)}function n(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var i={0:o-n+1,1:o};return s.push(i),i}function i(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var i={0:o-n+1,1:o};return a.push(i),i}function r(t){return t.map(i)}var o=-1,s=[],a=[],u=[],l={GeometryCollection:function(t){t.geometries.forEach(e)},LineString:function(t){t.arcs=n(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(n)},Polygon:function(t){t.arcs=t.arcs.map(i)},MultiPolygon:function(t){t.arcs=t.arcs.map(r)}};for(var c in t)e(t[c]);return{type:"Topology",coordinates:u,lines:s,rings:a,objects:t}},w=function(t){var e,n={};for(e in t)n[e]=i(t[e]);return n},b=function(t,e,n){function i(t){return[Math.round((t[0]-l)*g),Math.round((t[1]-c)*d)]}function r(t,e){for(var n,i,r,o,s,a=-1,u=0,h=t.length,f=new Array(h);++a<h;)n=t[a],o=Math.round((n[0]-l)*g),s=Math.round((n[1]-c)*d),o===i&&s===r||(f[u++]=[i=o,r=s]);for(f.length=u;u<e;)u=f.push([f[0][0],f[0][1]]);return f}function o(t){return r(t,2)}function s(t){return r(t,4)}function a(t){return t.map(s)}function u(t){null!=t&&p.hasOwnProperty(t.type)&&p[t.type](t)}var l=e[0],c=e[1],h=e[2],f=e[3],g=h-l?(n-1)/(h-l):1,d=f-c?(n-1)/(f-c):1,p={GeometryCollection:function(t){t.geometries.forEach(u)},Point:function(t){t.coordinates=i(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(i)},LineString:function(t){t.arcs=o(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(o)},Polygon:function(t){t.arcs=a(t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(a)}};for(var _ in t)u(t[_]);return{scale:[1/g,1/d],translate:[l,c]}};t.topology=function(t,e){function n(t){t&&d.hasOwnProperty(t.type)&&d[t.type](t)}function i(t){var e=[];do{var n=g.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function r(t){return t.map(i)}var o=l(t=w(t)),s=e>0&&o&&b(t,o,e),c=y(m(E(t))),f=c.coordinates,g=h(1.4*c.arcs.length,a,u);t=c.objects,c.bbox=o,c.arcs=c.arcs.map(function(t,e){return g.set(t,e),f.slice(t[0],t[1]+1)}),delete c.coordinates,f=null;var d={GeometryCollection:function(t){t.geometries.forEach(n)},LineString:function(t){t.arcs=i(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(i)},Polygon:function(t){t.arcs=t.arcs.map(i)},MultiPolygon:function(t){t.arcs=t.arcs.map(r)}};for(var p in t)n(t[p]);return s&&(c.transform=s,c.arcs=x(c.arcs)),c},Object.defineProperty(t,"__esModule",{value:!0})})},{}],55:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.concavity||1/0,i=[];if(r.coordEach(t,function(t){i.push([t[0],t[1]])}),!i.length)return null;var a=s(i,n);return a.length>3?o.polygon([a]):null}var r=t("@turf/meta"),o=t("@turf/helpers"),s=t("concaveman");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105,concaveman:56}],56:[function(t,e,n){"use strict";function i(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var i,o=h(t),s=_(16,["[0]","[1]","[0]","[1]"]).load(t),a=[],u=0;u<o.length;u++){var l=o[u];s.remove(l),i=f(l,i),a.push(i)}var d=_(16);for(u=0;u<a.length;u++)d.insert(c(a[u]));for(var p=e*e,v=n*n;a.length;){var m=a.shift(),y=m.p,x=m.next.p,E=g(y,x);if(!(E<v)){var w=E/p;(l=r(s,m.prev.p,y,x,m.next.next.p,w,d))&&Math.min(g(l,y),g(l,x))<=w&&(a.push(m),a.push(f(l,m)),s.remove(l),d.remove(m),d.insert(c(m)),d.insert(c(m.next)))}}m=i;var b=[];do{b.push(m.p),m=m.next}while(m!==i);return b.push(m.p),b}function r(t,e,n,i,r,a,l){for(var c=new m(null,o),h=t.data;h;){for(var f=0;f<h.children.length;f++){var g=h.children[f],p=h.leaf?d(g,n,i):s(n,i,g);p>a||c.push({node:g,dist:p})}for(;c.length&&!c.peek().node.children;){var _=c.pop(),v=_.node,y=d(v,e,n),x=d(v,i,r);if(_.dist<y&&_.dist<x&&u(n,v,l)&&u(i,v,l))return v}(h=c.pop())&&(h=h.node)}return null}function o(t,e){return t.dist-e.dist}function s(t,e,n){if(a(t,n)||a(e,n))return 0;var i=p(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===i)return 0;var r=p(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===r)return 0;var o=p(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=p(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(i,r,o,s)}function a(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function u(t,e,n){for(var i=Math.min(t[0],e[0]),r=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:i,minY:r,maxX:o,maxY:s}),u=0;u<a.length;u++)if(l(a[u].p,a[u].next.p,t,e))return!1;return!0}function l(t,e,n,i){return t!==i&&e!==n&&x(t,e,n)>0!=x(t,e,i)>0&&x(n,i,t)>0!=x(n,i,e)>0}function c(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function h(t){for(var e=t[0],n=t[0],i=t[0],r=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>i[0]&&(i=s),s[1]<n[1]&&(n=s),s[1]>r[1]&&(r=s)}var a=[e,n,i,r],u=a.slice();for(o=0;o<t.length;o++)y(t[o],a)||u.push(t[o]);var l=v(u),c=[];for(o=0;o<l.length;o++)c.push(u[l[o]]);return c}function f(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function g(t,e){var n=t[0]-e[0],i=t[1]-e[1];return n*n+i*i}function d(t,e,n){var i=e[0],r=e[1],o=n[0]-i,s=n[1]-r;if(0!==o||0!==s){var a=((t[0]-i)*o+(t[1]-r)*s)/(o*o+s*s);a>1?(i=n[0],r=n[1]):a>0&&(i+=o*a,r+=s*a)}return o=t[0]-i,s=t[1]-r,o*o+s*s}function p(t,e,n,i,r,o,s,a){var u,l,c,h,f=n-t,g=i-e,d=s-r,p=a-o,_=t-r,v=e-o,m=f*f+g*g,y=f*d+g*p,x=d*d+p*p,E=f*_+g*v,w=d*_+p*v,b=m*x-y*y,I=b,C=b;0===b?(l=0,I=1,h=w,C=x):(h=m*w-y*E,(l=y*w-x*E)<0?(l=0,h=w,C=x):l>I&&(l=I,h=w+y,C=x)),h<0?(h=0,-E<0?l=0:-E>m?l=I:(l=-E,I=m)):h>C&&(h=C,-E+y<0?l=0:-E+y>m?l=I:(l=-E+y,I=m)),u=0===l?0:l/I;var N=(1-(c=0===h?0:h/C))*r+c*s-((1-u)*t+u*n),S=(1-c)*o+c*a-((1-u)*e+u*i);return N*N+S*S}var _=t("rbush"),v=t("monotone-convex-hull-2d"),m=t("tinyqueue"),y=t("point-in-polygon"),x=t("robust-orientation")[3];e.exports=i,e.exports.default=i},{"monotone-convex-hull-2d":57,"point-in-polygon":58,rbush:60,"robust-orientation":61,tinyqueue:65}],57:[function(t,e,n){"use strict";e.exports=function(t){var e=t.length;if(e<3){for(var n=new Array(e),r=0;r<e;++r)n[r]=r;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}for(var o=new Array(e),r=0;r<e;++r)o[r]=r;o.sort(function(e,n){var i=t[e][0]-t[n][0];return i||t[e][1]-t[n][1]});for(var s=[o[0],o[1]],a=[o[0],o[1]],r=2;r<e;++r){for(var u=o[r],l=t[u],c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],l)<=0;)c-=1,s.pop();for(s.push(u),c=a.length;c>1&&i(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,r=0,f=s.length;r<f;++r)n[h++]=s[r];for(var g=a.length-2;g>0;--g)n[h++]=a[g];return n};var i=t("robust-orientation")[3]},{"robust-orientation":61}],58:[function(t,e,n){e.exports=function(t,e){for(var n=t[0],i=t[1],r=!1,o=0,s=e.length-1;o<e.length;s=o++){var a=e[o][0],u=e[o][1],l=e[s][0],c=e[s][1];u>i!=c>i&&n<(l-a)*(i-u)/(c-u)+a&&(r=!r)}return r}},{}],59:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],60:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{dup:50,quickselect:59}],61:[function(t,e,n){"use strict";function i(t,e){for(var n=new Array(t.length-1),i=1;i<t.length;++i)for(var r=n[i-1]=new Array(t.length-1),o=0,s=0;o<t.length;++o)o!==e&&(r[s++]=t[i][o]);return n}function r(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var i=0;i<t;++i)e[n][i]=["m",i,"[",t-n-1,"]"].join("")}return e}function o(t){return 1&t?"-":""}function s(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>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;n<t.length;++n)e.push(["scale(",s(a(i(t,n))),",",o(n),t[0][n],")"].join(""));return e}function u(t){for(var e=[],n=[],o=r(t),u=[],l=0;l<t;++l)0==(1&l)?e.push.apply(e,a(i(o,l))):n.push.apply(n,a(i(o,l))),u.push("m"+l);var d=s(e),p=s(n),_="orientation"+t+"Exact",v=["function ",_,"(",u.join(),"){var p=",d,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",_].join("");return new Function("sum","prod","scale","sub",v)(h,c,f,g)}function l(t){var e=v[t.length];return e||(e=v[t.length]=u(t.length)),e.apply(void 0,t)}var c=t("two-product"),h=t("robust-sum"),f=t("robust-scale"),g=t("robust-subtract"),d=5,p=u(3),_=u(4),v=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var i,r=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),s=r-o;if(r>0){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:p(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],g=o*l,d=s*u,p=s*a,v=r*l,m=r*u,y=o*a,x=c*(g-d)+h*(p-v)+f*(m-y),E=7.771561172376103e-16*((Math.abs(g)+Math.abs(d))*Math.abs(c)+(Math.abs(p)+Math.abs(v))*Math.abs(h)+(Math.abs(m)+Math.abs(y))*Math.abs(f));return x>E||-x>E?x:_(t,e,n,i)}];!function(){for(;v.length<=d;)v.push(u(v.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<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(r.join(""));var o=Function.apply(void 0,n);for(e.exports=o.apply(void 0,[l].concat(v)),i=0;i<=d;++i)e.exports[i]=v[i]}()},{"robust-scale":62,"robust-subtract":63,"robust-sum":64,"two-product":66}],62:[function(t,e,n){"use strict";var i=t("two-product"),r=t("two-sum");e.exports=function(t,e){var n=t.length;if(1===n){var o=i(t[0],e);return o[0]?o:[o[1]]}var s=new Array(2*n),a=[.1,.1],u=[.1,.1],l=0;i(t[0],e,a),a[0]&&(s[l++]=a[0]);for(var c=1;c<n;++c){i(t[c],e,u);var h=a[1];r(h,u[0],a),a[0]&&(s[l++]=a[0]);var f=u[1],g=a[1],d=f+g,p=g-(d-f);a[1]=d,p&&(s[l++]=p)}return a[1]&&(s[l++]=a[1]),0===l&&(s[l++]=0),s.length=l,s}},{"two-product":66,"two-sum":67}],63:[function(t,e,n){"use strict";function i(t,e){var n=t+e,i=n-t,r=t-(n-i)+(e-i);return r?[r,n]:[n]}e.exports=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return i(t[0],-e[0]);var o,s,a=n+r,u=new Array(a),l=0,c=0,h=0,f=Math.abs,g=t[c],d=f(g),p=-e[h],_=f(p);d<_?(s=g,(c+=1)<n&&(d=f(g=t[c]))):(s=p,(h+=1)<r&&(_=f(p=-e[h]))),c<n&&d<_||h>=r?(o=g,(c+=1)<n&&(d=f(g=t[c]))):(o=p,(h+=1)<r&&(_=f(p=-e[h])));for(var v,m,y=o+s,x=y-o,E=s-x,w=E,b=y;c<n&&h<r;)d<_?(o=g,(c+=1)<n&&(d=f(g=t[c]))):(o=p,(h+=1)<r&&(_=f(p=-e[h]))),(E=(s=w)-(x=(y=o+s)-o))&&(u[l++]=E),w=b-((v=b+y)-(m=v-b))+(y-m),b=v;for(;c<n;)(E=(s=w)-(x=(y=(o=g)+s)-o))&&(u[l++]=E),w=b-((v=b+y)-(m=v-b))+(y-m),b=v,(c+=1)<n&&(g=t[c]);for(;h<r;)(E=(s=w)-(x=(y=(o=p)+s)-o))&&(u[l++]=E),w=b-((v=b+y)-(m=v-b))+(y-m),b=v,(h+=1)<r&&(p=-e[h]);return w&&(u[l++]=w),b&&(u[l++]=b),l||(u[l++]=0),u.length=l,u}},{}],64:[function(t,e,n){"use strict";function i(t,e){var n=t+e,i=n-t,r=t-(n-i)+(e-i);return r?[r,n]:[n]}e.exports=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return i(t[0],e[0]);var o,s,a=n+r,u=new Array(a),l=0,c=0,h=0,f=Math.abs,g=t[c],d=f(g),p=e[h],_=f(p);d<_?(s=g,(c+=1)<n&&(d=f(g=t[c]))):(s=p,(h+=1)<r&&(_=f(p=e[h]))),c<n&&d<_||h>=r?(o=g,(c+=1)<n&&(d=f(g=t[c]))):(o=p,(h+=1)<r&&(_=f(p=e[h])));for(var v,m,y=o+s,x=y-o,E=s-x,w=E,b=y;c<n&&h<r;)d<_?(o=g,(c+=1)<n&&(d=f(g=t[c]))):(o=p,(h+=1)<r&&(_=f(p=e[h]))),(E=(s=w)-(x=(y=o+s)-o))&&(u[l++]=E),w=b-((v=b+y)-(m=v-b))+(y-m),b=v;for(;c<n;)(E=(s=w)-(x=(y=(o=g)+s)-o))&&(u[l++]=E),w=b-((v=b+y)-(m=v-b))+(y-m),b=v,(c+=1)<n&&(g=t[c]);for(;h<r;)(E=(s=w)-(x=(y=(o=p)+s)-o))&&(u[l++]=E),w=b-((v=b+y)-(m=v-b))+(y-m),b=v,(h+=1)<r&&(p=e[h]);return w&&(u[l++]=w),b&&(u[l++]=b),l||(u[l++]=0),u.length=l,u}},{}],65:[function(t,e,n){"use strict";function i(t,e){if(!(this instanceof i))return new i(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function r(t,e){return t<e?-1:t>e?1:0}e.exports=i,e.exports.default=i,i.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,i=e[t];t>0;){var r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i},_down:function(t){for(var e=this.data,n=this.compare,i=this.length>>1,r=e[t];t<i;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,r)>=0)break;e[t]=a,t=o}e[t]=r}}},{}],66:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r=t*e,o=i*t,s=o-(o-t),a=t-s,u=i*e,l=u-(u-e),c=e-l,h=a*c-(r-s*l-a*l-s*c);return n?(n[0]=h,n[1]=r,n):[h,r]};var i=+(Math.pow(2,27)+1)},{}],67:[function(t,e,n){"use strict";e.exports=function(t,e,n){var i=t+e,r=i-t,o=e-r,s=t-(i-r);return n?(n[0]=s+o,n[1]=i,n):[s+o,i]}},{}],68:[function(t,e,n){"use strict";function i(t,e,n,i){if(i=i||{},!o.isObject(i))throw new Error("options is invalid");var s=i.units,a=r.getCoord(t),u=o.degreesToRadians(a[0]),l=o.degreesToRadians(a[1]),c=o.degreesToRadians(n),h=o.lengthToRadians(e,s),f=Math.asin(Math.sin(l)*Math.cos(h)+Math.cos(l)*Math.sin(h)*Math.cos(c)),g=u+Math.atan2(Math.sin(c)*Math.sin(h)*Math.cos(l),Math.cos(h)-Math.sin(l)*Math.sin(f));return o.point([o.radiansToDegrees(g),o.radiansToDegrees(f)])}var r=t("@turf/invariant"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],69:[function(t,e,n){"use strict";function i(t,e){var n=u.getGeom(t),i=u.getGeom(e),s=t.properties||{};if(n=r(n),i=r(i),!n)return null;if(!i)return a.feature(n,s);var l=new o.GeoJSONReader,c=l.read(n),h=l.read(i),f=o.OverlayOp.difference(c,h);if(f.isEmpty())return null;var g=(new o.GeoJSONWriter).write(f);return a.feature(g,s)}function r(t){switch(t.type){case"Polygon":return s(t)>1?t:null;case"MultiPolygon":var e=[];if(l.flattenEach(t,function(t){s(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}var o=t("jsts-es"),s=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/area")),a=t("@turf/helpers"),u=t("@turf/invariant"),l=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/area":2,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"jsts-es":70}],70:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],71:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){var i,r;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach(function(e,o){var s=n(e,t);s>=0&&(void 0===r||s<r)&&(r=s,i=o)}),i}function o(t,e){return r(t,e,function(t,e){return t-e})}function s(t,e){if(e=e||{},!p.isObject(e))throw new Error("options is invalid");var n=e.propertyName;d.collectionOf(t,"Polygon","dissolve");var i=l(t),r=i.features,s=[];r.forEach(function(t,e){t.properties.origIndexPosition=e});var f=u();f.load(i);for(var g in r){var _=r[g],v=!1;if(f.search(_).features.forEach(function(t){_=r[g];var e=t.properties.origIndexPosition;if(s.length>0&&0!==e)if(e>s[s.length-1])e-=s.length;else{var i=o(e,s);0!==i&&(e-=i)}if(e!==+g){var u=r[e];u&&_&&(void 0!==n&&u.properties[n]!==_.properties[n]||c(_,u)&&a(_,u)&&(r[g]=h(_,u),s.push(t.properties.origIndexPosition),s.sort(function(t,e){return t-e}),f.remove(t),r.splice(e,1),_.properties.origIndexPosition=g,f.remove(_,function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition}),v=!0))}}),v){if(!_)continue;_.properties.origIndexPosition=g,f.insert(_),g--}}return r.forEach(function(t){delete t.properties.origIndexPosition,delete t.bbox}),i}function a(t,e){var n=p.lineString(g.coordAll(t)),i=p.lineString(g.coordAll(e));return f(n,i).features.length>0}var u=i(t("geojson-rbush")),l=i(t("@turf/clone")),c=i(t("@turf/boolean-overlap")),h=i(t("@turf/union")),f=i(t("@turf/line-intersect")),g=t("@turf/meta"),d=t("@turf/invariant"),p=t("@turf/helpers");e.exports=s,e.exports.default=s},{"@turf/boolean-overlap":18,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-intersect":91,"@turf/meta":105,"@turf/union":152,"geojson-rbush":72}],72:[function(t,e,n){"use strict";function i(t,e,n,i,o){r(t,e,n||0,i||t.length-1,o||s)}function r(t,e,n,i,s){for(;i>n;){if(i-n>600){var a=i-n+1,u=e-n+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);r(t,e,Math.max(n,Math.floor(e-u*c/a+h)),Math.min(i,Math.floor(e+(a-u)*c/a+h)),s)}var f=t[e],g=n,d=i;for(o(t,n,e),s(t[i],f)>0&&o(t,n,i);g<d;){for(o(t,g,d),g++,d--;s(t[g],f)<0;)g++;for(;s(t[d],f)>0;)d--}0===s(t[n],f)?o(t,n,d):o(t,++d,i),d<=e&&(n=d+1),e<=d&&(i=d-1)}}function o(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function s(t,e){return t<e?-1:t>e?1:0}function a(t,e){if(!(this instanceof a))return new a(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 u(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function l(t,e){c(t,0,t.children.length,e,t)}function c(t,e,n,i,r){r||(r=x(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],h(r,t.leaf?i(o):o);return r}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function f(t,e){return t.minX-e.minX}function g(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function _(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function v(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function m(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function y(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function x(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function E(t,e,n,r,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=r||(i(t,s=e+Math.ceil((n-e)/r/2)*r,e,n,o),a.push(e,s,s,n))}function w(t,e,n){if(null!==t){var i,r,o,s,a,u,l,c,h,f,g=0,d=0,p=t.type,_="FeatureCollection"===p,v="Feature"===p,m=_?t.features.length:1;for(i=0;i<m;i++)for(l=(f=!!(h=_?t.features[i].geometry:v?t.geometry:t)&&"GeometryCollection"===h.type)?h.geometries.length:1,r=0;r<l;r++){var y=0;if(null!==(u=f?h.geometries[r]:h)){c=u.coordinates;var x=u.type;switch(g=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":e(c,d,i,y),d++,y++;break;case"LineString":case"MultiPoint":for(o=0;o<c.length;o++)e(c[o],d,i,y),d++,"MultiPoint"===x&&y++;"LineString"===x&&y++;break;case"Polygon":case"MultiLineString":for(o=0;o<c.length;o++){for(s=0;s<c[o].length-g;s++)e(c[o][s],d,i,y),d++;"MultiLineString"===x&&y++}"Polygon"===x&&y++;break;case"MultiPolygon":for(o=0;o<c.length;o++){for(s=0;s<c[o].length;s++)for(a=0;a<c[o][s].length-g;a++)e(c[o][s][a],d,i,y),d++;y++}break;case"GeometryCollection":for(o=0;o<u.geometries.length;o++)w(u.geometries[o],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function b(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function I(t){var e=a(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=C(e)).bbox=e}else t.bbox=t.bbox?t.bbox:N(t);return a.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach(function(t){var n=C(t);n.bbox=t,e.push(n)}):b(t,function(t){t.bbox=t.bbox?t.bbox:N(t),e.push(t)}),a.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=C(e)).bbox=e}return a.prototype.remove.call(this,t)},e.clear=function(){return a.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:a.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return a.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:a.prototype.all.call(this)}},e.toJSON=function(){return a.prototype.toJSON.call(this)},e.fromJSON=function(t){return a.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:N(t),{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function C(t){var e=[t[0],t[1]],n=[t[0],t[3]],i=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],i,n,e]]}}}function N(t){var e=[1/0,1/0,-1/0,-1/0];return w(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}a.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!y(t,e))return n;for(var r,o,s,a,u=[];e;){for(r=0,o=e.children.length;r<o;r++)s=e.children[r],y(t,a=e.leaf?i(s):s)&&(e.leaf?n.push(s):m(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!y(t,e))return!1;for(var i,r,o,s,a=[];e;){for(i=0,r=e.children.length;i<r;i++)if(o=e.children[i],s=e.leaf?n(o):o,y(t,s)){if(e.leaf||m(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=x([]),this},remove:function(t,e){if(!t)return this;for(var n,i,r,o,s=this.data,a=this.toBBox(t),l=[],c=[];s||l.length;){if(s||(s=l.pop(),i=l[l.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(r=u(t,s.children,e)))return s.children.splice(r,1),l.push(s),this._condense(l),this;o||s.leaf||!m(s,a)?i?(n++,s=i.children[n],o=!1):s=null:(l.push(s),c.push(n),n=0,i=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:f,compareMinY:g,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,i){var r,o=n-e+1,s=this._maxEntries;if(o<=s)return r=x(t.slice(e,n+1)),l(r,this.toBBox),r;i||(i=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,i-1))),(r=x([])).leaf=!1,r.height=i;var a,u,c,h,f=Math.ceil(o/s),g=f*Math.ceil(Math.sqrt(s));for(E(t,e,n,g,this.compareMinX),a=e;a<=n;a+=g)for(E(t,a,c=Math.min(a+g-1,n),f,this.compareMinY),u=a;u<=c;u+=f)h=Math.min(u+f-1,c),r.children.push(this._build(t,u,h,i-1));return l(r,this.toBBox),r},_chooseSubtree:function(t,e,n,i){for(var r,o,s,a,u,l,c,h;;){if(i.push(e),e.leaf||i.length-1===n)break;for(c=h=1/0,r=0,o=e.children.length;r<o;r++)u=d(s=e.children[r]),(l=_(t,s)-u)<h?(h=l,c=u<c?u:c,a=s):l===h&&u<c&&(c=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var i=this.toBBox,r=n?t:i(t),o=[],s=this._chooseSubtree(r,this.data,e,o);for(s.children.push(t),h(s,r);e>=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 o=this._chooseSplitIndex(n,r,i),s=x(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,l(n,this.toBBox),l(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=x([t,e]),this.data.height=t.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,s,a,u,l,h;for(u=l=1/0,i=e;i<=n-e;i++)s=v(r=c(t,0,i,this.toBBox),o=c(t,i,n,this.toBBox)),a=d(r)+d(o),s<u?(u=s,h=i,l=a<l?a:l):s===u&&a<l&&(l=a,h=i);return h},_chooseSplitAxis:function(t,e,n){var i=t.leaf?this.compareMinX:f,r=t.leaf?this.compareMinY:g;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},_allDistMargin:function(t,e,n,i){t.children.sort(i);var r,o,s=this.toBBox,a=c(t,0,e,s),u=c(t,n-e,n,s),l=p(a)+p(u);for(r=e;r<n-e;r++)o=t.children[r],h(a,t.leaf?s(o):o),l+=p(a);for(r=n-e-1;r>=e;r--)o=t.children[r],h(u,t.leaf?s(o):o),l+=p(u);return l},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)h(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).splice(e.indexOf(t[n]),1):this.clear():l(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]+"};")}},e.exports=I,e.exports.default=I},{}],73:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!o.isObject(n))throw new Error("options is invalid");var i=n.units,s=r.getCoord(t),a=r.getCoord(e),u=o.degreesToRadians(a[1]-s[1]),l=o.degreesToRadians(a[0]-s[0]),c=o.degreesToRadians(s[1]),h=o.degreesToRadians(a[1]),f=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(h);return o.radiansToLength(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),i)}var r=t("@turf/invariant"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],74:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){return s(o(t))}var o=i(t("@turf/bbox")),s=i(t("@turf/bbox-polygon"));e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/bbox-polygon":5}],75:[function(t,e,n){"use strict";function i(t){var e=[];return"FeatureCollection"===t.type?r.featureEach(t,function(t){r.coordEach(t,function(n){e.push(o.point(n,t.properties))})}):r.coordEach(t,function(n){e.push(o.point(n,t.properties))}),o.featureCollection(e)}var r=t("@turf/meta"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],76:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("geojson is required");var e=[];return r.flattenEach(t,function(t){e.push(t)}),o.featureCollection(e)}var r=t("@turf/meta"),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],77:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.mutate;if(!t)throw new Error("geojson is required");return!1!==n&&void 0!==n||(t=s(t)),r.coordEach(t,function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e}),t}var r=t("@turf/meta"),o=t("@turf/helpers"),s=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clone"));e.exports=i,e.exports.default=i},{"@turf/clone":36,"@turf/helpers":79,"@turf/meta":105}],78:[function(t,e,n){"use strict";function i(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.properties,o=n.npoints,s=n.offset;return t=r.getCoord(t),e=r.getCoord(e),i=i||{},o=o||100,s=s||10,new c({x:t[0],y:t[1]},{x:e[0],y:e[1]},i).Arc(o,{offset:s}).json()}var r=t("@turf/invariant"),o=Math.PI/180,s=180/Math.PI,a=function(t,e){this.lon=t,this.lat=e,this.x=o*t,this.y=o*e};a.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},a.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new a(e,t)};var u=function(){this.coords=[],this.length=0};u.prototype.move_to=function(t){this.length++,this.coords.push(t)};var l=function(t){this.properties=t||{},this.geometries=[]};l.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},l.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=0;n<this.geometries.length;n++){if(0===this.geometries[n].coords.length)return"LINESTRING(empty)";this.geometries[n].coords.forEach(function(t){e+=t[0]+" "+t[1]+","}),t+=e.substring(0,e.length-1)+")"}return t};var c=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new a(t.x,t.y),this.end=new a(e.x,e.y),this.properties=n||{};var i=this.start.x-this.end.x,r=this.start.y-this.end.y,o=Math.pow(Math.sin(r/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(i/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};c.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),i=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),r=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),a=s*Math.atan2(o,Math.sqrt(Math.pow(i,2)+Math.pow(r,2)));return[s*Math.atan2(r,i),a]},c.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var i=1/(t-1),r=0;r<t;++r){var o=i*r,s=this.interpolate(o);n.push(s)}for(var a=!1,c=0,h=e&&e.offset?e.offset:10,f=180-h,g=-180+h,d=360-h,p=1;p<n.length;++p){var _=n[p-1][0],v=n[p][0],m=Math.abs(v-_);m>d&&(v>f&&_<g||_>f&&v<g)?a=!0:m>c&&(c=m)}var y=[];if(a&&c<h){var x=[];y.push(x);for(var E=0;E<n.length;++E){var w=parseFloat(n[E][0]);if(E>0&&Math.abs(w-n[E-1][0])>d){var b=parseFloat(n[E-1][0]),I=parseFloat(n[E-1][1]),C=parseFloat(n[E][0]),N=parseFloat(n[E][1]);if(b>-180&&b<g&&180===C&&E+1<n.length&&n[E-1][0]>-180&&n[E-1][0]<g){x.push([-180,n[E][1]]),E++,x.push([n[E][0],n[E][1]]);continue}if(b>f&&b<180&&-180===C&&E+1<n.length&&n[E-1][0]>f&&n[E-1][0]<180){x.push([180,n[E][1]]),E++,x.push([n[E][0],n[E][1]]);continue}if(b<g&&C>f){var S=b;b=C,C=S;var L=I;I=N,N=L}if(b>f&&C<g&&(C+=360),b<=180&&C>=180&&b<C){var M=(180-b)/(C-b),P=M*N+(1-M)*I;x.push([n[E-1][0]>f?180:-180,P]),(x=[]).push([n[E-1][0]>f?-180:180,P]),y.push(x)}else x=[],y.push(x);x.push([w,n[E][1]])}else x.push([n[E][0],n[E][1]])}}else{var R=[];y.push(R);for(var O=0;O<n.length;++O)R.push([n[O][0],n[O][1]])}for(var T=new l(this.properties),A=0;A<y.length;++A){var D=new u;T.geometries.push(D);for(var F=y[A],G=0;G<F.length;++G)D.move_to(F[G])}return T},e.exports=i,e.exports.default=i},{"@turf/invariant":84}],79:[function(t,e,n){"use strict";function i(t,e,n,i){if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");if(n){if(!Array.isArray(n))throw new Error("bbox must be an Array");if(4!==n.length)throw new Error("bbox must be an Array of 4 numbers")}if(i&&-1===["string","number"].indexOf(typeof i))throw new Error("id must be a number or a string");var r={type:"Feature"};return i&&(r.id=i),n&&(r.bbox=n),r.properties=e||{},r.geometry=t,r}function r(t,e,n,r){if(!t)throw new Error("No coordinates passed");if(!Array.isArray(t))throw new Error("Coordinates must be an Array");if(t.length<2)throw new Error("Coordinates must be at least 2 numbers long");if(!g(t[0])||!g(t[1]))throw new Error("Coordinates must contain numbers");return i({type:"Point",coordinates:t},e,n,r)}function o(t,e,n,r){if(!t)throw new Error("No coordinates passed");for(var o=0;o<t.length;o++){var s=t[o];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++){if(0===o&&0===a&&!g(s[0][0])||!g(s[0][1]))throw new Error("Coordinates must contain numbers");if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}}return i({type:"Polygon",coordinates:t},e,n,r)}function s(t,e,n,r){if(!t)throw new Error("No coordinates passed");if(t.length<2)throw new Error("Coordinates must be an array of two or more positions");if(!g(t[0][1])||!g(t[0][1]))throw new Error("Coordinates must contain numbers");return i({type:"LineString",coordinates:t},e,n,r)}function a(t,e,n,r){if(!t)throw new Error("No coordinates passed");return i({type:"MultiLineString",coordinates:t},e,n,r)}function u(t,e,n,r){if(!t)throw new Error("No coordinates passed");return i({type:"MultiPoint",coordinates:t},e,n,r)}function l(t,e,n,r){if(!t)throw new Error("No coordinates passed");return i({type:"MultiPolygon",coordinates:t},e,n,r)}function c(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=d[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function h(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=d[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function f(t){if(null===t||void 0===t)throw new Error("radians is required");return 180*(t%(2*Math.PI))/Math.PI}function g(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(n,"__esModule",{value:!0});var d={meters:6371008.8,metres:6371008.8,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:6371008.8/1852,inches:6371008.8*39.37,yards:6371008.8/1.0936,feet:20902260.511392,radians:1,degrees:6371008.8/111325},p={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/6371008.8,degrees:1/111325},_={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:3.86e-7,yards:1.195990046,feet:10.763910417,inches:1550.003100006};n.earthRadius=6371008.8,n.factors=d,n.unitsFactors=p,n.areaFactors=_,n.feature=i,n.geometry=function(t,e,n){if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(n&&4!==n.length)throw new Error("bbox must be an Array of 4 numbers");var i;switch(t){case"Point":i=r(e).geometry;break;case"LineString":i=s(e).geometry;break;case"Polygon":i=o(e).geometry;break;case"MultiPoint":i=u(e).geometry;break;case"MultiLineString":i=a(e).geometry;break;case"MultiPolygon":i=l(e).geometry;break;default:throw new Error(t+" is invalid")}return n&&(i.bbox=n),i},n.point=r,n.polygon=o,n.lineString=s,n.featureCollection=function(t,e,n){if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");if(e&&4!==e.length)throw new Error("bbox must be an Array of 4 numbers");if(n&&-1===["string","number"].indexOf(typeof n))throw new Error("id must be a number or a string");var i={type:"FeatureCollection"};return n&&(i.id=n),e&&(i.bbox=e),i.features=t,i},n.multiLineString=a,n.multiPoint=u,n.multiPolygon=l,n.geometryCollection=function(t,e,n,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return i({type:"GeometryCollection",geometries:t},e,n,r)},n.round=function(t,e){if(void 0===t||null===t||isNaN(t))throw new Error("num is required");if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},n.radiansToLength=c,n.lengthToRadians=h,n.lengthToDegrees=function(t,e){return f(h(t,e))},n.bearingToAzimuth=function(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e},n.radiansToDegrees=f,n.degreesToRadians=function(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180},n.convertLength=function(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return c(h(t,e),n||"kilometers")},n.convertArea=function(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=_[e||"meters"];if(!i)throw new Error("invalid original units");var r=_[n||"kilometers"];if(!r)throw new Error("invalid final units");return t/i*r},n.isNumber=g,n.isObject=function(t){return!!t&&t.constructor===Object},n.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},n.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},n.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},n.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},n.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},n.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},n.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],80:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!c.isObject(n))throw new Error("options is invalid");var i=n.properties||{},r=n.triangles,h=n.mask;if(null===e||void 0===e)throw new Error("cellSide is required");if(!c.isNumber(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(h&&-1===["Polygon","MultiPolygon"].indexOf(l.getType(h)))throw new Error("options.mask must be a (Multi)Polygon");var f=t[0],g=t[1],d=t[2],p=t[3],_=(g+p)/2,v=(f+d)/2,m=2*e/a([f,_],[d,_],n)*(d-f),y=2*e/a([v,g],[v,p],n)*(p-g),x=m/2,E=2*x,w=Math.sqrt(3)/2*y,b=d-f,I=p-g,C=.75*E,N=w,S=(b-E)/(E-x/2),L=Math.floor(S),M=(L*C-x/2-b)/2-x/2+C/2,P=Math.floor((I-w)/w),R=(I-P*w)/2,O=P*w-I>w/2;O&&(R-=w/4);for(var T=[],A=[],D=0;D<6;D++){var F=2*Math.PI/6*D;T.push(Math.cos(F)),A.push(Math.sin(F))}for(var G=[],q=0;q<=L;q++)for(var k=0;k<=P;k++){var B=q%2==1;if((0!==k||!B)&&(0!==k||!O)){var j=q*C+f-M,z=k*N+g+R;if(B&&(z-=w/2),!0===r)s([j,z],m/2,y/2,i,T,A).forEach(function(t){h?u(h,t)&&G.push(t):G.push(t)});else{var Y=o([j,z],m/2,y/2,i,T,A);h?u(h,Y)&&G.push(Y):G.push(Y)}}}return c.featureCollection(G)}function o(t,e,n,i,r,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*r[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),c.polygon([s],i)}function s(t,e,n,i,r,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*r[a],t[1]+n*o[a]]),u.push([t[0]+e*r[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(c.polygon([u],i))}return s}var a=i(t("@turf/distance")),u=i(t("@turf/intersect")),l=t("@turf/invariant"),c=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/distance":73,"@turf/helpers":79,"@turf/intersect":82,"@turf/invariant":84}],81:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.gridType,r=n.property,_=n.weight;if(!t)throw new Error("points is required");if(p.collectionOf(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==_&&"number"!=typeof _)throw new Error("weight must be a number");r=r||"elevation",i=i||"square",_=_||1;var v,m=o(t);switch(i){case"point":case"points":v=a(m,e,n);break;case"square":case"squares":v=c(m,e,n);break;case"hex":case"hexes":v=s(m,e,n);break;case"triangle":case"triangles":v=h(m,e,n);break;default:throw new Error("invalid gridType")}var y=[];return d.featureEach(v,function(e){var o=0,s=0;d.featureEach(t,function(t){var a,c="point"===i?e:l(e),h=u(c,t,n);if(void 0!==r&&(a=t.properties[r]),void 0===a&&(a=t.geometry.coordinates[2]),void 0===a)throw new Error("zValue is missing");0===h&&(o=a);var f=1/Math.pow(h,_);s+=f,o+=f*a});var a=f(e);a.properties[r]=o/s,y.push(a)}),g.featureCollection(y)}var o=i(t("@turf/bbox")),s=i(t("@turf/hex-grid")),a=i(t("@turf/point-grid")),u=i(t("@turf/distance")),l=i(t("@turf/centroid")),c=i(t("@turf/square-grid")),h=i(t("@turf/triangle-grid")),f=i(t("@turf/clone")),g=t("@turf/helpers"),d=t("@turf/meta"),p=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/centroid":33,"@turf/clone":36,"@turf/distance":73,"@turf/helpers":79,"@turf/hex-grid":80,"@turf/invariant":84,"@turf/meta":105,"@turf/point-grid":111,"@turf/square-grid":141,"@turf/triangle-grid":150}],82:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=a.getGeom(t),i=a.getGeom(e);if(l(s(i,{precision:4})).coordinates[0].length<4)return null;if(l(s(n,{precision:4})).coordinates[0].length<4)return null;var r=new o.GeoJSONReader,c=r.read(s(n)),h=r.read(s(i)),f=o.OverlayOp.intersection(c,h);if(f.isEmpty())return null;var g=(new o.GeoJSONWriter).write(f);return u.feature(g)}var o=t("jsts-es"),s=i(t("@turf/truncate")),a=t("@turf/invariant"),u=t("@turf/helpers"),l=i(t("@turf/clean-coords"));e.exports=r,e.exports.default=r},{"@turf/clean-coords":35,"@turf/helpers":79,"@turf/invariant":84,"@turf/truncate":151,"jsts-es":83}],83:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],84:[function(t,e,n){"use strict";function i(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 r(e),e;throw new Error("No valid coordinates")}function r(t){if(t.length>1&&o.isNumber(t[0])&&o.isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return r(t[0]);throw new Error("coordinates must only contain numbers")}Object.defineProperty(n,"__esModule",{value:!0});var o=t("@turf/helpers");n.getCoord=function(t){if(!t)throw new Error("obj is required");var e=i(t);if(e.length>1&&o.isNumber(e[0])&&o.isNumber(e[1]))return e;throw new Error("Coordinate is not a valid Point")},n.getCoords=i,n.containsNumber=r,n.geojsonType=function(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)},n.featureOf=function(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)},n.collectionOf=function(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<t.features.length;i++){var r=t.features[i];if(!r||"Feature"!==r.type||!r.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+r.geometry.type)}},n.getGeom=function(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")},n.getGeomType=function(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType")},n.getType=function(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}},{"@turf/helpers":79}],85:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(e=e||{},!L.isObject(e))throw new Error("options is invalid");var n=e.zProperty||"elevation",i=e.flip,r=e.flags;S.collectionOf(t,"Point","input must contain Points");for(var s=o(t,i),a=[],u=0;u<s.length;u++){for(var l=s[u],c=[],h=0;h<l.length;h++){var f=l[h];f.properties[n]?c.push(f.properties[n]):c.push(0),!0===r&&(f.properties.matrixPosition=[u,h])}a.push(c)}return a}function o(t,e){var n={};return M.featureEach(t,function(t){var e=S.getCoords(t)[1];n[e]||(n[e]=[]),n[e].push(t)}),Object.keys(n).map(function(t){return n[t].sort(function(t,e){return S.getCoords(t)[0]-S.getCoords(e)[0]})}).sort(function(t,n){return e?S.getCoords(t[0])[1]-S.getCoords(n[0])[1]:S.getCoords(n[0])[1]-S.getCoords(t[0])[1]})}function s(t,e,n,i){i=i||{};for(var r=Object.keys(P),o=0;o<r.length;o++){var s=r[o],a=i[s];a=void 0!==a&&null!==a?a:P[s],R[s]=a}R.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var u,h=l(t,e,n);return R.polygons?(R.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=p(h)):(R.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=c(h)),"function"==typeof R.successCallback&&R.successCallback(u),u}function a(t,e,n){return(t-e)/(n-e)}function u(t){return t.constructor.toString().indexOf("Array")>-1}function l(t,e,n){for(var i=t.length-1,r=t[0].length-1,o={rows:i,cols:r,cells:[]},s=e+Math.abs(n),u=0;u<i;++u){o.cells[u]=[];for(var l=0;l<r;++l){var c=0,h=t[u+1][l],f=t[u+1][l+1],g=t[u][l+1],d=t[u][l];if(!(isNaN(h)||isNaN(f)||isNaN(g)||isNaN(d))){c|=h<e?0:h>s?128:64,c|=f<e?0:f>s?32:16,c|=g<e?0:g>s?8:4;var p=+(c|=d<e?0:d>s?2:1),_=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 v=(h+f+g+d)/4;_=v>s?2:v<e?0:1,34===c?1===_?c=35:0===_&&(c=136):136===c?1===_?(c=35,_=4):0===_&&(c=34):17===c?1===_?(c=155,_=4):0===_&&(c=153):68===c?1===_?(c=103,_=4):0===_&&(c=102):153===c?1===_&&(c=155):102===c?1===_&&(c=103):152===c?_<2&&(c=156,_=1):137===c?_<2&&(c=139,_=1):98===c?_<2&&(c=99,_=1):38===c?_<2&&(c=39,_=1):18===c?_>0?(c=156,_=4):c=152:33===c?_>0?(c=139,_=4):c=137:72===c?_>0?(c=99,_=4):c=98:132===c&&(_>0?(c=39,_=4):c=38)}if(0!=c&&170!=c){var m,y,x,E,w,b,I,C;m=y=x=E=w=b=I=C=.5;var N=[];1===c?(x=1-a(e,g,d),C=1-a(e,h,d),N.push(vt[c])):169===c?(x=a(s,d,g),C=a(s,d,h),N.push(vt[c])):4===c?(b=1-a(e,f,g),E=a(e,d,g),N.push(pt[c])):166===c?(b=a(s,g,f),E=1-a(s,g,d),N.push(pt[c])):16===c?(w=a(e,g,f),y=a(e,h,f),N.push(dt[c])):154===c?(w=1-a(s,f,g),y=1-a(s,f,h),N.push(dt[c])):64===c?(I=a(e,d,h),m=1-a(e,f,h),N.push(yt[c])):106===c?(I=1-a(s,h,d),m=a(s,h,f),N.push(yt[c])):168===c?(E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),N.push(_t[c]),N.push(vt[c])):2===c?(E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),N.push(_t[c]),N.push(vt[c])):162===c?(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),N.push(_t[c]),N.push(vt[c])):8===c?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),N.push(dt[c]),N.push(pt[c])):138===c?(w=1-a(e,f,g),b=1-a(s,f,g),m=1-a(s,f,h),y=1-a(e,f,h),N.push(dt[c]),N.push(pt[c])):32===c?(w=a(s,g,f),b=a(e,g,f),m=a(e,h,f),y=a(s,h,f),N.push(dt[c]),N.push(pt[c])):42===c?(C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f),N.push(mt[c]),N.push(yt[c])):128===c&&(C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h),N.push(mt[c]),N.push(yt[c])),5===c?(b=1-a(e,f,g),C=1-a(e,h,d),N.push(pt[c])):165===c?(b=a(s,g,f),C=a(s,d,h),N.push(pt[c])):20===c?(E=a(e,d,g),y=a(e,h,f),N.push(_t[c])):150===c?(E=1-a(s,g,d),y=1-a(s,f,h),N.push(_t[c])):80===c?(w=a(e,g,f),I=a(e,d,h),N.push(dt[c])):90===c?(w=1-a(s,f,g),I=1-a(s,h,d),N.push(dt[c])):65===c?(x=1-a(e,g,d),m=1-a(e,f,h),N.push(vt[c])):105===c?(x=a(s,d,g),m=a(s,h,f),N.push(vt[c])):160===c?(w=a(s,g,f),b=a(e,g,f),C=a(e,d,h),I=a(s,d,h),N.push(dt[c]),N.push(pt[c])):10===c?(w=1-a(e,f,g),b=1-a(s,f,g),C=1-a(s,h,d),I=1-a(e,h,d),N.push(dt[c]),N.push(pt[c])):130===c?(E=1-a(e,g,d),x=1-a(s,g,d),m=1-a(s,f,h),y=1-a(e,f,h),N.push(_t[c]),N.push(vt[c])):40===c?(E=a(s,d,g),x=a(e,d,g),m=a(e,h,f),y=a(s,h,f),N.push(_t[c]),N.push(vt[c])):101===c?(b=a(s,g,f),m=a(s,h,f),N.push(pt[c])):69===c?(b=1-a(e,f,g),m=1-a(e,f,h),N.push(pt[c])):149===c?(C=a(s,d,h),y=1-a(s,f,h),N.push(mt[c])):21===c?(C=1-a(e,h,d),y=a(e,h,f),N.push(mt[c])):86===c?(E=1-a(s,g,d),I=1-a(s,h,d),N.push(_t[c])):84===c?(E=a(e,d,g),I=a(e,d,h),N.push(_t[c])):89===c?(w=1-a(s,f,g),x=a(s,d,g),N.push(vt[c])):81===c?(w=a(e,g,f),x=1-a(e,g,d),N.push(vt[c])):96===c?(w=a(s,g,f),b=a(e,g,f),I=a(e,d,h),m=a(s,h,f),N.push(dt[c]),N.push(pt[c])):74===c?(w=1-a(e,f,g),b=1-a(s,f,g),I=1-a(s,h,d),m=1-a(e,f,h),N.push(dt[c]),N.push(pt[c])):24===c?(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),y=a(e,h,f),N.push(dt[c]),N.push(vt[c])):146===c?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),y=1-a(s,f,h),N.push(dt[c]),N.push(vt[c])):6===c?(b=1-a(e,f,g),E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),N.push(pt[c]),N.push(_t[c])):164===c?(b=a(s,g,f),E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),N.push(pt[c]),N.push(_t[c])):129===c?(x=1-a(e,g,d),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h),N.push(vt[c]),N.push(mt[c])):41===c?(x=a(s,d,g),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f),N.push(vt[c]),N.push(mt[c])):66===c?(E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),m=1-a(e,f,h),N.push(_t[c]),N.push(vt[c])):104===c?(E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),m=a(s,h,f),N.push(vt[c]),N.push(xt[c])):144===c?(w=a(e,g,f),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h),N.push(dt[c]),N.push(yt[c])):26===c?(w=1-a(s,f,g),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f),N.push(dt[c]),N.push(yt[c])):36===c?(b=a(s,g,f),E=a(e,d,g),m=a(e,h,f),y=a(s,h,f),N.push(pt[c]),N.push(_t[c])):134===c?(b=1-a(e,f,g),E=1-a(s,g,d),m=1-a(s,f,h),y=1-a(e,f,h),N.push(pt[c]),N.push(_t[c])):9===c?(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),C=1-a(e,h,d),N.push(dt[c]),N.push(pt[c])):161===c?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),C=a(s,d,h),N.push(dt[c]),N.push(pt[c])):37===c?(b=a(s,g,f),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f),N.push(pt[c]),N.push(mt[c])):133===c?(b=1-a(e,f,g),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h),N.push(pt[c]),N.push(mt[c])):148===c?(E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h),N.push(_t[c]),N.push(yt[c])):22===c?(E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f),N.push(_t[c]),N.push(yt[c])):82===c?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),N.push(dt[c]),N.push(vt[c])):88===c?(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),N.push(dt[c]),N.push(vt[c])):73===c?(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),m=1-a(e,f,h),N.push(dt[c]),N.push(pt[c])):97===c?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),m=a(s,h,f),N.push(dt[c]),N.push(pt[c])):145===c?(w=a(e,g,f),x=1-a(e,g,d),C=a(s,d,h),y=1-a(s,f,h),N.push(dt[c]),N.push(mt[c])):25===c?(w=1-a(s,f,g),x=a(s,d,g),C=1-a(e,h,d),y=a(e,h,f),N.push(dt[c]),N.push(mt[c])):70===c?(b=1-a(e,f,g),E=1-a(s,g,d),I=1-a(s,h,d),m=1-a(e,f,h),N.push(pt[c]),N.push(_t[c])):100===c?(b=a(s,g,f),E=a(e,d,g),I=a(e,d,h),m=a(s,h,f),N.push(pt[c]),N.push(_t[c])):34===c?(0===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(mt[c]),N.push(yt[c])):35===c?(4===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(vt[c]),N.push(yt[c])):136===c?(0===_?(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)):(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)),N.push(dt[c]),N.push(pt[c]),N.push(mt[c]),N.push(yt[c])):153===c?(0===_?(w=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(vt[c])):102===c?(0===_?(b=1-a(e,f,g),E=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(pt[c]),N.push(yt[c])):155===c?(4===_?(w=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(mt[c])):103===c?(4===_?(b=1-a(e,f,g),E=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(pt[c]),N.push(_t[c])):152===c?(0===_?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(_t[c]),N.push(vt[c])):156===c?(4===_?(w=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),y=a(e,h,f)):(w=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),C=a(e,d,h),I=a(s,d,h),y=1-a(s,f,h)),N.push(dt[c]),N.push(vt[c]),N.push(yt[c])):137===c?(0===_?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)):(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)),N.push(dt[c]),N.push(pt[c]),N.push(vt[c])):139===c?(4===_?(w=a(s,g,f),b=a(e,g,f),x=1-a(e,g,d),C=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)):(w=1-a(e,f,g),b=1-a(s,f,g),x=a(s,d,g),C=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)),N.push(dt[c]),N.push(pt[c]),N.push(mt[c])):98===c?(0===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(yt[c])):99===c?(4===_?(w=1-a(e,f,g),b=1-a(s,f,g),E=a(s,d,g),x=a(e,d,g),I=a(e,d,h),m=1-a(e,f,h)):(w=a(s,g,f),b=a(e,g,f),E=1-a(e,g,d),x=1-a(s,g,d),I=1-a(s,h,d),m=a(s,h,f)),N.push(dt[c]),N.push(pt[c]),N.push(vt[c])):38===c?(0===_?(b=1-a(e,f,g),E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(pt[c]),N.push(mt[c]),N.push(yt[c])):39===c?(4===_?(b=1-a(e,f,g),E=a(e,d,g),C=a(e,d,h),I=a(s,d,h),m=1-a(s,f,h),y=1-a(e,f,h)):(b=a(s,g,f),E=1-a(s,g,d),C=1-a(s,h,d),I=1-a(e,h,d),m=a(e,h,f),y=a(s,h,f)),N.push(pt[c]),N.push(_t[c]),N.push(yt[c])):85===c&&(w=1,b=0,E=1,x=0,C=0,I=1,m=0,y=1),(m<0||m>1||y<0||y>1||w<0||w>1||E<0||E>1||C<0||C>1||I<0||I>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+p+" "+h+","+f+","+g+","+d+" "+_+" "+m+" "+y+" "+w+" "+b+" "+E+" "+x+" "+C+" "+I),o.cells[u][l]={cval:c,cval_real:p,flipped:_,topleft:m,topright:y,righttop:w,rightbottom:b,bottomright:E,bottomleft:x,leftbottom:C,lefttop:I,edges:N}}}}}return o}function c(t){for(var e=[],n=t.rows,i=t.cols,r=[],o=0;o<n;o++)for(var s=0;s<i;s++)if(void 0!==t.cells[o][s]&&t.cells[o][s].edges.length>0){var a=g(t.cells[o][s]),u=null,l=s,c=o;null!==a&&r.push([a.p[0]+l,a.p[1]+c]);do{if(null===(u=d(t.cells[c][l],a.x,a.y,a.o)))break;if(r.push([u.p[0]+l,u.p[1]+c]),l+=u.x,c+=u.y,a=u,c<0||c>=n||l<0||l>=i||void 0===t.cells[c][l]){var f=h(t,l-=u.x,c-=u.y,u.x,u.y,u.o);if(null===f)break;f.path.forEach(function(t){r.push(t)}),l=f.i,c=f.j,a=f}}while(void 0!==t.cells[c][l]&&t.cells[c][l].edges.length>0);e.push(r),r=[],t.cells[o][s].edges.length>0&&s--}return e}function h(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&D)c.push([u,l]),i=-1,r=0,o=0;else{if(!(a&A)){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&D)){if(a&A){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&T)){if(a&O){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&O)){if(a&D){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&O)){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&A)){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&A)){if(a&T){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&D)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&O)){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&T)){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&A)){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&O)){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 f(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}function g(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&T?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&A?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&D?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&T?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&A?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&D?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&D?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&D?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&O?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&D?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&D?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&O?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&A?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&O?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&D?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&O?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&O?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&T?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&O?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&T?{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 d(t,e,n,i){var r,o,s,a,u,l=t.cval;switch(e){case-1:switch(i){case 0:r=pt[l],s=V[l],a=U[l],u=H[l];break;default:r=dt[l],s=z[l],a=Y[l],u=X[l]}break;case 1:switch(i){case 0:r=mt[l],s=it[l],a=rt[l],u=ot[l];break;default:r=yt[l],s=tt[l],a=et[l],u=nt[l]}break;default:switch(n){case-1:switch(i){case 0:r=xt[l],s=F[l],a=G[l],u=q[l];break;default:r=Et[l],s=k[l],a=B[l],u=j[l]}break;case 1:switch(i){case 0:r=vt[l],s=W[l],a=J[l],u=Z[l];break;default:r=_t[l],s=K[l],a=Q[l],u=$[l]}}}if(o=t.edges.indexOf(r),void 0===t.edges[o])return null;switch(f(t,o),l=t.cval_real,r){case 0:l&T?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:l&A?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:l&A?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:l&D?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:l&T?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:l&A?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:l&A?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:l&D?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:l&A?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:l&D?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:l&D?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:l&O?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:l&A?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:l&D?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:l&D?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:l&O?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:l&A?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:l&O?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:l&D?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:l&O?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:l&O?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:l&T?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:l&O?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:l&T?(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!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}function p(t){var e=[],n=0;return t.cells.forEach(function(t,i){t.forEach(function(t,r){if(void 0!==t){var o=wt[t.cval](t);"object"==typeof o&&u(o)?"object"==typeof o[0]&&u(o[0])?"object"==typeof o[0][0]&&u(o[0][0])?o.forEach(function(t){t.forEach(function(t){t[0]+=r,t[1]+=i}),e[n++]=t}):(o.forEach(function(t){t[0]+=r,t[1]+=i}),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}function _(t,e,n){if(n=n||{},!L.isObject(n))throw new Error("options is invalid");var i=n.zProperty||"elevation",o=n.commonProperties||{},s=n.breaksProperties||[];if(S.collectionOf(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!L.isObject(o))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=r(t,{zProperty:i,flip:!0}),u=v(a,e,i),l=(u=m(u,a,t)).map(function(t,e){if(s[e]&&!L.isObject(s[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Object.assign({},o,s[e]);return n[i]=t[i],L.multiPolygon(t.groupedRings,n)});return L.featureCollection(l)}function v(t,e,n){for(var i=[],r=1;r<e.length;r++){var o=+e[r-1],a=+e[r],u=x(y(s(t,o,a-o))),l={};l.groupedRings=u,l[n]=o+"-"+a,i.push(l)}return i}function m(t,e,n){var i=b(n),r=i[2]-i[0],o=i[3]-i[1],s=i[0],a=i[1],u=r/(e[0].length-1),l=o/(e.length-1),c=function(t){t[0]=t[0]*u+s,t[1]=t[1]*l+a};return t.forEach(function(t){t.groupedRings.forEach(function(t){t.forEach(function(t){t.forEach(c)})})}),t}function y(t){var e=[],n=[];t.forEach(function(t){var i=I(L.polygon([t]));n.push(i),e.push({ring:t,area:i})}),n.sort(function(t,e){return e-t});var i=[];return n.forEach(function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){i.push(e[n].ring),e.splice(n,1);break}}),i}function x(t){for(var e=t.map(function(t){return{lrCoordinates:t,grouped:!1}}),n=[];!w(e);)for(var i=0;i<e.length;i++)if(!e[i].grouped){var r=[];r.push(e[i].lrCoordinates),e[i].grouped=!0;for(var o=L.polygon([e[i].lrCoordinates]),s=i+1;s<e.length;s++)e[s].grouped||E(L.polygon([e[s].lrCoordinates]),o)&&(r.push(e[s].lrCoordinates),e[s].grouped=!0);n.push(r)}return n}function E(t,e){for(var n=N(t),i=0;i<n.features.length;i++)if(!C(n.features[i],e))return!1;return!0}function w(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}var b=i(t("@turf/bbox")),I=i(t("@turf/area")),C=i(t("@turf/boolean-point-in-polygon")),N=i(t("@turf/explode")),S=t("@turf/invariant"),L=t("@turf/helpers"),M=t("@turf/meta"),P={successCallback:null,verbose:!1,polygons:!1},R={},O=64,T=16,A=4,D=1,F=[],G=[],q=[],k=[],B=[],j=[],z=[],Y=[],X=[],V=[],U=[],H=[],W=[],J=[],Z=[],K=[],Q=[],$=[],tt=[],et=[],nt=[],it=[],rt=[],ot=[];z[85]=V[85]=-1,Y[85]=U[85]=0,X[85]=H[85]=1,tt[85]=it[85]=1,et[85]=rt[85]=0,nt[85]=ot[85]=1,F[85]=k[85]=0,G[85]=B[85]=-1,q[85]=Z[85]=0,K[85]=W[85]=0,Q[85]=J[85]=1,j[85]=$[85]=1,it[1]=it[169]=0,rt[1]=rt[169]=-1,ot[1]=ot[169]=0,W[1]=W[169]=-1,J[1]=J[169]=0,Z[1]=Z[169]=0,V[4]=V[166]=0,U[4]=U[166]=-1,H[4]=H[166]=1,K[4]=K[166]=1,Q[4]=Q[166]=0,$[4]=$[166]=0,z[16]=z[154]=0,Y[16]=Y[154]=1,X[16]=X[154]=1,k[16]=k[154]=1,B[16]=B[154]=0,j[16]=j[154]=1,tt[64]=tt[106]=0,et[64]=et[106]=1,nt[64]=nt[106]=0,F[64]=F[106]=-1,G[64]=G[106]=0,q[64]=q[106]=1,tt[2]=tt[168]=0,et[2]=et[168]=-1,nt[2]=nt[168]=1,it[2]=it[168]=0,rt[2]=rt[168]=-1,ot[2]=ot[168]=0,W[2]=W[168]=-1,J[2]=J[168]=0,Z[2]=Z[168]=0,K[2]=K[168]=-1,Q[2]=Q[168]=0,$[2]=$[168]=1,z[8]=z[162]=0,Y[8]=Y[162]=-1,X[8]=X[162]=0,V[8]=V[162]=0,U[8]=U[162]=-1,H[8]=H[162]=1,W[8]=W[162]=1,J[8]=J[162]=0,Z[8]=Z[162]=1,K[8]=K[162]=1,Q[8]=Q[162]=0,$[8]=$[162]=0,z[32]=z[138]=0,Y[32]=Y[138]=1,X[32]=X[138]=1,V[32]=V[138]=0,U[32]=U[138]=1,H[32]=H[138]=0,F[32]=F[138]=1,G[32]=G[138]=0,q[32]=q[138]=0,k[32]=k[138]=1,B[32]=B[138]=0,j[32]=j[138]=1,it[128]=it[42]=0,rt[128]=rt[42]=1,ot[128]=ot[42]=1,tt[128]=tt[42]=0,et[128]=et[42]=1,nt[128]=nt[42]=0,F[128]=F[42]=-1,G[128]=G[42]=0,q[128]=q[42]=1,k[128]=k[42]=-1,B[128]=B[42]=0,j[128]=j[42]=0,V[5]=V[165]=-1,U[5]=U[165]=0,H[5]=H[165]=0,it[5]=it[165]=1,rt[5]=rt[165]=0,ot[5]=ot[165]=0,K[20]=K[150]=0,Q[20]=Q[150]=1,$[20]=$[150]=1,k[20]=k[150]=0,B[20]=B[150]=-1,j[20]=j[150]=1,z[80]=z[90]=-1,Y[80]=Y[90]=0,X[80]=X[90]=1,tt[80]=tt[90]=1,et[80]=et[90]=0,nt[80]=nt[90]=1,W[65]=W[105]=0,J[65]=J[105]=1,Z[65]=Z[105]=0,F[65]=F[105]=0,G[65]=G[105]=-1,q[65]=q[105]=0,z[160]=z[10]=-1,Y[160]=Y[10]=0,X[160]=X[10]=1,V[160]=V[10]=-1,U[160]=U[10]=0,H[160]=H[10]=0,it[160]=it[10]=1,rt[160]=rt[10]=0,ot[160]=ot[10]=0,tt[160]=tt[10]=1,et[160]=et[10]=0,nt[160]=nt[10]=1,K[130]=K[40]=0,Q[130]=Q[40]=1,$[130]=$[40]=1,W[130]=W[40]=0,J[130]=J[40]=1,Z[130]=Z[40]=0,F[130]=F[40]=0,G[130]=G[40]=-1,q[130]=q[40]=0,k[130]=k[40]=0,B[130]=B[40]=-1,j[130]=j[40]=1,V[37]=V[133]=0,U[37]=U[133]=1,H[37]=H[133]=1,it[37]=it[133]=0,rt[37]=rt[133]=1,ot[37]=ot[133]=0,F[37]=F[133]=-1,G[37]=G[133]=0,q[37]=q[133]=0,k[37]=k[133]=1,B[37]=B[133]=0,j[37]=j[133]=0,K[148]=K[22]=-1,Q[148]=Q[22]=0,$[148]=$[22]=0,it[148]=it[22]=0,rt[148]=rt[22]=-1,ot[148]=ot[22]=1,tt[148]=tt[22]=0,et[148]=et[22]=1,nt[148]=nt[22]=1,k[148]=k[22]=-1,B[148]=B[22]=0,j[148]=j[22]=1,z[82]=z[88]=0,Y[82]=Y[88]=-1,X[82]=X[88]=1,K[82]=K[88]=1,Q[82]=Q[88]=0,$[82]=$[88]=1,W[82]=W[88]=-1,J[82]=J[88]=0,Z[82]=Z[88]=1,tt[82]=tt[88]=0,et[82]=et[88]=-1,nt[82]=nt[88]=0,z[73]=z[97]=0,Y[73]=Y[97]=1,X[73]=X[97]=0,V[73]=V[97]=0,U[73]=U[97]=-1,H[73]=H[97]=0,W[73]=W[97]=1,J[73]=J[97]=0,Z[73]=Z[97]=0,F[73]=F[97]=1,G[73]=G[97]=0,q[73]=q[97]=1,z[145]=z[25]=0,Y[145]=Y[25]=-1,X[145]=X[25]=0,W[145]=W[25]=1,J[145]=J[25]=0,Z[145]=Z[25]=1,it[145]=it[25]=0,rt[145]=rt[25]=1,ot[145]=ot[25]=1,k[145]=k[25]=-1,B[145]=B[25]=0,j[145]=j[25]=0,V[70]=V[100]=0,U[70]=U[100]=1,H[70]=H[100]=0,K[70]=K[100]=-1,Q[70]=Q[100]=0,$[70]=$[100]=1,tt[70]=tt[100]=0,et[70]=et[100]=-1,nt[70]=nt[100]=1,F[70]=F[100]=1,G[70]=G[100]=0,q[70]=q[100]=0,V[101]=V[69]=0,U[101]=U[69]=1,H[101]=H[69]=0,F[101]=F[69]=1,G[101]=G[69]=0,q[101]=q[69]=0,it[149]=it[21]=0,rt[149]=rt[21]=1,ot[149]=ot[21]=1,k[149]=k[21]=-1,B[149]=B[21]=0,j[149]=j[21]=0,K[86]=K[84]=-1,Q[86]=Q[84]=0,$[86]=$[84]=1,tt[86]=tt[84]=0,et[86]=et[84]=-1,nt[86]=nt[84]=1,z[89]=z[81]=0,Y[89]=Y[81]=-1,X[89]=X[81]=0,W[89]=W[81]=1,J[89]=J[81]=0,Z[89]=Z[81]=1,z[96]=z[74]=0,Y[96]=Y[74]=1,X[96]=X[74]=0,V[96]=V[74]=-1,U[96]=U[74]=0,H[96]=H[74]=1,tt[96]=tt[74]=1,et[96]=et[74]=0,nt[96]=nt[74]=0,F[96]=F[74]=1,G[96]=G[74]=0,q[96]=q[74]=1,z[24]=z[146]=0,Y[24]=Y[146]=-1,X[24]=X[146]=1,K[24]=K[146]=1,Q[24]=Q[146]=0,$[24]=$[146]=1,W[24]=W[146]=0,J[24]=J[146]=1,Z[24]=Z[146]=1,k[24]=k[146]=0,B[24]=B[146]=-1,j[24]=j[146]=0,V[6]=V[164]=-1,U[6]=U[164]=0,H[6]=H[164]=1,K[6]=K[164]=-1,Q[6]=Q[164]=0,$[6]=$[164]=0,it[6]=it[164]=0,rt[6]=rt[164]=-1,ot[6]=ot[164]=1,tt[6]=tt[164]=1,et[6]=et[164]=0,nt[6]=nt[164]=0,W[129]=W[41]=0,J[129]=J[41]=1,Z[129]=Z[41]=1,it[129]=it[41]=0,rt[129]=rt[41]=1,ot[129]=ot[41]=0,F[129]=F[41]=-1,G[129]=G[41]=0,q[129]=q[41]=0,k[129]=k[41]=0,B[129]=B[41]=-1,j[129]=j[41]=0,K[66]=K[104]=0,Q[66]=Q[104]=1,$[66]=$[104]=0,W[66]=W[104]=-1,J[66]=J[104]=0,Z[66]=Z[104]=1,tt[66]=tt[104]=0,et[66]=et[104]=-1,nt[66]=nt[104]=0,F[66]=F[104]=0,G[66]=G[104]=-1,q[66]=q[104]=1,z[144]=z[26]=-1,Y[144]=Y[26]=0,X[144]=X[26]=0,it[144]=it[26]=1,rt[144]=rt[26]=0,ot[144]=ot[26]=1,tt[144]=tt[26]=0,et[144]=et[26]=1,nt[144]=nt[26]=1,k[144]=k[26]=-1,B[144]=B[26]=0,j[144]=j[26]=1,V[36]=V[134]=0,U[36]=U[134]=1,H[36]=H[134]=1,K[36]=K[134]=0,Q[36]=Q[134]=1,$[36]=$[134]=0,F[36]=F[134]=0,G[36]=G[134]=-1,q[36]=q[134]=1,k[36]=k[134]=1,B[36]=B[134]=0,j[36]=j[134]=0,z[9]=z[161]=-1,Y[9]=Y[161]=0,X[9]=X[161]=0,V[9]=V[161]=0,U[9]=U[161]=-1,H[9]=H[161]=0,W[9]=W[161]=1,J[9]=J[161]=0,Z[9]=Z[161]=0,it[9]=it[161]=1,rt[9]=rt[161]=0,ot[9]=ot[161]=1,z[136]=0,Y[136]=1,X[136]=1,V[136]=0,U[136]=1,H[136]=0,K[136]=-1,Q[136]=0,$[136]=1,W[136]=-1,J[136]=0,Z[136]=0,it[136]=0,rt[136]=-1,ot[136]=0,tt[136]=0,et[136]=-1,nt[136]=1,F[136]=1,G[136]=0,q[136]=0,k[136]=1,B[136]=0,j[136]=1,z[34]=0,Y[34]=-1,X[34]=0,V[34]=0,U[34]=-1,H[34]=1,K[34]=1,Q[34]=0,$[34]=0,W[34]=1,J[34]=0,Z[34]=1,it[34]=0,rt[34]=1,ot[34]=1,tt[34]=0,et[34]=1,nt[34]=0,F[34]=-1,G[34]=0,q[34]=1,k[34]=-1,B[34]=0,j[34]=0,z[35]=0,Y[35]=1,X[35]=1,V[35]=0,U[35]=-1,H[35]=1,K[35]=1,Q[35]=0,$[35]=0,W[35]=-1,J[35]=0,Z[35]=0,it[35]=0,rt[35]=-1,ot[35]=0,tt[35]=0,et[35]=1,nt[35]=0,F[35]=-1,G[35]=0,q[35]=1,k[35]=1,B[35]=0,j[35]=1,z[153]=0,Y[153]=1,X[153]=1,W[153]=-1,J[153]=0,Z[153]=0,it[153]=0,rt[153]=-1,ot[153]=0,k[153]=1,B[153]=0,j[153]=1,V[102]=0,U[102]=-1,H[102]=1,K[102]=1,Q[102]=0,$[102]=0,tt[102]=0,et[102]=1,nt[102]=0,F[102]=-1,G[102]=0,q[102]=1,z[155]=0,Y[155]=-1,X[155]=0,W[155]=1,J[155]=0,Z[155]=1,it[155]=0,rt[155]=1,ot[155]=1,k[155]=-1,B[155]=0,j[155]=0,V[103]=0,U[103]=1,H[103]=0,K[103]=-1,Q[103]=0,$[103]=1,tt[103]=0,et[103]=-1,nt[103]=1,F[103]=1,G[103]=0,q[103]=0,z[152]=0,Y[152]=1,X[152]=1,K[152]=-1,Q[152]=0,$[152]=1,W[152]=-1,J[152]=0,Z[152]=0,it[152]=0,rt[152]=-1,ot[152]=0,tt[152]=0,et[152]=-1,nt[152]=1,k[152]=1,B[152]=0,j[152]=1,z[156]=0,Y[156]=-1,X[156]=1,K[156]=1,Q[156]=0,$[156]=1,W[156]=-1,J[156]=0,Z[156]=0,it[156]=0,rt[156]=-1,ot[156]=0,tt[156]=0,et[156]=1,nt[156]=1,k[156]=-1,B[156]=0,j[156]=1,z[137]=0,Y[137]=1,X[137]=1,V[137]=0,U[137]=1,H[137]=0,W[137]=-1,J[137]=0,Z[137]=0,it[137]=0,rt[137]=-1,ot[137]=0,F[137]=1,G[137]=0,q[137]=0,k[137]=1,B[137]=0,j[137]=1,z[139]=0,Y[139]=1,X[139]=1,V[139]=0,U[139]=-1,H[139]=0,W[139]=1,J[139]=0,Z[139]=0,it[139]=0,rt[139]=1,ot[139]=0,F[139]=-1,G[139]=0,q[139]=0,k[139]=1,B[139]=0,j[139]=1,z[98]=0,Y[98]=-1,X[98]=0,V[98]=0,U[98]=-1,H[98]=1,K[98]=1,Q[98]=0,$[98]=0,W[98]=1,J[98]=0,Z[98]=1,tt[98]=0,et[98]=1,nt[98]=0,F[98]=-1,G[98]=0,q[98]=1,z[99]=0,Y[99]=1,X[99]=0,V[99]=0,U[99]=-1,H[99]=1,K[99]=1,Q[99]=0,$[99]=0,W[99]=-1,J[99]=0,Z[99]=1,tt[99]=0,et[99]=-1,nt[99]=0,F[99]=1,G[99]=0,q[99]=1,V[38]=0,U[38]=-1,H[38]=1,K[38]=1,Q[38]=0,$[38]=0,it[38]=0,rt[38]=1,ot[38]=1,tt[38]=0,et[38]=1,nt[38]=0,F[38]=-1,G[38]=0,q[38]=1,k[38]=-1,B[38]=0,j[38]=0,V[39]=0,U[39]=1,H[39]=1,K[39]=-1,Q[39]=0,$[39]=0,it[39]=0,rt[39]=-1,ot[39]=1,tt[39]=0,et[39]=1,nt[39]=0,F[39]=-1,G[39]=0,q[39]=1,k[39]=1,B[39]=0,j[39]=0;var st=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},at=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ut=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},lt=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},ct=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},ht=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},ft=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},gt=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},dt=[],pt=[],_t=[],vt=[],mt=[],yt=[],xt=[],Et=[];vt[1]=mt[1]=18,vt[169]=mt[169]=18,_t[4]=pt[4]=12,_t[166]=pt[166]=12,dt[16]=Et[16]=4,dt[154]=Et[154]=4,yt[64]=xt[64]=22,yt[106]=xt[106]=22,_t[2]=yt[2]=17,vt[2]=mt[2]=18,_t[168]=yt[168]=17,vt[168]=mt[168]=18,dt[8]=vt[8]=9,pt[8]=_t[8]=12,dt[162]=vt[162]=9,pt[162]=_t[162]=12,dt[32]=Et[32]=4,pt[32]=xt[32]=1,dt[138]=Et[138]=4,pt[138]=xt[138]=1,mt[128]=Et[128]=21,yt[128]=xt[128]=22,mt[42]=Et[42]=21,yt[42]=xt[42]=22,pt[5]=mt[5]=14,pt[165]=mt[165]=14,_t[20]=Et[20]=6,_t[150]=Et[150]=6,dt[80]=yt[80]=11,dt[90]=yt[90]=11,vt[65]=xt[65]=3,vt[105]=xt[105]=3,dt[160]=yt[160]=11,pt[160]=mt[160]=14,dt[10]=yt[10]=11,pt[10]=mt[10]=14,_t[130]=Et[130]=6,vt[130]=xt[130]=3,_t[40]=Et[40]=6,vt[40]=xt[40]=3,pt[101]=xt[101]=1,pt[69]=xt[69]=1,mt[149]=Et[149]=21,mt[21]=Et[21]=21,_t[86]=yt[86]=17,_t[84]=yt[84]=17,dt[89]=vt[89]=9,dt[81]=vt[81]=9,dt[96]=xt[96]=0,pt[96]=yt[96]=15,dt[74]=xt[74]=0,pt[74]=yt[74]=15,dt[24]=_t[24]=8,vt[24]=Et[24]=7,dt[146]=_t[146]=8,vt[146]=Et[146]=7,pt[6]=yt[6]=15,_t[6]=mt[6]=16,pt[164]=yt[164]=15,_t[164]=mt[164]=16,vt[129]=Et[129]=7,mt[129]=xt[129]=20,vt[41]=Et[41]=7,mt[41]=xt[41]=20,_t[66]=xt[66]=2,vt[66]=yt[66]=19,_t[104]=xt[104]=2,vt[104]=yt[104]=19,dt[144]=mt[144]=10,yt[144]=Et[144]=23,dt[26]=mt[26]=10,yt[26]=Et[26]=23,pt[36]=Et[36]=5,_t[36]=xt[36]=2,pt[134]=Et[134]=5,_t[134]=xt[134]=2,dt[9]=mt[9]=10,pt[9]=vt[9]=13,dt[161]=mt[161]=10,pt[161]=vt[161]=13,pt[37]=Et[37]=5,mt[37]=xt[37]=20,pt[133]=Et[133]=5,mt[133]=xt[133]=20,_t[148]=mt[148]=16,yt[148]=Et[148]=23,_t[22]=mt[22]=16,yt[22]=Et[22]=23,dt[82]=_t[82]=8,vt[82]=yt[82]=19,dt[88]=_t[88]=8,vt[88]=yt[88]=19,dt[73]=xt[73]=0,pt[73]=vt[73]=13,dt[97]=xt[97]=0,pt[97]=vt[97]=13,dt[145]=vt[145]=9,mt[145]=Et[145]=21,dt[25]=vt[25]=9,mt[25]=Et[25]=21,pt[70]=xt[70]=1,_t[70]=yt[70]=17,pt[100]=xt[100]=1,_t[100]=yt[100]=17,dt[34]=vt[34]=9,pt[34]=_t[34]=12,mt[34]=Et[34]=21,yt[34]=xt[34]=22,dt[136]=Et[136]=4,pt[136]=xt[136]=1,_t[136]=yt[136]=17,vt[136]=mt[136]=18,dt[35]=Et[35]=4,pt[35]=_t[35]=12,vt[35]=mt[35]=18,yt[35]=xt[35]=22,dt[153]=Et[153]=4,vt[153]=mt[153]=18,pt[102]=_t[102]=12,yt[102]=xt[102]=22,dt[155]=vt[155]=9,mt[155]=Et[155]=23,pt[103]=xt[103]=1,_t[103]=yt[103]=17,dt[152]=Et[152]=4,_t[152]=yt[152]=17,vt[152]=mt[152]=18,dt[156]=_t[156]=8,vt[156]=mt[156]=18,yt[156]=Et[156]=23,dt[137]=Et[137]=4,pt[137]=xt[137]=1,vt[137]=mt[137]=18,dt[139]=Et[139]=4,pt[139]=vt[139]=13,mt[139]=xt[139]=20,dt[98]=vt[98]=9,pt[98]=_t[98]=12,yt[98]=xt[98]=22,dt[99]=xt[99]=0,pt[99]=_t[99]=12,vt[99]=yt[99]=19,pt[38]=_t[38]=12,mt[38]=Et[38]=21,yt[38]=xt[38]=22,pt[39]=Et[39]=5,_t[39]=mt[39]=16,yt[39]=xt[39]=22;var wt=[];wt[1]=wt[169]=st,wt[4]=wt[166]=at,wt[16]=wt[154]=ut,wt[64]=wt[106]=lt,wt[168]=wt[2]=ct,wt[162]=wt[8]=ht,wt[138]=wt[32]=ft,wt[42]=wt[128]=gt,wt[5]=wt[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},wt[20]=wt[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},wt[80]=wt[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},wt[65]=wt[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},wt[160]=wt[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},wt[130]=wt[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},wt[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},wt[101]=wt[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},wt[149]=wt[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},wt[86]=wt[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},wt[89]=wt[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},wt[96]=wt[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},wt[24]=wt[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},wt[6]=wt[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},wt[129]=wt[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},wt[66]=wt[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},wt[144]=wt[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},wt[36]=wt[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},wt[9]=wt[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},wt[37]=wt[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},wt[148]=wt[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},wt[82]=wt[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},wt[73]=wt[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},wt[145]=wt[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},wt[70]=wt[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},wt[34]=function(t){return[gt(t),ht(t)]},wt[35]=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]]},wt[136]=function(t){return[ft(t),ct(t)]},wt[153]=function(t){return[ut(t),st(t)]},wt[102]=function(t){return[at(t),lt(t)]},wt[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},wt[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},wt[152]=function(t){return[ut(t),ct(t)]},wt[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},wt[137]=function(t){return[ft(t),st(t)]},wt[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},wt[98]=function(t){return[ht(t),lt(t)]},wt[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},wt[38]=function(t){return[at(t),gt(t)]},wt[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},e.exports=_,e.exports.default=_},{"@turf/area":2,"@turf/bbox":6,"@turf/boolean-point-in-polygon":24,"@turf/explode":75,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],86:[function(t,e,n){"use strict";function i(t,e,n){n=n||{};for(var i=Object.keys(E),r=0;r<i.length;r++){var s=i[r],a=n[s];a=void 0!==a&&null!==a?a:E[s],w[s]=a}w.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+e);var u=c(o(t,e));return"function"==typeof w.successCallback&&w.successCallback(u),u}function r(t,e,n){return(t-e)/(n-e)}function o(t,e){for(var n=t.length-1,i=t[0].length-1,o={rows:n,cols:i,cells:[]},s=0;s<n;++s){o.cells[s]=[];for(var a=0;a<i;++a){var u=0,l=t[s+1][a],c=t[s+1][a+1],h=t[s][a+1],f=t[s][a];if(!(isNaN(l)||isNaN(c)||isNaN(h)||isNaN(f))){u|=l>=e?8:0,u|=c>=e?4:0,u|=h>=e?2:0;var g=!1;if(5===(u|=f>=e?1:0)||10===u){var d=(l+c+h+f)/4;5===u&&d<e?(u=10,g=!0):10===u&&d<e&&(u=5,g=!0)}if(0!==u&&15!==u){var p,_,v,m;p=_=v=m=.5,1===u?(v=1-r(e,l,f),_=1-r(e,h,f)):2===u?(_=r(e,f,h),m=1-r(e,c,h)):3===u?(v=1-r(e,l,f),m=1-r(e,c,h)):4===u?(p=r(e,l,c),m=r(e,h,c)):5===u?(p=r(e,l,c),m=r(e,h,c),_=1-r(e,h,f),v=1-r(e,l,f)):6===u?(_=r(e,f,h),p=r(e,l,c)):7===u?(v=1-r(e,l,f),p=r(e,l,c)):8===u?(v=r(e,f,l),p=1-r(e,c,l)):9===u?(_=1-r(e,h,f),p=1-r(e,c,l)):10===u?(p=1-r(e,c,l),m=1-r(e,c,h),_=r(e,f,h),v=r(e,f,l)):11===u?(p=1-r(e,c,l),m=1-r(e,c,h)):12===u?(v=r(e,f,l),m=r(e,h,c)):13===u?(_=1-r(e,h,f),m=r(e,h,c)):14===u?(v=r(e,f,l),_=r(e,f,h)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+u),o.cells[s][a]={cval:u,flipped:g,top:p,right:m,bottom:_,left:v}}}}}return o}function s(t){return 5===t.cval||10===t.cval}function a(t){return 0===t.cval||15===t.cval}function u(t){a(t)||5===t.cval||10===t.cval||(t.cval=15)}function l(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}function c(t){var e=[],n=0;return t.cells.forEach(function(i,r){i.forEach(function(i,o){if(void 0!==i&&!s(i)&&!a(i)){var u=h(t.cells,r,o),l=!1;if("mergeable"===u.info)for(var c=u.path[u.path.length-1][0],f=u.path[u.path.length-1][1],g=n-1;g>=0;g--)if(Math.abs(e[g][0][0]-c)<=1e-7&&Math.abs(e[g][0][1]-f)<=1e-7){for(var d=u.path.length-2;d>=0;--d)e[g].unshift(u.path[d]);l=!0;break}l||(e[n++]=u.path)}})}),e}function h(t,e,n){var i,r,o,s=t.length,a=[],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","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],g=t[e][n],d=g.cval,p=l(g,o=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][d]);a.push([n+p[0],e+p[1]]),p=l(g,o=f[d]),a.push([n+p[0],e+p[1]]),u(g);for(var _=n+c[d],v=e+h[d],m=d;_>=0&&v>=0&&v<s&&(_!=n||v!=e)&&void 0!==(g=t[v][_]);){if(0===(d=g.cval)||15===d)return{path:a,info:"mergeable"};o=f[d],i=c[d],r=h[d],5!==d&&10!==d||(5===d?g.flipped?-1===h[m]?(o="left",i=-1,r=0):(o="right",i=1,r=0):-1===c[m]&&(o="bottom",i=0,r=-1):10===d&&(g.flipped?-1===c[m]?(o="top",i=0,r=1):(o="bottom",i=0,r=-1):1===h[m]&&(o="left",i=-1,r=0))),p=l(g,o),a.push([_+p[0],v+p[1]]),u(g),_+=i,v+=r,m=d}return{path:a,info:"closed"}}function f(t,e){if(e=e||{},!x.isObject(e))throw new Error("options is invalid");var n=e.zProperty||"elevation",i=e.flip,r=e.flags;y.collectionOf(t,"Point","input must contain Points");for(var o=g(t,i),s=[],a=0;a<o.length;a++){for(var u=o[a],l=[],c=0;c<u.length;c++){var h=u[c];h.properties[n]?l.push(h.properties[n]):l.push(0),!0===r&&(h.properties.matrixPosition=[a,c])}s.push(l)}return s}function g(t,e){var n={};return m.featureEach(t,function(t){var e=y.getCoords(t)[1];n[e]||(n[e]=[]),n[e].push(t)}),Object.keys(n).map(function(t){return n[t].sort(function(t,e){return y.getCoords(t)[0]-y.getCoords(e)[0]})}).sort(function(t,n){return e?y.getCoords(t[0])[1]-y.getCoords(n[0])[1]:y.getCoords(n[0])[1]-y.getCoords(t[0])[1]})}function d(t,e,n){if(n=n||{},!x.isObject(n))throw new Error("options is invalid");var i=n.zProperty||"elevation",r=n.commonProperties||{},o=n.breaksProperties||[];if(y.collectionOf(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!x.isObject(r))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=f(t,{zProperty:i,flip:!0}),a=_(p(s,e,i,r,o),s,t);return x.featureCollection(a)}function p(t,e,n,r,o){for(var s=[],a=1;a<e.length;a++){var u=+e[a],l=Object.assign({},r,o[a]);l[n]=u;var c=x.multiLineString(i(t,u),l);s.push(c)}return s}function _(t,e,n){var i=v(n),r=i[2]-i[0],o=i[3]-i[1],s=i[0],a=i[1],u=r/(e[0].length-1),l=o/(e.length-1),c=function(t){t[0]=t[0]*u+s,t[1]=t[1]*l+a};return t.forEach(function(t){m.coordEach(t,c)}),t}var v=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/bbox")),m=t("@turf/meta"),y=t("@turf/invariant"),x=t("@turf/helpers"),E={successCallback:null,verbose:!1},w={};e.exports=d,e.exports.default=d},{"@turf/bbox":6,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],87:[function(t,e,n){"use strict";function i(t){var e,n,i={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).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;n<t.length-1;n++)for(var s=n;s<e.length-1;s++){if(t===e){if(1===Math.abs(n-s))continue;if(0===n&&s===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var a=r(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[s][0],e[s][1],e[s+1][0],e[s+1][1]);a&&i.features.push(o.point([a[0],a[1]]))}})}),i}function r(t,e,n,i,r,o,s,a){var u,l,c,h,f,g={x:null,y:null,onLine1:!1,onLine2:!1};return 0==(u=(a-o)*(n-t)-(s-r)*(i-e))?null!==g.x&&null!==g.y&&g:(l=e-o,c=t-r,h=(s-r)*l-(a-o)*c,f=(n-t)*l-(i-e)*c,l=h/u,c=f/u,g.x=t+l*(n-t),g.y=e+l*(i-e),l>=0&&l<=1&&(g.onLine1=!0),c>=0&&c<=1&&(g.onLine2=!0),!(!g.onLine1||!g.onLine2)&&[g.x,g.y])}var o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],88:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");if(!t)throw new Error("geojson is required");return o.segmentReduce(t,function(t,n){var i=n.geometry.coordinates;return t+r(i[0],i[1],e)},0)}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/distance")),o=t("@turf/meta"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/distance":73,"@turf/helpers":79,"@turf/meta":105}],89:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i,r){if(r=r||{},!u.isObject(r))throw new Error("options is invalid");var l=r.steps,c=r.units;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===i||null===i)throw new Error("bearing2 is required");if("object"!=typeof r)throw new Error("options must be an object");l=l||64;var h=o(n),f=o(i),g=t.properties;if(h===f)return u.lineString(a(t,e,r).geometry.coordinates[0],g);for(var d=h,p=h<f?f:f+360,_=d,v=[],m=0;_<p;)v.push(s(t,e,_,c).geometry.coordinates),_=d+360*++m/l;return _>p&&v.push(s(t,e,p,c).geometry.coordinates),u.lineString(v,g)}function o(t){var e=t%360;return e<0&&(e+=360),e}var s=i(t("@turf/destination")),a=i(t("@turf/circle")),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/circle":34,"@turf/destination":68,"@turf/helpers":79}],90:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!l.isObject(n))throw new Error("options is invalid");var i=n.units,r=n.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var s=[];return u.flattenEach(t,function(t){r&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),o(t,e,i,function(t){s.push(t)})}),l.featureCollection(s)}function o(t,e,n,i){var r=s(t,{units:n});if(r<=e)return i(t);var o=r/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var u=0;u<o;u++)i(a(t,e*u,e*(u+1),{units:n}),u)}var s=i(t("@turf/length")),a=i(t("@turf/line-slice-along")),u=t("@turf/meta"),l=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/helpers":79,"@turf/length":88,"@turf/line-slice-along":97,"@turf/meta":105}],91:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n={},i=[];if("LineString"===t.type&&(t=c.feature(t)),"LineString"===e.type&&(e=c.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 r=o(t,e);return r&&i.push(r),c.featureCollection(i)}var h=s();return h.load(a(e)),l.featureEach(a(t),function(t){l.featureEach(h.search(t),function(e){var r=o(t,e);if(r){var s=u.getCoords(r).join(",");n[s]||(n[s]=!0,i.push(r))}})}),c.featureCollection(i)}function o(t,e){var n=u.getCoords(t),i=u.getCoords(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var r=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=i[0][0],h=i[0][1],f=i[1][0],g=i[1][1],d=(g-h)*(s-r)-(f-l)*(a-o),p=(f-l)*(o-h)-(g-h)*(r-l),_=(s-r)*(o-h)-(a-o)*(r-l);if(0===d)return null;var v=p/d,m=_/d;if(v>=0&&v<=1&&m>=0&&m<=1){var y=r+v*(s-r),x=o+v*(a-o);return c.point([y,x])}return null}var s=i(t("geojson-rbush")),a=i(t("@turf/line-segment")),u=t("@turf/invariant"),l=t("@turf/meta"),c=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/helpers":79,"@turf/invariant":84,"@turf/line-segment":96,"@turf/meta":105,"geojson-rbush":92}],92:[function(t,e,n){arguments[4][72][0].apply(n,arguments)},{dup:72}],93:[function(t,e,n){"use strict";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)}function h(t,e,n){if(n=n||{},!_.isObject(n))throw new Error("options is invalid");var i=n.units;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");var r=p.getType(t),o=t.properties;switch(r){case"LineString":return f(t,e,i);case"MultiLineString":var s=[];return d.flattenEach(t,function(t){s.push(f(t,e,i).geometry.coordinates)}),_.multiLineString(s,o);default:throw new Error("geometry "+r+" is not supported")}}function f(t,e,n){var i=[],r=_.lengthToDegrees(e,n),o=p.getCoords(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=g(t,o[e+1],r);if(i.push(n),e>0){var a=i[e-1],u=c(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}}),_.lineString(s,t.properties)}function g(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 d=t("@turf/meta"),p=t("@turf/invariant"),_=t("@turf/helpers");e.exports=h,e.exports.default=h},{"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],94:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function o(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):u(t,e,n))}function s(t){return null===t||void 0===t}function a(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 u(t,e,n){var i,u;if(s(t)||s(e))return!1;if(t.prototype!==e.prototype)return!1;if(r(t))return!!r(e)&&(t=m.call(t),e=m.call(e),o(t,e,n));if(a(t)){if(!a(e))return!1;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}try{var l=Object.keys(t),c=Object.keys(e)}catch(t){return!1}if(l.length!==c.length)return!1;for(l.sort(),c.sort(),i=l.length-1;i>=0;i--)if(l[i]!==c[i])return!1;for(i=l.length-1;i>=0;i--)if(u=l[i],!o(t[u],e[u],n))return!1;return typeof t==typeof e}function l(t,e,n){if(n=n||{},!v.isObject(n))throw new Error("options is invalid");var i=n.tolerance||0,r=[],s=h();s.load(f(t));var a;return _.segmentEach(e,function(t){var e=!1;_.featureEach(s.search(t),function(n){if(!1===e){var r=p.getCoords(t).sort(),s=p.getCoords(n).sort();o(r,s)?(e=!0,a=a?c(a,t):t):(0===i?d(r[0],n)&&d(r[1],n):g(n,r[0]).properties.dist<=i&&g(n,r[1]).properties.dist<=i)?(e=!0,a=a?c(a,t):t):(0===i?d(s[0],t)&&d(s[1],t):g(t,s[0]).properties.dist<=i&&g(t,s[1]).properties.dist<=i)&&(a=a?c(a,n):n)}}),!1===e&&a&&(r.push(a),a=void 0)}),a&&r.push(a),v.featureCollection(r)}function c(t,e){var n=p.getCoords(e),i=p.getCoords(t),r=i[0],s=i[i.length-1],a=t.geometry.coordinates;return o(n[0],r)?a.unshift(n[1]):o(n[0],s)?a.push(n[1]):o(n[1],r)?a.unshift(n[0]):o(n[1],s)&&a.push(n[0]),t}var h=i(t("geojson-rbush")),f=i(t("@turf/line-segment")),g=i(t("@turf/nearest-point-on-line")),d=i(t("@turf/boolean-point-on-line")),p=t("@turf/invariant"),_=t("@turf/meta"),v=t("@turf/helpers"),m=Array.prototype.slice;e.exports=l,e.exports.default=l},{"@turf/boolean-point-on-line":25,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-segment":96,"@turf/meta":105,"@turf/nearest-point-on-line":107,"geojson-rbush":95}],95:[function(t,e,n){arguments[4][72][0].apply(n,arguments)},{dup:72}],96:[function(t,e,n){"use strict";function i(t){if(!t)throw new Error("geojson is required");var e=[];return l.flattenEach(t,function(t){r(t,e)}),a.featureCollection(e)}function r(t,e){var n=[],i=t.geometry;switch(i.type){case"Polygon":n=u.getCoords(i);break;case"LineString":n=[u.getCoords(i)]}n.forEach(function(n){o(n,t.properties).forEach(function(t){t.id=e.length,e.push(t)})})}function o(t,e){var n=[];return t.reduce(function(t,i){var r=a.lineString([t,i],e);return r.bbox=s(t,i),n.push(r),i}),n}function s(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return[n<r?n:r,i<o?i:o,n>r?n:r,i>o?i:o]}var a=t("@turf/helpers"),u=t("@turf/invariant"),l=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],97:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){if(i=i||{},!u.isObject(i))throw new Error("options is invalid");var r,l=[];if("Feature"===t.type)r=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");r=t.coordinates}for(var c,h,f,g=0,d=0;d<r.length&&!(e>=g&&d===r.length-1);d++){if(g>e&&0===l.length){if(!(c=e-g))return l.push(r[d]),u.lineString(l);h=o(r[d],r[d-1])-180,f=a(r[d],c,h,i),l.push(f.geometry.coordinates)}if(g>=n)return(c=n-g)?(h=o(r[d],r[d-1])-180,f=a(r[d],c,h,i),l.push(f.geometry.coordinates),u.lineString(l)):(l.push(r[d]),u.lineString(l));if(g>=e&&l.push(r[d]),d===r.length-1)return u.lineString(l);g+=s(r[d],r[d+1],i)}return u.lineString(r[r.length-1])}var o=i(t("@turf/bearing")),s=i(t("@turf/distance")),a=i(t("@turf/destination")),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/destination":68,"@turf/distance":73,"@turf/helpers":79}],98:[function(t,e,n){"use strict";function i(t,e,n){var i;if("Feature"===n.type)i=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");i=n.coordinates}for(var s,a=o(n,t),u=o(n,e),l=[(s=a.properties.index<=u.properties.index?[a,u]:[u,a])[0].geometry.coordinates],c=s[0].properties.index+1;c<s[1].properties.index+1;c++)l.push(i[c]);return l.push(s[1].geometry.coordinates),r.lineString(l,n.properties)}var r=t("@turf/helpers"),o=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/nearest-point-on-line"));e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/nearest-point-on-line":107}],99:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var n=p.getType(t),i=p.getType(e);if("LineString"!==n)throw new Error("line must be LineString");if("FeatureCollection"===i)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===i)throw new Error("splitter cannot be a GeometryCollection");var r=h(e,{precision:7});switch(i){case"Point":return s(t,r);case"MultiPoint":return o(t,c(r));case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return o(t,d(t,r))}}function o(t,e){var n=[],i=l();return _.featureEach(e,function(e){if(n.forEach(function(t,e){t.id=e}),n.length){var r=a(e,i.search(e));n=n.filter(function(t){return t.id!==r.id}),i.remove(r),_.featureEach(s(r,e),function(t){n.push(t),i.insert(t)})}else n=s(t,e).features,i.load(v.featureCollection(n))}),v.featureCollection(n)}function s(t,e){var n=[],i=p.getCoords(t)[0],r=p.getCoords(t)[t.geometry.coordinates.length-1];if(u(i,p.getCoords(e))||u(r,p.getCoords(e)))return v.featureCollection([t]);var o=l(),s=f(t);o.load(s);var c=o.search(e);if(!c.features.length)return v.featureCollection([t]);var h=a(e,c),g=[i],d=_.featureReduce(s,function(t,i,r){var o=p.getCoords(i)[1],s=p.getCoords(e);return r===h.id?(t.push(s),n.push(v.lineString(t)),u(s,o)?[s]:[s,o]):(t.push(o),t)},g);return d.length>1&&n.push(v.lineString(d)),v.featureCollection(n)}function a(t,e){if(!e.features)throw new Error("<lines> must contain features");if(1===e.features.length)return e.features[0];var n,i=1/0;return _.featureEach(e,function(e){var r=g(e,t).properties.dist;r<i&&(n=e,i=r)}),n}function u(t,e){return t[0]===e[0]&&t[1]===e[1]}var l=i(t("geojson-rbush")),c=i(t("@turf/flatten")),h=i(t("@turf/truncate")),f=i(t("@turf/line-segment")),g=i(t("@turf/nearest-point-on-line")),d=i(t("@turf/line-intersect")),p=t("@turf/invariant"),_=t("@turf/meta"),v=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/flatten":76,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-intersect":91,"@turf/line-segment":96,"@turf/meta":105,"@turf/nearest-point-on-line":107,"@turf/truncate":151,"geojson-rbush":100}],100:[function(t,e,n){arguments[4][72][0].apply(n,arguments)},{dup:72}],101:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.properties,i=e.autoComplete,o=e.orderCoords;if(!t)throw new Error("lines is required");switch(i=void 0===i||i,o=void 0===o||o,u.getType(t)){case"FeatureCollection":case"GeometryCollection":var s=[];return(t.features?t.features:t.geometries).forEach(function(t){s.push(u.getCoords(r(t,{},i,o)))}),l.multiPolygon(s,n)}return r(t,n,i,o)}function r(t,e,n,i){e=e||t.properties||{};var r=u.getCoords(t),c=u.getType(t);if(!r.length)throw new Error("line must contain coordinates");switch(c){case"LineString":return n&&(r=o(r)),l.polygon([r],e);case"MultiLineString":var h=[],f=0;return r.forEach(function(t){if(n&&(t=o(t)),i){var e=s(a(l.lineString(t)));e>f?(h.unshift(t),f=e):h.push(t)}else h.push(t)}),l.polygon(h,e);default:throw new Error("geometry type "+c+" is not supported")}}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=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/bbox")),u=t("@turf/invariant"),l=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/bbox":6,"@turf/helpers":79,"@turf/invariant":84}],102:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=a(e),i=s(t),r=i[0],l=i[1];return o(n,r=u(r),l=u(l))}function o(t,e,n){var i=[];return i.push(t.geometry.coordinates[0]),d.flattenEach(e,function(t){i.push(t.geometry.coordinates[0])}),d.flattenEach(n,function(t){i.push(t.geometry.coordinates[0])}),f.polygon(i)}function s(t){var e=[],n=[];return d.flattenEach(t,function(t){var i=t.geometry.coordinates,r=i[0],o=i.slice(1);e.push(f.polygon([r])),o.forEach(function(t){n.push(f.polygon([t]))})}),[f.featureCollection(e),f.featureCollection(n)]}function a(t){var e=t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return f.polygon(e)}function u(t){if(t.features.length<=1)return t;var e=c(t),n=[],i={};return d.flattenEach(t,function(t,r){if(i[r])return!0;for(e.remove({index:r},l),i[r]=!0;;){var o=g(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map(function(t){return i[t.index]=!0,e.remove({index:t.index},l),t.geojson});a.push(t),t=h.apply(this,a)}if(0===s.length)break}n.push(t)}),f.featureCollection(n)}function l(t,e){return t.index===e.index}function c(t){var e=p(),n=[];return d.flattenEach(t,function(t,e){var i=g(t);n.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],geojson:t,index:e})}),e.load(n),e}var h=i(t("@turf/union")),f=t("@turf/helpers"),g=i(t("@turf/bbox")),d=t("@turf/meta"),p=t("rbush");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/helpers":79,"@turf/meta":105,"@turf/union":152,rbush:104}],103:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],104:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{dup:50,quickselect:103}],105:[function(t,e,n){"use strict";function i(t,e,n){if(null!==t){var r,o,s,a,u,l,c,h,f,g,d=0,p=0,_=t.type,v="FeatureCollection"===_,m="Feature"===_,y=v?t.features.length:1;for(r=0;r<y;r++)for(c=(g=!!(f=v?t.features[r].geometry:m?t.geometry:t)&&"GeometryCollection"===f.type)?f.geometries.length:1,o=0;o<c;o++){var x=0;if(null!==(l=g?f.geometries[o]:f)){h=l.coordinates;var E=l.type;switch(d=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":e(h,p,r,x),p++,x++;break;case"LineString":case"MultiPoint":for(s=0;s<h.length;s++)e(h[s],p,r,x),p++,"MultiPoint"===E&&x++;"LineString"===E&&x++;break;case"Polygon":case"MultiLineString":for(s=0;s<h.length;s++){for(a=0;a<h[s].length-d;a++)e(h[s][a],p,r,x),p++;"MultiLineString"===E&&x++}"Polygon"===E&&x++;break;case"MultiPolygon":for(s=0;s<h.length;s++){for(a=0;a<h[s].length;a++)for(u=0;u<h[s][a].length-d;u++)e(h[s][a][u],p,r,x),p++;x++}break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)i(l.geometries[s],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function r(t,e,n,r){var o=n;return i(t,function(t,i,r,s){o=0===i&&void 0===n?t:e(o,t,i,r,s)},r),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function a(t,e){var n,i,r,o,s,a,u,l,c,h,f=0,g="FeatureCollection"===t.type,d="Feature"===t.type,p=g?t.features.length:1;for(n=0;n<p;n++){for(a=g?t.features[n].geometry:d?t.geometry:t,l=g?t.features[n].properties:d?t.properties:{},c=g?t.features[n].bbox:d?t.bbox:void 0,h=g?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,r=0;r<s;r++)if(null!==(o=u?a.geometries[r]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,f,l,c,h);break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)e(o.geometries[i],f,l,c,h);break;default:throw new Error("Unknown Geometry Type")}else e(null,f,l,c,h);f++}}function u(t,e){a(t,function(t,n,i,r,o){var s=null===t?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return void e(h.feature(t,i,r,o),n,0)}var a;switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}t.coordinates.forEach(function(t,r){var o={type:a,coordinates:t};e(h.feature(o,i),n,r)})})}function l(t,e){u(t,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;"Point"!==s&&"MultiPoint"!==s&&r(t,function(r,s){var a=h.lineString([r,s],t.properties);return e(a,n,i,o),o++,s})}})}function c(t,e){if(!t)throw new Error("geojson is required");u(t,function(t,n,i){if(null!==t.geometry){var r=t.geometry.type,o=t.geometry.coordinates;switch(r){case"LineString":e(t,n,i,0);break;case"Polygon":for(var s=0;s<o.length;s++)e(h.lineString(o[s],t.properties),n,i,s)}}})}Object.defineProperty(n,"__esModule",{value:!0});var h=t("@turf/helpers");n.coordEach=i,n.coordReduce=r,n.propEach=o,n.propReduce=function(t,e,n){var i=n;return o(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i},n.featureEach=s,n.featureReduce=function(t,e,n){var i=n;return s(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i},n.coordAll=function(t){var e=[];return i(t,function(t){e.push(t)}),e},n.geomEach=a,n.geomReduce=function(t,e,n){var i=n;return a(t,function(t,r,o){i=0===r&&void 0===n?t:e(i,t,r,o)}),i},n.flattenEach=u,n.flattenReduce=function(t,e,n){var i=n;return u(t,function(t,r,o){i=0===r&&0===o&&void 0===n?t:e(i,t,r,o)}),i},n.segmentEach=l,n.segmentReduce=function(t,e,n){var i=n,r=!1;return l(t,function(t,o,s,a){i=!1===r&&void 0===n?t:e(i,t,o,s,a),r=!0}),i},n.lineEach=c,n.lineReduce=function(t,e,n){var i=n;return c(t,function(t,r,o,s){i=0===r&&void 0===n?t:e(i,t,r,o,s)}),i}},{"@turf/helpers":79}],106:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){var n=a(t,e),i=o(t,e);return s(t,n/2,i)}var o=i(t("@turf/bearing")),s=i(t("@turf/destination")),a=i(t("@turf/distance"));e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/destination":68,"@turf/distance":73}],107:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!c.isObject(n))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var r=c.point([1/0,1/0],{dist:1/0}),f=0;return l.flattenEach(t,function(t){for(var i=h.getCoords(t),l=0;l<i.length-1;l++){var g=c.point(i[l]);g.properties.dist=s(e,g,n);var d=c.point(i[l+1]);d.properties.dist=s(e,d,n);var p=s(g,d,n),_=Math.max(g.properties.dist,d.properties.dist),v=o(g,d),m=a(e,_,v+90,n),y=a(e,_,v-90,n),x=u(c.lineString([m.geometry.coordinates,y.geometry.coordinates]),c.lineString([g.geometry.coordinates,d.geometry.coordinates])),E=null;x.features.length>0&&((E=x.features[0]).properties.dist=s(e,E,n),E.properties.location=f+s(g,E,n)),g.properties.dist<r.properties.dist&&((r=g).properties.index=l,r.properties.location=f),d.properties.dist<r.properties.dist&&((r=d).properties.index=l+1,r.properties.location=f+p),E&&E.properties.dist<r.properties.dist&&((r=E).properties.index=l),f+=p}}),r}var o=i(t("@turf/bearing")),s=i(t("@turf/distance")),a=i(t("@turf/destination")),u=i(t("@turf/line-intersect")),l=t("@turf/meta"),c=t("@turf/helpers"),h=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/destination":68,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-intersect":91,"@turf/meta":105}],108:[function(t,e,n){"use strict";function i(t,e,n){var i="object"==typeof n?n.units:n;if(!t)throw new Error("points is required");if(!(t=r(t)).features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==(e.geometry?e.geometry.type:e.type))throw new Error("line must be a LineString");var a=1/0,u=null;return s.featureEach(t,function(t){var n=o(t,e,{units:i});n<a&&(a=n,u=t)}),u.properties.dist=a,u}function r(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return s.geomEach(t,function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})}),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter(function(t){return"Point"===t.geometry.type}),t;default:throw new Error("points must be a Point Collection")}}var o=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/point-to-line-distance")),s=t("@turf/meta");e.exports=i,e.exports.default=i},{"@turf/meta":105,"@turf/point-to-line-distance":113}],109:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var n,i=1/0;return a.featureEach(e,function(e,r){var a=s(t,e);a<i&&((n=o(e)).properties.featureIndex=r,n.properties.distanceToPoint=a,i=a)}),n}var o=i(t("@turf/clone")),s=i(t("@turf/distance")),a=t("@turf/meta");e.exports=r,e.exports.default=r},{"@turf/clone":36,"@turf/distance":73,"@turf/meta":105}],110:[function(t,e,n){"use strict";function i(t,e){var n=r.getCoord(t),i=r.getGeom(e).coordinates[0];if(i.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var o=e.properties||{},s=o.a,a=o.b,u=o.c,l=n[0],c=n[1],h=i[0][0],f=i[0][1],g=void 0!==s?s:i[0][2],d=i[1][0],p=i[1][1],_=void 0!==a?a:i[1][2],v=i[2][0],m=i[2][1],y=void 0!==u?u:i[2][2];return(y*(l-h)*(c-p)+g*(l-d)*(c-m)+_*(l-v)*(c-f)-_*(l-h)*(c-m)-y*(l-d)*(c-f)-g*(l-v)*(c-p))/((l-h)*(c-p)+(l-d)*(c-m)+(l-v)*(c-f)-(l-h)*(c-m)-(l-d)*(c-f)-(l-v)*(c-p))}var r=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":84}],111:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i=n.mask,r=n.properties,l=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!u.isNumber(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(a.getType(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var c=t[0],h=t[1],f=t[2],g=t[3],d=e/s([c,h],[f,h],n)*(f-c),p=e/s([c,h],[c,g],n)*(g-h),_=f-c,v=g-h,m=Math.floor(_/d),y=(v-Math.floor(v/p)*p)/2,x=c+(_-m*d)/2;x<=f;){for(var E=h+y;E<=g;){var w=u.point([x,E],r);i?o(w,i)&&l.push(w):l.push(w),E+=p}x+=d}return u.featureCollection(l)}var o=i(t("@turf/boolean-within")),s=i(t("@turf/distance")),a=t("@turf/invariant"),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/boolean-within":26,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84}],112:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){for(var e=o(t),n=u(e),i=!1,r=0;!i&&r<e.features.length;){var f,g=e.features[r].geometry,d=!1;if("Point"===g.type)n.geometry.coordinates[0]===g.coordinates[0]&&n.geometry.coordinates[1]===g.coordinates[1]&&(i=!0);else if("MultiPoint"===g.type){var p=!1;for(f=0;!p&&f<g.coordinates.length;)n.geometry.coordinates[0]===g.coordinates[f][0]&&n.geometry.coordinates[1]===g.coordinates[f][1]&&(i=!0,p=!0),f++}else if("LineString"===g.type)for(f=0;!d&&f<g.coordinates.length-1;)s(n.geometry.coordinates[0],n.geometry.coordinates[1],g.coordinates[f][0],g.coordinates[f][1],g.coordinates[f+1][0],g.coordinates[f+1][1])&&(d=!0,i=!0),f++;else if("MultiLineString"===g.type)for(var _=0;_<g.coordinates.length;){d=!1,f=0;for(var v=g.coordinates[_];!d&&f<v.length-1;)s(n.geometry.coordinates[0],n.geometry.coordinates[1],v[f][0],v[f][1],v[f+1][0],v[f+1][1])&&(d=!0,i=!0),f++;_++}else"Polygon"!==g.type&&"MultiPolygon"!==g.type||c(n,g)&&(i=!0);r++}if(i)return n;var m=h.featureCollection([]);for(r=0;r<e.features.length;r++)m.features=m.features.concat(a(e.features[r]).features);return h.point(l(n,m).geometry.coordinates)}function o(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?h.featureCollection([h.feature(t)]):h.featureCollection([t]):t}function s(t,e,n,i,r,o){return Math.sqrt((r-n)*(r-n)+(o-i)*(o-i))===Math.sqrt((t-n)*(t-n)+(e-i)*(e-i))+Math.sqrt((r-t)*(r-t)+(o-e)*(o-e))}var a=i(t("@turf/explode")),u=i(t("@turf/center")),l=i(t("@turf/nearest-point")),c=i(t("@turf/boolean-point-in-polygon")),h=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/boolean-point-in-polygon":24,"@turf/center":32,"@turf/explode":75,"@turf/helpers":79,"@turf/nearest-point":109}],113:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!_.isObject(n))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=_.point(t):"Point"===t.type?t=_.feature(t):d.featureOf(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=_.lineString(e):"LineString"===e.type?e=_.feature(e):d.featureOf(e,"LineString","line");var i=1/0,r=t.geometry.coordinates;return p.segmentEach(e,function(t){var e=t.geometry.coordinates[0],s=t.geometry.coordinates[1],a=o(r,e,s,n);i>a&&(i=a)}),i}function o(t,e,n,i){var r=i.mercator,o=!0!==r?c(e,t,i):u(e,t,i),a=_.bearingToAzimuth(!0!==r?l(e,t):h(e,t)),f=_.bearingToAzimuth(!0!==r?l(e,n):h(e,n)),g=Math.abs(a-f);if(g>90)return o;var d=(f+180)%360,p=_.bearingToAzimuth(!0!==r?l(n,t):h(n,t)),v=Math.abs(p-d);return v>180&&(v=Math.abs(v-360)),v>90?!0!==r?c(t,n,i):u(t,n,i):!0!==r?o*Math.sin(_.degreesToRadians(g)):s(e,n,t,i)}function s(t,e,n,i){var r=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(r=t[0]>0||e[0]>0||n[0]>0?-180:180);var o=_.point(n),s=g.toMercator([t[0]+r,t[1]]),u=g.toMercator([e[0]+r,e[1]]),l=g.toMercator([n[0]+r,n[1]]),c=g.toWgs84(a(s,u,l));return 0!==r&&(c[0]-=r),f(o,c,i)}function a(t,e,n){var i=t[0],r=t[1],o=e[0]-i,s=e[1]-r,a=((n[0]-i)*o+(n[1]-r)*s)/(o*o+s*s);return[i+a*o,r+a*s]}function u(t,e,n){var i=n.units,r=0;Math.abs(t[0])>=180&&(r=t[0]>0?-180:180),Math.abs(e[0])>=180&&(r=e[0]>0?-180:180);var o=g.toMercator([t[0]+r,t[1]]),s=g.toMercator([e[0]+r,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]),l=Math.sqrt(u);return _.convertLength(l,"meters",i)}var l=i(t("@turf/bearing")),c=i(t("@turf/distance")),h=i(t("@turf/rhumb-bearing")),f=i(t("@turf/rhumb-distance")),g=t("@turf/projection"),d=t("@turf/invariant"),p=t("@turf/meta"),_=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/bearing":7,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/projection":130,"@turf/rhumb-bearing":133,"@turf/rhumb-distance":135}],114:[function(t,e,n){"use strict";function i(t,e){for(var n=o.featureCollection([]),i=0;i<e.features.length;i++)for(var s=0;s<t.features.length;s++)r(t.features[s],e.features[i])&&n.features.push(t.features[s]);return n}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/boolean-point-in-polygon")),o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/boolean-point-in-polygon":24,"@turf/helpers":79}],115:[function(t,e,n){"use strict";function i(t,e){var n,i,o,s=u.getCoords(t),c=u.getCoords(e);switch(u.getType(e)){case"Polygon":n=c[0][0],i=c[0][0],o=a(c[0][0],c[0][c[0].length-1],s);var h=r(c[0],s,o,void 0,n,i);n=h[0],i=h[1];break;case"MultiPolygon":n=c[0][0][0],i=c[0][0][0],o=a(c[0][0][0],c[0][0][c[0][0].length-1],s),c.forEach(function(t){var e=r(t[0],s,o,void 0,n,i);n=e[0],i=e[1]})}return l.featureCollection([l.point(n),l.point(i)])}function r(t,e,n,i,r,u){for(var l=0;l<t.length;l++){var c=t[l],h=t[l+1];l===t.length-1&&(h=t[0]),i=a(c,h,e),n<=0&&i>0?s(e,c,r)||(r=c):n>0&&i<=0&&(o(e,c,u)||(u=c)),n=i}return[r,u]}function o(t,e,n){return a(t,e,n)>0}function s(t,e,n){return a(t,e,n)<0}function a(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}var u=t("@turf/invariant"),l=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],116:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");var n=e.properties,i=o.getType(t),a=o.getCoords(t);if(n=n||t.properties||{},!a.length)throw new Error("polygon must contain coordinates");switch(i){case"Polygon":return r(a,n);case"MultiPolygon":var u=[];return a.forEach(function(t){u.push(r(t,n))}),s.featureCollection(u);default:throw new Error("geom "+i+" not supported")}}function r(t,e){return t.length>1?s.multiLineString(t,e):s.lineString(t[0],e)}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],117:[function(t,e,n){"use strict";var i=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("polygonize"));e.exports=i,e.exports.default=i},{polygonize:128}],118:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":79,dup:5}],119:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{"@turf/meta":120,dup:6}],120:[function(t,e,n){"use strict";function i(t,e,n){if(null!==t){var r,o,s,a,u,l,c,h,f,g,d=0,p=0,_=t.type,v="FeatureCollection"===_,m="Feature"===_,y=v?t.features.length:1;for(r=0;r<y;r++)for(c=(g=!!(f=v?t.features[r].geometry:m?t.geometry:t)&&"GeometryCollection"===f.type)?f.geometries.length:1,o=0;o<c;o++){var x=0;if(null!==(l=g?f.geometries[o]:f)){h=l.coordinates;var E=l.type;switch(d=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":e(h,p,r,x),p++,x++;break;case"LineString":case"MultiPoint":for(s=0;s<h.length;s++)e(h[s],p,r,x),p++,"MultiPoint"===E&&x++;"LineString"===E&&x++;break;case"Polygon":case"MultiLineString":for(s=0;s<h.length;s++){for(a=0;a<h[s].length-d;a++)e(h[s][a],p,r,x),p++;"MultiLineString"===E&&x++}"Polygon"===E&&x++;break;case"MultiPolygon":for(s=0;s<h.length;s++){for(a=0;a<h[s].length;a++)for(u=0;u<h[s][a].length-d;u++)e(h[s][a][u],p,r,x),p++;x++}break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)i(l.geometries[s],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function r(t,e,n,r){var o=n;return i(t,function(t,i,r,s){o=0===i&&void 0===n?t:e(o,t,i,r,s)},r),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function a(t,e){var n,i,r,o,s,a,u,l,c=0,h="FeatureCollection"===t.type,f="Feature"===t.type,g=h?t.features.length:1;for(n=0;n<g;n++){for(a=h?t.features[n].geometry:f?t.geometry:t,l=h?t.features[n].properties:f?t.properties:{},s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,r=0;r<s;r++)if(null!==(o=u?a.geometries[r]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,c,l);break;case"GeometryCollection":for(i=0;i<o.geometries.length;i++)e(o.geometries[i],c,l);break;default:throw new Error("Unknown Geometry Type")}else e(null,c,l);c++}}function u(t,e){a(t,function(t,n,i){var r=null===t?null:t.type;switch(r){case null:case"Point":case"LineString":case"Polygon":return void e(c(t,i),n,0)}var o;switch(r){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}t.coordinates.forEach(function(t,r){e(c({type:o,coordinates:t},i),n,r)})})}function l(t,e){u(t,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;"Point"!==s&&"MultiPoint"!==s&&r(t,function(r,s){var a=h([r,s],t.properties);return e(a,n,i,o),o++,s})}})}function c(t,e){if(void 0===t)throw new Error("No geometry passed");return{type:"Feature",properties:e||{},geometry:t}}function h(t,e){if(!t)throw new Error("No coordinates passed");if(t.length<2)throw new Error("Coordinates must be an array of two or more positions");return{type:"Feature",properties:e||{},geometry:{type:"LineString",coordinates:t}}}function f(t,e){if(!t)throw new Error("geojson is required");var n=t.geometry?t.geometry.type:t.type;if(!n)throw new Error("invalid geojson");if("FeatureCollection"===n)throw new Error("FeatureCollection is not supported");if("GeometryCollection"===n)throw new Error("GeometryCollection is not supported");var i=t.geometry?t.geometry.coordinates:t.coordinates;if(!i)throw new Error("geojson must contain coordinates");switch(n){case"LineString":return void e(i,0,0);case"Polygon":case"MultiLineString":for(var r=0,o=0;o<i.length;o++)"MultiLineString"===n&&(r=o),e(i[o],o,r);return;case"MultiPolygon":for(var s=0;s<i.length;s++)for(var a=0;a<i[s].length;a++)e(i[s][a],a,s);return;default:throw new Error(n+" geometry not supported")}}Object.defineProperty(n,"__esModule",{value:!0}),n.coordEach=i,n.coordReduce=r,n.propEach=o,n.propReduce=function(t,e,n){var i=n;return o(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i},n.featureEach=s,n.featureReduce=function(t,e,n){var i=n;return s(t,function(t,r){i=0===r&&void 0===n?t:e(i,t,r)}),i},n.coordAll=function(t){var e=[];return i(t,function(t){e.push(t)}),e},n.geomEach=a,n.geomReduce=function(t,e,n){var i=n;return a(t,function(t,r,o){i=0===r&&void 0===n?t:e(i,t,r,o)}),i},n.flattenEach=u,n.flattenReduce=function(t,e,n){var i=n;return u(t,function(t,r,o){i=0===r&&0===o&&void 0===n?t:e(i,t,r,o)}),i},n.segmentEach=l,n.segmentReduce=function(t,e,n){var i=n,r=!1;return l(t,function(t,o,s,a){i=!1===r&&void 0===n?t:e(i,t,o,s,a),r=!0}),i},n.lineEach=f,n.lineReduce=function(t,e,n){var i=n;return f(t,function(t,r,o){i=0===r&&void 0===n?t:e(i,t,r,o)}),i}},{}],121:[function(t,e,n){arguments[4][74][0].apply(n,arguments)},{"@turf/bbox":119,"@turf/bbox-polygon":118,dup:74}],122:[function(t,e,n){"use strict";function i(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var i=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var a=s.getCoord(t),u=s.getCoords(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===o(a,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h<u.length&&!f;h++)if(r(a,u[h][0],i)){for(var g=!1,d=1;d<u[h].length&&!g;)r(a,u[h][d],!i)&&(g=!0),d++;g||(f=!0)}return f}function r(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function o(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/invariant":123}],123:[function(t,e,n){"use strict";function i(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 r(e),e;throw new Error("No valid coordinates")}function r(t){if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return!0;if(Array.isArray(t[0])&&t[0].length)return r(t[0]);throw new Error("coordinates must only contain numbers")}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoord=function(t){if(!t)throw new Error("obj is required");var e=i(t);if(e.length>1&&"number"==typeof e[0]&&"number"==typeof e[1])return e;throw new Error("Coordinate is not a valid Point")},n.getCoords=i,n.containsNumber=r,n.geojsonType=function(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)},n.featureOf=function(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)},n.collectionOf=function(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<t.features.length;i++){var r=t.features[i];if(!r||"Feature"!==r.type||!r.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+r.geometry.type)}},n.getGeom=function(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")},n.getGeomType=function(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType")},n.getType=function(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}},{}],124:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("@turf/helpers"),s=t("./util"),a=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}}]),r(t,[{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"}},{key:"toLineString",value:function(){return(0,o.lineString)([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return(0,s.orientationIndex)(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}();n.default=a,e.exports=n.default},{"./util":129,"@turf/helpers":79}],125:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=t("./util"),a=t("@turf/helpers"),u=i(t("@turf/envelope")),l=i(t("@turf/inside")),c=function(){function t(){r(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0}return o(t,[{key:"push",value:function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var t=this,e=this.edges.reduce(function(e,n,i){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=i),e},0),n=(0===e?this.length:e)-1,i=(e+1)%this.length,r=(0,s.orientationIndex)(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(0,a.multiPoint)(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=(0,a.polygon)([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=(0,u.default)(this.toPolygon())}},{key:"inside",value:function(t){return(0,l.default)(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()),!(0,s.envelopeIsEqual)(o,n)&&(0,s.envelopeContains)(o,n)){var u=t.map(function(t){return t.from.coordinates}).find(function(t){return!e.some(function(e){return(0,s.coordinatesEqual)(t,e.from.coordinates)})});u&&e.inside((0,a.point)(u))&&(r&&!(0,s.envelopeContains)(i,o)||(r=e))}}),r}}]),t}();n.default=c,e.exports=n.default},{"./util":129,"@turf/envelope":121,"@turf/helpers":79,"@turf/inside":122}],126:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=i(t("./Node")),u=i(t("./Edge")),l=i(t("./EdgeRing")),c=t("@turf/meta"),h=t("@turf/invariant"),f=function(){function t(){r(this,t),this.edges=[],this.nodes={}}return s(t,[{key:"getNode",value:function(t){var e=a.default.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new a.default(t)),n}},{key:"addEdge",value:function(t,e){var n=new u.default(t,e),i=n.getSymetric();this.edges.push(n),this.edges.push(i)}}],[{key:"fromGeoJson",value:function(e){o(e);var n=new t;return(0,c.flattenEach)(e,function(t){(0,h.featureOf)(t,"LineString","Graph::fromGeoJson"),(0,c.coordReduce)(t,function(t,e){if(t){var i=n.getNode(t),r=n.getNode(e);n.addEdge(i,r)}return e})}),n}}]),s(t,[{key:"deleteDangles",value:function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})}},{key:"_removeIfDangle",value:function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}}},{key:"deleteCutEdges",value:function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})}},{key:"_computeNextCWEdges",value:function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach(function(t){return e._computeNextCWEdges(e.nodes[t])}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})}},{key:"_computeNextCCWEdges",value:function(t,e){for(var n=t.getOuterEdges(),i=void 0,r=void 0,o=n.length-1;o>=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 l.default;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}();n.default=f,e.exports=n.default},{"./Edge":124,"./EdgeRing":125,"./Node":127,"@turf/invariant":123,"@turf/meta":105}],127:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("./util"),s=function(){function t(e){i(this,t),this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return r(t,null,[{key:"buildId",value:function(t){return t.join(",")}}]),r(t,[{key:"removeInnerEdge",value:function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})}},{key:"removeOuterEdge",value:function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})}},{key:"addOuterEdge",value:function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var i=e.to,r=n.to;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-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 s=(0,o.orientationIndex)(t.coordinates,i.coordinates,r.coordinates);return s<0?1:s>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}();n.default=s,e.exports=n.default},{"./util":129}],128:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var r=i(t("./Graph")),o=i(t("./EdgeRing")),s=t("@turf/helpers");n.default=function(t){var e=r.default.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],i=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):i.push(t)}),n.forEach(function(t){o.default.findEdgeRingContaining(t,i)&&i.push(t)}),(0,s.featureCollection)(i.map(function(t){return t.toPolygon()}))},e.exports=n.default},{"./EdgeRing":125,"./Graph":126,"@turf/helpers":79}],129:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.coordinatesEqual=n.envelopeContains=n.envelopeIsEqual=n.orientationIndex=void 0;var i=function(t){return t&&t.__esModule?t:{default:t}}(t("@turf/inside")),r=t("@turf/helpers");n.orientationIndex=function(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)},n.envelopeIsEqual=function(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)},n.envelopeContains=function(t,e){return e.geometry.coordinates[0].every(function(e){return(0,i.default)((0,r.point)(e),t)})},n.coordinatesEqual=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},{"@turf/helpers":79,"@turf/inside":122}],130:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&u.isNumber(t[0])?t="mercator"===e?r(t):o(t):(!0!==i&&(t=l(t)),a.coordEach(t,function(t){var n="mercator"===e?r(t):o(t);t[0]=n[0],t[1]=n[1]})),t}function r(t){var e=Math.PI/180,n=6378137,i=20037508.342789244,r=[n*(Math.abs(t[0])<=180?t[0]:t[0]-360*s(t[0]))*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>i&&(r[0]=i),r[0]<-i&&(r[0]=-i),r[1]>i&&(r[1]=i),r[1]<-i&&(r[1]=-i),r}function o(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}function s(t){return t<0?-1:t>0?1:0}Object.defineProperty(n,"__esModule",{value:!0});var a=t("@turf/meta"),u=t("@turf/helpers"),l=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/clone"));n.toMercator=function(t,e){return i(t,"mercator",e)},n.toWgs84=function(t,e){return i(t,"wgs84",e)}},{"@turf/clone":36,"@turf/helpers":79,"@turf/meta":105}],131:[function(t,e,n){"use strict";function i(t){if(l.isObject(t)&&(t=t.bbox),t&&!Array.isArray(t))throw new Error("bbox is invalid");return t?u(t):[s(),a()]}function r(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}function o(){return Math.random()-.5}function s(){return 360*o()}function a(){return 180*o()}function u(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}Object.defineProperty(n,"__esModule",{value:!0});var l=t("@turf/helpers");n.randomPosition=i,n.randomPoint=function(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.bbox;void 0!==t&&null!==t||(t=1);for(var r=[],o=0;o<t;o++)r.push(l.point(i(n)));return l.featureCollection(r)},n.randomPolygon=function(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.bbox,o=e.num_vertices,s=e.max_radial_length;void 0!==t&&null!==t||(t=1),l.isNumber(o)||(o=10),l.isNumber(s)||(s=10);for(var a=[],u=0;u<t;u++){var c=[],h=Array.apply(null,new Array(o+1)).map(Math.random);h.forEach(function(t,e,n){n[e]=e>0?t+n[e-1]:t}),h.forEach(function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();c.push([e*s*Math.sin(t),e*s*Math.cos(t)])}),c[c.length-1]=c[0],c=c.map(r(i(n))),a.push(l.polygon([c]))}return l.featureCollection(a)},n.randomLineString=function(t,e){if(e=e||{},!l.isObject(e))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,o=e.max_length,s=e.max_rotation;void 0!==t&&null!==t||(t=1),(!l.isNumber(r)||r<2)&&(r=10),l.isNumber(o)||(o=1e-4),l.isNumber(s)||(s=Math.PI/8);for(var a=[],u=0;u<t;u++){for(var c=[i(n)],h=0;h<r-1;h++){var f=(0===h?2*Math.random()*Math.PI:Math.tan((c[h][1]-c[h-1][1])/(c[h][0]-c[h-1][0])))+(Math.random()-.5)*s*2,g=Math.random()*o;c.push([c[h][0]+g*Math.cos(f),c[h][1]+g*Math.sin(f)])}a.push(l.lineString(c))}return l.featureCollection(a)}},{"@turf/helpers":79}],132:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(e=e||{},!f.isObject(e))throw new Error("options is invalid");var n=e.reverse||!1,i=e.mutate||!1;if(!t)throw new Error("<geojson> is required");if("boolean"!=typeof n)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof i)throw new Error("<mutate> must be a boolean");!1===i&&(t=u(t));var r=[];switch(t.type){case"GeometryCollection":return c.geomEach(t,function(t){o(t,n)}),t;case"FeatureCollection":return c.featureEach(t,function(t){c.featureEach(o(t,n),function(t){r.push(t)})}),f.featureCollection(r)}return o(t,n)}function o(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return c.geomEach(t,function(t){o(t,e)}),t;case"LineString":return s(h.getCoords(t),e),t;case"Polygon":return a(h.getCoords(t),e),t;case"MultiLineString":return h.getCoords(t).forEach(function(t){s(t,e)}),t;case"MultiPolygon":return h.getCoords(t).forEach(function(t){a(t,e)}),t;case"Point":case"MultiPoint":return t}}function s(t,e){l(t)===e&&t.reverse()}function a(t,e){l(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)l(t[n])===e&&t[n].reverse()}var u=i(t("@turf/clone")),l=i(t("@turf/boolean-clockwise")),c=t("@turf/meta"),h=t("@turf/invariant"),f=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/boolean-clockwise":9,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105}],133:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!s.isObject(n))throw new Error("options is invalid");var i=n.final;if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");var a;return(a=i?r(o.getCoord(e),o.getCoord(t)):r(o.getCoord(t),o.getCoord(e)))>180?-(360-a):a}function r(t,e){var n=s.degreesToRadians(t[1]),i=s.degreesToRadians(e[1]),r=s.degreesToRadians(e[0]-t[0]);r>Math.PI&&(r-=2*Math.PI),r<-Math.PI&&(r+=2*Math.PI);var o=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),a=Math.atan2(r,o);return(s.radiansToDegrees(a)+360)%360}var o=t("@turf/invariant"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],134:[function(t,e,n){"use strict";function i(t,e,n,i){if(i=i||{},!o.isObject(i))throw new Error("options is invalid");var a=i.units,u=i.properties;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");var l=o.convertLength(e,a,"meters"),c=s.getCoord(t),h=r(c,l,n);return h[0]+=h[0]-c[0]>180?-360:c[0]-h[0]>180?360:0,o.point(h,u)}function r(t,e,n,i){var r=e/(i=void 0===i?o.earthRadius:Number(i)),s=t[0]*Math.PI/180,a=o.degreesToRadians(t[1]),u=o.degreesToRadians(n),l=r*Math.cos(u),c=a+l;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),f=Math.abs(h)>1e-11?l/h:Math.cos(a);return[(180*(s+r*Math.sin(u)/f)/Math.PI+540)%360-180,180*c/Math.PI]}var o=t("@turf/helpers"),s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],135:[function(t,e,n){"use strict";function i(t,e,n){if(n=n||{},!o.isObject(n))throw new Error("options is invalid");var i=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var a=s.getCoord(t),u=s.getCoord(e);u[0]+=u[0]-a[0]>180?-360:a[0]-u[0]>180?360:0;var l=r(a,u);return o.convertLength(l,"meters",i)}function r(t,e,n){var i=n=void 0===n?o.earthRadius:Number(n),r=t[1]*Math.PI/180,s=e[1]*Math.PI/180,a=s-r,u=Math.abs(e[0]-t[0])*Math.PI/180;u>Math.PI&&(u-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),c=Math.abs(l)>1e-11?a/l:Math.cos(r);return Math.sqrt(a*a+c*c*u*u)*i}var o=t("@turf/helpers"),s=t("@turf/invariant");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/invariant":84}],136:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("featurecollection is required");if(null===e||void 0===e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return o.featureCollection(r(t.features,e))}function r(t,e){for(var n,i,r=t.slice(0),o=t.length,s=o-e;o-- >s;)n=r[i=Math.floor((o+1)*Math.random())],r[i]=r[o],r[o]=n;return r.slice(s)}var o=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],137:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i,r){if(r=r||{},!l.isObject(r))throw new Error("options is invalid");if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===i||null===i)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");if(o(n)===o(i))return s(t,e,r);var h=c.getCoords(t),f=a(t,e,n,i,r),g=[[h]];return u.coordEach(f,function(t){g[0].push(t)}),g[0].push(h),l.polygon(g)}function o(t){var e=t%360;return e<0&&(e+=360),e}var s=i(t("@turf/circle")),a=i(t("@turf/line-arc")),u=t("@turf/meta"),l=t("@turf/helpers"),c=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/circle":34,"@turf/helpers":79,"@turf/invariant":84,"@turf/line-arc":89,"@turf/meta":105}],138:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function o(){return new u(function(t){return t.f})}function s(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var i=0,r=t[n];i<r.length;i++){var o=new a(n,i,r[i]);this.grid[n][i]=o,this.nodes.push(o)}}this.init()}function a(t,e,n){this.x=t,this.y=e,this.weight=n}function u(t){this.content=[],this.scoreFunction=t}function l(t,e,n){if(n=n||{},!m.isObject(n))throw new Error("options is invalid");var i=n.resolution,r=n.minDistance,o=n.obstacles||m.featureCollection([]);if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(i&&!m.isNumber(i)||i<=0)throw new Error("options.resolution must be a number, greater than 0");if(r)throw new Error("options.minDistance is not yet implemented");var a=v.getCoord(t),u=v.getCoord(e);switch(t=m.point(a),e=m.point(u),v.getType(o)){case"FeatureCollection":if(0===o.features.length)return m.lineString([a,u]);break;case"Polygon":o=m.featureCollection([m.feature(v.getGeom(o))]);break;default:throw new Error("invalid obstacles")}var l=o;l.features.push(t),l.features.push(e);var f=h(d(_(h(l)),1.15));i||(i=g([f[0],f[1]],[f[2],f[1]],n)/100),l.features.pop(),l.features.pop();for(var x=f[0],E=f[1],w=f[2],b=f[3],I=i/g([x,E],[w,E],n)*(w-x),C=i/g([x,E],[x,b],n)*(b-E),N=w-x,S=b-E,L=(N-Math.floor(N/I)*I)/2,M=[],P=[],R=[],O=[],T=1/0,A=1/0,D=b-(S-Math.floor(S/C)*C)/2,F=0;D>=E;){for(var G=[],q=[],k=x+L,B=0;k<=w;){var j=m.point([k,D]),z=c(j,o);G.push(z?0:1),q.push(k+"|"+D);var Y=g(j,t);!z&&Y<T&&(T=Y,R={x:B,y:F});var X=g(j,e);!z&&X<A&&(A=X,O={x:B,y:F}),k+=I,B++}P.push(G),M.push(q),D-=C,F++}var V=new s(P,{diagonal:!0}),U=V.grid[R.y][R.x],H=V.grid[O.y][O.x],W=[a];return y.search(V,U,H).forEach(function(t){var e=M[t.x][t.y].split("|");W.push([+e[0],+e[1]])}),W.push(u),p(m.lineString(W))}function c(t,e){for(var n=0;n<e.features.length;n++)if(f(t,e.features[n]))return!0;return!1}var h=i(t("@turf/bbox")),f=i(t("@turf/boolean-point-in-polygon")),g=i(t("@turf/distance")),d=i(t("@turf/transform-scale")),p=i(t("@turf/clean-coords")),_=i(t("@turf/bbox-polygon")),v=t("@turf/invariant"),m=t("@turf/helpers"),y={search:function(t,e,n,i){t.cleanDirty();var s=(i=i||{}).heuristic||y.heuristics.manhattan,a=i.closest||!1,u=o(),l=e;for(e.h=s(e,n),u.push(e);u.size()>0;){var c=u.pop();if(c===n)return r(c);c.closed=!0;for(var h=t.neighbors(c),f=0,g=h.length;f<g;++f){var d=h[f];if(!d.closed&&!d.isWall()){var p=c.g+d.getCost(c),_=d.visited;(!_||p<d.g)&&(d.visited=!0,d.parent=c,d.h=d.h||s(d,n),d.g=p,d.f=d.g+d.h,t.markDirty(d),a&&(d.h<l.h||d.h===l.h&&d.g<l.g)&&(l=d),_?u.rescoreElement(d):u.push(d))}}}return a?r(l):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),i=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return 1*(i+r)+(n-2)*Math.min(i,r)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};s.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)y.cleanNode(this.nodes[t])},s.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)y.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},s.prototype.markDirty=function(t){this.dirtyNodes.push(t)},s.prototype.neighbors=function(t){var e=[],n=t.x,i=t.y,r=this.grid;return r[n-1]&&r[n-1][i]&&e.push(r[n-1][i]),r[n+1]&&r[n+1][i]&&e.push(r[n+1][i]),r[n]&&r[n][i-1]&&e.push(r[n][i-1]),r[n]&&r[n][i+1]&&e.push(r[n][i+1]),this.diagonal&&(r[n-1]&&r[n-1][i-1]&&e.push(r[n-1][i-1]),r[n+1]&&r[n+1][i-1]&&e.push(r[n+1][i-1]),r[n-1]&&r[n-1][i+1]&&e.push(r[n-1][i+1]),r[n+1]&&r[n+1][i+1]&&e.push(r[n+1][i+1])),e},s.prototype.toString=function(){for(var t,e,n,i,r=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,i=(e=o[s]).length;n<i;n++)t.push(e[n].weight);r.push(t.join(" "))}return r.join("\n")},a.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},a.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},a.prototype.isWall=function(){return 0===this.weight},u.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,i=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(i)))break;this.content[n]=e,this.content[t]=i,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],i=this.scoreFunction(n);;){var r,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(r=this.scoreFunction(u))<i&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?i:r)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}},e.exports=l,e.exports.default=l},{"@turf/bbox":6,"@turf/bbox-polygon":5,"@turf/boolean-point-in-polygon":24,"@turf/clean-coords":35,"@turf/distance":73,"@turf/helpers":79,"@turf/invariant":84,"@turf/transform-scale":148}],139:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e){if(e=e||{},!f.isObject(e))throw new Error("options is invalid");var n=e.tolerance,i=e.highQuality,r=e.mutate;if(!t)throw new Error("geojson is required");if(n&&n<0)throw new Error("invalid tolerance");return!0!==r&&(t=c(t)),h.geomEach(t,function(t){o(t,n,i)}),t}function o(t,e,n){var i=t.type;if("Point"===i||"MultiPoint"===i)return t;l(t,!0);var r=t.coordinates;switch(i){case"LineString":t.coordinates=s(r,e,n);break;case"MultiLineString":t.coordinates=r.map(function(t){return s(t,e,n)});break;case"Polygon":t.coordinates=a(r,e,n);break;case"MultiPolygon":t.coordinates=r.map(function(t){return a(t,e,n)})}return t}function s(t,e,n){return g(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 r=g(i,e,n).map(function(t){return[t.x,t.y]});!u(r);)r=g(i,e-=.01*e,n).map(function(t){return[t.x,t.y]});return r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),r})}function u(t){return!(t.length<3)&&!(3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}var l=i(t("@turf/clean-coords")),c=i(t("@turf/clone")),h=t("@turf/meta"),f=t("@turf/helpers"),g=t("simplify-js");e.exports=r,e.exports.default=r},{"@turf/clean-coords":35,"@turf/clone":36,"@turf/helpers":79,"@turf/meta":105,"simplify-js":140}],140:[function(t,e,n){!function(){"use strict";function t(t,e){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}function n(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 i(e,n){for(var i,r=e[0],o=[r],s=1,a=e.length;s<a;s++)t(i=e[s],r)>n&&(o.push(i),r=i);return r!==i&&o.push(i),o}function r(t,e){var i,r,o,s,a=t.length,u=new("undefined"!=typeof Uint8Array?Uint8Array:Array)(a),l=0,c=a-1,h=[],f=[];for(u[l]=u[c]=1;c;){for(r=0,i=l+1;i<c;i++)(o=n(t[i],t[l],t[c]))>r&&(s=i,r=o);r>e&&(u[s]=1,h.push(l,s,s,c)),c=h.pop(),l=h.pop()}for(i=0;i<a;i++)u[i]&&f.push(t[i]);return f}function o(t,e,n){var o=void 0!==e?e*e:1;return t=n?t:i(t,o),t=r(t,o)}void 0!==e?e.exports=o:"undefined"!=typeof self?self.simplify=o:window.simplify=o}()},{}],141:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i=n.properties,r=n.mask,l=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!u.isNumber(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(r&&-1===["Polygon","MultiPolygon"].indexOf(a.getType(r)))throw new Error("options.mask must be a (Multi)Polygon");for(var c=t[0],h=t[1],f=t[2],g=t[3],d=e/o([c,h],[f,h],n)*(f-c),p=e/o([c,h],[c,g],n)*(g-h),_=f-c,v=g-h,m=Math.floor(_/d),y=Math.floor(v/p),x=(v-y*p)/2,E=c+(_-m*d)/2,w=0;w<m;w++){for(var b=h+x,I=0;I<y;I++){var C=u.polygon([[[E,b],[E,b+p],[E+d,b+p],[E+d,b],[E,b]]],i);r?s(r,C)&&l.push(C):l.push(C),b+=p}E+=d}return u.featureCollection(l)}var o=i(t("@turf/distance")),s=i(t("@turf/intersect")),a=t("@turf/invariant"),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/distance":73,"@turf/helpers":79,"@turf/intersect":82,"@turf/invariant":84}],142:[function(t,e,n){"use strict";function i(t){var e=t[0],n=t[1],i=t[2],o=t[3];if(r(t.slice(0,2),[i,n])>=r(t.slice(0,2),[e,o])){var s=(n+o)/2;return[e,s-(i-e)/2,i,s+(i-e)/2]}var a=(e+i)/2;return[a-(o-n)/2,n,a+(o-n)/2,o]}var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(t("@turf/distance"));e.exports=i,e.exports.default=i},{"@turf/distance":73}],143:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){return t=s(t),e=s(e),a.featureEach(t,function(t){t.properties||(t.properties={}),a.featureEach(e,function(e){void 0===t.properties[i]&&o(t,e)&&(t.properties[i]=e.properties[n])})}),t}var o=i(t("@turf/boolean-point-in-polygon")),s=i(t("@turf/clone")),a=t("@turf/meta");e.exports=r,e.exports.default=r},{"@turf/boolean-point-in-polygon":24,"@turf/clone":36,"@turf/meta":105}],144:[function(t,e,n){"use strict";function i(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=r(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(r(t))}),e}function r(t){var e=o(t),n=a(e.vertices,e.holes,2),i=[],r=[];n.forEach(function(t,i){var o=n[i];r.push([e.vertices[2*o],e.vertices[2*o+1]])});for(var u=0;u<r.length;u+=3){var l=r.slice(u,u+3);l.push(r[u]),i.push(s.polygon([l]))}return i}function o(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}var s=t("@turf/helpers"),a=t("earcut");e.exports=i,e.exports.default=i},{"@turf/helpers":79,earcut:145}],145:[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,g,d,p,_;if(i&&(a=h(t,e,a,n)),t.length>80*n){l=f=t[0],c=g=t[1];for(var v=n;v<o;v+=n)d=t[v],p=t[v+1],d<l&&(l=d),p<c&&(c=p),d>f&&(f=d),p>g&&(g=p);_=Math.max(f-l,g-c)}return s(a,u,n,l,c,_),u}function r(t,e,n,i,r){var o,s;if(r===R(t,e,n,i)>0)for(o=e;o<n;o+=i)s=L(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=L(o,t[o],t[o+1],s);return s&&w(s,s.next)&&(M(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||!w(i,i.next)&&0!==E(i.prev,i,i.next))i=i.next;else{if(M(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&&p(t,i,r,h);for(var g,d,_=t;t.prev!==t.next;)if(g=t.prev,d=t.next,h?u(t,i,r,h):a(t))e.push(g.i/n),e.push(t.i/n),e.push(d.i/n),M(t),t=d.next,_=d.next;else if((t=d)===_){f?1===f?s(t=l(t,e,n),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(E(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(y(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&E(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(E(r,o,s)>=0)return!1;for(var a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,u=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,l=r.x>o.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=v(a,u,e,n,i),f=v(l,c,e,n,i),g=t.nextZ;g&&g.z<=f;){if(g!==t.prev&&g!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&E(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(g=t.prevZ;g&&g.z>=h;){if(g!==t.prev&&g!==t.next&&y(r.x,r.y,o.x,o.y,s.x,s.y,g.x,g.y)&&E(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}function l(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!w(r,o)&&b(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),M(i),M(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&&x(u,l)){var c=S(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=[];for(s=0,a=e.length;s<a;s++)(u=r(t,e[s]*i,s<a-1?e[s+1]*i:t.length,i,!1))===u.next&&(u.steiner=!0),l.push(m(u));for(l.sort(f),s=0;s<l.length;s++)g(l[s],n),n=o(n,n.next);return n}function f(t,e){return t.x-e.x}function g(t,e){if(e=d(t,e)){var n=S(e,t);o(n,n.next)}}function d(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=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.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===s)return n.prev;var u,l=n,c=n.x,h=n.y,f=1/0;for(i=n.next;i!==l;)r>=i.x&&i.x>=c&&y(o<h?r:s,o,c,h,o<h?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<f||u===f&&i.x>n.x)&&C(i,t)&&(n=i,f=u),i=i.next;return n}function p(t,e,n,i){var r=t;do{null===r.z&&(r.z=v(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,_(r)}function _(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;e<l&&(a++,i=i.nextZ);e++);for(u=l;a>0||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 v(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<n.x&&(n=e),e=e.next}while(e!==t);return n}function y(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!I(t,e)&&C(t,e)&&C(e,t)&&N(t,e)}function E(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,n,i){return!!(w(t,e)&&w(n,i)||w(t,i)&&w(n,e))||E(t,e,n)>0!=E(t,e,i)>0&&E(n,i,t)>0!=E(n,i,e)>0}function I(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&&b(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function C(t,e){return E(t.prev,t,t.next)<0?E(t,e,t.next)>=0&&E(t,t.prev,e)>=0:E(t,e,t.prev)<0||E(t,t.next,e)<0}function N(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 S(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 M(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 R(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}e.exports=i,i.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(R(t,0,o,n));if(r)for(var a=0,u=e.length;a<u;a++){var l=e[a]*n,c=a<u-1?e[a+1]*n:t.length;s-=Math.abs(R(t,l,c,n))}var h=0;for(a=0;a<i.length;a+=3){var f=i[a]*n,g=i[a+1]*n,d=i[a+2]*n;h+=Math.abs((t[f]-t[d])*(t[g+1]-t[f+1])-(t[f]-t[g])*(t[d+1]-t[f+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},i.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n}},{}],146:[function(t,e,n){"use strict";function i(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return u.featureCollection(a(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.polygon([[e,i,r,e]],o)}))}function r(t,e,n){this.a=t,this.b=e,this.c=n;var i,r,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,l=o*(t.x+e.x)+s*(t.y+e.y),c=a*(t.x+n.x)+u*(t.y+n.y),h=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*l-s*c)/h,this.y=(o*c-a*l)/h,i=this.x-t.x,r=this.y-t.y,this.r=i*i+r*r}function o(t,e){return e.x-t.x}function s(t){var e,n,i,r,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],i=s;i;)if(o=t[--i],r=t[--i],e===r&&n===o||e===o&&n===r){t.splice(s,2),t.splice(i,2),s-=2;continue t}}function a(t){if(t.length<3)return[];t.sort(o);for(var e,n,i,a,u,l,c=t.length-1,h=t[c].x,f=t[0].x,g=t[c].y,d=g;c--;)t[c].y<g&&(g=t[c].y),t[c].y>d&&(d=t[c].y);var p,_=f-h,v=d-g,m=_>v?_:v,y=.5*(f+h),x=.5*(d+g),E=[new r({x:y-20*m,y:x-m,__sentinel:!0},{x:y,y:x+20*m,__sentinel:!0},{x:y+20*m,y:x-m,__sentinel:!0})],w=[],b=[];for(c=t.length;c--;){for(b.length=0,p=E.length;p--;)(_=t[c].x-E[p].x)>0&&_*_>E[p].r?(w.push(E[p]),E.splice(p,1)):_*_+(v=t[c].y-E[p].y)*v>E[p].r||(b.push(E[p].a,E[p].b,E[p].b,E[p].c,E[p].c,E[p].a),E.splice(p,1));for(s(b),p=b.length;p;)n=b[--p],e=b[--p],i=t[c],a=n.x-e.x,u=n.y-e.y,l=2*(a*(i.y-n.y)-u*(i.x-n.x)),Math.abs(l)>1e-12&&E.push(new r(e,n,i))}for(Array.prototype.push.apply(w,E),c=w.length;c--;)(w[c].a.__sentinel||w[c].b.__sentinel||w[c].c.__sentinel)&&w.splice(c,1);return w}var u=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79}],147:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!f.isObject(n))throw new Error("options is invalid");var i=n.pivot,r=n.mutate;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:(i||(i=o(t)),!1!==r&&void 0!==r||(t=l(t)),c.coordEach(t,function(t){var n=s(i,t)+e,r=a(i,t),o=h.getCoords(u(i,r,n));t[0]=o[0],t[1]=o[1]}),t)}var o=i(t("@turf/centroid")),s=i(t("@turf/rhumb-bearing")),a=i(t("@turf/rhumb-distance")),u=i(t("@turf/rhumb-destination")),l=i(t("@turf/clone")),c=t("@turf/meta"),h=t("@turf/invariant"),f=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/centroid":33,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/rhumb-bearing":133,"@turf/rhumb-destination":134,"@turf/rhumb-distance":135}],148:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!p.isObject(n))throw new Error("options is invalid");var i=n.origin,r=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var s=Array.isArray(i)||"object"==typeof i;return!0!==r&&(t=a(t)),"FeatureCollection"!==t.type||s?o(t,e,i):(d.featureEach(t,function(n,r){t.features[r]=o(n,e,i)}),t)}function o(t,e,n){var i="Point"===_.getType(t);return n=s(t,n),1===e||i?t:(d.coordEach(t,function(t){var i=f(n,t),r=h(n,t),o=i*e,s=_.getCoords(g(n,o,r));t[0]=s[0],t[1]=s[1],3===t.length&&(t[2]*=e)}),t)}function s(t,e){if(void 0!==e&&null!==e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return _.getCoord(e);var n=t.bbox?t.bbox:c(t),i=n[0],r=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return p.point([i,r]);case"se":case"southeast":case"eastsouth":case"bottomright":return p.point([o,r]);case"nw":case"northwest":case"westnorth":case"topleft":return p.point([i,s]);case"ne":case"northeast":case"eastnorth":case"topright":return p.point([o,s]);case"center":return u(t);case void 0:case null:case"centroid":return l(t);default:throw new Error("invalid origin")}}var a=i(t("@turf/clone")),u=i(t("@turf/center")),l=i(t("@turf/centroid")),c=i(t("@turf/bbox")),h=i(t("@turf/rhumb-bearing")),f=i(t("@turf/rhumb-distance")),g=i(t("@turf/rhumb-destination")),d=t("@turf/meta"),p=t("@turf/helpers"),_=t("@turf/invariant");e.exports=r,e.exports.default=r},{"@turf/bbox":6,"@turf/center":32,"@turf/centroid":33,"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/rhumb-bearing":133,"@turf/rhumb-destination":134,"@turf/rhumb-distance":135}],149:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){if(i=i||{},!s.isObject(i))throw new Error("options is invalid");var r=i.units,c=i.zTranslation,h=i.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(c&&"number"!=typeof c&&isNaN(c))throw new Error("zTranslation is not a number");if(c=void 0!==c?c:0,0===e&&0===c)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==h&&void 0!==h||(t=u(t)),o.coordEach(t,function(t){var i=a.getCoords(l(t,e,n,{units:r}));t[0]=i[0],t[1]=i[1],c&&3===t.length&&(t[2]+=c)}),t}var o=t("@turf/meta"),s=t("@turf/helpers"),a=t("@turf/invariant"),u=i(t("@turf/clone")),l=i(t("@turf/rhumb-destination"));e.exports=r,e.exports.default=r},{"@turf/clone":36,"@turf/helpers":79,"@turf/invariant":84,"@turf/meta":105,"@turf/rhumb-destination":134}],150:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n){if(n=n||{},!u.isObject(n))throw new Error("options is invalid");var i=n.properties,r=n.mask,l=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!u.isNumber(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(r&&-1===["Polygon","MultiPolygon"].indexOf(a.getType(r)))throw new Error("options.mask must be a (Multi)Polygon");for(var c=e/o([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),h=e/o([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),f=0,g=t[0];g<=t[2];){for(var d=0,p=t[1];p<=t[3];){var _=null,v=null;f%2==0&&d%2==0?(_=u.polygon([[[g,p],[g,p+h],[g+c,p],[g,p]]],i),v=u.polygon([[[g,p+h],[g+c,p+h],[g+c,p],[g,p+h]]],i)):f%2==0&&d%2==1?(_=u.polygon([[[g,p],[g+c,p+h],[g+c,p],[g,p]]],i),v=u.polygon([[[g,p],[g,p+h],[g+c,p+h],[g,p]]],i)):d%2==0&&f%2==1?(_=u.polygon([[[g,p],[g,p+h],[g+c,p+h],[g,p]]],i),v=u.polygon([[[g,p],[g+c,p+h],[g+c,p],[g,p]]],i)):d%2==1&&f%2==1&&(_=u.polygon([[[g,p],[g,p+h],[g+c,p],[g,p]]],i),v=u.polygon([[[g,p+h],[g+c,p+h],[g+c,p],[g,p+h]]],i)),r?(s(r,_)&&l.push(_),s(r,v)&&l.push(v)):(l.push(_),l.push(v)),p+=h,d++}f++,g+=c}return u.featureCollection(l)}var o=i(t("@turf/distance")),s=i(t("@turf/intersect")),a=t("@turf/invariant"),u=t("@turf/helpers");e.exports=r,e.exports.default=r},{"@turf/distance":73,"@turf/helpers":79,"@turf/intersect":82,"@turf/invariant":84}],151:[function(t,e,n){"use strict";function i(t,e){if(e=e||{},!s.isObject(e))throw new Error("options is invalid");var n=e.precision,i=e.coordinates,a=e.mutate;if(n=void 0===n||null===n||isNaN(n)?6:n,i=void 0===i||null===i||isNaN(i)?3:i,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof i)throw new Error("<coordinates> must be a number");!1!==a&&void 0!==a||(t=JSON.parse(JSON.stringify(t)));var u=Math.pow(10,n);return o.coordEach(t,function(t){r(t,u,i)}),t}function r(t,e,n){t.length>n&&t.splice(n,t.length);for(var i=0;i<t.length;i++)t[i]=Math.round(t[i]*e)/e;return t}var o=t("@turf/meta"),s=t("@turf/helpers");e.exports=i,e.exports.default=i},{"@turf/helpers":79,"@turf/meta":105}],152:[function(t,e,n){"use strict";function i(){for(var t=new r.GeoJSONReader,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=r.UnionOp.union(e,t.read(JSON.stringify(arguments[n].geometry)));return e=(new r.GeoJSONWriter).write(e),{type:"Feature",geometry:e,properties:arguments[0].properties}}var r=t("jsts-es");e.exports=i,e.exports.default=i},{"jsts-es":153}],153:[function(t,e,n){arguments[4][30][0].apply(n,arguments)},{dup:30}],154:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}function r(t,e,n,i){if(o(t,n)||o(t,i)||o(e,n)||o(i,n))return null;var r=t[0],s=t[1],a=e[0],u=e[1],l=n[0],c=n[1],h=i[0],f=i[1],g=(r-a)*(c-f)-(s-u)*(l-h);return 0===g?null:[((r*u-s*a)*(l-h)-(r-a)*(l*f-c*h))/g,((r*u-s*a)*(c-f)-(s-u)*(l*f-c*h))/g]}function o(t,e){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!o(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function s(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 a(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(s([t[(e-1).modulo(t.length-1)],t[e],t[(e+1).modulo(t.length-1)]],!0))i=1;else var i=-1;return i}function u(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!u(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function l(t){for(var e={},n=1,i=0,r=t.length;i<r;++i){if(e.hasOwnProperty(t[i])){n=0;break}e[t[i]]=1}return n}function c(t){var e=[];return h.flattenEach(t,function(t){"Polygon"===t.geometry.type&&h.featureEach(m(t),function(n){e.push(f.polygon(n.geometry.coordinates,t.properties))})}),f.featureCollection(e)}var h=t("@turf/meta"),f=t("@turf/helpers"),g=i(t("@turf/area")),d=i(t("@turf/boolean-point-in-polygon")),p=t("rbush"),_=function(t,e,n){function i(t,n,i,o){var l=s[t][n],c=s[t][n+1],h=s[i][o],f=s[i][o+1],g=r(l,c,h,f);if(null!==g){var d,p;if(d=c[0]!==l[0]?(g[0]-l[0])/(c[0]-l[0]):(g[1]-l[1])/(c[1]-l[1]),p=f[0]!==h[0]?(g[0]-h[0])/(f[0]-h[0]):(g[1]-h[1])/(f[1]-h[1]),!(d>=1||d<=0||p>=1||p<=0)){var _=g,v=!u[_];v&&(u[_]=!0),e?a.push(e(g,t,n,l,c,d,i,o,h,f,p,v)):a.push(g)}}}function o(t,e){var n,i,r,o,a=s[t][e],u=s[t][e+1];return a[0]<u[0]?(n=a[0],i=u[0]):(n=u[0],i=a[0]),a[1]<u[1]?(r=a[1],o=u[1]):(r=u[1],o=a[1]),{minX:n,minY:r,maxX:i,maxY:o,ring:t,edge:e}}if("Polygon"!==t.geometry.type)throw new Error("The input feature must be a Polygon");void 0===n&&(n=1);var s=t.geometry.coordinates,a=[],u={};if(n){for(var l=[],c=0;c<s.length;c++)for(var h=0;h<s[c].length-1;h++)l.push(o(c,h));var f=p();f.load(l)}for(var g=0;g<s.length;g++)for(var d=0;d<s[g].length-1;d++)if(n)f.search(o(g,d)).forEach(function(t){var e=t.ring,n=t.edge;i(g,d,e,n)});else for(var _=0;_<s.length;_++)for(var v=0;v<s[_].length-1;v++)i(g,d,_,v);return e||(a={type:"Feature",geometry:{type:"MultiPoint",coordinates:a}}),a},v=t("rbush"),m=function(t){function e(){for(var t=[],e=0;e<J.features.length;e++)-1==J.features[e].properties.parent&&t.push(e);if(t.length>1)for(e=0;e<t.length;e++){for(var n=-1,i=0;i<J.features.length;i++)t[e]!=i&&d(J.features[t[e]].geometry.coordinates[0][0],J.features[i],{ignoreBoundary:!0})&&g(J.features[i])<1/0&&(n=i);J.features[t[e]].properties.parent=n}}function n(){for(var t=0;t<J.features.length;t++)if(-1==J.features[t].properties.parent){var e=J.features[t].properties.winding;J.features[t].properties.netWinding=e,i(t,e)}}function i(t,e){for(var n=0;n<J.features.length;n++)if(J.features[n].properties.parent==t){var r=e+J.features[n].properties.winding;J.features[n].properties.netWinding=r,i(n,r)}}if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var r=t.geometry.coordinates.length,o=[],c=0;c<r;c++){var h=t.geometry.coordinates[c];u(h[0],h[h.length-1])||h.push(h[0]),o.push.apply(o,h.slice(0,h.length-1))}if(!l(o))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var p=o.length,m=_(t,function(t,e,n,i,r,o,s,a,u,l,c,h){return[t,e,n,i,r,o,s,a,u,l,c,h]}),E=m.length;if(0==E){for(var w=[],c=0;c<r;c++)w.push(f.polygon([t.geometry.coordinates[c]],{parent:-1,winding:a(t.geometry.coordinates[c])}));J=f.featureCollection(w);return e(),n(),J}for(var b=[],I=[],c=0;c<r;c++){b.push([]);for(O=0;O<t.geometry.coordinates[c].length-1;O++)b[c].push([new y(t.geometry.coordinates[c][(O+1).modulo(t.geometry.coordinates[c].length-1)],1,[c,O],[c,(O+1).modulo(t.geometry.coordinates[c].length-1)],void 0)]),I.push(new x(t.geometry.coordinates[c][O],[c,(O-1).modulo(t.geometry.coordinates[c].length-1)],[c,O],void 0,void 0,!1,!0))}for(c=0;c<E;c++)b[m[c][1]][m[c][2]].push(new y(m[c][0],m[c][5],[m[c][1],m[c][2]],[m[c][6],m[c][7]],void 0)),m[c][11]&&I.push(new x(m[c][0],[m[c][1],m[c][2]],[m[c][6],m[c][7]],void 0,void 0,!0,!0));for(var C=I.length,c=0;c<b.length;c++)for(O=0;O<b[c].length;O++)b[c][O].sort(function(t,e){return t.param<e.param?-1:1});for(var N=[],c=0;c<C;c++)N.push({minX:I[c].coord[0],minY:I[c].coord[1],maxX:I[c].coord[0],maxY:I[c].coord[1],index:c});var S=v();S.load(N);for(c=0;c<b.length;c++)for(O=0;O<b[c].length;O++)for(A=0;A<b[c][O].length;A++){M=A==b[c][O].length-1?b[c][(O+1).modulo(t.geometry.coordinates[c].length-1)][0].coord:b[c][O][A+1].coord;var L=S.search({minX:M[0],minY:M[1],maxX:M[0],maxY:M[1]})[0];b[c][O][A].nxtIsectAlongEdgeIn=L.index}for(c=0;c<b.length;c++)for(O=0;O<b[c].length;O++)for(A=0;A<b[c][O].length;A++){var M=b[c][O][A].coord,P=(L=S.search({minX:M[0],minY:M[1],maxX:M[0],maxY:M[1]})[0]).index;P<p?I[P].nxtIsectAlongRingAndEdge2=b[c][O][A].nxtIsectAlongEdgeIn:u(I[P].ringAndEdge1,b[c][O][A].ringAndEdgeIn)?I[P].nxtIsectAlongRingAndEdge1=b[c][O][A].nxtIsectAlongEdgeIn:I[P].nxtIsectAlongRingAndEdge2=b[c][O][A].nxtIsectAlongEdgeIn}for(var R=[],c=0,O=0;O<r;O++){for(var T=c,A=0;A<t.geometry.coordinates[O].length-1;A++)I[c].coord[0]<I[T].coord[0]&&(T=c),c++;for(var D=I[T].nxtIsectAlongRingAndEdge2,A=0;A<I.length;A++)if(I[A].nxtIsectAlongRingAndEdge1==T||I[A].nxtIsectAlongRingAndEdge2==T){var F=A;break}var G=s([I[F].coord,I[T].coord,I[D].coord],!0)?1:-1;R.push({isect:T,parent:-1,winding:G})}R.sort(function(t,e){return I[t.isect].coord>I[e.isect].coord?-1:1});for(w=[];R.length>0;){var q=R.pop(),k=q.isect,B=q.parent,j=q.winding,z=w.length,Y=[I[k].coord],X=k;if(I[k].ringAndEdge1Walkable)var V=I[k].ringAndEdge1,U=I[k].nxtIsectAlongRingAndEdge1;else var V=I[k].ringAndEdge2,U=I[k].nxtIsectAlongRingAndEdge2;for(;!u(I[k].coord,I[U].coord);){Y.push(I[U].coord);for(var H=void 0,c=0;c<R.length;c++)if(R[c].isect==U){H=c;break}if(void 0!=H&&R.splice(H,1),u(V,I[U].ringAndEdge1)){if(V=I[U].ringAndEdge2,I[U].ringAndEdge2Walkable=!1,I[U].ringAndEdge1Walkable){W={isect:U};s([I[X].coord,I[U].coord,I[I[U].nxtIsectAlongRingAndEdge2].coord],1==j)?(W.parent=B,W.winding=-j):(W.parent=z,W.winding=j),R.push(W)}X=U,U=I[U].nxtIsectAlongRingAndEdge2}else{if(V=I[U].ringAndEdge1,I[U].ringAndEdge1Walkable=!1,I[U].ringAndEdge2Walkable){var W={isect:U};s([I[X].coord,I[U].coord,I[I[U].nxtIsectAlongRingAndEdge1].coord],1==j)?(W.parent=B,W.winding=-j):(W.parent=z,W.winding=j),R.push(W)}X=U,U=I[U].nxtIsectAlongRingAndEdge1}}Y.push(I[U].coord),w.push(f.polygon([Y],{index:z,parent:B,winding:j,netWinding:void 0}))}var J=f.featureCollection(w);return e(),n(),J},y=function(t,e,n,i,r){this.coord=t,this.param=e,this.ringAndEdgeIn=n,this.ringAndEdgeOut=i,this.nxtIsectAlongEdgeIn=r},x=function(t,e,n,i,r,o,s){this.coord=t,this.ringAndEdge1=e,this.ringAndEdge2=n,this.nxtIsectAlongRingAndEdge1=i,this.nxtIsectAlongRingAndEdge2=r,this.ringAndEdge1Walkable=o,this.ringAndEdge2Walkable=s};Number.prototype.modulo=function(t){return(this%t+t)%t},e.exports=c,e.exports.default=c},{"@turf/area":2,"@turf/boolean-point-in-polygon":24,"@turf/helpers":79,"@turf/meta":105,rbush:156}],155:[function(t,e,n){arguments[4][49][0].apply(n,arguments)},{dup:49}],156:[function(t,e,n){arguments[4][50][0].apply(n,arguments)},{dup:50,quickselect:155}],157:[function(t,e,n){"use strict";function i(t){return(t=t.slice()).push(t[0]),o.polygon([t])}function r(t,e){if(e=e||{},!o.isObject(e))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return s.collectionOf(t,"Point","points"),o.featureCollection(a.voronoi().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(i))}var o=t("@turf/helpers"),s=t("@turf/invariant"),a=t("d3-voronoi");e.exports=r,e.exports.default=r},{"@turf/helpers":79,"@turf/invariant":84,"d3-voronoi":158}],158:[function(t,e,n){!function(t,i){i("object"==typeof n&&void 0!==e?n:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t){return t[0]}function n(t){return t[1]}function i(){this._=null}function r(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function o(t,e){var n=e,i=e.R,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function s(t,e){var n=e,i=e.L,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function a(t){for(;t.L;)t=t.L;return t}function u(t,e,n,i){var r=[null,null],o=q.push(r)-1;return r.left=t,r.right=e,n&&c(r,t,e,n),i&&c(r,e,t,i),F[t.index].halfedges.push(o),F[e.index].halfedges.push(o),r}function l(t,e,n){var i=[e,n];return i.left=t,i}function c(t,e,n,i){t[0]||t[1]?t.left===n?t[1]=i:t[0]=i:(t[0]=i,t.left=e,t.right=n)}function h(t,e,n,i,r){var o,s=t[0],a=t[1],u=s[0],l=s[1],c=0,h=1,f=a[0]-u,g=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=i-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}if(o=n-l,g||!(o>0)){if(o/=g,g<0){if(o<c)return;o<h&&(h=o)}else if(g>0){if(o>h)return;o>c&&(c=o)}if(o=r-l,g||!(o<0)){if(o/=g,g<0){if(o>h)return;o>c&&(c=o)}else if(g>0){if(o<c)return;o<h&&(h=o)}return!(c>0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*g]),h<1&&(t[1]=[u+h*f,l+h*g]),!0)}}}}}function f(t,e,n,i,r){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],g=c[0],d=c[1],p=(h+g)/2,_=(f+d)/2;if(d===f){if(p<e||p>=i)return;if(h>g){if(u){if(u[1]>=r)return}else u=[p,n];o=[p,r]}else{if(u){if(u[1]<n)return}else u=[p,r];o=[p,n]}}else if(s=(h-g)/(d-f),a=_-s*p,s<-1||s>1)if(h>g){if(u){if(u[1]>=r)return}else u=[(n-a)/s,n];o=[(r-a)/s,r]}else{if(u){if(u[1]<n)return}else u=[(r-a)/s,r];o=[(n-a)/s,n]}else if(f<d){if(u){if(u[0]>=i)return}else u=[e,s*e+a];o=[i,s*i+a]}else{if(u){if(u[0]<e)return}else u=[i,s*i+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function g(t,e,n,i){for(var r,o=q.length;o--;)f(r=q[o],t,e,n,i)&&h(r,t,e,n,i)&&(Math.abs(r[0][0]-r[1][0])>j||Math.abs(r[0][1]-r[1][1])>j)||delete q[o]}function d(t){return F[t.index]={site:t,halfedges:[]}}function p(t,e){var n=t.site,i=e.left,r=e.right;return n===r&&(r=i,i=n),r?Math.atan2(r[1]-i[1],r[0]-i[0]):(n===i?(i=e[1],r=e[0]):(i=e[0],r=e[1]),Math.atan2(i[0]-r[0],r[1]-i[1]))}function _(t,e){return e[+(e.left!==t.site)]}function v(t,e){return e[+(e.left===t.site)]}function m(){for(var t,e,n,i,r=0,o=F.length;r<o;++r)if((t=F[r])&&(i=(e=t.halfedges).length)){var s=new Array(i),a=new Array(i);for(n=0;n<i;++n)s[n]=n,a[n]=p(t,q[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<i;++n)a[n]=e[s[n]];for(n=0;n<i;++n)e[n]=a[n]}}function y(t,e,n,i){var r,o,s,a,u,c,h,f,g,d,p,m,y=F.length,x=!0;for(r=0;r<y;++r)if(o=F[r]){for(s=o.site,a=(u=o.halfedges).length;a--;)q[u[a]]||u.splice(a,1);for(a=0,c=u.length;a<c;)p=(d=v(o,q[u[a]]))[0],m=d[1],f=(h=_(o,q[u[++a%c]]))[0],g=h[1],(Math.abs(p-f)>j||Math.abs(m-g)>j)&&(u.splice(a,0,q.push(l(s,d,Math.abs(p-t)<j&&i-m>j?[t,Math.abs(f-t)<j?g:i]:Math.abs(m-i)<j&&n-p>j?[Math.abs(g-i)<j?f:n,i]:Math.abs(p-n)<j&&m-e>j?[n,Math.abs(f-n)<j?g:e]:Math.abs(m-e)<j&&p-t>j?[Math.abs(g-e)<j?f:t,e]:null))-1),++c);c&&(x=!1)}if(x){var E,w,b,I=1/0;for(r=0,x=null;r<y;++r)(o=F[r])&&(b=(E=(s=o.site)[0]-t)*E+(w=s[1]-e)*w)<I&&(I=b,x=o);if(x){var C=[t,e],N=[t,i],S=[n,i],L=[n,e];x.halfedges.push(q.push(l(s=x.site,C,N))-1,q.push(l(s,N,S))-1,q.push(l(s,S,L))-1,q.push(l(s,L,C))-1)}}for(r=0;r<y;++r)(o=F[r])&&(o.halfedges.length||delete F[r])}function x(){r(this),this.x=this.y=this.arc=this.site=this.cy=null}function E(t){var e=t.P,n=t.N;if(e&&n){var i=e.site,r=t.site,o=n.site;if(i!==o){var s=r[0],a=r[1],u=i[0]-s,l=i[1]-a,c=o[0]-s,h=o[1]-a,f=2*(u*h-l*c);if(!(f>=-z)){var g=u*u+l*l,d=c*c+h*h,p=(h*g-l*d)/f,_=(u*d-c*g)/f,v=k.pop()||new x;v.arc=t,v.site=r,v.x=p+s,v.y=(v.cy=_+a)+Math.sqrt(p*p+_*_),t.circle=v;for(var m=null,y=G._;y;)if(v.y<y.y||v.y===y.y&&v.x<=y.x){if(!y.L){m=y.P;break}y=y.L}else{if(!y.R){m=y;break}y=y.R}G.insert(m,v),m||(A=v)}}}}function w(t){var e=t.circle;e&&(e.P||(A=e.N),G.remove(e),k.push(e),r(e),t.circle=null)}function b(){r(this),this.edge=this.site=this.circle=null}function I(t){var e=B.pop()||new b;return e.site=t,e}function C(t){w(t),D.remove(t),B.push(t),r(t)}function N(t){var e=t.circle,n=e.x,i=e.cy,r=[n,i],o=t.P,s=t.N,a=[t];C(t);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<j&&Math.abs(i-l.circle.cy)<j;)o=l.P,a.unshift(l),C(l),l=o;a.unshift(l),w(l);for(var h=s;h.circle&&Math.abs(n-h.circle.x)<j&&Math.abs(i-h.circle.cy)<j;)s=h.N,a.push(h),C(h),h=s;a.push(h),w(h);var f,g=a.length;for(f=1;f<g;++f)h=a[f],l=a[f-1],c(h.edge,l.site,h.site,r);l=a[0],(h=a[g-1]).edge=u(l.site,h.site,null,r),E(l),E(h)}function S(t){for(var e,n,i,r,o=t[0],s=t[1],a=D._;a;)if((i=L(a,s)-o)>j)a=a.L;else{if(!((r=o-M(a,s))>j)){i>-j?(e=a.P,n=a):r>-j?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}d(t);var l=I(t);if(D.insert(e,l),e||n){if(e===n)return w(e),n=I(e.site),D.insert(l,n),l.edge=n.edge=u(e.site,l.site),E(e),void E(n);if(n){w(e),w(n);var h=e.site,f=h[0],g=h[1],p=t[0]-f,_=t[1]-g,v=n.site,m=v[0]-f,y=v[1]-g,x=2*(p*y-_*m),b=p*p+_*_,C=m*m+y*y,N=[(y*b-_*C)/x+f,(p*C-m*b)/x+g];c(n.edge,h,v,N),l.edge=u(h,t,null,N),n.edge=u(t,v,null,N),E(e),E(n)}else l.edge=u(e.site,l.site)}}function L(t,e){var n=t.site,i=n[0],r=n[1],o=r-e;if(!o)return i;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var c=a-i,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+r-o/2)))/h+i:(i+a)/2}function M(t,e){var n=t.N;if(n)return L(n,e);var i=t.site;return i[1]===e?i[0]:1/0}function P(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function R(t,e){return e[1]-t[1]||e[0]-t[0]}function O(t,e){var n,r,o,s=t.sort(R).pop();for(q=[],F=new Array(t.length),D=new i,G=new i;;)if(o=A,s&&(!o||s[1]<o.y||s[1]===o.y&&s[0]<o.x))s[0]===n&&s[1]===r||(S(s),n=s[0],r=s[1]),s=t.pop();else{if(!o)break;N(o.arc)}if(m(),e){var a=+e[0][0],u=+e[0][1],l=+e[1][0],c=+e[1][1];g(a,u,l,c),y(a,u,l,c)}this.edges=q,this.cells=F,D=G=q=F=null}var T=function(t){return function(){return t}};i.prototype={constructor:i,insert:function(t,e){var n,i,r;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=a(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(i=n.U).L?(r=i.R)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.R&&(o(this,n),n=(t=n).U),n.C=!1,i.C=!0,s(this,i)):(r=i.L)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.L&&(s(this,n),n=(t=n).U),n.C=!1,i.C=!0,o(this,i)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,i,r=t.U,u=t.L,l=t.R;if(n=u?l?a(l):u:l,r?r.L===t?r.L=n:r.R=n:this._=n,u&&l?(i=n.C,n.C=t.C,n.L=u,u.U=n,n!==l?(r=n.U,n.U=t.U,t=n.R,r.L=t,n.R=l,l.U=n):(n.U=r,r=n,t=n.R)):(i=t.C,t=n),t&&(t.U=r),!i)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===r.L){if((e=r.R).C&&(e.C=!1,r.C=!0,o(this,r),e=r.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,s(this,e),e=r.R),e.C=r.C,r.C=e.R.C=!1,o(this,r),t=this._;break}}else if((e=r.L).C&&(e.C=!1,r.C=!0,s(this,r),e=r.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,o(this,e),e=r.L),e.C=r.C,r.C=e.L.C=!1,s(this,r),t=this._;break}e.C=!0,t=r,r=r.U}while(!t.C);t&&(t.C=!1)}}};var A,D,F,G,q,k=[],B=[],j=1e-6,z=1e-12;O.prototype={constructor:O,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return _(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,i){if(o=(r=n.halfedges).length)for(var r,o,s,a=n.site,u=-1,l=e[r[o-1]],c=l.left===a?l.right:l.left;++u<o;)s=c,c=(l=e[r[u]]).left===a?l.right:l.left,s&&c&&i<s.index&&i<c.index&&P(a,s,c)<0&&t.push([a.data,s.data,c.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var i,r,o=this,s=o._found||0,a=o.cells.length;!(r=o.cells[s]);)if(++s>=a)return null;var u=t-r.site[0],l=e-r.site[1],c=u*u+l*l;do{r=o.cells[i=s],s=null,r.halfedges.forEach(function(n){var i=o.edges[n],a=i.left;if(a!==r.site&&a||(a=i.right)){var u=t-a[0],l=e-a[1],h=u*u+l*l;h<c&&(c=h,s=a.index)}})}while(null!==s);return o._found=i,null==n||c<=n*n?r.site:null}};t.voronoi=function(){function t(t){return new O(t.map(function(e,n){var o=[Math.round(i(e,n,t)/j)*j,Math.round(r(e,n,t)/j)*j];return o.index=n,o.data=e,o}),o)}var i=e,r=n,o=null;return t.polygons=function(e){return t(e).polygons()},t.links=function(e){return t(e).links()},t.triangles=function(e){return t(e).triangles()},t.x=function(e){return arguments.length?(i="function"==typeof e?e:T(+e),t):i},t.y=function(e){return arguments.length?(r="function"==typeof e?e:T(+e),t):r},t.extent=function(e){return arguments.length?(o=null==e?null:[[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]],t):o&&[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},t.size=function(e){return arguments.length?(o=null==e?null:[[0,0],[+e[0],+e[1]]],t):o&&[o[1][0]-o[0][0],o[1][1]-o[0][1]]},t},Object.defineProperty(t,"__esModule",{value:!0})})},{}],159:[function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(n,"__esModule",{value:!0});var r=i(t("@turf/isolines")),o=i(t("@turf/convex")),s=i(t("@turf/points-within-polygon")),a=i(t("@turf/concave")),u=i(t("@turf/collect")),l=i(t("@turf/flip")),c=i(t("@turf/simplify")),h=i(t("@turf/bezier-spline")),f=i(t("@turf/tag")),g=i(t("@turf/sample")),d=i(t("@turf/envelope")),p=i(t("@turf/square")),_=i(t("@turf/circle")),v=i(t("@turf/midpoint")),m=i(t("@turf/center")),y=i(t("@turf/center-of-mass")),x=i(t("@turf/centroid")),E=i(t("@turf/combine")),w=i(t("@turf/distance")),b=i(t("@turf/explode")),I=i(t("@turf/bbox")),C=i(t("@turf/tesselate")),N=i(t("@turf/bbox-polygon")),S=i(t("@turf/boolean-point-in-polygon")),L=i(t("@turf/intersect")),M=i(t("@turf/nearest-point")),P=i(t("@turf/nearest-point-on-line")),R=i(t("@turf/nearest-point-to-line")),O=i(t("@turf/planepoint")),T=i(t("@turf/tin")),A=i(t("@turf/bearing")),D=i(t("@turf/destination")),F=i(t("@turf/kinks")),G=i(t("@turf/point-on-feature")),q=i(t("@turf/area")),k=i(t("@turf/along")),B=i(t("@turf/length")),j=i(t("@turf/line-slice")),z=i(t("@turf/line-slice-along")),Y=i(t("@turf/point-grid")),X=i(t("@turf/square-grid")),V=i(t("@turf/triangle-grid")),U=i(t("@turf/hex-grid")),H=i(t("@turf/truncate")),W=i(t("@turf/flatten")),J=i(t("@turf/line-intersect")),Z=i(t("@turf/mask")),K=i(t("@turf/line-chunk")),Q=i(t("@turf/unkink-polygon")),$=i(t("@turf/great-circle")),tt=i(t("@turf/line-segment")),et=i(t("@turf/line-split")),nt=i(t("@turf/line-arc")),it=i(t("@turf/polygon-to-line")),rt=i(t("@turf/line-to-polygon")),ot=i(t("@turf/bbox-clip")),st=i(t("@turf/line-overlap")),at=i(t("@turf/sector")),ut=i(t("@turf/rhumb-bearing")),lt=i(t("@turf/rhumb-distance")),ct=i(t("@turf/rhumb-destination")),ht=i(t("@turf/polygon-tangents")),ft=i(t("@turf/rewind")),gt=i(t("@turf/isobands")),dt=i(t("@turf/transform-rotate")),pt=i(t("@turf/transform-scale")),_t=i(t("@turf/transform-translate")),vt=i(t("@turf/line-offset")),mt=i(t("@turf/polygonize")),yt=i(t("@turf/boolean-disjoint")),xt=i(t("@turf/boolean-contains")),Et=i(t("@turf/boolean-crosses")),wt=i(t("@turf/boolean-clockwise")),bt=i(t("@turf/boolean-overlap")),It=i(t("@turf/boolean-point-on-line")),Ct=i(t("@turf/boolean-equal")),Nt=i(t("@turf/boolean-within")),St=i(t("@turf/clone")),Lt=i(t("@turf/clean-coords")),Mt=i(t("@turf/interpolate")),Pt=i(t("@turf/clusters-dbscan")),Rt=i(t("@turf/clusters-kmeans")),Ot=i(t("@turf/point-to-line-distance")),Tt=i(t("@turf/boolean-parallel")),At=i(t("@turf/shortest-path")),Dt=i(t("@turf/voronoi")),Ft=t("@turf/projection"),Gt=t("@turf/random"),qt=t("@turf/clusters"),kt=t("@turf/helpers"),Bt=t("@turf/invariant"),jt=t("@turf/meta"),zt=i(t("@turf/difference")),Yt=i(t("@turf/dissolve")),Xt=i(t("@turf/buffer")),Vt=i(t("@turf/union"));n.projection=Ft,n.random=Gt,n.clusters=qt,n.helpers=kt,n.invariant=Bt,n.meta=jt,n.isolines=r,n.convex=o,n.pointsWithinPolygon=s,n.concave=a,n.collect=u,n.flip=l,n.simplify=c,n.bezierSpline=h,n.tag=f,n.sample=g,n.envelope=d,n.square=p,n.circle=_,n.midpoint=v,n.center=m,n.centerOfMass=y,n.centroid=x,n.combine=E,n.distance=w,n.explode=b,n.bbox=I,n.tesselate=C,n.bboxPolygon=N,n.booleanPointInPolygon=S,n.intersect=L,n.nearestPoint=M,n.nearestPointOnLine=P,n.nearestPointToLine=R,n.planepoint=O,n.tin=T,n.bearing=A,n.destination=D,n.kinks=F,n.pointOnFeature=G,n.area=q,n.along=k,n.length=B,n.lineSlice=j,n.lineSliceAlong=z,n.pointGrid=Y,n.squareGrid=X,n.triangleGrid=V,n.hexGrid=U,n.truncate=H,n.flatten=W,n.lineIntersect=J,n.mask=Z,n.lineChunk=K,n.unkinkPolygon=Q,n.greatCircle=$,n.lineSegment=tt,n.lineSplit=et,n.lineArc=nt,n.polygonToLine=it,n.lineToPolygon=rt,n.bboxClip=ot,n.lineOverlap=st,n.sector=at,n.rhumbBearing=ut,n.rhumbDistance=lt,n.rhumbDestination=ct,n.polygonTangents=ht,n.rewind=ft,n.isobands=gt,n.transformRotate=dt,n.transformScale=pt,n.transformTranslate=_t,n.lineOffset=vt,n.polygonize=mt,n.booleanDisjoint=yt,n.booleanContains=xt,n.booleanCrosses=Et,n.booleanClockwise=wt,n.booleanOverlap=bt,n.booleanPointOnLine=It,n.booleanEqual=Ct,n.booleanWithin=Nt,n.clone=St,n.cleanCoords=Lt,n.interpolate=Mt,n.clustersDbscan=Pt,n.clustersKmeans=Rt,n.pointToLineDistance=Ot,n.booleanParallel=Tt,n.shortestPath=At,n.voronoi=Dt,n.difference=zt,n.dissolve=Yt,n.buffer=Xt,n.union=Vt,n.pointOnSurface=G,n.polygonToLineString=it,n.lineStringToPolygon=rt,n.inside=S,n.within=s,n.bezier=h,n.nearest=M,n.pointOnLine=P,n.lineDistance=B,n.radians2degrees=kt.radiansToDegrees,n.degrees2radians=kt.degreesToRadians,n.distanceToDegrees=kt.lengthToDegrees,n.distanceToRadians=kt.lengthToRadians,n.radiansToDistance=kt.radiansToLength,n.bearingToAngle=kt.bearingToAzimuth,n.convertDistance=kt.convertLength,Object.keys(Ft).forEach(function(t){n[t]=Ft[t]}),Object.keys(Gt).forEach(function(t){n[t]=Gt[t]}),Object.keys(qt).forEach(function(t){n[t]=qt[t]}),Object.keys(kt).forEach(function(t){n[t]=kt[t]}),Object.keys(Bt).forEach(function(t){n[t]=Bt[t]}),Object.keys(jt).forEach(function(t){n[t]=jt[t]})},{"@turf/along":1,"@turf/area":2,"@turf/bbox":6,"@turf/bbox-clip":3,"@turf/bbox-polygon":5,"@turf/bearing":7,"@turf/bezier-spline":8,"@turf/boolean-clockwise":9,"@turf/boolean-contains":10,"@turf/boolean-crosses":11,"@turf/boolean-disjoint":12,"@turf/boolean-equal":13,"@turf/boolean-overlap":18,"@turf/boolean-parallel":23,"@turf/boolean-point-in-polygon":24,"@turf/boolean-point-on-line":25,"@turf/boolean-within":26,"@turf/buffer":27,"@turf/center":32,"@turf/center-of-mass":31,"@turf/centroid":33,"@turf/circle":34,"@turf/clean-coords":35,"@turf/clone":36,"@turf/clusters":47,"@turf/clusters-dbscan":37,"@turf/clusters-kmeans":43,"@turf/collect":48,"@turf/combine":51,"@turf/concave":52,"@turf/convex":55,"@turf/destination":68,"@turf/difference":69,"@turf/dissolve":71,"@turf/distance":73,"@turf/envelope":74,"@turf/explode":75,"@turf/flatten":76,"@turf/flip":77,"@turf/great-circle":78,"@turf/helpers":79,"@turf/hex-grid":80,"@turf/interpolate":81,"@turf/intersect":82,"@turf/invariant":84,"@turf/isobands":85,"@turf/isolines":86,"@turf/kinks":87,"@turf/length":88,"@turf/line-arc":89,"@turf/line-chunk":90,"@turf/line-intersect":91,"@turf/line-offset":93,"@turf/line-overlap":94,"@turf/line-segment":96,"@turf/line-slice":98,"@turf/line-slice-along":97,"@turf/line-split":99,"@turf/line-to-polygon":101,"@turf/mask":102,"@turf/meta":105,"@turf/midpoint":106,"@turf/nearest-point":109,"@turf/nearest-point-on-line":107,"@turf/nearest-point-to-line":108,"@turf/planepoint":110,"@turf/point-grid":111,"@turf/point-on-feature":112,"@turf/point-to-line-distance":113,"@turf/points-within-polygon":114,"@turf/polygon-tangents":115,"@turf/polygon-to-line":116,"@turf/polygonize":117,"@turf/projection":130,"@turf/random":131,"@turf/rewind":132,"@turf/rhumb-bearing":133,"@turf/rhumb-destination":134,"@turf/rhumb-distance":135,"@turf/sample":136,"@turf/sector":137,"@turf/shortest-path":138,"@turf/simplify":139,"@turf/square":142,"@turf/square-grid":141,"@turf/tag":143,"@turf/tesselate":144,"@turf/tin":146,"@turf/transform-rotate":147,"@turf/transform-scale":148,"@turf/transform-translate":149,"@turf/triangle-grid":150,"@turf/truncate":151,"@turf/union":152,"@turf/unkink-polygon":154,"@turf/voronoi":157}]},{},[159])(159)});
|