!function(t){var e={};function n®{if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:“Module”}),Object.defineProperty(t,“__esModule”,{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&“object”==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r®,Object.defineProperty(r,“default”,{enumerable:!0,value:t}),2&e&&“string”!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,“a”,e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=“”,n(n.s=0)}([function(t,e,n){(function(t){const e=n(2);t.turf=e,t.turfAPIs=()=>Object.keys(e).filter(t=>e[t].constructor===Function)}).call(this,n(1))},function(t,e){var n;n=function(){return this}();try{n=n||new Function(“return this”)()}catch(t){“object”==typeof window&&(n=window)}t.exports=n},function(t,e,n){!function(t){“use strict”;function e(t,e,n){if(!I(n=n||{}))throw new Error(“options is invalid”);var r=n.bbox,i=n.id;if(void 0===t)throw new Error(“geometry is required”);if(e&&e.constructor!==Object)throw new Error(“properties must be an Object”);r&&N®,i&&C(i);var o={type:“Feature”};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(!I(n=n||{}))throw new Error(“options is invalid”);var i,s=n.bbox;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”);switch(s&&N(s),t){case“Point”:i=r(e).geometry;break;case“LineString”:i=a(e).geometry;break;case“Polygon”:i=o(e).geometry;break;case“MultiPoint”:i=l(e).geometry;break;case“MultiLineString”:i=h(e).geometry;break;case“MultiPolygon”:i=p(e).geometry;break;default:throw new Error(t+“ is invalid”)}return s&&(i.bbox=s),i}function r(t,n,r){if(!t)throw new Error(“coordinates is required”);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(!b(t[0])||!b(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return r(t,e)})),n)}function o(t,n,r){if(!t)throw new Error("coordinates is required");for(var i=0;i=0))throw new Error(“precision must be a positive number”);var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(null==t)throw new Error(“radians is required”);if(e&&“string”!=typeof e)throw new Error(“units must be a string”);var n=bo[e||“kilometers”];if(!n)throw new Error(e+“ units is invalid”);return t*n}function y(t,e){if(null==t)throw new Error(“distance is required”);if(e&&“string”!=typeof e)throw new Error(“units must be a string”);var n=bo[e||“kilometers”];if(!n)throw new Error(e+“ units is invalid”);return t/n}function _(t,e){return v(y(t,e))}function m(t){if(null==t)throw new Error(“bearing is required”);var e=t%360;return e<0&&(e+=360),e}function v(t){if(null==t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null==t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null==t)throw new Error("length is required");if(!(t>=0))throw new Error(“length must be a positive number”);return d(y(t,e),n||“kilometers”)}function w(t,e,n){if(null==t)throw new Error(“area is required”);if(!(t>=0))throw new Error(“area must be a positive number”);var r=No[e||“meters”];if(!r)throw new Error(“invalid original units”);var i=No[n||“kilometers”];if(!i)throw new Error(“invalid final units”);return t/r*i}function b(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function N(t){if(!t)throw new Error(“bbox is required”);if(!Array.isArray(t))throw new Error(“bbox must be an Array”);if(4!==t.length&&6!==t.length)throw new Error(“bbox must be an Array of 4 or 6 numbers”);t.forEach((function(t){if(!b(t))throw new Error(“bbox must only contain numbers”)}))}function C(t){if(!t)throw new Error(“id is required”);if(-1===[“string”,“number”].indexOf(typeof t))throw new Error(“id must be a number or a string”)}function S(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,h,l=0,p=0,f=t.type,g=“FeatureCollection”===f,d=“Feature”===f,y=g?t.features.length:1,_=0;_t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1&&b(e[0])&&b(e[1]))return e;throw new Error(“Coordinate is not a valid Point”)}function U(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 Y(e),e;throw new Error(“No valid coordinates”)}function Y(t){if(t.length>1&&b(t[0])&&b(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Y(t[0]);throw new Error(“coordinates must only contain numbers”)}function V(t,e,n){if(!e||!n)throw new Error(“type and name required”);if(!t||t.type!==e)throw new Error(“Invalid input to ”n
“: must be a ”e
“, given ”+t.type)}function H(t,e,n){if(!t)throw new Error(“No feature passed”);if(!n)throw new Error(“.featureOf() requires a name”);if(!t||“Feature”!==t.type||!t.geometry)throw new Error(“Invalid input to ”n
“, Feature with geometry required”);if(!t.geometry||t.geometry.type!==e)throw new Error(“Invalid input to ”n
“: must be a ”e
“, given ”+t.geometry.type)}function W(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 r=0;rn“, Feature with geometry required”);if(!i.geometry||i.geometry.type!==e)throw new Error(“Invalid input to ”n
“: must be a ”e
“, given ”+i.geometry.type)}}function J(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”)}function Z(){throw new Error(“invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType”)}function K(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”)}function Q(t,e,n){n=n||{};for(var r=Object.keys(Lo),i=0;i=0&&d>=0&&d=0;h–)if(Math.abs(e[h][0][0]-u)<=1e-7&&Math.abs(e[h][0][1]-c)<=1e-7){for(var l=s.path.length-2;l>=0;–l)e[h].unshift(s.path[l]);a=!0;break}a||(e[n++]=s.path)}}))})),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o=e?8:0,a|=c>=e?4:0,a|=h>=e?2:0;var p,f,g,d,y=!1;if(5==(a|=l>=e?1:0)||10===a){var _=(u+c+h+l)/4;5===a&&_=t.minX&&e.maxY>=t.minY}function gt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function dt(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,Oo(t,o,e,n,i),s.push(e,o,o,n))}function yt(t,e){return t(e={exports:{}},e.exports),e.exports}function _t(t,e){if(!(this instanceof _t))return new _t(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return te?1:0},this.length>0)for(var n=(this.length>>1)-1;n>=0;n–)this._down(n)}function mt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;or[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;oo||a.push({node:h,dist:l})}for(;a.length&&!a.peek().node.children;){var p=a.pop(),f=p.node,g=Nt(f,e,n),d=Nt(f,r,i);if(p.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function Et(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u0!=Yo(t,e,r)>0&&Yo(n,r,t)>0!=Yo(n,r,e)>0}(a[u].p,a[u].next.p,t,e))return!1;return!0}function wt(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 bt(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 It(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Nt(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Ct(t,e,n,r,i,o,s,a){var u,c,h,l,p=n-t,f=r-e,g=s-i,d=a-o,y=t-i,_=e-o,m=p*p+f*f,v=p*g+f*d,x=g*g+d*d,E=p*y+f*_,w=g*y+d*_,b=m*x-v*v,I=b,N=b;0===b?(c=0,I=1,l=w,N=x):(l=m*w-v*E,(c=v*w-x*E)<0?(c=0,l=w,N=x):c>I&&(c=I,l=w+v,N=x)),l<0?(l=0,-E<0?c=0:-E>m?c=I:(c=-E,I=m)):l>N&&(l=N,-E+v<0?c=0:-E+v>m?c=I:(c=-E+v,I=m));var C=(1-(h=0===l?0:l/N))*i+h*s-((1-(u=0===c?0:c/I))*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return C*C+S*S}function St(t,e){if(!I(e=e||{}))throw new Error(“options is invalid”);var n=e.concavity||1/0,r=[];if(S(t,(function(t){r.push([t[0],t[1]])})),!r.length)return null;var i=Vo(r,n);return i.length>3?o([i]):null}function Mt(t,e,n){if(“object”!=typeof(n=n||{}))throw new Error(“options is invalid”);var r=n.ignoreBoundary;if(!t)throw new Error(“point is required”);if(!e)throw new Error(“polygon is required”);var i=X(t),o=U(e),s=e.geometry?e.geometry.type:e.type,a=e.bbox;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,a))return!1;“Polygon”===s&&(o=[o]);for(var u=0,c=!1;ut[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function Pt(t,e){var n=[];return A(e,(function(e){O(t,(function(t){Mt(t,e)&&n.push(t)}))})),c(n)}function Ot(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return c(function(t){if(t.length<3)return[];t.sort(Tt);for(var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;a--;)t[a].yl&&(l=t[a].y);var p,f=c-u,g=l-h,d=f>g?f:g,y=.5*(c+u),_=.5*(l+h),m=[new Rt({x:y-20*d,y:_-d,__sentinel:!0},{x:y,y:_+20*d,__sentinel:!0},{x:y+20*d,y:_-d,__sentinel:!0})],v=[],x=[];for(a=t.length;a–;){for(x.length=0,p=m.length;p–;)(f=t[a].x-m[p].x)>0&&f*f>m[p].r?(v.push(m[p]),m.splice(p,1)):f*f+(g=t[a].y-m[p].y)*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1));for(At(x),p=x.length;p;)n=x[–p],e=x[–p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new Rt(e,n,r))}for(Array.prototype.push.apply(v,m),a=v.length;a–;)(v[a].a.__sentinel||v[a].b.__sentinel||v[a].c.__sentinel)&&v.splice(a,1);return v}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],s={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,r,i,e]],s)})))}function Rt(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),h=a*(t.x+n.x)+u*(t.y+n.y),l=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*h)/l,this.y=(o*h-a*c)/l,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}function Tt(t,e){return e.x-t.x}function At(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[–s],e=t[–s],r=s;r;)if(o=t[–r],i=t[–r],e===i&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function Dt(t,e,n){if(!I(n=n||{}))throw new Error(“options is invalid”);var r=n.units,i=X(t),o=X(e),s=x(o[1]-i[1]),a=x(o[0]-i[0]),u=x(i[1]),c=x(o[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos©;return d(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r)}function Ft(t){if(!t)throw new Error(“geojson is required”);switch(t.type){case“Feature”:return qt(t);case“FeatureCollection”:return function(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 qt(t)})),e}(t);case“Point”:case“LineString”:case“Polygon”:case“MultiPoint”:case“MultiLineString”:case“MultiPolygon”:case“GeometryCollection”:return Gt(t);default:throw new Error(“unknown GeoJSON type”)}}function qt(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=function t(e){var n={};return e?(Object.keys(e).forEach((function®{var i=e[r];“object”==typeof i?null===i?n[r]=null:i.length?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=Gt(t.geometry),e}function Gt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),“GeometryCollection”===t.type?(e.geometries=t.geometries.map((function(t){return Gt(t)})),e):(e.coordinates=function t(e){return“object”!=typeof e[0]?e.slice():e.map((function(e){return t(e)}))}(t.coordinates),e)}function Bt(t,e){function n(t,e){e.length&&e.pop();for(var n=u[t<0?~t:t],r=0,i=n.length;r1)for(var s,a,u=1,c=r(o[0]);uc&&(a=o[0],o[0]=o[u],o[u]=a,c=s);return o}))}}function zt(t,e,n){for(var r,i=e+(n—e>>1);e=Math.abs(h)?c>0?o<=r&&r<=a:a<=r&&r<=o:h>0?s<=i&&i<=u:u<=i&&i<=s)}(n,i=e[a+1],r)||o.push(r);return o.push(i),o}function Kt(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function Qt(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return(o=t.x-r)*o+(s=t.y-i)*s}function $t(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return function(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,i,o){for(var s,a=i,u=n+1;ua&&(s=u,a=c)}a>i&&(s-n>1&&t(e,n,s,i,o),o.push(e[s]),r-s>1&&t(e,s,r,i,o))}(t,0,n,e,r),r.push(t[n]),r}(t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;oe&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),r)}function te(t,e,n){return $t(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 ee(t,e,n){return t.map((function(t){var r=t.map((function(t){return{x:t[0],y:t[1]}}));if(r.length<4)throw new Error("invalid polygon");for(var i=$t(r,e,n).map((function(t){return[t.x,t.y]}));!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=$t(r,e-=.01*e,n).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function ne(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.resolution||1e4,r=e.sharpness||.85;if(!t)throw new Error("line is required");if(!b(n))throw new Error("resolution must be an number");if(!b(r))throw new Error("sharpness must be an number");for(var i=[],o=new as({points:J(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),duration:n,sharpness:r}),s=0;s=Dt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function se(t,e,n,i){if(!I(i=i||{}))throw new Error(“options is invalid”);var o=i.units,s=i.properties,a=X(t),u=x(a[0]),c=x(a[1]),h=x(n),l=y(e,o),p=Math.asin(Math.sin©*Math.cos(l)+Math.cos©*Math.sin(l)*Math.cos(h));return r([v(u+Math.atan2(Math.sin(h)*Math.sin(l)*Math.cos©,Math.cos(l)-Math.sin©*Math.sin(p))),v(p)],s)}function ae(t,e,n){var r=(n=n||{}).steps||64,i=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 r)throw new Error(“steps must be a number”);r=r||64,i=i||t.properties||{};for(var s=[],a=0;a=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=h&&i!==r.x&&_e(on.x)&&Ee(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=we(e,t);ge(n,n.next)}}(a[i],n),n=ge(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=s=t[1];for(var g=n;go&&(o=a),u>s&&(s=u);c=0!==(c=Math.max(o-r,s-i))?1/c:0}return function t(e,n,r,i,o,s,a){if(e){!a&&s&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=ye(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(e,i,o,s);for(var u,c,h=e;e.prev!==e.next;)if(u=e.prev,c=e.next,s?function(t,e,n,r){var i=t.prev,o=t,s=t.next;if(me(i,o,s)>=0)return!1;for(var a=i.xo.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=ye(a,u,e,n,r),p=ye(c,h,e,n,r),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&_e(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&me(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&_e(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&me(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(e,i,o,s):function(t){var e=t.prev,n=t,r=t.next;if(me(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(_e(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&me(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(e))n.push(u.i/r),n.push(e.i/r),n.push(c.i/r),Ie(e),e=c.next,h=c.next;else if((e=c)===h){a?1===a?t(e=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!ve(i,o)&&xe(i,r,r.next,o)&&Ee(i,o)&&Ee(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Ie®,Ie(r.next),r=t=o),r=r.next}while(r!==t);return r}(e,n,r),n,r,i,o,s,2):2===a&&function(e,n,r,i,o,s){var a=e;do{for(var u=a.next.next;u!==a.prev;){if(a.i!==u.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&xe(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Ee(t,e)&&Ee(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}(a,u)){var c=we(a,u);return a=ge(a,a.next),c=ge(c,c.next),t(a,n,r,i,o,s),void t(c,n,r,i,o,s)}u=u.next}a=a.next}while(a!==e)}(e,n,r,i,o,s):t(ge(e),n,r,i,o,s,1);break}}}(p,f,n,r,i,c),f}function fe(t,e,n,r,i){var o,s;if(i===Ce(t,e,n,r)>0)for(o=e;o=e;o-=r)s=be(o,t[o],t[o+1],s);return s&&ve(s,s.next)&&(Ie(s),s=s.next),s}function ge(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!ve(r,r.next)&&0!==me(r.prev,r,r.next))r=r.next;else{if(Ie®,(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function de(t,e){return t.x-e.x}function ye(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function _e(t,e,n,r,i,o,s,a){return(i-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function me(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ve(t,e){return t.x===e.x&&t.y===e.y}function xe(t,e,n,r){return!!(ve(t,e)&&ve(n,r)||ve(t,r)&&ve(n,e))||me(t,e,n)>0!=me(t,e,r)>0&&me(n,r,t)>0!=me(n,r,e)>0}function Ee(t,e){return me(t.prev,t,t.next)<0?me(t,e,t.next)>=0&&me(t,t.prev,e)>=0:me(t,e,t.prev)<0||me(t,t.next,e)<0}function we(t,e){var n=new Ne(t.i,t.x,t.y),r=new Ne(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function be(t,e,n,r){var i=new Ne(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ie(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 Ne(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 Ce(t,e,n,r){for(var i=0,o=e,s=n-r;o0&&(r+=t[i-1].length,n.holes.push®)}return n}(t),n=us(e.vertices,e.holes,2),r=[],i=[];n.forEach((function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var s=0;sr;){if(i-r>600){var s=i-r+1,a=n-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-a*c/s+h)),Math.min(i,Math.floor(n+(s-a)*c/s+h)),o)}var l=e[n],p=r,f=i;for(Pe(e,r,n),o(e[i],l)>0&&Pe(e,r,i);p0;)f–}0===o(e[r],l)?Pe(e,r,f):Pe(e,++f,i),f<=n&&(r=f+1),n<=f&&(i=f-1)}}(t,e,n||0,r||t.length-1,i||function(t,e){return te?1:0})}function Pe(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Oe(t,e){if(!(this instanceof Oe))return new Oe(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 Re(t,e){Te(t,0,t.children.length,e,t)}function Te(t,e,n,r,i){i||(i=ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s=t.minX&&e.maxY>=t.minY}function ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function je(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(Le(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Xe(t){var e=Oe(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=Ue(e)).bbox=e}else t.bbox=t.bbox?t.bbox:Ye(t);return Oe.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var n=Ue(t);n.bbox=t,e.push(n)})):O(t,(function(t){t.bbox=t.bbox?t.bbox:Ye(t),e.push(t)})),Oe.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=Ue(e)).bbox=e}return Oe.prototype.remove.call(this,t)},e.clear=function(){return Oe.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:Oe.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return Oe.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:Oe.prototype.all.call(this)}},e.toJSON=function(){return Oe.prototype.toJSON.call(this)},e.fromJSON=function(t){return Oe.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:Ye(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function Ue(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function Ye(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]i?n:i,r>o?r:o]}(t,r),n.push(i),r})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}(t,e)})),c(e)}function He(t,n){var r={},i=[];if(“LineString”===t.type&&(t=e(t)),“LineString”===n.type&&(n=e(n)),“Feature”===t.type&&“Feature”===n.type&&“LineString”===t.geometry.type&&“LineString”===n.geometry.type&&2===t.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=We(t,n);return o&&i.push(o),c(i)}var s=Xe();return s.load(Ve(n)),O(Ve(t),(function(t){O(s.search(t),(function(e){var n=We(t,e);if(n){var o=U(n).join(“,”);r[o]||(r[o]=!0,i.push(n))}}))})),c(i)}function We(t,e){var n=U(t),i=U(e);if(2!==n.length)throw new Error(“ line1 must only contain 2 coordinates”);if(2!==i.length)throw new Error(“ line2 must only contain 2 coordinates”);var o=n[0][0],s=n[0][1],a=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],l=i[1][0],p=i[1][1],f=(p-h)*(a-o)-(l-c)*(u-s);if(0===f)return null;var g=((l-c)*(s-h)-(p-h)*(o-c))/f,d=((a-o)*(s-h)-(u-s)*(o-c))/f;return g>=0&&g<=1&&d>=0&&d<=1?r([o+g*(a-o),s+g*(u-s)]):null}function Je(t,e,n){if(!I(n=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 o=r([1/0,1/0],{dist:1/0}),s=0;return F(t,(function(t){for(var i=U(t),u=0;u0&&((_=y.features[0]).properties.dist=Dt(e,_,n),_.properties.location=s+Dt(c,_,n)),c.properties.dist180?-(360-r):r}function Ke(t,e){var n=x(t[1]),r=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function Qe(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=X(t),o=X(e);return o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0,E(function(t,e,n){var r=n=void 0===n?wo:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+c*c*a*a)*r}(i,o),“meters”,r)}function $e(t,e){return en(t,“mercator”,e)}function tn(t,e){return en(t,“wgs84”,e)}function en(t,e,n){if(!I(n=n||{}))throw new Error(“options is invalid”);var r=n.mutate;if(!t)throw new Error(“geojson is required”);return Array.isArray(t)&&b(t[0])?t=“mercator”===e?nn(t):rn(t):(!0!==r&&(t=Ft(t)),S(t,(function(t){var n=“mercator”===e?nn(t):rn(t);t[0]=n[0],t[1]=n[1]}))),t}function nn(t){var e=Math.PI/180,n=20037508.342789244,r=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>n&&(r[0]=n),r[0]<-n&&(r[0]=-n),r[1]>n&&(r[1]=n),r[1]<-n&&(r[1]=-n),r}function rn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function on(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=r(t):"Point"===t.type?t=e(t):H(t,"Point","point"),!n)throw new Error("line is required");Array.isArray(n)?n=a(n):"LineString"===n.type?n=e(n):H(n,"LineString","line");var o=1/0,s=t.geometry.coordinates;return G(n,(function(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],a=function(t,e,n,i){var o=i.mercator,s=!0!==o?Dt(e,t,i):sn(e,t,i),a=m(!0!==o?ue(e,t):Ze(e,t)),u=m(!0!==o?ue(e,n):Ze(e,n)),c=Math.abs(a-u);if(c>90)return s;var h=(u+180)%360,l=m(!0!==o?ue(n,t):Ze(n,t)),p=Math.abs(l-h);return p>180&&(p=Math.abs(p-360)),p>90?!0!==o?Dt(t,n,i):sn(t,n,i):!0!==o?s*Math.sin(x©):function(t,e,n,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(o=t[0]>0||e[0]>0||n[0]>0?-180:180);var s=r(n),a=tn(function(t,e,n){var r=t[0],i=t[1],o=e[0]-r,s=e[1]-i,a=((n[0]-r)*o+(n[1]-i)*s)/(o*o+s*s);return[r+a*o,i+a*s]}($e([t[0]+o,t[1]]),$e([e[0]+o,e[1]]),$e([n[0]+o,n[1]])));return 0!==o&&(a[0]-=o),Qe(s,a,i)}(e,n,t,i)}(s,e,n,i);o>a&&(o=a)})),o}function sn(t,e,n){var r=n.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=$e([t[0]+i,t[1]]),s=$e([e[0]+i,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]);return E(Math.sqrt(u),“meters”,r)}function an(t){for(var n=function(t){return“FeatureCollection”!==t.type?“Feature”!==t.type?c([e(t)]):c([t]):t}(t),i=ce(n),o=!1,s=0;!o&&s0){e+=Math.abs(ln(t[0]));for(var n=1;n2){for(s=0;s=h&&l===i.length-1);l++){if(h>e&&0===o.length){if(!(s=e-h))return o.push(i[l]),a(o);u=ue(i[l],i[l-1])-180,c=se(i[l],s,u,r),o.push(c.geometry.coordinates)}if(h>=n)return(s=n-h)?(u=ue(i[l],i[l-1])-180,c=se(i[l],s,u,r),o.push(c.geometry.coordinates),a(o)):(o.push(i[l]),a(o));if(h>=e&&o.push(i[l]),l===i.length-1)return a(o);h+=Dt(i[l],i[l+1],r)}return a(i[i.length-1])}function dn(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!I(n))throw new Error(“invalid options”);if(!t)throw new Error(“pt is required”);if(!e)throw new Error(“line is required”);for(var i=X(t),o=U(e),s=0;s=Math.abs(l)?h>0?s0?a=Math.abs(l)?h>0?s<=i&&i0?a<=o&&o=Math.abs(l)?h>0?s0?a=Math.abs(l)?h>0?s<=i&&i<=u:u<=i&&i<=s:l>0?a<=o&&o<=c:c<=o&&o<=a)}(o[s],o[s+1],i,a))return!0}return!1}function yn(t,e){var n=K(t),r=K(e),i=J(t),o=J(e);switch(n){case"Point":switch(r){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;nr“ geometry not supported”)}case“MultiPoint”:switch®{case“MultiPoint”:return function(t,e){for(var n=0;nr“ geometry not supported”)}case“LineString”:switch®{case“LineString”:return function(t,e){for(var n=0;nr“ geometry not supported”)}case“Polygon”:switch®{case“Polygon”:return function(t,e){var n=j(t);if(!_n(j(e),n))return!1;for(var r=0;rr“ geometry not supported”)}default:throw new Error(“feature1 ”n
“ geometry not supported”)}}function _n(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3] is required“);if(”number“!=typeof n)throw new Error(” must be a number“);if(”number“!=typeof r)throw new Error(” must be a number“);!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return S(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r=0==e}function bn(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n1&&n.push(a(l)),c(n)}function Cn(t,e){if(!e.features.length)throw new Error(”lines must contain features“);if(1===e.features.length)return e.features[0];var n,r=1/0;return O(e,(function(e){var i=Je(e,t).properties.dist;ip&&g.push(se(t,e,p,s).geometry.coordinates),a(g,h)}function Ln(t){var e=t%360;return e<0&&(e+=360),e}function Pn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=K(t),i=U(t);if(n=n||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(r){case"Polygon":return On(i,n);case"MultiPolygon":var o=[];return i.forEach((function(t){o.push(On(t,n))})),c(o);default:throw new Error("geom "r
” not supported“)}}function On(t,e){return t.length>1?h(t,e):a(t[0],e)}function Rn(t,e){if(!I(e=e||{}))throw new Error(”options is invalid“);var n=e.properties,r=e.autoComplete,i=e.orderCoords;if(!t)throw new Error(”lines is required“);switch(r=void 0===r||r,i=void 0===i||i,K(t)){case”FeatureCollection“:case”GeometryCollection“:var o=[];return(t.features?t.features:t.geometries).forEach((function(t){o.push(U(Tn(t,{},r,i)))})),p(o,n)}return Tn(t,n,r,i)}function Tn(t,e,n,r){e=e||t.properties||{};var i=U(t),s=K(t);if(!i.length)throw new Error(”line must contain coordinates“);switch(s){case”LineString“:return n&&(i=An(i)),o([i],e);case”MultiLineString“:var u=[],c=0;return i.forEach((function(t){if(n&&(t=An(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(j(a(t)));e>c?(u.unshift(t),c=e):u.push(t)}else u.push(t)})),o(u,e);default:throw new Error(”geometry type “s
” is not supported“)}}function An(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function Dn(t,e,n){var r,i,o,s,a,u=t.length,c=qn(t[0],e),h=[];for(n||(n=[]),r=1;re[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Gn(t,e){for(var n=[],r=0;r0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&n.push(i))}return n}function Bn(t){return”[object Arguments]“===Object.prototype.toString.call(t)}function kn(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):function(t,e,n){var r,i;if(zn(t)||zn(e))return!1;if(t.prototype!==e.prototype)return!1;if(Bn(t))return!!Bn(e)&&kn(t=ws.call(t),e=ws.call(e),n);if(jn(t)){if(!jn(e))return!1;if(t.length!==e.length)return!1;for(r=0;r=0;r–)if(o[r]!==s[r])return!1;for(r=o.length-1;r>=0;r–)if(!kn(t[i=o[r]],e[i],n))return!1;return typeof t==typeof e}(t,e,n))}function zn(t){return null==t}function jn(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 Xn(t,e,n){if(!I(n=n||{}))throw new Error(”options is invalid“);var r,i=n.tolerance||0,o=[],s=Xe();return s.load(Ve(t)),G(e,(function(t){var e=!1;O(s.search(t),(function(n){if(!1===e){var o=U(t).sort(),s=U(n).sort();kn(o,s)||(0===i?dn(o[0],n)&&dn(o[1],n):Je(n,o[0]).properties.dist<=i&&Je(n,o[1]).properties.dist<=i)?(e=!0,r=r?Un(r,t):t):(0===i?dn(s[0],t)&&dn(s[1],t):Je(t,s[0]).properties.dist<=i&&Je(t,s[1]).properties.dist<=i)&&(r=r?Un(r,n):n)}})),!1===e&&r&&(o.push(r),r=void 0)})),r&&o.push(r),c(o)}function Un(t,e){var n=U(e),r=U(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return kn(n[0],i)?s.unshift(n[1]):kn(n[0],o)?s.push(n[1]):kn(n[1],i)?s.unshift(n[0]):kn(n[1],o)&&s.push(n[0]),t}function Yn(t){var e=t%360;return e<0&&(e+=360),e}function Vn(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties;if(!t)throw new Error("origin is required");if(null==e)throw new Error("distance is required");if(null==n)throw new Error("bearing is required");if(!(e>=0))throw new Error(”distance must be greater than 0“);var a=E(e,o,”meters“),u=X(t),c=function(t,e,n,r){var i=e/(r=void 0===r?wo:Number®),o=t[0]*Math.PI/180,s=x(t[1]),a=x(n),u=i*Math.cos(a),c=s+u;Math.abs©>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(s/2+Math.PI/4)),l=Math.abs(h)>1e-11?u/h:Math.cos(s);return[(180*(o+i*Math.sin(a)/l)/Math.PI+540)%360-180,180*c/Math.PI]}(u,a,n);return c[0]+=c[0]-u[0]>180?-360:u[0]-c[0]>180?360:0,r(c,s)}function Hn(t,e,n,r,i,o){for(var s=0;s0?function(t,e,n){return Wn(t,e,n)<0}(e,a,i)||(i=a):n>0&&r<=0&&(function(t,e,n){return Wn(t,e,n)>0}(e,a,o)||(o=a)),n=r}return[i,o]}function Wn(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function Jn(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,r,i=U(t),o=0,s=1;s0}function Zn(t,e){switch(”Feature“===t.type?t.geometry.type:t.type){case”GeometryCollection“:return A(t,(function(t){Zn(t,e)})),t;case”LineString“:return Kn(U(t),e),t;case”Polygon“:return Qn(U(t),e),t;case”MultiLineString“:return U(t).forEach((function(t){Kn(t,e)})),t;case”MultiPolygon“:return U(t).forEach((function(t){Qn(t,e)})),t;case”Point“:case”MultiPoint“:return t}}function Kn(t,e){Jn(t)===e&&t.reverse()}function Qn(t,e){Jn(t[0])!==e&&t[0].reverse();for(var n=1;ne”:“+(e+n)+”]“);var u,c=function(t,e,n){for(var r=t.length-1,i=t[0].length-1,o={rows:r,cols:i,cells:[]},s=e+Math.abs(n),a=0;as?128:64,c|=ls?32:16,c|=ps?8:4;var g=+(c|=fs?2:1),d=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+l+p+f)/4;d=y>s?2:y0?(c=156,d=4):c=152:33===c?d>0?(c=139,d=4):c=137:72===c?d>0?(c=99,d=4):c=98:132===c&&(d>0?(c=39,d=4):c=38)}if(0!=c&&170!=c){var _,m,v,x,E,w,b,I;_=m=v=x=E=w=b=I=.5;var N=[];1===c?(v=1-tr(e,p,f),I=1-tr(e,h,f),N.push(ha[c])):169===c?(v=tr(s,f,p),I=tr(s,f,h),N.push(ha[c])):4===c?(w=1-tr(e,l,p),x=tr(e,f,p),N.push(ua[c])):166===c?(w=tr(s,p,l),x=1-tr(s,p,f),N.push(ua[c])):16===c?(E=tr(e,p,l),m=tr(e,h,l),N.push(aa[c])):154===c?(E=1-tr(s,l,p),m=1-tr(s,l,h),N.push(aa[c])):64===c?(b=tr(e,f,h),_=1-tr(e,l,h),N.push(pa[c])):106===c?(b=1-tr(s,h,f),_=tr(s,h,l),N.push(pa[c])):168===c?(x=tr(s,f,p),v=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),N.push(ca[c]),N.push(ha[c])):2===c?(x=1-tr(e,p,f),v=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),N.push(ca[c]),N.push(ha[c])):162===c?(E=tr(s,p,l),w=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),N.push(ca[c]),N.push(ha[c])):8===c?(E=1-tr(e,l,p),w=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),N.push(aa[c]),N.push(ua[c])):138===c?(E=1-tr(e,l,p),w=1-tr(s,l,p),_=1-tr(s,l,h),m=1-tr(e,l,h),N.push(aa[c]),N.push(ua[c])):32===c?(E=tr(s,p,l),w=tr(e,p,l),_=tr(e,h,l),m=tr(s,h,l),N.push(aa[c]),N.push(ua[c])):42===c?(I=1-tr(s,h,f),b=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l),N.push(la[c]),N.push(pa[c])):128===c&&(I=tr(e,f,h),b=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h),N.push(la[c]),N.push(pa[c])),5===c?(w=1-tr(e,l,p),I=1-tr(e,h,f),N.push(ua[c])):165===c?(w=tr(s,p,l),I=tr(s,f,h),N.push(ua[c])):20===c?(x=tr(e,f,p),m=tr(e,h,l),N.push(ca[c])):150===c?(x=1-tr(s,p,f),m=1-tr(s,l,h),N.push(ca[c])):80===c?(E=tr(e,p,l),b=tr(e,f,h),N.push(aa[c])):90===c?(E=1-tr(s,l,p),b=1-tr(s,h,f),N.push(aa[c])):65===c?(v=1-tr(e,p,f),_=1-tr(e,l,h),N.push(ha[c])):105===c?(v=tr(s,f,p),_=tr(s,h,l),N.push(ha[c])):160===c?(E=tr(s,p,l),w=tr(e,p,l),I=tr(e,f,h),b=tr(s,f,h),N.push(aa[c]),N.push(ua[c])):10===c?(E=1-tr(e,l,p),w=1-tr(s,l,p),I=1-tr(s,h,f),b=1-tr(e,h,f),N.push(aa[c]),N.push(ua[c])):130===c?(x=1-tr(e,p,f),v=1-tr(s,p,f),_=1-tr(s,l,h),m=1-tr(e,l,h),N.push(ca[c]),N.push(ha[c])):40===c?(x=tr(s,f,p),v=tr(e,f,p),_=tr(e,h,l),m=tr(s,h,l),N.push(ca[c]),N.push(ha[c])):101===c?(w=tr(s,p,l),_=tr(s,h,l),N.push(ua[c])):69===c?(w=1-tr(e,l,p),_=1-tr(e,l,h),N.push(ua[c])):149===c?(I=tr(s,f,h),m=1-tr(s,l,h),N.push(la[c])):21===c?(I=1-tr(e,h,f),m=tr(e,h,l),N.push(la[c])):86===c?(x=1-tr(s,p,f),b=1-tr(s,h,f),N.push(ca[c])):84===c?(x=tr(e,f,p),b=tr(e,f,h),N.push(ca[c])):89===c?(E=1-tr(s,l,p),v=tr(s,f,p),N.push(ha[c])):81===c?(E=tr(e,p,l),v=1-tr(e,p,f),N.push(ha[c])):96===c?(E=tr(s,p,l),w=tr(e,p,l),b=tr(e,f,h),_=tr(s,h,l),N.push(aa[c]),N.push(ua[c])):74===c?(E=1-tr(e,l,p),w=1-tr(s,l,p),b=1-tr(s,h,f),_=1-tr(e,l,h),N.push(aa[c]),N.push(ua[c])):24===c?(E=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),m=tr(e,h,l),N.push(aa[c]),N.push(ha[c])):146===c?(E=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),m=1-tr(s,l,h),N.push(aa[c]),N.push(ha[c])):6===c?(w=1-tr(e,l,p),x=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),N.push(ua[c]),N.push(ca[c])):164===c?(w=tr(s,p,l),x=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),N.push(ua[c]),N.push(ca[c])):129===c?(v=1-tr(e,p,f),I=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h),N.push(ha[c]),N.push(la[c])):41===c?(v=tr(s,f,p),I=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l),N.push(ha[c]),N.push(la[c])):66===c?(x=1-tr(e,p,f),v=1-tr(s,p,f),b=1-tr(s,h,f),_=1-tr(e,l,h),N.push(ca[c]),N.push(ha[c])):104===c?(x=tr(s,f,p),v=tr(e,f,p),b=tr(e,f,h),_=tr(s,h,l),N.push(ha[c]),N.push(fa[c])):144===c?(E=tr(e,p,l),I=tr(e,f,h),b=tr(s,f,h),m=1-tr(s,l,h),N.push(aa[c]),N.push(pa[c])):26===c?(E=1-tr(s,l,p),I=1-tr(s,h,f),b=1-tr(e,h,f),m=tr(e,h,l),N.push(aa[c]),N.push(pa[c])):36===c?(w=tr(s,p,l),x=tr(e,f,p),_=tr(e,h,l),m=tr(s,h,l),N.push(ua[c]),N.push(ca[c])):134===c?(w=1-tr(e,l,p),x=1-tr(s,p,f),_=1-tr(s,l,h),m=1-tr(e,l,h),N.push(ua[c]),N.push(ca[c])):9===c?(E=1-tr(e,l,p),w=1-tr(s,l,p),v=tr(s,f,p),I=1-tr(e,h,f),N.push(aa[c]),N.push(ua[c])):161===c?(E=tr(s,p,l),w=tr(e,p,l),v=1-tr(e,p,f),I=tr(s,f,h),N.push(aa[c]),N.push(ua[c])):37===c?(w=tr(s,p,l),I=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l),N.push(ua[c]),N.push(la[c])):133===c?(w=1-tr(e,l,p),I=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h),N.push(ua[c]),N.push(la[c])):148===c?(x=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),m=1-tr(s,l,h),N.push(ca[c]),N.push(pa[c])):22===c?(x=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),m=tr(e,h,l),N.push(ca[c]),N.push(pa[c])):82===c?(E=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),b=1-tr(s,h,f),N.push(aa[c]),N.push(ha[c])):88===c?(E=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),b=tr(e,f,h),N.push(aa[c]),N.push(ha[c])):73===c?(E=1-tr(e,l,p),w=1-tr(s,l,p),v=tr(s,f,p),_=1-tr(e,l,h),N.push(aa[c]),N.push(ua[c])):97===c?(E=tr(s,p,l),w=tr(e,p,l),v=1-tr(e,p,f),_=tr(s,h,l),N.push(aa[c]),N.push(ua[c])):145===c?(E=tr(e,p,l),v=1-tr(e,p,f),I=tr(s,f,h),m=1-tr(s,l,h),N.push(aa[c]),N.push(la[c])):25===c?(E=1-tr(s,l,p),v=tr(s,f,p),I=1-tr(e,h,f),m=tr(e,h,l),N.push(aa[c]),N.push(la[c])):70===c?(w=1-tr(e,l,p),x=1-tr(s,p,f),b=1-tr(s,h,f),_=1-tr(e,l,h),N.push(ua[c]),N.push(ca[c])):100===c?(w=tr(s,p,l),x=tr(e,f,p),b=tr(e,f,h),_=tr(s,h,l),N.push(ua[c]),N.push(ca[c])):34===c?(0===d?(E=1-tr(e,l,p),w=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)):(E=tr(s,p,l),w=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)),N.push(aa[c]),N.push(ua[c]),N.push(la[c]),N.push(pa[c])):35===c?(4===d?(E=1-tr(e,l,p),w=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)):(E=tr(s,p,l),w=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)),N.push(aa[c]),N.push(ua[c]),N.push(ha[c]),N.push(pa[c])):136===c?(0===d?(E=tr(s,p,l),w=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)):(E=1-tr(e,l,p),w=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)),N.push(aa[c]),N.push(ua[c]),N.push(la[c]),N.push(pa[c])):153===c?(0===d?(E=tr(e,p,l),v=1-tr(e,p,f),I=1-tr(e,h,f),m=tr(e,h,l)):(E=1-tr(s,l,p),v=tr(s,f,p),I=tr(s,f,h),m=1-tr(s,l,h)),N.push(aa[c]),N.push(ha[c])):102===c?(0===d?(w=1-tr(e,l,p),x=tr(e,f,p),b=tr(e,f,h),_=1-tr(e,l,h)):(w=tr(s,p,l),x=1-tr(s,p,f),b=1-tr(s,h,f),_=tr(s,h,l)),N.push(ua[c]),N.push(pa[c])):155===c?(4===d?(E=tr(e,p,l),v=1-tr(e,p,f),I=1-tr(e,h,f),m=tr(e,h,l)):(E=1-tr(s,l,p),v=tr(s,f,p),I=tr(s,f,h),m=1-tr(s,l,h)),N.push(aa[c]),N.push(la[c])):103===c?(4===d?(w=1-tr(e,l,p),x=tr(e,f,p),b=tr(e,f,h),_=1-tr(e,l,h)):(w=tr(s,p,l),x=1-tr(s,p,f),b=1-tr(s,h,f),_=tr(s,h,l)),N.push(ua[c]),N.push(ca[c])):152===c?(0===d?(E=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),m=tr(e,h,l)):(E=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),m=1-tr(s,l,h)),N.push(aa[c]),N.push(ca[c]),N.push(ha[c])):156===c?(4===d?(E=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),m=tr(e,h,l)):(E=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),m=1-tr(s,l,h)),N.push(aa[c]),N.push(ha[c]),N.push(pa[c])):137===c?(0===d?(E=tr(s,p,l),w=tr(e,p,l),v=1-tr(e,p,f),I=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)):(E=1-tr(e,l,p),w=1-tr(s,l,p),v=tr(s,f,p),I=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)),N.push(aa[c]),N.push(ua[c]),N.push(ha[c])):139===c?(4===d?(E=tr(s,p,l),w=tr(e,p,l),v=1-tr(e,p,f),I=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)):(E=1-tr(e,l,p),w=1-tr(s,l,p),v=tr(s,f,p),I=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)),N.push(aa[c]),N.push(ua[c]),N.push(la[c])):98===c?(0===d?(E=1-tr(e,l,p),w=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),b=tr(e,f,h),_=1-tr(e,l,h)):(E=tr(s,p,l),w=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),b=1-tr(s,h,f),_=tr(s,h,l)),N.push(aa[c]),N.push(ua[c]),N.push(pa[c])):99===c?(4===d?(E=1-tr(e,l,p),w=1-tr(s,l,p),x=tr(s,f,p),v=tr(e,f,p),b=tr(e,f,h),_=1-tr(e,l,h)):(E=tr(s,p,l),w=tr(e,p,l),x=1-tr(e,p,f),v=1-tr(s,p,f),b=1-tr(s,h,f),_=tr(s,h,l)),N.push(aa[c]),N.push(ua[c]),N.push(ha[c])):38===c?(0===d?(w=1-tr(e,l,p),x=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)):(w=tr(s,p,l),x=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)),N.push(ua[c]),N.push(la[c]),N.push(pa[c])):39===c?(4===d?(w=1-tr(e,l,p),x=tr(e,f,p),I=tr(e,f,h),b=tr(s,f,h),_=1-tr(s,l,h),m=1-tr(e,l,h)):(w=tr(s,p,l),x=1-tr(s,p,f),I=1-tr(s,h,f),b=1-tr(e,h,f),_=tr(e,h,l),m=tr(s,h,l)),N.push(ua[c]),N.push(ca[c]),N.push(pa[c])):85===c&&(E=1,w=0,x=1,v=0,I=0,b=1,_=0,m=1),(_<0||_>1||m<0||m>1||E<0||E>1||x<0||x>1||I<0||I>1||b<0||b>1)&&console.log(”MarchingSquaresJS-isoBands: “c
” “g
” “h
”,“l
”,“p
”,“f
” “d
” “_
” “m
” “E
” “w
” “x
” “v
” “I
” “+b),o.cells[a][u]={cval:c,cval_real:g,flipped:d,topleft:_,topright:m,righttop:E,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:b,edges:N}}}}}return o}(t,e,n);return Is.polygons?(Is.verbose&&console.log(”MarchingSquaresJS-isoBands: returning single polygons for each grid cell“),u=function(t){var e=[],n=0;return t.cells.forEach((function(t,r){t.forEach((function(t,i){if(void 0!==t){var o=da[t.cval](t);”object“==typeof o&&er(o)?”object“==typeof o[0]&&er(o[0])?”object“==typeof o[0][0]&&er(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=o):console.log(”MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates“):console.log(”MarchingSquaresJS-isoBands: bandcell polygon with null coordinates“)}}))})),e}©):(Is.verbose&&console.log(”MarchingSquaresJS-isoBands: returning polygon paths for entire data grid“),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o0){var a=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&Cs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&Ss?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&Ss?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&Ms?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&Cs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&Ss?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&Ss?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&Ms?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&Ss?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&Ms?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&Ms?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&Ns?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&Ss?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&Ms?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&Ms?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&Ns?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&Ss?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&Ns?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&Ms?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&Ns?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&Ns?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&Cs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&Ns?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&Cs?{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}(t.cells[o][s]),u=null,c=s,h=o;null!==a&&i.push([a.p[0]+c,a.p[1]+h]);do{if(null===(u=function(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:switch®{case 0:i=ua[c],s=Gs[c],a=Bs[c],u=ks[c];break;default:i=aa[c],s=Ds[c],a=Fs[c],u=qs[c]}break;case 1:switch®{case 0:i=la[c],s=Zs[c],a=Ks[c],u=Qs[c];break;default:i=pa[c],s=Hs[c],a=Ws[c],u=Js[c]}break;default:switch(n){case-1:switch®{case 0:i=fa[c],s=Ls[c],a=Ps[c],u=Os[c];break;default:i=ga[c],s=Rs[c],a=Ts[c],u=As[c]}break;case 1:switch®{case 0:i=ha[c],s=zs[c],a=js[c],u=Xs[c];break;default:i=ca[c],s=Us[c],a=Ys[c],u=Vs[c]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;nn” “s
” “a
” “+u)),{p:[e,n],x:s,y:a,o:u}}(t.cells[h][c],a.x,a.y,a.o)))break;if(i.push([u.p[0]+c,u.p[1]+h]),c+=u.x,a=u,(h+=u.y)<0||h>=n||c<0||c>=r||void 0===t.cells[h][c]){var l=function(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,h=[],l=!1;!l;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,a=(s=t.cells[c][u]).cval_real,-1===i)if(0===o)if(a&Ms)h.push([u,c]),r=-1,i=0,o=0;else{if(!(a&Ss)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+1,c]),r=1,i=0,o=0}else{if(!(a&Ms)){if(a&Ss){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+s.bottomleft,c]),r=0,i=1,o=0,l=!0;break}h.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&Cs)){if(a&Ns){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+s.topright,c+1]),r=0,i=-1,o=1,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}else h.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&Ns)){if(a&Ms){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+s.lefttop]),r=1,i=0,o=1,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}else{if(!(a&Ns)){console.log(”MarchingSquaresJS-isoBands: wtf“);break}h.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log(”MarchingSquaresJS-isoBands: we came from nowhere!“);break}if(0===o){if(!(a&Ss)){h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}else{if(!(a&Ss)){if(a&Cs){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else if(a=(s=t.cells[c][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(a&Ms)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u,c])}else{if(!(a&Ns)){console.log(”MarchingSquaresJS-isoBands: found entry from top at “u
”,“+c);break}console.log(”MarchingSquaresJS-isoBands: proceeding in x-direction!“)}else if(1===r){if(0===o){console.log(”MarchingSquaresJS-isoBands: wtf“);break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(a&Cs)){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log(”MarchingSquaresJS-isoBands: wtf“);break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(a&Ss)){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log(”MarchingSquaresJS-isoBands: where did we came from???“);break}if(0!==o){console.log(”MarchingSquaresJS-isoBands: wtf“);break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(a&Ns)){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}}if(c+=i,(u+=r)===e&&c===n)break}return{path:h,i:u,j:c,x:r,y:i,o:o}}(t,c-=u.x,h-=u.y,u.x,u.y,u.o);if(null===l)break;l.path.forEach((function(t){i.push(t)})),c=l.i,h=l.j,a=l}}while(void 0!==t.cells[h][c]&&t.cells[h][c].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s–}return e}©),”function“==typeof Is.successCallback&&Is.successCallback(u),u}function tr(t,e,n){return(t-e)/(n-e)}function er(t){return t.constructor.toString().indexOf(”Array“)>-1}function nr(t,e,n){if(!I(n=n||{}))throw new Error(”options is invalid“);var r=n.pivot,i=n.mutate;if(!t)throw new Error(”geojson is required“);if(null==e||isNaN(e))throw new Error(”angle is required“);return 0===e||(r||(r=he(t)),!1!==i&&void 0!==i||(t=Ft(t)),S(t,(function(t){var n=Ze(r,t)+e,i=Qe(r,t),o=U(Vn(r,i,n));t[0]=o[0],t[1]=o[1]}))),t}function rr(t,e,n){if(!I(n=n||{}))throw new Error(”options is invalid“);var r=n.origin,i=n.mutate;if(!t)throw new Error(”geojson required“);if(”number“!=typeof e||0===e)throw new Error(”invalid factor“);var o=Array.isArray®||”object“==typeof r;return!0!==i&&(t=Ft(t)),”FeatureCollection“!==t.type||o?ir(t,e,r):(O(t,(function(n,i){t.features[i]=ir(n,e,r)})),t)}function ir(t,e,n){var i=”Point“===K(t);return n=function(t,e){if(null!=e||(e=”centroid“),Array.isArray(e)||”object“==typeof e)return X(e);var n=t.bbox?t.bbox:j(t),i=n[0],o=n[1],s=n[2],a=n[3];switch(e){case”sw“:case”southwest“:case”westsouth“:case”bottomleft“:return r([i,o]);case”se“:case”southeast“:case”eastsouth“:case”bottomright“:return r([s,o]);case”nw“:case”northwest“:case”westnorth“:case”topleft“:return r([i,a]);case”ne“:case”northeast“:case”eastnorth“:case”topright“:return r([s,a]);case”center“:return ce(t);case void 0:case null:case”centroid“:return he(t);default:throw new Error(”invalid origin“)}}(t,n),1===e||i||S(t,(function(t){var r=Qe(n,t),i=Ze(n,t),o=U(Vn(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)})),t}function or(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function sr(t,e){return t[0]*e[1]-e[0]*t[1]}function ar(t,e,n){var r=[],i=_(e,n),o=U(t),s=[];return o.forEach((function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r;return[[i,t[1]+n*(t[0]-e[0])/r],[o,e[1]+n*(t[0]-e[0])/r]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=function(t,e){return!function(t,e){return 0===sr(or(t),or(e))}(t,e)&&function(t,e){var n=t[0],r=or(t),i=e[0],o=or(e),s=sr(r,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(n,function(t,e){return[t*e[0],t*e[1]]}(sr(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,n),o)/s,r))}(t,e)}(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]))}})),a(s,t.properties)}function ur(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(r*s-o*i)}function cr(t,e){return e.geometry.coordinates[0].every((function(e){return Mt(r(e),t)}))}function hr(t,e){for(var n=0;n=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function lr(t,e){return He(e,Pn(t)).features.length>0}function pr(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]0}function yr(t,e){for(var n=!1,i=!1,o=t.coordinates[0].length,s=0;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]0?t[1]0}function wr(t,e,n){n=n||[];for(var r=0;r0)){if(o/=p,p<0){if(o0){if(o>l)return;o>h&&(h=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>l)return;o>h&&(h=o)}else if(p>0){if(o0)){if(o/=f,f<0){if(o0){if(o>l)return;o>h&&(h=o)}if(o=i-c,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>h&&(h=o)}else if(f>0){if(o0||l<1)||(h>0&&(t[0]=[u+h*p,c+h*f]),l<1&&(t[1]=[u+l*p,c+l*f]),!0)}}}}}function Br(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,h=t.right,l=c[0],p=c[1],f=h[0],g=h[1],d=(l+f)/2,y=(p+g)/2;if(g===p){if(d=r)return;if(l>f){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]1)if(l>f){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]=-Va)){var f=u*u+c*c,g=h*h+l*l,d=(l*f-c*g)/p,y=(u*g-h*f)/p,_=Xa.pop()||new function(){Or(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=d+s,_.y=(_.cy=y+a)+Math.sqrt(d*d+y*y),t.circle=_;for(var m=null,v=za._;v;)if(_.yYa)a=a.L;else{if(!((i=o-function(t,e){var n=t.N;if(n)return Jr(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(a,s))>Ya)){r>-Ya?(e=a.P,n=a):i>-Ya?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){ka[t.index]={site:t,halfedges:[]}}(t);var u=Yr(t);if(Ba.insert(e,u),e||n){if(e===n)return Ur(e),n=Yr(e.site),Ba.insert(u,n),u.edge=n.edge=Dr(e.site,u.site),Xr(e),void Xr(n);if(n){Ur(e),Ur(n);var c=e.site,h=c[0],l=c[1],p=t[0]-h,f=t[1]-l,g=n.site,d=g[0]-h,y=g[1]-l,_=2*(p*y-f*d),m=p*p+f*f,v=d*d+y*y,x=[(y*m-f*v)/_+h,(p*v-d*m)/_+l];qr(n.edge,c,g,x),u.edge=Dr(c,t,null,x),n.edge=Dr(t,g,null,x),Xr(e),Xr(n)}else u.edge=Dr(e.site,u.site)}}function Jr(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var h=a-r,l=1/o-1/c,p=h/c;return l?(-p+Math.sqrt(p*p-2*l*(h*h/(-2*c)-u+c/2+i-o/2)))/l+r:(r+a)/2}function Zr(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Kr(t,e){return e[1]-t[1]||e[0]-t[0]}function Qr(t,e){var n,r,i,o=t.sort(Kr).pop();for(ja=[],ka=new Array(t.length),Ba=new Pr,za=new Pr;;)if(i=Ga,o&&(!i||o[1]Ya||Math.abs(i[0][1]-i[1][1])>Ya)||delete ja[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y=ka.length,_=!0;for(i=0;iYa||Math.abs(d-p)>Ya)&&(u.splice(a,0,ja.push(Fr(s,f,Math.abs(g-t)Ya?[t,Math.abs(l-t)Ya?[Math.abs(p-r)Ya?[n,Math.abs(l-n)Ya?[Math.abs(p-e)=-270&&(d=-d),g<-180&&g>=-360&&(y=-y),”degrees“===s){var _=d*Math.cos(l)+y*Math.sin(l),m=y*Math.cos(l)-d*Math.sin(l);d=_,y=m}p.push([d+h[0],y+h[1]])}return p.push(p[0]),”degrees“===s?o([p],c):nr(o([p],c),a,{pivot:u})}function ei(t){var e=t*Math.PI/180;return Math.tan(e)}function ni(t,e){if(!I(e=e||{}))throw new Error(”options is invalid“);var n=e.properties,i=e.weight;if(!t)throw new Error(”geojson is required“);var o=0,s=0,a=0;return A(t,(function(t,e,n){var r=n[i];if(!b(r=null==r?1:r))throw new Error(”weight value must be a number for feature index “+e);(r=Number®)>0&&S(t,(function(t){o+=t[0]*r,s+=t[1]*r,a+=r}))})),r([o/a,s/a],n)}function ri(t,e,n,i){var o=n.properties.tolerance||.001,s=0,a=0,u=0,c=0;if(O(n,(function(e){var n=e.properties.weight,r=null==n?1:n;if(!b(r=Number®))throw new Error(”weight value must be a number“);if(r>0){c+=1;var i=r*Dt(e,t);0===i&&(i=1);var o=r/i;s+=e.geometry.coordinates[0]*o,a+=e.geometry.coordinates[1]*o,u+=o}})),c<1)throw new Error("no features to measure");var h=s/u,l=a/u;return 1===c||0===i||Math.abs(h-e[0])0?t+n[e-1]:t})),h.forEach((function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])})),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(oi(n))),s.push(o([u]))}return c(s)}function ui(t,e){if(!I(e=e||{}))throw new Error(”options is invalid“);var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;null!=t||(t=1),(!b®||r<2)&&(r=10),b(i)||(i=1e-4),b(o)||(o=Math.PI/8);for(var s=[],u=0;u1?t:null;case”MultiPolygon“:var e=[];if(F(t,(function(t){cn(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:”MultiPolygon“,coordinates:e}}}function Ti(){this.reset()}function Ai(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Di(t){return t>1?vf:t<-1?-vf:Math.asin(t)}function Fi(){}function qi(t,e){t&&Af.hasOwnProperty(t.type)&&Af[t.type](t,e)}function Gi(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++imf?t-Ef:t<-mf?t+Ef:t,e]}function Wi(t,e,n){return(t%=Ef)?e||n?Ff(Zi(t),Ki(e,n)):Zi(t):e||n?Ki(e,n):Hi}function Ji(t){return function(e,n){return[(e+=t)>mf?e-Ef:e<-mf?e+Ef:e,n]}}function Zi(t){var e=Ji(t);return e.invert=Ji(-t),e}function Ki(t,e){function n(t,e){var n=Sf(e),a=Sf(t)*n,u=Pf(t)*n,c=Pf(e),h=c*r+a*i;return[Cf(u*o-h*s,a*r-c*i),Di(h*o+u*s)]}var r=Sf(t),i=Pf(t),o=Sf(e),s=Pf(e);return n.invert=function(t,e){var n=Sf(e),a=Sf(t)*n,u=Pf(t)*n,c=Pf(e),h=c*o-u*s;return[Cf(u*o+c*s,a*r+h*i),Di(h*r-a*i)]},n}function Qi(t,e){(e=zi(e))[0]-=t,Vi(e);var n=function(t){return t>1?0:t<-1?mf:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+Ef-_f)%Ef}function $i(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function to(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r0)do{c.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==l);else c.point(o[0],o[1])}function s(r,i){return If(r[0]-t)<_f?i>0?0:3:If(r[0]-n)<_f?i>0?2:1:If(r[1]-e)<_f?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function u(t,e){i(t,e)&&E.point(t,e)}function c(o,s){var a=i(o,s);if(l&&p.push([o,s]),v)f=o,g=s,d=a,v=!1,a&&(E.lineStart(),E.point(o,s));else if(a&&m)E.point(o,s);else{var u=[y=Math.max(Uf,Math.min(Xf,y)),_=Math.max(Uf,Math.min(Xf,_))],c=[o=Math.max(Uf,Math.min(Xf,o)),s=Math.max(Uf,Math.min(Xf,s))];Gf(u,c,t,e,n,r)?(m||(E.lineStart(),E.point(u[0],u[1])),E.point(c[0],c[1]),a||E.lineEnd(),x=!1):a&&(E.lineStart(),E.point(o,s),x=!1)}y=o,_=s,m=a}var h,l,p,f,g,d,y,_,m,v,x,E=s,w=qf(),b={point:u,lineStart:function(){b.point=c,l&&l.push(p=[]),v=!0,m=!1,y=_=NaN},lineEnd:function(){h&&(c(f,g),d&&m&&w.rejoin(),h.push(w.result())),b.point=u,m&&E.lineEnd()},polygonStart:function(){E=w,h=[],l=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=x&&e,i=(h=jf(h)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&kf(h,a,e,o,s),s.polygonEnd()),E=s,h=l=p=null}};return b}}function no(t){return t.length>1}function ro(t,e){return((t=t.x)[0]<0?t[1]-vf-_f:vf-t[1])-((e=e.x)[0]<0?e[1]-vf-_f:vf-e[1])}function io(t){return function(e){var n=new oo;for(var r in t)n[r]=t[r];return n.stream=e,n}}function oo(){}function so(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),Df(n,t.stream(Kf));var s=Kf.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=e[0][0]
(r-a*(s[1][0]+s[0][0]))/2,c=e[0][1]
(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,c])}function ao(t,e){return[t,Lf(Rf((vf+e)/2))]}function uo(t,e){return[Lf(Rf((vf+e)/2)),-t]}function co(t,n,r,i){var o=t.properties||{},s=”Feature“===t.type?t.geometry:t;if(”GeometryCollection“===s.type){var a=[];return A(t,(function(t){var e=co(t,n,r,i);e&&a.push(e)})),c(a)}var u,h=j(t),l=h[1]>50&&h[3]>50;u=l?{type:s.type,coordinates:ho(s.coordinates,po(s))}:$e(s);var p,f=(new nh).read(u),g=d(y(n,r),”meters“),_=Hl.bufferOp(f,g);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((_=(new rh).write(_)).coordinates))return(p=l?{type:_.type,coordinates:lo(_.coordinates,po(s))}:tn(_)).geometry?p:e(p,o)}function ho(t,e){return”object“!=typeof t[0]?e(t):t.map((function(t){return ho(t,e)}))}function lo(t,e){return”object“!=typeof t[0]?e.invert(t):t.map((function(t){return lo(t,e)}))}function po(t){var e=ce(t).geometry.coordinates.reverse(),n=e.map((function(t){return-t}));return ig().center(e).rotate(n).scale(wo)}function fo(){for(var t=new nh,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n=0&&(void 0===i||om/2;P&&(L-=m/4);for(var O=[],R=[],T=0;T<6;T++){var A=2*Math.PI/6*T;O.push(Math.cos(A)),R.push(Math.sin(A))}for(var D=[],F=0;F<=C;F++)for(var q=0;q<=M;q++){var G=F%2==1;if(!(0===q&&G||0===q&&P)){var B=F*E+a-S,k=q*w+u+L;if(G&&(k-=m/2),!0===i)(function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=[];c.push(t),c.push([t[0]+e*i[u],t[1]+n*s[u]]),c.push([t[0]+e*i[(u+1)%6],t[1]+n*s[(u+1)%6]]),c.push(t),a.push(o([c],r))}return a})([B,k],g/2,d/2,r,O,R).forEach((function(t){s?go(s,t)&&D.push(t):D.push(t)}));else{var z=function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=t[0]+e*i[u],h=t[1]+n*s[u];a.push([c,h])}return a.push(a[0].slice()),o([a],r)}([B,k],g/2,d/2,r,O,R);s?go(s,z)&&D.push(z):D.push(z)}}}return c(D)}function mo(t){if(t.features.length<=1)return t;var e=function(t){var e=Ro(),n=[];return F(t,(function(t,e){var r=j(t);n.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:t,index:e})})),e.load(n),e}(t),n=[],r={};return F(t,(function(t,i){if(r[i])return!0;for(e.remove({index:i},vo),r[i]=!0;;){var o=j(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 r[t.index]=!0,e.remove({index:t.index},vo),t.geojson}));a.push(t),t=fo.apply(this,a)}if(0===s.length)break}n.push(t)})),c(n)}function vo(t,e){return t.index===e.index}function xo(t,e,n){if(!I(n=n||{}))throw new Error(”options is invalid“);var r=n.properties,i=n.mask,s=[];if(null==e)throw new Error(”cellSide is required“);if(!b(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(K(i)))throw new Error(”options.mask must be a (Multi)Polygon“);for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/Dt([a,u],[h,u],n)*(h-a),f=e/Dt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=Math.floor(d/f),m=(d-_*f)/2,v=a+(g-y*p)/2,x=0;xe?1:0};i>r;){if(i-r>600){var s=i-r+1,a=n-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-a*c/s+h)),Math.min(i,Math.floor(n+(s-a)*c/s+h)),o)}var l=e[n],p=r,f=i;for(rt(e,r,n),o(e[i],l)>0&&rt(e,r,i);p0;)f–}0===o(e[r],l)?rt(e,r,f):rt(e,++f,i),f<=n&&(r=f+1),n<=f&&(i=f-1)}},Ro=it;it.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!ft(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e–;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=gt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ot(n,this.toBBox),ot(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=gt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ot(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=st(t,0,r,this.toBBox),o=st(t,r,n,this.toBBox)),a=ht(i)+ht(o),s=e;i–)o=t.children[i],at(u,t.leaf?s(o):o),c+=lt(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r–)at(e[r],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():ot(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]
”};“)}};var To=function(t,e,n){var r=t*e,i=Ao*t,o=i-(i-t),s=t-o,a=Ao*e,u=a-(a-e),c=e-u,h=s*c-(r-o*u-s*u-o*c);return n?(n[0]=h,n[1]=r,n):[h,r]},Ao=+(Math.pow(2,27)+1),Do=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,h=Math.abs,l=t[u],p=h(l),f=e[c],g=h(f);p=r?(i=l,(u+=1)=r?(i=l,(u+=1)>1;return[”sum(“,r(t.slice(0,e)),”,“,r(t.slice(e)),”)“].join(”“)}function i(t){if(2===t.length)return[[”sum(prod(“,t[0][0],”,“,t[1][1],”),prod(-“,t[0][1],”,“,t[1][0],”))“].join(”“)];for(var o=[],s=0;st”Exact“,p=[”function “,l,”(“,a.join(),”){var p=“,c,”,n=“,h,”,d=sub(p,n);return d[d.length-1];};return “,l].join(”“);return new Function(”sum“,”prod“,”scale“,”sub“,p)(Do,To,qo,Go)}var s=o(3),a=o(4),u=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var r,i=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),a=i-o;if(i>0){if(o<=0)return a;r=i+o}else{if(!(i<0))return a;if(o>=0)return a;r=-(i+o)}var u=33306690738754716e-32*r;return a>=u||a<=-u?a:s(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],u=t[1]-r[1],c=e[1]-r[1],h=n[1]-r[1],l=t[2]-r[2],p=e[2]-r[2],f=n[2]-r[2],g=o*h,d=s*c,y=s*u,_=i*h,m=i*c,v=o*u,x=l*(g-d)+p*(y-_)+f*(m-v),E=7771561172376103e-31*((Math.abs(g)+Math.abs(d))*Math.abs(l)+(Math.abs(y)+Math.abs(_))*Math.abs(p)+(Math.abs(m)+Math.abs(v))*Math.abs(f));return x>E||-x>E?x:a(t,e,n,r)}];!function(){for(;u.length<=5;)u.push(o(u.length));for(var e=[],n=["slow"],r=0;r<=5;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=5;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i1&&zo(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&zo(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var h=0,l=(r=0,o.length);r0;–p)n[h++]=s[p];return n},zo=Bo[3],jo=_t,Xo=_t;_t.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,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}},jo.default=Xo;var Uo=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;or!=h>r&&n<(c-a)*(r-u)/(h-u)+a&&(i=!i)}return i},Yo=Bo[3],Vo=mt,Ho=mt;Vo.default=Ho;var Wo=function(t){return t},Jo=function(t){if(null==t)return Wo;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,h=new Array(c);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u=t)throw new Error(”full hashmap“);h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},maybeSet:function(r,o){for(var c=e®&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)throw new Error(”full hashmap“);h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},get:function(r,o){for(var c=e®&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)break;h=s[c=c+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e>7^rs[2]^rs[3])},os=function(t){var e,n,r,i=function(t){function e(t,e,n,r){if(p[n]!==t){p[n]=t;var i=f[n];if(i>=0){var o=g[n];i===e&&o===r||i===r&&o===e||(++y,d[n]=1)}else f[n]=e,g[n]=r}}function n(t){return is(u[t])}function r(t,e){return ts(u[t],u[e])}var i,o,s,a,u=t.coordinates,c=t.lines,h=t.rings,l=function(){for(var t=$o(1.4*u.length,n,r,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i=t)throw new Error(”full hashset“);u=o[a=a+1&s]}return o[a]=r,!0},has:function®{for(var a=e®&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;ea&&(a=e),nu&&(u=n)}function r(t){t.forEach(n)}function i(t){t.forEach®}var o=1/0,s=1/0,a=-1/0,u=-1/0,c={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){r(t.arcs)},MultiLineString:function(t){t.arcs.forEach®},Polygon:function(t){t.arcs.forEach®},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var h in t)e(t[h]);return a>=o&&u>=s?[o,s,a,u]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=jt(t[e]);return n}(t)),s=e>0&&o&&function(t,e,n){function r(t){return[Math.round((t[0]-c)*f),Math.round((t[1]-h)*g)]}function i(t,e){for(var n,r,i,o,s,a=-1,u=0,l=t.length,p=new Array(l);++at&&(e.push®,n=i)}return e},as.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))}},as.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 r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){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:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])};var us=pe,cs=pe;pe.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ce(t,0,o,n));if(i)for(var a=0,u=e.length;a0&&(r+=t[i-1].length,n.holes.push®)}return n},us.default=cs,Oe.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!ke(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e–;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=ze(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,Re(n,this.toBBox),Re(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Re(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=Te(t,0,r,this.toBBox),o=Te(t,r,n,this.toBBox)),a=qe(i)+qe(o),s=e;i–)o=t.children[i],Ae(u,t.leaf?s(o):o),c+=Ge(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r–)Ae(e[r],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():Re(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]
”};“)}};var hs=Object.freeze({toMercator:$e,toWgs84:tn}),ls=6378137,ps=function(t){function e(){for(var t=[],e=0;e1)for(e=0;e=1||u<=0||c>=1||c<=0))){var d=g,y=!a[d];y&&(a[d]=!0),e?s.push(e(g,t,n,h,l,u,r,i,p,f,c,y)):s.push(g)}}function i(t,e){var n,r,i,s,a=o[t][e],u=o[t][e+1];return a[0]y[e.isect].coord?-1:1})),f=[];N.length>0;){var P=N.pop(),O=P.isect,R=P.parent,T=P.winding,A=f.length,D=[y[O].coord],F=O;if(y[O].ringAndEdge1Walkable)var q=y[O].ringAndEdge1,G=y[O].nxtIsectAlongRingAndEdge1;else q=y[O].ringAndEdge2,G=y[O].nxtIsectAlongRingAndEdge2;for(;!bn(y[O].coord,y[G].coord);){D.push(y[G].coord);var B=void 0;for(a=0;at[1]”,“},r=0;rt” and “+e)};xs.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),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=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),s=ys*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[ys*Math.atan2(i,r),s]},xs.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 r=1/(t-1),i=0;ip&&(d>h&&gh&&du&&(u=y)}var _=[];if(a&&u0&&Math.abs(x-n[v-1][0])>p){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(E>-180&&E-180&&n[v-1][0]h&&E<180&&-180===b&&v+1h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(Eh){var N=E;E=b,b=N;var C=w;w=I,I=C}if(E>h&&b=180&&Eh?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;P=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=ur(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},ya.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},ya.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},ya.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var _a=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};_a.prototype.getSymetric=function(){return this.symetric||(this.symetric=new _a(this.to,this.from),this.symetric.symetric=this),this.symetric},_a.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},_a.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},_a.prototype.toString=function(){return”Edge { “this.from.id
” -> “this.to.id
” }“},_a.prototype.toLineString=function(){return a([this.from.coordinates,this.to.coordinates])},_a.prototype.compareTo=function(t){return ur(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var ma=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},va={length:{configurable:!0}};ma.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},ma.prototype.get=function(t){return this.edges[t]},va.length.get=function(){return this.edges.length},ma.prototype.forEach=function(t){this.edges.forEach(t)},ma.prototype.map=function(t){return this.edges.map(t)},ma.prototype.some=function(t){return this.edges.some(t)},ma.prototype.isValid=function(){return!0},ma.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=ur(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},ma.prototype.toMultiPoint=function(){return l(this.edges.map((function(t){return t.from.coordinates})))},ma.prototype.toPolygon=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=o([t])},ma.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ie(this.toPolygon())},ma.findEdgeRingContaining=function(t,e){var n,i,o=t.getEnvelope();return e.forEach((function(e){var s=e.getEnvelope();if(i&&(n=i.getEnvelope()),!function(t,e){var n=t.geometry.coordinates.map((function(t){return t[0]})),r=t.geometry.coordinates.map((function(t){return t[1]})),i=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,i)&&Math.max(null,r)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,i)&&Math.min(null,r)===Math.min(null,o)}(s,o)&&cr(s,o)){var a=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)}))}));a&&e.inside(r(a))&&(i&&!cr(n,s)||(i=e))}})),i},ma.prototype.inside=function(t){return Mt(t,this.toPolygon())},Object.defineProperties(ma.prototype,va);var xa=function(){this.edges=[],this.nodes={}};xa.fromGeoJson=function(t){!function(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“)}(t);var e=new xa;return F(t,(function(t){H(t,”LineString“,”Graph::fromGeoJson“),M(t,(function(t,n){if(t){var r=e.getNode(t),i=e.getNode(n);e.addEdge(r,i)}return n}))})),e},xa.prototype.getNode=function(t){var e=ya.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new ya(t)),n},xa.prototype.addEdge=function(t,e){var n=new _a(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push®},xa.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},xa.prototype._removeIfDangle=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)}))}},xa.prototype.deleteCutEdges=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))}))},xa.prototype._computeNextCWEdges=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}))},xa.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;–o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},xa.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual®);e++}})),t},xa.prototype.getEdgeRings=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},xa.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},xa.prototype._findEdgeRing=function(t){var e=t,n=new ma;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},xa.prototype.removeNode=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]},xa.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()};var Ea=yt((function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}(t.exports=”function“==typeof Object.keys?Object.keys:n).shim=n})),wa=(Ea.shim,yt((function(t,e){function n(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 i=”[object Arguments]“==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?n:r).supported=n,e.unsupported=r}))),ba=(wa.supported,wa.unsupported,yt((function(t){function e(t){return null==t}function n(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])}var r=Array.prototype.slice,i=t.exports=function(t,o,s){return s||(s={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||”object“!=typeof t&&”object“!=typeof o?s.strict?t===o:t==o:function(t,o,s){var a,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(wa(t))return!!wa(o)&&(t=r.call(t),o=r.call(o),i(t,o,s));if(n(t)){if(!n(o))return!1;if(t.length!==o.length)return!1;for(a=0;a=0;a–)if(c[a]!=h[a])return!1;for(a=c.length-1;a>=0;a–)if(u=c[a],!i(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))}}))),Ia=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:xr};Ia.prototype.compare=function(t,e){if(t.type!==e.type||!vr(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,r=mr(t),i=mr(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),i)}}return!1},Ia.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},Ia.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},Ia.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),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},Ia.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)},Ia.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},Ia.prototype.removePseudo=function(t){return t};var Na=Ia,Ca=yt((function(t){function e(t,e,n,r){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,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n0){for(u=0;u=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;ri&&(n=r):e=this.minPts)return n},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r0,f=[];if(n)i=”kmrand“==n?function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join(”_“):”“+a;n[u]||(n[u]=!0,r.push(a))}if(r.length0,s=t[Math.floor(Math.random()*i)];for(o&&s.join(”_“),r.push(s);r.length0;){var u=s.pop();if(u===n)return Ir(u);u.closed=!0;for(var c=t.neighbors(u),h=0,l=c.length;hthis.x” “this.y
”]“},Cr.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Cr.prototype.isWall=function(){return 0===this.weight},Sr.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)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=a)return null;var u=t-i.site[0],c=e-i.site[1],h=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],l=u*u+c*c;le.x?1:this.ye.y?1:0},nu.prototype.clone=function(){},nu.prototype.copy=function(){return new nu(this)},nu.prototype.toString=function(){return”(“this.x
”, “this.y
”, “this.z
”)“},nu.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},nu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},nu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+nu.hashCode(this.x))+nu.hashCode(this.y)},nu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},nu.prototype.interfaces_=function(){return[$a,tu,_i]},nu.prototype.getClass=function(){return nu},nu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=Ka.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},ru.DimensionalComparator.get=function(){return iu},ru.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},ru.NULL_ORDINATE.get=function(){return Ka.NaN},ru.X.get=function(){return 0},ru.Y.get=function(){return 1},ru.Z.get=function(){return 2},Object.defineProperties(nu,ru);var iu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new Za(”only 2 or 3 dimensions may be specified“);this._dimensionsToTest=e}};iu.prototype.compare=function(t,e){var n=t,r=e,i=iu.compare(n.x,r.x);if(0!==i)return i;var o=iu.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:iu.compare(n.z,r.z)},iu.prototype.interfaces_=function(){return[eu]},iu.prototype.getClass=function(){return iu},iu.compare=function(t,e){return te?1:Ka.isNaN(t)?Ka.isNaN(e)?0:-1:Ka.isNaN(e)?1:0};var ou=function(){};ou.prototype.create=function(){},ou.prototype.interfaces_=function(){return[]},ou.prototype.getClass=function(){return ou};var su=function(){},au={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};su.prototype.interfaces_=function(){return[]},su.prototype.getClass=function(){return su},su.toLocationSymbol=function(t){switch(t){case su.EXTERIOR:return”e“;case su.BOUNDARY:return”b“;case su.INTERIOR:return”i“;case su.NONE:return”-“}throw new Za(”Unknown location value: “+t)},au.INTERIOR.get=function(){return 0},au.BOUNDARY.get=function(){return 1},au.EXTERIOR.get=function(){return 2},au.NONE.get=function(){return-1},Object.defineProperties(su,au);var uu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},cu=function(){},hu={LOG_10:{configurable:!0}};cu.prototype.interfaces_=function(){return[]},cu.prototype.getClass=function(){return cu},cu.log10=function(t){var e=Math.log(t);return Ka.isInfinite(e)||Ka.isNaN(e)?e:e/cu.LOG_10},cu.min=function(t,e,n,r){var i=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},cu.wrap=function(t,e){return t<0?e- -t%e:t%e},cu.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},cu.average=function(t,e){return(t+e)/2},hu.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(cu,hu);var lu=function(t){this.str=t};lu.prototype.append=function(t){this.str+=t},lu.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},lu.prototype.toString=function(t){return this.str};var pu=function(t){this.value=t};pu.prototype.intValue=function(){return this.value},pu.prototype.compareTo=function(t){return this.valuet?1:0},pu.isNaN=function(t){return Number.isNaN(t)};var fu=function(){};fu.isWhitespace=function(t){return t<=32&&t>=0||127===t},fu.toUpperCase=function(t){return t.toUpperCase()};var gu=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if(”number“==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if(”string“==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse®)}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},du={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};gu.prototype.le=function(t){return(this._hi9?(h=!0,l=”9“):l=”0“+c,s.append(l),n=n.subtract(gu.valueOf©).multiply(gu.TEN),h&&n.selfAdd(gu.TEN);var p=!0,f=gu.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},gu.prototype.sqr=function(){return this.multiply(this)},gu.prototype.doubleValue=function(){return this._hi+this._lo},gu.prototype.subtract=function(){if(arguments[0]instanceof gu){var t=arguments[0];return this.add(t.negate())}if(”number“==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},gu.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},gu.prototype.isZero=function(){return 0===this._hi&&0===this._lo},gu.prototype.selfSubtract=function(){if(arguments[0]instanceof gu){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)}},gu.prototype.getSpecialNumberString=function(){return this.isZero()?”0.0“:this.isNaN()?”NaN “:null},gu.prototype.min=function(t){return this.le(t)?this:t},gu.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof gu){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],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,h=null,l=null;return u=this._hi/n,l=(i=(c=gu.SPLIT*u)-(i=c-u))*(s=(l=gu.SPLIT*n)-(s=l-n))-(h=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,l=u+(c=(this._hi-h-l+this._lo-u*r)/n),this._hi=l,this._lo=u-l+c,this}},gu.prototype.dump=function(){return”DD<"this._hi
“, ”this._lo
“>”},gu.prototype.divide=function(){if(arguments[0]instanceof gu){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=gu.SPLIT*o)-(e=s-o)),u=e*(r=(u=gu.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new gu(u=o+s,o-u+s)}if(“number”==typeof arguments[0]){var c=arguments[0];return Ka.isNaN©?gu.createNaN():gu.copy(this).selfDivide(c,0)}},gu.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},gu.prototype.pow=function(t){if(0===t)return gu.valueOf(1);var e=new gu(this),n=gu.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},gu.prototype.ceil=function(){if(this.isNaN())return gu.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new gu(t,e)},gu.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},gu.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},gu.prototype.setValue=function(){if(arguments[0]instanceof gu){var t=arguments[0];return this.init(t),this}if(“number”==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},gu.prototype.max=function(t){return this.ge(t)?this:t},gu.prototype.sqrt=function(){if(this.isZero())return gu.valueOf(0);if(this.isNegative())return gu.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=gu.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add®},gu.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof gu){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if(“number”==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))this._lo)
(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],h=null,l=null,p=null,f=null,g=null,d=null,y=null;f=this._hi+u,l=this._lo+c,g=f-(d=f-this._hi),p=l-(y=l-this._lo);var _=(h=f+(d=(g=u-d+(this._hi-g))+l))+(d=(p=c-y+(this._lo-p))+(d+(f-h))),m=d+(h-_);return this.hi=,this._lo=m,this}},gu.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof gu){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],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=gu.SPLIT*this._hi)-this._hi,c=gu.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var h=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),l=c+(i=u-h);return this._hi=h,this._lo=l,this}},gu.prototype.selfSqr=function(){return this.selfMultiply(this)},gu.prototype.floor=function(){if(this.isNaN())return gu.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new gu(t,e)},gu.prototype.negate=function(){return this.isNaN()?this:new gu(-this._hi,-this._lo)},gu.prototype.clone=function(){},gu.prototype.multiply=function(){if(arguments[0]instanceof gu){var t=arguments[0];return t.isNaN()?gu.createNaN():gu.copy(this).selfMultiply(t)}if(“number”==typeof arguments[0]){var e=arguments[0];return Ka.isNaN(e)?gu.createNaN():gu.copy(this).selfMultiply(e,0)}},gu.prototype.isNaN=function(){return Ka.isNaN(this._hi)},gu.prototype.intValue=function(){return Math.trunc(this._hi)},gu.prototype.toString=function(){var t=gu.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},gu.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+gu.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+gu.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},gu.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=gu.SPLIT*n)-(i=s-n)),o=(a=gu.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new gu(u,n-u+s)},gu.prototype.toSciNotation=function(){if(this.isZero())return gu.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=gu.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+“.”+i;return this.isNegative()?“-”+o+r:o+r},gu.prototype.abs=function(){return this.isNaN()?gu.NaN:this.isNegative()?this.negate():new gu(this)},gu.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},gu.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},gu.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},gu.prototype.trunc=function(){return this.isNaN()?gu.NaN:this.isPositive()?this.floor():this.ceil()},gu.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},gu.prototype.interfaces_=function(){return[_i,$a,tu]},gu.prototype.getClass=function(){return gu},gu.sqr=function(t){return gu.valueOf(t).selfMultiply(t)},gu.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return gu.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new gu(e)}},gu.sqrt=function(t){return gu.valueOf(t).sqrt()},gu.parse=function(t){for(var e=0,n=t.length;fu.isWhitespace(t.charAt(e));)e++;var r=!1;if(e=n);){var c=t.charAt(e);if(e++,fu.isDigit©){var h=c-“0”;o.selfMultiply(gu.TEN),o.selfAdd(h),s++}else{if(“.”!==c){if(“e”===c||“E”===c){var l=t.substring(e);try{u=pu.parseInt(l)}catch(e){throw e instanceof Error?new Error(“Invalid exponent ”l
“ in string ”+t):e}break}throw new Error(“Unexpected character ‘”c
“’ at position ”e
“ in string ”+t)}a=s}}var p=o,f=s-a-u;if(0===f)p=o;else if(f>0){var g=gu.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=gu.TEN.pow(-f);p=o.multiply(d)}return r?p.negate():p},gu.createNaN=function(){return new gu(Ka.NaN,Ka.NaN)},gu.copy=function(t){return new gu(t)},gu.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},gu.stringOfChar=function(t,e){for(var n=new lu,r=0;r0){if(o<=0)return yu.signum(s);r=i+o}else{if(!(i<0))return yu.signum(s);if(o>=0)return yu.signum(s);r=-i-o}var a=yu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?yu.signum(s):2},yu.signum=function(t){return t>0?1:t<0?-1:0},_u.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(yu,_u);var mu=function(){},vu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};vu.X.get=function(){return 0},vu.Y.get=function(){return 1},vu.Z.get=function(){return 2},vu.M.get=function(){return 3},mu.prototype.setOrdinate=function(t,e,n){},mu.prototype.size=function(){},mu.prototype.getOrdinate=function(t,e){},mu.prototype.getCoordinate=function(){},mu.prototype.getCoordinateCopy=function(t){},mu.prototype.getDimension=function(){},mu.prototype.getX=function(t){},mu.prototype.clone=function(){},mu.prototype.expandEnvelope=function(t){},mu.prototype.copy=function(){},mu.prototype.getY=function(t){},mu.prototype.toCoordinateArray=function(){},mu.prototype.interfaces_=function(){return[tu]},mu.prototype.getClass=function(){return mu},Object.defineProperties(mu,vu);var xu=function(){},Eu=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(xu),wu=function(){};wu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;se=arguments;this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if(“number”==typeof arguments&&“number”==typeof arguments){var n=arguments,r=arguments;this.x=n,this.y=r,this.w=1}else if(argumentsinstanceof t&&argumentsinstanceof t){var i=arguments,o=arguments;this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(argumentsinstanceof nu&&argumentsinstanceof nu){var s=arguments,a=arguments;this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments,c=arguments,h=arguments;this.x=u,this.y=c,this.w=h}else if(4===arguments.length){var l=arguments,p=arguments,f=arguments,g=arguments,d=l.y-p.y,y=p.x-l.x,_=l.x*p.y-p.x*l.y,m=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*_,this.y=m*_-d*x,this.w=d*v-m*y}};bu.prototype.getY=function(){var t=this.y/this.w;if(Ka.isNaN(t)||Ka.isInfinite(t))throw new Eu;return t},bu.prototype.getX=function(){var t=this.x/this.w;if(Ka.isNaN(t)||Ka.isInfinite(t))throw new Eu;return t},bu.prototype.getCoordinate=function(){var t=new nu;return t.x=this.getX(),t.y=this.getY(),t},bu.prototype.interfaces_=function(){return[]},bu.prototype.getClass=function(){return bu},bu.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,c=n.x*r.y-r.x*n.y,h=i*u-a*o,l=(o*c-u*s)/h,p=(a*s-i*c)/h;if(Ka.isNaN(l)||Ka.isInfinite(l)||Ka.isNaN(p)||Ka.isInfinite(p))throw new Eu;return new nu(l,p)};var Iu=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(argumentsinstanceof nu){var e=arguments;this.init(e.x,e.x,e.y,e.y)}else if(argumentsinstanceof t){var n=arguments;this.init(n)}}else if(2===arguments.length){var r=arguments,i=arguments;this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments,s=arguments,a=arguments,u=arguments;this.init(o,s,a,u)}},Nu={serialVersionUID:{configurable:!0}};Iu.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Iu.prototype.equals=function(t){if(!(t instanceof Iu))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()},Iu.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Iu;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new Iu(e,r,n,i)},Iu.prototype.isNull=function(){return this._maxx<this._minx},Iu.prototype.getMaxX=function(){return this._maxx},Iu.prototype.covers=function(){if(1===arguments.length){if(argumentsinstanceof nu){var t=arguments;return this.covers(t.x,t.y)}if(argumentsinstanceof Iu){var e=arguments;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,r=arguments;return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},Iu.prototype.intersects=function(){if(1===arguments.length){if(argumentsinstanceof Iu){var t=arguments;return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(argumentsinstanceof nu){var e=arguments;return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments,r=arguments;return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},Iu.prototype.getMinY=function(){return this._miny},Iu.prototype.getMinX=function(){return this._minx},Iu.prototype.expandToInclude=function(){if(1===arguments.length){if(argumentsinstanceof nu){var t=arguments;this.expandToInclude(t.x,t.y)}else if(argumentsinstanceof Iu){var e=arguments;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,r=arguments;this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},Iu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Iu.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Iu.prototype.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},Iu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Iu.prototype.toString=function(){return“Env[”this._minx
“ : ”this._maxx
“, ”this._miny
“ : ”this._maxy
“]”},Iu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Iu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Iu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Iu.prototype.expandBy=function(){if(1===arguments.length){var t=arguments;this.expandBy(t,t)}else if(2===arguments.length){var e=arguments,n=arguments;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()}},Iu.prototype.contains=function(){if(1===arguments.length){if(argumentsinstanceof Iu){var t=arguments;return this.covers(t)}if(argumentsinstanceof nu){var e=arguments;return this.covers(e)}}else if(2===arguments.length){var n=arguments,r=arguments;return this.covers(n,r)}},Iu.prototype.centre=function(){return this.isNull()?null:new nu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Iu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(argumentsinstanceof nu){var t=arguments;this.init(t.x,t.x,t.y,t.y)}else if(argumentsinstanceof Iu){var e=arguments;this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments,r=arguments;this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments,o=arguments,s=arguments,a=arguments;i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},Iu.prototype.getMaxY=function(){return this._maxy},Iu.prototype.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)},Iu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+nu.hashCode(this._minx))+nu.hashCode(this._maxx))+nu.hashCode(this._miny))+nu.hashCode(this._maxy)},Iu.prototype.interfaces_=function(){return},Iu.prototype.getClass=function(){return Iu},Iu.intersects=function(){if(3===arguments.length){var t=arguments,e=arguments,n=arguments;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 r=arguments,i=arguments,o=arguments,s=arguments,a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(c>u||h<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),c=Math.min(r.y,i.y),h=Math.max(r.y,i.y),c>u||h<a))}},Nu.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Iu,Nu);var Cu={typeStr:/^s*(w+)s*(s*(.*)s*)s*$/,emptyTypeStr:/^s*(w+)s*EMPTYs*$/,spaces:/s+/,parenComma:/)s*,s*(/,doubleParenComma:/)s*)s*,s*(s*(/,trimParens:/^s*(?(.*?))?s*$/},Su=function(t){this.geometryFactory=t||new Zc};Su.prototype.read=function(t){var e,n,r;t=t.replace(//g,“ ”);var i=Cu.typeStr.exec(t);if(-1!==t.search(“EMPTY”)&&((i=Cu.emptyTypeStr.exec(t))=void 0),i&&(n=i.toLowerCase(),r=i,Lu&&(e=Lu.apply(this,))),void 0===e)throw new Error(“Could not parse WKT ”+t);return e},Su.prototype.write=function(t){return this.extractGeometry(t)},Su.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Mu)return null;var n=e.toUpperCase();return t.isEmpty()?n+“ EMPTY”:n+“(”+Mu.apply(this,)+“)”};var Mu={coordinate:function(t){return t.x+“ ”+t.y},point:function(t){return Mu.coordinate.call(this,t._coordinates._coordinates)},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n])+“)”);return e.join(“,”)},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n]));return e.join(“,”)},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n]));return e.join(“,”)},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n])+“)”);return e.join(“,”)},polygon:function(t){var e=[];e.push(“(”+Mu.linestring.apply(this,)+“)”);for(var n=0,r=t._holes.length;n])+“)”);return e.join(“,”)},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n])+“)”);return e.join(“,”)},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n));return e.join(“,”)}},Lu={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(Cu.spaces);return this.geometryFactory.createPoint(new nu(Number.parseFloat(e),Number.parseFloat(e)))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(“,”),r=[],i=0,o=n.length;i.replace(Cu.trimParens,“$1”),r.push(Lu.point.apply(this,));return this.geometryFactory.createMultiPoint®},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(“,”),r=[],i=0,o=n.length;i.trim().split(Cu.spaces),r.push(new nu(Number.parseFloat(e),Number.parseFloat(e)));return this.geometryFactory.createLineString®},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(“,”),r=[],i=0,o=n.length;i.trim().split(Cu.spaces),r.push(new nu(Number.parseFloat(e),Number.parseFloat(e)));return this.geometryFactory.createLinearRing®},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Cu.parenComma),r=[],i=0,o=n.length;i.replace(Cu.trimParens,“$1”),r.push(Lu.linestring.apply(this,));return this.geometryFactory.createMultiLineString®},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(Cu.parenComma),s=[],a=0,u=o.length;a.replace(Cu.trimParens,“$1”),n=Lu.linestring.apply(this,),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push®;return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Cu.doubleParenComma),r=[],i=0,o=n.length;i.replace(Cu.trimParens,“$1”),r.push(Lu.polygon.apply(this,));return this.geometryFactory.createMultiPolygon®},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,s*()/g,“|$1”)).trim().split(“|”),n=[],r=0,i=e.length;r));return this.geometryFactory.createGeometryCollection(n)}},Pu=function(t){this.parser=new Su(t)};Pu.prototype.write=function(t){return this.parser.write(t)},Pu.toLineString=function(t,e){if(2!==arguments.length)throw new Error(“Not implemented”);return“LINESTRING ( ”t.x
“ ”t.y
“, ”e.x
“ ”e.y
“ )”};var Ou=function(t){function e(e){t.call(this,e),this.name=“RuntimeException”,this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Ru=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments;t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ou),Tu=function(){};Tu.prototype.interfaces_=function(){return[]},Tu.prototype.getClass=function(){return Tu},Tu.shouldNeverReachHere=function(){if(0===arguments.length)Tu.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments;throw new Ru(“Should never reach here”+(null!==t?“: ”+t:“”))}},Tu.isTrue=function(){var t,e;if(1===arguments.length)t=arguments,Tu.isTrue(t,null);else if(2===arguments.length&&(t=arguments,e=arguments,!t))throw null===e?new Ru:new Ru(e)},Tu.equals=function(){var t,e,n;if(2===arguments.length)t=arguments,e=arguments,Tu.equals(t,e,null);else if(3===arguments.length&&(t=arguments,e=arguments,n=arguments,!e.equals(t)))throw new Ru(“Expected ”t
“ but encountered ”e
(null!==n?“: ”+n:“”))};var Au=function(){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=new nu,this._intPt=new nu,this._pa=this._intPt,this._pb=this._intPt,this._result=0},Du={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Au.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[e]},Au.prototype.getTopologySummary=function(){var t=new lu;return this.isEndPoint()&&t.append(“ endpoint”),this._isProper&&t.append(“ proper”),this.isCollinear()&&t.append(“ collinear”),t.toString()},Au.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0]=t,this._inputLines[1]=e,this._inputLines[0]=n,this._inputLines[1]=r,this._result=this.computeIntersect(t,e,n,r)},Au.prototype.getIntersectionNum=function(){return this._result},Au.prototype.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;this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[0]=0,this._intLineIndex[1]=1):(this._intLineIndex[0]=1,this._intLineIndex[1]=0)}},Au.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Au.prototype.setPrecisionModel=function(t){this._precisionModel=t},Au.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments,e=0;e.equals2D(this._inputLines[0])&&!this._intPt.equals2D(this._inputLines[1]))return!0;return!1}},Au.prototype.getIntersection=function(t){return this._intPt},Au.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Au.prototype.hasIntersection=function(){return this._result!==Au.NO_INTERSECTION},Au.prototype.getEdgeDistance=function(t,e){return Au.computeEdgeDistance(this._intPt,this._inputLines[0],this._inputLines[1])},Au.prototype.isCollinear=function(){return this._result===Au.COLLINEAR_INTERSECTION},Au.prototype.toString=function(){return Pu.toLineString(this._inputLines[0],this._inputLines[1])+“ - ”+Pu.toLineString(this._inputLines[0],this._inputLines[1])+this.getTopologySummary()},Au.prototype.getEndpoint=function(t,e){return this._inputLines[e]},Au.prototype.isIntersection=function(t){for(var e=0;e.equals2D(t))return!0;return!1},Au.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e]]},Au.prototype.interfaces_=function(){return[]},Au.prototype.getClass=function(){return Au},Au.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return Tu.isTrue(!(0===o&&!t.equals(e)),“Bad distance calculation”),o},Au.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return Tu.isTrue(!(0===o&&!t.equals(e)),“Invalid distance calculation”),o},Du.DONT_INTERSECT.get=function(){return 0},Du.DO_INTERSECT.get=function(){return 1},Du.COLLINEAR.get=function(){return 2},Du.NO_INTERSECTION.get=function(){return 0},Du.POINT_INTERSECTION.get=function(){return 1},Du.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Au,Du);var Fu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Iu(this._inputLines[0],this._inputLines[1]),n=new Iu(this._inputLines[0],this._inputLines[1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments,n=arguments,r=arguments;if(this._isProper=!1,Iu.intersects(n,r,e)&&0===Bu.orientationIndex(n,r,e)&&0===Bu.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals®)&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=bu.intersection(t,n,r,i)}catch(s){if(!(s instanceof Eu))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new nu(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs®<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=yu.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);wu.out.println(“DD in env = ”s
“ ——————— ”+o),i.distance(o)>1e-4&&wu.out.println(“Distance = ”+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new nu(t),o=new nu(e),s=new nu(n),a=new nu®,u=new nu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Iu.intersects(e,n,r),s=Iu.intersects(e,n,i),a=Iu.intersects(r,i,e),u=Iu.intersects(r,i,n);return o&&s?(this._intPt=r,this._intPt=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt=e,this._intPt=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt=r,this._intPt=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt=r,this._intPt=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt=i,this._intPt=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt=i,this._intPt=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){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,c=n.x<r.x?n.x:r.x,h=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(a<l?a:l))/2,g=((s>h?s:h)+(u<p?u:p))/2;i.x=f,i.y=g,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!Iu.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=Bu.orientationIndex(e,n,r),s=Bu.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=Bu.orientationIndex(r,i,e),u=Bu.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt=e:n.equals2D®||n.equals2D(i)?this._intPt=n:0===o?this._intPt=new nu®:0===s?this._intPt=new nu(i):0===a?this._intPt=new nu(e):0===u&&(this._intPt=new nu(n))):(this._isProper=!0,this._intPt=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=Bu.distancePointLine(t,n,r),s=Bu.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=Bu.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=Bu.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(Au),qu=function(){};qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu},qu.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return qu.signOfDet2x2(r,i,o,s)},qu.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var Gu=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments;this._p=t};Gu.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,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(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 i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=qu.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},Gu.prototype.isPointInPolygon=function(){return this.getLocation()!==su.EXTERIOR},Gu.prototype.getLocation=function(){return this._isPointOnSegment?su.BOUNDARY:this._crossingCount%2==1?su.INTERIOR:su.EXTERIOR},Gu.prototype.isOnSegment=function(){return this._isPointOnSegment},Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu},Gu.locatePointInRing=function(){if(argumentsinstanceof nu&&uu(arguments,mu)){for(var t=arguments,e=arguments,n=new Gu(t),r=new nu,i=new nu,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(argumentsinstanceof nu&&argumentsinstanceof Array){for(var s=arguments,a=arguments,u=new Gu(s),c=1;c<a.length;c++){var h=a,l=a;if(u.countSegment(h,l),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var Bu=function(){},ku={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Bu.prototype.interfaces_=function(){return[]},Bu.prototype.getClass=function(){return Bu},Bu.orientationIndex=function(t,e,n){return yu.orientationIndex(t,e,n)},Bu.signedArea=function(){if(argumentsinstanceof Array){var t=arguments;if(t.length<3)return 0;for(var e=0,n=t.x,r=1;r<t.length-1;r++){var i=t.x-n,o=t.y;e+=i*(t.y-o)}return e/2}if(uu(arguments,mu)){var s=arguments,a=s.size();if(a<3)return 0;var u=new nu,c=new nu,h=new nu;s.getCoordinate(0,c),s.getCoordinate(1,h);var l=c.x;h.x-=l;for(var p=0,f=1;f<a-1;f++)u.y=c.y,c.x=h.x,c.y=h.y,s.getCoordinate(f+1,h),h.x-=l,p+=c.x*(u.y-h.y);return p/2}},Bu.distanceLineLine=function(t,e,n,r){if(t.equals(e))return Bu.distancePointLine(t,n,r);if(n.equals®)return Bu.distancePointLine(r,t,e);var i=!1;if(Iu.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.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)&&(i=!0)}}else i=!0;return i?cu.min(Bu.distancePointLine(t,n,r),Bu.distancePointLine(e,n,r),Bu.distancePointLine(n,t,e),Bu.distancePointLine(r,t,e)):0},Bu.isPointInRing=function(t,e){return Bu.locatePointInRing(t,e)!==su.EXTERIOR},Bu.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new nu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,c=a-i,h=u-o;n+=Math.sqrt(c*c+h*h),i=a,o=u}return n},Bu.isCCW=function(t){var e=t.length-1;if(e<3)throw new Za(“Ring has fewer than 4 points, so orientation cannot be determined”);for(var n=t,r=0,i=1;i<=e;i++){var o=t;o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t.equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t.equals2D(n)&&a!==r);var u=t,c=t;if(u.equals2D(n)||c.equals2D(n)||u.equals2D©)return!1;var h=Bu.computeOrientation(u,n,c);return 0===h?u.x>c.x:h>0},Bu.locatePointInRing=function(t,e){return Gu.locatePointInRing(t,e)},Bu.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt®},Bu.computeOrientation=function(t,e,n){return Bu.orientationIndex(t,e,n)},Bu.distancePointLine=function(){if(2===arguments.length){var t=arguments,e=arguments;if(0===e.length)throw new Za(“Line array must contain at least one vertex”);for(var n=t.distance(e),r=0;r<e.length-1;r++){var i=Bu.distancePointLine(t,e,e);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments,s=arguments,a=arguments;if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var h=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(h)*Math.sqrt(u)}},Bu.isOnLine=function(t,e){for(var n=new Fu,r=1;r<e.length;r++){var i=e,o=e;if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ku.CLOCKWISE.get=function(){return-1},ku.RIGHT.get=function(){return Bu.CLOCKWISE},ku.COUNTERCLOCKWISE.get=function(){return 1},ku.LEFT.get=function(){return Bu.COUNTERCLOCKWISE},ku.COLLINEAR.get=function(){return 0},ku.STRAIGHT.get=function(){return Bu.COLLINEAR},Object.defineProperties(Bu,ku);var zu=function(){};zu.prototype.filter=function(t){},zu.prototype.interfaces_=function(){return[]},zu.prototype.getClass=function(){return zu};var ju=function(){var t=arguments;this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Xu={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ju.prototype.isGeometryCollection=function(){return this.getSortIndex()===ju.SORTINDEX_GEOMETRYCOLLECTION},ju.prototype.getFactory=function(){return this._factory},ju.prototype.getGeometryN=function(t){return this},ju.prototype.getArea=function(){return 0},ju.prototype.isRectangle=function(){return!1},ju.prototype.equals=function(){if(argumentsinstanceof ju){var t=arguments;return null!==t&&this.equalsTopo(t)}if(argumentsinstanceof Object){var e=arguments;if(!(e instanceof ju))return!1;var n=e;return this.equalsExact(n)}},ju.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ju.prototype.geometryChanged=function(){this.apply(ju.geometryChangedFilter)},ju.prototype.geometryChangedAction=function(){this._envelope=null},ju.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ju.prototype.getLength=function(){return 0},ju.prototype.getNumGeometries=function(){return 1},ju.prototype.compareTo=function(){if(1===arguments.length){var t=arguments,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,r=arguments;return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ju.prototype.getUserData=function(){return this._userData},ju.prototype.getSRID=function(){return this._SRID},ju.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ju.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ju.SORTINDEX_GEOMETRYCOLLECTION)throw new Za(“This method does not support GeometryCollection arguments”)},ju.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ju.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ju.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ju.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Iu(this._envelope)},ju.prototype.setSRID=function(t){this._SRID=t},ju.prototype.setUserData=function(t){this._userData=t},ju.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},ju.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ju.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ju.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ju.SORTINDEX_MULTIPOINT||this.getSortIndex()===ju.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ju.SORTINDEX_MULTIPOLYGON},ju.prototype.interfaces_=function(){return},ju.prototype.getClass=function(){return ju},ju.hasNonEmptyElements=function(t){for(var e=0;e.isEmpty())return!0;return!1},ju.hasNullElements=function(t){for(var e=0;e)return!0;return!1},Xu.serialVersionUID.get=function(){return 0x799ea46522854c00},Xu.SORTINDEX_POINT.get=function(){return 0},Xu.SORTINDEX_MULTIPOINT.get=function(){return 1},Xu.SORTINDEX_LINESTRING.get=function(){return 2},Xu.SORTINDEX_LINEARRING.get=function(){return 3},Xu.SORTINDEX_MULTILINESTRING.get=function(){return 4},Xu.SORTINDEX_POLYGON.get=function(){return 5},Xu.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Xu.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Xu.geometryChangedFilter.get=function(){return Uu},Object.defineProperties(ju,Xu);var Uu=function(){};Uu.interfaces_=function(){return},Uu.filter=function(t){t.geometryChangedAction()};var Yu=function(){};Yu.prototype.filter=function(t){},Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu};var Vu=function(){},Hu={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Vu.prototype.isInBoundary=function(t){},Vu.prototype.interfaces_=function(){return[]},Vu.prototype.getClass=function(){return Vu},Hu.Mod2BoundaryNodeRule.get=function(){return Wu},Hu.EndPointBoundaryNodeRule.get=function(){return Ju},Hu.MultiValentEndPointBoundaryNodeRule.get=function(){return Zu},Hu.MonoValentEndPointBoundaryNodeRule.get=function(){return Ku},Hu.MOD2_BOUNDARY_RULE.get=function(){return new Wu},Hu.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ju},Hu.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Zu},Hu.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ku},Hu.OGC_SFS_BOUNDARY_RULE.get=function(){return Vu.MOD2_BOUNDARY_RULE},Object.defineProperties(Vu,Hu);var Wu=function(){};Wu.prototype.isInBoundary=function(t){return t%2==1},Wu.prototype.interfaces_=function(){return},Wu.prototype.getClass=function(){return Wu};var Ju=function(){};Ju.prototype.isInBoundary=function(t){return t>0},Ju.prototype.interfaces_=function(){return},Ju.prototype.getClass=function(){return Ju};var Zu=function(){};Zu.prototype.isInBoundary=function(t){return t>1},Zu.prototype.interfaces_=function(){return},Zu.prototype.getClass=function(){return Zu};var Ku=function(){};Ku.prototype.isInBoundary=function(t){return 1===t},Ku.prototype.interfaces_=function(){return},Ku.prototype.getClass=function(){return Ku};var Qu=function(){};Qu.prototype.add=function(){},Qu.prototype.addAll=function(){},Qu.prototype.isEmpty=function(){},Qu.prototype.iterator=function(){},Qu.prototype.size=function(){},Qu.prototype.toArray=function(){},Qu.prototype.remove=function(){};var $u=function(t){function e(e){t.call(this),this.message=e||“”}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={name:{configurable:!0}};return n.name.get=function(){return“IndexOutOfBoundsException”},Object.defineProperties(e,n),e}(Error),tc=function(){};tc.prototype.hasNext=function(){},tc.prototype.next=function(){},tc.prototype.remove=function(){};var ec=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Qu);(mi.prototype=new Error).name=“NoSuchElementException”;var nc=function(t){function e(){t.call(this),this.array_=[],argumentsinstanceof Qu&&this.addAll(arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments,arguments),!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_;return this.array_=e,n},e.prototype.iterator=function(){return new rc(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new $u;return this.array_},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);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n===t){this.array_.splice(n,1),e=!0;break}return e},e}(ec),rc=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new mi;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(tc),ic=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments;this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments,r=arguments;this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments,n=arguments,r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments;t.prototype.add.call(this,e)}else if(2===arguments.length){if(argumentsinstanceof Array&&“boolean”==typeof arguments){var n=arguments,r=arguments;return this.add(n,r,!0),!0}if(argumentsinstanceof nu&&“boolean”==typeof arguments){var i=arguments;if(!arguments&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(argumentsinstanceof Object&&“boolean”==typeof arguments){var o=arguments,s=arguments;return this.add(o,s),!0}}else if(3===arguments.length){if(“boolean”==typeof arguments&&argumentsinstanceof Array&&“boolean”==typeof arguments){var a=arguments,u=arguments;if(arguments)for(var c=0;c,u);else for(var h=a.length-1;h>=0;h–)this.add(a,u);return!0}if(“boolean”==typeof arguments&&Number.isInteger(arguments)&&argumentsinstanceof nu){var l=arguments,p=arguments;if(!arguments){var f=this.size();if(f>0){if(l>0&&this.get(l-1).equals2D(p))return null;if(l<f&&this.get(l).equals2D(p))return null}}t.prototype.add.call(this,l,p)}}else if(4===arguments.length){var g=arguments,d=arguments,y=arguments,_=arguments,m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g,d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new nu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(nc),oc=function(){},sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};sc.ForwardComparator.get=function(){return ac},sc.BidirectionalComparator.get=function(){return uc},sc.coordArrayType.get=function(){return new Array(0).fill(null)},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc},oc.isRing=function(t){return!(t.length<4||!t.equals2D(t))},oc.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t;if(oc.indexOf(r,e)<0)return r}return null},oc.scroll=function(t,e){var n=oc.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);wu.arraycopy(t,n,r,0,t.length-n),wu.arraycopy(t,0,r,t.length-n,n),wu.arraycopy(r,0,t,0,t.length)},oc.equals=function(){if(2===arguments.length){var t=arguments,e=arguments;if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n.equals(e))return!1;return!0}if(3===arguments.length){var r=arguments,i=arguments,o=arguments;if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s,i))return!1;return!0}},oc.intersection=function(t,e){for(var n=new ic,r=0;r)&&n.add(t,!0);return n.toCoordinateArray()},oc.hasRepeatedPoints=function(t){for(var e=1;e.equals(t))return!0;return!1},oc.removeRepeatedPoints=function(t){return oc.hasRepeatedPoints(t)?new ic(t,!1).toCoordinateArray():t},oc.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t;t=t,t=i}},oc.removeNull=function(t){for(var e=0,n=0;n&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o&&(r=t);return r},oc.copyDeep=function(){if(1===arguments.length){for(var t=arguments,e=new Array(t.length).fill(null),n=0;n=new nu(t);return e}if(5===arguments.length)for(var r=arguments,i=arguments,o=arguments,s=arguments,a=arguments,u=0;u=new nu(r)},oc.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t,i=e;if(0!==r.compareTo(i))return!1}return!0},oc.envelope=function(t){for(var e=new Iu,n=0;n);return e},oc.toCoordinateArray=function(t){return t.toArray(oc.coordArrayType)},oc.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},oc.indexOf=function(t,e){for(var n=0;n))return n;return-1},oc.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t.compareTo(t);if(0!==r)return r}return 1},oc.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t.compareTo(e);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},oc.minCoordinate=function(t){for(var e=null,n=0;n)>0)&&(e=t);return e},oc.extract=function(t,e,n){e=cu.clamp(e,0,t.length);var r=(n=cu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array®.fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i=t;return i},Object.defineProperties(oc,sc);var ac=function(){};ac.prototype.compare=function(t,e){return oc.compare(t,e)},ac.prototype.interfaces_=function(){return},ac.prototype.getClass=function(){return ac};var uc=function(){};uc.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=oc.compare(n,r);return oc.isEqualReversed(n,r)?0:i},uc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=oc.increasingDirection(n),o=oc.increasingDirection®,s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var c=n.compareTo(r);if(0!==c)return c;s+=i,a+=o}return 0},uc.prototype.interfaces_=function(){return},uc.prototype.getClass=function(){return uc};var cc=function(){};cc.prototype.get=function(){},cc.prototype.put=function(){},cc.prototype.size=function(){},cc.prototype.values=function(){},cc.prototype.entrySet=function(){};var hc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(cc);(vi.prototype=new Error).name=“OperationNotSupported”,(xi.prototype=new Qu).contains=function(){};var lc=function(t){function e(){t.call(this),this.array_=[],argumentsinstanceof Qu&&this.addAll(arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e);return t},e.prototype.iterator=function(){return new pc(this)},e}(xi),pc=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new mi;return this.hashSet_.array_},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new vi},e}(tc),fc=0;(Ci.prototype=new hc).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},Ci.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:fc,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:fc,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Ci.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(wi(t)===Ii(wi(wi(t)))){var e=Ni(wi(wi(t)));1===Ei(e)?(bi(wi(t),fc),bi(e,fc),bi(wi(wi(t)),1),t=wi(wi(t))):(t===Ni(wi(t))&&(t=wi(t),this.rotateLeft(t)),bi(wi(t),fc),bi(wi(wi(t)),1),this.rotateRight(wi(wi(t))))}else{var n=Ii(wi(wi(t)));1===Ei(n)?(bi(wi(t),fc),bi(n,fc),bi(wi(wi(t)),1),t=wi(wi(t))):(t===Ii(wi(t))&&(t=wi(t),this.rotateRight(t)),bi(wi(t),fc),bi(wi(wi(t)),1),this.rotateLeft(wi(wi(t))))}this.root_.color=fc},Ci.prototype.values=function(){var t=new nc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Ci.successor(e));)t.add(e.value);return t},Ci.prototype.entrySet=function(){var t=new lc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Ci.successor(e));)t.add(e);return t},Ci.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}},Ci.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}},Ci.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Ci.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},Ci.prototype.size=function(){return this.size_};var gc=function(){};gc.prototype.interfaces_=function(){return[]},gc.prototype.getClass=function(){return gc},Si.prototype=new xi,(Mi.prototype=new Si).contains=function(t){for(var e=0,n=this.array_.length;e.compareTo(t))return!0;return!1},Mi.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e.compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},Mi.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},Mi.prototype.remove=function(t){throw new vi},Mi.prototype.size=function(){return this.array_.length},Mi.prototype.isEmpty=function(){return 0===this.array_.length},Mi.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e);return t},Mi.prototype.iterator=function(){return new dc(this)};var dc=function(t){this.treeSet_=t,this.position_=0};dc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new mi;return this.treeSet_.array_},dc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},dc.prototype.remove=function(){throw new vi};var yc=function(){};yc.sort=function(){var t,e,n,r,i=arguments;if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort®;else if(2===arguments.length)n=arguments,r=function(t,e){return n.compare(t,e)},i.sort®;else if(3===arguments.length){(e=i.slice(arguments,arguments)).sort();var o=i.slice(0,arguments).concat(e,i.slice(arguments,i.length));for(i.splice(0,i.length),t=0;t)}else if(4===arguments.length)for(e=i.slice(arguments,arguments),n=arguments,r=function(t,e){return n.compare(t,e)},e.sort®,o=i.slice(0,arguments).concat(e,i.slice(arguments,i.length)),i.splice(0,i.length),t=0;t)},yc.asList=function(t){for(var e=new nc,n=0,r=t.length;n);return e};var _c=function(){},mc={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};mc.P.get=function(){return 0},mc.L.get=function(){return 1},mc.A.get=function(){return 2},mc.FALSE.get=function(){return-1},mc.TRUE.get=function(){return-2},mc.DONTCARE.get=function(){return-3},mc.SYM_FALSE.get=function(){return“F”},mc.SYM_TRUE.get=function(){return“T”},mc.SYM_DONTCARE.get=function(){return“*”},mc.SYM_P.get=function(){return“0”},mc.SYM_L.get=function(){return“1”},mc.SYM_A.get=function(){return“2”},c.prototype.interfaces=function(){return[]},_c.prototype.getClass=function(){return _c},_c.toDimensionSymbol=function(t){switch(t){case _c.FALSE:return _c.SYM_FALSE;case _c.TRUE:return _c.SYM_TRUE;case _c.DONTCARE:return _c.SYM_DONTCARE;case _c.P:return _c.SYM_P;case _c.L:return _c.SYM_L;case _c.A:return _c.SYM_A}throw new Za(“Unknown dimension value: ”+t)},_c.toDimensionValue=function(t){switch(fu.toUpperCase(t)){case _c.SYM_FALSE:return _c.FALSE;case _c.SYM_TRUE:return _c.TRUE;case _c.SYM_DONTCARE:return _c.DONTCARE;case _c.SYM_P:return _c.P;case _c.SYM_L:return _c.L;case _c.SYM_A:return _c.A}throw new Za(“Unknown dimension symbol: ”+t)},Object.defineProperties(_c,mc);var vc=function(){};vc.prototype.filter=function(t){},vc.prototype.interfaces_=function(){return[]},vc.prototype.getClass=function(){return vc};var xc=function(){};xc.prototype.filter=function(t,e){},xc.prototype.isDone=function(){},xc.prototype.isGeometryChanged=function(){},xc.prototype.interfaces_=function(){return[]},xc.prototype.getClass=function(){return xc};var Ec=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new Za(“geometries must not contain null elements”)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new Iu,e=0;e.getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries.getCoordinates(),i=0;i=r;return t},e.prototype.getArea=function(){for(var t=0,e=0;e.getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments,n=arguments;if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i