/* 2020-9-22 15:23:20 | 版权所有 军懋国兴 */ function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.turf={})}(this,function(t){"use strict";var p=6371008.8,r={meters:p,metres:p,millimeters:1e3*p,millimetres:1e3*p,centimeters:100*p,centimetres:100*p,kilometers:p/1e3,kilometres:p/1e3,miles:p/1609.344,nauticalmiles:p/1852,inches:39.37*p,yards:p/1.0936,feet:3.28084*p,radians:1,degrees:p/111325},e={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/p,degrees:1/111325},o={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006};function j(t,e,n){if(!H(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&&w(r),i&&b(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(!H(n=n||{}))throw new Error("options is invalid");var r,i=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(i&&w(i),t){case"Point":r=X(e).geometry;break;case"LineString":r=U(e).geometry;break;case"Polygon":r=G(e).geometry;break;case"MultiPoint":r=u(e).geometry;break;case"MultiLineString":r=v(e).geometry;break;case"MultiPolygon":r=x(e).geometry;break;default:throw new Error(t+" is invalid")}return i&&(r.bbox=i),r}function X(t,e,n){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(!V(t[0])||!V(t[1]))throw new Error("coordinates must contain numbers");return j({type:"Point",coordinates:t},e,n)}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 Y(t.map(function(t){return X(t,e)}),n)}function G(t,e,n){if(!t)throw new Error("coordinates is required");for(var r=0;rt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=t.minX&&e.maxY>=t.minY}function It(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Nt(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(function t(e,n,r,i,o){for(r=r||0,i=i||e.length-1,o=o||pt;rthis._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=It(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,dt(n,this.toBBox),dt(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=It([t,e]),this.data.height=t.height+1,this.data.leaf=!1,dt(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){for(var r,i,o,s,a,u,h,c,l,p,f,g,d=a=1/0,y=e;y<=n-e;y++)h=r=yt(t,0,y,this.toBBox),c=i=yt(t,y,n,this.toBBox),l=Math.max(h.minX,c.minX),p=Math.max(h.minY,c.minY),f=Math.min(h.maxX,c.maxX),g=Math.min(h.maxY,c.maxY),o=Math.max(0,f-l)*Math.max(0,g-p),s=xt(r)+xt(i),o>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function p(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n>1)-1;0<=n;n--)this._down(n)}function qt(t,e){return t>1,o=e[i];if(0<=n(r,o))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];tr[0]&&(r=s),s[1]i[1]&&(i=s)}for(var a=[e,n,r,i],u=a.slice(),o=0;o=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function Xt(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),h=Math.max(t[0],e[0]),c=Math.max(t[1],e[1]),l=n.search({minX:a,minY:u,maxX:h,maxY:c}),p=0;p=i[0]&&a[3]>=i[1]))return!1;"Polygon"===s&&(o=[o]);for(var u=0,h=!1;ut[1]!=h>t[1]&&t[0]<(u-s)*(t[1]-a)/(h-a)+s&&(r=!r)}return r}function Qt(t,e){var n=[];return R(e,function(e){L(t,function(t){Zt(t,e)&&n.push(t)})}),Y(n)}function $t(t,n){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var o=!1;return Y(function(t){if(t.length<3)return[];t.sort(ee);for(var e,n,r,i,o,s,a=t[x=t.length-1].x,u=t[0].x,h=t[x].y,c=h;x--;)t[x].yc&&(c=t[x].y);for(var l,p=u-a,f=c-h,g=f_[l].r?(m.push(_[l]),_.splice(l,1)):p*p+(f=t[x].y-_[l].y)*f>_[l].r||(v.push(_[l].a,_[l].b,_[l].b,_[l].c,_[l].c,_[l].a),_.splice(l,1));for(function(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],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}(v),l=v.length;l;)n=v[--l],e=v[--l],r=t[x],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),1e-12=o)throw new Error("full hashmap");r=h[n=n+1&l]}return h[n]=t,c[n]=e},maybeSet:function(t,e){for(var n=s(t)&l,r=h[n],i=0;r!=u;){if(a(r,t))return c[n];if(++i>=o)throw new Error("full hashmap");r=h[n=n+1&l]}return h[n]=t,c[n]=e},get:function(t,e){for(var n=s(t)&l,r=h[n],i=0;r!=u;){if(a(r,t))return c[n];if(++i>=o)break;r=h[n=n+1&l]}return e},keys:function(){for(var t=[],e=0,n=h.length;e>7^ye[2]^ye[3])}var ge=new ArrayBuffer(16),de=new Float64Array(ge),ye=new Uint32Array(ge);function _e(t,e,n){for(var r,i=e+(n---e>>1);e=i)throw new Error("full hashset");n=u[e=e+1&h]}return u[e]=t,!0},has:function(t){for(var e=o(t)&h,n=u[e],r=0;n!=a;){if(s(n,t))return!0;if(++r>=i)break;n=u[e=e+1&h]}return!1},values:function(){for(var t=[],e=0,n=u.length;es&&(i=n[0],n[0]=n[o],n[o]=i,s=r);return n})}}.apply(this,arguments))}(i,i.objects.geoms.geometries)}(n,t);default:throw new Error(r+" is not supported")}}function Ne(t,e){var n="object"==_typeof(e)?e.mutate:e;if(!t)throw new Error("geojson is required");var r=rt(t),i=[];switch(r){case"LineString":i=Ce(t);break;case"MultiLineString":case"Polygon":Z(t).forEach(function(t){i.push(Ce(t))});break;case"MultiPolygon":Z(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(Ce(t))}),i.push(e)});break;case"Point":return t;case"MultiPoint":var o={};Z(t).forEach(function(t){var e=t.join("-");o.hasOwnProperty(e)||(i.push(t),o[e]=!0)});break;default:throw new Error(r+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=i,t):{type:r,coordinates:i}:!0===n?(t.geometry.coordinates=i,t):j({type:r,coordinates:i},t.properties,t.bbox,t.id)}function Ce(t){var e,n,r,i,o,s=Z(t);if(2===s.length&&(e=s[0],n=s[1],e[0]!==n[0]||e[1]!==n[1]))return s;var a=[],u=s.length-1;a.push(s[0]);for(var h,c,l,p,f,g,d,y,_,m,v,x=1;x=Math.abs(v)?0this.duration&&(e=this.duration-1);var n=e/this.duration;if(1<=n)return this.points[this.length-1];var r,i=Math.floor((this.points.length-1)*n),o=(this.length-1)*n-i,s=this.points[i],a=this.controls[i][1],u=this.controls[i+1][0],h=this.points[i+1],c=[(r=o*o)*o,3*r*(1-o),3*o*(1-o)*(1-o),(1-o)*(1-o)*(1-o)];return{x:h.x*c[0]+u.x*c[1]+a.x*c[2]+s.x*c[3],y:h.y*c[0]+u.y*c[1]+a.y*c[2]+s.y*c[3],z:h.z*c[0]+u.z*c[1]+a.z*c[2]+s.z*c[3]}};var je=Ue,Xe=Ue;function Ue(t,e,n){n=n||2;var r,i,o,s,a,u,h,c=e&&e.length,l=c?e[0]*n:t.length,p=Ye(t,0,l,n,!0),f=[];if(!p)return f;if(c&&(p=function(t,e,n,r){for(var i,o=[],s=0,a=e.length;s=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&&s=r.x&&r.x>=c&&i!==r.x&&Ze(on.x)&&tn(r,t)&&(n=r,p=u),r=r.next;return n}(t,e))&&Ve(n=en(e,t),n.next)}})(o[s],n),n=Ve(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.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,c=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=Je(a,u,e,n,r),p=Je(h,c,e,n,r),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ze(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=Ke(f.prev,f,f.next))return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&Ze(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=Ke(f.prev,f,f.next))return!1;f=f.prevZ}return!0}(t,r,i,o):function(t){var e=t.prev,n=t,r=t.next;if(0<=Ke(e,n,r))return!1;for(var i=t.next.next;i!==t.prev;){if(Ze(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=Ke(i.prev,i,i.next))return!1;i=i.next}return!0}(t))e.push(a.i/n),e.push(t.i/n),e.push(u.i/n),rn(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?He(t=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Qe(i,o)&&$e(i,r,r.next,o)&&tn(i,o)&&tn(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),rn(r),rn(r.next),r=t=o),r=r.next}while(r!==t);return r}(t,e,n),e,n,r,i,o,2):2===s&&function(t,e,n,r,i,o){var s,a,u=t;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&(a=h,(s=u).next.i!==a.i&&s.prev.i!==a.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&&$e(n,n.next,t,e))return 1;n=n.next}while(n!==t)}(s,a)&&tn(s,a)&&tn(a,s)&&function(t){for(var e=t,n=!1,r=(t.x+a.x)/2,i=(t.y+a.y)/2;e.y>i!=e.next.y>i&&e.next.y!==e.y&&r<(e.next.x-e.x)*(i-e.y)/(e.next.y-e.y)+e.x&&(n=!n),(e=e.next)!==t;);return n}(s))){var c=en(u,h);return u=Ve(u,u.next),c=Ve(c,c.next),He(u,e,n,r,i,o),He(c,e,n,r,i,o)}h=h.next}u=u.next}while(u!==t)}(t,e,n,r,i,o):He(Ve(t),e,n,r,i,o,1);break}}}function We(t,e){return t.x-e.x}function Je(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 Ze(t,e,n,r,i,o,s,a){return 0<=(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)}function Ke(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Qe(t,e){return t.x===e.x&&t.y===e.y}function $e(t,e,n,r){return Qe(t,e)&&Qe(n,r)||Qe(t,r)&&Qe(n,e)||0=t.minX&&e.maxY>=t.minY}function En(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function wn(t,e,n,r,i){for(var o,s,a,u,h=[e,n];h.length;)(n=h.pop())-(e=h.pop())<=r||(s=t,a=o=e+Math.ceil((n-e)/r/2)*r,u=i,function t(e,n,r,i,o){for(;rt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],u=r[0][0],h=r[0][1],c=r[1][0],l=r[1][1],p=(l-h)*(s-i)-(c-u)*(a-o);if(0==p)return null;var f=((c-u)*(o-h)-(l-h)*(i-u))/p,g=((s-i)*(o-h)-(a-o)*(i-u))/p;return 0<=f&&f<=1&&0<=g&&g<=1?X([i+f*(s-i),o+f*(a-o)]):null}function Ln(t,p,f){if(!H(f=f||{}))throw new Error("options is invalid");var e=t.geometry?t.geometry.type:t.type;if("LineString"!==e&&"MultiLineString"!==e)throw new Error("lines must be LineString or MultiLineString");var g=X([1/0,1/0],{dist:1/0}),d=0;return A(t,function(t){for(var e=Z(t),n=0;nMath.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(y(Math.atan2(i,o))+360)%360}function Rn(t,e,n){if(!H(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=J(t),o=J(e);return o[0]+=180Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),h=1e-11r&&(i[0]=r),i[0]<-r&&(i[0]=-r),i[1]>r&&(i[1]=r),i[1]<-r&&(i[1]=-r),i}function qn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}Ue.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(sn(t,0,o,n));if(i)for(var a=0,u=e.length;athis._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=En(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,pn(n,this.toBBox),pn(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=En([t,e]),this.data.height=t.height+1,this.data.leaf=!1,pn(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){for(var r,i,o,s,a,u,h,c,l,p,f,g,d=a=1/0,y=e;y<=n-e;y++)h=r=fn(t,0,y,this.toBBox),c=i=fn(t,y,n,this.toBBox),l=Math.max(h.minX,c.minX),p=Math.max(h.minY,c.minY),f=Math.min(h.maxX,c.maxX),g=Math.min(h.maxY,c.maxY),o=Math.max(0,f-l)*Math.max(0,g-p),s=_n(r)+_n(i),o=Math.abs(d)?0=Math.abs(d)?0=Math.abs(d)?0=Math.abs(d)?0e[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 N(t,function(t){!function(t,e){t.length>r&&t.splice(r,t.length);for(var n=0;np){var E,w,b,I,N=parseFloat(n[v-1][0]),C=parseFloat(n[v-1][1]),S=parseFloat(n[v][0]),M=parseFloat(n[v][1]);if(-180c&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}Nc?180:-180,I]),(m=[]).push([n[v-1][0]>c?-180:180,I])):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;Pe[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Mr(t,e){for(var n=[],r=0;rMath.PI/2&&(u=0 "+this.to.id+" }"},Zi.prototype.toLineString=function(){return U([this.from.coordinates,this.to.coordinates])},Zi.prototype.compareTo=function(t){return Hi(t.from.coordinates,t.to.coordinates,this.to.coordinates)};function Ki(){this.edges=[],this.polygon=void 0,this.envelope=void 0}var Qi={length:{configurable:!0}};Ki.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Ki.prototype.get=function(t){return this.edges[t]},Qi.length.get=function(){return this.edges.length},Ki.prototype.forEach=function(t){this.edges.forEach(t)},Ki.prototype.map=function(t){return this.edges.map(t)},Ki.prototype.some=function(t){return this.edges.some(t)},Ki.prototype.isValid=function(){return!0},Ki.prototype.isHole=function(){var r=this,t=this.edges.reduce(function(t,e,n){return e.from.coordinates[1]>r.edges[t].from.coordinates[1]&&(t=n),t},0),e=(0===t?this.length:t)-1,n=(t+1)%this.length,i=Hi(this.edges[e].from.coordinates,this.edges[t].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[e].from.coordinates[0]>this.edges[n].from.coordinates[0]:0=Math.abs(u)?0e[0]||t[2]e[1]||t[3]=Math.abs(a)?0=Math.abs(a)?0=this.minPts&&(e=this._mergeArrays(e,r))),1!==this._assigned[i]&&this._addToCluster(i,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;n=this.minPts)return n},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=i)return}else u=[d,n];o=[d,i]}else{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]us||Math.abs(i[0][1]-i[1][1])>us)||delete as[o]}(o=+e[0][0],s=+e[0][1],a=+e[1][0],u=+e[1][1]),function(t,e,n,r){var i,o,s,a,u,h,c,l,p,f,g,d,y=os.length,_=!0;for(C=0;Cus||Math.abs(g-l)>us)&&(a.splice(s,0,as.push(Uo(o,p,Math.abs(f-t)=n)return null;for(var r=s-u.site[0],i=a-u.site[1],l=r*r+i*i;u=h.cells[e=c],c=null,u.halfedges.forEach(function(t){var e,n,r,i=h.edges[t],o=i.left;!(o!==u.site&&o||(o=i.right))||(r=(e=s-o[0])*e+(n=a-o[1])*n)t.x?1:this.yt.y?1:0},Bs.prototype.clone=function(){},Bs.prototype.copy=function(){return new Bs(this)},Bs.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Bs.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)},Bs.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},Bs.prototype.hashCode=function(){return 37*(629+Bs.hashCode(this.x))+Bs.hashCode(this.y)},Bs.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},Bs.prototype.interfaces_=function(){return[Ds,Fs,Gs]},Bs.prototype.getClass=function(){return Bs},Bs.hashCode=function(){if(1===arguments.length){var t=Ts.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},ks.DimensionalComparator.get=function(){return zs},ks.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},ks.NULL_ORDINATE.get=function(){return Ts.NaN},ks.X.get=function(){return 0},ks.Y.get=function(){return 1},ks.Z.get=function(){return 2},Object.defineProperties(Bs,ks);var zs=function(t){if(this._dimensionsToTest=2,0!==arguments.length&&1===arguments.length){if(2!==t&&3!==t)throw new Rs;this._dimensionsToTest=t}};zs.prototype.compare=function(t,e){var n=t,r=e,i=zs.compare(n.x,r.x);if(0!==i)return i;var o=zs.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:zs.compare(n.z,r.z)},zs.prototype.interfaces_=function(){return[qs]},zs.prototype.getClass=function(){return zs},zs.compare=function(t,e){return tt?1:0},Js.isNaN=function(t){return Number.isNaN(t)};function Zs(){}Zs.isWhitespace=function(t){return t<=32&&0<=t||127===t},Zs.toUpperCase=function(t){return t.toUpperCase()};function Ks(){var t,e,n,r;this._hi=0,(this._lo=0)===arguments.length?this.init(0):1===arguments.length?"number"==typeof arguments[0]?(t=arguments[0],this.init(t)):arguments[0]instanceof Ks?(e=arguments[0],this.init(e)):"string"==typeof arguments[0]&&Ks.call(this,Ks.parse(arguments[0])):2===arguments.length&&(n=arguments[0],r=arguments[1],this.init(n,r))}var Qs={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}};Ks.prototype.le=function(t){return(this._hi=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},Ks.prototype.sqr=function(){return this.multiply(this)},Ks.prototype.doubleValue=function(){return this._hi+this._lo},Ks.prototype.subtract=function(){if(arguments[0]instanceof Ks){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Ks.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Ks.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Ks.prototype.selfSubtract=function(){if(arguments[0]instanceof Ks){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)}},Ks.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Ks.prototype.min=function(t){return this.le(t)?this:t},Ks.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Ks){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,r,i,o,s=arguments[0],a=arguments[1],u=null,h=null,c=this._hi/s,l=(u=(o=Ks.SPLIT*c)-(o-c))*(h=(l=Ks.SPLIT*s)-(l-s))-(i=c*s)+u*(r=s-h)+(n=c-u)*h+n*r;return l=c+(o=(this._hi-i-l+this._lo-c*a)/s),this._hi=l,this._lo=c-l+o,this}},Ks.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Ks.prototype.divide=function(){if(arguments[0]instanceof Ks){var t,e,n,r=arguments[0],i=null,o=null,s=(e=this._hi/r._hi)-(i=(u=Ks.SPLIT*e)-(u-e)),a=i*(o=(a=Ks.SPLIT*r._hi)-(a-r._hi))-(n=e*r._hi)+i*(t=r._hi-o)+s*o+s*t,u=(this._hi-n-a+this._lo-e*r._lo)/r._hi;return new Ks(a=e+u,e-a+u)}if("number"==typeof arguments[0]){var h=arguments[0];return Ts.isNaN(h)?Ks.createNaN():Ks.copy(this).selfDivide(h,0)}},Ks.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Ks.prototype.pow=function(t){if(0===t)return Ks.valueOf(1);var e=new Ks(this),n=Ks.valueOf(1),r=Math.abs(t);if(1t._hi?1:this._lot._lo?1:0},Ks.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Ks.prototype.setValue=function(){if(arguments[0]instanceof Ks){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Ks.prototype.max=function(t){return this.ge(t)?this:t},Ks.prototype.sqrt=function(){if(this.isZero())return Ks.valueOf(0);if(this.isNegative())return Ks.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Ks.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Ks.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Ks){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,n,r,i,o=arguments[0],s=(n=this._hi+o)-(r=n-this._hi),a=(i=o-r+(this._hi-s)+this._lo)+(n-(e=n+i));return this._hi=e+a,this._lo=a+(e-this._hi),this}}else if(2===arguments.length){var u,h,c,l=arguments[0],p=arguments[1],f=this._hi+l,g=this._lo+p,d=f-(c=f-this._hi),y=g-(h=g-this._lo),_=(u=f+(c=l-c+(this._hi-d)+g))+(c=p-h+(this._lo-y)+(c+(f-u))),m=c+(u-_);return this._hi=_,this._lo=m,this}},Ks.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Ks){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,r,i,o,s=arguments[0],a=arguments[1],u=(o=Ks.SPLIT*this._hi)-this._hi,h=Ks.SPLIT*s;u=o-u,n=this._hi-u,i=h-s;var c=(o=this._hi*s)+(h=u*(i=h-i)-o+u*(r=s-i)+n*i+n*r+(this._hi*a+this._lo*s)),l=h+(o-c);return this._hi=c,this._lo=l,this}},Ks.prototype.selfSqr=function(){return this.selfMultiply(this)},Ks.prototype.floor=function(){if(this.isNaN())return Ks.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Ks(t,e)},Ks.prototype.negate=function(){return this.isNaN()?this:new Ks(-this._hi,-this._lo)},Ks.prototype.clone=function(){},Ks.prototype.multiply=function(){if(arguments[0]instanceof Ks){var t=arguments[0];return t.isNaN()?Ks.createNaN():Ks.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Ts.isNaN(e)?Ks.createNaN():Ks.copy(this).selfMultiply(e,0)}},Ks.prototype.isNaN=function(){return Ts.isNaN(this._hi)},Ks.prototype.intValue=function(){return Math.trunc(this._hi)},Ks.prototype.toString=function(){var t=Ks.magnitude(this._hi);return-3<=t&&t<=20?this.toStandardNotation():this.toSciNotation()},Ks.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e,n=new Array(1).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,o=r;return"."===r.charAt(0)?o="0"+r:i<0?o="0."+Ks.stringOfChar("0",-i)+r:-1===r.indexOf(".")&&(e=i-r.length,o=r+Ks.stringOfChar("0",e)+".0"),this.isNegative()?"-"+o:o},Ks.prototype.reciprocal=function(){var t,e,n,r,i,o=null,s=(e=1/this._hi)-(o=(r=Ks.SPLIT*e)-(r-e)),a=(i=Ks.SPLIT*this._hi)-this._hi,u=e+(r=(1-(n=e*this._hi)-(o*(a=i-a)-n+o*(t=this._hi-a)+s*a+s*t)-e*this._lo)/this._hi);return new Ks(u,e-u+r)},Ks.prototype.toSciNotation=function(){if(this.isZero())return Ks.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=Ks.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";1t._hi||this._hi===t._hi)&&this._lo>t._lo},Ks.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Ks.prototype.trunc=function(){return this.isNaN()?Ks.NaN:this.isPositive()?this.floor():this.ceil()},Ks.prototype.signum=function(){return 0t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},ha.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof ha){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=r._maxx),r._minythis._maxy&&(this._maxy=r._maxy))}}else 2===arguments.length&&(t=arguments[0],e=arguments[1],this.isNull()?(this._minx=t,this._maxx=t,this._miny=e,this._maxy=e):(tthis._maxx&&(this._maxx=t),ethis._maxy&&(this._maxy=e)))},ha.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},ha.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ha.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ha.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ha.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ha.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return ethis._maxx||this._miny>this._maxy)&&this.setToNull()}},ha.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof ha){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Bs){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},ha.prototype.centre=function(){return this.isNull()?null:new Bs((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ha.prototype.init=function(){var t,e,n,r,i,o,s,a;0===arguments.length?this.setToNull():1===arguments.length?arguments[0]instanceof Bs?(t=arguments[0],this.init(t.x,t.x,t.y,t.y)):arguments[0]instanceof ha&&(e=arguments[0],this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy):2===arguments.length?(n=arguments[0],r=arguments[1],this.init(n.x,r.x,n.y,r.y)):4===arguments.length&&(i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],this._maxx=it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},ha.prototype.hashCode=function(){return 37*(37*(37*(629+Bs.hashCode(this._minx))+Bs.hashCode(this._maxx))+Bs.hashCode(this._miny))+Bs.hashCode(this._maxy)},ha.prototype.interfaces_=function(){return[Ds,Gs]},ha.prototype.getClass=function(){return ha},ha.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),h=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(u=this.size())throw new Ya;return this.array_[t]},iu.prototype.isEmpty=function(){return 0===this.array_.length},iu.prototype.size=function(){return this.array_.length},iu.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=t?e:[]},Za.indexOf=function(t,e){for(var n=0;n=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Za.compare(n,r);return Za.isEqualReversed(n,r)?0:i},su.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Za.increasingDirection(n),o=Za.increasingDirection(r),s=0=this.size())throw new Error;return this.array_[t]},Lh.prototype.push=function(t){return this.array_.push(t),t},Lh.prototype.pop=function(t){if(0===this.array_.length)throw new Mh;return this.array_.pop()},Lh.prototype.peek=function(){if(0===this.array_.length)throw new Mh;return this.array_[this.array_.length-1]},Lh.prototype.empty=function(){return 0===this.array_.length},Lh.prototype.isEmpty=function(){return this.empty()},Lh.prototype.search=function(t){return this.array_.indexOf(t)},Lh.prototype.size=function(){return this.array_.length},Lh.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;ethis._minCoord.y&&n.y>this._minCoord.y&&r===Pa.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ph.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ch.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ph.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ph.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}ya.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ch.LEFT&&(this._orientedDe=this._minDe.getSym())},Ph.prototype.interfaces_=function(){return[]},Ph.prototype.getClass=function(){return Ph};function Oh(){this.array_=[]}var Rh,Th=((Rh=va)&&(Ah.__proto__=Rh),((Ah.prototype=Object.create(Rh&&Rh.prototype)).constructor=Ah).prototype.getCoordinate=function(){return this.pt},Ah.prototype.interfaces_=function(){return[]},Ah.prototype.getClass=function(){return Ah},Ah.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},Ah);function Ah(t,e){Rh.call(this,Ah.msgWithCoord(t,e)),this.pt=e?new Bs(e):null,this.name="TopologyException"}Oh.prototype.addLast=function(t){this.array_.push(t)},Oh.prototype.removeFirst=function(){return this.array_.shift()},Oh.prototype.isEmpty=function(){return 0===this.array_.length};function Dh(){this._finder=null,this._dirEdgeList=new $a,this._nodes=new $a,this._rightMostCoord=null,this._env=null,this._finder=new Ph}Dh.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Dh.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Dh.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Th("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Dh.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ch.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Dh.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Dh.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();1<=e.getDepth(Ch.RIGHT)&&e.getDepth(Ch.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Dh.prototype.computeDepths=function(t){var e=new du,n=new Oh,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s,a=o.next().getSym();a.isVisited()||(s=a.getNode(),e.contains(s)||(n.addLast(s),e.add(s)))}}},Dh.prototype.compareTo=function(t){return this._rightMostCoord.xt._rightMostCoord.x?1:0},Dh.prototype.getEnvelope=function(){if(null===this._env){for(var t=new ha,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length&&((e=new Array(3).fill(null))[Ch.ON]=this.location[Ch.ON],e[Ch.LEFT]=Xs.NONE,e[Ch.RIGHT]=Xs.NONE,this.location=e);for(var n=0;nthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Gh.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=n.x?r.y>=n.y?Zh.NE:Zh.SE:r.y>=n.y?Zh.NW:Zh.SW}},Kh.NE.get=function(){return 0},Kh.NW.get=function(){return 1},Kh.SW.get=function(){return 2},Kh.SE.get=function(){return 3},Object.defineProperties(Zh,Kh);function Qh(t,e,n,r){var i,o,s,a,u;this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length?this._edge=t:3===arguments.length?(i=e,o=n,this._edge=t,this.init(i,o),this._label=null):4===arguments.length&&(s=e,a=n,u=r,this._edge=t,this.init(s,a),this._label=u)}Qh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrantfc.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,t,e):this.expand(this._boundable2,this._boundable1,t,e),null;if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new Rs},fc.prototype.isLeaves=function(){return!(fc.isComposite(this._boundable1)||fc.isComposite(this._boundable2))},fc.prototype.compareTo=function(t){return this._distancet._distance?1:0},fc.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new fc(o,e,this._itemDistance);s.getDistance()>32),n=Ts.doubleToLongBits(this.p1.x);return n^=31*Ts.doubleToLongBits(this.p1.y),e^(Math.trunc(n)^Math.trunc(n>>32))},Lc.prototype.interfaces_=function(){return[Ds,Gs]},Lc.prototype.getClass=function(){return Lc},Lc.midPoint=function(t,e){return new Bs((t.x+e.x)/2,(t.y+e.y)/2)},Pc.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Lc,Pc);function Oc(){this.tempEnv1=new ha,this.tempEnv2=new ha,this._overlapSeg1=new Lc,this._overlapSeg2=new Lc}Oc.prototype.overlap=function(){var t,e,n;2===arguments.length||4===arguments.length&&(t=arguments[1],e=arguments[2],n=arguments[3],arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2))},Oc.prototype.interfaces_=function(){return[]},Oc.prototype.getClass=function(){return Oc};function Rc(t,e,n,r){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var i=e,o=n,s=r;this._pts=t,this._start=i,this._end=o,this._context=s}Rc.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Rc.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=Zh.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return Bc},Object.defineProperties(t,n),t}(Dc),Bc=((qc=Oc)&&(zc.__proto__=qc),((zc.prototype=Object.create(qc&&qc.prototype)).constructor=zc).prototype.overlap=function(){if(4!==arguments.length)return qc.prototype.overlap.apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),i=e.getContext();this._si.processIntersections(r,t,i,n)},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc},zc),kc={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};function zc(){qc.call(this),this._si=null;var t=arguments[0];this._si=t}Fc.prototype.getEndCapStyle=function(){return this._endCapStyle},Fc.prototype.isSingleSided=function(){return this._isSingleSided},Fc.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Fc.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Fc.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Fc.JOIN_ROUND&&(this._quadrantSegments=Fc.DEFAULT_QUADRANT_SEGMENTS)},Fc.prototype.getJoinStyle=function(){return this._joinStyle},Fc.prototype.setJoinStyle=function(t){this._joinStyle=t},Fc.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Fc.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Fc.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Fc.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Fc.prototype.getMitreLimit=function(){return this._mitreLimit},Fc.prototype.setMitreLimit=function(t){this._mitreLimit=t},Fc.prototype.setSingleSided=function(t){this._isSingleSided=t},Fc.prototype.interfaces_=function(){return[]},Fc.prototype.getClass=function(){return Fc},Fc.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},kc.CAP_ROUND.get=function(){return 1},kc.CAP_FLAT.get=function(){return 2},kc.CAP_SQUARE.get=function(){return 3},kc.JOIN_ROUND.get=function(){return 1},kc.JOIN_MITRE.get=function(){return 2},kc.JOIN_BEVEL.get=function(){return 3},kc.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},kc.DEFAULT_MITRE_LIMIT.get=function(){return 5},kc.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Fc,kc);function jc(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Pa.COUNTERCLOCKWISE,this._inputLine=t||null}var Xc={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};jc.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},jc.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;nMath.PI;)t-=Vc.PI_TIMES_2;for(;t<=-Math.PI;)t+=Vc.PI_TIMES_2;return t},Vc.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Vc.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return 0Math.PI&&(n=2*Math.PI-n),n},Vc.toRadians=function(t){return t*Math.PI/180},Vc.getTurn=function(t,e){var n=Math.sin(e-t);return 0Math.PI?i-Vc.PI_TIMES_2:i},Hc.PI_TIMES_2.get=function(){return 2*Math.PI},Hc.PI_OVER_2.get=function(){return Math.PI/2},Hc.PI_OVER_4.get=function(){return Math.PI/4},Hc.COUNTERCLOCKWISE.get=function(){return Pa.COUNTERCLOCKWISE},Hc.CLOCKWISE.get=function(){return Pa.CLOCKWISE},Hc.NONE.get=function(){return Pa.COLLINEAR},Object.defineProperties(Vc,Hc);function Wc(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Lc,this._seg1=new Lc,this._offset0=new Lc,this._offset1=new Lc,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Sa,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),8<=e.getQuadrantSegments()&&e.getJoinStyle()===Fc.JOIN_ROUND&&(this._closingSegLengthFactor=Wc.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}var Jc={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Wc.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=Pa.computeOrientation(this._s0,this._s1,this._s2),r=n===Pa.CLOCKWISE&&this._side===Ch.LEFT||n===Pa.COUNTERCLOCKWISE&&this._side===Ch.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Wc.prototype.addLineEndCap=function(t,e){var n=new Lc(t,e),r=new Lc;this.computeOffsetSegment(n,Ch.LEFT,this._distance,r);var i=new Lc;this.computeOffsetSegment(n,Ch.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Fc.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,Pa.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Fc.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Fc.CAP_SQUARE:var u=new Bs;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var h=new Bs(r.p1.x+u.x,r.p1.y+u.y),c=new Bs(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(h),this._segList.addPt(c)}},Wc.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Wc.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=ua.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof sa))throw t;o=new Bs(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Wc.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,h=n.y-t.y,c=Math.atan2(h,u);r===Pa.CLOCKWISE?a<=c&&(a+=2*Math.PI):c<=a&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},Wc.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)a.getMaxY()||n.findStabbedSegments(r,s.getDirectedEdges(),i)}return i}if(3===arguments.length)if(Ys(arguments[2],Ha)&&arguments[0]instanceof Bs&&arguments[1]instanceof ec)for(var u=arguments[0],h=arguments[1],c=arguments[2],l=h.getEdge().getCoordinates(),p=0;pn._seg.p1.y&&n._seg.reverse(),Math.max(n._seg.p0.x,n._seg.p1.x)n._seg.p1.y||Pa.computeOrientation(n._seg.p0,n._seg.p1,u)===Pa.RIGHT||(t=h.getDepth(Ch.LEFT),n._seg.p0.equals(l[p])||(t=h.getDepth(Ch.RIGHT)),e=new $c(n._seg,t),c.add(e))}else if(Ys(arguments[2],Ha)&&arguments[0]instanceof Bs&&Ys(arguments[1],Ha))for(var f=arguments[0],g=arguments[2],d=arguments[1].iterator();d.hasNext();){var y=d.next();y.isForward()&&n.findStabbedSegments(f,y,g)}},Kc.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:pc.min(e)._leftDepth},Kc.prototype.interfaces_=function(){return[]},Kc.prototype.getClass=function(){return Kc},Qc.DepthSegment.get=function(){return $c},Object.defineProperties(Kc,Qc);var $c=function(t,e){this._upwardSeg=null,this._leftDepth=null;var n=e;this._upwardSeg=new Lc(t),this._leftDepth=n};$c.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},$c.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},$c.prototype.toString=function(){return this._upwardSeg.toString()},$c.prototype.interfaces_=function(){return[Ds]},$c.prototype.getClass=function(){return $c};function tl(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}tl.prototype.area=function(){return tl.area(this.p0,this.p1,this.p2)},tl.prototype.signedArea=function(){return tl.signedArea(this.p0,this.p1,this.p2)},tl.prototype.interpolateZ=function(t){if(null===t)throw new Rs;return tl.interpolateZ(t,this.p0,this.p1,this.p2)},tl.prototype.longestSideLength=function(){return tl.longestSideLength(this.p0,this.p1,this.p2)},tl.prototype.isAcute=function(){return tl.isAcute(this.p0,this.p1,this.p2)},tl.prototype.circumcentre=function(){return tl.circumcentre(this.p0,this.p1,this.p2)},tl.prototype.area3D=function(){return tl.area3D(this.p0,this.p1,this.p2)},tl.prototype.centroid=function(){return tl.centroid(this.p0,this.p1,this.p2)},tl.prototype.inCentre=function(){return tl.inCentre(this.p0,this.p1,this.p2)},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl},tl.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},tl.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},tl.det=function(t,e,n,r){return t*r-e*n},tl.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,h=r.y-o,c=s*h-a*u,l=t.x-i,p=t.y-o,f=(h*l-a*p)/c,g=(-u*l+s*p)/c;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},tl.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return s=eh.MINIMUM_VALID_SIZE&&Pa.isCCW(t)&&(o=i,s=r,n=Ch.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},el.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $u?this.addPolygon(t):t instanceof Ju?this.addLineString(t):t instanceof Ku?this.addPoint(t):(t instanceof th||t instanceof Fu||t instanceof nh||t instanceof Du)&&this.addCollection(t)},el.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},el.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new Ja;var t=this._parent.getGeometryN(this._index++);return t instanceof Du?(this._subcollectionIterator=new rl(t),this._subcollectionIterator.next()):t},rl.prototype.remove=function(){throw new Error(this.getClass().getName())},rl.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},rl.prototype.interfaces_=function(){return[Ua]},rl.prototype.getClass=function(){return rl},rl.isAtomic=function(t){return!(t instanceof Du)};function il(t){this._geom=null,this._geom=t}il.prototype.locate=function(t){return il.locate(t,this._geom)},il.prototype.interfaces_=function(){return[nl]},il.prototype.getClass=function(){return il},il.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Pa.isPointInRing(t,e.getCoordinates())},il.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!il.isPointInRing(t,n))return!1;for(var r=0;re&&(r=1),this._depth[t][n]=r}}},xl.prototype.getDelta=function(t){return this._depth[t][Ch.RIGHT]-this._depth[t][Ch.LEFT]},xl.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Xs.EXTERIOR:Xs.INTERIOR},xl.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},xl.prototype.add=function(){var t,e;if(1===arguments.length)for(var n=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var o=n.getLocation(r,i);o!==Xs.EXTERIOR&&o!==Xs.INTERIOR||(this.isNull(r,i)?this._depth[r][i]=xl.depthAtLocation(o):this._depth[r][i]+=xl.depthAtLocation(o))}else 3===arguments.length&&(t=arguments[0],e=arguments[1],arguments[2]===Xs.INTERIOR&&this._depth[t][e]++)},xl.prototype.interfaces_=function(){return[]},xl.prototype.getClass=function(){return xl},xl.depthAtLocation=function(t){return t===Xs.EXTERIOR?0:t===Xs.INTERIOR?1:xl.NULL_VALUE},El.NULL_VALUE.get=function(){return-1},Object.defineProperties(xl,El);function wl(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new fl,this._bufParams=t||null}var bl,Il=((bl=Bh)&&(Nl.__proto__=bl),((Nl.prototype=Object.create(bl&&bl.prototype)).constructor=Nl).prototype.getDepth=function(){return this._depth},Nl.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new Nl(t,qh.toLineLabel(this._label))},Nl.prototype.isIsolated=function(){return this._isIsolated},Nl.prototype.getCoordinates=function(){return this.pts},Nl.prototype.setIsolated=function(t){this._isIsolated=t},Nl.prototype.setName=function(t){this._name=t},Nl.prototype.equals=function(t){if(!(t instanceof Nl))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;or||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return ya.isTrue(!(s&&a),"Found bad envelope test"),a},Ll.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new Bs(this._maxx,this._maxy),this._corner[1]=new Bs(this._minx,this._maxy),this._corner[2]=new Bs(this._minx,this._miny),this._corner[3]=new Bs(this._maxx,this._miny)},Ll.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Ll.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Ll.prototype.getCoordinate=function(){return this._originalPt},Ll.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Ll.prototype.getSafeEnvelope=function(){var t;return null===this._safeEnv&&(t=Ll.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor,this._safeEnv=new ha(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)),this._safeEnv},Ll.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},Ll.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},Ll.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},Ll.prototype.interfaces_=function(){return[]},Ll.prototype.getClass=function(){return Ll},Pl.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(Ll,Pl);function Ol(){this.tempEnv1=new ha,this.selectedSegment=new Lc}Ol.prototype.select=function(){var t;1===arguments.length||2===arguments.length&&(t=arguments[1],arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment))},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol};function Rl(t){this._index=null,this._index=t}var Tl={HotPixelSnapAction:{configurable:!0}};Rl.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new Fl(e,n,r);return this._index.query(i,{interfaces_:function(){return[uc]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},Rl.prototype.interfaces_=function(){return[]},Rl.prototype.getClass=function(){return Rl},Tl.HotPixelSnapAction.get=function(){return Fl},Object.defineProperties(Rl,Tl);function Al(t){this._li=null,this._interiorIntersections=null,this._li=t,this._interiorIntersections=new $a}var Dl,Fl=((Dl=Ol)&&(ql.__proto__=Dl),((ql.prototype=Object.create(Dl&&Dl.prototype)).constructor=ql).prototype.isNodeAdded=function(){return this._isNodeAdded},ql.prototype.select=function(){if(2!==arguments.length)return Dl.prototype.select.apply(this,arguments);var t=arguments[1],e=arguments[0].getContext();if(null!==this._parentEdge&&e===this._parentEdge&&t===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(e,t)},ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql},ql);function ql(){Dl.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}Al.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;uthis._distance&&this.initialize(e,n,r)}},zl.prototype.interfaces_=function(){return[]},zl.prototype.getClass=function(){return zl};function jl(){}jl.prototype.interfaces_=function(){return[]},jl.prototype.getClass=function(){return jl},jl.computeDistance=function(){if(arguments[2]instanceof zl&&arguments[0]instanceof Ju&&arguments[1]instanceof Bs)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new Lc,i=0;ithis._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var l=u.getCoordinates(),p=h.getCoordinates(),f=0;fthis._distance&&this.initialize(e,n,r)}},ep.prototype.interfaces_=function(){return[]},ep.prototype.getClass=function(){return ep};function np(){}np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.computeDistance=function(){if(arguments[2]instanceof ep&&arguments[0]instanceof Ju&&arguments[1]instanceof Bs)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new Lc,i=t.getCoordinates(),o=0;on&&(this._isValid=!1,r=i.getCoordinates(),this._errorLocation=r[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+fa.toLineString(r[0],r[1])+")")},ap.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=ap.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(0=t.size()-2},pp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},pp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},pp.prototype.interfaces_=function(){return[gl]},pp.prototype.getClass=function(){return pp},pp.createAllIntersectionsFinder=function(t){var e=new pp(t);return e.setFindAllIntersections(!0),e},pp.createAnyIntersectionFinder=function(t){return new pp(t)},pp.createIntersectionCounter=function(t){var e=new pp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};function fp(t){this._li=new Sa,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0,this._segStrings=t}fp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},fp.prototype.getIntersections=function(){return this._segInt.getIntersections()},fp.prototype.isValid=function(){return this.execute(),this._isValid},fp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},fp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new pp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Gc;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},fp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Th(this.getErrorMessage(),this._segInt.getInteriorIntersection())},fp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+fa.toLineString(t[0],t[1])+" and "+fa.toLineString(t[2],t[3])},fp.prototype.interfaces_=function(){return[]},fp.prototype.getClass=function(){return fp},fp.computeIntersections=function(t){var e=new fp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};function gp(){this._nv=null;var t=arguments[0];this._nv=new fp(gp.toSegmentStrings(t))}gp.prototype.checkValid=function(){this._nv.checkValid()},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.toSegmentStrings=function(t){for(var e=new $a,n=t.iterator();n.hasNext();){var r=n.next();e.add(new lp(r.getCoordinates(),r))}return e},gp.checkValid=function(t){new gp(t).checkValid()};function dp(t){this._mapOp=t}dp.prototype.map=function(t){for(var e=new $a,n=0;n>52},wp.zeroLowerBits=function(t,e){return t&~((1<t._xValue?1:this._eventTypet._eventType?1:0},Tp.prototype.getInsertEvent=function(){return this._insertEvent},Tp.prototype.isInsert=function(){return this._eventType===Tp.INSERT},Tp.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},Tp.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Tp.prototype.interfaces_=function(){return[Ds]},Tp.prototype.getClass=function(){return Tp},Ap.INSERT.get=function(){return 1},Ap.DELETE.get=function(){return 2},Object.defineProperties(Tp,Ap);function Dp(){}Dp.prototype.interfaces_=function(){return[]},Dp.prototype.getClass=function(){return Dp};function Fp(t,e,n){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var r=e,i=n;this._li=t,this._includeProper=r,this._recordIsolated=i}Fp.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Fp.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Fp.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Fp.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Fp.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Fp.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},Fp.prototype.hasProperIntersection=function(){return this._hasProper},Fp.prototype.hasIntersection=function(){return this._hasIntersection},Fp.prototype.isDone=function(){return this._isDone},Fp.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},Fp.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Fp.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Fp.prototype.interfaces_=function(){return[]},Fp.prototype.getClass=function(){return Fp},Fp.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};function qp(){this._min=Ts.POSITIVE_INFINITY,this._max=Ts.NEGATIVE_INFINITY}var Gp,Bp=((Gp=Dp)&&(zp.__proto__=Gp),((zp.prototype=Object.create(Gp&&Gp.prototype)).constructor=zp).prototype.prepareEvents=function(){pc.sort(this.events);for(var t=0;te||this._max=t.size()?null:t.get(e)},yf.union=function(t){return new yf(t).union()},_f.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(yf,_f);var mf=function(){};function vf(t){switch(t.type){case"Polygon":return 1If?Rf((qf(r)*(a=Af(o))*qf(i)-qf(o)*(s=Af(r))*qf(n))/(s*a*u)):(r+o)/2,l.point(d,g),l.lineEnd(),l.lineStart(),l.point(h,g),p=0),l.point(f=t,g=e),d=h},lineEnd:function(){l.lineEnd(),f=g=NaN},clean:function(){return 2-p}}},function(t,e,n,r){var i,o;null==t?(o=n*Cf,r.point(-Nf,o),r.point(0,o),r.point(Nf,o),r.point(Nf,0),r.point(Nf,-o),r.point(0,-o),r.point(-Nf,-o),r.point(-Nf,0),r.point(-Nf,o)):Of(t[0]-e[0])>If?(o=n*(i=t[0]If;function d(t,e){return Af(t)*Af(e)>C}function y(t,e,n){var r=[1,0,0],i=Kf(Jf(t),Jf(e)),o=Zf(i,i),s=i[0],a=o-s*s;if(!a)return!n&&t;var u=C*o/a,h=-C*s/a,c=Kf(r,i),l=$f(r,u);Qf(l,$f(i,h));var p=c,f=Zf(l,p),g=Zf(p,p),d=f*f-g*(Zf(l,l)-1);if(!(d<0)){var y=Gf(d),_=$f(p,(-f-y)/g);if(Qf(_,l),_=Wf(_),!n)return _;var m,v=t[0],x=e[0],E=t[1],w=e[1];xs;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=Ae,t.square=De,t.circle=qe,t.midpoint=function(t,e){return Fe(t,ne(t,e)/2,Ge(t,e))},t.center=Be,t.centerOfMass=function t(e,n){switch(rt(e)){case"Point":return e;case"Polygon":var r=[];N(e,function(t){r.push(t)});for(var i,o,s,a,u,h,c,l=ke(e,n),p=l.geometry.coordinates,f=0,g=0,d=0,y=r.map(function(t){return[t[0]-p[0],t[1]-p[1]]}),_=0;_l[e.isect].coord?-1:1}),u=[];0 is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof r)throw new Error(" must be a boolean");!1===r&&(t=re(t));var i=[];switch(t.type){case"GeometryCollection":return R(t,function(t){zr(t,n)}),t;case"FeatureCollection":return L(t,function(t){L(zr(t,n),function(t){i.push(t)})}),Y(i)}return zr(t,n)},t.isobands=function(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(tt(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!H(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s=function(t,e){if(!H(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;tt(t,"Point","input must contain Points");for(var o,s,a=(o=r,s={},L(t,function(t){var e=Z(t)[1];s[e]||(s[e]=[]),s[e].push(t)}),Object.keys(s).map(function(t){return s[t].sort(function(t,e){return Z(t)[0]-Z(e)[0]})}).sort(function(t,e){return o?Z(t[0])[1]-Z(e[0])[1]:Z(e[0])[1]-Z(t[0])[1]})),u=[],h=0;ha[a.length-1]?i-=a.length:0!==(e=function(r,t){var i,o;if(!Array.isArray(t))throw new Error("Get closest expects an array as second argument");return t.forEach(function(t,e){var n=t-r;0<=n&&(void 0===o||n