PageSourceSearch

https://pymenton.cl/chunk-BY4QPXOO.js

js pymenton.cl collected 2026-10-04 13:42:54 UTC 560,849 bytes, 29 lines download raw bytes

1import{A as Nd,B as Ld,C as Rd,D as Ad,f as Sl,g as dd,h as fd,i as Ka,j as tc,k as pd,l as md,m as ec,n as ic,q as gd,r as Ed,s as Cd,t as Md,u as Pd,v as Id,w as Sd,x as rc,y as Od,z as kd}from"./chunk-5GHOHGGM.js";import{a as yd}from"./chunk-S2MOHKNM.js";import{a as bd}from"./chunk-6U3IPKLK.js";import{G as nd,L as Za,O as rd,V as od,aa as sd,ba as ad,da as cd,ea as ld,fa as Il,ja as oa,sa as ud,ta as hd}from"./chunk-LVCOYB5A.js";import{b as wd}from"./chunk-YE56YD3K.js";import{a as vd}from"./chunk-PIX57KUU.js";import{b as xd}from"./chunk-2QOMRJZD.js";import{$ as lo,$b as Ja,A as os,Ba as Pt,Bb as Kh,Ca as qi,Cb as ia,Db as na,Ea as El,Fa as Jh,Fb as ra,Ga as Cl,Gb as Wa,Ha as Ml,J as Qs,Ja as Wr,Ka as Ie,La as No,Ma as Zs,N as Vh,Na as Ks,Oa as ta,Ob as Qa,Ra as Ji,Sa as as,Sb as td,Tb as ed,V as ss,W as wr,Wa as me,X as ja,Xa as xe,Y as hr,Ya as Je,Z as wl,Za as $a,_a as Ha,_b as us,aa as br,ab as ea,c as Ya,cc as hs,d as $h,ea as Er,eb as Lo,fa as Cr,gb as ve,gc as id,h as pi,kb as cs,lb as Zi,m as ns,mb as Va,n as rs,na as Js,nb as Ro,oa as Wh,qb as Zh,r as Hh,rb as ls,sb as Mr,ta as Qh,tb as Pl,wc as _d,xa as bl,yc as nc}from"./chunk-CGGBRR6Y.js";import{a as ko,d as rt,e as fi}from"./chunk-CWTPBX7D.js";var oc=rt(($b,qd)=>{"use strict";var Bd=Object.getOwnPropertySymbols,H0=Object.prototype.hasOwnProperty,V0=Object.prototype.propertyIsEnumerable;function W0(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function Q0(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var s={},o=0;o<10;o++)s["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(s).map(function(h){return s[h]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}qd.exports=Q0()?Object.assign:function(r,s){for(var o,c=W0(r),l,h=1;h<arguments.length;h++){o=Object(arguments[h]);for(var f in o)H0.call(o,f)&&(c[f]=o[f]);if(Bd){l=Bd(o);for(var p=0;p<l.length;p++)V0.call(o,l[p])&&(c[l[p]]=o[l[p]])}}return c}});var zd=rt((nE,Gd)=>{Gd.exports=function(s,o,c,l){var h=s[0],f=s[1],p=!1;c===void 0&&(c=0),l===void 0&&(l=o.length);for(var y=(l-c)/2,x=0,S=y-1;x<y;S=x++){var O=o[c+x*2+0],N=o[c+x*2+1],z=o[c+S*2+0],X=o[c+S*2+1],$=N>f!=X>f&&h<(z-O)*(f-N)/(X-N)+O;$&&(p=!p)}return p}});var Xd=rt((rE,Ud)=>{Ud.exports=function(s,o,c,l){var h=s[0],f=s[1],p=!1;c===void 0&&(c=0),l===void 0&&(l=o.length);for(var y=l-c,x=0,S=y-1;x<y;S=x++){var O=o[x+c][0],N=o[x+c][1],z=o[S+c][0],X=o[S+c][1],$=N>f!=X>f&&h<(z-O)*(f-N)/(X-N)+O;$&&(p=!p)}return p}});var $d=rt((oE,cc)=>{var Yd=zd(),jd=Xd();cc.exports=function(s,o,c,l){return o.length>0&&Array.isArray(o[0])?jd(s,o,c,l):Yd(s,o,c,l)};cc.exports.nested=jd;cc.exports.flat=Yd});var Kd=rt((Dl,Fl)=>{(function(r,s){typeof Dl=="object"&&typeof Fl<"u"?Fl.exports=s():typeof define=="function"&&define.amd?define(s):r.quickselect=s()})(Dl,function(){"use strict";function r(l,h,f,p,y){s(l,h,f||0,p||l.length-1,y||c)}function s(l,h,f,p,y){for(;p>f;){if(p-f>600){var x=p-f+1,S=h-f+1,O=Math.log(x),N=.5*Math.exp(2*O/3),z=.5*Math.sqrt(O*N*(x-N)/x)*(S-x/2<0?-1:1),X=Math.max(f,Math.floor(h-S*N/x+z)),$=Math.min(p,Math.floor(h+(x-S)*N/x+z));s(l,h,X,$,y)}var I=l[h],k=f,T=p;for(o(l,f,h),y(l[p],I)>0&&o(l,f,p);k<T;){for(o(l,k,T),k++,T--;y(l[k],I)<0;)k++;for(;y(l[T],I)>0;)T--}y(l[f],I)===0?o(l,f,T):(T++,o(l,T,p)),T<=h&&(f=T+1),h<=T&&(p=T-1)}}function o(l,h,f){var p=l[h];l[h]=l[f],l[f]=p}function c(l,h){return l<h?-1:l>h?1:0}return r})});var zl=rt((dI,Gl)=>{"use strict";Gl.exports=ca;Gl.exports.default=ca;var dy=Kd();function ca(r,s){if(!(this instanceof ca))return new ca(r,s);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),s&&this._initFormat(s),this.clear()}ca.prototype={all:function(){return this._all(this.data,[])},search:function(r){var s=this.data,o=[],c=this.toBBox;if(!hc(r,s))return o;for(var l=[],h,f,p,y;s;){for(h=0,f=s.children.length;h<f;h++)p=s.children[h],y=s.leaf?c(p):p,hc(r,y)&&(s.leaf?o.push(p):ql(r,y)?this._all(p,o):l.push(p));s=l.pop()}return o}
1,collides:function(r){var s=this.data,o=this.toBBox;if(!hc(r,s))return!1;for(var c=[],l,h,f,p;s;){for(l=0,h=s.children.length;l<h;l++)if(f=s.children[l],p=s.leaf?o(f):f,hc(r,p)){if(s.leaf||ql(r,p))return!0;c.push(f)}s=c.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var s=0,o=r.length;s<o;s++)this.insert(r[s]);return this}var c=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=c;else if(this.data.height===c.height)this._splitRoot(this.data,c);else{if(this.data.height<c.height){var l=this.data;this.data=c,c=l}this._insert(c,this.data.height-c.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ps([]),this},remove:function(r,s){if(!r)return this;for(var o=this.data,c=this.toBBox(r),l=[],h=[],f,p,y,x;o||l.length;){if(o||(o=l.pop(),p=l[l.length-1],f=h.pop(),x=!0),o.leaf&&(y=fy(r,o.children,s),y!==-1))return o.children.splice(y,1),l.push(o),this._condense(l),this;!x&&!o.leaf&&ql(o,c)?(l.push(o),h.push(f),f=0,p=o,o=o.children[0]):p?(f++,o=p.children[f],x=!1):o=null}return this},toBBox:function(r){return r},compareMinX:tf,compareMinY:ef,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,s){for(var o=[];r;)r.leaf?s.push.apply(s,r.children):o.push.apply(o,r.children),r=o.pop();return s},_build:function(r,s,o,c){var l=o-s+1,h=this._maxEntries,f;if(l<=h)return f=ps(r.slice(s,o+1)),fs(f,this.toBBox),f;c||(c=Math.ceil(Math.log(l)/Math.log(h)),h=Math.ceil(l/Math.pow(h,c-1))),f=ps([]),f.leaf=!1,f.height=c;var p=Math.ceil(l/h),y=p*Math.ceil(Math.sqrt(h)),x,S,O,N;for(nf(r,s,o,y,this.compareMinX),x=s;x<=o;x+=y)for(O=Math.min(x+y-1,o),nf(r,x,O,p,this.compareMinY),S=x;S<=O;S+=p)N=Math.min(S+p-1,O),f.children.push(this._build(r,S,N,c-1));return fs(f,this.toBBox),f},_chooseSubtree:function(r,s,o,c){for(var l,h,f,p,y,x,S,O;c.push(s),!(s.leaf||c.length-1===o);){for(S=O=1/0,l=0,h=s.children.length;l<h;l++)f=s.children[l],y=Bl(f),x=py(r,f)-y,x<O?(O=x,S=y<S?y:S,p=f):x===O&&y<S&&(S=y,p=f);s=p||s.children[0]}return s},_insert:function(r,s,o){var c=this.toBBox,l=o?r:c(r),h=[],f=this._chooseSubtree(l,this.data,s,h);for(f.children.push(r),aa(f,l);s>=0&&h[s].children.length>this._maxEntries;)this._split(h,s),s--;this._adjustParentBBoxes(l,h,s)},_split:function(r,s){var o=r[s],c=o.children.length,l=this._minEntries;this._chooseSplitAxis(o,l,c);var h=this._chooseSplitIndex(o,l,c),f=ps(o.children.splice(h,o.children.length-h));f.height=o.height,f.leaf=o.leaf,fs(o,this.toBBox),fs(f,this.toBBox),s?r[s-1].children.push(f):this._splitRoot(o,f)},_splitRoot:function(r,s){this.data=ps([r,s]),this.data.height=r.height+1,this.data.leaf=!1,fs(this.data,this.toBBox)},_chooseSplitIndex:function(r,s,o){var c,l,h,f,p,y,x,S;for(y=x=1/0,c=s;c<=o-s;c++)l=sa(r,0,c,this.toBBox),h=sa(r,c,o,this.toBBox),f=my(l,h),p=Bl(l)+Bl(h),f<y?(y=f,S=c,x=p<x?p:x):f===y&&p<x&&(x=p,S=c);return S},_chooseSplitAxis:function(r,s,o){var c=r.leaf?this.compareMinX:tf,l=r.leaf?this.compareMinY:ef,h=this._allDistMargin(r,s,o,c),f=this._allDistMargin(r,s,o,l);h<f&&r.children.sort(c)},_allDistMargin:function(r,s,o,c){r.children.sort(c);var l=this.toBBox,h=sa(r,0,s,l),f=sa(r,o-s,o,l),p=uc(h)+uc(f),y,x;for(y=s;y<o-s;y++)x=r.children[y],aa(h,r.leaf?l(x):x),p+=uc(h);for(y=o-s-1;y>=s;y--)x=r.children[y],aa(f,r.leaf?l(x):x),p+=uc(f);return p},_adjustParentBBoxes:function(r,s,o){for(var c=o;c>=0;c--)aa(s[c],r)},_condense:function(r){for(var s=r.length-1,o;s>=0;s--)r[s].children.length===0?s>0?(o=r[s-1].children,o.splice(o.indexOf(r[s]),1)):this.clear():fs(r[s],this.toBBox)},_initFormat:function(r){var s=["return a"," - b",";"];this.compareMinX=new Function("a","b",s.join(r[0])),this.compareMinY=new Function("a","b",s.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function fy(r,s,o){if(!o)return s.indexOf(r);for(var c=0;c<s.length;c++)if(o(r,s[c]))return c;return-1}function fs(r,s){sa(r,0,r.children.length,s,r)}function sa(r,s,o,c,l){l||(l=ps(null)),l.minX=1/0,l.minY=1/0,l.maxX=-1/0,l.maxY=-1/0;for(var h=s,f;h<o;h++)f=r.children[h],aa(l,r.leaf?c(f):f);return l}function aa(r,s){return r.minX=Math.min(r.minX,s.minX),r.minY=Math.min(r.minY,s.minY),r.maxX=Math.max(r.maxX,s.maxX),r.maxY=Math.max(r.maxY,s.maxY),r}function tf(r,s){return r.minX-s.minX}function ef(r,s){return r.minY-s.minY}function Bl(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function uc(r){return r.maxX-r.minX+(r.maxY-r.minY)}function py(r,s){return(Math.max(s.maxX,r.maxX)-Math.min(s.minX,r.minX))*(Math.max(s.maxY,r.maxY)-Math.min(s.minY,r.minY))}function my(r,s){var o=Math.max(r.minX,s.minX),c=Math.max(r.minY,s.minY),l=Math.min(r.maxX,s.maxX),h=Math.min(r.maxY,s.maxY);return Math.max(0,l-o)*Math.max(0,h-c)}function ql(r,s){return r.minX<=s.minX&&r.minY<=s.minY&&s.maxX<=r.maxX&&s.maxY<=r.maxY}function hc(r,s){return s.minX<=r.maxX&&s.minY<=r.maxY&&s.maxX>=r.minX&&s.maxY>=r.minY}function ps(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function nf(r,s,o,c,l){for(var h=[s,o],f;h.length;)o=h.pop(),s=h.pop(),!(o-s<=c)&&(f=s+Math.ceil((o-s)/c/2)*c,dy(r,f,s,o,l),h.push(s,f,f,o))}});var lf=rt((MS,Hl)=>{"use strict";Hl.exports=mc;Hl.exports.default=mc;function mc(r,s,o){o=o||2;
vendor: 6,113 bytes, line 1
1var c=s&&s.length,l=c?s[0]*o:r.length,h=sf(r,0,l,o,!0),f=[];if(!h||h.next===h.prev)return f;var p,y,x,S,O,N,z;if(c&&(h=My(r,s,h,o)),r.length>80*o){p=x=r[0],y=S=r[1];for(var X=o;X<l;X+=o)O=r[X],N=r[X+1],O<p&&(p=O),N<y&&(y=N),O>x&&(x=O),N>S&&(S=N);z=Math.max(x-p,S-y),z=z!==0?32767/z:0}return ha(h,f,o,p,y,z,0),f}function sf(r,s,o,c,l){var h,f;if(l===$l(r,s,o,c)>0)for(h=s;h<o;h+=c)f=of(h,r[h],r[h+1],f);else for(h=o-c;h>=s;h-=c)f=of(h,r[h],r[h+1],f);return f&&gc(f,f.next)&&(fa(f),f=f.next),f}function Ao(r,s){if(!r)return r;s||(s=r);var o=r,c;do if(c=!1,!o.steiner&&(gc(o,o.next)||ni(o.prev,o,o.next)===0)){if(fa(o),o=s=o.prev,o===o.next)break;c=!0}else o=o.next;while(c||o!==s);return s}function ha(r,s,o,c,l,h,f){if(r){!f&&h&&ky(r,c,l,h);for(var p=r,y,x;r.prev!==r.next;){if(y=r.prev,x=r.next,h?by(r,c,l,h):wy(r)){s.push(y.i/o|0),s.push(r.i/o|0),s.push(x.i/o|0),fa(r),r=x.next,p=x.next;continue}if(r=x,r===p){f?f===1?(r=Ey(Ao(r),s,o),ha(r,s,o,c,l,h,2)):f===2&&Cy(r,s,o,c,l,h):ha(Ao(r),s,o,c,l,h,1);break}}}}function wy(r){var s=r.prev,o=r,c=r.next;if(ni(s,o,c)>=0)return!1;for(var l=s.x,h=o.x,f=c.x,p=s.y,y=o.y,x=c.y,S=l<h?l<f?l:f:h<f?h:f,O=p<y?p<x?p:x:y<x?y:x,N=l>h?l>f?l:f:h>f?h:f,z=p>y?p>x?p:x:y>x?y:x,X=c.next;X!==s;){if(X.x>=S&&X.x<=N&&X.y>=O&&X.y<=z&&ys(l,p,h,y,f,x,X.x,X.y)&&ni(X.prev,X,X.next)>=0)return!1;X=X.next}return!0}function by(r,s,o,c){var l=r.prev,h=r,f=r.next;if(ni(l,h,f)>=0)return!1;for(var p=l.x,y=h.x,x=f.x,S=l.y,O=h.y,N=f.y,z=p<y?p<x?p:x:y<x?y:x,X=S<O?S<N?S:N:O<N?O:N,$=p>y?p>x?p:x:y>x?y:x,I=S>O?S>N?S:N:O>N?O:N,k=Yl(z,X,s,o,c),T=Yl($,I,s,o,c),P=r.prevZ,Y=r.nextZ;P&&P.z>=k&&Y&&Y.z<=T;){if(P.x>=z&&P.x<=$&&P.y>=X&&P.y<=I&&P!==l&&P!==f&&ys(p,S,y,O,x,N,P.x,P.y)&&ni(P.prev,P,P.next)>=0||(P=P.prevZ,Y.x>=z&&Y.x<=$&&Y.y>=X&&Y.y<=I&&Y!==l&&Y!==f&&ys(p,S,y,O,x,N,Y.x,Y.y)&&ni(Y.prev,Y,Y.next)>=0))return!1;Y=Y.nextZ}for(;P&&P.z>=k;){if(P.x>=z&&P.x<=$&&P.y>=X&&P.y<=I&&P!==l&&P!==f&&ys(p,S,y,O,x,N,P.x,P.y)&&ni(P.prev,P,P.next)>=0)return!1;P=P.prevZ}for(;Y&&Y.z<=T;){if(Y.x>=z&&Y.x<=$&&Y.y>=X&&Y.y<=I&&Y!==l&&Y!==f&&ys(p,S,y,O,x,N,Y.x,Y.y)&&ni(Y.prev,Y,Y.next)>=0)return!1;Y=Y.nextZ}return!0}function Ey(r,s,o){var c=r;do{var l=c.prev,h=c.next.next;!gc(l,h)&&af(l,c,c.next,h)&&da(l,h)&&da(h,l)&&(s.push(l.i/o|0),s.push(c.i/o|0),s.push(h.i/o|0),fa(c),fa(c.next),c=r=h),c=c.next}while(c!==r);return Ao(c)}function Cy(r,s,o,c,l,h){var f=r;do{for(var p=f.next.next;p!==f.prev;){if(f.i!==p.i&&Ry(f,p)){var y=cf(f,p);f=Ao(f,f.next),y=Ao(y,y.next),ha(f,s,o,c,l,h,0),ha(y,s,o,c,l,h,0);return}p=p.next}f=f.next}while(f!==r)}function My(r,s,o,c){var l=[],h,f,p,y,x;for(h=0,f=s.length;h<f;h++)p=s[h]*c,y=h<f-1?s[h+1]*c:r.length,x=sf(r,p,y,c,!1),x===x.next&&(x.steiner=!0),l.push(Ly(x));for(l.sort(Py),h=0;h<l.length;h++)o=Iy(l[h],o);return o}function Py(r,s){return r.x-s.x}function Iy(r,s){var o=Sy(r,s);if(!o)return s;var c=cf(o,r);return Ao(c,c.next),Ao(o,o.next)}function Sy(r,s){var o=s,c=r.x,l=r.y,h=-1/0,f;do{if(l<=o.y&&l>=o.next.y&&o.next.y!==o.y){var p=o.x+(l-o.y)*(o.next.x-o.x)/(o.next.y-o.y);if(p<=c&&p>h&&(h=p,f=o.x<o.next.x?o:o.next,p===c))return f}o=o.next}while(o!==s);if(!f)return null;var y=f,x=f.x,S=f.y,O=1/0,N;o=f;do c>=o.x&&o.x>=x&&c!==o.x&&ys(l<S?c:h,l,x,S,l<S?h:c,l,o.x,o.y)&&(N=Math.abs(l-o.y)/(c-o.x),da(o,r)&&(N<O||N===O&&(o.x>f.x||o.x===f.x&&Oy(f,o)))&&(f=o,O=N)),o=o.next;while(o!==y);return f}function Oy(r,s){return ni(r.prev,r,s.prev)<0&&ni(s.next,r,r.next)<0}function ky(r,s,o,c){var l=r;do l.z===0&&(l.z=Yl(l.x,l.y,s,o,c)),l.prevZ=l.prev,l.nextZ=l.next,l=l.next;while(l!==r);l.prevZ.nextZ=null,l.prevZ=null,Ny(l)}function Ny(r){var s,o,c,l,h,f,p,y,x=1;do{for(o=r,r=null,h=null,f=0;o;){for(f++,c=o,p=0,s=0;s<x&&(p++,c=c.nextZ,!!c);s++);for(y=x;p>0||y>0&&c;)p!==0&&(y===0||!c||o.z<=c.z)?(l=o,o=o.nextZ,p--):(l=c,c=c.nextZ,y--),h?h.nextZ=l:r=l,l.prevZ=h,h=l;o=c}h.nextZ=null,x*=2}while(f>1);return r}function Yl(r,s,o,c,l){return r=(r-o)*l|0,s=(s-c)*l|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,r|s<<1}function Ly(r){var s=r,o=r;do(s.x<o.x||s.x===o.x&&s.y<o.y)&&(o=s),s=s.next;while(s!==r);return o}function ys(r,s,o,c,l,h,f,p){return(l-f)*(s-p)>=(r-f)*(h-p)&&(r-f)*(c-p)>=(o-f)*(s-p)&&(o-f)*(h-p)>=(l-f)*(c-p)}function Ry(r,s){return r.next.i!==s.i&&r.prev.i!==s.i&&!Ay(r,s)&&(da(r,s)&&da(s,r)&&Ty(r,s)&&(ni(r.prev,r,s.prev)||ni(r,s.prev,s))||gc(r,s)&&ni(r.prev,r,r.next)>0&&ni(s.prev,s,s.next)>0)}function ni(r,s,o){return(s.y-r.y)*(o.x-s.x)-(s.x-r.x)*(o.y-s.y)}function gc(r,s){return r.x===s.x&&r.y===s.y}function af(r,s,o,c){var l=pc(ni(r,s,o)),h=pc(ni(r,s,c)),f=pc(ni(o,c,r)),p=pc(ni(o,c,s));return!!(l!==h&&f!==p||l===0&&fc(r,o,s)||h===0&&fc(r,c,s)||f===0&&fc(o,r,c)||p===0&&fc(o,s,c))}function fc(r,s,o){return s.x<=Math.max(r.x,o.x)&&s.x>=Math.min(r.x,o.x)&&s.y<=Math.max(r.y,o.y)&&s.y>=Math.min(r.y,o.y)}function pc(r){return r>0?1:r<0?-1:0}function Ay(r,s){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==s.i&&o.next.i!==s.i&&af(o,o.next,r,s))return!0;o=o.next}while(o!==r);return!1}function da(r,s){return ni(r.prev,r,r.next)<0?ni(r,s,r.next)>=0&&ni(r,r.prev,s)>=0:ni(r,s,r.prev)<0||ni(r,r.next,s)<0}function Ty(r,s){var o=r,c=!1,l=(r.x+s.x)/2,h=(r.y+s.y)/2;do o.y>h!=o.next.y>h&&o.next.y!==o.y&&l<(o.next.x-o.x)*(h-o.y)/(o.next.y-o.y)+o.x&&(c=!c),o=o.next;while(o!==r);return c}function cf(r,s){var o=new jl(r.i,r.x,r.y),c=new jl(s.i,s.x,s.y),l=r.next,h=s.prev;return r.next=s,s.prev=r,o.next=l,l.prev=o,c.next=o,o.prev=c,h.next=c,c.prev=h,c}function of(r,s,o,c){var l=new jl(r,s,o);return c?(l.next=c.next,l.prev=c,c.next.prev=l,c.next=l):(l.prev=l,l.next=l),l}function fa(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function jl(r,s,o){this.i=r,this.x=s,this.y=o,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}mc.deviation=function(r,s,o,c){var l=s&&s.length,h=l?s[0]*o:r.length,f=Math.abs($l(r,0,h,o));if(l)for(var p=0,y=s.length;p<y;p++){var x=s[p]*o,S=p<y-1?s[p+1]*o:r.length;f-=Math.abs($l(r,x,S,o))}var O=0;for(p=0;p<c.length;
1p+=3){var N=c[p]*o,z=c[p+1]*o,X=c[p+2]*o;O+=Math.abs((r[N]-r[X])*(r[z+1]-r[N+1])-(r[N]-r[z])*(r[X+1]-r[N+1]))}return f===0&&O===0?0:Math.abs((O-f)/f)};function $l(r,s,o,c){for(var l=0,h=s,f=o-c;h<o;h+=c)l+=(r[f]-r[h])*(r[h+1]+r[f+1]),f=h;return l}mc.flatten=function(r){for(var s=r[0][0].length,o={vertices:[],holes:[],dimensions:s},c=0,l=0;l<r.length;l++){for(var h=0;h<r[l].length;h++)for(var f=0;f<s;f++)o.vertices.push(r[l][h][f]);l>0&&(c+=r[l-1].length,o.holes.push(c))}return o}});var uf=rt((Vl,Wl)=>{(function(r,s){typeof Vl=="object"&&typeof Wl<"u"?Wl.exports=s():typeof define=="function"&&define.amd?define(s):(r=r||self).RBush=s()})(Vl,function(){"use strict";function r(I,k,T,P,Y){(function W(Z,et,E,dt,wt){for(;dt>E;){if(dt-E>600){var yt=dt-E+1,L=et-E+1,Le=Math.log(yt),st=.5*Math.exp(2*Le/3),we=.5*Math.sqrt(Le*st*(yt-st)/yt)*(L-yt/2<0?-1:1),ri=Math.max(E,Math.floor(et-L*st/yt+we)),oi=Math.min(dt,Math.floor(et+(yt-L)*st/yt+we));W(Z,et,ri,oi,wt)}var Me=Z[et],Ze=E,A=dt;for(s(Z,E,et),wt(Z[dt],Me)>0&&s(Z,E,dt);Ze<A;){for(s(Z,Ze,A),Ze++,A--;wt(Z[Ze],Me)<0;)Ze++;for(;wt(Z[A],Me)>0;)A--}wt(Z[E],Me)===0?s(Z,E,A):s(Z,++A,dt),A<=et&&(E=A+1),et<=A&&(dt=A-1)}})(I,k,T||0,P||I.length-1,Y||o)}function s(I,k,T){var P=I[k];I[k]=I[T],I[T]=P}function o(I,k){return I<k?-1:I>k?1:0}var c=function(I){I===void 0&&(I=9),this._maxEntries=Math.max(4,I),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function l(I,k,T){if(!T)return k.indexOf(I);for(var P=0;P<k.length;P++)if(T(I,k[P]))return P;return-1}function h(I,k){f(I,0,I.children.length,k,I)}function f(I,k,T,P,Y){Y||(Y=X(null)),Y.minX=1/0,Y.minY=1/0,Y.maxX=-1/0,Y.maxY=-1/0;for(var W=k;W<T;W++){var Z=I.children[W];p(Y,I.leaf?P(Z):Z)}return Y}function p(I,k){return I.minX=Math.min(I.minX,k.minX),I.minY=Math.min(I.minY,k.minY),I.maxX=Math.max(I.maxX,k.maxX),I.maxY=Math.max(I.maxY,k.maxY),I}function y(I,k){return I.minX-k.minX}function x(I,k){return I.minY-k.minY}function S(I){return(I.maxX-I.minX)*(I.maxY-I.minY)}function O(I){return I.maxX-I.minX+(I.maxY-I.minY)}function N(I,k){return I.minX<=k.minX&&I.minY<=k.minY&&k.maxX<=I.maxX&&k.maxY<=I.maxY}function z(I,k){return k.minX<=I.maxX&&k.minY<=I.maxY&&k.maxX>=I.minX&&k.maxY>=I.minY}function X(I){return{children:I,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function $(I,k,T,P,Y){for(var W=[k,T];W.length;)if(!((T=W.pop())-(k=W.pop())<=P)){var Z=k+Math.ceil((T-k)/P/2)*P;r(I,Z,k,T,Y),W.push(k,Z,Z,T)}}return c.prototype.all=function(){return this._all(this.data,[])},c.prototype.search=function(I){var k=this.data,T=[];if(!z(I,k))return T;for(var P=this.toBBox,Y=[];k;){for(var W=0;W<k.children.length;W++){var Z=k.children[W],et=k.leaf?P(Z):Z;z(I,et)&&(k.leaf?T.push(Z):N(I,et)?this._all(Z,T):Y.push(Z))}k=Y.pop()}return T},c.prototype.collides=function(I){var k=this.data;if(!z(I,k))return!1;for(var T=[];k;){for(var P=0;P<k.children.length;P++){var Y=k.children[P],W=k.leaf?this.toBBox(Y):Y;if(z(I,W)){if(k.leaf||N(I,W))return!0;T.push(Y)}}k=T.pop()}return!1},c.prototype.load=function(I){if(!I||!I.length)return this;if(I.length<this._minEntries){for(var k=0;k<I.length;k++)this.insert(I[k]);return this}var T=this._build(I.slice(),0,I.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var P=this.data;this.data=T,T=P}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},c.prototype.insert=function(I){return I&&this._insert(I,this.data.height-1),this},c.prototype.clear=function(){return this.data=X([]),this},c.prototype.remove=function(I,k){if(!I)return this;for(var T,P,Y,W=this.data,Z=this.toBBox(I),et=[],E=[];W||et.length;){if(W||(W=et.pop(),P=et[et.length-1],T=E.pop(),Y=!0),W.leaf){var dt=l(I,W.children,k);if(dt!==-1)return W.children.splice(dt,1),et.push(W),this._condense(et),this}Y||W.leaf||!N(W,Z)?P?(T++,W=P.children[T],Y=!1):W=null:(et.push(W),E.push(T),T=0,P=W,W=W.children[0])}return this},c.prototype.toBBox=function(I){return I},c.prototype.compareMinX=function(I,k){return I.minX-k.minX},c.prototype.compareMinY=function(I,k){return I.minY-k.minY},c.prototype.toJSON=function(){return this.data},c.prototype.fromJSON=function(I){return this.data=I,this},c.prototype._all=function(I,k){for(var T=[];I;)I.leaf?k.push.apply(k,I.children):T.push.apply(T,I.children),I=T.pop();return k},c.prototype._build=function(I,k,T,P){var Y,W=T-k+1,Z=this._maxEntries;if(W<=Z)return h(Y=X(I.slice(k,T+1)),this.toBBox),Y;P||(P=Math.ceil(Math.log(W)/Math.log(Z)),Z=Math.ceil(W/Math.pow(Z,P-1))),(Y=X([])).leaf=!1,Y.height=P;
vendor: 16,285 bytes, line 1
1var et=Math.ceil(W/Z),E=et*Math.ceil(Math.sqrt(Z));$(I,k,T,E,this.compareMinX);for(var dt=k;dt<=T;dt+=E){var wt=Math.min(dt+E-1,T);$(I,dt,wt,et,this.compareMinY);for(var yt=dt;yt<=wt;yt+=et){var L=Math.min(yt+et-1,wt);Y.children.push(this._build(I,yt,L,P-1))}}return h(Y,this.toBBox),Y},c.prototype._chooseSubtree=function(I,k,T,P){for(;P.push(k),!k.leaf&&P.length-1!==T;){for(var Y=1/0,W=1/0,Z=void 0,et=0;et<k.children.length;et++){var E=k.children[et],dt=S(E),wt=(yt=I,L=E,(Math.max(L.maxX,yt.maxX)-Math.min(L.minX,yt.minX))*(Math.max(L.maxY,yt.maxY)-Math.min(L.minY,yt.minY))-dt);wt<W?(W=wt,Y=dt<Y?dt:Y,Z=E):wt===W&&dt<Y&&(Y=dt,Z=E)}k=Z||k.children[0]}var yt,L;return k},c.prototype._insert=function(I,k,T){var P=T?I:this.toBBox(I),Y=[],W=this._chooseSubtree(P,this.data,k,Y);for(W.children.push(I),p(W,P);k>=0&&Y[k].children.length>this._maxEntries;)this._split(Y,k),k--;this._adjustParentBBoxes(P,Y,k)},c.prototype._split=function(I,k){var T=I[k],P=T.children.length,Y=this._minEntries;this._chooseSplitAxis(T,Y,P);var W=this._chooseSplitIndex(T,Y,P),Z=X(T.children.splice(W,T.children.length-W));Z.height=T.height,Z.leaf=T.leaf,h(T,this.toBBox),h(Z,this.toBBox),k?I[k-1].children.push(Z):this._splitRoot(T,Z)},c.prototype._splitRoot=function(I,k){this.data=X([I,k]),this.data.height=I.height+1,this.data.leaf=!1,h(this.data,this.toBBox)},c.prototype._chooseSplitIndex=function(I,k,T){for(var P,Y,W,Z,et,E,dt,wt=1/0,yt=1/0,L=k;L<=T-k;L++){var Le=f(I,0,L,this.toBBox),st=f(I,L,T,this.toBBox),we=(Y=Le,W=st,Z=void 0,et=void 0,E=void 0,dt=void 0,Z=Math.max(Y.minX,W.minX),et=Math.max(Y.minY,W.minY),E=Math.min(Y.maxX,W.maxX),dt=Math.min(Y.maxY,W.maxY),Math.max(0,E-Z)*Math.max(0,dt-et)),ri=S(Le)+S(st);we<wt?(wt=we,P=L,yt=ri<yt?ri:yt):we===wt&&ri<yt&&(yt=ri,P=L)}return P||T-k},c.prototype._chooseSplitAxis=function(I,k,T){var P=I.leaf?this.compareMinX:y,Y=I.leaf?this.compareMinY:x;this._allDistMargin(I,k,T,P)<this._allDistMargin(I,k,T,Y)&&I.children.sort(P)},c.prototype._allDistMargin=function(I,k,T,P){I.children.sort(P);for(var Y=this.toBBox,W=f(I,0,k,Y),Z=f(I,T-k,T,Y),et=O(W)+O(Z),E=k;E<T-k;E++){var dt=I.children[E];p(W,I.leaf?Y(dt):dt),et+=O(W)}for(var wt=T-k-1;wt>=k;wt--){var yt=I.children[wt];p(Z,I.leaf?Y(yt):yt),et+=O(Z)}return et},c.prototype._adjustParentBBoxes=function(I,k,T){for(var P=T;P>=0;P--)p(k[P],I)},c.prototype._condense=function(I){for(var k=I.length-1,T=void 0;k>=0;k--)I[k].children.length===0?k>0?(T=I[k-1].children).splice(T.indexOf(I[k]),1):this.clear():h(I[k],this.toBBox)},c})});var tu=rt(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.earthRadius=63710088e-1;gt.factors={centimeters:gt.earthRadius*100,centimetres:gt.earthRadius*100,degrees:gt.earthRadius/111325,feet:gt.earthRadius*3.28084,inches:gt.earthRadius*39.37,kilometers:gt.earthRadius/1e3,kilometres:gt.earthRadius/1e3,meters:gt.earthRadius,metres:gt.earthRadius,miles:gt.earthRadius/1609.344,millimeters:gt.earthRadius*1e3,millimetres:gt.earthRadius*1e3,nauticalmiles:gt.earthRadius/1852,radians:1,yards:gt.earthRadius*1.0936};gt.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/gt.earthRadius,yards:1.0936133};gt.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function fo(r,s,o){o===void 0&&(o={});var c={type:"Feature"};return(o.id===0||o.id)&&(c.id=o.id),o.bbox&&(c.bbox=o.bbox),c.properties=s||{},c.geometry=r,c}gt.feature=fo;function Fy(r,s,o){switch(o===void 0&&(o={}),r){case"Point":return Ql(s).geometry;case"LineString":return Zl(s).geometry;case"Polygon":return Jl(s).geometry;case"MultiPoint":return df(s).geometry;case"MultiLineString":return hf(s).geometry;case"MultiPolygon":return ff(s).geometry;default:throw new Error(r+" is invalid")}}gt.geometry=Fy;function Ql(r,s,o){if(o===void 0&&(o={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!yc(r[0])||!yc(r[1]))throw new Error("coordinates must contain numbers");var c={type:"Point",coordinates:r};return fo(c,s,o)}gt.point=Ql;function By(r,s,o){return o===void 0&&(o={}),vc(r.map(function(c){return Ql(c,s)}),o)}gt.points=By;function Jl(r,s,o){o===void 0&&(o={});for(var c=0,l=r;c<l.length;c++){var h=l[c];if(h.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var f=0;f<h[h.length-1].length;f++)if(h[h.length-1][f]!==h[0][f])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:r};return fo(p,s,o)}gt.polygon=Jl;function qy(r,s,o){return o===void 0&&(o={}),vc(r.map(function(c){return Jl(c,s)}),o)}gt.polygons=qy;function Zl(r,s,o){if(o===void 0&&(o={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var c={type:"LineString",coordinates:r};return fo(c,s,o)}gt.lineString=Zl;function Gy(r,s,o){return o===void 0&&(o={}),vc(r.map(function(c){return Zl(c,s)}),o)}gt.lineStrings=Gy;function vc(r,s){s===void 0&&(s={});var o={type:"FeatureCollection"};return s.id&&(o.id=s.id),s.bbox&&(o.bbox=s.bbox),o.features=r,o}gt.featureCollection=vc;function hf(r,s,o){o===void 0&&(o={});var c={type:"MultiLineString",coordinates:r};return fo(c,s,o)}gt.multiLineString=hf;function df(r,s,o){o===void 0&&(o={});var c={type:"MultiPoint",coordinates:r};return fo(c,s,o)}gt.multiPoint=df;function ff(r,s,o){o===void 0&&(o={});var c={type:"MultiPolygon",coordinates:r};return fo(c,s,o)}gt.multiPolygon=ff;function zy(r,s,o){o===void 0&&(o={});var c={type:"GeometryCollection",geometries:r};return fo(c,s,o)}gt.geometryCollection=zy;function Uy(r,s){if(s===void 0&&(s=0),s&&!(s>=0))throw new Error("precision must be a positive number");var o=Math.pow(10,s||0);return Math.round(r*o)/o}gt.round=Uy;function pf(r,s){s===void 0&&(s="kilometers");var o=gt.factors[s];if(!o)throw new Error(s+" units is invalid");return r*o}gt.radiansToLength=pf;function Kl(r,s){s===void 0&&(s="kilometers");var o=gt.factors[s];if(!o)throw new Error(s+" units is invalid");return r/o}gt.lengthToRadians=Kl;function Xy(r,s){return mf(Kl(r,s))}gt.lengthToDegrees=Xy;function Yy(r){var s=r%360;return s<0&&(s+=360),s}gt.bearingToAzimuth=Yy;function mf(r){var s=r%(2*Math.PI);return s*180/Math.PI}gt.radiansToDegrees=mf;function jy(r){var s=r%360;return s*Math.PI/180}gt.degreesToRadians=jy;function $y(r,s,o){if(s===void 0&&(s="kilometers"),o===void 0&&(o="kilometers"),!(r>=0))throw new Error("length must be a positive number");return pf(Kl(r,s),o)}gt.convertLength=$y;function Hy(r,s,o){if(s===void 0&&(s="meters"),o===void 0&&(o="kilometers"),!(r>=0))throw new Error("area must be a positive number");var c=gt.areaFactors[s];if(!c)throw new Error("invalid original units");var l=gt.areaFactors[o];if(!l)throw new Error("invalid final units");return r/c*l}gt.convertArea=Hy;function yc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}gt.isNumber=yc;function Vy(r){return!!r&&r.constructor===Object}gt.isObject=Vy;function Wy(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(s){if(!yc(s))throw new Error("bbox must only contain numbers")})}gt.validateBBox=Wy;function Qy(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}gt.validateId=Qy});var iu=rt(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var pn=tu();function pa(r,s,o){if(r!==null)for(var c,l,h,f,p,y,x,S=0,O=0,N,z=r.type,X=z==="FeatureCollection",$=z==="Feature",I=X?r.features.length:1,k=0;k<I;k++){x=X?r.features[k].geometry:$?r.geometry:r,N=x?x.type==="GeometryCollection":!1,p=N?x.geometries.length:1;for(var T=0;T<p;T++){var P=0,Y=0;if(f=N?x.geometries[T]:x,f!==null){y=f.coordinates;var W=f.type;switch(S=o&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(s(y,O,k,P,Y)===!1)return!1;O++,P++;break;case"LineString":case"MultiPoint":for(c=0;c<y.length;c++){if(s(y[c],O,k,P,Y)===!1)return!1;O++,W==="MultiPoint"&&P++}W==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(c=0;c<y.length;c++){for(l=0;l<y[c].length-S;l++){if(s(y[c][l],O,k,P,Y)===!1)return!1;O++}W==="MultiLineString"&&P++,W==="Polygon"&&Y++}W==="Polygon"&&P++;break;case"MultiPolygon":for(c=0;c<y.length;c++){for(Y=0,l=0;l<y[c].length;l++){for(h=0;h<y[c][l].length-S;h++){if(s(y[c][l][h],O,k,P,Y)===!1)return!1;O++}Y++}P++}break;case"GeometryCollection":for(c=0;c<f.geometries.length;c++)if(pa(f.geometries[c],s,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jy(r,s,o,c){var l=o;return pa(r,function(h,f,p,y,x){f===0&&o===void 0?l=h:l=s(l,h,f,p,y,x)},c),l}function gf(r,s){var o;switch(r.type){case"FeatureCollection":for(o=0;o<r.features.length&&s(r.features[o].properties,o)!==!1;o++);break;case"Feature":s(r.properties,0);break}}function Zy(r,s,o){var c=o;return gf(r,function(l,h){h===0&&o===void 0?c=l:c=s(c,l,h)}),c}function yf(r,s){if(r.type==="Feature")s(r,0);else if(r.type==="FeatureCollection")for(var o=0;o<r.features.length&&s(r.features[o],o)!==!1;o++);}function Ky(r,s,o){var c=o;return yf(r,function(l,h){h===0&&o===void 0?c=l:c=s(c,l,h)}),c}function tv(r){var s=[];return pa(r,function(o){s.push(o)}),s}function eu(r,s){var o,c,l,h,f,p,y,x,S,O,N=0,z=r.type==="FeatureCollection",X=r.type==="Feature",$=z?r.features.length:1;for(o=0;o<$;o++){for(p=z?r.features[o].geometry:X?r.geometry:r,x=z?r.features[o].properties:X?r.properties:{},S=z?r.features[o].bbox:X?r.bbox:void 0,O=z?r.features[o].id:X?r.id:void 0,y=p?p.type==="GeometryCollection":!1,f=y?p.geometries.length:1,l=0;l<f;l++){if(h=y?p.geometries[l]:p,h===null){if(s(null,N,x,S,O)===!1)return!1;continue}switch(h.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(s(h,N,x,S,O)===!1)return!1;break}case"GeometryCollection":{for(c=0;c<h.geometries.length;c++)if(s(h.geometries[c],N,x,S,O)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}N++}}function ev(r,s,o){var c=o;return eu(r,function(l,h,f,p,y){h===0&&o===void 0?c=l:c=s(c,l,h,f,p,y)}),c}function _c(r,s){eu(r,function(o,c,l,h,f){var p=o===null?null:o.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return s(pn.feature(o,l,{bbox:h,id:f}),c,0)===!1?!1:void 0}var y;switch(p){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var x=0;x<o.coordinates.length;x++){var S=o.coordinates[x],O={type:y,coordinates:S};if(s(pn.feature(O,l),c,x)===!1)return!1}})}function iv(r,s,o){var c=o;return _c(r,function(l,h,f){h===0&&f===0&&o===void 0?c=l:c=s(c,l,h,f)}),c}function vf(r,s){_c(r,function(o,c,l){var h=0;if(o.geometry){var f=o.geometry.type;if(!(f==="Point"||f==="MultiPoint")){var p,y=0,x=0,S=0;if(pa(o,function(O,N,z,X,$){if(p===void 0||c>y||X>x||$>S){p=O,y=c,x=X,S=$,h=0;return}var I=pn.lineString([p,O],o.properties);if(s(I,c,l,$,h)===!1)return!1;h++,p=O})===!1)return!1}}})}function nv(r,s,o){var c=o,l=!1;return vf(r,function(h,f,p,y,x){l===!1&&o===void 0?c=h:c=s(c,h,f,p,y,x),l=!0}),c}function _f(r,s){if(!r)throw new Error("geojson is required");_c(r,function(o,c,l){if(o.geometry!==null){var h=o.geometry.type,f=o.geometry.coordinates;switch(h){case"LineString":if(s(o,c,l,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p<f.length;p++)if(s(pn.lineString(f[p],o.properties),c,l,p)===!1)return!1;break}}})}function rv(r,s,o){var c=o;return _f(r,function(l,h,f,p){h===0&&o===void 0?c=l:c=s(c,l,h,f,p)}),c}function ov(r,s){if(s=s||{},!pn.isObject(s))throw new Error("options is invalid");var o=s.featureIndex||0,c=s.multiFeatureIndex||0,l=s.geometryIndex||0,h=s.segmentIndex||0,f=s.properties,p;switch(r.type){case"FeatureCollection":o<0&&(o=r.features.length+o),f=f||r.features[o].properties,p=r.features[o].geometry;break;case"Feature":f=f||r.properties,p=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=r;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var y=p.coordinates;switch(p.type){case"Point":case"MultiPoint":return null;case"LineString":return h<0&&(h=y.length+h-1),pn.lineString([y[h],y[h+1]],f,s);case"Polygon":return l<0&&(l=y.length+l),h<0&&(h=y[l].length+h-1),pn.lineString([y[l][h],y[l][h+1]],f,s);case"MultiLineString":return c<0&&(c=y.length+c),h<0&&(h=y[c].length+h-1),pn.lineString([y[c][h],y[c][h+1]],f,s);case"MultiPolygon":return c<0&&(c=y.length+c),l<0&&(l=y[c].length+l),h<0&&(h=y[c][l].length-h-1),pn.lineString([y[c][l][h],y[c][l][h+1]],f,s)}throw new Error("geojson is invalid")}function sv(r,s){if(s=s||{},!pn.isObject(s))throw new Error("options is invalid");var o=s.featureIndex||0,c=s.multiFeatureIndex||0,l=s.geometryIndex||0,h=s.coordIndex||0,f=s.properties,p;switch(r.type){case"FeatureCollection":o<0&&(o=r.features.length+o),f=f||r.features[o].properties,p=r.features[o].geometry;break;case"Feature":f=f||r.properties,p=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=r;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var y=p.coordinates;switch(p.type){case"Point":return pn.point(y,f,s);case"MultiPoint":return c<0&&(c=y.length+c),pn.point(y[c],f,s);case"LineString":return h<0&&(h=y.length+h),pn.point(y[h],f,s);case"Polygon":return l<0&&(l=y.length+l),h<0&&(h=y[l].length+h),pn.point(y[l][h],f,s);case"MultiLineString":return c<0&&(c=y.length+c),h<0&&(h=y[c].length+h),pn.point(y[c][h],f,s);case"MultiPolygon":return c<0&&(c=y.length+c),l<0&&(l=y[c].length+l),h<0&&(h=y[c][l].length-h),pn.point(y[c][l][h],f,s)}throw new Error("geojson is invalid")}Oi.coordAll=tv;Oi.coordEach=pa;Oi.coordReduce=Jy;Oi.featureEach=yf;Oi.featureReduce=Ky;Oi.findPoint=sv;Oi.findSegment=ov;Oi.flattenEach=_c;Oi.flattenReduce=iv;Oi.geomEach=eu;Oi.geomReduce=ev;Oi.lineEach=_f;Oi.lineReduce=rv;Oi.propEach=gf;Oi.propReduce=Zy;Oi.segmentEach=vf;Oi.segmentReduce=nv});var xf=rt(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});var av=iu();function nu(r){var s=[1/0,1/0,-1/0,-1/0];return av.coordEach(r,function(o){s[0]>o[0]&&(s[0]=o[0]),s[1]>o[1]&&(s[1]=o[1]),s[2]<o[0]&&(s[2]=o[0]),s[3]<o[1]&&(s[3]=o[1])}),s}nu.default=nu;ru.default=nu});var xc=rt((zS,ou)=>{var Sr=uf(),bf=tu(),Ef=iu(),vs=xf().default,cv=Ef.featureEach,qS=Ef.coordEach,GS=bf.polygon,wf=bf.featureCollection;function Cf(r){var s=new Sr(r);return s.insert=function(o){if(o.type!=="Feature")throw new Error("invalid feature");return o.bbox=o.bbox?o.bbox:vs(o),Sr.prototype.insert.call(this,o)},s.load=function(o){var c=[];return Array.isArray(o)?o.forEach(function(l){if(l.type!=="Feature")throw new Error("invalid features");l.bbox=l.bbox?l.bbox:vs(l),c.push(l)}):cv(o,function(l){if(l.type!=="Feature")throw new Error("invalid features");l.bbox=l.bbox?l.bbox:vs(l),c.push(l)}),Sr.prototype.load.call(this,c)},s.remove=function(o,c){if(o.type!=="Feature")throw new Error("invalid feature");return o.bbox=o.bbox?o.bbox:vs(o),Sr.prototype.remove.call(this,o,c)},s.clear=function(){return Sr.prototype.clear.call(this)},s.search=function(o){var c=Sr.prototype.search.call(this,this.toBBox(o));return wf(c)},s.collides=function(o){return Sr.prototype.collides.call(this,this.toBBox(o))},s.all=function(){var o=Sr.prototype.all.call(this);return wf(o)},s.toJSON=function(){return Sr.prototype.toJSON.call(this)},s.fromJSON=function(o){return Sr.prototype.fromJSON.call(this,o)},s.toBBox=function(o){var c;if(o.bbox)c=o.bbox;else if(Array.isArray(o)&&o.length===4)c=o;else if(Array.isArray(o)&&o.length===6)c=[o[0],o[1],o[3],o[4]];else if(o.type==="Feature")c=vs(o);else if(o.type==="FeatureCollection")c=vs(o);else throw new Error("invalid geojson");return{minX:c[0],minY:c[1],maxX:c[2],maxY:c[3]}},s}
vendor: 22,908 bytes, line 1
1ou.exports=Cf;ou.exports.default=Cf});var du=rt((Qk,Af)=>{"use strict";var Rf=Object.prototype.toString;Af.exports=function(s){var o=Rf.call(s),c=o==="[object Arguments]";return c||(c=o!=="[object Array]"&&s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&Rf.call(s.callee)==="[object Function]"),c}});var Xf=rt((Jk,Uf)=>{"use strict";var zf;Object.keys||(ya=Object.prototype.hasOwnProperty,fu=Object.prototype.toString,Tf=du(),pu=Object.prototype.propertyIsEnumerable,Df=!pu.call({toString:null},"toString"),Ff=pu.call(function(){},"prototype"),va=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Cc=function(r){var s=r.constructor;return s&&s.prototype===r},Bf={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},qf=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!Bf["$"+r]&&ya.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Cc(window[r])}catch{return!0}}catch{return!0}return!1}(),Gf=function(r){if(typeof window>"u"||!qf)return Cc(r);try{return Cc(r)}catch{return!1}},zf=function(s){var o=s!==null&&typeof s=="object",c=fu.call(s)==="[object Function]",l=Tf(s),h=o&&fu.call(s)==="[object String]",f=[];if(!o&&!c&&!l)throw new TypeError("Object.keys called on a non-object");var p=Ff&&c;if(h&&s.length>0&&!ya.call(s,0))for(var y=0;y<s.length;++y)f.push(String(y));if(l&&s.length>0)for(var x=0;x<s.length;++x)f.push(String(x));else for(var S in s)!(p&&S==="prototype")&&ya.call(s,S)&&f.push(String(S));if(Df)for(var O=Gf(s),N=0;N<va.length;++N)!(O&&va[N]==="constructor")&&ya.call(s,va[N])&&f.push(va[N]);return f});var ya,fu,Tf,pu,Df,Ff,va,Cc,Bf,qf,Gf;Uf.exports=zf});var mu=rt((Zk,$f)=>{"use strict";var vv=Array.prototype.slice,_v=du(),Yf=Object.keys,Mc=Yf?function(s){return Yf(s)}:Xf(),jf=Object.keys;Mc.shim=function(){if(Object.keys){var s=function(){var o=Object.keys(arguments);return o&&o.length===arguments.length}(1,2);s||(Object.keys=function(c){return _v(c)?jf(vv.call(c)):jf(c)})}else Object.keys=Mc;return Object.keys||Mc};$f.exports=Mc});var gu=rt((Kk,Hf)=>{"use strict";Hf.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var s={},o=Symbol("test"),c=Object(o);if(typeof o=="string"||Object.prototype.toString.call(o)!=="[object Symbol]"||Object.prototype.toString.call(c)!=="[object Symbol]")return!1;var l=42;s[o]=l;for(var h in s)return!1;if(typeof Object.keys=="function"&&Object.keys(s).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(s).length!==0)return!1;var f=Object.getOwnPropertySymbols(s);if(f.length!==1||f[0]!==o||!Object.prototype.propertyIsEnumerable.call(s,o))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(s,o);if(p.value!==l||p.enumerable!==!0)return!1}return!0}});var Pc=rt((tN,Vf)=>{"use strict";var xv=gu();Vf.exports=function(){return xv()&&!!Symbol.toStringTag}});var yu=rt((eN,Wf)=>{"use strict";Wf.exports=Object});var vu=rt((iN,Qf)=>{"use strict";Qf.exports=Error});var Zf=rt((nN,Jf)=>{"use strict";Jf.exports=EvalError});var tp=rt((rN,Kf)=>{"use strict";Kf.exports=RangeError});var ip=rt((oN,ep)=>{"use strict";ep.exports=ReferenceError});var _u=rt((sN,np)=>{"use strict";np.exports=SyntaxError});var To=rt((aN,rp)=>{"use strict";rp.exports=TypeError});var sp=rt((cN,op)=>{"use strict";op.exports=URIError});var cp=rt((lN,ap)=>{"use strict";ap.exports=Math.abs});var up=rt((uN,lp)=>{"use strict";lp.exports=Math.floor});var dp=rt((hN,hp)=>{"use strict";hp.exports=Math.max});var pp=rt((dN,fp)=>{"use strict";fp.exports=Math.min});var gp=rt((fN,mp)=>{"use strict";mp.exports=Math.pow});var vp=rt((pN,yp)=>{"use strict";yp.exports=Math.round});var xp=rt((mN,_p)=>{"use strict";_p.exports=Number.isNaN||function(s){return s!==s}});var bp=rt((gN,wp)=>{"use strict";var wv=xp();wp.exports=function(s){return wv(s)||s===0?s:s<0?-1:1}});var Cp=rt((yN,Ep)=>{"use strict";Ep.exports=Object.getOwnPropertyDescriptor});var Do=rt((vN,Mp)=>{"use strict";var Ic=Cp();if(Ic)try{Ic([],"length")}catch{Ic=null}Mp.exports=Ic});var _a=rt((_N,Pp)=>{"use strict";var Sc=Object.defineProperty||!1;if(Sc)try{Sc({},"a",{value:1})}catch{Sc=!1}Pp.exports=Sc});var Op=rt((xN,Sp)=>{"use strict";var Ip=typeof Symbol<"u"&&Symbol,bv=gu();Sp.exports=function(){return typeof Ip!="function"||typeof Symbol!="function"||typeof Ip("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:bv()}});var xu=rt((wN,kp)=>{"use strict";kp.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var wu=rt((bN,Np)=>{"use strict";var Ev=yu();Np.exports=Ev.getPrototypeOf||null});var Ap=rt((EN,Rp)=>{"use strict";var Cv="Function.prototype.bind called on incompatible ",Mv=Object.prototype.toString,Pv=Math.max,Iv="[object Function]",Lp=function(s,o){for(var c=[],l=0;l<s.length;l+=1)c[l]=s[l];for(var h=0;h<o.length;h+=1)c[h+s.length]=o[h];return c},Sv=function(s,o){for(var c=[],l=o||0,h=0;l<s.length;l+=1,h+=1)c[h]=s[l];return c},Ov=function(r,s){for(var o="",c=0;c<r.length;c+=1)o+=r[c],c+1<r.length&&(o+=s);return o};Rp.exports=function(s){var o=this;if(typeof o!="function"||Mv.apply(o)!==Iv)throw new TypeError(Cv+o);for(var c=Sv(arguments,1),l,h=function(){if(this instanceof l){var S=o.apply(this,Lp(c,arguments));return Object(S)===S?S:this}return o.apply(s,Lp(c,arguments))},f=Pv(0,o.length-c.length),p=[],y=0;y<f;y++)p[y]="$"+y;if(l=Function("binder","return function ("+Ov(p,",")+"){ return binder.apply(this,arguments); }")(h),o.prototype){var x=function(){};x.prototype=o.prototype,l.prototype=new x,x.prototype=null}return l}});var _s=rt((CN,Tp)=>{"use strict";var kv=Ap();Tp.exports=Function.prototype.bind||kv});var Oc=rt((MN,Dp)=>{"use strict";Dp.exports=Function.prototype.call});var kc=rt((PN,Fp)=>{"use strict";Fp.exports=Function.prototype.apply});var qp=rt((IN,Bp)=>{"use strict";Bp.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bu=rt((SN,Gp)=>{"use strict";var Nv=_s(),Lv=kc(),Rv=Oc(),Av=qp();Gp.exports=Av||Nv.call(Rv,Lv)});var Nc=rt((ON,zp)=>{"use strict";var Tv=_s(),Dv=To(),Fv=Oc(),Bv=bu();zp.exports=function(s){if(s.length<1||typeof s[0]!="function")throw new Dv("a function is required");return Bv(Tv,Fv,s)}});var Hp=rt((kN,$p)=>{"use strict";var qv=Nc(),Up=Do(),Yp;try{Yp=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var Eu=!!Yp&&Up&&Up(Object.prototype,"__proto__"),jp=Object,Xp=jp.getPrototypeOf;$p.exports=Eu&&typeof Eu.get=="function"?qv([Eu.get]):typeof Xp=="function"?function(s){return Xp(s==null?s:jp(s))}:!1});var Cu=rt((NN,Jp)=>{"use strict";var Vp=xu(),Wp=wu(),Qp=Hp();Jp.exports=Vp?function(s){return Vp(s)}:Wp?function(s){if(!s||typeof s!="object"&&typeof s!="function")throw new TypeError("getProto: not an object");return Wp(s)}:Qp?function(s){return Qp(s)}:null});var Mu=rt((LN,Zp)=>{"use strict";var Gv=Function.prototype.call,zv=Object.prototype.hasOwnProperty,Uv=_s();Zp.exports=Uv.call(Gv,zv)});var Su=rt((RN,rm)=>{"use strict";var ee,Xv=yu(),Yv=vu(),jv=Zf(),$v=tp(),Hv=ip(),Es=_u(),bs=To(),Vv=sp(),Wv=cp(),Qv=up(),Jv=dp(),Zv=pp(),Kv=gp(),t_=vp(),e_=bp(),im=Function,Pu=function(r){try{return im('"use strict"; return ('+r+").constructor;")()}catch{}},xa=Do(),i_=_a(),Iu=function(){throw new bs},n_=xa?function(){try{return arguments.callee,Iu}catch{try{return xa(arguments,"callee").get}catch{return Iu}}}():Iu,xs=Op()(),Xi=Cu(),r_=wu(),o_=xu(),nm=kc(),wa=Oc(),ws={},s_=typeof Uint8Array>"u"||!Xi?ee:Xi(Uint8Array),Fo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ee:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ee:ArrayBuffer,"%ArrayIteratorPrototype%":xs&&Xi?Xi([][Symbol.iterator]()):ee,"%AsyncFromSyncIteratorPrototype%":ee,"%AsyncFunction%":ws,"%AsyncGenerator%":ws,"%AsyncGeneratorFunction%":ws,"%AsyncIteratorPrototype%":ws,"%Atomics%":typeof Atomics>"u"?ee:Atomics,"%BigInt%":typeof BigInt>"u"?ee:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ee:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ee:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ee:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Yv,"%eval%":eval,"%EvalError%":jv,"%Float16Array%":typeof Float16Array>"u"?ee:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ee:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ee:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ee:FinalizationRegistry,"%Function%":im,"%GeneratorFunction%":ws,"%Int8Array%":typeof Int8Array>"u"?ee:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ee:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ee:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xs&&Xi?Xi(Xi([][Symbol.iterator]())):ee,"%JSON%":typeof JSON=="object"?JSON:ee,"%Map%":typeof Map>"u"?ee:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xs||!Xi?ee:Xi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xv,"%Object.getOwnPropertyDescriptor%":xa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ee:Promise,"%Proxy%":typeof Proxy>"u"?ee:Proxy,"%RangeError%":$v,"%ReferenceError%":Hv,"%Reflect%":typeof Reflect>"u"?ee:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ee:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xs||!Xi?ee:Xi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ee:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xs&&Xi?Xi(""[Symbol.iterator]()):ee,"%Symbol%":xs?Symbol:ee,"%SyntaxError%":Es,"%ThrowTypeError%":n_,"%TypedArray%":s_,"%TypeError%":bs,"%Uint8Array%":typeof Uint8Array>"u"?ee:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ee:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ee:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ee:Uint32Array,"%URIError%":Vv,"%WeakMap%":typeof WeakMap>"u"?ee:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ee:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ee:WeakSet,"%Function.prototype.call%":wa,"%Function.prototype.apply%":nm,"%Object.defineProperty%":i_,"%Object.getPrototypeOf%":r_,"%Math.abs%":Wv,"%Math.floor%":Qv,"%Math.max%":Jv,"%Math.min%":Zv,"%Math.pow%":Kv,"%Math.round%":t_,"%Math.sign%":e_,"%Reflect.getPrototypeOf%":o_};if(Xi)try{null.error}catch(r){Kp=Xi(Xi(r)),Fo["%Error.prototype%"]=Kp}var Kp,a_=function r(s){var o;if(s==="%AsyncFunction%")o=Pu("async function () {}");else if(s==="%GeneratorFunction%")o=Pu("function* () {}");else if(s==="%AsyncGeneratorFunction%")o=Pu("async function* () {}");else if(s==="%AsyncGenerator%"){var c=r("%AsyncGeneratorFunction%");c&&(o=c.prototype)}else if(s==="%AsyncIteratorPrototype%"){var l=r("%AsyncGenerator%");l&&Xi&&(o=Xi(l.prototype))}return Fo[s]=o,o},tm={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ba=_s(),Lc=Mu(),c_=ba.call(wa,Array.prototype.concat),l_=ba.call(nm,Array.prototype.splice),em=ba.call(wa,String.prototype.replace),Rc=ba.call(wa,String.prototype.slice),u_=ba.call(wa,RegExp.prototype.exec),h_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,d_=/\\(\\)?/g,f_=function(s){var o=Rc(s,0,1),c=Rc(s,-1);if(o==="%"&&c!=="%")throw new Es("invalid intrinsic syntax, expected closing `%`");if(c==="%"&&o!=="%")throw new Es("invalid intrinsic syntax, expected opening `%`");var l=[];return em(s,h_,function(h,f,p,y){l[l.length]=p?em(y,d_,"$1"):f||h}),l},p_=function(s,o){var c=s,l;if(Lc(tm,c)&&(l=tm[c],c="%"+l[0]+"%"),Lc(Fo,c)){var h=Fo[c];if(h===ws&&(h=a_(c)),typeof h>"u"&&!o)throw new bs("intrinsic "+s+" exists, but is not available. Please file an issue!");return{alias:l,name:c,value:h}}throw new Es("intrinsic "+s+" does not exist!")};rm.exports=function(s,o){if(typeof s!="string"||s.length===0)throw new bs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new bs('"allowMissing" argument must be a boolean');if(u_(/^%?[^%]*%?$/,s)===null)throw new Es("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var c=f_(s),l=c.length>0?c[0]:"",h=p_("%"+l+"%",o),f=h.name,p=h.value,y=!1,x=h.alias;x&&(l=x[0],l_(c,c_([0,1],x)));for(var S=1,O=!0;S<c.length;S+=1){var N=c[S],z=Rc(N,0,1),X=Rc(N,-1);if((z==='"'||z==="'"||z==="`"||X==='"'||X==="'"||X==="`")&&z!==X)throw new Es("property names with quotes must have matching quotes");if((N==="constructor"||!O)&&(y=!0),l+="."+N,f="%"+l+"%",Lc(Fo,f))p=Fo[f];else if(p!=null){if(!(N in p)){if(!o)throw new bs("base intrinsic for "+s+" exists, but the property is not available.");return}if(xa&&S+1>=c.length){var $=xa(p,N);O=!!$,O&&"get"in $&&!("originalValue"in $.get)?p=$.get:p=p[N]}else O=Lc(p,N),p=p[N];O&&!y&&(Fo[f]=p)}}return p}});var Ac=rt((AN,am)=>{"use strict";var om=Su(),sm=Nc(),m_=sm([om("%String.prototype.indexOf%")]);am.exports=function(s,o){var c=om(s,!!o);return typeof c=="function"&&m_(s,".prototype.")>-1?sm([c]):c}});var um=rt((TN,lm)=>{"use strict";var g_=Pc()(),y_=Ac(),Ou=y_("Object.prototype.toString"),Tc=function(s){return g_&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:Ou(s)==="[object Arguments]"},cm=function(s){return Tc(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&Ou(s)!=="[object Array]"&&"callee"in s&&Ou(s.callee)==="[object Function]"},v_=function(){return Tc(arguments)}();Tc.isLegacyArguments=cm;lm.exports=v_?Tc:cm});var Dc=rt((DN,fm)=>{"use strict";var hm=_a(),__=_u(),Cs=To(),dm=Do();fm.exports=function(s,o,c){if(!s||typeof s!="object"&&typeof s!="function")throw new Cs("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new Cs("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Cs("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Cs("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Cs("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Cs("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!dm&&dm(s,o);if(hm)hm(s,o,{configurable:f===null&&y?y.configurable:!f,enumerable:l===null&&y?y.enumerable:!l,value:c,writable:h===null&&y?y.writable:!h});else if(p||!l&&!h&&!f)s[o]=c;else throw new __("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Fc=rt((FN,mm)=>{"use strict";var ku=_a(),pm=function(){return!!ku};pm.hasArrayLengthDefineBug=function(){if(!ku)return null;try{return ku([],"length",{value:1}).length!==1}catch{return!0}};mm.exports=pm});var Ms=rt((BN,_m)=>{"use strict";var x_=mu(),w_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",b_=Object.prototype.toString,E_=Array.prototype.concat,gm=Dc(),C_=function(r){return typeof r=="function"&&b_.call(r)==="[object Function]"},ym=Fc()(),M_=function(r,s,o,c){if(s in r){if(c===!0){if(r[s]===o)return}else if(!C_(c)||!c())return}ym?gm(r,s,o,!0):gm(r,s,o)},vm=function(r,s){var o=arguments.length>2?arguments[2]:{},c=x_(s);w_&&(c=E_.call(c,Object.getOwnPropertySymbols(s)));for(var l=0;l<c.length;l+=1)M_(r,c[l],s[c[l]],o[c[l]])};vm.supportsDescriptors=!!ym;_m.exports=vm});var Cm=rt((qN,Em)=>{"use strict";var P_=Su(),xm=Dc(),I_=Fc()(),wm=Do(),bm=To(),S_=P_("%Math.floor%");Em.exports=function(s,o){if(typeof s!="function")throw new bm("`fn` is not a function");if(typeof o!="number"||o<0||o>4294967295||S_(o)!==o)throw new bm("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],l=!0,h=!0;if("length"in s&&wm){var f=wm(s,"length");f&&!f.configurable&&(l=!1),f&&!f.writable&&(h=!1)}return(l||h||!c)&&(I_?xm(s,"length",o,!0,!0):xm(s,"length",o)),s}});var Pm=rt((GN,Mm)=>{"use strict";var O_=_s(),k_=kc(),N_=bu();Mm.exports=function(){return N_(O_,k_,arguments)}});var Nu=rt((zN,Bc)=>{"use strict";var L_=Cm(),Im=_a(),R_=Nc(),Sm=Pm();Bc.exports=function(s){var o=R_(arguments),c=1+s.length-(arguments.length-1);return L_(o,c>0?c:0,!0)};Im?Im(Bc.exports,"apply",{value:Sm}):Bc.exports.apply=Sm});var Lu=rt((UN,km)=>{"use strict";var Om=function(r){return r!==r};km.exports=function(s,o){return s===0&&o===0?1/s===1/o:!!(s===o||Om(s)&&Om(o))}});var Ru=rt((XN,Nm)=>{"use strict";var A_=Lu();Nm.exports=function(){return typeof Object.is=="function"?Object.is:A_}});var Rm=rt((YN,Lm)=>{"use strict";var T_=Ru(),D_=Ms();Lm.exports=function(){var s=T_();return D_(Object,{is:s},{is:function(){return Object.is!==s}}),s}});var Fm=rt((jN,Dm)=>{"use strict";var F_=Ms(),B_=Nu(),q_=Lu(),Am=Ru(),G_=Rm(),Tm=B_(Am(),Object);F_(Tm,{getPolyfill:Am,implementation:q_,shim:G_});Dm.exports=Tm});var Xm=rt(($N,Um)=>{"use strict";var Bm=Ac(),z_=Pc()(),U_=Mu(),X_=Do(),Du;z_?(qm=Bm("RegExp.prototype.exec"),Au={},qc=function(){throw Au},Tu={toString:qc,valueOf:qc},typeof Symbol.toPrimitive=="symbol"&&(Tu[Symbol.toPrimitive]=qc),Du=function(s){if(!s||typeof s!="object")return!1;var o=X_(s,"lastIndex"),c=o&&U_(o,"value");if(!c)return!1;try{qm(s,Tu)}catch(l){return l===Au}}):(Gm=Bm("Object.prototype.toString"),zm="[object RegExp]",Du=function(s){return!s||typeof s!="object"&&typeof s!="function"?!1:Gm(s)===zm});var qm,Au,qc,Tu,Gm,zm;Um.exports=Du});var jm=rt((HN,Ym)=>{"use strict";var Ca=function(){return typeof function(){}.name=="string"},Ea=Object.getOwnPropertyDescriptor;if(Ea)try{Ea([],"length")}catch{Ea=null}Ca.functionsHaveConfigurableNames=function(){if(!Ca()||!Ea)return!1;var s=Ea(function(){},"name");return!!s&&!!s.configurable};var Y_=Function.prototype.bind;Ca.boundFunctionsHaveNames=function(){return Ca()&&typeof Y_=="function"&&function(){}.bind().name!==""};Ym.exports=Ca});var Vm=rt((VN,Hm)=>{"use strict";var $m=Dc(),j_=Fc()(),$_=jm().functionsHaveConfigurableNames(),H_=To();Hm.exports=function(s,o){if(typeof s!="function")throw new H_("`fn` is not a function");var c=arguments.length>2&&!!arguments[2];return(!c||$_)&&(j_?$m(s,"name",o,!0,!0):$m(s,"name",o)),s}});var Fu=rt((WN,Wm)=>{"use strict";var V_=Vm(),W_=To(),Q_=Object;Wm.exports=V_(function(){if(this==null||this!==Q_(this))throw new W_("RegExp.prototype.flags getter called on non-object");var s="";return this.hasIndices&&(s+="d"),this.global&&(s+="g"),this.ignoreCase&&(s+="i"),this.multiline&&(s+="m"),this.dotAll&&(s+="s"),this.unicode&&(s+="u"),this.unicodeSets&&(s+="v"),this.sticky&&(s+="y"),s},"get flags",!0)});var Bu=rt((QN,Qm)=>{"use strict";var J_=Fu(),Z_=Ms().supportsDescriptors,K_=Object.getOwnPropertyDescriptor;Qm.exports=function(){if(Z_&&/a/mig.flags==="gim"){var s=K_(RegExp.prototype,"flags");if(s&&typeof s.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",c={};if(Object.defineProperty(c,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(c,"sticky",{get:function(){o+="y"}}),s.get.call(c),o==="dy")return s.get}}return J_}});var Km=rt((JN,Zm)=>{"use strict";var t1=Ms().supportsDescriptors,e1=Bu(),i1=Do(),n1=Object.defineProperty,r1=vu(),Jm=Cu(),o1=/a/;Zm.exports=function(){if(!t1||!Jm)throw new r1("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var s=e1(),o=Jm(o1),c=i1(o,"flags");return(!c||c.get!==s)&&n1(o,"flags",{configurable:!0,enumerable:!1,get:s}),s}});var ng=rt((ZN,ig)=>{"use strict";var s1=Ms(),a1=Nu(),c1=Fu(),tg=Bu(),l1=Km(),eg=a1(tg());s1(eg,{getPolyfill:tg,implementation:c1,shim:l1});ig.exports=eg});var sg=rt((KN,og)=>{"use strict";var rg=Ac(),u1=rg("Date.prototype.getDay"),h1=function(s){try{return u1(s),!0}catch{return!1}},d1=rg("Object.prototype.toString"),f1="[object Date]",p1=Pc()();og.exports=function(s){return typeof s!="object"||s===null?!1:p1?h1(s):d1(s)===f1}});var qu=rt((tL,yg)=>
1{var ag=mu(),cg=um(),lg=Fm(),ug=Xm(),hg=ng(),dg=sg(),fg=Date.prototype.getTime;function gg(r,s,o){var c=o||{};return(c.strict?lg(r,s):r===s)?!0:!r||!s||typeof r!="object"&&typeof s!="object"?c.strict?lg(r,s):r==s:m1(r,s,c)}function pg(r){return r==null}function mg(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function m1(r,s,o){var c,l;if(typeof r!=typeof s||pg(r)||pg(s)||r.prototype!==s.prototype||cg(r)!==cg(s))return!1;var h=ug(r),f=ug(s);if(h!==f)return!1;if(h||f)return r.source===s.source&&hg(r)===hg(s);if(dg(r)&&dg(s))return fg.call(r)===fg.call(s);var p=mg(r),y=mg(s);if(p!==y)return!1;if(p||y){if(r.length!==s.length)return!1;for(c=0;c<r.length;c++)if(r[c]!==s[c])return!1;return!0}if(typeof r!=typeof s)return!1;try{var x=ag(r),S=ag(s)}catch{return!1}if(x.length!==S.length)return!1;for(x.sort(),S.sort(),c=x.length-1;c>=0;c--)if(x[c]!=S[c])return!1;for(c=x.length-1;c>=0;c--)if(l=x[c],!gg(r[l],s[l],o))return!1;return!0}yg.exports=gg});var Ju=rt((sA,Cg)=>{var ox=qu(),Or=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:sx};Or.prototype.compare=function(r,s){if(r.type!==s.type||!Eg(r,s))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,s.coordinates);case"LineString":return this.compareLine(r.coordinates,s.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,s);case"Feature":return this.compareFeature(r,s);default:if(r.type.indexOf("Multi")===0){var o=this,c=bg(r),l=bg(s);return c.every(function(h){return this.some(function(f){return o.compare(h,f)})},l)}}return!1};function bg(r){return r.coordinates.map(function(s){return{type:r.type.replace("Multi",""),coordinates:s}})}function Eg(r,s){return r.hasOwnProperty("coordinates")?r.coordinates.length===s.coordinates.length:r.length===s.length}Or.prototype.compareCoord=function(r,s){if(r.length!==s.length)return!1;for(var o=0;o<r.length;o++)if(r[o].toFixed(this.precision)!==s[o].toFixed(this.precision))return!1;return!0};Or.prototype.compareLine=function(r,s,o,c){if(!Eg(r,s))return!1;var l=this.pseudoNode?r:this.removePseudo(r),h=this.pseudoNode?s:this.removePseudo(s);if(!(c&&!this.compareCoord(l[0],h[0])&&(h=this.fixStartIndex(h,l),!h))){var f=this.compareCoord(l[o],h[o]);return this.direction||f?this.comparePath(l,h):this.compareCoord(l[o],h[h.length-(1+o)])?this.comparePath(l.slice().reverse(),h):!1}};Or.prototype.fixStartIndex=function(r,s){for(var o,c=-1,l=0;l<r.length;l++)if(this.compareCoord(r[l],s[0])){c=l;break}return c>=0&&(o=[].concat(r.slice(c,r.length),r.slice(1,c+1))),o};Or.prototype.comparePath=function(r,s){var o=this;return r.every(function(c,l){return o.compareCoord(c,this[l])},s)};Or.prototype.comparePolygon=function(r,s){if(this.compareLine(r.coordinates[0],s.coordinates[0],1,!0)){var o=r.coordinates.slice(1,r.coordinates.length),c=s.coordinates.slice(1,s.coordinates.length),l=this;return o.every(function(h){return this.some(function(f){return l.compareLine(h,f,1,!0)})},c)}else return!1};Or.prototype.compareFeature=function(r,s){return r.id!==s.id||!this.objectComparator(r.properties,s.properties)||!this.compareBBox(r,s)?!1:this.compare(r.geometry,s.geometry)};Or.prototype.compareBBox=function(r,s){return!!(!r.bbox&&!s.bbox||r.bbox&&s.bbox&&this.compareCoord(r.bbox,s.bbox))};Or.prototype.removePseudo=function(r){return r};function sx(r,s){return ox(r,s,{strict:!0})}Cg.exports=Or});var Mg=rt((vA,Uc)=>{function po(r,s,o,c){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(r,s,o,c)}po.prototype.run=function(r,s,o,c){this._init(r,s,o,c);for(var l=0;l<this._datasetLength;l++)if(this._visited[l]!==1){this._visited[l]=1;var h=this._regionQuery(l);if(h.length<this.minPts)this.noise.push(l);
1else{var f=this.clusters.length;this.clusters.push([]),this._addToCluster(l,f),this._expandCluster(f,h)}}return this.clusters};po.prototype._init=function(r,s,o,c){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}s&&(this.epsilon=s),o&&(this.minPts=o),c&&(this.distance=c)};po.prototype._expandCluster=function(r,s){for(var o=0;o<s.length;o++){var c=s[o];if(this._visited[c]!==1){this._visited[c]=1;var l=this._regionQuery(c);l.length>=this.minPts&&(s=this._mergeArrays(s,l))}this._assigned[c]!==1&&this._addToCluster(c,r)}};po.prototype._addToCluster=function(r,s){this.clusters[s].push(r),this._assigned[r]=1};po.prototype._regionQuery=function(r){for(var s=[],o=0;o<this._datasetLength;o++){var c=this.distance(this.dataset[r],this.dataset[o]);c<this.epsilon&&s.push(o)}return s};po.prototype._mergeArrays=function(r,s){for(var o=s.length,c=0;c<o;c++){var l=s[c];r.indexOf(l)<0&&r.push(l)}return r};po.prototype._euclideanDistance=function(r,s){for(var o=0,c=Math.min(r.length,s.length);c--;)o+=(r[c]-s[c])*(r[c]-s[c]);return Math.sqrt(o)};typeof Uc<"u"&&Uc.exports&&(Uc.exports=po)});var Pg=rt((_A,Xc)=>{function mo(r,s,o){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,s,o)}mo.prototype.init=function(r,s,o){this.assignments=[],this.centroids=[],typeof r<"u"&&(this.dataset=r),typeof s<"u"&&(this.k=s),typeof o<"u"&&(this.distance=o)};mo.prototype.run=function(r,s){this.init(r,s);for(var o=this.dataset.length,c=0;c<this.k;c++)this.centroids[c]=this.randomCentroid();for(var l=!0;l;){l=this.assign();for(var h=0;h<this.k;h++){for(var f=new Array(S),p=0,y=0;y<S;y++)f[y]=0;for(var x=0;x<o;x++){var S=this.dataset[x].length;if(h===this.assignments[x]){for(var y=0;y<S;y++)f[y]+=this.dataset[x][y];p++}}if(p>0){for(var y=0;y<S;y++)f[y]/=p;this.centroids[h]=f}else this.centroids[h]=this.randomCentroid(),l=!0}}return this.getClusters()};mo.prototype.randomCentroid=function(){var r=this.dataset.length-1,s,o;do o=Math.round(Math.random()*r),s=this.dataset[o];while(this.centroids.indexOf(s)>=0);return s};mo.prototype.assign=function(){for(var r=!1,s=this.dataset.length,o,c=0;c<s;c++)o=this.argmin(this.dataset[c],this.centroids,this.distance),o!=this.assignments[c]&&(this.assignments[c]=o,r=!0);return r};mo.prototype.getClusters=function(){for(var r=new Array(this.k),s,o=0;o<this.assignments.length;o++)s=this.assignments[o],typeof r[s]>"u"&&(r[s]=[]),r[s].push(o);return r};mo.prototype.argmin=function(r,s,o){for(var c=Number.MAX_VALUE,l=0,h=s.length,f,p=0;p<h;p++)f=o(r,s[p]),f<c&&(c=f,l=p);return l};mo.prototype.distance=function(r,s){for(var o=0,c=Math.min(r.length,s.length);c--;){var l=r[c]-s[c];o+=l*l}return Math.sqrt(o)};typeof Xc<"u"&&Xc.exports&&(Xc.exports=mo)});var Zu=rt((xA,Yc)=>{function kr(r,s,o){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,s,o)}kr.prototype.insert=function(r,s){for(var o=this._queue.length,c=o;c--;){var l=this._priorities[c];this._sorting==="desc"?s>l&&(o=c):s<l&&(o=c)}this._insertAt(r,s,o)};kr.prototype.remove=function(r){for(var s=this._queue.length;s--;){var o=this._queue[s];if(r===o){this._queue.splice(s,1),this._priorities.splice(s,1);break}}};kr.prototype.forEach=function(r){this._queue.forEach(r)};kr.prototype.getElements=function(){return this._queue};kr.prototype.getElementPriority=function(r){return this._priorities[r]};kr.prototype.getPriorities=function(){return this._priorities};kr.prototype.getElementsWithPriorities=function(){for(var r=[],s=0,o=this._queue.length;s<o;s++)r.push([this._queue[s],this._priorities[s]]);return r};kr.prototype._init=function(r,s,o){if(r&&s){if(this._queue=[],this._priorities=[],r.length!==s.length)throw new Error("Arrays must have the same length");for(var c=0;c<r.length;c++)this.insert(r[c],s[c])}o&&(this._sorting=o)};kr.prototype._insertAt=function(r,s,o){this._queue.length===o?(this._queue.push(r),this._priorities.push(s)):(this._queue.splice(o,0,r),this._priorities.splice(o,0,s))};typeof Yc<"u"&&Yc.exports&&(Yc.exports=kr)});var Sg=rt((wA,Is)=>{typeof Is<"u"&&Is.exports&&(Ig=Zu());var Ig;function Qr(r,s,o,c){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,s,o,c)}Qr.prototype.run=function(r,s,o,c){this._init(r,s,o,c);for(var l=0,h=this.dataset.length;l<h;l++)if(this._processed[l]!==1){this._processed[l]=1,this.cluster
1s.push([l]);var f=this.clusters.length-1;this._orderedList.push(l);var p=new Ig(null,null,"asc"),y=this._regionQuery(l);this._distanceToCore(l)!==void 0&&(this._updateQueue(l,y,p),this._expandCluster(f,p))}return this.clusters};Qr.prototype.getReachabilityPlot=function(){for(var r=[],s=0,o=this._orderedList.length;s<o;s++){var c=this._orderedList[s],l=this._reachability[c];r.push([c,l])}return r};Qr.prototype._init=function(r,s,o,c){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}s&&(this.epsilon=s),o&&(this.minPts=o),c&&(this.distance=c)};Qr.prototype._updateQueue=function(r,s,o){var c=this;this._coreDistance=this._distanceToCore(r),s.forEach(function(l){if(c._processed[l]===void 0){var h=c.distance(c.dataset[r],c.dataset[l]),f=Math.max(c._coreDistance,h);c._reachability[l]===void 0?(c._reachability[l]=f,o.insert(l,f)):f<c._reachability[l]&&(c._reachability[l]=f,o.remove(l),o.insert(l,f))}})};Qr.prototype._expandCluster=function(r,s){for(var o=s.getElements(),c=0,l=o.length;c<l;c++){var h=o[c];if(this._processed[h]===void 0){var f=this._regionQuery(h);this._processed[h]=1,this.clusters[r].push(h),this._orderedList.push(h),this._distanceToCore(h)!==void 0&&(this._updateQueue(h,f,s),this._expandCluster(r,s))}}};Qr.prototype._distanceToCore=function(r){for(var s=this.epsilon,o=0;o<s;o++){var c=this._regionQuery(r,o);if(c.length>=this.minPts)return o}};Qr.prototype._regionQuery=function(r,s){s=s||this.epsilon;for(var o=[],c=0,l=this.dataset.length;c<l;c++)this.distance(this.dataset[r],this.dataset[c])<s&&o.push(c);return o};Qr.prototype._euclideanDistance=function(r,s){for(var o=0,c=Math.min(r.length,s.length);c--;)o+=(r[c]-s[c])*(r[c]-s[c]);return Math.sqrt(o)};typeof Is<"u"&&Is.exports&&(Is.exports=Qr)});var Og=rt((bA,jc)=>{typeof jc<"u"&&jc.exports&&(jc.exports={DBSCAN:Mg(),KMEANS:Pg(),OPTICS:Sg(),PriorityQueue:Zu()})});var Ku=rt((SA,Ng)=>{"use strict";Ng.exports={eudist:function(s,o,c){for(var l=s.length,h=0,f=0;f<l;f++){var p=(s[f]||0)-(o[f]||0);h+=p*p}return c?Math.sqrt(h):h},mandist:function(s,o,c){for(var l=s.length,h=0,f=0;f<l;f++)h+=Math.abs((s[f]||0)-(o[f]||0));return c?Math.sqrt(h):h},dist:function(s,o,c){var l=Math.abs(s-o);return c?l:l*l}}});var Ag=rt((OA,Rg)=>{"use strict";var Lg=Ku(),dx=Lg.eudist,fx=Lg.dist;Rg.exports={kmrand:function(s,o){for(var c={},l=[],h=o<<2,f=s.length,p=s[0].length>0;l.length<o&&h-- >0;){var y=s[Math.floor(Math.random()*f)],x=p?y.join("_"):""+y;c[x]||(c[x]=!0,l.push(y))}if(l.length<o)throw new Error("Error initializating clusters");return l},kmpp:function(s,o){var c=s[0].length?dx:fx,l=[],h=s.length,f=s[0].length>0,p={},y=s[Math.floor(Math.random()*h)],x=f?y.join("_"):""+y;for(l.push(y),p[x]=!0;l.length<o;){for(var S=[],O=l.length,N=0,z=[],X=0;X<h;X++){for(var $=1/0,I=0;I<O;I++){var k=c(s[X],l[I]);k<=$&&($=k)}S[X]=$}for(var T=0;T<h;T++)N+=S[T];for(var P=0;P<h;P++)z[P]={i:P,v:s[P],pr:S[P]/N,cs:0};z.sort(function(et,E){return et.pr-E.pr}),z[0].cs=z[0].pr;for(var Y=1;Y<h;Y++)z[Y].cs=z[Y-1].cs+z[Y].pr;for(var W=Math.random(),Z=0;Z<h-1&&z[Z++].cs<W;);l.push(z[Z-1].v)}return l}}});var qg=rt((LA,Bg)=>{"use strict";var th=Ku(),Fg=Ag(),px=th.eudist,kA=th.mandist,NA=th.dist,mx=Fg.kmrand,gx=Fg.kmpp,Tg=1e4;function Dg(r,s,o){o=o||[];for(var c=0;c<r;c++)o[c]=s;return o}function yx(r,s,o,c){var l=[],h=[],f=[],p=[],y=!1,x=c||Tg,S=r.length,O=r[0].length,N=O>0,z=[];if(o)o=="kmrand"?l=mx(r,s):o=="kmpp"?l=gx(r,s):l=o;else for(var X={};l.length<s;){var $=Math.floor(Math.random()*S);X[$]||(X[$]=!0,l.push(r[$]))}do{Dg(s,0,z);for(var I=0;I<S;I++){for(var k=1/0,T=0,P=0;P<s;P++){var p=N?px(r[I],l[P]):Math.abs(r[I]-l[P]);p<=k&&(k=p,T=P)}f[I]=T,z[T]++}for(var Y=[],h=[],W=0,Z=0;Z<s;Z++)Y[Z]=N?Dg(O,0,Y[Z]):0,h[Z]=l[Z];if(N){for(var et=0;et<s;et++)l[et]=[];for(var E=0;E<S;E++)for(var dt=f[E],wt=Y[dt],yt=r[E],L=0;L<O;L++)wt[L]+=yt[L];y=!0;for(var Le=0;Le<s;Le++){for(var st=l[Le],we=Y[Le],ri=h[Le],oi=z[Le],Me=0;Me<O;Me++)st[Me]=we[Me]/oi||0;if(y){for(var Ze=0;Ze<O;Ze++)if(ri[Ze]!=st[Ze]){y=!1;break}}}}else{for(var A=0;A<S;A++){var ji=f[A];Y[ji]+=r[A]}for(var De=0;De<s;De++)l[De]=Y[De]/z[De]||0;y=!0;for(var qn=0;qn<s;qn++)if(h[qn]!=l[qn]){y=!1;break}}y=y||--x<=0}while(!y);return{it:Tg-x,k:s,idxs:f,centroids:l}}Bg.exports=yx});var Ls=rt((sh,ah)=>{(function(r,s){typeof sh=="object"&&typeof ah<"u"?ah.exports=s():typeof define=="function"&&define.amd?define(s):(r=typeof globalThis<"u"?globalThis:r||self,r.polygonClipping=s())})(sh,function(){"use strict";function r(R,m){var v={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]}
1,trys:[],ops:[]},w,C,b,U;return U={next:D(0),throw:D(1),return:D(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function D(j){return function(F){return V([j,F])}}function V(j){if(w)throw new TypeError("Generator is already executing.");for(;v;)try{if(w=1,C&&(b=j[0]&2?C.return:j[0]?C.throw||((b=C.return)&&b.call(C),0):C.next)&&!(b=b.call(C,j[1])).done)return b;switch(C=0,b&&(j=[j[0]&2,b.value]),j[0]){case 0:case 1:b=j;break;case 4:return v.label++,{value:j[1],done:!1};case 5:v.label++,C=j[1],j=[0];continue;case 7:j=v.ops.pop(),v.trys.pop();continue;default:if(b=v.trys,!(b=b.length>0&&b[b.length-1])&&(j[0]===6||j[0]===2)){v=0;continue}if(j[0]===3&&(!b||j[1]>b[0]&&j[1]<b[3])){v.label=j[1];break}if(j[0]===6&&v.label<b[1]){v.label=b[1],b=j;break}if(b&&v.label<b[2]){v.label=b[2],v.ops.push(j);break}b[2]&&v.ops.pop(),v.trys.pop();continue}j=m.call(R,v)}catch(F){j=[6,F],C=0}finally{w=b=0}if(j[0]&5)throw j[1];return{value:j[0]?j[1]:void 0,done:!0}}}var s=function(){function R(m,v){this.next=null,this.key=m,this.data=v,this.left=null,this.right=null}return R}();function o(R,m){return R>m?1:R<m?-1:0}function c(R,m,v){for(var w=new s(null,null),C=w,b=w;;){var U=v(R,m.key);if(U<0){if(m.left===null)break;if(v(R,m.left.key)<0){var D=m.left;if(m.left=D.right,D.right=m,m=D,m.left===null)break}b.left=m,b=m,m=m.left}else if(U>0){if(m.right===null)break;if(v(R,m.right.key)>0){var D=m.right;if(m.right=D.left,D.left=m,m=D,m.right===null)break}C.right=m,C=m,m=m.right}else break}return C.right=m.left,b.left=m.right,m.left=w.right,m.right=w.left,m}function l(R,m,v,w){var C=new s(R,m);if(v===null)return C.left=C.right=null,C;v=c(R,v,w);var b=w(R,v.key);return b<0?(C.left=v.left,C.right=v,v.left=null):b>=0&&(C.right=v.right,C.left=v,v.right=null),C}function h(R,m,v){var w=null,C=null;if(m){m=c(R,m,v);var b=v(m.key,R);b===0?(w=m.left,C=m.right):b<0?(C=m.right,m.right=null,w=m):(w=m.left,m.left=null,C=m)}return{left:w,right:C}}function f(R,m,v){return m===null?R:(R===null||(m=c(R.key,m,v),m.left=R),m)}function p(R,m,v,w,C){if(R){w(""+m+(v?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+C(R)+`
2`);var b=m+(v?"    ":"\u2502   ");R.left&&p(R.left,b,!1,w,C),R.right&&p(R.right,b,!0,w,C)}}var y=function(){function R(m){m===void 0&&(m=o),this._root=null,this._size=0,this._comparator=m}return R.prototype.insert=function(m,v){return this._size++,this._root=l(m,v,this._root,this._comparator)},R.prototype.add=function(m,v){var w=new s(m,v);this._root===null&&(w.left=w.right=null,this._size++,this._root=w);var C=this._comparator,b=c(m,this._root,C),U=C(m,b.key);return U===0?this._root=b:(U<0?(w.left=b.left,w.right=b,b.left=null):U>0&&(w.right=b.right,w.left=b,b.right=null),this._size++,this._root=w),this._root},R.prototype.remove=function(m){this._root=this._remove(m,this._root,this._comparator)},R.prototype._remove=function(m,v,w){var C;if(v===null)return null;v=c(m,v,w);var b=w(m,v.key);return b===0?(v.left===null?C=v.right:(C=c(m,v.left,w),C.right=v.right),this._size--,C):v},R.prototype.pop=function(){var m=this._root;if(m){for(;m.left;)m=m.left;return this._root=c(m.key,this._root,this._comparator),this._root=this._remove(m.key,this._root,this._comparator),{key:m.key,data:m.data}}return null},R.prototype.findStatic=function(m){for(var v=this._root,w=this._comparator;v;){var C=w(m,v.key);if(C===0)return v;C<0?v=v.left:v=v.right}return null},R.prototype.find=function(m){return this._root&&(this._root=c(m,this._root,this._comparator),this._comparator(m,this._root.key)!==0)?null:this._root},R.prototype.contains=function(m){for(var v=this._root,w=this._comparator;v;){var C=w(m,v.key);if(C===0)return!0;C<0?v=v.left:v=v.right}return!1},R.prototype.forEach=function(m,v){for(var w=this._root,C=[],b=!1;!b;)w!==null?(C.push(w),w=w.left):C.length!==0?(w=C.pop(),m.call(v,w),w=w.right):b=!0;return this},R.prototype.range=function(m,v,w,C){for(var b=[],U=this._comparator,D=this._root,V;b.length!==0||D;)if(D)b.push(D),D=D.left;else{if(D=b.pop(),V=U(D.key,v),V>0)break;if(U(D.key,m)>=0&&w.call(C,D))return this;D=D.right}return this},R.prototype.keys=function(){var m=[];return this.forEach(function(v){var w=v.key;return m.push(w)}),m},R.prototype.values=function(){var m=[];return this.forEach(function(v){var w=v.data;return m.push(w)}),m},R.prototype.min=function(){return this._root?this.minNode(this._root).key:null},R.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},R.prototype.minNode=function(m){if(m===void 0&&(m=this._root),m)for(;m.left;)m=m.left;return m},R.prototype.maxNode=function(m){if(m===void 0&&(m=this._root),m)for(;m.right;)m=m.right;return m},R.prototype.at=function(m){for(var v=this._root,w=!1,C=0,b=[];!w;)if(v)b.push(v),v=v.left;else if(b.length>0){if(v=b.pop(),C===m)return v;C++,v=v.right}else w=!0;return null},R.prototype.next=function(m){var v=this._root,w=null;if(m.right){for(w=m.right;w.left;)w=w.left;return w}for(var C=this._comparator;v;){var b=C(m.key,v.key);if(b===0)break;b<0?(w=v,v=v.left):v=v.right}return w},R.prototype.prev=function(m){var v=this._root,w=null;if(m.left!==null){for(w=m.left;w.right;)w=w.right;return w}for(var C=this._comparator;v;){var b=C(m.key,v.key);if(b===0)break;b<0?v=v.left:(w=v,v=v.right)}return w},R.prototype.clear=function(){return this._root=null,this._size=0,this},R.prototype.toList=function(){return O(this._root)},R.prototype.load=function(m,v,w){v===void 0&&(v=[]),w===void 0&&(w=!1);var C=m.length,b=this._comparator;if(w&&X(m,v,0,C-1,b),this._root===null)this._root=x(m,v,0,C),this._size=C;else{var U=z(this.toList(),S(m,v),b);C=this._size+C,this._root=N({head:U},0,C)}return this},R.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(R.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),R.prototype.toString=function(m){m===void 0&&(m=function(w){return String(w.key)});var v=[];return p(this._root,"",!0,function(w){return v.push(w)},m),v.join("")},R.prototype.update=function(m,v,w){var C=this._comparator,b=h(m,this._root,C),U=b.left,D=b.right;C(m,v)<0?D=l(v,w,D,C):U=l(v,w,U,C),this._root=f(U,D,C)},R.prototype.split=function(m){return h(m,this._root,this._comparator)},R.prototype[Symbol.iterator]=function(){var m,v,w;return r(this,function(C){switch(C.label){case 0:m=this._root,v=[],w=!1,C.label=1;case 1:return w?[3,6]:m===null?[3,2]:(v.push(m),m=m.left,[3,5]);case 2:return v.length===0?[3,4]:(m=v.pop(),[4,m]);case 3:return C.sent(),m=m.right,[3,5];case 4:w=!0,C.label=5;case 5:return[3,1];case 6:return[2]}})},R}();function x(R,m,v,w){var C=w-v;if(C>0){var b=v+Math.floor(C/2),U=R[b],D=m[b],V=new s(U,D);return V.left=x(R,m,v,b),V.right=x(R,m,b+1,w),V}return null}function S(R,m){for(var v=new s(null,null),w=v,C=0;C<R.length;C++)w=w.next=new s(R[C],m[C]);
2return w.next=null,v.next}function O(R){for(var m=R,v=[],w=!1,C=new s(null,null),b=C;!w;)m?(v.push(m),m=m.left):v.length>0?(m=b=b.next=v.pop(),m=m.right):w=!0;return b.next=null,C.next}function N(R,m,v){var w=v-m;if(w>0){var C=m+Math.floor(w/2),b=N(R,m,C),U=R.head;return U.left=b,R.head=R.head.next,U.right=N(R,C+1,v),U}return null}function z(R,m,v){for(var w=new s(null,null),C=w,b=R,U=m;b!==null&&U!==null;)v(b.key,U.key)<0?(C.next=b,b=b.next):(C.next=U,U=U.next),C=C.next;return b!==null?C.next=b:U!==null&&(C.next=U),w.next}function X(R,m,v,w,C){if(!(v>=w)){for(var b=R[v+w>>1],U=v-1,D=w+1;;){do U++;while(C(R[U],b)<0);do D--;while(C(R[D],b)>0);if(U>=D)break;var V=R[U];R[U]=R[D],R[D]=V,V=m[U],m[U]=m[D],m[D]=V}X(R,m,v,D,C),X(R,m,D+1,w,C)}}let $=(R,m)=>R.ll.x<=m.x&&m.x<=R.ur.x&&R.ll.y<=m.y&&m.y<=R.ur.y,I=(R,m)=>{if(m.ur.x<R.ll.x||R.ur.x<m.ll.x||m.ur.y<R.ll.y||R.ur.y<m.ll.y)return null;let v=R.ll.x<m.ll.x?m.ll.x:R.ll.x,w=R.ur.x<m.ur.x?R.ur.x:m.ur.x,C=R.ll.y<m.ll.y?m.ll.y:R.ll.y,b=R.ur.y<m.ur.y?R.ur.y:m.ur.y;return{ll:{x:v,y:C},ur:{x:w,y:b}}},k=Number.EPSILON;k===void 0&&(k=Math.pow(2,-52));let T=k*k,P=(R,m)=>{if(-k<R&&R<k&&-k<m&&m<k)return 0;let v=R-m;return v*v<T*R*m?0:R<m?-1:1};class Y{constructor(){this.reset()}reset(){this.xRounder=new W,this.yRounder=new W}round(m,v){return{x:this.xRounder.round(m),y:this.yRounder.round(v)}}}class W{constructor(){this.tree=new y,this.round(0)}round(m){let v=this.tree.add(m),w=this.tree.prev(v);if(w!==null&&P(v.key,w.key)===0)return this.tree.remove(m),w.key;let C=this.tree.next(v);return C!==null&&P(v.key,C.key)===0?(this.tree.remove(m),C.key):m}}let Z=new Y,et=11102230246251565e-32,E=134217729,dt=(3+8*et)*et;
2function wt(R,m,v,w,C){let b,U,D,V,j=m[0],F=w[0],q=0,Q=0;F>j==F>-j?(b=j,j=m[++q]):(b=F,F=w[++Q]);let H=0;if(q<R&&Q<v)for(F>j==F>-j?(U=j+b,D=b-(U-j),j=m[++q]):(U=F+b,D=b-(U-F),F=w[++Q]),b=U,D!==0&&(C[H++]=D);q<R&&Q<v;)F>j==F>-j?(U=b+j,V=U-b,D=b-(U-V)+(j-V),j=m[++q]):(U=b+F,V=U-b,D=b-(U-V)+(F-V),F=w[++Q]),b=U,D!==0&&(C[H++]=D);for(;q<R;)U=b+j,V=U-b,D=b-(U-V)+(j-V),j=m[++q],b=U,D!==0&&(C[H++]=D);for(;Q<v;)U=b+F,V=U-b,D=b-(U-V)+(F-V),F=w[++Q],b=U,D!==0&&(C[H++]=D);return(b!==0||H===0)&&(C[H++]=b),H}function yt(R,m){let v=m[0];for(let w=1;w<R;w++)v+=m[w];return v}function L(R){return new Float64Array(R)}let Le=(3+16*et)*et,st=(2+12*et)*et,we=(9+64*et)*et*et,ri=L(4),oi=L(8),Me=L(12),Ze=L(16),A=L(4);function ji(R,m,v,w,C,b,U){let D,V,j,F,q,Q,H,vt,ft,Mt,xt,Re,mi,ai,ke,ci,$i,Be,_t=R-C,qe=v-C,$e=m-b,Ge=w-b;ai=_t*Ge,Q=E*_t,H=Q-(Q-_t),vt=_t-H,Q=E*Ge,ft=Q-(Q-Ge),Mt=Ge-ft,ke=vt*Mt-(ai-H*ft-vt*ft-H*Mt),ci=$e*qe,Q=E*$e,H=Q-(Q-$e),vt=$e-H,Q=E*qe,ft=Q-(Q-qe),Mt=qe-ft,$i=vt*Mt-(ci-H*ft-vt*ft-H*Mt),xt=ke-$i,q=ke-xt,ri[0]=ke-(xt+q)+(q-$i),Re=ai+xt,q=Re-ai,mi=ai-(Re-q)+(xt-q),xt=mi-ci,q=mi-xt,ri[1]=mi-(xt+q)+(q-ci),Be=Re+xt,q=Be-Re,ri[2]=Re-(Be-q)+(xt-q),ri[3]=Be;let Pe=yt(4,ri),Mn=st*U;if(Pe>=Mn||-Pe>=Mn||(q=R-_t,D=R-(_t+q)+(q-C),q=v-qe,j=v-(qe+q)+(q-C),q=m-$e,V=m-($e+q)+(q-b),q=w-Ge,F=w-(Ge+q)+(q-b),D===0&&V===0&&j===0&&F===0)||(Mn=we*U+dt*Math.abs(Pe),Pe+=_t*F+Ge*D-($e*j+qe*V),Pe>=Mn||-Pe>=Mn))return Pe;ai=D*Ge,Q=E*D,H=Q-(Q-D),vt=D-H,Q=E*Ge,ft=Q-(Q-Ge),Mt=Ge-ft,ke=vt*Mt-(ai-H*ft-vt*ft-H*Mt),ci=V*qe,Q=E*V,H=Q-(Q-V),vt=V-H,Q=E*qe,ft=Q-(Q-qe),Mt=qe-ft,$i=vt*Mt-(ci-H*ft-vt*ft-H*Mt),xt=ke-$i,q=ke-xt,A[0]=ke-(xt+q)+(q-$i),Re=ai+xt,q=Re-ai,mi=ai-(Re-q)+(xt-q),xt=mi-ci,q=mi-xt,A[1]=mi-(xt+q)+(q-ci),Be=Re+xt,q=Be-Re,A[2]=Re-(Be-q)+(xt-q),A[3]=Be;let on=wt(4,ri,4,A,oi);ai=_t*F,Q=E*_t,H=Q-(Q-_t),vt=_t-H,Q=E*F,ft=Q-(Q-F),Mt=F-ft,ke=vt*Mt-(ai-H*ft-vt*ft-H*Mt),ci=$e*j,Q=E*$e,H=Q-(Q-$e),vt=$e-H,Q=E*j,ft=Q-(Q-j),Mt=j-ft,$i=vt*Mt-(ci-H*ft-vt*ft-H*Mt),xt=ke-$i,q=ke-xt,A[0]=ke-(xt+q)+(q-$i),Re=ai+xt,q=Re-ai,mi=ai-(Re-q)+(xt-q),xt=mi-ci,q=mi-xt,A[1]=mi-(xt+q)+(q-ci),Be=Re+xt,q=Be-Re,A[2]=Re-(Be-q)+(xt-q),A[3]=Be;let Yo=wt(on,oi,4,A,Me);ai=D*F,Q=E*D,H=Q-(Q-D),vt=D-H,Q=E*F,ft=Q-(Q-F),Mt=F-ft,ke=vt*Mt-(ai-H*ft-vt*ft-H*Mt),ci=V*j,Q=E*V,H=Q-(Q-V),vt=V-H,Q=E*j,ft=Q-(Q-j),Mt=j-ft,$i=vt*Mt-(ci-H*ft-vt*ft-H*Mt),xt=ke-$i,q=ke-xt,A[0]=ke-(xt+q)+(q-$i),Re=ai+xt,q=Re-ai,mi=ai-(Re-q)+(xt-q),xt=mi-ci,q=mi-xt,A[1]=mi-(xt+q)+(q-ci),Be=Re+xt,q=Be-Re,A[2]=Re-(Be-q)+(xt-q),A[3]=Be;let sn=wt(Yo,Me,4,A,Ze);return Ze[sn-1]}function De(R,m,v,w,C,b){let U=(m-b)*(v-C),D=(R-C)*(w-b),V=U-D,j=Math.abs(U+D);return Math.abs(V)>=Le*j?V:-ji(R,m,v,w,C,b,j)}let qn=(R,m)=>R.x*m.y-R.y*m.x,Et=(R,m)=>R.x*m.x+R.y*m.y,Jr=(R,m,v)=>{let w=De(R.x,R.y,m.x,m.y,v.x,v.y);return w>0?-1:w<0?1:0},vo=R=>Math.sqrt(Et(R,R)),Zr=(R,m,v)=>{let w={x:m.x-R.x,y:m.y-R.y},C={x:v.x-R.x,y:v.y-R.y};return qn(C,w)/vo(C)/vo(w)},si=(R,m,v)=>{let w={x:m.x-R.x,y:m.y-R.y},C={x:v.x-R.x,y:v.y-R.y};return Et(C,w)/vo(C)/vo(w)},rn=(R,m,v)=>m.y===0?null:{x:R.x+m.x/m.y*(v-R.y),y:v},ct=(R,m,v)=>m.x===0?null:{x:v,y:R.y+m.y/m.x*(v-R.x)},Ta=(R,m,v,w)=>{if(m.x===0)return ct(v,w,R.x);if(w.x===0)return ct(R,m,v.x);if(m.y===0)return rn(v,w,R.y);if(w.y===0)return rn(R,m,v.y);let C=qn(m,w);if(C==0)return null;let b={x:v.x-R.x,y:v.y-R.y},U=qn(b,m)/C,D=qn(b,w)/C,V=R.x+D*m.x,j=v.x+U*w.x,F=R.y+D*m.y,q=v.y+U*w.y,Q=(V+j)/2,H=(F+q)/2;return{x:Q,y:H}};class Fe{static compare(m,v){let w=Fe.comparePoints(m.point,v.point);return w!==0?w:(m.point!==v.point&&m.link(v),m.isLeft!==v.isLeft?m.isLeft?1:-1:bi.compare(m.segment,v.segment))}static comparePoints(m,v){return m.x<v.x?-1:m.x>v.x?1:m.y<v.y?-1:m.y>v.y?1:0}constructor(m,v){m.events===void 0?m.events=[this]:m.events.push(this),this.point=m,this.isLeft=v}link(m){if(m.point===this.point)throw new Error("Tried to link already linked events");let v=m.point.events;for(let w=0,C=v.length;w<C;w++){let b=v[w];this.point.events.push(b),b.point=this.point}this.checkForConsuming()}checkForConsuming(){let m=this.point.events.length;for(let v=0;v<m;v++){let w=this.point.events[v];if(w.segment.consumedBy===void 0)for(let C=v+1;C<m;C++){let b=this.point.events[C];b.consumedBy===void 0&&w.otherSE.point.events===b.otherSE.point.events&&w.segment.consume(b.segment)}}}getAvailableLinkedEvents(){let m=[];for(let v=0,w=this.point.events.length;v<w;v++){let C=this.point.events[v];C!==this&&!C.segment.ringOut&&C.segment.isInResult()&&m.push(C)}return m}getLeftmostComparator(m){let v=new Map,w=C=>{let b=C.otherSE;v.set(C,{sine:Zr(this.point,m.point,b.point),cosine:si(this.point,m.point,b.point)})};return(C,b)=>{v.has(C)||w(C),v.has(b)||w(b);let{sine:U,cosine:D}=v.get(C),{sine:V,cosine:j}=v.get(b);return U>=0&&V>=0?D<j?1:D>j?-1:0:U<0&&V<0?D<j?-1:D>j?1:0:V<U?-1:V>U?1:0}}}let Xo=0;
2class bi{static compare(m,v){let w=m.leftSE.point.x,C=v.leftSE.point.x,b=m.rightSE.point.x,U=v.rightSE.point.x;if(U<w)return 1;if(b<C)return-1;let D=m.leftSE.point.y,V=v.leftSE.point.y,j=m.rightSE.point.y,F=v.rightSE.point.y;if(w<C){if(V<D&&V<j)return 1;if(V>D&&V>j)return-1;let q=m.comparePoint(v.leftSE.point);if(q<0)return 1;if(q>0)return-1;let Q=v.comparePoint(m.rightSE.point);return Q!==0?Q:-1}if(w>C){if(D<V&&D<F)return-1;if(D>V&&D>F)return 1;let q=v.comparePoint(m.leftSE.point);if(q!==0)return q;let Q=m.comparePoint(v.rightSE.point);return Q<0?1:Q>0?-1:1}if(D<V)return-1;if(D>V)return 1;if(b<U){let q=v.comparePoint(m.rightSE.point);if(q!==0)return q}if(b>U){let q=m.comparePoint(v.rightSE.point);if(q<0)return 1;if(q>0)return-1}if(b!==U){let q=j-D,Q=b-w,H=F-V,vt=U-C;if(q>Q&&H<vt)return 1;if(q<Q&&H>vt)return-1}return b>U?1:b<U||j<F?-1:j>F?1:m.id<v.id?-1:m.id>v.id?1:0}constructor(m,v,w,C){this.id=++Xo,this.leftSE=m,m.segment=this,m.otherSE=v,this.rightSE=v,v.segment=this,v.otherSE=m,this.rings=w,this.windings=C}static fromRing(m,v,w){let C,b,U,D=Fe.comparePoints(m,v);if(D<0)C=m,b=v,U=1;else if(D>0)C=v,b=m,U=-1;else throw new Error(`Tried to create degenerate segment at [${m.x}, ${m.y}]`);let V=new Fe(C,!0),j=new Fe(b,!1);return new bi(V,j,[w],[U])}replaceRightSE(m){this.rightSE=m,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let m=this.leftSE.point.y,v=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:m<v?m:v},ur:{x:this.rightSE.point.x,y:m>v?m:v}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(m){return m.x===this.leftSE.point.x&&m.y===this.leftSE.point.y||m.x===this.rightSE.point.x&&m.y===this.rightSE.point.y}comparePoint(m){if(this.isAnEndpoint(m))return 0;let v=this.leftSE.point,w=this.rightSE.point,C=this.vector();if(v.x===w.x)return m.x===v.x?0:m.x<v.x?1:-1;let b=(m.y-v.y)/C.y,U=v.x+b*C.x;if(m.x===U)return 0;let D=(m.x-v.x)/C.x,V=v.y+D*C.y;return m.y===V?0:m.y<V?-1:1}getIntersection(m){let v=this.bbox(),w=m.bbox(),C=I(v,w);if(C===null)return null;let b=this.leftSE.point,U=this.rightSE.point,D=m.leftSE.point,V=m.rightSE.point,j=$(v,D)&&this.comparePoint(D)===0,F=$(w,b)&&m.comparePoint(b)===0,q=$(v,V)&&this.comparePoint(V)===0,Q=$(w,U)&&m.comparePoint(U)===0;if(F&&j)return Q&&!q?U:!Q&&q?V:null;if(F)return q&&b.x===V.x&&b.y===V.y?null:b;if(j)return Q&&U.x===D.x&&U.y===D.y?null:D;if(Q&&q)return null;if(Q)return U;if(q)return V;let H=Ta(b,this.vector(),D,m.vector());return H===null||!$(C,H)?null:Z.round(H.x,H.y)}split(m){let v=[],w=m.events!==void 0,C=new Fe(m,!0),b=new Fe(m,!1),U=this.rightSE;this.replaceRightSE(b),v.push(b),v.push(C);let D=new bi(C,U,this.rings.slice(),this.windings.slice());return Fe.comparePoints(D.leftSE.point,D.rightSE.point)>0&&D.swapEvents(),Fe.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),w&&(C.checkForConsuming(),b.checkForConsuming()),v}swapEvents(){let m=this.rightSE;this.rightSE=this.leftSE,this.leftSE=m,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let v=0,w=this.windings.length;v<w;v++)this.windings[v]*=-1}consume(m){let v=this,w=m;for(;v.consumedBy;)v=v.consumedBy;for(;w.consumedBy;)w=w.consumedBy;let C=bi.compare(v,w);if(C!==0){if(C>0){let b=v;v=w,w=b}if(v.prev===w){let b=v;v=w,w=b}for(let b=0,U=w.rings.length;b<U;b++){let D=w.rings[b],V=w.windings[b],j=v.rings.indexOf(D);j===-1?(v.rings.push(D),v.windings.push(V)):v.windings[j]+=V}w.rings=null,w.windings=null,w.consumedBy=v,w.leftSE.consumedBy=v.leftSE,w.rightSE.consumedBy=v.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let m=this.prev.consumedBy||this.prev;this._beforeState=m.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let m=this.beforeState();this._afterState={rings:m.rings.slice(0),windings:m.windings.slice(0),multiPolys:[]};let v=this._afterState.rings,w=this._afterState.windings,C=this._afterState.multiPolys;for(let D=0,V=this.rings.length;D<V;D++){let j=this.rings[D],F=this.windings[D],q=v.indexOf(j);q===-1?(v.push(j),w.push(F)):w[q]+=F}let b=[],U=[];for(let D=0,V=v.length;D<V;D++){if(w[D]===0)continue;let j=v[D],F=j.poly;if(U.indexOf(F)===-1)if(j.isExterior)b.push(F);else{U.indexOf(F)===-1&&U.push(F);let q=b.indexOf(j.poly);q!==-1&&b.splice(q,1)}}for(let D=0,V=b.length;D<V;D++){let j=b[D].multiPoly;C.indexOf(j)===-1&&C.push(j)}return this._afterState}
2isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let m=this.beforeState().multiPolys,v=this.afterState().multiPolys;switch(tt.type){case"union":{let w=m.length===0,C=v.length===0;this._isInResult=w!==C;break}case"intersection":{let w,C;m.length<v.length?(w=m.length,C=v.length):(w=v.length,C=m.length),this._isInResult=C===tt.numMultiPolys&&w<C;break}case"xor":{let w=Math.abs(m.length-v.length);this._isInResult=w%2===1;break}case"difference":{let w=C=>C.length===1&&C[0].isSubject;this._isInResult=w(m)!==w(v);break}default:throw new Error(`Unrecognized operation type found ${tt.type}`)}return this._isInResult}}class Rr{constructor(m,v,w){if(!Array.isArray(m)||m.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=v,this.isExterior=w,this.segments=[],typeof m[0][0]!="number"||typeof m[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let C=Z.round(m[0][0],m[0][1]);this.bbox={ll:{x:C.x,y:C.y},ur:{x:C.x,y:C.y}};let b=C;for(let U=1,D=m.length;U<D;U++){if(typeof m[U][0]!="number"||typeof m[U][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let V=Z.round(m[U][0],m[U][1]);V.x===b.x&&V.y===b.y||(this.segments.push(bi.fromRing(b,V,this)),V.x<this.bbox.ll.x&&(this.bbox.ll.x=V.x),V.y<this.bbox.ll.y&&(this.bbox.ll.y=V.y),V.x>this.bbox.ur.x&&(this.bbox.ur.x=V.x),V.y>this.bbox.ur.y&&(this.bbox.ur.y=V.y),b=V)}(C.x!==b.x||C.y!==b.y)&&this.segments.push(bi.fromRing(b,C,this))}getSweepEvents(){let m=[];for(let v=0,w=this.segments.length;v<w;v++){let C=this.segments[v];m.push(C.leftSE),m.push(C.rightSE)}return m}}class mn{constructor(m,v){if(!Array.isArray(m))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Rr(m[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let w=1,C=m.length;w<C;w++){let b=new Rr(m[w],this,!1);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.interiorRings.push(b)}this.multiPoly=v}getSweepEvents(){let m=this.exteriorRing.getSweepEvents();for(let v=0,w=this.interiorRings.length;v<w;v++){let C=this.interiorRings[v].getSweepEvents();for(let b=0,U=C.length;b<U;b++)m.push(C[b])}return m}}class Ln{constructor(m,v){if(!Array.isArray(m))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof m[0][0][0]=="number"&&(m=[m])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let w=0,C=m.length;w<C;w++){let b=new mn(m[w],this);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.polys.push(b)}this.isSubject=v}getSweepEvents(){let m=[];for(let v=0,w=this.polys.length;v<w;v++){let C=this.polys[v].getSweepEvents();for(let b=0,U=C.length;b<U;b++)m.push(C[b])}return m}}class Ar{static factory(m){let v=[];for(let w=0,C=m.length;w<C;w++){let b=m[w];if(!b.isInResult()||b.ringOut)continue;let U=null,D=b.leftSE,V=b.rightSE,j=[D],F=D.point,q=[];for(;U=D,D=V,j.push(D),D.point!==F;)for(;;){let Q=D.getAvailableLinkedEvents();if(Q.length===0){let ft=j[0].point,Mt=j[j.length-1].point;throw new Error(`Unable to complete output ring starting at [${ft.x}, ${ft.y}]. Last matching segment found ends at [${Mt.x}, ${Mt.y}].`)}if(Q.length===1){V=Q[0].otherSE;break}let H=null;for(let ft=0,Mt=q.length;ft<Mt;ft++)if(q[ft].point===D.point){H=ft;break}if(H!==null){let ft=q.splice(H)[0],Mt=j.splice(ft.index);Mt.unshift(Mt[0].otherSE),v.push(new Ar(Mt.reverse()));continue}q.push({index:j.length,point:D.point});let vt=D.getLeftmostComparator(U);V=Q.sort(vt)[0].otherSE;break}v.push(new Ar(j))}return v}constructor(m){this.events=m;for(let v=0,w=m.length;v<w;v++)m[v].segment.ringOut=this;this.poly=null}getGeom(){let m=this.events[0].point,v=[m];for(let j=1,F=this.events.length-1;j<F;j++){let q=this.events[j].point,Q=this.events[j+1].point;Jr(q,m,Q)!==0&&(v.push(q),m=q)}if(v.length===1)return null;let w=v[0],C=v[1];Jr(w,m,C)===0&&v.shift(),v.push(v[0]);let b=this.isExteriorRing()?1:-1,U=this.isExteriorRing()?0:v.length-1,D=this.isExteriorRing()?v.length:-1,V=[];for(let j=U;j!=D;j+=b)V.push([v[j].x,v[j].y]);return V}isExteriorRing(){if(this._isExteriorRing===void 0){let m=this.enclosingRing();this._isExteriorRing=m?!m.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let m=this.events[0];for(let C=1,b=this.events.length;C<b;C++){let U=this.events[C];Fe.compare(m,U)>0&&(m=U)}let v=m.segment.prevInResult(),w=v?v.prevInResult():null;for(;;){if(!v)return null;if(!w)return v.ringOut;
2if(w.ringOut!==v.ringOut)return w.ringOut.enclosingRing()!==v.ringOut?v.ringOut:v.ringOut.enclosingRing();v=w.prevInResult(),w=v?v.prevInResult():null}}}class pt{constructor(m){this.exteriorRing=m,m.poly=this,this.interiorRings=[]}addInterior(m){this.interiorRings.push(m),m.poly=this}getGeom(){let m=[this.exteriorRing.getGeom()];if(m[0]===null)return null;for(let v=0,w=this.interiorRings.length;v<w;v++){let C=this.interiorRings[v].getGeom();C!==null&&m.push(C)}return m}}class be{constructor(m){this.rings=m,this.polys=this._composePolys(m)}getGeom(){let m=[];for(let v=0,w=this.polys.length;v<w;v++){let C=this.polys[v].getGeom();C!==null&&m.push(C)}return m}_composePolys(m){let v=[];for(let w=0,C=m.length;w<C;w++){let b=m[w];if(!b.poly)if(b.isExteriorRing())v.push(new pt(b));else{let U=b.enclosingRing();U.poly||v.push(new pt(U)),U.poly.addInterior(b)}}return v}}class Tr{constructor(m){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bi.compare;this.queue=m,this.tree=new y(v),this.segments=[]}process(m){let v=m.segment,w=[];if(m.consumedBy)return m.isLeft?this.queue.remove(m.otherSE):this.tree.remove(v),w;let C=m.isLeft?this.tree.add(v):this.tree.find(v);if(!C)throw new Error(`Unable to find segment #${v.id} [${v.leftSE.point.x}, ${v.leftSE.point.y}] -> [${v.rightSE.point.x}, ${v.rightSE.point.y}] in SweepLine tree.`);let b=C,U=C,D,V;for(;D===void 0;)b=this.tree.prev(b),b===null?D=null:b.key.consumedBy===void 0&&(D=b.key);for(;V===void 0;)U=this.tree.next(U),U===null?V=null:U.key.consumedBy===void 0&&(V=U.key);if(m.isLeft){let j=null;if(D){let q=D.getIntersection(v);if(q!==null&&(v.isAnEndpoint(q)||(j=q),!D.isAnEndpoint(q))){let Q=this._splitSafely(D,q);for(let H=0,vt=Q.length;H<vt;H++)w.push(Q[H])}}let F=null;if(V){let q=V.getIntersection(v);if(q!==null&&(v.isAnEndpoint(q)||(F=q),!V.isAnEndpoint(q))){let Q=this._splitSafely(V,q);for(let H=0,vt=Q.length;H<vt;H++)w.push(Q[H])}}if(j!==null||F!==null){let q=null;j===null?q=F:F===null?q=j:q=Fe.comparePoints(j,F)<=0?j:F,this.queue.remove(v.rightSE),w.push(v.rightSE);let Q=v.split(q);for(let H=0,vt=Q.length;H<vt;H++)w.push(Q[H])}w.length>0?(this.tree.remove(v),w.push(m)):(this.segments.push(v),v.prev=D)}else{if(D&&V){let j=D.getIntersection(V);if(j!==null){if(!D.isAnEndpoint(j)){let F=this._splitSafely(D,j);for(let q=0,Q=F.length;q<Q;q++)w.push(F[q])}if(!V.isAnEndpoint(j)){let F=this._splitSafely(V,j);for(let q=0,Q=F.length;q<Q;q++)w.push(F[q])}}}this.tree.remove(v)}return w}_splitSafely(m,v){this.tree.remove(m);let w=m.rightSE;this.queue.remove(w);let C=m.split(v);return C.push(w),m.consumedBy===void 0&&this.tree.add(m),C}}let Jn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Dr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Cn{run(m,v,w){tt.type=m,Z.reset();let C=[new Ln(v,!0)];for(let q=0,Q=w.length;q<Q;q++)C.push(new Ln(w[q],!1));if(tt.numMultiPolys=C.length,tt.type==="difference"){let q=C[0],Q=1;for(;Q<C.length;)I(C[Q].bbox,q.bbox)!==null?Q++:C.splice(Q,1)}if(tt.type==="intersection")for(let q=0,Q=C.length;q<Q;q++){let H=C[q];for(let vt=q+1,ft=C.length;vt<ft;vt++)if(I(H.bbox,C[vt].bbox)===null)return[]}let b=new y(Fe.compare);for(let q=0,Q=C.length;q<Q;q++){let H=C[q].getSweepEvents();for(let vt=0,ft=H.length;vt<ft;vt++)if(b.insert(H[vt]),b.size>Jn)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let U=new Tr(b),D=b.size,V=b.pop();for(;V;){let q=V.key;if(b.size===D){let H=q.segment;throw new Error(`Unable to pop() ${q.isLeft?"left":"right"} SweepEvent [${q.point.x}, ${q.point.y}] from segment #${H.id} [${H.leftSE.point.x}, ${H.leftSE.point.y}] -> [${H.rightSE.point.x}, ${H.rightSE.point.y}] from queue.`)}if(b.size>Jn)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(U.segments.length>Dr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let Q=U.process(q);for(let H=0,vt=Q.length;H<vt;H++){let ft=Q[H];ft.consumedBy===void 0&&b.insert(ft)}D=b.size,V=b.pop()}Z.reset();let j=Ar.factory(U.segments);return new be(j).getGeom()}}let tt=new Cn;var As={union:function(R){for(var m=arguments.length,v=new Array(m>1?m-1:0),w=1;w<m;w++)v[w-1]=arguments[w];return tt.run("union",R,v)},intersection:function(R){for(var m=arguments.length,v=new Array(m>1?m-1:0),w=1;w<m;w++)v[w-1]=arguments[w];return tt.run("intersection",R,v)},xor:function(R){for(var m=arguments.length,v=new Array(m>1?m-1:0),w=1;w<m;w++)v[w-1]=arguments[w];return tt.run("xor",R,v)},difference:function(R){for(var m=arguments.length,v=new Array(m>1?m-1:0),w=1;w<m;w++)v[w-1]=arguments[w];return tt.run("difference",R,v)}};return As})});var o0=rt((Wc,r0)=>{(function(r,s){typeof Wc=="object"&&typeof r0<"u"?s(Wc):typeof define=="function"&&define.amd?define(["exports"],s):s(r.jsts={})})(Wc,function(r){"use strict";function s(){}function o(t){this.message=t||""}function c(t){this.message=t||""}function l(t){this.message=t||""}function h(){}function f(t){return t===null?ke:t.color}function p(t){return t===null?null:t.parent}function y(t,e){t!==null&&(t.color=e)}function x(t){return t===null?null:t.left}function S(t){return t===null?null:t.right}function O(){this.root_=null,this.size_=0}function N(){}function z(){this.array_=[],arguments[0]instanceof D&&this.addAll(
2arguments[0])}function X(){}function $(t){this.message=t||""}function I(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),i=Math.max(Math.min(e.length,9007199254740991),0)||0,n=1 in arguments&&parseInt(Number(arguments[1]),10)||0;n=n<0?Math.max(i+n,0):Math.min(n,i);var a=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:i;for(a=a<0?Math.max(i+arguments[2],0):Math.min(a,i);n<a;)e[n]=t,++n;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return typeof t=="number"&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var k=function(){};k.prototype.interfaces_=function(){return[]},k.prototype.getClass=function(){return k},k.prototype.equalsWithTolerance=function(t,e,i){return Math.abs(t-e)<=i};var T=function(t){function e(i){t.call(this,i),this.name="IllegalArgumentException",this.message=i,this.stack=new t().stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),P=function(){},Y={MAX_VALUE:{configurable:!0}};P.isNaN=function(t){return Number.isNaN(t)},P.doubleToLongBits=function(t){return t},P.longBitsToDouble=function(t){return t},P.isInfinite=function(t){return!Number.isFinite(t)},Y.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(P,Y);var W=function(){},Z=function(){},et=function(){},E=function t(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},dt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};E.prototype.setOrdinate=function(t,e){switch(t){case E.X:this.x=e;break;case E.Y:this.y=e;break;case E.Z:this.z=e;break;default:throw new T("Invalid ordinate index: "+t)}},E.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(arguments.length===2){var e=arguments[0],i=arguments[1];return!!k.equalsWithTolerance(this.x,e.x,i)&&!!k.equalsWithTolerance(this.y,e.y,i)}},E.prototype.getOrdinate=function(t){switch(t){case E.X:return this.x;case E.Y:return this.y;case E.Z:return this.z}throw new T("Invalid ordinate index: "+t)},E.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||P.isNaN(this.z))&&P.isNaN(t.z)},E.prototype.equals=function(t){return t instanceof E&&this.equals2D(t)},E.prototype.equalInZ=function(t,e){return k.equalsWithTolerance(this.z,t.z,e)},E.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},E.prototype.clone=function(){},E.prototype.copy=function(){return new E(this)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},E.prototype.distance3D=function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+i*i+n*n)},E.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},E.prototype.hashCode=function(){var t=17;return t=37*t+E.hashCode(this.x),t=37*t+E.hashCode(this.y)},E.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},E.prototype.interfaces_=function(){return[W,Z,s]},E.prototype.getClass=function(){return E},E.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=P.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},dt.DimensionalComparator.get=function(){return wt},dt.serialVersionUID.get=function(){return 6683108902428367e3},dt.NULL_ORDINATE.get=function(){return P.NaN},dt.X.get=function(){return 0},dt.Y.get=function(){return 1},dt.Z.get=function(){return 2},Object.defineProperties(E,dt);var wt=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new T("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};wt.prototype.compare=function(t,e){var i=t,n=e,a=wt.compare(i.x,n.x);if(a!==0)return a;var u=wt.compare(i.y,n.y);return u!==0?u:this._dimensionsToTest<=2?0:wt.compare(i.z,n.z)},wt.prototype.interfaces_=function(){return[et]},wt.prototype.getClass=function(){return wt},wt.compare=function(t,e){return t<e?-1:t>e?1:P.isNaN(t)?P.isNaN(e)?0:-1:P.isNaN(e)?1:0};var yt=function(){};yt.prototype.create=function(){},yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt};var L=function(){},Le={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};L.prototype.interfaces_=function(){return[]},L.prototype.getClass=function(){return L}
2,L.toLocationSymbol=function(t){switch(t){case L.EXTERIOR:return"e";case L.BOUNDARY:return"b";case L.INTERIOR:return"i";case L.NONE:return"-"}throw new T("Unknown location value: "+t)},Le.INTERIOR.get=function(){return 0},Le.BOUNDARY.get=function(){return 1},Le.EXTERIOR.get=function(){return 2},Le.NONE.get=function(){return-1},Object.defineProperties(L,Le);var st=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},we=function(){},ri={LOG_10:{configurable:!0}};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.log10=function(t){var e=Math.log(t);return P.isInfinite(e)||P.isNaN(e)?e:e/we.LOG_10},we.min=function(t,e,i,n){var a=t;return e<a&&(a=e),i<a&&(a=i),n<a&&(a=n),a},we.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],i=arguments[2];return t<e?e:t>i?i:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],a=arguments[1],u=arguments[2];return n<a?a:n>u?u:n}},we.wrap=function(t,e){return t<0?e- -t%e:t%e},we.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2],n=t;return e>n&&(n=e),i>n&&(n=i),n}if(arguments.length===4){var a=arguments[0],u=arguments[1],d=arguments[2],g=arguments[3],_=a;return u>_&&(_=u),d>_&&(_=d),g>_&&(_=g),_}},we.average=function(t,e){return(t+e)/2},ri.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(we,ri);var oi=function(t){this.str=t};oi.prototype.append=function(t){this.str+=t},oi.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},oi.prototype.toString=function(t){return this.str};var Me=function(t){this.value=t};Me.prototype.intValue=function(){return this.value},Me.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Me.isNaN=function(t){return Number.isNaN(t)};var Ze=function(){};Ze.isWhitespace=function(t){return t<=32&&t>=0||t===127},Ze.toUpperCase=function(t){return t.toUpperCase()};var A=function t(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var i=arguments[0];this.init(i)}else if(typeof arguments[0]=="string"){var n=arguments[0];t.call(this,t.parse(n))}}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.init(a,u)}},ji={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}};A.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},A.prototype.extractSignificantDigits=function(t,e){var i=this.abs(),n=A.magnitude(i._hi),a=A.TEN.pow(n);(i=i.divide(a)).gt(A.TEN)?(i=i.divide(A.TEN),n+=1):i.lt(A.ONE)&&(i=i.multiply(A.TEN),n-=1);for(var u=n+1,d=new oi,g=A.MAX_PRINT_DIGITS-1,_=0;_<=g;_++){t&&_===u&&d.append(".");var M=Math.trunc(i._hi);if(M<0)break;var B=!1,G=0;M>9?(B=!0,G="9"):G="0"+M,d.append(G),i=i.subtract(A.valueOf(M)).multiply(A.TEN),B&&i.selfAdd(A.TEN);var it=!0,nt=A.magnitude(i._hi);if(nt<0&&Math.abs(nt)>=g-_&&(it=!1),!it)break}return e[0]=n,d.toString()},A.prototype.sqr=function(){return this.multiply(this)},A.prototype.doubleValue=function(){return this._hi+this._lo},A.prototype.subtract=function(){if(arguments[0]instanceof A){var t=arguments[0];return this.add(t.negate())}if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},A.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},A.prototype.isZero=function(){return this._hi===0&&this._lo===0},A.prototype.selfSubtract=function(){if(arguments[0]instanceof A){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},A.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},A.prototype.min=function(t){return this.le(t)?this:t},A.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1],a=null,u=null,d=null,g=null,_=null,M=null,B=null,G=null;return _=this._hi/i,M=A.SPLIT*_,a=M-_,G=A.SPLIT*i,a=M-a,u=_-a,d=G-i,B=_*i,d=G-d,g=i-d,G=a*d-B+a*g+u*d+u*g,M=(this._hi-B-G+this._lo-_*n)/i,G=_+M,this._hi=G,this._lo=_-G+M,this}},A.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},A.prototype.divide=function(){if(arguments[0]instanceof A){var t=arguments[0],e=null,i=null,n=null,a=null,u=null,d=null,g=null,_=null;
2return i=(u=this._hi/t._hi)-(e=(d=A.SPLIT*u)-(e=d-u)),_=e*(n=(_=A.SPLIT*t._hi)-(n=_-t._hi))-(g=u*t._hi)+e*(a=t._hi-n)+i*n+i*a,d=(this._hi-g-_+this._lo-u*t._lo)/t._hi,new A(_=u+d,u-_+d)}if(typeof arguments[0]=="number"){var M=arguments[0];return P.isNaN(M)?A.createNaN():A.copy(this).selfDivide(M,0)}},A.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},A.prototype.pow=function(t){if(t===0)return A.valueOf(1);var e=new A(this),i=A.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&i.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else i=e;return t<0?i.reciprocal():i},A.prototype.ceil=function(){if(this.isNaN())return A.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new A(t,e)},A.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},A.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},A.prototype.setValue=function(){if(arguments[0]instanceof A){var t=arguments[0];return this.init(t),this}if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},A.prototype.max=function(t){return this.ge(t)?this:t},A.prototype.sqrt=function(){if(this.isZero())return A.valueOf(0);if(this.isNegative())return A.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,i=A.valueOf(e),n=this.subtract(i.sqr())._hi*(.5*t);return i.add(n)},A.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0],i=null,n=null,a=null,u=null,d=null,g=null;return a=this._hi+e,d=a-this._hi,u=a-d,u=e-d+(this._hi-u),g=u+this._lo,i=a+g,n=g+(a-i),this._hi=i+n,this._lo=n+(i-this._hi),this}}else if(arguments.length===2){var _=arguments[0],M=arguments[1],B=null,G=null,it=null,nt=null,at=null,ut=null,de=null;nt=this._hi+_,G=this._lo+M,at=nt-(ut=nt-this._hi),it=G-(de=G-this._lo);
2var Qe=(B=nt+(ut=(at=_-ut+(this._hi-at))+G))+(ut=(it=M-de+(this._lo-it))+(ut+(nt-B))),Bi=ut+(B-Qe);return this._hi=Qe,this._lo=Bi,this}},A.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof A){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1],a=null,u=null,d=null,g=null,_=null,M=null;a=(_=A.SPLIT*this._hi)-this._hi,M=A.SPLIT*i,a=_-a,u=this._hi-a,d=M-i;var B=(_=this._hi*i)+(M=a*(d=M-d)-_+a*(g=i-d)+u*d+u*g+(this._hi*n+this._lo*i)),G=M+(a=_-B);return this._hi=B,this._lo=G,this}},A.prototype.selfSqr=function(){return this.selfMultiply(this)},A.prototype.floor=function(){if(this.isNaN())return A.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new A(t,e)},A.prototype.negate=function(){return this.isNaN()?this:new A(-this._hi,-this._lo)},A.prototype.clone=function(){},A.prototype.multiply=function(){if(arguments[0]instanceof A){var t=arguments[0];return t.isNaN()?A.createNaN():A.copy(this).selfMultiply(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return P.isNaN(e)?A.createNaN():A.copy(this).selfMultiply(e,0)}},A.prototype.isNaN=function(){return P.isNaN(this._hi)},A.prototype.intValue=function(){return Math.trunc(this._hi)},A.prototype.toString=function(){var t=A.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},A.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!0,e),n=e[0]+1,a=i;if(i.charAt(0)===".")a="0"+i;else if(n<0)a="0."+A.stringOfChar("0",-n)+i;else if(i.indexOf(".")===-1){var u=n-i.length;a=i+A.stringOfChar("0",u)+".0"}return this.isNegative()?"-"+a:a},A.prototype.reciprocal=function(){var t=null,e=null,i=null,n=null,a=null,u=null,d=null,g=null;e=(a=1/this._hi)-(t=(u=A.SPLIT*a)-(t=u-a)),i=(g=A.SPLIT*this._hi)-this._hi;var _=a+(u=(1-(d=a*this._hi)-(g=t*(i=g-i)-d+t*(n=this._hi-i)+e*i+e*n)-a*this._lo)/this._hi);return new A(_,a-_+u)},A.prototype.toSciNotation=function(){if(this.isZero())return A.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!1,e),n=A.SCI_NOT_EXPONENT_CHAR+e[0];if(i.charAt(0)==="0")throw new Error("Found leading zero: "+i);var a="";i.length>1&&(a=i.substring(1));var u=i.charAt(0)+"."+a;return this.isNegative()?"-"+u+n:u+n},A.prototype.abs=function(){return this.isNaN()?A.NaN:this.isNegative()?this.negate():new A(this)},A.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},A.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},A.prototype.add=function(){if(arguments[0]instanceof A){var t=arguments[0];return A.copy(this).selfAdd(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return A.copy(this).selfAdd(e)}},A.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof A){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this._hi=i,this._lo=n}},A.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},A.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},A.prototype.trunc=function(){return this.isNaN()?A.NaN:this.isPositive()?this.floor():this.ceil()},A.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},A.prototype.interfaces_=function(){return[s,W,Z]},A.prototype.getClass=function(){return A},A.sqr=function(t){return A.valueOf(t).selfMultiply(t)},A.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return A.parse(t)}if(typeof arguments[0]=="number"){var e=arguments[0];return new A(e)}},A.sqrt=function(t){return A.valueOf(t).sqrt()},A.parse=function(t){for(var e=0,i=t.length;Ze.isWhitespace(t.charAt(e));)e++;var n=!1;if(e<i){var a=t.charAt(e);a!=="-"&&a!=="+"||(e++,a==="-"&&(n=!0))}for(var u=new A,d=0,g=0,_=0;!(e>=i);){var M=t.charAt(e);if(e++,Ze.isDigit(M)){var B=M-"0";u.selfMultiply(A.TEN),u.selfAdd(B),d++}else{if(M!=="."){if(M==="e"||M==="E"){var G=t.substring(e);try{_=Me.parseInt(G)}catch(de){throw de instanceof Error?new Error("Invalid exponent "+G+" in string "+t):de}break}throw new Error("Unexpected character '"+M+"' at position "+e+" in string "+t)}g=d}}var it=u,nt=d-g-_;if(nt===0)it=u;else if(nt>0){var at=A.TEN.pow(nt);it=u.divide(at)}else if(nt<0){var ut=A.TEN.pow(-nt);it=u.multiply(ut)}return n?it.negate():it},A.createNaN=function(){return new A(P.NaN,P.NaN)},A.copy=function(t){return new A(t)},A.magnitude=function(t){var e=Math.abs(t),i=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(i));return 10*Math.pow(10,n)<=e&&(n+=1),n},A.stringOfChar=function(t,e){for(var i=new oi,n=0;n<e;n++)i.append(t);return i.toString()},ji.PI.get=function(){return new A(3.141592653589793,12246467991473532e-32)},ji.TWO_PI.get=function(){return new A(6.283185307179586,24492935982947064e-32)},ji.PI_2.get=function(){return new A(1.5707963267948966,6123233995736766e-32)},ji.E.get=function(){return new A(2.718281828459045,14456468917292502e-32)},ji.NaN.get=function(){return new A(P.NaN,P.NaN)},ji.EPS.get=function(){return 123259516440783e-46},ji.SPLIT.get=function(){return 134217729},ji.MAX_PRINT_DIGITS.get=function(){return 32},ji.TEN.get=function(){return A.valueOf(10)},ji.ONE.get=function(){return A.valueOf(1)},ji.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},ji.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(A,ji);var De=function(){},qn={DP_SAFE_EPSILON:{configurable:!0}};De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De}
2,De.orientationIndex=function(t,e,i){var n=De.orientationIndexFilter(t,e,i);if(n<=1)return n;var a=A.valueOf(e.x).selfAdd(-t.x),u=A.valueOf(e.y).selfAdd(-t.y),d=A.valueOf(i.x).selfAdd(-e.x),g=A.valueOf(i.y).selfAdd(-e.y);return a.selfMultiply(g).selfSubtract(u.selfMultiply(d)).signum()},De.signOfDet2x2=function(t,e,i,n){return t.multiply(n).selfSubtract(e.multiply(i)).signum()},De.intersection=function(t,e,i,n){var a=A.valueOf(n.y).selfSubtract(i.y).selfMultiply(A.valueOf(e.x).selfSubtract(t.x)),u=A.valueOf(n.x).selfSubtract(i.x).selfMultiply(A.valueOf(e.y).selfSubtract(t.y)),d=a.subtract(u),g=A.valueOf(n.x).selfSubtract(i.x).selfMultiply(A.valueOf(t.y).selfSubtract(i.y)),_=A.valueOf(n.y).selfSubtract(i.y).selfMultiply(A.valueOf(t.x).selfSubtract(i.x)),M=g.subtract(_).selfDivide(d).doubleValue(),B=A.valueOf(t.x).selfAdd(A.valueOf(e.x).selfSubtract(t.x).selfMultiply(M)).doubleValue(),G=A.valueOf(e.x).selfSubtract(t.x).selfMultiply(A.valueOf(t.y).selfSubtract(i.y)),it=A.valueOf(e.y).selfSubtract(t.y).selfMultiply(A.valueOf(t.x).selfSubtract(i.x)),nt=G.subtract(it).selfDivide(d).doubleValue(),at=A.valueOf(i.y).selfAdd(A.valueOf(n.y).selfSubtract(i.y).selfMultiply(nt)).doubleValue();return new E(B,at)},De.orientationIndexFilter=function(t,e,i){var n=null,a=(t.x-i.x)*(e.y-i.y),u=(t.y-i.y)*(e.x-i.x),d=a-u;if(a>0){if(u<=0)return De.signum(d);n=a+u}else{if(!(a<0)||u>=0)return De.signum(d);n=-a-u}var g=De.DP_SAFE_EPSILON*n;return d>=g||-d>=g?De.signum(d):2},De.signum=function(t){return t>0?1:t<0?-1:0},qn.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(De,qn);var Et=function(){},Jr={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Jr.X.get=function(){return 0},Jr.Y.get=function(){return 1},Jr.Z.get=function(){return 2},Jr.M.get=function(){return 3},Et.prototype.setOrdinate=function(t,e,i){},Et.prototype.size=function(){},Et.prototype.getOrdinate=function(t,e){},Et.prototype.getCoordinate=function(){},Et.prototype.getCoordinateCopy=function(t){},Et.prototype.getDimension=function(){},Et.prototype.getX=function(t){},Et.prototype.clone=function(){},Et.prototype.expandEnvelope=function(t){},Et.prototype.copy=function(){},Et.prototype.getY=function(t){},Et.prototype.toCoordinateArray=function(){},Et.prototype.interfaces_=function(){return[Z]},Et.prototype.getClass=function(){return Et},Object.defineProperties(Et,Jr);var vo=function(){},Zr=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}(vo),si=function(){};si.arraycopy=function(t,e,i,n,a){for(var u=0,d=e;d<e+a;d++)i[n+u]=t[d],u++},si.getProperty=function(t){return{"line.separator":`
3`}[t]};var rn=function t(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var i=arguments[0],n=arguments[1];this.x=i,this.y=n,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var a=arguments[0],u=arguments[1];this.x=a.y*u.w-u.y*a.w,this.y=u.x*a.w-a.x*u.w,this.w=a.x*u.y-u.x*a.y}else if(arguments[0]instanceof E&&arguments[1]instanceof E){var d=arguments[0],g=arguments[1];this.x=d.y-g.y,this.y=g.x-d.x,this.w=d.x*g.y-g.x*d.y}}else if(arguments.length===3){var _=arguments[0],M=arguments[1],B=arguments[2];this.x=_,this.y=M,this.w=B}else if(arguments.length===4){var G=arguments[0],it=arguments[1],nt=arguments[2],at=arguments[3],ut=G.y-it.y,de=it.x-G.x,Qe=G.x*it.y-it.x*G.y,Bi=nt.y-at.y,ur=at.x-nt.x,Vr=nt.x*at.y-at.x*nt.y;this.x=de*Vr-ur*Qe,this.y=Bi*Qe-ut*Vr,this.w=ut*ur-Bi*de}};rn.prototype.getY=function(){var t=this.y/this.w;if(P.isNaN(t)||P.isInfinite(t))throw new Zr;return t},rn.prototype.getX=function(){var t=this.x/this.w;if(P.isNaN(t)||P.isInfinite(t))throw new Zr;return t},rn.prototype.getCoordinate=function(){var t=new E;return t.x=this.getX(),t.y=this.getY(),t},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn}
3,rn.intersection=function(t,e,i,n){var a=t.y-e.y,u=e.x-t.x,d=t.x*e.y-e.x*t.y,g=i.y-n.y,_=n.x-i.x,M=i.x*n.y-n.x*i.y,B=a*_-g*u,G=(u*M-_*d)/B,it=(g*d-a*M)/B;if(P.isNaN(G)||P.isInfinite(G)||P.isNaN(it)||P.isInfinite(it))throw new Zr;return new E(G,it)};var ct=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof E){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var i=arguments[0];this.init(i)}}else if(arguments.length===2){var n=arguments[0],a=arguments[1];this.init(n.x,a.x,n.y,a.y)}else if(arguments.length===4){var u=arguments[0],d=arguments[1],g=arguments[2],_=arguments[3];this.init(u,d,g,_)}},Ta={serialVersionUID:{configurable:!0}};ct.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ct.prototype.equals=function(t){if(!(t instanceof ct))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()},ct.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ct;var e=this._minx>t._minx?this._minx:t._minx,i=this._miny>t._miny?this._miny:t._miny,n=this._maxx<t._maxx?this._maxx:t._maxx,a=this._maxy<t._maxy?this._maxy:t._maxy;return new ct(e,n,i,a)},ct.prototype.isNull=function(){return this._maxx<this._minx},ct.prototype.getMaxX=function(){return this._maxx},ct.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof ct){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];return!this.isNull()&&i>=this._minx&&i<=this._maxx&&n>=this._miny&&n<=this._maxy}},ct.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ct){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof E){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];return!this.isNull()&&!(i>this._maxx||i<this._minx||n>this._maxy||n<this._miny)}},ct.prototype.getMinY=function(){return this._miny},ct.prototype.getMinX=function(){return this._minx},ct.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ct){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=n,this._maxy=n):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),n<this._miny&&(this._miny=n),n>this._maxy&&(this._maxy=n))}},ct.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ct.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ct.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},ct.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ct.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}
3,ct.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ct.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ct.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ct.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ct.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ct){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof E){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.covers(i,n)}},ct.prototype.centre=function(){return this.isNull()?null:new E((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ct.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ct){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this.init(i.x,n.x,i.y,n.y)}else if(arguments.length===4){var a=arguments[0],u=arguments[1],d=arguments[2],g=arguments[3];a<u?(this._minx=a,this._maxx=u):(this._minx=u,this._maxx=a),d<g?(this._miny=d,this._maxy=g):(this._miny=g,this._maxy=d)}},ct.prototype.getMaxY=function(){return this._maxy},ct.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 i=0;return this._maxy<t._miny?i=t._miny-this._maxy:this._miny>t._maxy&&(i=this._miny-t._maxy),e===0?i:i===0?e:Math.sqrt(e*e+i*i)},ct.prototype.hashCode=function(){var t=17;return t=37*t+E.hashCode(this._minx),t=37*t+E.hashCode(this._maxx),t=37*t+E.hashCode(this._miny),t=37*t+E.hashCode(this._maxy)},ct.prototype.interfaces_=function(){return[W,s]},ct.prototype.getClass=function(){return ct},ct.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2];return i.x>=(t.x<e.x?t.x:e.x)&&i.x<=(t.x>e.x?t.x:e.x)&&i.y>=(t.y<e.y?t.y:e.y)&&i.y<=(t.y>e.y?t.y:e.y)}if(arguments.length===4){var n=arguments[0],a=arguments[1],u=arguments[2],d=arguments[3],g=Math.min(u.x,d.x),_=Math.max(u.x,d.x),M=Math.min(n.x,a.x),B=Math.max(n.x,a.x);return!(M>_)&&!(B<g)&&(g=Math.min(u.y,d.y),_=Math.max(u.y,d.y),M=Math.min(n.y,a.y),B=Math.max(n.y,a.y),!(M>_)&&!(B<g))}},Ta.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ct,Ta);var Fe={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Xo=function(t){this.geometryFactory=t||new bt};Xo.prototype.read=function(t){var e,i,n;t=t.replace(/[\n\r]/g," ");var a=Fe.typeStr.exec(t);if(t.search("EMPTY")!==-1&&((a=Fe.emptyTypeStr.exec(t))[2]=void 0),a&&(i=a[1].toLowerCase(),n=a[2],Rr[i]&&(e=Rr[i].apply(this,[n]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Xo.prototype.write=function(t){return this.extractGeometry(t)},Xo.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!bi[e])return null;var i=e.toUpperCase();return t.isEmpty()?i+" EMPTY":i+"("+bi[e].apply(this,[t])+")"};var bi={coordinate:function(t){return t.x+" "+t.y},point:function(t){return bi.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push("("+bi.point.apply(this,[t._geometries[i]])+")");return e.join(",")},linestring:function(t){for(var e=[],i=0,n=t._points._coordinates.length;i<n;++i)e.push(bi.coordinate.apply(this,[t._points._coordinates[i]]));return e.join(",")},linearring:function(t){for(var e=[],i=0,n=t._points._coordinates.length;i<n;++i)e.push(bi.coordinate.apply(this,[t._points._coordinates[i]]));return e.join(",")},multilinestring:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push("("+bi.linestring.apply(this,[t._geometries[i]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+bi.linestring.apply(this,[t._shell])+")");for(var i=0,n=t._holes.length;i<n;++i)e.push("("+bi.linestring.apply(this,[t._holes[i]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push("("+bi.polygon.apply(this,[t._geometries[i]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;
3++i)e.push(this.extractGeometry(t._geometries[i]));return e.join(",")}},Rr={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(Fe.spaces);return this.geometryFactory.createPoint(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(t===void 0)return this.geometryFactory.createMultiPoint();for(var e,i=t.trim().split(","),n=[],a=0,u=i.length;a<u;++a)e=i[a].replace(Fe.trimParens,"$1"),n.push(Rr.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(n)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e,i=t.trim().split(","),n=[],a=0,u=i.length;a<u;++a)e=i[a].trim().split(Fe.spaces),n.push(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e,i=t.trim().split(","),n=[],a=0,u=i.length;a<u;++a)e=i[a].trim().split(Fe.spaces),n.push(new E(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){if(t===void 0)return this.geometryFactory.createMultiLineString();for(var e,i=t.trim().split(Fe.parenComma),n=[],a=0,u=i.length;a<u;++a)e=i[a].replace(Fe.trimParens,"$1"),n.push(Rr.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(n)},polygon:function(t){if(t===void 0)return this.geometryFactory.createPolygon();for(var e,i,n,a,u=t.trim().split(Fe.parenComma),d=[],g=0,_=u.length;g<_;++g)e=u[g].replace(Fe.trimParens,"$1"),i=Rr.linestring.apply(this,[e]),n=this.geometryFactory.createLinearRing(i._points),g===0?a=n:d.push(n);return this.geometryFactory.createPolygon(a,d)},multipolygon:function(t){if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var e,i=t.trim().split(Fe.doubleParenComma),n=[],a=0,u=i.length;a<u;++a)e=i[a].replace(Fe.trimParens,"$1"),n.push(Rr.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(n)},geometrycollection:function(t){if(t===void 0)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),i=[],n=0,a=e.length;n<a;++n)i.push(this.read(e[n]));return this.geometryFactory.createGeometryCollection(i)}},mn=function(t){this.parser=new Xo(t)};mn.prototype.write=function(t){return this.parser.write(t)},mn.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Ln=function(t){function e(i){t.call(this,i),this.name="RuntimeException",this.message=i,this.stack=new t().stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Ar=function(t){function e(){if(t.call(this),arguments.length===0)t.call(this);else if(arguments.length===1){var i=arguments[0];t.call(this,i)}}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}(Ln),pt=function(){};pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},pt.shouldNeverReachHere=function(){if(arguments.length===0)pt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Ar("Should never reach here"+(t!==null?": "+t:""))}},pt.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],pt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Ar:new Ar(e)},pt.equals=function(){var t,e,i;if(arguments.length===2)t=arguments[0],e=arguments[1],pt.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],i=arguments[2],!e.equals(t)))throw new Ar("Expected "+t+" but encountered "+e+(i!==null?": "+i:""))};var be=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[0]=new E,this._intPt[1]=new E,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Tr={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};be.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},be.prototype.getTopologySummary=function(){var t=new oi;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}
3,be.prototype.computeIntersection=function(t,e,i,n){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=i,this._inputLines[1][1]=n,this._result=this.computeIntersect(t,e,i,n)},be.prototype.getIntersectionNum=function(){return this._result},be.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},be.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},be.prototype.setPrecisionModel=function(t){this._precisionModel=t},be.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},be.prototype.getIntersection=function(t){return this._intPt[t]},be.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},be.prototype.hasIntersection=function(){return this._result!==be.NO_INTERSECTION},be.prototype.getEdgeDistance=function(t,e){return be.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},be.prototype.isCollinear=function(){return this._result===be.COLLINEAR_INTERSECTION},be.prototype.toString=function(){return mn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+mn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},be.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},be.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},be.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},be.prototype.interfaces_=function(){return[]},be.prototype.getClass=function(){return be},be.computeEdgeDistance=function(t,e,i){var n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y),u=-1;if(t.equals(e))u=0;else if(t.equals(i))u=n>a?n:a;else{var d=Math.abs(t.x-e.x),g=Math.abs(t.y-e.y);(u=n>a?d:g)!==0||t.equals(e)||(u=Math.max(d,g))}return pt.isTrue(!(u===0&&!t.equals(e)),"Bad distance calculation"),u},be.nonRobustComputeEdgeDistance=function(t,e,i){var n=t.x-e.x,a=t.y-e.y,u=Math.sqrt(n*n+a*a);return pt.isTrue(!(u===0&&!t.equals(e)),"Invalid distance calculation"),u},Tr.DONT_INTERSECT.get=function(){return 0},Tr.DO_INTERSECT.get=function(){return 1},Tr.COLLINEAR.get=function(){return 2},Tr.NO_INTERSECTION.get=function(){return 0},Tr.POINT_INTERSECTION.get=function(){return 1},Tr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(be,Tr);var Jn=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(i){var n=new ct(this._inputLines[0][0],this._inputLines[0][1]),a=new ct(this._inputLines[1][0],this._inputLines[1][1]);return n.contains(i)&&a.contains(i)},e.prototype.computeIntersection=function(){if(arguments.length!==3)return t.prototype.computeIntersection.apply(this,arguments);var i=arguments[0],n=arguments[1],a=arguments[2];if(this._isProper=!1,ct.intersects(n,a,i)&&tt.orientationIndex(n,a,i)===0&&tt.orientationIndex(a,n,i)===0)return this._isProper=!0,(i.equals(n)||i.equals(a))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(i,n,a,u,d){d.x=this.smallestInAbsValue(i.x,n.x,a.x,u.x),d.y=this.smallestInAbsValue(i.y,n.y,a.y,u.y),i.x-=d.x,i.y-=d.y,n.x-=d.x,n.y-=d.y,a.x-=d.x,a.y-=d.y,u.x-=d.x,u.y-=d.y},e.prototype.safeHCoordinateIntersection=function(i,n,a,u){var d=null;try{d=rn.intersection(i,n,a,u)}catch(g){if(!(g instanceof Zr))throw g;d=e.nearestEndpoint(i,n,a,u)}return d},e.prototype.intersection=function(i,n,a,u){var d=this.intersectionWithNormalization(i,n,a,u);return this.isInSegmentEnvelopes(d)||(d=new E(e.nearestEndpoint(i,n,a,u))),this._precisionModel!==null&&this._precisionModel.makePrecise(d),d},e.prototype.smallestInAbsValue=function(i,n,a,u){var d=i,g=Math.abs(d);return Math.abs(n)<g&&(d=n,g=Math.abs(n)),Math.abs(a)<g&&(d=a,g=Math.abs(a)
3),Math.abs(u)<g&&(d=u),d},e.prototype.checkDD=function(i,n,a,u,d){var g=De.intersection(i,n,a,u),_=this.isInSegmentEnvelopes(g);si.out.println("DD in env = "+_+"  --------------------- "+g),d.distance(g)>1e-4&&si.out.println("Distance = "+d.distance(g))},e.prototype.intersectionWithNormalization=function(i,n,a,u){var d=new E(i),g=new E(n),_=new E(a),M=new E(u),B=new E;this.normalizeToEnvCentre(d,g,_,M,B);var G=this.safeHCoordinateIntersection(d,g,_,M);return G.x+=B.x,G.y+=B.y,G},e.prototype.computeCollinearIntersection=function(i,n,a,u){var d=ct.intersects(i,n,a),g=ct.intersects(i,n,u),_=ct.intersects(a,u,i),M=ct.intersects(a,u,n);return d&&g?(this._intPt[0]=a,this._intPt[1]=u,t.COLLINEAR_INTERSECTION):_&&M?(this._intPt[0]=i,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):d&&_?(this._intPt[0]=a,this._intPt[1]=i,!a.equals(i)||g||M?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):d&&M?(this._intPt[0]=a,this._intPt[1]=n,!a.equals(n)||g||_?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):g&&_?(this._intPt[0]=u,this._intPt[1]=i,!u.equals(i)||d||M?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):g&&M?(this._intPt[0]=u,this._intPt[1]=n,!u.equals(n)||d||_?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(i,n,a,u,d){var g=i.x<n.x?i.x:n.x,_=i.y<n.y?i.y:n.y,M=i.x>n.x?i.x:n.x,B=i.y>n.y?i.y:n.y,G=a.x<u.x?a.x:u.x,it=a.y<u.y?a.y:u.y,nt=a.x>u.x?a.x:u.x,at=a.y>u.y?a.y:u.y,ut=((g>G?g:G)+(M<nt?M:nt))/2,de=((_>it?_:it)+(B<at?B:at))/2;d.x=ut,d.y=de,i.x-=d.x,i.y-=d.y,n.x-=d.x,n.y-=d.y,a.x-=d.x,a.y-=d.y,u.x-=d.x,u.y-=d.y},e.prototype.computeIntersect=function(i,n,a,u){if(this._isProper=!1,!ct.intersects(i,n,a,u))return t.NO_INTERSECTION;var d=tt.orientationIndex(i,n,a),g=tt.orientationIndex(i,n,u);if(d>0&&g>0||d<0&&g<0)return t.NO_INTERSECTION;var _=tt.orientationIndex(a,u,i),M=tt.orientationIndex(a,u,n);return _>0&&M>0||_<0&&M<0?t.NO_INTERSECTION:d===0&&g===0&&_===0&&M===0?this.computeCollinearIntersection(i,n,a,u):(d===0||g===0||_===0||M===0?(this._isProper=!1,i.equals2D(a)||i.equals2D(u)?this._intPt[0]=i:n.equals2D(a)||n.equals2D(u)?this._intPt[0]=n:d===0?this._intPt[0]=new E(a):g===0?this._intPt[0]=new E(u):_===0?this._intPt[0]=new E(i):M===0&&(this._intPt[0]=new E(n))):(this._isProper=!0,this._intPt[0]=this.intersection(i,n,a,u)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(i,n,a,u){var d=i,g=tt.distancePointLine(i,a,u),_=tt.distancePointLine(n,a,u);return _<g&&(g=_,d=n),(_=tt.distancePointLine(a,i,n))<g&&(g=_,d=a),(_=tt.distancePointLine(u,i,n))<g&&(g=_,d=u),d},e}(be),Dr=function(){};Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.orientationIndex=function(t,e,i){var n=e.x-t.x,a=e.y-t.y,u=i.x-e.x,d=i.y-e.y;return Dr.signOfDet2x2(n,a,u,d)},Dr.signOfDet2x2=function(t,e,i,n){var a=null,u=null,d=null;if(a=1,t===0||n===0)return e===0||i===0?0:e>0?i>0?-a:a:i>0?a:-a;if(e===0||i===0)return n>0?t>0?a:-a:t>0?-a:a;if(e>0?n>0?e<=n||(a=-a,u=t,t=i,i=u,u=e,e=n,n=u):e<=-n?(a=-a,i=-i,n=-n):(u=t,t=-i,i=u,u=e,e=-n,n=u):n>0?-e<=n?(a=-a,t=-t,e=-e):(u=-t,t=i,i=u,u=-e,e=n,n=u):e>=n?(t=-t,e=-e,i=-i,n=-n):(a=-a,u=-t,t=-i,i=u,u=-e,e=-n,n=u),t>0){if(!(i>0)||!(t<=i))return a}else{if(i>0||!(t>=i))return-a;a=-a,t=-t,i=-i}for(;;){if(d=Math.floor(i/t),i-=d*t,(n-=d*e)<0)return-a;if(n>e)return a;
3if(t>i+i){if(e<n+n)return a}else{if(e>n+n)return-a;i=t-i,n=e-n,a=-a}if(n===0)return i===0?0:-a;if(i===0||(d=Math.floor(t/i),t-=d*i,(e-=d*n)<0))return a;if(e>n)return-a;if(i>t+t){if(n<e+e)return-a}else{if(n>e+e)return a;t=i-t,e=n-e,a=-a}if(e===0)return t===0?0:a;if(t===0)return-a}};var Cn=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Cn.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 i=t.x,n=e.x;return i>n&&(i=e.x,n=t.x),this._p.x>=i&&this._p.x<=n&&(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 a=t.x-this._p.x,u=t.y-this._p.y,d=e.x-this._p.x,g=e.y-this._p.y,_=Dr.signOfDet2x2(a,u,d,g);if(_===0)return this._isPointOnSegment=!0,null;g<u&&(_=-_),_>0&&this._crossingCount++}},Cn.prototype.isPointInPolygon=function(){return this.getLocation()!==L.EXTERIOR},Cn.prototype.getLocation=function(){return this._isPointOnSegment?L.BOUNDARY:this._crossingCount%2==1?L.INTERIOR:L.EXTERIOR},Cn.prototype.isOnSegment=function(){return this._isPointOnSegment},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.locatePointInRing=function(){if(arguments[0]instanceof E&&st(arguments[1],Et)){for(var t=arguments[0],e=arguments[1],i=new Cn(t),n=new E,a=new E,u=1;u<e.size();u++)if(e.getCoordinate(u,n),e.getCoordinate(u-1,a),i.countSegment(n,a),i.isOnSegment())return i.getLocation();return i.getLocation()}if(arguments[0]instanceof E&&arguments[1]instanceof Array){for(var d=arguments[0],g=arguments[1],_=new Cn(d),M=1;M<g.length;M++){var B=g[M],G=g[M-1];if(_.countSegment(B,G),_.isOnSegment())return _.getLocation()}return _.getLocation()}};var tt=function(){},Kr={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.orientationIndex=function(t,e,i){return De.orientationIndex(t,e,i)},tt.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,i=t[0].x,n=1;n<t.length-1;n++){var a=t[n].x-i,u=t[n+1].y;e+=a*(t[n-1].y-u)}return e/2}if(st(arguments[0],Et)){var d=arguments[0],g=d.size();if(g<3)return 0;var _=new E,M=new E,B=new E;d.getCoordinate(0,M),d.getCoordinate(1,B);var G=M.x;B.x-=G;for(var it=0,nt=1;nt<g-1;nt++)_.y=M.y,M.x=B.x,M.y=B.y,d.getCoordinate(nt+1,B),B.x-=G,it+=M.x*(_.y-B.y);return it/2}},tt.distanceLineLine=function(t,e,i,n){if(t.equals(e))return tt.distancePointLine(t,i,n);if(i.equals(n))return tt.distancePointLine(n,t,e);var a=!1;if(ct.intersects(t,e,i,n)){var u=(e.x-t.x)*(n.y-i.y)-(e.y-t.y)*(n.x-i.x);if(u===0)a=!0;else{var d=(t.y-i.y)*(n.x-i.x)-(t.x-i.x)*(n.y-i.y),g=((t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y))/u,_=d/u;(_<0||_>1||g<0||g>1)&&(a=!0)}}else a=!0;return a?we.min(tt.distancePointLine(t,i,n),tt.distancePointLine(e,i,n),tt.distancePointLine(i,t,e),tt.distancePointLine(n,t,e)):0},tt.isPointInRing=function(t,e){return tt.locatePointInRing(t,e)!==L.EXTERIOR},tt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var i=0,n=new E;t.getCoordinate(0,n);for(var a=n.x,u=n.y,d=1;d<e;d++){t.getCoordinate(d,n);var g=n.x,_=n.y,M=g-a,B=_-u;i+=Math.sqrt(M*M+B*B),a=g,u=_}return i},tt.isCCW=function(t){var e=t.length-1;if(e<3)throw new T("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=t[0],n=0,a=1;a<=e;a++){var u=t[a];u.y>i.y&&(i=u,n=a)}var d=n;do(d-=1)<0&&(d=e);while(t[d].equals2D(i)&&d!==n);var g=n;do g=(g+1)%e;while(t[g].equals2D(i)&&g!==n);var _=t[d],M=t[g];if(_.equals2D(i)||M.equals2D(i)||_.equals2D(M))return!1;var B=tt.computeOrientation(_,i,M),G=!1;return G=B===0?_.x>M.x:B>0,G},tt.locatePointInRing=function(t,e){return Cn.locatePointInRing(t,e)},tt.distancePointLinePerpendicular=function(t,e,i){var n=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),a=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/n;return Math.abs(a)*Math.sqrt(n)}
3,tt.computeOrientation=function(t,e,i){return tt.orientationIndex(t,e,i)},tt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new T("Line array must contain at least one vertex");for(var i=t.distance(e[0]),n=0;n<e.length-1;n++){var a=tt.distancePointLine(t,e[n],e[n+1]);a<i&&(i=a)}return i}if(arguments.length===3){var u=arguments[0],d=arguments[1],g=arguments[2];if(d.x===g.x&&d.y===g.y)return u.distance(d);var _=(g.x-d.x)*(g.x-d.x)+(g.y-d.y)*(g.y-d.y),M=((u.x-d.x)*(g.x-d.x)+(u.y-d.y)*(g.y-d.y))/_;if(M<=0)return u.distance(d);if(M>=1)return u.distance(g);var B=((d.y-u.y)*(g.x-d.x)-(d.x-u.x)*(g.y-d.y))/_;return Math.abs(B)*Math.sqrt(_)}},tt.isOnLine=function(t,e){for(var i=new Jn,n=1;n<e.length;n++){var a=e[n-1],u=e[n];if(i.computeIntersection(t,a,u),i.hasIntersection())return!0}return!1},Kr.CLOCKWISE.get=function(){return-1},Kr.RIGHT.get=function(){return tt.CLOCKWISE},Kr.COUNTERCLOCKWISE.get=function(){return 1},Kr.LEFT.get=function(){return tt.COUNTERCLOCKWISE},Kr.COLLINEAR.get=function(){return 0},Kr.STRAIGHT.get=function(){return tt.COLLINEAR},Object.defineProperties(tt,Kr);var Zn=function(){};Zn.prototype.filter=function(t){},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var ht=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Gn={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}};ht.prototype.isGeometryCollection=function(){return this.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION},ht.prototype.getFactory=function(){return this._factory},ht.prototype.getGeometryN=function(t){return this},ht.prototype.getArea=function(){return 0},ht.prototype.isRectangle=function(){return!1},ht.prototype.equals=function(){if(arguments[0]instanceof ht){var t=arguments[0];return t!==null&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ht))return!1;var i=e;return this.equalsExact(i)}},ht.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ht.prototype.geometryChanged=function(){this.apply(ht.geometryChangedFilter)},ht.prototype.geometryChangedAction=function(){this._envelope=null},ht.prototype.equalsNorm=function(t){return t!==null&&this.norm().equalsExact(t.norm())},ht.prototype.getLength=function(){return 0},ht.prototype.getNumGeometries=function(){return 1},ht.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(i,n)}},ht.prototype.getUserData=function(){return this._userData},ht.prototype.getSRID=function(){return this._SRID},ht.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ht.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION)throw new T("This method does not support GeometryCollection arguments")},ht.prototype.equal=function(t,e,i){return i===0?t.equals(e):t.distance(e)<=i},ht.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ht.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ht.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ct(this._envelope)},ht.prototype.setSRID=function(t){this._SRID=t},ht.prototype.setUserData=function(t){this._userData=t},ht.prototype.compare=function(t,e){for(var i=t.iterator(),n=e.iterator();i.hasNext()&&n.hasNext();){var a=i.next(),u=n.next(),d=a.compareTo(u);if(d!==0)return d}return i.hasNext()?1:n.hasNext()?-1:0},ht.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ht.prototype.isGeometryCollectionOrDerived=function(){return this.get
3SortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ht.SORTINDEX_MULTIPOINT||this.getSortIndex()===ht.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ht.SORTINDEX_MULTIPOLYGON},ht.prototype.interfaces_=function(){return[Z,W,s]},ht.prototype.getClass=function(){return ht},ht.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ht.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Gn.serialVersionUID.get=function(){return 8763622679187377e3},Gn.SORTINDEX_POINT.get=function(){return 0},Gn.SORTINDEX_MULTIPOINT.get=function(){return 1},Gn.SORTINDEX_LINESTRING.get=function(){return 2},Gn.SORTINDEX_LINEARRING.get=function(){return 3},Gn.SORTINDEX_MULTILINESTRING.get=function(){return 4},Gn.SORTINDEX_POLYGON.get=function(){return 5},Gn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Gn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Gn.geometryChangedFilter.get=function(){return As},Object.defineProperties(ht,Gn);var As=function(){};As.interfaces_=function(){return[Zn]},As.filter=function(t){t.geometryChangedAction()};var R=function(){};R.prototype.filter=function(t){},R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R};var m=function(){},v={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}};m.prototype.isInBoundary=function(t){},m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},v.Mod2BoundaryNodeRule.get=function(){return w},v.EndPointBoundaryNodeRule.get=function(){return C},v.MultiValentEndPointBoundaryNodeRule.get=function(){return b},v.MonoValentEndPointBoundaryNodeRule.get=function(){return U},v.MOD2_BOUNDARY_RULE.get=function(){return new w},v.ENDPOINT_BOUNDARY_RULE.get=function(){return new C},v.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new b},v.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new U},v.OGC_SFS_BOUNDARY_RULE.get=function(){return m.MOD2_BOUNDARY_RULE},Object.defineProperties(m,v);var w=function(){};w.prototype.isInBoundary=function(t){return t%2==1},w.prototype.interfaces_=function(){return[m]},w.prototype.getClass=function(){return w};
3var C=function(){};C.prototype.isInBoundary=function(t){return t>0},C.prototype.interfaces_=function(){return[m]},C.prototype.getClass=function(){return C};var b=function(){};b.prototype.isInBoundary=function(t){return t>1},b.prototype.interfaces_=function(){return[m]},b.prototype.getClass=function(){return b};var U=function(){};U.prototype.isInBoundary=function(t){return t===1},U.prototype.interfaces_=function(){return[m]},U.prototype.getClass=function(){return U};var D=function(){};D.prototype.add=function(){},D.prototype.addAll=function(){},D.prototype.isEmpty=function(){},D.prototype.iterator=function(){},D.prototype.size=function(){},D.prototype.toArray=function(){},D.prototype.remove=function(){},(o.prototype=new Error).name="IndexOutOfBoundsException";var V=function(){};V.prototype.hasNext=function(){},V.prototype.next=function(){},V.prototype.remove=function(){};var j=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}(D);(c.prototype=new Error).name="NoSuchElementException";var F=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof D&&this.addAll(arguments[0])}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[t,D]},e.prototype.add=function(i){return arguments.length===1?this.array_.push(i):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(i){for(var n=i.iterator();n.hasNext();)this.add(n.next());return!0},e.prototype.set=function(i,n){var a=this.array_[i];return this.array_[i]=n,a},e.prototype.iterator=function(){return new q(this)},e.prototype.get=function(i){if(i<0||i>=this.size())throw new o;return this.array_[i]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var i=[],n=0,a=this.array_.length;n<a;n++)i.push(this.array_[n]);return i},e.prototype.remove=function(i){for(var n=!1,a=0,u=this.array_.length;a<u;a++)if(this.array_[a]===i){this.array_.splice(a,1),n=!0;break}return n},e}(j),q=function(t){function e(i){t.call(this),this.arrayList_=i,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 c;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(i){return this.arrayList_.set(this.position_-1,i)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(V),Q=function(t){function e(){if(t.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.ensureCapacity(a.length),this.add(a,u)}}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={coordArrayType:{configurable:!0}};return i.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(n){return this.get(n)},e.prototype.addAll=function(){if(arguments.length===2){for(var n=arguments[0],a=arguments[1],u=!1,d=n.iterator();d.hasNext();)this.add(d.next(),a),u=!0;return u}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var n=t.prototype.clone.call(this),a=0;a<this.size();a++)n.add(a,this.get(a).copy());return n},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];t.prototype.add.call(this,n)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var a=arguments[0],u=arguments[1];return this.add(a,u,!0),!0}if(arguments[0]instanceof E&&typeof arguments[1]=="boolean"){var d=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(d))return null;t.prototype.add.call(this,d)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var g=arguments[0],_=arguments[1];return this.add(g,_),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var M=arguments[0],B=arguments[1];if(arguments[2])for(var G=0;G<M.length;G++)this.add(M[G],B);else for(var it=M.length-1;it>=0;it--)this.add(M[it],B);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof E){var nt=arguments[0],at=arguments[1];if(!arguments[2]){var ut=this.size();if(ut>0&&(nt>0&&this.get(nt-1).equals2D(at)||nt<ut&&this.get(nt).equals2D(at)))return null}t.prototype.add.call(this,nt,at)}}else if(arguments.length===4){var de=arguments[0],Qe=arguments[1],Bi=arguments[2],ur=arguments[3],Vr=1;Bi>ur&&(Vr=-1);for(var xl=Bi;xl!==ur;xl+=Vr)this.add(de[xl],Qe);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new E(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,i),e}(F),H=function(){},vt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};vt.ForwardComparator.get=function(){return ft},vt.BidirectionalComparator.get=function(){return Mt},vt.coordArrayType.get=function(){return new Array(0).fill(null)},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},H.ptNotInList=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];if(H.indexOf(n,e)<0)return n}return null},H.scroll=function(t,e){var i=H.indexOf(e,t);if(i<0)return null;var n=new Array(t.length).fill(null);si.arraycopy(t,i,n,0,t.length-i),si.arraycopy(t,0,n,t.length-i,i),si.arraycopy(n,0,t,0,t.length)},H.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;
3if(t===null||e===null||t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!t[i].equals(e[i]))return!1;return!0}if(arguments.length===3){var n=arguments[0],a=arguments[1],u=arguments[2];if(n===a)return!0;if(n===null||a===null||n.length!==a.length)return!1;for(var d=0;d<n.length;d++)if(u.compare(n[d],a[d])!==0)return!1;return!0}},H.intersection=function(t,e){for(var i=new Q,n=0;n<t.length;n++)e.intersects(t[n])&&i.add(t[n],!0);return i.toCoordinateArray()},H.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},H.removeRepeatedPoints=function(t){return H.hasRepeatedPoints(t)?new Q(t,!1).toCoordinateArray():t},H.reverse=function(t){for(var e=t.length-1,i=Math.trunc(e/2),n=0;n<=i;n++){var a=t[n];t[n]=t[e-n],t[e-n]=a}},H.removeNull=function(t){for(var e=0,i=0;i<t.length;i++)t[i]!==null&&e++;var n=new Array(e).fill(null);if(e===0)return n;for(var a=0,u=0;u<t.length;u++)t[u]!==null&&(n[a++]=t[u]);return n},H.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),i=0;i<t.length;i++)e[i]=new E(t[i]);return e}if(arguments.length===5)for(var n=arguments[0],a=arguments[1],u=arguments[2],d=arguments[3],g=arguments[4],_=0;_<g;_++)u[d+_]=new E(n[a+_])},H.isEqualReversed=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],a=e[t.length-i-1];if(n.compareTo(a)!==0)return!1}return!0},H.envelope=function(t){for(var e=new ct,i=0;i<t.length;i++)e.expandToInclude(t[i]);return e},H.toCoordinateArray=function(t){return t.toArray(H.coordArrayType)},H.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},H.indexOf=function(t,e){for(var i=0;i<e.length;i++)if(t.equals(e[i]))return i;return-1},H.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var i=t.length-1-e,n=t[e].compareTo(t[i]);if(n!==0)return n}return 1},H.compare=function(t,e){for(var i=0;i<t.length&&i<e.length;){var n=t[i].compareTo(e[i]);if(n!==0)return n;i++}return i<e.length?-1:i<t.length?1:0},H.minCoordinate=function(t){for(var e=null,i=0;i<t.length;i++)(e===null||e.compareTo(t[i])>0)&&(e=t[i]);return e},H.extract=function(t,e,i){e=we.clamp(e,0,t.length);var n=(i=we.clamp(i,-1,t.length))-e+1;i<0&&(n=0),e>=t.length&&(n=0),i<e&&(n=0);var a=new Array(n).fill(null);if(n===0)return a;for(var u=0,d=e;d<=i;d++)a[u++]=t[d];return a},Object.defineProperties(H,vt);var ft=function(){};ft.prototype.compare=function(t,e){return H.compare(t,e)},ft.prototype.interfaces_=function(){return[et]},ft.prototype.getClass=function(){return ft};var Mt=function(){};Mt.prototype.compare=function(t,e){var i=t,n=e;if(i.length<n.length)return-1;if(i.length>n.length)return 1;if(i.length===0)return 0;var a=H.compare(i,n);return H.isEqualReversed(i,n)?0:a},Mt.prototype.OLDcompare=function(t,e){var i=t,n=e;if(i.length<n.length)return-1;if(i.length>n.length)return 1;if(i.length===0)return 0;for(var a=H.increasingDirection(i),u=H.increasingDirection(n),d=a>0?0:i.length-1,g=u>0?0:i.length-1,_=0;_<i.length;_++){var M=i[d].compareTo(n[g]);if(M!==0)return M;d+=a,g+=u}return 0},Mt.prototype.interfaces_=function(){return[et]},Mt.prototype.getClass=function(){return Mt};var xt=function(){};xt.prototype.get=function(){},xt.prototype.put=function(){},xt.prototype.size=function(){},xt.prototype.values=function(){},xt.prototype.entrySet=function(){};var Re=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}(xt);(l.prototype=new Error).name="OperationNotSupported",(h.prototype=new D).contains=function(){};var mi=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof D&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(i){for(var n=0,a=this.array_.length;n<a;n++)if(this.array_[n]===i)return!0;return!1},e.prototype.add=function(i){return!this.contains(i)&&(this.array_.push(i),!0)},e.prototype.addAll=function(i){for(var n=i.iterator();n.hasNext();)this.add(n.next());return!0},e.prototype.remove=function(i){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var i=[],n=0,a=this.array_.length;n<a;n++)i.push(this.array_[n]);return i},e.prototype.iterator=function(){return new ai(this)},e}(h),ai=function(t){function e(i){t.call(this),this.hashSet_=i,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_.
3size())throw new c;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new l},e}(V),ke=0;(O.prototype=new Re).get=function(t){for(var e=this.root_;e!==null;){var i=t.compareTo(e.key);if(i<0)e=e.left;else{if(!(i>0))return e.value;e=e.right}}return null},O.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:ke,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var i,n,a=this.root_;do if(i=a,(n=t.compareTo(a.key))<0)a=a.left;else{if(!(n>0)){var u=a.value;return a.value=e,u}a=a.right}while(a!==null);var d={key:t,left:null,right:null,value:e,parent:i,color:ke,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?i.left=d:i.right=d,this.fixAfterInsertion(d),this.size_++,null},O.prototype.fixAfterInsertion=function(t){for(t.color=1;t!=null&&t!==this.root_&&t.parent.color===1;)if(p(t)===x(p(p(t)))){var e=S(p(p(t)));f(e)===1?(y(p(t),ke),y(e,ke),y(p(p(t)),1),t=p(p(t))):(t===S(p(t))&&(t=p(t),this.rotateLeft(t)),y(p(t),ke),y(p(p(t)),1),this.rotateRight(p(p(t))))}else{var i=x(p(p(t)));f(i)===1?(y(p(t),ke),y(i,ke),y(p(p(t)),1),t=p(p(t))):(t===x(p(t))&&(t=p(t),this.rotateRight(t)),y(p(t),ke),y(p(p(t)),1),this.rotateLeft(p(p(t))))}this.root_.color=ke},O.prototype.values=function(){var t=new F,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=O.successor(e))!==null;)t.add(e.value);return t},O.prototype.entrySet=function(){var t=new mi,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=O.successor(e))!==null;)t.add(e);return t},O.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},O.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},O.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t},O.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}for(var i=t.parent,n=t;i!==null&&n===i.right;)n=i,i=i.parent;return i},O.prototype.size=function(){return this.size_};var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},N.prototype=new h,(z.prototype=new N).contains=function(t){for(var e=0,i=this.array_.length;e<i;e++)if(this.array_[e].compareTo(t)===0)return!0;return!1},z.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,i=this.array_.length;e<i;e++)if(this.array_[e].compareTo(t)===1)return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},z.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},z.prototype.remove=function(t){throw new l},z.prototype.size=function(){return this.array_.length},z.prototype.isEmpty=function(){return this.array_.length===0},z.prototype.toArray=function(){for(var t=[],e=0,i=this.array_.length;e<i;e++)t.push(this.array_[e]);return t},z.prototype.iterator=function(){return new $i(this)};var $i=function(t){this.treeSet_=t,this.position_=0};$i.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new c;return this.treeSet_.array_[this.position_++]},$i.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},$i.prototype.remove=function(){throw new l};var Be=function(){};Be.sort=function(){var t,e,i,n,a=arguments[0];if(arguments.length===1)n=function(d,g){return d.compareTo(g)},a.sort(n);else if(arguments.length===2)i=arguments[1],n=function(d,g){return i.compare(d,g)},a.sort(n);else if(arguments.length===3){(e=a.slice(arguments[1],arguments[2])).sort();var u=a.slice(0,arguments[1]).concat(e,a.slice(arguments[2],a.length));for(a.splice(0,a.length),t=0;t<u.length;t++)a.push(u[t])}else if(arguments.length===4)for(e=a.slice(arguments[1],arguments[2]),i=arguments[3],n=function(d,g){return i.compare(d,g)},e.sort(n),u=a.slice(0,arguments[1]).concat(e,a.slice(arguments[2],a.length)),a.splice(0,a.length),t=0;t<u.length;t++)a.push(u[t])},Be.asList=function(t){for(var e=new F,i=0,n=t.length;i<n;i++)e.add(t[i]);return e};var _t=function(){},qe={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}};qe.P.get=function(){return 0},qe.L.get=function(){return 1},qe.A.get=function(){return 2},qe.FALSE.get=function(){return-1},qe.TRUE.get=function(){return-2},qe.DONTCARE.get=function(){return-3},qe.SYM_FALSE.get=function(){return"F"},qe.SYM_TRUE.get=function(){return"T"},qe.SYM_DONTCARE.get=function(){return"*"},qe.SYM_P.get=function(){return"0"},qe.SYM_L.get=function(){return"1"},qe.SYM_A.get=function(){return"2"},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t}
3,_t.toDimensionSymbol=function(t){switch(t){case _t.FALSE:return _t.SYM_FALSE;case _t.TRUE:return _t.SYM_TRUE;case _t.DONTCARE:return _t.SYM_DONTCARE;case _t.P:return _t.SYM_P;case _t.L:return _t.SYM_L;case _t.A:return _t.SYM_A}throw new T("Unknown dimension value: "+t)},_t.toDimensionValue=function(t){switch(Ze.toUpperCase(t)){case _t.SYM_FALSE:return _t.FALSE;case _t.SYM_TRUE:return _t.TRUE;case _t.SYM_DONTCARE:return _t.DONTCARE;case _t.SYM_P:return _t.P;case _t.SYM_L:return _t.L;case _t.SYM_A:return _t.A}throw new T("Unknown dimension symbol: "+t)},Object.defineProperties(_t,qe);var $e=function(){};$e.prototype.filter=function(t){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ge=function(){};Ge.prototype.filter=function(t,e){},Ge.prototype.isDone=function(){},Ge.prototype.isGeometryChanged=function(){},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge};var Pe=function(t){function e(n,a){if(t.call(this,a),this._geometries=n||[],t.hasNullElements(this._geometries))throw new T("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var n=new ct,a=0;a<this._geometries.length;a++)n.expandToInclude(this._geometries[a].getEnvelopeInternal());return n},e.prototype.getGeometryN=function(n){return this._geometries[n]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var n=new Array(this.getNumPoints()).fill(null),a=-1,u=0;u<this._geometries.length;u++)for(var d=this._geometries[u].getCoordinates(),g=0;g<d.length;g++)n[++a]=d[g];return n},e.prototype.getArea=function(){for(var n=0,a=0;a<this._geometries.length;a++)n+=this._geometries[a].getArea();return n},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];if(!this.isEquivalentClass(n))return!1;var u=n;if(this._geometries.length!==u._geometries.length)return!1;for(var d=0;d<this._geometries.length;d++)if(!this._geometries[d].equalsExact(u._geometries[d],a))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var n=0;n<this._geometries.length;n++)this._geometries[n].normalize();Be.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var n=_t.FALSE,a=0;a<this._geometries.length;a++)n=Math.max(n,this._geometries[a].getBoundaryDimension());return n},e.prototype.getDimension=function(){for(var n=_t.FALSE,a=0;a<this._geometries.length;a++)n=Math.max(n,this._geometries[a].getDimension());return n},e.prototype.getLength=function(){for(var n=0,a=0;a<this._geometries.length;a++)n+=this._geometries[a].getLength();return n},e.prototype.getNumPoints=function(){for(var n=0,a=0;a<this._geometries.length;a++)n+=this._geometries[a].getNumPoints();return n},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var n=this._geometries.length,a=new Array(n).fill(null),u=0;u<this._geometries.length;u++)a[u]=this._geometries[u].reverse();return this.getFactory().createGeometryCollection(a)},e.prototype.compareToSameClass=function(){if(arguments.length===1){var n=arguments[0],a=new z(Be.asList(this._geometries)),u=new z(Be.asList(n._geometries));return this.compare(a,u)}if(arguments.length===2){for(var d=arguments[0],g=arguments[1],_=d,M=this.getNumGeometries(),B=_.getNumGeometries(),G=0;G<M&&G<B;){var it=this.getGeometryN(G),nt=_.getGeometryN(G),at=it.compareToSameClass(nt,g);if(at!==0)return at;G++}return G<M?1:G<B?-1:0}},e.prototype.apply=function(){if(st(arguments[0],R))for(var n=arguments[0],a=0;a<this._geometries.length;a++)this._geometries[a].apply(n);else if(st(arguments[0],Ge)){var u=arguments[0];if(this._geometries.length===0)return null;for(var d=0;d<this._geometries.length&&(this._geometries[d].apply(u),!u.isDone());d++);u.isGeometryChanged()&&this.geometryChanged()}else if(st(arguments[0],$e)){var g=arguments[0];g.filter(this);for(var _=0;_<this._geometries.length;_++)this._geometries[_].apply(g)}else if(st(arguments[0],Zn)){var M=arguments[0];M.filter(this);for(var B=0;B<this._geometries.length;B++)this._geometries[B].apply(M)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),pt.shouldNeverReachHere(),null},e.prototype.clone=function(){var n=t.prototype.clone.call(this);n._geometries=new Array(this._geometries.length).fill(null);for(var a=0;a<this._geometries.length;a++)n._geometries[a]=this._geometries[a].clone();return n},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var n=new Array(this._geometries.length).fill(null),a=0;a<n.length;a++)n[a]=this._geometries[a].copy();return new e(n,this._factory)},e.prototype.isEmpty=function(){for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,i),e}(ht),Mn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];return!!this.isEquivalentClass(n)&&t.prototype.equalsExact.call(this,n,a)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?_t.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var n=this._geometries.length,a=new Array(n).fill(null),u=0;u<this._geometries.length;u++)a[n-1-u]=this._geometries[u].reverse();return this.getFactory().createMultiLineString(a)},e.prototype.getBoundary=function(){return new on(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var n=new Array(this._geometries.length).fill(null),a=0;a<n.length;a++)n[a]=this._geometries[a].copy();return new e(n,this._factory)},e.prototype.interfaces_=function(){return[ci]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,i),e}(Pe),on=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=m.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=n}};on.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},on.prototype.getBoundary=function(){return this._geom instanceof Ae?this.boundaryLineString(this._geom):this._geom instanceof Mn?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},on.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},on.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},on.prototype.computeBoundaryCoordinates=function(t){var e=new F;this._endpointMap=new O;for(var i=0;i<t.getNumGeometries();i++){var n=t.getGeometryN(i);n.getNumPoints()!==0&&(this.addEndpoint(n.getCoordinateN(0)),this.addEndpoint(n.getCoordinateN(n.getNumPoints()-1)))}for(var a=this._endpointMap.entrySet().iterator();a.hasNext();){var u=a.next(),d=u.getValue().count;this._bnRule.isInBoundary(d)&&e.add(u.getKey())}return H.toCoordinateArray(e)},on.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Yo,this._endpointMap.put(t,e)),e.count++},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},on.getBoundary=function(){if(arguments.length===1){var t=arguments[0];return new on(t).getBoundary()}if(arguments.length===2){var e=arguments[0],i=arguments[1];return new on(e,i).getBoundary()}};var Yo=function(){this.count=null};Yo.prototype.interfaces_=function(){return[]},Yo.prototype.getClass=function(){return Yo};var sn=function(){},sl={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},sn.chars=function(t,e){for(var i=new Array(e).fill(null),n=0;n<e;n++)i[n]=t;return String(i)},sn.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new function(){},i=new function(){}(e);return t.printStackTrace(i),e.toString()}if(arguments.length===2){for(var n=arguments[0],a=arguments[1],u="",d=new function(){}(new function(){}
3(sn.getStackTrace(n))),g=0;g<a;g++)try{u+=d.readLine()+sn.NEWLINE}catch(_){if(!(_ instanceof X))throw _;pt.shouldNeverReachHere()}return u}},sn.split=function(t,e){for(var i=e.length,n=new F,a=""+t,u=a.indexOf(e);u>=0;){var d=a.substring(0,u);n.add(d),u=(a=a.substring(u+i)).indexOf(e)}a.length>0&&n.add(a);for(var g=new Array(n.size()).fill(null),_=0;_<g.length;_++)g[_]=n.get(_);return g},sn.toString=function(){if(arguments.length===1){var t=arguments[0];return sn.SIMPLE_ORDINATE_FORMAT.format(t)}},sn.spaces=function(t){return sn.chars(" ",t)},sl.NEWLINE.get=function(){return si.getProperty("line.separator")},sl.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(sn,sl);var ze=function(){};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.copyCoord=function(t,e,i,n){for(var a=Math.min(t.getDimension(),i.getDimension()),u=0;u<a;u++)i.setOrdinate(n,u,t.getOrdinate(e,u))},ze.isRing=function(t){var e=t.size();return e===0||!(e<=3)&&t.getOrdinate(0,Et.X)===t.getOrdinate(e-1,Et.X)&&t.getOrdinate(0,Et.Y)===t.getOrdinate(e-1,Et.Y)},ze.isEqual=function(t,e){var i=t.size();if(i!==e.size())return!1;for(var n=Math.min(t.getDimension(),e.getDimension()),a=0;a<i;a++)for(var u=0;u<n;u++){var d=t.getOrdinate(a,u),g=e.getOrdinate(a,u);if(t.getOrdinate(a,u)!==e.getOrdinate(a,u)&&(!P.isNaN(d)||!P.isNaN(g)))return!1}return!0},ze.extend=function(t,e,i){var n=t.create(i,e.getDimension()),a=e.size();if(ze.copy(e,0,n,0,a),a>0)for(var u=a;u<i;u++)ze.copy(e,a-1,n,u,1);return n},ze.reverse=function(t){for(var e=t.size()-1,i=Math.trunc(e/2),n=0;n<=i;n++)ze.swap(t,n,e-n)},ze.swap=function(t,e,i){if(e===i)return null;for(var n=0;n<t.getDimension();n++){var a=t.getOrdinate(e,n);t.setOrdinate(e,n,t.getOrdinate(i,n)),t.setOrdinate(i,n,a)}},ze.copy=function(t,e,i,n,a){for(var u=0;u<a;u++)ze.copyCoord(t,e+u,i,n+u)},ze.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var i=t.getDimension(),n=new oi;n.append("(");for(var a=0;a<e;a++){a>0&&n.append(" ");for(var u=0;u<i;u++)u>0&&n.append(","),n.append(sn.toString(t.getOrdinate(a,u)))}return n.append(")"),n.toString()}},ze.ensureValidRing=function(t,e){var i=e.size();return i===0?e:i<=3?ze.createClosedRing(t,e,4):e.getOrdinate(0,Et.X)===e.getOrdinate(i-1,Et.X)&&e.getOrdinate(0,Et.Y)===e.getOrdinate(i-1,Et.Y)?e:ze.createClosedRing(t,e,i+1)},ze.createClosedRing=function(t,e,i){var n=t.create(i,e.getDimension()),a=e.size();ze.copy(e,0,n,0,a);for(var u=a;u<i;u++)ze.copy(e,0,n,u,1);return n};var Ae=function(t){function e(n,a){t.call(this,a),this._points=null,this.init(n)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ct:this._points.expandEnvelope(new ct)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];if(!this.isEquivalentClass(n))return!1;var u=n;if(this._points.size()!==u._points.size())return!1;for(var d=0;d<this._points.size();d++)if(!this.equal(this._points.getCoordinate(d),u._points.getCoordinate(d),a))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var n=0;n<Math.trunc(this._points.size()/2);n++){var a=this._points.size()-1-n;if(!this._points.getCoordinate(n).equals(this._points.getCoordinate(a)))return this._points.getCoordinate(n).compareTo(this._points.getCoordinate(a))>0&&ze.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?_t.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return tt.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var n=this._points.copy();return ze.reverse(n),this.getFactory().createLineString(n)},e.prototype.compareToSameClass=function(){if(arguments.length===1){for(var n=arguments[0],a=0,u=0;a<this._points.size()&&u<n._points.size();){var d=this._points.getCoordinate(a).compareTo(n._points.getCoordinate(u));if(d!==0)return d;a++,u++}return a<this._points.size()?1:u<n._points.size()?-1:0}if(arguments.length===2){var g=arguments[0];return arguments[1].compare(this._points,g._points)}},e.prototype.apply=function(){if(st(arguments[0],R))for(var n=arguments[0],a=0;a<this._points.size();a++)n.filter(this._points.getCoordinate(a));else if(st(arguments[0],Ge)){var u=arguments[0];if(this._points.size()===0)return null;for(var d=0;d<this._points.size()&&(u.filter(this._points,d),!u.isDone());d++);u.isGeometryChanged()&&this.geometryChanged()}else st(arguments[0],$e)?arguments[0].filter(this):st(arguments[0],Zn)&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new on(this).getBoundary()},e.prototype.isEquivalentClass=function(n){return n instanceof e},e.prototype.clone=function(){var n=t.prototype.clone.call(this);return n._points=this._points.clone(),n},e.prototype.getCoordinateN=function(n){return this._points.getCoordinate(n)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(n){if(n===null&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),n.size()===1)throw new T("Invalid number of points in LineString (found "+n.size()+" - must be 0 or >= 2)");this._points=n},e.prototype.isCoordinate=function(n){for(var a=0;a<this._points.size();a++)if(this._points.getCoordinate(a).equals(n))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(n){return this.getFactory().createPoint(this._points.getCoordinate(n))},e.prototype.interfaces_=function(){return[ci]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,i),e}(ht),Ts=function(){};Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var an=function(t){function e(n,a){t.call(this,a),this._coordinates=n||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ct;var n=new ct;return n.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),n},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];return!!this.isEquivalentClass(n)&&(!(!this.isEmpty()||!n.isEmpty())||this.isEmpty()===n.isEmpty()&&this.equal(n.getCoordinate(),this.getCoordinate(),a))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return _t.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var n=arguments[0];return this.getCoordinate().compareTo(n.getCoordinate())}if(arguments.length===2){var a=arguments[0];return arguments[1].compare(this._coordinates,a._coordinates)}},e.prototype.apply=function(){if(st(arguments[0],R)){var n=arguments[0];if(this.isEmpty())return null;n.filter(this.getCoordinate())}else if(st(arguments[0],Ge)){var a=arguments[0];if(this.isEmpty())return null;a.filter(this._coordinates,0),a.isGeometryChanged()&&this.geometryChanged()}else st(arguments[0],$e)?arguments[0].filter(this):st(arguments[0],Zn)&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var n=t.prototype.clone.call(this);return n._coordinates=this._coordinates.clone(),n},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(n){n===null&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),pt.isTrue(n.size()<=1),this._coordinates=n},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Ts]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,i),e}(ht),Fr=function(){};Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr};var Ke=function(t){function e(n,a,u){if(t.call(this,u),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),a===null&&(a=[]),t.hasNullElements(a))throw new T("holes must not contain null elements");if(n.isEmpty()&&t.hasNonEmptyElements(a))throw new T("shell is empty but holes are not");this._shell=n,this._holes=a}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var n=new Array(this.getNumPoints()).fill(null),a=-1,u=this._shell.getCoordinates(),d=0;d<u.length;d++)n[++a]=u[d];for(var g=0;g<this._holes.length;g++)for(var _=this._holes[g].getCoordinates(),M=0;M<_.length;M++)n[++a]=_[M];return n},e.prototype.getArea=function(){var n=0;n+=Math.abs(tt.signedArea(this._shell.getCoordinateSequence()));for(var a=0;a<this._holes.length;a++)n-=Math.abs(tt.signedArea(this._holes[a].getCoordinateSequence()));return n},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var n=this._shell.getCoordinateSequence(),a=this.getEnvelopeInternal(),u=0;u<5;u++){var d=n.getX(u);if(d!==a.getMinX()&&d!==a.getMaxX())return!1;var g=n.getY(u);if(g!==a.getMinY()&&g!==a.getMaxY())return!1}for(var _=n.getX(0),M=n.getY(0),B=1;B<=4;B++){var G=n.getX(B),it=n.getY(B);if(G!==_==(it!==M))return!1;_=G,M=it}return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];if(!this.isEquivalentClass(n))return!1;
3var u=n,d=this._shell,g=u._shell;if(!d.equalsExact(g,a)||this._holes.length!==u._holes.length)return!1;for(var _=0;_<this._holes.length;_++)if(!this._holes[_].equalsExact(u._holes[_],a))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var n=0;n<this._holes.length;n++)this.normalize(this._holes[n],!1);Be.sort(this._holes)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];if(a.isEmpty())return null;var d=new Array(a.getCoordinates().length-1).fill(null);si.arraycopy(a.getCoordinates(),0,d,0,d.length);var g=H.minCoordinate(a.getCoordinates());H.scroll(d,g),si.arraycopy(d,0,a.getCoordinates(),0,d.length),a.getCoordinates()[d.length]=d[0],tt.isCCW(a.getCoordinates())===u&&H.reverse(a.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var n=0;n+=this._shell.getLength();for(var a=0;a<this._holes.length;a++)n+=this._holes[a].getLength();return n},e.prototype.getNumPoints=function(){for(var n=this._shell.getNumPoints(),a=0;a<this._holes.length;a++)n+=this._holes[a].getNumPoints();return n},e.prototype.reverse=function(){var n=this.copy();n._shell=this._shell.copy().reverse(),n._holes=new Array(this._holes.length).fill(null);for(var a=0;a<this._holes.length;a++)n._holes[a]=this._holes[a].copy().reverse();return n},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(arguments.length===1){var n=arguments[0],a=this._shell,u=n._shell;return a.compareToSameClass(u)}if(arguments.length===2){var d=arguments[0],g=arguments[1],_=d,M=this._shell,B=_._shell,G=M.compareToSameClass(B,g);if(G!==0)return G;for(var it=this.getNumInteriorRing(),nt=_.getNumInteriorRing(),at=0;at<it&&at<nt;){var ut=this.getInteriorRingN(at),de=_.getInteriorRingN(at),Qe=ut.compareToSameClass(de,g);if(Qe!==0)return Qe;at++}return at<it?1:at<nt?-1:0}},e.prototype.apply=function(n){if(st(n,R)){this._shell.apply(n);for(var a=0;a<this._holes.length;a++)this._holes[a].apply(n)}else if(st(n,Ge)){if(this._shell.apply(n),!n.isDone())for(var u=0;u<this._holes.length&&(this._holes[u].apply(n),!n.isDone());u++);n.isGeometryChanged()&&this.geometryChanged()}else if(st(n,$e))n.filter(this);else if(st(n,Zn)){n.filter(this),this._shell.apply(n);for(var d=0;d<this._holes.length;d++)this._holes[d].apply(n)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var n=new Array(this._holes.length+1).fill(null);n[0]=this._shell;for(var a=0;a<this._holes.length;a++)n[a+1]=this._holes[a];return n.length<=1?this.getFactory().createLinearRing(n[0].getCoordinateSequence()):this.getFactory().createMultiLineString(n)},e.prototype.clone=function(){var n=t.prototype.clone.call(this);n._shell=this._shell.clone(),n._holes=new Array(this._holes.length).fill(null);for(var a=0;a<this._holes.length;a++)n._holes[a]=this._holes[a].clone();return n},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var n=this._shell.copy(),a=new Array(this._holes.length).fill(null),u=0;u<a.length;u++)a[u]=this._holes[u].copy();return new e(n,a,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(n){return this._holes[n]},e.prototype.interfaces_=function(){return[Fr]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,i),e}(ht),jo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];return!!this.isEquivalentClass(n)&&t.prototype.equalsExact.call(this,n,a)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var n=arguments[0];return this._geometries[n].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return _t.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var n=new Array(this._geometries.length).fill(null),a=0;a<n.length;a++)n[a]=this._geometries[a].copy();return new e(n,this._factory)},e.prototype.interfaces_=function(){return[Ts]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,i),e}(Pe),Kn=function(t){function e(n,a){n instanceof E&&a instanceof bt&&(n=a.getCoordinateSequenceFactory().create(n)),t.call(this,n,a),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return _t.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var n=this._points.copy();return ze.reverse(n),this.getFactory().createLinearRing(n)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new T("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new T("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.MINIMUM_VALID_SIZE.get=function(){return 4},i.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,i),e}(Ae),tr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];return!!this.isEquivalentClass(n)&&t.prototype.equalsExact.call(this,n,a)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var n=this._geometries.length,a=new Array(n).fill(null),u=0;u<this._geometries.length;u++)a[u]=this._geometries[u].reverse();return this.getFactory().createMultiPolygon(a)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var n=new F,a=0;a<this._geometries.length;a++)for(var u=this._geometries[a].getBoundary(),d=0;d<u.getNumGeometries();d++)n.add(u.getGeometryN(d));var g=new Array(n.size()).fill(null);return this.getFactory().createMultiLineString(n.toArray(g))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var n=new Array(this._geometries.length).fill(null),a=0;a<n.length;a++)n[a]=this._geometries[a].copy();return new e(n,this._factory)},e.prototype.interfaces_=function(){return[Fr]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,i),e}(Pe),Pn=function(t){this._factory=t||null,this._isUserDataCopied=!1},Da={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Pn.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Pn.prototype.edit=function(t,e){if(t===null)return null;var i=this.editInternal(t,e);return this._isUserDataCopied&&i.setUserData(t.getUserData()),i},Pn.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof Pe?this.editGeometryCollection(t,e):t instanceof Ke?this.editPolygon(t,e):t instanceof an?e.edit(t,this._factory):t instanceof Ae?e.edit(t,this._factory):(pt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Pn.prototype.editGeometryCollection=function(t,e){for(var i=e.edit(t,this._factory),n=new F,a=0;a<i.getNumGeometries();a++){var u=this.edit(i.getGeometryN(a),e);u===null||u.isEmpty()||n.add(u)}return i.getClass()===jo?this._factory.createMultiPoint(n.toArray([])):i.getClass()===Mn?this._factory.createMultiLineString(n.toArray([])):i.getClass()===tr?this._factory.createMultiPolygon(n.toArray([])):this._factory.createGeometryCollection(n.toArray([]))},Pn.prototype.editPolygon=function(t,e){var i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var n=this.edit(i.getExteriorRing(),e);if(n===null||n.isEmpty())return this._factory.createPolygon();for(var a=new F,u=0;u<i.getNumInteriorRing();u++){var d=this.edit(i.getInteriorRingN(u),e);d===null||d.isEmpty()||a.add(d)}return this._factory.createPolygon(n,a.toArray([]))},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.GeometryEditorOperation=function(){},Da.NoOpGeometryOperation.get=function(){return Ds},Da.CoordinateOperation.get=function(){return Fs},Da.CoordinateSequenceOperation.get=function(){return Bs},Object.defineProperties(Pn,Da);var Ds=function(){};Ds.prototype.edit=function(t,e){return t},Ds.prototype.interfaces_=function(){return[Pn.GeometryEditorOperation]},Ds.prototype.getClass=function(){return Ds};var Fs=function(){};Fs.prototype.edit=function(t,e){var i=this.editCoordinates(t.getCoordinates(),t);return i===null?t:t instanceof Kn?e.createLinearRing(i):t instanceof Ae?e.createLineString(i):t instanceof an?i.length>0?e.createPoint(i[0]):e.createPoint():t},Fs.prototype.interfaces_=function(){return[Pn.GeometryEditorOperation]},Fs.prototype.getClass=function(){return Fs};var Bs=function(){};Bs.prototype.edit=function(t,e){return t instanceof Kn?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Ae?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof an?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Bs.prototype.interfaces_=function(){return[Pn.GeometryEditorOperation]},Bs.prototype.getClass=function(){return Bs};var Ue=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new E}else if(st(arguments[0],Et)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var n=0;n<this._coordinates.length;n++)this._coordinates[n]=i.getCoordinateCopy(n)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var a=arguments[0],u=arguments[1];this._coordinates=a,this._dimension=u,a===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var d=arguments[0],g=arguments[1];this._coordinates=new Array(d).fill(null),this._dimension=g;
3for(var _=0;_<d;_++)this._coordinates[_]=new E}}},Eh={serialVersionUID:{configurable:!0}};Ue.prototype.setOrdinate=function(t,e,i){switch(e){case Et.X:this._coordinates[t].x=i;break;case Et.Y:this._coordinates[t].y=i;break;case Et.Z:this._coordinates[t].z=i;break;default:throw new T("invalid ordinateIndex")}},Ue.prototype.size=function(){return this._coordinates.length},Ue.prototype.getOrdinate=function(t,e){switch(e){case Et.X:return this._coordinates[t].x;case Et.Y:return this._coordinates[t].y;case Et.Z:return this._coordinates[t].z}return P.NaN},Ue.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}if(arguments.length===2){var e=arguments[0],i=arguments[1];i.x=this._coordinates[e].x,i.y=this._coordinates[e].y,i.z=this._coordinates[e].z}},Ue.prototype.getCoordinateCopy=function(t){return new E(this._coordinates[t])},Ue.prototype.getDimension=function(){return this._dimension},Ue.prototype.getX=function(t){return this._coordinates[t].x},Ue.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new Ue(t,this._dimension)},Ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},Ue.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new Ue(t,this._dimension)},Ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new oi(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},Ue.prototype.getY=function(t){return this._coordinates[t].y},Ue.prototype.toCoordinateArray=function(){return this._coordinates},Ue.prototype.interfaces_=function(){return[Et,s]},Ue.prototype.getClass=function(){return Ue},Eh.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Ue,Eh);var er=function(){},al={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};er.prototype.readResolve=function(){return er.instance()},er.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Ue(t)}if(st(arguments[0],Et)){var e=arguments[0];return new Ue(e)}}else if(arguments.length===2){var i=arguments[0],n=arguments[1];return n>3&&(n=3),n<2?new Ue(i):new Ue(i,n)}},er.prototype.interfaces_=function(){return[yt,s]},er.prototype.getClass=function(){return er},er.instance=function(){return er.instanceObject},al.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},al.instanceObject.get=function(){return new er},Object.defineProperties(er,al);var Ch=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(i){return this.map_.get(i)||null},e.prototype.put=function(i,n){return this.map_.set(i,n),n},e.prototype.values=function(){for(var i=new F,n=this.map_.values(),a=n.next();!a.done;)i.add(a.value),a=n.next();return i},e.prototype.entrySet=function(){var i=new mi;return this.map_.entries().forEach(function(n){return i.add(n)}),i},e.prototype.size=function(){return this.map_.size()},e}(xt),Zt=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof zn){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var i=arguments[0];this._modelType=t.FIXED,this.setScale(i)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},cl={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Zt.prototype.equals=function(t){if(!(t instanceof Zt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Zt.prototype.compareTo=function(t){var e=t,i=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new Me(i).compareTo(new Me(n))},Zt.prototype.getScale=function(){return this._scale},Zt.prototype.isFloating=function(){return this._modelType===Zt.FLOATING||this._modelType===Zt.FLOATING_SINGLE},Zt.prototype.getType=function(){return this._modelType},Zt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Zt.FLOATING?t="Floating":this._modelType===Zt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Zt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Zt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];return P.isNaN(t)||this._modelType===Zt.FLOATING_SINGLE?t:this._modelType===Zt.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof E){var e=arguments[0];if(this._modelType===Zt.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Zt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Zt.FLOATING?t=16:this._modelType===Zt.FLOATING_SINGLE?t=6:this._modelType===Zt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Zt.prototype.setScale=function(t){this._scale=Math.abs(t)},Zt.prototype.interfaces_=function(){return[s,W]},Zt.prototype.getClass=function(){return Zt},Zt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},cl.serialVersionUID.get=function(){return 7777263578777804e3},cl.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Zt,cl);var zn=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ll={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};zn.prototype.readResolve=function(){return zn.nameToTypeMap.get(this._name)},zn.prototype.toString=function(){return this._name},zn.prototype.interfaces_=function(){return[s]},zn.prototype.getClass=function(){return zn},ll.serialVersionUID.get=function(){return-552860263173159e4},ll.nameToTypeMap.get=function(){return new Ch},Object.defineProperties(zn,ll),Zt.Type=zn,Zt.FIXED=new zn("FIXED"),Zt.FLOATING=new zn("FLOATING"),Zt.FLOATING_SINGLE=new zn("FLOATING SINGLE");var bt=function t(){this._precisionModel=new Zt,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?st(arguments[0],yt)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Zt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Mh={serialVersionUID:{configurable:!0}};bt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new E(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new E(t.getMinX(),t.getMinY()),new E(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new E(t.getMinX(),t.getMinY()),new E(t.getMinX(),t.getMaxY()),new E(t.getMaxX(),t.getMaxY()),new E(t.getMaxX(),t.getMinY()),new E(t.getMinX(),t.getMinY())]),null)},bt.prototype.createLineString=function(t){return t?t instanceof Array?new Ae(this.getCoordinateSequenceFactory().create(t),this):st(t,Et)?new Ae(t,this):void 0:new Ae(this.getCoordinateSequenceFactory().create([]),this)},bt.prototype.createMultiLineString=function(){if(arguments.length===0)return new Mn(null,this);if(arguments.length===1){var t=arguments[0];return new Mn(t,this)}},bt.prototype.buildGeometry=function(t){for(var e=null,i=!1,n=!1,a=t.iterator();a.hasNext();){var u=a.next(),d=u.getClass();e===null&&(e=d),d!==e&&(i=!0),u.isGeometryCollectionOrDerived()&&(n=!0)}if(e===null)return this.createGeometryCollection();if(i||n)return this.createGeometryCollection(bt.toGeometryArray(t));var g=t.iterator().next();if(t.size()>1){if(g instanceof Ke)return this.createMultiPolygon(bt.toPolygonArray(t));if(g instanceof Ae)return this.createMultiLineString(bt.toLineStringArray(t));if(g instanceof an)return this.createMultiPoint(bt.toPointArray(t));pt.shouldNeverReachHere("Unhandled class: "+g.getClass().getName())}return g},bt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},bt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}if(st(arguments[0],Et)){var e=arguments[0];return new an(e,this)}}},bt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},bt.prototype.createPolygon=function(){if(arguments.length===0)return new Ke(null,null,this);if(arguments.length===1){if(st(arguments[0],Et)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Kn){var i=arguments[0];return this.createPolygon(i,null)}}else if(arguments.length===2){var n=arguments[0],a=arguments[1];return new Ke(n,a,this)}},bt.prototype.getSRID=function(){return this._SRID},bt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Pe(null,this);if(arguments.length===1){var t=arguments[0];return new Pe(t,this)}},bt.prototype.createGeometry=function(t){return new Pn(this).edit(t,{edit:function(){if(arguments.length===2){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},bt.prototype.getPrecisionModel=function(){return this._precisionModel},bt.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}if(st(arguments[0],Et)){var e=arguments[0];return new Kn(e,this)}}},bt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new tr(null,this);if(arguments.length===1){var t=arguments[0];return new tr(t,this)}},bt.prototype.createMultiPoint=function(){if(arguments.length===0)return new jo(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new jo(t,this)}
3if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)}if(st(arguments[0],Et)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(i.size()).fill(null),a=0;a<i.size();a++){var u=this.getCoordinateSequenceFactory().create(1,i.getDimension());ze.copy(i,a,u,0,1),n[a]=this.createPoint(u)}return this.createMultiPoint(n)}}},bt.prototype.interfaces_=function(){return[s]},bt.prototype.getClass=function(){return bt},bt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.getDefaultCoordinateSequenceFactory=function(){return er.instance()},bt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},bt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Mh.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(bt,Mh);var D0=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Fa=function(t){this.geometryFactory=t||new bt};Fa.prototype.read=function(t){var e,i=(e=typeof t=="string"?JSON.parse(t):t).type;if(!Un[i])throw new Error("Unknown GeoJSON type: "+e.type);return D0.indexOf(i)!==-1?Un[i].apply(this,[e.coordinates]):i==="GeometryCollection"?Un[i].apply(this,[e.geometries]):Un[i].apply(this,[e])},Fa.prototype.write=function(t){var e=t.getGeometryType();if(!mr[e])throw new Error("Geometry is not supported");return mr[e].apply(this,[t])};var Un={Feature:function(t){var e={};for(var i in t)e[i]=t[i];if(t.geometry){var n=t.geometry.type;if(!Un[n])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Un.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var i=0;i<t.features.length;++i)e.features.push(this.read(t.features[i]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],i=0;i<t.length;++i){var n=t[i];e.push(new E(n[0],n[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new E(t[0],t[1]),new E(t[2],t[1]),new E(t[2],t[3]),new E(t[0],t[3]),new E(t[0],t[1])])},Point:function(t){var e=new E(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],i=0;i<t.length;++i)e.push(Un.Point.apply(this,[t[i]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Un.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],i=0;i<t.length;++i)e.push(Un.LineString.apply(this,[t[i]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Un.coordinates.apply(this,[t[0]]),i=this.geometryFactory.createLinearRing(e),n=[],a=1;a<t.length;++a){var u=t[a],d=Un.coordinates.apply(this,[u]),g=this.geometryFactory.createLinearRing(d);n.push(g)}return this.geometryFactory.createPolygon(i,n)},MultiPolygon:function(t){for(var e=[],i=0;i<t.length;++i){var n=t[i];e.push(Un.Polygon.apply(this,[n]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],i=0;i<t.length;++i){var n=t[i];e.push(this.read(n))}return this.geometryFactory.createGeometryCollection(e)}},mr={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:mr.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],a=mr.Point.apply(this,[n]);e.push(a.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],i=t.getCoordinates(),n=0;n<i.length;++n){var a=i[n];e.push(mr.coordinate.apply(this,[a]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],a=mr.LineString.apply(this,[n]);e.push(a.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],i=mr.LineString.apply(this,[t._shell]);e.push(i.coordinates);for(var n=0;n<t._holes.length;++n){var a=t._holes[n],u=mr.LineString.apply(this,[a]);e.push(u.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],a=mr.Polygon.apply(this,[n]);e.push(a.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],a=n.getGeometryType();e.push(mr[a].apply(this,[n]))}return{type:"GeometryCollection",geometries:e}}},ul=function(t){this.geometryFactory=t||new bt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Fa(this.geometryFactory)};ul.prototype.read=function(t){var e=this.parser.read(t);
3return this.precisionModel.getType()===Zt.FIXED&&this.reducePrecision(e),e},ul.prototype.reducePrecision=function(t){var e,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,i=t.points.length;e<i;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,i=t.geometries.length;e<i;e++)this.reducePrecision(t.geometries[e])};var Ph=function(){this.parser=new Fa(this.geometryFactory)};Ph.prototype.write=function(t){return this.parser.write(t)};var K=function(){},Ba={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.opposite=function(t){return t===K.LEFT?K.RIGHT:t===K.RIGHT?K.LEFT:t},Ba.ON.get=function(){return 0},Ba.LEFT.get=function(){return 1},Ba.RIGHT.get=function(){return 2},Object.defineProperties(K,Ba),($.prototype=new Error).name="EmptyStackException",(I.prototype=new j).add=function(t){return this.array_.push(t),!0},I.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},I.prototype.push=function(t){return this.array_.push(t),t},I.prototype.pop=function(t){if(this.array_.length===0)throw new $;return this.array_.pop()},I.prototype.peek=function(){if(this.array_.length===0)throw new $;return this.array_[this.array_.length-1]},I.prototype.empty=function(){return this.array_.length===0},I.prototype.isEmpty=function(){return this.empty()},I.prototype.search=function(t){return this.array_.indexOf(t)},I.prototype.size=function(){return this.array_.length},I.prototype.toArray=function(){for(var t=[],e=0,i=this.array_.length;e<i;e++)t.push(this.array_[e]);return t};var Xn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Xn.prototype.getCoordinate=function(){return this._minCoord},Xn.prototype.getRightmostSide=function(t,e){var i=this.getRightmostSideOfSegment(t,e);return i<0&&(i=this.getRightmostSideOfSegment(t,e-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),i},Xn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();pt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],i=t[this._minIndex+1],n=tt.computeOrientation(this._minCoord,i,e),a=!1;(e.y<this._minCoord.y&&i.y<this._minCoord.y&&n===tt.COUNTERCLOCKWISE||e.y>this._minCoord.y&&i.y>this._minCoord.y&&n===tt.CLOCKWISE)&&(a=!0),a&&(this._minIndex=this._minIndex-1)},Xn.prototype.getRightmostSideOfSegment=function(t,e){var i=t.getEdge().getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var n=K.LEFT;return i[e].y<i[e+1].y&&(n=K.RIGHT),n},Xn.prototype.getEdge=function(){return this._orientedDe},Xn.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),i=0;i<e.length-1;i++)(this._minCoord===null||e[i].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=i,this._minCoord=e[i])},Xn.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)},Xn.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();i.isForward()&&this.checkForRightmostCoordinate(i)}pt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===K.LEFT&&(this._orientedDe=this._minDe.getSym())},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var gr=function(t){function e(i,n){t.call(this,e.msgWithCoord(i,n)),this.pt=n?new E(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(i,n){return n?i:i+" [ "+n+" ]"},e}(Ln),qa=function(){this.array_=[]};qa.prototype.addLast=function(t){this.array_.push(t)},qa.prototype.removeFirst=function(){return this.array_.shift()},qa.prototype.isEmpty=function(){return this.array_.length===0};var Ni=function(){this._finder=null,this._dirEdgeList=new F,this._nodes=new F,this._rightMostCoord=null,this._env=null,this._finder=new Xn};Ni.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ni.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ni.prototype.computeNodeDepth=function(t){for(var e=null,i=t.getEdges().iterator();i.hasNext();){var n=i.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(e===null)throw new gr("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var a=t.getEdges().iterator();a.hasNext();){var u=a.next();u.setVisited(!0),this.copySymDepths(u)}},Ni.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(K.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ni.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ni.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(K.RIGHT)>=1&&e.getDepth(K.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ni.prototype.computeDepths=function(t){var e=new mi,i=new qa,n=t.getNode();for(i.addLast(n),e.add(n),t.setVisited(!0);!i.isEmpty();){var a=i.removeFirst();e.add(a),this.computeNodeDepth(a);for(var u=a.getEdges().iterator();u.hasNext();){var d=u.next().getSym();if(!d.isVisited()){var g=d.getNode();e.contains(g)||(i.addLast(g),e.add(g))}}}},Ni.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ni.prototype.getEnvelope=function(){if(this._env===null){for(var t=new ct,e=this._dirEdgeList.iterator();e.hasNext();)for(var i=e.next().getEdge().getCoordinates(),n=0;n<i.length-1;n++)t.expandToInclude(i[n]);this._env=t}return this._env},Ni.prototype.addReachable=function(t){var e=new I;for(e.add(t);!e.empty();){var i=e.pop();this.add(i,e)}},Ni.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(K.LEFT,t.getDepth(K.RIGHT)),e.setDepth(K.RIGHT,t.getDepth(K.LEFT))},Ni.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var n=i.next();this._dirEdgeList.add(n);
3var a=n.getSym().getNode();a.isVisited()||e.push(a)}},Ni.prototype.getNodes=function(){return this._nodes},Ni.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ni.prototype.interfaces_=function(){return[W]},Ni.prototype.getClass=function(){return Ni};var _e=function t(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var i=arguments[0];this.init(1),this.location[K.ON]=i}else if(arguments[0]instanceof t){var n=arguments[0];if(this.init(n.location.length),n!==null)for(var a=0;a<this.location.length;a++)this.location[a]=n.location[a]}}else if(arguments.length===3){var u=arguments[0],d=arguments[1],g=arguments[2];this.init(3),this.location[K.ON]=u,this.location[K.LEFT]=d,this.location[K.RIGHT]=g}};_e.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},_e.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==L.NONE)return!1;return!0},_e.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===L.NONE&&(this.location[e]=t)},_e.prototype.isLine=function(){return this.location.length===1},_e.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[K.ON]=this.location[K.ON],e[K.LEFT]=L.NONE,e[K.RIGHT]=L.NONE,this.location=e}for(var i=0;i<this.location.length;i++)this.location[i]===L.NONE&&i<t.location.length&&(this.location[i]=t.location[i])},_e.prototype.getLocations=function(){return this.location},_e.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[K.LEFT];this.location[K.LEFT]=this.location[K.RIGHT],this.location[K.RIGHT]=t},_e.prototype.toString=function(){var t=new oi;return this.location.length>1&&t.append(L.toLocationSymbol(this.location[K.LEFT])),t.append(L.toLocationSymbol(this.location[K.ON])),this.location.length>1&&t.append(L.toLocationSymbol(this.location[K.RIGHT])),t.toString()},_e.prototype.setLocations=function(t,e,i){this.location[K.ON]=t,this.location[K.LEFT]=e,this.location[K.RIGHT]=i},_e.prototype.get=function(t){return t<this.location.length?this.location[t]:L.NONE},_e.prototype.isArea=function(){return this.location.length>1},_e.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===L.NONE)return!0;return!1},_e.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(K.ON,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.location[e]=i}},_e.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(L.NONE)},_e.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},_e.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e};var he=function t(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new _e(e),this.elt[1]=new _e(e)}else if(arguments[0]instanceof t){var i=arguments[0];this.elt[0]=new _e(i.elt[0]),this.elt[1]=new _e(i.elt[1])}}else if(arguments.length===2){var n=arguments[0],a=arguments[1];this.elt[0]=new _e(L.NONE),this.elt[1]=new _e(L.NONE),this.elt[n].setLocation(a)}else if(arguments.length===3){var u=arguments[0],d=arguments[1],g=arguments[2];this.elt[0]=new _e(u,d,g),this.elt[1]=new _e(u,d,g)}else if(arguments.length===4){var _=arguments[0],M=arguments[1],B=arguments[2],G=arguments[3];this.elt[0]=new _e(L.NONE,L.NONE,L.NONE),this.elt[1]=new _e(L.NONE,L.NONE,L.NONE),this.elt[_].setLocations(M,B,G)}};he.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},he.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},he.prototype.isNull=function(t){return this.elt[t].isNull()},he.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.elt[e].setAllLocationsIfNull(i)}},he.prototype.isLine=function(t){return this.elt[t].isLine()},he.prototype.merge=function(t){for(var e=0;e<2;e++)this.elt[e]===null&&t.elt[e]!==null?this.elt[e]=new _e(t.elt[e]):this.elt[e].merge
3(t.elt[e])},he.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},he.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(K.ON)}if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.elt[e].get(i)}},he.prototype.toString=function(){var t=new oi;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},he.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},he.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},he.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(K.ON,e)}else if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2];this.elt[i].setLocation(n,a)}},he.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},he.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},he.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new _e(this.elt[t].location[0]))},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.toLineLabel=function(t){for(var e=new he(L.NONE),i=0;i<2;i++)e.setLocation(i,t.getLocation(i));return e};var He=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new F,this._pts=new F,this._label=new he(L.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new F,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};He.prototype.computeRing=function(){if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=tt.isCCW(this._ring.getCoordinates())},He.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},He.prototype.computePoints=function(t){this._startDe=t;var e=t,i=!0;do{if(e===null)throw new gr("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new gr("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var n=e.getLabel();pt.isTrue(n.isArea()),this.mergeLabel(n),this.addPoints(e.getEdge(),e.isForward(),i),i=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},He.prototype.getLinearRing=function(){return this._ring},He.prototype.getCoordinate=function(t){return this._pts.get(t)},He.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},He.prototype.addPoints=function(t,e,i){var n=t.getCoordinates();if(e){var a=1;i&&(a=0);for(var u=a;u<n.length;u++)this._pts.add(n[u])}else{var d=n.length-2;i&&(d=n.length-1);for(var g=d;g>=0;g--)this._pts.add(n[g])}},He.prototype.isHole=function(){return this._isHole},He.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},He.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!tt.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();)if(i.next().containsPoint(t))return!1;return!0},He.prototype.addHole=function(t){this._holes.add(t)},He.prototype.isShell=function(){return this._shell===null},He.prototype.getLabel=function(){return this._label},He.prototype.getEdges=function(){return this._edges},He.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},He.prototype.getShell=function(){return this._shell},He.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],n=e.getLocation(i,K.RIGHT);if(n===L.NONE)return null;if(this._label.getLocation(i)===L.NONE)return this._label.setLocation(i,n),null}},He.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},He.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)e[i]=this._holes.get(i).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var F0=function(t){function e(){var i=arguments[0],n=arguments[1];t.call(this,i,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(i,n){i.setMinEdgeRing(n)},e.prototype.getNext=function(i){return i.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(He),B0=function(t){function e(){var i=arguments[0],n=arguments[1];t.call(this,i,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var i=new F,n=this._startDe;do{if(n.getMinEdgeRing()===null){var a=new F0(n,this._geometryFactory);i.add(a)}n=n.getNext()}while(n!==this._startDe);return i},e.prototype.setEdgeRing=function(i,n){i.setEdgeRing(n)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var i=this._startDe;do i.getNode().getEdges().linkMinimalDirectedEdges(this),i=i.getNext();while(i!==this._startDe)},e.prototype.getNext=function(i){return i.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(He),gn=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};gn.prototype.setVisited=function(t){this._isVisited=t},gn.prototype.setInResult=function(t){this._isInResult=t},gn.prototype.isCovered=function(){return this._isCovered},gn.prototype.isCoveredSet=function(){return this._isCoveredSet},gn.prototype.setLabel=function(t){this._label=t},gn.prototype.getLabel=function(){return this._label},gn.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},gn.prototype.updateIM=function(t){pt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},gn.prototype.isInResult=function(){return this._isInResult},gn.prototype.isVisited=function(){return this._isVisited},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Ga=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var i=arguments[0],n=arguments[1];this._coord=i,this._edges=n,this._label=new he(0,L.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var i=this.getEdges().getEdges().iterator();i.hasNext();)if(i.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(i){i.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(i){},e.prototype.computeMergedLocation=function(i,n){var a=L.NONE;if(a=this._label.getLocation(n),!i.isNull(n)){var u=i.getLocation(n);a!==L.BOUNDARY&&(a=u)}return a},e.prototype.setLabel=function(){if(arguments.length!==2)return t.prototype.setLabel.apply(this,arguments);var i=arguments[0],n=arguments[1];this._label===null?this._label=new he(i,n):this._label.setLocation(i,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof he)for(var n=arguments[0],a=0;a<2;a++){var u=this.computeMergedLocation(n,a);this._label.getLocation(a)===L.NONE&&this._label.setLocation(a,u)}},e.prototype.add=function(i){this._edges.insert(i),i.setNode(this)},e.prototype.setLabelBoundary=function(i){if(this._label===null)return null;var n=L.NONE;this._label!==null&&(n=this._label.getLocation(i));var a=null;switch(n){case L.BOUNDARY:a=L.INTERIOR;break;case L.INTERIOR:default:a=L.BOUNDARY}this._label.setLocation(i,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gn),Yn=function(){this.nodeMap=new O,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Yn.prototype.find=function(t){return this.nodeMap.get(t)},Yn.prototype.addNode=function(){if(arguments[0]instanceof E){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Ga){var i=arguments[0],n=this.nodeMap.get(i.getCoordinate());return n===null?(this.nodeMap.put(i.getCoordinate(),i),i):(n.mergeLabel(i),n)}},Yn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Yn.prototype.iterator=function(){return this.nodeMap.values().iterator()},Yn.prototype.values=function(){return this.nodeMap.values()},Yn.prototype.getBoundaryNodes=function(t){for(var e=new F,i=this.iterator();i.hasNext();){var n=i.next();n.getLabel().getLocation(t)===L.BOUNDARY&&e.add(n)}return e},Yn.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var pe=function(){},qs={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.isNorthern=function(t){return t===pe.NE||t===pe.NW},pe.isOpposite=function(t,e){return t===e?!1:(t-e+4)%4===2},pe.commonHalfPlane=function(t,e){if(t===e)return t;if((t-e+4)%4===2)return-1;var i=t<e?t:e;return i===0&&(t>e?t:e)===3?3:i},pe.isInHalfPlane=function(t,e){return e===pe.SE?t===pe.SE||t===pe.SW:t===e||t===e+1},pe.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new T("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?pe.NE:pe.SE:e>=0?pe.NW:pe.SW}if(arguments[0]instanceof E&&arguments[1]instanceof E){var i=arguments[0],n=arguments[1];if(n.x===i.x&&n.y===i.y)throw new T("Cannot compute the quadrant for two identical points "+i);return n.x>=i.x?n.y>=i.y?pe.NE:pe.SE:n.y>=i.y?pe.NW:pe.SW}},qs.NE.get=function(){return 0},qs.NW.get=function(){return 1},qs.SW.get=function(){return 2},qs.SE.get=function(){return 3},Object.defineProperties(pe,qs);var Ei=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],i=arguments[1],n=arguments[2];this._edge=e,this.init(i,n),this._label=null}else if(arguments.length===4){var a=arguments[0],u=arguments[1],d=arguments[2],g=arguments[3];this._edge=a,this.init(u,d),this._label=g}};Ei.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:tt.computeOrientation(t._p0,t._p1,this._p1)},Ei.prototype.getDy=function(){return this._dy},Ei.prototype.getCoordinate=function(){return this._p0}
3,Ei.prototype.setNode=function(t){this._node=t},Ei.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),n=i.lastIndexOf("."),a=i.substring(n+1);t.print("  "+a+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+"   "+this._label)},Ei.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ei.prototype.getDirectedCoordinate=function(){return this._p1},Ei.prototype.getDx=function(){return this._dx},Ei.prototype.getLabel=function(){return this._label},Ei.prototype.getEdge=function(){return this._edge},Ei.prototype.getQuadrant=function(){return this._quadrant},Ei.prototype.getNode=function(){return this._node},Ei.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),i=e.lastIndexOf(".");return"  "+e.substring(i+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+"   "+this._label},Ei.prototype.computeLabel=function(t){},Ei.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=pe.quadrant(this._dx,this._dy),pt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Ei.prototype.interfaces_=function(){return[W]},Ei.prototype.getClass=function(){return Ei};var hl=function(t){function e(){var i=arguments[0],n=arguments[1];if(t.call(this,i),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(i.getCoordinate(0),i.getCoordinate(1));else{var a=i.getNumPoints()-1;this.init(i.getCoordinate(a),i.getCoordinate(a-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(i){return this._depth[i]},e.prototype.setVisited=function(i){this._isVisited=i},e.prototype.computeDirectedLabel=function(){this._label=new he(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(i,n){if(this._depth[i]!==-999&&this._depth[i]!==n)throw new gr("assigned depths do not match",this.getCoordinate());this._depth[i]=n},e.prototype.isInteriorAreaEdge=function(){for(var i=!0,n=0;n<2;n++)this._label.isArea(n)&&this._label.getLocation(n,K.LEFT)===L.INTERIOR&&this._label.getLocation(n,K.RIGHT)===L.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(i){this._nextMin=i},e.prototype.print=function(i){t.prototype.print.call(this,i),i.print(" "+this._depth[K.LEFT]+"/"+this._depth[K.RIGHT]),i.print(" ("+this.getDepthDelta()+")"),this._isInResult&&i.print(" inResult")},e.prototype.setMinEdgeRing=function(i){this._minEdgeRing=i},e.prototype.isLineEdge=function(){var i=this._label.isLine(0)||this._label.isLine(1),n=!this._label.isArea(0)||this._label.allPositionsEqual(0,L.EXTERIOR),a=!this._label.isArea(1)||this._label.allPositionsEqual(1,L.EXTERIOR);return i&&n&&a},e.prototype.setEdgeRing=function(i){this._edgeRing=i},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var i=this._edge.getDepthDelta();return this._isForward||(i=-i),i},e.prototype.setInResult=function(i){this._isInResult=i},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(i){this.print(i),i.print(" "),this._isForward?this._edge.print(i):this._edge.printReverse(i)},e.prototype.setSym=function(i){this._sym=i},e.prototype.setVisitedEdge=function(i){this.setVisited(i),this._sym.setVisited(i)},e.prototype.setEdgeDepths=function(i,n){var a=this.getEdge().getDepthDelta();this._isForward||(a=-a);var u=1;i===K.LEFT&&(u=-1);var d=K.opposite(i),g=n+a*u;this.setDepth(i,n),this.setDepth(d,g)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(i){this._next=i},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(i,n){return i===L.EXTERIOR&&n===L.INTERIOR?1:i===L.INTERIOR&&n===L.EXTERIOR?-1:0},e}(Ei),$o=function(){};$o.prototype.createNode=function(t){return new Ga(t,null)},$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o};var Ne=function(){if(this._edges=new F,this._nodes=null,this._edgeEndList=new F,arguments.length===0)this._nodes=new Yn(new $o);else if(arguments.length===1){var t=arguments[0];this._nodes=new Yn(t)}};Ne.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var i=this._edges.get(e);i.print(t),i.eiList.print(t)}},Ne.prototype.find=function(t){return this._nodes.find(t)},Ne.prototype.addNode=function(){if(arguments[0]instanceof Ga){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof E){var e=arguments[0];return this._nodes.addNode(e)}},Ne.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ne.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ne.prototype.debugPrintln=function(t){si.out.println(t)},Ne.prototype.isBoundaryNode=function(t,e){var i=this._nodes.find(e);if(i===null)return!1;var n=i.getLabel();return n!==null&&n.getLocation(t)===L.BOUNDARY},Ne.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()}
3,Ne.prototype.matchInSameDirection=function(t,e,i,n){return!!t.equals(i)&&tt.computeOrientation(t,e,n)===tt.COLLINEAR&&pe.quadrant(t,e)===pe.quadrant(i,n)},Ne.prototype.getEdgeEnds=function(){return this._edgeEndList},Ne.prototype.debugPrint=function(t){si.out.print(t)},Ne.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ne.prototype.findEdgeInSameDirection=function(t,e){for(var i=0;i<this._edges.size();i++){var n=this._edges.get(i),a=n.getCoordinates();if(this.matchInSameDirection(t,e,a[0],a[1])||this.matchInSameDirection(t,e,a[a.length-1],a[a.length-2]))return n}return null},Ne.prototype.insertEdge=function(t){this._edges.add(t)},Ne.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var i=e.next();if(i.getEdge()===t)return i}return null},Ne.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();this._edges.add(i);var n=new hl(i,!0),a=new hl(i,!1);n.setSym(a),a.setSym(n),this.add(n),this.add(a)}},Ne.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ne.prototype.getNodes=function(){return this._nodes.values()},Ne.prototype.findEdge=function(t,e){for(var i=0;i<this._edges.size();i++){var n=this._edges.get(i),a=n.getCoordinates();if(t.equals(a[0])&&e.equals(a[1]))return n}return null},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var cn=function(){this._geometryFactory=null,this._shellList=new F;var t=arguments[0];this._geometryFactory=t};cn.prototype.sortShellsAndHoles=function(t,e,i){for(var n=t.iterator();n.hasNext();){var a=n.next();a.isHole()?i.add(a):e.add(a)}},cn.prototype.computePolygons=function(t){for(var e=new F,i=t.iterator();i.hasNext();){var n=i.next().toPolygon(this._geometryFactory);e.add(n)}return e},cn.prototype.placeFreeHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next();if(n.getShell()===null){var a=this.findEdgeRingContaining(n,t);if(a===null)throw new gr("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(a)}}},cn.prototype.buildMinimalEdgeRings=function(t,e,i){for(var n=new F,a=t.iterator();a.hasNext();){var u=a.next();if(u.getMaxNodeDegree()>2){u.linkDirectedEdgesForMinimalEdgeRings();var d=u.buildMinimalRings(),g=this.findShell(d);g!==null?(this.placePolygonHoles(g,d),e.add(g)):i.addAll(d)}else n.add(u)}return n},cn.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},cn.prototype.buildMaximalEdgeRings=function(t){for(var e=new F,i=t.iterator();i.hasNext();){var n=i.next();if(n.isInResult()&&n.getLabel().isArea()&&n.getEdgeRing()===null){var a=new B0(n,this._geometryFactory);e.add(a),a.setInResult()}}return e},cn.prototype.placePolygonHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next();n.isHole()&&n.setShell(t)}},cn.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},cn.prototype.findEdgeRingContaining=function(t,e){for(var i=t.getLinearRing(),n=i.getEnvelopeInternal(),a=i.getCoordinateN(0),u=null,d=null,g=e.iterator();g.hasNext();){var _=g.next(),M=_.getLinearRing(),B=M.getEnvelopeInternal();u!==null&&(d=u.getLinearRing().getEnvelopeInternal());var G=!1;B.contains(n)&&tt.isPointInRing(a,M.getCoordinates())&&(G=!0),G&&(u===null||d.contains(B))&&(u=_)}return u},cn.prototype.findShell=function(t){for(var e=0,i=null,n=t.iterator();n.hasNext();){var a=n.next();a.isHole()||(i=a,e++)}return pt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),i},cn.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],i=arguments[1];Ne.linkResultDirectedEdges(i);var n=this.buildMaximalEdgeRings(e),a=new F,u=this.buildMinimalEdgeRings(n,this._shellList,a);this.sortShellsAndHoles(u,this._shellList,a),this.placeFreeHoles(this._shellList,a)}},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var Ho=function(){};Ho.prototype.getBounds=function(){},Ho.prototype.interfaces_=function(){return[]},Ho.prototype.getClass=function(){return Ho};var Rn=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Rn.prototype.getItem=function(){return this._item},Rn.prototype.getBounds=function(){return this._bounds},Rn.prototype.interfaces_=function(){return[Ho,s]},Rn.prototype.getClass=function(){return Rn};var yr=function(){this._size=null,this._items=null,this._size=0,this._items=new F,this._items.add(null)};yr.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},yr.prototype.size=function(){return this._size},yr.prototype.reorder=function(t){for(var e=null,i=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).
3compareTo(i)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,i)},yr.prototype.clear=function(){this._size=0,this._items.clear()},yr.prototype.isEmpty=function(){return this._size===0},yr.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var Br=function(){};Br.prototype.visitItem=function(t){},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var _o=function(){};_o.prototype.insert=function(t,e){},_o.prototype.remove=function(t,e){},_o.prototype.query=function(){},_o.prototype.interfaces_=function(){return[]},_o.prototype.getClass=function(){return _o};var ti=function(){if(this._childBoundables=new F,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Ih={serialVersionUID:{configurable:!0}};ti.prototype.getLevel=function(){return this._level},ti.prototype.size=function(){return this._childBoundables.size()},ti.prototype.getChildBoundables=function(){return this._childBoundables},ti.prototype.addChildBoundable=function(t){pt.isTrue(this._bounds===null),this._childBoundables.add(t)},ti.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},ti.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},ti.prototype.interfaces_=function(){return[Ho,s]},ti.prototype.getClass=function(){return ti},Ih.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(ti,Ih);var An=function(){};An.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},An.min=function(t){return An.sort(t),t.get(0)},An.sort=function(t,e){var i=t.toArray();e?Be.sort(i,e):Be.sort(i);for(var n=t.iterator(),a=0,u=i.length;a<u;a++)n.next(),n.set(i[a])},An.singletonList=function(t){var e=new F;return e.add(t),e};var Ve=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=i,this._distance=this.distance()};Ve.prototype.expandToQueue=function(t,e){var i=Ve.isComposite(this._boundable1),n=Ve.isComposite(this._boundable2);if(i&&n)return Ve.area(this._boundable1)>Ve.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(i)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new T("neither boundable is composite")},Ve.prototype.isLeaves=function(){return!(Ve.isComposite(this._boundable1)||Ve.isComposite(this._boundable2))},Ve.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Ve.prototype.expand=function(t,e,i,n){for(var a=t.getChildBoundables().iterator();a.hasNext();){var u=a.next(),d=new Ve(u,e,this._itemDistance);d.getDistance()<n&&i.add(d)}},Ve.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Ve.prototype.getDistance=function(){return this._distance},Ve.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ve.prototype.interfaces_=function(){return[W]},Ve.prototype.getClass=function(){return Ve},Ve.area=function(t){return t.getBounds().getArea()},Ve.isComposite=function(t){return t instanceof ti};var ui=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new F,this._nodeCapacity=null,arguments.length===0){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var i=arguments[0];pt.isTrue(i>
31,"Node capacity must be greater than 1"),this._nodeCapacity=i}},za={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};ui.prototype.getNodeCapacity=function(){return this._nodeCapacity},ui.prototype.lastNode=function(t){return t.get(t.size()-1)},ui.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var i=e.next();i instanceof ti?t+=this.size(i):i instanceof Rn&&(t+=1)}return t}},ui.prototype.removeItem=function(t,e){for(var i=null,n=t.getChildBoundables().iterator();n.hasNext();){var a=n.next();a instanceof Rn&&a.getItem()===e&&(i=a)}return i!==null&&(t.getChildBoundables().remove(i),!0)},ui.prototype.itemsTree=function(){if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new F:t}if(arguments.length===1){for(var e=arguments[0],i=new F,n=e.getChildBoundables().iterator();n.hasNext();){var a=n.next();if(a instanceof ti){var u=this.itemsTree(a);u!==null&&i.add(u)}else a instanceof Rn?i.add(a.getItem()):pt.shouldNeverReachHere()}return i.size()<=0?null:i}},ui.prototype.insert=function(t,e){pt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Rn(t,e))},ui.prototype.boundablesAtLevel=function(){if(arguments.length===1){var t=arguments[0],e=new F;return this.boundablesAtLevel(t,this._root,e),e}if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2];if(pt.isTrue(i>-2),n.getLevel()===i)return a.add(n),null;for(var u=n.getChildBoundables().iterator();u.hasNext();){var d=u.next();d instanceof ti?this.boundablesAtLevel(i,d,a):(pt.isTrue(d instanceof Rn),i===-1&&a.add(d))}return null}},ui.prototype.query=function(){if(arguments.length===1){var t=arguments[0];this.build();var e=new F;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(arguments.length===2){var i=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,n)}else if(arguments.length===3){if(st(arguments[2],Br)&&arguments[0]instanceof Object&&arguments[1]instanceof ti)for(var a=arguments[0],u=arguments[1],d=arguments[2],g=u.getChildBoundables(),_=0;_<g.size();_++){var M=g.get(_);this.getIntersectsOp().intersects(M.getBounds(),a)&&(M instanceof ti?this.query(a,M,d):M instanceof Rn?d.visitItem(M.getItem()):pt.shouldNeverReachHere())}else if(st(arguments[2],j)&&arguments[0]instanceof Object&&arguments[1]instanceof ti)for(var B=arguments[0],G=arguments[1],it=arguments[2],nt=G.getChildBoundables(),at=0;at<nt.size();at++){var ut=nt.get(at);this.getIntersectsOp().intersects(ut.getBounds(),B)&&(ut instanceof ti?this.query(B,ut,it):ut instanceof Rn?it.add(ut.getItem()):pt.shouldNeverReachHere())}}},ui.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},ui.prototype.getRoot=function(){return this.build(),this._root},ui.prototype.remove=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2],u=this.removeItem(n,a);if(u)return!0;for(var d=null,g=n.getChildBoundables().iterator();g.hasNext();){var _=g.next();if(this.getIntersectsOp().intersects(_.getBounds(),i)&&_ instanceof ti&&(u=this.remove(i,_,a))){d=_;break}}return d!==null&&d.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(d),u}},ui.prototype.createHigherLevels=function(t,e){pt.isTrue(!t.isEmpty());var i=this.createParentBoundables(t,e+1);return i.size()===1?i.get(0):this.createHigherLevels(i,e+1)},ui.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var i=e.next();if(i instanceof ti){var n=this.depth(i);n>t&&(t=n)}}return t+1}},ui.prototype.createParentBoundables=function(t,e){pt.isTrue(!t.isEmpty());var i=new F;i.add(this.createNode(e));var n=new F(t);An.sort(n,this.getComparator());for(var a=n.iterator();a.hasNext();){var u=a.next();this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(e)),this.lastNode(i).addChildBoundable(u)}return i},ui.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},ui.prototype.interfaces_=function(){return[s]},ui.prototype.getClass=function(){return ui},ui.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},za.IntersectsOp.get=function(){return q0},za.serialVersionUID.get=function(){return-3886435814360241e3},za.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(ui,za);var q0=function(){},Vo=function(){};Vo.prototype.distance=function(t,e){},Vo.prototype.interfaces_=function(){return[]},Vo.prototype.getClass=function(){return Vo};var Sh=function(t){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,t.call(this,n)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(n,a){pt.isTrue(n.length>0);for(var u=new F,d=0;d<n.length;d++)u.addAll(this.createParentBoundablesFromVerticalSlice(n[d],a));return u},e.prototype.createNode=function(n){return new Oh(n)},e.prototype.size=function(){return arguments.length===0?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length!==2)return t.prototype.insert.apply(this,arguments);var n=arguments[0],a=arguments[1];if(n.isNull())return null;t.prototype.insert.call(this,n,a)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(n,a){for(var u=Math.trunc(Math.ceil(n.size()/a)),d=new Array(a).fill(null),g=n.iterator(),_=0;_<a;_++){d[_]=new F;for(var M=0;g.hasNext()&&M<u;){var B=g.next();d[_].add(B),M++}}return d},e.prototype.query=function(){if(arguments.length===1){var n=arguments[0];return t.prototype.query.call(this,n)}if(arguments.length===2){var a=arguments[0],u=arguments[1];t.prototype.query.call(this,a,u)}else if(arguments.length===3){if(st(arguments[2],Br)&&arguments[0]instanceof Object&&arguments[1]instanceof ti){var d=arguments[0],g=arguments[1],_=arguments[2];t.prototype.query.call(this,d,g,_)}else if(st(arguments[2],j)&&arguments[0]instanceof Object&&arguments[1]instanceof ti){var M=arguments[0],B=arguments[1],G=arguments[2];t.prototype.query.call(this,M,B,G)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(n,a){return t.prototype.createParentBoundables.call(this,n,a)},e.prototype.remove=function(){if(arguments.length===2){var n=arguments[0],a=arguments[1];return t.prototype.remove.call(this,n,a)}return t.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(n,a){pt.isTrue(!n.isEmpty());var u=Math.trunc(Math.ceil(n.size()/this.getNodeCapacity())),d=new F(n);An.sort(d,e.xComparator);var g=this.verticalSlices(d,Math.trunc(Math.ceil(Math.sqrt(u))));return this.createParentBoundablesFromVerticalSlices(g,a)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(st(arguments[0],Vo)){var n=arguments[0],a=new Ve(this.getRoot(),this.getRoot(),n);return this.nearestNeighbour(a)}if(arguments[0]instanceof Ve){var u=arguments[0];return this.nearestNeighbour(u,P.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&st(arguments[1],Vo)){var d=arguments[0],g=arguments[1],_=new Ve(this.getRoot(),d.getRoot(),g);return this.nearestNeighbour(_)}if(arguments[0]instanceof Ve&&typeof arguments[1]=="number"){var M=arguments[0],B=arguments[1],G=null,it=new yr;for(it.add(M);!it.isEmpty()&&B>0;){var nt=it.poll(),at=nt.getDistance();if(at>=B)break;nt.isLeaves()?(B=at,G=nt):nt.expandToQueue(it,B)}return[G.getBoundable(0).getItem(),G.getBoundable(1).getItem()]}}else if(arguments.length===3){var ut=arguments[0],de=arguments[1],Qe=arguments[2],Bi=new Rn(ut,de),ur=new Ve(this.getRoot(),Bi,Qe);return this.nearestNeighbour(ur)[0]}},e.prototype.interfaces_=function(){return[_o,s]},e.prototype.getClass=function(){return e},e.centreX=function(n){return e.avg(n.getMinX(),n.getMaxX())},e.avg=function(n,a){return(n+a)/2},e.centreY=function(n){return e.avg(n.getMinY(),n.getMaxY())},i.STRtreeNode.get=function(){return Oh},i.serialVersionUID.get=function(){return 0x39920f7d5f261e0},i.xComparator.get=function(){return{interfaces_:function(){return[et]},compare:function(n,a){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(a.getBounds()))}}},i.yComparator.get=function(){return{interfaces_:function(){return[et]},compare:function(n,a){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(a.getBounds()))}}},i.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(n,a){return n.intersects(a)}}},i.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,i),e}(ui),Oh=function(t){function e(){var i=arguments[0];t.call(this,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var i=null,n=this.getChildBoundables().iterator();n.hasNext();){var a=n.next();i===null?i=new ct(a.getBounds()):i.expandToInclude(a.getBounds())}return i},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ti),Hi=function(){};Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi},Hi.relativeSign=function(t,e){return t<e?-1:t>e?1:0}
3,Hi.compare=function(t,e,i){if(e.equals2D(i))return 0;var n=Hi.relativeSign(e.x,i.x),a=Hi.relativeSign(e.y,i.y);switch(t){case 0:return Hi.compareValue(n,a);case 1:return Hi.compareValue(a,n);case 2:return Hi.compareValue(a,-n);case 3:return Hi.compareValue(-n,a);case 4:return Hi.compareValue(-n,-a);case 5:return Hi.compareValue(-a,-n);case 6:return Hi.compareValue(-a,n);case 7:return Hi.compareValue(n,-a)}return pt.shouldNeverReachHere("invalid octant value"),0},Hi.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var qr=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this._segString=t,this.coord=new E(e),this.segmentIndex=i,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(i))};qr.prototype.getCoordinate=function(){return this.coord},qr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},qr.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Hi.compare(this._segmentOctant,this.coord,e.coord)},qr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},qr.prototype.isInterior=function(){return this._isInterior},qr.prototype.interfaces_=function(){return[W]},qr.prototype.getClass=function(){return qr};var Li=function(){this._nodeMap=new O,this._edge=null;var t=arguments[0];this._edge=t};Li.prototype.getSplitCoordinates=function(){var t=new Q;this.addEndpoints();for(var e=this.iterator(),i=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(i,n,t),i=n}return t.toCoordinateArray()},Li.prototype.addCollapsedNodes=function(){var t=new F;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var i=e.next().intValue();this.add(this._edge.getCoordinate(i),i)}},Li.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Li.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var i=this._edge.getCoordinate(e),n=this._edge.getCoordinate(e+2);i.equals2D(n)&&t.add(new Me(e+1))}},Li.prototype.addEdgeCoordinates=function(t,e,i){var n=this._edge.getCoordinate(e.segmentIndex),a=e.isInterior()||!e.coord.equals2D(n);i.add(new E(t.coord),!1);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)i.add(this._edge.getCoordinate(u));a&&i.add(new E(e.coord))},Li.prototype.iterator=function(){return this._nodeMap.values().iterator()},Li.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),i=e.next();e.hasNext();){var n=e.next(),a=this.createSplitEdge(i,n);t.add(a),i=n}},Li.prototype.findCollapseIndex=function(t,e,i){if(!t.coord.equals2D(e.coord))return!1;var n=e.segmentIndex-t.segmentIndex;return e.isInterior()||n--,n===1&&(i[0]=t.segmentIndex+1,!0)},Li.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),i=this.iterator(),n=i.next();i.hasNext();){var a=i.next();this.findCollapseIndex(n,a,e)&&t.add(new Me(e[0])),n=a}},Li.prototype.getEdge=function(){return this._edge},Li.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Li.prototype.createSplitEdge=function(t,e){var i=e.segmentIndex-t.segmentIndex+2,n=this._edge.getCoordinate(e.segmentIndex),a=e.isInterior()||!e.coord.equals2D(n);a||i--;var u=new Array(i).fill(null),d=0;u[d++]=new E(t.coord);for(var g=t.segmentIndex+1;g<=e.segmentIndex;g++)u[d++]=this._edge.getCoordinate(g);return a&&(u[d]=new E(e.coord)),new Xe(u,this._edge.getData())},Li.prototype.add=function(t,e){var i=new qr(this._edge,t,e,this._edge.getSegmentOctant(e)),n=this._nodeMap.get(i);return n!==null?(pt.isTrue(n.coord.equals2D(t),"Found equal nodes with different coordinates"),n):(this._nodeMap.put(i,i),i)},Li.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),i=t.get(0).getCoordinate(0);if(!i.equals2D(e[0]))throw new Ln("bad split edge start point at "+i);var n=t.get(t.size()-1).getCoordinates(),a=n[n.length-1];if(!a.equals2D(e[e.length-1]))throw new Ln("bad split edge end point at "+a)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li}
3;var xo=function(){};xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo},xo.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new T("Cannot compute the octant for point ( "+t+", "+e+" )");var i=Math.abs(t),n=Math.abs(e);return t>=0?e>=0?i>=n?0:1:i>=n?7:6:e>=0?i>=n?3:2:i>=n?4:5}if(arguments[0]instanceof E&&arguments[1]instanceof E){var a=arguments[0],u=arguments[1],d=u.x-a.x,g=u.y-a.y;if(d===0&&g===0)throw new T("Cannot compute the octant for two identical points "+a);return xo.octant(d,g)}};var ir=function(){};ir.prototype.getCoordinates=function(){},ir.prototype.size=function(){},ir.prototype.getCoordinate=function(t){},ir.prototype.isClosed=function(){},ir.prototype.setData=function(t){},ir.prototype.getData=function(){},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir};var Gs=function(){};Gs.prototype.addIntersection=function(t,e){},Gs.prototype.interfaces_=function(){return[ir]},Gs.prototype.getClass=function(){return Gs};var Xe=function(){this._nodeList=new Li(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Xe.prototype.getCoordinates=function(){return this._pts},Xe.prototype.size=function(){return this._pts.length},Xe.prototype.getCoordinate=function(t){return this._pts[t]},Xe.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Xe.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Xe.prototype.setData=function(t){this._data=t},Xe.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:xo.octant(t,e)},Xe.prototype.getData=function(){return this._data},Xe.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var i=arguments[0],n=arguments[1],a=arguments[3],u=new E(i.getIntersection(a));this.addIntersection(u,n)}},Xe.prototype.toString=function(){return mn.toLineString(new Ue(this._pts))},Xe.prototype.getNodeList=function(){return this._nodeList},Xe.prototype.addIntersectionNode=function(t,e){var i=e,n=i+1;if(n<this._pts.length){var a=this._pts[n];t.equals2D(a)&&(i=n)}return this._nodeList.add(t,i)},Xe.prototype.addIntersections=function(t,e,i){for(var n=0;n<t.getIntersectionNum();n++)this.addIntersection(t,e,i,n)},Xe.prototype.interfaces_=function(){return[Gs]},Xe.prototype.getClass=function(){return Xe},Xe.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new F;return Xe.getNodedSubstrings(t,e),e}if(arguments.length===2)for(var i=arguments[0],n=arguments[1],a=i.iterator();a.hasNext();)a.next().getNodeList().addSplitEdges(n)};var lt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new E,this.p1=new E;else if(arguments.length===1){var t=arguments[0];this.p0=new E(t.p0),this.p1=new E(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],i=arguments[1],n=arguments[2],a=arguments[3];this.p0=new E(e,i),this.p1=new E(n,a)}},kh={serialVersionUID:{configurable:!0}};lt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},lt.prototype.orientationIndex=function(){if(arguments[0]instanceof lt){var t=arguments[0],e=tt.orientationIndex(this.p0,this.p1,t.p0),i=tt.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&i>=0||e<=0&&i<=0?Math.max(e,i):0}if(arguments[0]instanceof E){var n=arguments[0];return tt.orientationIndex(this.p0,this.p1,n)}},lt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},lt.prototype.isVertical=function(){return this.p0.x===this.p1.x},lt.prototype.equals=function(t){if(!(t instanceof lt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},lt.prototype.intersection=function(t){var e=new Jn;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},lt.prototype.project=function(){if(arguments[0]instanceof E){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new E(t);var e=this.projectionFactor(t),i=new E;return i.x=this.p0.x+e*(this.p1.x-this.p0.x),i.y=this.p0.y+e*(this.p1.y-this.p0.y),i}if(arguments[0]instanceof lt){var n=arguments[0],a=this.projectionFactor(n.p0),u=this.projectionFactor(n.p1);if(a>=1&&u>=1||a<=0&&u<=0)return null;var d=this.project(n.p0);a<0&&(d=this.p0),a>1&&(d=this.p1);var g=this.project(n.p1);return u<0&&(g=this.p0),u>1&&(g=this.p1),new lt(d,g)}},lt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},lt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},lt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},lt.prototype.distancePerpendicular=function(t){return tt.distancePointLinePerpendicular(t,this.p0,this.p1)},lt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},lt.prototype.midPoint=function(){return lt.midPoint(this.p0,this.p1)},lt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,n=e*e+i*i;return n<=0?P.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*i)/n},lt.prototype.closestPoints=function(t){var e=this.intersection(t);
3if(e!==null)return[e,e];var i=new Array(2).fill(null),n=P.MAX_VALUE,a=null,u=this.closestPoint(t.p0);n=u.distance(t.p0),i[0]=u,i[1]=t.p0;var d=this.closestPoint(t.p1);(a=d.distance(t.p1))<n&&(n=a,i[0]=d,i[1]=t.p1);var g=t.closestPoint(this.p0);(a=g.distance(this.p0))<n&&(n=a,i[0]=this.p0,i[1]=g);var _=t.closestPoint(this.p1);return(a=_.distance(this.p1))<n&&(n=a,i[0]=this.p1,i[1]=_),i},lt.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},lt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},lt.prototype.getLength=function(){return this.p0.distance(this.p1)},lt.prototype.compareTo=function(t){var e=t,i=this.p0.compareTo(e.p0);return i!==0?i:this.p1.compareTo(e.p1)},lt.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},lt.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},lt.prototype.lineIntersection=function(t){try{return rn.intersection(this.p0,this.p1,t.p0,t.p1)}catch(e){if(!(e instanceof Zr))throw e}return null},lt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},lt.prototype.pointAlongOffset=function(t,e){var i=this.p0.x+t*(this.p1.x-this.p0.x),n=this.p0.y+t*(this.p1.y-this.p0.y),a=this.p1.x-this.p0.x,u=this.p1.y-this.p0.y,d=Math.sqrt(a*a+u*u),g=0,_=0;if(e!==0){if(d<=0)throw new Error("Cannot compute offset from zero-length line segment");g=e*a/d,_=e*u/d}return new E(i-_,n+g)},lt.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=i.x,this.p1.y=i.y}},lt.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||P.isNaN(e))&&(e=1),e},lt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},lt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},lt.prototype.distance=function(){if(arguments[0]instanceof lt){var t=arguments[0];return tt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof E){var e=arguments[0];return tt.distancePointLine(e,this.p0,this.p1)}},lt.prototype.pointAlong=function(t){var e=new E;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},lt.prototype.hashCode=function(){var t=P.doubleToLongBits(this.p0.x);t^=31*P.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),i=P.doubleToLongBits(this.p1.x);return i^=31*P.doubleToLongBits(this.p1.y),e^(Math.trunc(i)^Math.trunc(i>>32))},lt.prototype.interfaces_=function(){return[W,s]},lt.prototype.getClass=function(){return lt},lt.midPoint=function(t,e){return new E((t.x+e.x)/2,(t.y+e.y)/2)},kh.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(lt,kh);var zs=function(){this.tempEnv1=new ct,this.tempEnv2=new ct,this._overlapSeg1=new lt,this._overlapSeg2=new lt};zs.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];t.getLineSegment(e,this._overlapSeg1),i.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},zs.prototype.interfaces_=function(){return[]},zs.prototype.getClass=function(){return zs};var ln=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=i,this._context=n};ln.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},ln.prototype.computeSelect=function(t,e,i,n){var a=this._pts[e],u=this._pts[i];if(n.tempEnv1.init(a,u),i-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var d=Math.trunc((e+i)/2);e<d&&this.computeSelect(t,e,d,n),d<i&&this.computeSelect(t,d,i,n)},ln.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,i=this._start;i<=this._end;
3i++)t[e++]=this._pts[i];return t},ln.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},ln.prototype.setId=function(t){this._id=t},ln.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},ln.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ct(t,e)}return this._env},ln.prototype.getEndIndex=function(){return this._end},ln.prototype.getStartIndex=function(){return this._start},ln.prototype.getContext=function(){return this._context},ln.prototype.getId=function(){return this._id},ln.prototype.computeOverlapsInternal=function(t,e,i,n,a,u){var d=this._pts[t],g=this._pts[e],_=i._pts[n],M=i._pts[a];if(e-t==1&&a-n==1)return u.overlap(this,t,i,n),null;if(u.tempEnv1.init(d,g),u.tempEnv2.init(_,M),!u.tempEnv1.intersects(u.tempEnv2))return null;var B=Math.trunc((t+e)/2),G=Math.trunc((n+a)/2);t<B&&(n<G&&this.computeOverlapsInternal(t,B,i,n,G,u),G<a&&this.computeOverlapsInternal(t,B,i,G,a,u)),B<e&&(n<G&&this.computeOverlapsInternal(B,e,i,n,G,u),G<a&&this.computeOverlapsInternal(B,e,i,G,a,u))},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var jn=function(){};jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.getChainStartIndices=function(t){var e=0,i=new F;i.add(new Me(e));do{var n=jn.findChainEnd(t,e);i.add(new Me(n)),e=n}while(e<t.length-1);return jn.toIntArray(i)},jn.findChainEnd=function(t,e){for(var i=e;i<t.length-1&&t[i].equals2D(t[i+1]);)i++;if(i>=t.length-1)return t.length-1;for(var n=pe.quadrant(t[i],t[i+1]),a=e+1;a<t.length&&!(!t[a-1].equals2D(t[a])&&pe.quadrant(t[a-1],t[a])!==n);)a++;return a-1},jn.getChains=function(){if(arguments.length===1){var t=arguments[0];return jn.getChains(t,null)}if(arguments.length===2){for(var e=arguments[0],i=arguments[1],n=new F,a=jn.getChainStartIndices(e),u=0;u<a.length-1;u++){var d=new ln(e,a[u],a[u+1],i);n.add(d)}return n}},jn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var to=function(){};to.prototype.computeNodes=function(t){},to.prototype.getNodedSubstrings=function(){},to.prototype.interfaces_=function(){return[]},to.prototype.getClass=function(){return to};var Us=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Us.prototype.setSegmentIntersector=function(t){this._segInt=t},Us.prototype.interfaces_=function(){return[to]},Us.prototype.getClass=function(){return Us};var dl=function(t){function e(n){n?t.call(this,n):t.call(this),this._monoChains=new F,this._index=new Sh,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return Xe.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(n){for(var a=jn.getChains(n.getCoordinates(),n).iterator();a.hasNext();){var u=a.next();u.setId(this._idCounter++),this._index.insert(u.getEnvelope(),u),this._monoChains.add(u)}},e.prototype.computeNodes=function(n){this._nodedSegStrings=n;for(var a=n.iterator();a.hasNext();)this.add(a.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var n=new Nh(this._segInt),a=this._monoChains.iterator();a.hasNext();)for(var u=a.next(),d=this._index.query(u.getEnvelope()).iterator();d.hasNext();){var g=d.next();if(g.getId()>u.getId()&&(u.computeOverlaps(g,n),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.SegmentOverlapAction.get=function(){return Nh},Object.defineProperties(e,i),e}(Us),Nh=function(t){function e(){t.call(this),this._si=null;var i=arguments[0];this._si=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length!==4)return t.prototype.overlap.apply(this,arguments);var i=arguments[0],n=arguments[1],a=arguments[2],u=arguments[3],d=i.getContext(),g=a.getContext();this._si.processIntersections(d,n,g,u)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zs),Kt=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var i=arguments[0],n=arguments[1];this.setQuadrantSegments(i),this.setEndCapStyle(n)}else if(arguments.length===4){var a=arguments[0],u=arguments[1],d=arguments[2],g=arguments[3];this.setQuadrantSegments(a),this.setEndCapStyle(u),this.setJoinStyle(d),this.setMitreLimit(g)}}},vr={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}};Kt.prototype.getEndCapStyle=function(){return this._endCapStyle},Kt.prototype.isSingleSided=function(){return this._isSingleSided},Kt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Kt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Kt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Kt.JOIN_ROUND&&(this._quadrantSegments=Kt.DEFAULT_QUADRANT_SEGMENTS)},Kt.prototype.getJoinStyle=function(){return this._joinStyle},Kt.prototype.setJoinStyle=function(t){this._joinStyle=t},Kt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Kt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Kt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Kt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Kt.prototype.getMitreLimit=function(){return this._mitreLimit},Kt.prototype.setMitreLimit=function(t){this._mitreLimit=t},Kt.prototype.setSingleSided=function(t){this._isSingleSided=t},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},vr.CAP_ROUND.get=function(){return 1},vr.CAP_FLAT.get=function(){return 2},vr.CAP_SQUARE.get=function(){return 3},vr.JOIN_ROUND.get=function(){return 1},vr.JOIN_MITRE.get=function(){return 2},vr.JOIN_BEVEL.get=function(){return 3},vr.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},vr.DEFAULT_MITRE_LIMIT.get=function(){return 5},vr.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Kt,vr);var Te=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=tt.COUNTERCLOCKWISE,this._inputLine=t||null},Xs={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};
3Te.prototype.isDeletable=function(t,e,i,n){var a=this._inputLine[t],u=this._inputLine[e],d=this._inputLine[i];return!!this.isConcave(a,u,d)&&!!this.isShallow(a,u,d,n)&&this.isShallowSampled(a,u,t,i,n)},Te.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(e),n=!1;i<this._inputLine.length;){var a=!1;this.isDeletable(t,e,i,this._distanceTol)&&(this._isDeleted[e]=Te.DELETE,a=!0,n=!0),t=a?i:e,e=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(e)}return n},Te.prototype.isShallowConcavity=function(t,e,i,n){return tt.computeOrientation(t,e,i)!==this._angleOrientation?!1:tt.distancePointLine(e,t,i)<n},Te.prototype.isShallowSampled=function(t,e,i,n,a){var u=Math.trunc((n-i)/Te.NUM_PTS_TO_CHECK);u<=0&&(u=1);for(var d=i;d<n;d+=u)if(!this.isShallow(t,e,this._inputLine[d],a))return!1;return!0},Te.prototype.isConcave=function(t,e,i){var n=tt.computeOrientation(t,e,i)===this._angleOrientation;return n},Te.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=tt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do e=this.deleteShallowConcavities();while(e);return this.collapseLine()},Te.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Te.DELETE;)e++;return e},Te.prototype.isShallow=function(t,e,i,n){return tt.distancePointLine(e,t,i)<n},Te.prototype.collapseLine=function(){for(var t=new Q,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Te.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.simplify=function(t,e){return new Te(t).simplify(e)},Xs.INIT.get=function(){return 0},Xs.DELETE.get=function(){return 1},Xs.KEEP.get=function(){return 1},Xs.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Te,Xs);var yn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new F},Lh={COORDINATE_ARRAY_TYPE:{configurable:!0}};yn.prototype.getCoordinates=function(){return this._ptList.toArray(yn.COORDINATE_ARRAY_TYPE)},yn.prototype.setPrecisionModel=function(t){this._precisionModel=t},yn.prototype.addPt=function(t){var e=new E(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},yn.prototype.revere=function(){},yn.prototype.addPts=function(t,e){if(e)for(var i=0;i<t.length;i++)this.addPt(t[i]);else for(var n=t.length-1;n>=0;n--)this.addPt(t[n])},yn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},yn.prototype.toString=function(){return new bt().createLineString(this.getCoordinates()).toString()},yn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new E(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},yn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn},Lh.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(yn,Lh);var Ct=function(){},wo={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.toDegrees=function(t){return 180*t/Math.PI},Ct.normalize=function(t){for(;t>Math.PI;)t-=Ct.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ct.PI_TIMES_2;return t},Ct.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}if(arguments.length===2){var e=arguments[0],i=arguments[1],n=i.x-e.x,a=i.y-e.y;return Math.atan2(a,n)}},Ct.isAcute=function(t,e,i){var n=t.x-e.x,a=t.y-e.y;return n*(i.x-e.x)+a*(i.y-e.y)>0},Ct.isObtuse=function(t,e,i){var n=t.x-e.x,a=t.y-e.y;return n*(i.x-e.x)+a*(i.y-e.y)<0}
3,Ct.interiorAngle=function(t,e,i){var n=Ct.angle(e,t),a=Ct.angle(e,i);return Math.abs(a-n)},Ct.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ct.PI_TIMES_2;t>=Ct.PI_TIMES_2&&(t=0)}else{for(;t>=Ct.PI_TIMES_2;)t-=Ct.PI_TIMES_2;t<0&&(t=0)}return t},Ct.angleBetween=function(t,e,i){var n=Ct.angle(e,t),a=Ct.angle(e,i);return Ct.diff(n,a)},Ct.diff=function(t,e){var i=null;return(i=t<e?e-t:t-e)>Math.PI&&(i=2*Math.PI-i),i},Ct.toRadians=function(t){return t*Math.PI/180},Ct.getTurn=function(t,e){var i=Math.sin(e-t);return i>0?Ct.COUNTERCLOCKWISE:i<0?Ct.CLOCKWISE:Ct.NONE},Ct.angleBetweenOriented=function(t,e,i){var n=Ct.angle(e,t),a=Ct.angle(e,i)-n;return a<=-Math.PI?a+Ct.PI_TIMES_2:a>Math.PI?a-Ct.PI_TIMES_2:a},wo.PI_TIMES_2.get=function(){return 2*Math.PI},wo.PI_OVER_2.get=function(){return Math.PI/2},wo.PI_OVER_4.get=function(){return Math.PI/4},wo.COUNTERCLOCKWISE.get=function(){return tt.COUNTERCLOCKWISE},wo.CLOCKWISE.get=function(){return tt.CLOCKWISE},wo.NONE.get=function(){return tt.COLLINEAR},Object.defineProperties(Ct,wo);var Ee=function t(){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 lt,this._seg1=new lt,this._offset0=new lt,this._offset1=new lt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],i=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=i,this._li=new Jn,this._filletAngleQuantum=Math.PI/2/i.getQuadrantSegments(),i.getQuadrantSegments()>=8&&i.getJoinStyle()===Kt.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},Ys={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}};Ee.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 i=tt.computeOrientation(this._s0,this._s1,this._s2),n=i===tt.CLOCKWISE&&this._side===K.LEFT||i===tt.COUNTERCLOCKWISE&&this._side===K.RIGHT;i===0?this.addCollinear(e):n?this.addOutsideTurn(i,e):this.addInsideTurn(i,e)},Ee.prototype.addLineEndCap=function(t,e){var i=new lt(t,e),n=new lt;this.computeOffsetSegment(i,K.LEFT,this._distance,n);var a=new lt;this.computeOffsetSegment(i,K.RIGHT,this._distance,a);var u=e.x-t.x,d=e.y-t.y,g=Math.atan2(d,u);switch(this._bufParams.getEndCapStyle()){case Kt.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,g+Math.PI/2,g-Math.PI/2,tt.CLOCKWISE,this._distance),this._segList.addPt(a.p1);break;case Kt.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(a.p1);break;case Kt.CAP_SQUARE:var _=new E;_.x=Math.abs(this._distance)*Math.cos(g),_.y=Math.abs(this._distance)*Math.sin(g);var M=new E(n.p1.x+_.x,n.p1.y+_.y),B=new E(a.p1.x+_.x,a.p1.y+_.y);this._segList.addPt(M),this._segList.addPt(B)}},Ee.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ee.prototype.addMitreJoin=function(t,e,i,n){var a=!0,u=null;try{u=rn.intersection(e.p0,e.p1,i.p0,i.p1),(n<=0?1:u.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(a=!1)}catch(d){if(!(d instanceof Zr))throw d;u=new E(0,0),a=!1}a?this._segList.addPt(u):this.addLimitedMitreJoin(e,i,n,this._bufParams.getMitreLimit())},Ee.prototype.addFilletCorner=function(t,e,i,n,a){var u=e.x-t.x,d=e.y-t.y,g=Math.atan2(d,u),_=i.x-t.x,M=i.y-t.y,B=Math.atan2(M,_);n===tt.CLOCKWISE?g<=B&&(g+=2*Math.PI):g>=B&&(g-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,g,B,n,a),this._segList.addPt(i)},Ee.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ee.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Kt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Kt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},Ee.prototype.createSquare=function(t){this._segList.addPt(new E(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new E(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new E(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new E(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Ee.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Ee.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ee.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)}
3,Ee.prototype.initSideSegments=function(t,e,i){this._s1=t,this._s2=e,this._side=i,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},Ee.prototype.addLimitedMitreJoin=function(t,e,i,n){var a=this._seg0.p1,u=Ct.angle(a,this._seg0.p0),d=Ct.angleBetweenOriented(this._seg0.p0,a,this._seg1.p1)/2,g=Ct.normalize(u+d),_=Ct.normalize(g+Math.PI),M=n*i,B=i-M*Math.abs(Math.sin(d)),G=a.x+M*Math.cos(_),it=a.y+M*Math.sin(_),nt=new E(G,it),at=new lt(a,nt),ut=at.pointAlongOffset(1,B),de=at.pointAlongOffset(1,-B);this._side===K.LEFT?(this._segList.addPt(ut),this._segList.addPt(de)):(this._segList.addPt(de),this._segList.addPt(ut))},Ee.prototype.computeOffsetSegment=function(t,e,i,n){var a=e===K.LEFT?1:-1,u=t.p1.x-t.p0.x,d=t.p1.y-t.p0.y,g=Math.sqrt(u*u+d*d),_=a*i*u/g,M=a*i*d/g;n.p0.x=t.p0.x-M,n.p0.y=t.p0.y+_,n.p1.x=t.p1.x-M,n.p1.y=t.p1.y+_},Ee.prototype.addFilletArc=function(t,e,i,n,a){var u=n===tt.CLOCKWISE?-1:1,d=Math.abs(e-i),g=Math.trunc(d/this._filletAngleQuantum+.5);if(g<1)return null;for(var _=d/g,M=0,B=new E;M<d;){var G=e+u*M;B.x=t.x+a*Math.cos(G),B.y=t.y+a*Math.sin(G),this._segList.addPt(B),M+=_}},Ee.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Ee.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var i=new E((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i);var n=new E((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ee.prototype.createCircle=function(t){var e=new E(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ee.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ee.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new yn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ee.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ee.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Kt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Kt.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,tt.CLOCKWISE,this._distance))},Ee.prototype.closeRing=function(){this._segList.closeRing()},Ee.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee},Ys.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Ys.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Ys.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Ys.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ee,Ys);var Vi=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Vi.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var i=e<0,n=Math.abs(e),a=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],a):this.computeOffsetCurve(t,i,a);var u=a.getCoordinates();return i&&H.reverse(u),u},Vi.prototype.computeSingleSidedBufferCurve=function(t,e,i){var n=this.simplifyTolerance(this._distance);if(e){i.addSegments(t,!0);var a=Te.simplify(t,-n),u=a.length-1;i.initSideSegments(a[u],a[u-1],K.LEFT),i.addFirstSegment();for(var d=u-2;d>=0;d--)i.addNextSegment(a[d],!0)}else{i.addSegments(t,!1);var g=Te.simplify(t,n),_=g.length-1;i.initSideSegments(g[0],g[1],K.LEFT),i.addFirstSegment();for(var M=2;M<=_;M++)i.addNextSegment(g[M],!0)}i.addLastSegment(),i.closeRing()}
3,Vi.prototype.computeRingBufferCurve=function(t,e,i){var n=this.simplifyTolerance(this._distance);e===K.RIGHT&&(n=-n);var a=Te.simplify(t,n),u=a.length-1;i.initSideSegments(a[u-1],a[0],e);for(var d=1;d<=u;d++){var g=d!==1;i.addNextSegment(a[d],g)}i.closeRing()},Vi.prototype.computeLineBufferCurve=function(t,e){var i=this.simplifyTolerance(this._distance),n=Te.simplify(t,i),a=n.length-1;e.initSideSegments(n[0],n[1],K.LEFT);for(var u=2;u<=a;u++)e.addNextSegment(n[u],!0);e.addLastSegment(),e.addLineEndCap(n[a-1],n[a]);var d=Te.simplify(t,-i),g=d.length-1;e.initSideSegments(d[g],d[g-1],K.LEFT);for(var _=g-2;_>=0;_--)e.addNextSegment(d[_],!0);e.addLastSegment(),e.addLineEndCap(d[1],d[0]),e.closeRing()},Vi.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Kt.CAP_ROUND:e.createCircle(t);break;case Kt.CAP_SQUARE:e.createSquare(t)}},Vi.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var i=Math.abs(e),n=this.getSegGen(i);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var a=e<0;this.computeSingleSidedBufferCurve(t,a,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},Vi.prototype.getBufferParameters=function(){return this._bufParams},Vi.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Vi.prototype.getRingCurve=function(t,e,i){if(this._distance=i,t.length<=2)return this.getLineCurve(t,i);if(i===0)return Vi.copyCoordinates(t);var n=this.getSegGen(i);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},Vi.prototype.computeOffsetCurve=function(t,e,i){var n=this.simplifyTolerance(this._distance);if(e){var a=Te.simplify(t,-n),u=a.length-1;i.initSideSegments(a[u],a[u-1],K.LEFT),i.addFirstSegment();for(var d=u-2;d>=0;d--)i.addNextSegment(a[d],!0)}else{var g=Te.simplify(t,n),_=g.length-1;i.initSideSegments(g[0],g[1],K.LEFT),i.addFirstSegment();for(var M=2;M<=_;M++)i.addNextSegment(g[M],!0)}i.addLastSegment()},Vi.prototype.getSegGen=function(t){return new Ee(this._precisionModel,this._bufParams,t)},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi},Vi.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),i=0;i<e.length;i++)e[i]=new E(t[i]);return e};var bo=function(){this._subgraphs=null,this._seg=new lt,this._cga=new tt;var t=arguments[0];this._subgraphs=t},Rh={DepthSegment:{configurable:!0}};bo.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var t=arguments[0],e=new F,i=this._subgraphs.iterator();i.hasNext();){var n=i.next(),a=n.getEnvelope();t.y<a.getMinY()||t.y>a.getMaxY()||this.findStabbedSegments(t,n.getDirectedEdges(),e)}return e}if(arguments.length===3){if(st(arguments[2],j)&&arguments[0]instanceof E&&arguments[1]instanceof hl){for(var u=arguments[0],d=arguments[1],g=arguments[2],_=d.getEdge().getCoordinates(),M=0;M<_.length-1;M++)if(this._seg.p0=_[M],this._seg.p1=_[M+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<u.x)&&!(this._seg.isHorizontal()||u.y<this._seg.p0.y||u.y>this._seg.p1.y||tt.computeOrientation(this._seg.p0,this._seg.p1,u)===tt.RIGHT)){var B=d.getDepth(K.LEFT);this._seg.p0.equals(_[M])||(B=d.getDepth(K.RIGHT));var G=new eo(this._seg,B);g.add(G)}}else if(st(arguments[2],j)&&arguments[0]instanceof E&&st(arguments[1],j))for(var it=arguments[0],nt=arguments[1],at=arguments[2],ut=nt.iterator();ut.hasNext();){var de=ut.next();de.isForward()&&this.findStabbedSegments(it,de,at)}}},bo.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return e.size()===0?0:An.min(e)._leftDepth},bo.prototype.interfaces_=function(){return[]},bo.prototype.getClass=function(){return bo},Rh.DepthSegment.get=function(){return eo},Object.defineProperties(bo,Rh);var eo=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new lt(t),this._leftDepth=e};eo.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 i=this._upwardSeg.orientationIndex(e._upwardSeg);return i!==0||(i=-1*e._upwardSeg.orientationIndex(this._upwardSeg))!=0?i:this._upwardSeg.compareTo(e._upwardSeg)},eo.prototype.compareX=function(t,e){var i=t.p0.compareTo(e.p0);return i!==0?i:t.p1.compareTo(e.p1)},eo.prototype.toString=function(){return this._upwardSeg.toString()},eo.prototype.interfaces_=function(){return[W]},eo.prototype.getClass=function(){return eo};
3var te=function(t,e,i){this.p0=t||null,this.p1=e||null,this.p2=i||null};te.prototype.area=function(){return te.area(this.p0,this.p1,this.p2)},te.prototype.signedArea=function(){return te.signedArea(this.p0,this.p1,this.p2)},te.prototype.interpolateZ=function(t){if(t===null)throw new T("Supplied point is null.");return te.interpolateZ(t,this.p0,this.p1,this.p2)},te.prototype.longestSideLength=function(){return te.longestSideLength(this.p0,this.p1,this.p2)},te.prototype.isAcute=function(){return te.isAcute(this.p0,this.p1,this.p2)},te.prototype.circumcentre=function(){return te.circumcentre(this.p0,this.p1,this.p2)},te.prototype.area3D=function(){return te.area3D(this.p0,this.p1,this.p2)},te.prototype.centroid=function(){return te.centroid(this.p0,this.p1,this.p2)},te.prototype.inCentre=function(){return te.inCentre(this.p0,this.p1,this.p2)},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.area=function(t,e,i){return Math.abs(((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2)},te.signedArea=function(t,e,i){return((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2},te.det=function(t,e,i,n){return t*n-e*i},te.interpolateZ=function(t,e,i,n){var a=e.x,u=e.y,d=i.x-a,g=n.x-a,_=i.y-u,M=n.y-u,B=d*M-g*_,G=t.x-a,it=t.y-u,nt=(M*G-g*it)/B,at=(-_*G+d*it)/B;return e.z+nt*(i.z-e.z)+at*(n.z-e.z)},te.longestSideLength=function(t,e,i){var n=t.distance(e),a=e.distance(i),u=i.distance(t),d=n;return a>d&&(d=a),u>d&&(d=u),d},te.isAcute=function(t,e,i){return!!Ct.isAcute(t,e,i)&&!!Ct.isAcute(e,i,t)&&!!Ct.isAcute(i,t,e)},te.circumcentre=function(t,e,i){var n=i.x,a=i.y,u=t.x-n,d=t.y-a,g=e.x-n,_=e.y-a,M=2*te.det(u,d,g,_),B=te.det(d,u*u+d*d,_,g*g+_*_),G=te.det(u,u*u+d*d,g,g*g+_*_);return new E(n-B/M,a+G/M)},te.perpendicularBisector=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=new rn(t.x+i/2,t.y+n/2,1),u=new rn(t.x-n+i/2,t.y+i+n/2,1);return new rn(a,u)},te.angleBisector=function(t,e,i){var n=e.distance(t),a=n/(n+e.distance(i)),u=i.x-t.x,d=i.y-t.y;return new E(t.x+a*u,t.y+a*d)},te.area3D=function(t,e,i){var n=e.x-t.x,a=e.y-t.y,u=e.z-t.z,d=i.x-t.x,g=i.y-t.y,_=i.z-t.z,M=a*_-u*g,B=u*d-n*_,G=n*g-a*d,it=M*M+B*B+G*G,nt=Math.sqrt(it)/2;return nt},te.centroid=function(t,e,i){var n=(t.x+e.x+i.x)/3,a=(t.y+e.y+i.y)/3;return new E(n,a)},te.inCentre=function(t,e,i){var n=e.distance(i),a=t.distance(i),u=t.distance(e),d=n+a+u,g=(n*t.x+a*e.x+u*i.x)/d,_=(n*t.y+a*e.y+u*i.y)/d;return new E(g,_)};var In=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new F;var t=arguments[0],e=arguments[1],i=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=i};In.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,L.EXTERIOR,L.INTERIOR)},In.prototype.addPolygon=function(t){var e=this._distance,i=K.LEFT;this._distance<0&&(e=-this._distance,i=K.RIGHT);var n=t.getExteriorRing(),a=H.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance)||this._distance<=0&&a.length<3)return null;this.addPolygonRing(a,e,i,L.EXTERIOR,L.INTERIOR);for(var u=0;u<t.getNumInteriorRing();u++){var d=t.getInteriorRingN(u),g=H.removeRepeatedPoints(d.getCoordinates());this._distance>0&&this.isErodedCompletely(d,-this._distance)||this.addPolygonRing(g,e,K.opposite(i),L.INTERIOR,L.EXTERIOR)}},In.prototype.isTriangleErodedCompletely=function(t,e){var i=new te(t[0],t[1],t[2]),n=i.inCentre();return tt.distancePointLine(n,i.p0,i.p1)<Math.abs(e)},In.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=H.removeRepeatedPoints(t.getCoordinates()),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,L.EXTERIOR,L.INTERIOR)},In.prototype.addCurve=function(t,e,i){if(t===null||t.length<2)return null;var n=new Xe(t,new he(0,L.BOUNDARY,e,i));this._curveList.add(n)},In.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},In.prototype.addPolygonRing=function(t,e,i,n,a){if(e===0&&t.length<Kn.MINI
3MUM_VALID_SIZE)return null;var u=n,d=a;t.length>=Kn.MINIMUM_VALID_SIZE&&tt.isCCW(t)&&(u=a,d=n,i=K.opposite(i));var g=this._curveBuilder.getRingCurve(t,i,e);this.addCurve(g,u,d)},In.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ke?this.addPolygon(t):t instanceof Ae?this.addLineString(t):t instanceof an?this.addPoint(t):t instanceof jo?this.addCollection(t):t instanceof Mn?this.addCollection(t):t instanceof tr?this.addCollection(t):t instanceof Pe&&this.addCollection(t)},In.prototype.isErodedCompletely=function(t,e){var i=t.getCoordinates();if(i.length<4)return e<0;if(i.length===4)return this.isTriangleErodedCompletely(i,e);var n=t.getEnvelopeInternal(),a=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>a},In.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var i=t.getGeometryN(e);this.add(i)}},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In};var Wo=function(){};Wo.prototype.locate=function(t){},Wo.prototype.interfaces_=function(){return[]},Wo.prototype.getClass=function(){return Wo};var nr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};nr.prototype.next=function(){if(this._atStart)return this._atStart=!1,nr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new c;var t=this._parent.getGeometryN(this._index++);return t instanceof Pe?(this._subcollectionIterator=new nr(t),this._subcollectionIterator.next()):t},nr.prototype.remove=function(){throw new Error(this.getClass().getName())},nr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},nr.prototype.interfaces_=function(){return[V]},nr.prototype.getClass=function(){return nr},nr.isAtomic=function(t){return!(t instanceof Pe)};var vn=function(){this._geom=null;var t=arguments[0];this._geom=t};vn.prototype.locate=function(t){return vn.locate(t,this._geom)},vn.prototype.interfaces_=function(){return[Wo]},vn.prototype.getClass=function(){return vn},vn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&tt.isPointInRing(t,e.getCoordinates())},vn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var i=e.getExteriorRing();if(!vn.isPointInRing(t,i))return!1;for(var n=0;n<e.getNumInteriorRing();n++){var a=e.getInteriorRingN(n);if(vn.isPointInRing(t,a))return!1}return!0},vn.containsPoint=function(t,e){if(e instanceof Ke)return vn.containsPointInPolygon(t,e);if(e instanceof Pe)for(var i=new nr(e);i.hasNext();){var n=i.next();if(n!==e&&vn.containsPoint(t,n))return!0}return!1},vn.locate=function(t,e){return e.isEmpty()?L.EXTERIOR:vn.containsPoint(t,e)?L.INTERIOR:L.EXTERIOR};var Ci=function(){this._edgeMap=new O,this._edgeList=null,this._ptInAreaLocation=[L.NONE,L.NONE]};Ci.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),i=e-1;return e===0&&(i=this._edgeList.size()-1),this._edgeList.get(i)},Ci.prototype.propagateSideLabels=function(t){for(var e=L.NONE,i=this.iterator();i.hasNext();){var n=i.next().getLabel();n.isArea(t)&&n.getLocation(t,K.LEFT)!==L.NONE&&(e=n.getLocation(t,K.LEFT))}if(e===L.NONE)return null;for(var a=e,u=this.iterator();u.hasNext();){var d=u.next(),g=d.getLabel();if(g.getLocation(t,K.ON)===L.NONE&&g.setLocation(t,K.ON,a),g.isArea(t)){var _=g.getLocation(t,K.LEFT),M=g.getLocation(t,K.RIGHT);if(M!==L.NONE){if(M!==a)throw new gr("side location conflict",d.getCoordinate());_===L.NONE&&pt.shouldNeverReachHere("found single null side (at "+d.getCoordinate()+")"),a=_}else pt.isTrue(g.getLocation(t,K.LEFT)===L.NONE,"found single null side"),g.setLocation(t,K.RIGHT,a),g.setLocation(t,K.LEFT,a)}}},Ci.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Ci.prototype.print=function(t){si.out.println("EdgeEndStar:   "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Ci.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ci.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var i=e.size()-1,n=e.get(i).getLabel().getLocation(t,K.LEFT);pt.isTrue(n!==L.NONE,"Found unlabelled area edge");for(var a=n,u=this.iterator();u.hasNext();){var d=u.next().getLabel();pt.isTrue(d.isArea(t),"Found non-area edge");var g=d.getLocation(t,K.LEFT),_=d.getLocation(t,K.RIGHT);if(g===_||_!==a)return!1;a=g}return!0},Ci.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Ci.prototype.iterator=function(){return this.getEdges().iterator()},Ci.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new F(this._edgeMap.values())
3),this._edgeList},Ci.prototype.getLocation=function(t,e,i){return this._ptInAreaLocation[t]===L.NONE&&(this._ptInAreaLocation[t]=vn.locate(e,i[t].getGeometry())),this._ptInAreaLocation[t]},Ci.prototype.toString=function(){var t=new oi;t.append("EdgeEndStar:   "+this.getCoordinate()),t.append(`
4`);for(var e=this.iterator();e.hasNext();){var i=e.next();t.append(i),t.append(`
5`)}return t.toString()},Ci.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Ci.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],i=this.iterator();i.hasNext();)for(var n=i.next().getLabel(),a=0;a<2;a++)n.isLine(a)&&n.getLocation(a)===L.BOUNDARY&&(e[a]=!0);for(var u=this.iterator();u.hasNext();)for(var d=u.next(),g=d.getLabel(),_=0;_<2;_++)if(g.isAnyNull(_)){var M=L.NONE;if(e[_])M=L.EXTERIOR;else{var B=d.getCoordinate();M=this.getLocation(_,B,t)}g.setAllLocationsIfNull(_,M)}},Ci.prototype.getDegree=function(){return this._edgeMap.size()},Ci.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var G0=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var i=null,n=null,a=this._SCANNING_FOR_INCOMING,u=0;u<this._resultAreaEdgeList.size();u++){var d=this._resultAreaEdgeList.get(u),g=d.getSym();if(d.getLabel().isArea())switch(i===null&&d.isInResult()&&(i=d),a){case this._SCANNING_FOR_INCOMING:if(!g.isInResult())continue;n=g,a=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!d.isInResult())continue;n.setNext(d),a=this._SCANNING_FOR_INCOMING}}if(a===this._LINKING_TO_OUTGOING){if(i===null)throw new gr("no outgoing dirEdge found",this.getCoordinate());pt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),n.setNext(i)}},e.prototype.insert=function(i){var n=i;this.insertEdgeEnd(n,n)},e.prototype.getRightmostEdge=function(){var i=this.getEdges(),n=i.size();if(n<1)return null;var a=i.get(0);if(n===1)return a;var u=i.get(n-1),d=a.getQuadrant(),g=u.getQuadrant();return pe.isNorthern(d)&&pe.isNorthern(g)?a:pe.isNorthern(d)||pe.isNorthern(g)?a.getDy()!==0?a:u.getDy()!==0?u:(pt.shouldNeverReachHere("found two horizontal edges incident on node"),null):u},e.prototype.print=function(i){si.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var n=this.iterator();n.hasNext();){var a=n.next();i.print("out "),a.print(i),i.println(),i.print("in "),a.getSym().print(i),i.println()}},e.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new F;for(var i=this.iterator();i.hasNext();){var n=i.next();(n.isInResult()||n.getSym().isInResult())&&this._resultAreaEdgeList.add(n)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(i){for(var n=this.iterator();n.hasNext();){var a=n.next().getLabel();a.setAllLocationsIfNull(0,i.getLocation(0)),a.setAllLocationsIfNull(1,i.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var i=null,n=null,a=this._edgeList.size()-1;a>=0;a--){var u=this._edgeList.get(a),d=u.getSym();n===null&&(n=d),i!==null&&d.setNext(i),i=u}n.setNext(i)},e.prototype.computeDepths=function(){if(arguments.length===1){var i=arguments[0],n=this.findIndex(i),a=i.getDepth(K.LEFT),u=i.getDepth(K.RIGHT),d=this.computeDepths(n+1,this._edgeList.size(),a);if(this.computeDepths(0,n,d)!==u)throw new gr("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var g=arguments[0],_=arguments[1],M=arguments[2],B=g;B<_;B++){var G=this._edgeList.get(B);G.setEdgeDepths(K.RIGHT,M),M=G.getDepth(K.LEFT)}return M}},e.prototype.mergeSymLabels=function(){for(var i=this.iterator();i.hasNext();){var n=i.next();n.getLabel().merge(n.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(i){for(var n=null,a=null,u=this._SCANNING_FOR_INCOMING,d=this._resultAreaEdgeList.size()-1;d>=0;d--){var g=this._resultAreaEdgeList.get(d),_=g.getSym();switch(n===null&&g.getEdgeRing()===i&&(n=g),u){case this._SCANNING_FOR_INCOMING:if(_.getEdgeRing()!==i)continue;
5a=_,u=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(g.getEdgeRing()!==i)continue;a.setNextMin(g),u=this._SCANNING_FOR_INCOMING}}u===this._LINKING_TO_OUTGOING&&(pt.isTrue(n!==null,"found null for first outgoing dirEdge"),pt.isTrue(n.getEdgeRing()===i,"unable to link last incoming dirEdge"),a.setNextMin(n))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var i=0,n=this.iterator();n.hasNext();)n.next().isInResult()&&i++;return i}if(arguments.length===1){for(var a=arguments[0],u=0,d=this.iterator();d.hasNext();)d.next().getEdgeRing()===a&&u++;return u}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var i=L.NONE,n=this.iterator();n.hasNext();){var a=n.next(),u=a.getSym();if(!a.isLineEdge()){if(a.isInResult()){i=L.INTERIOR;break}if(u.isInResult()){i=L.EXTERIOR;break}}}if(i===L.NONE)return null;for(var d=i,g=this.iterator();g.hasNext();){var _=g.next(),M=_.getSym();_.isLineEdge()?_.getEdge().setCovered(d===L.INTERIOR):(_.isInResult()&&(d=L.EXTERIOR),M.isInResult()&&(d=L.INTERIOR))}},e.prototype.computeLabelling=function(i){t.prototype.computeLabelling.call(this,i),this._label=new he(L.NONE);for(var n=this.iterator();n.hasNext();)for(var a=n.next().getEdge().getLabel(),u=0;u<2;u++){var d=a.getLocation(u);d!==L.INTERIOR&&d!==L.BOUNDARY||this._label.setLocation(u,L.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ci),Ah=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.createNode=function(i){return new Ga(i,new G0)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($o),Gr=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Gr.prototype.compareTo=function(t){var e=t;return Gr.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Gr.prototype.interfaces_=function(){return[W]},Gr.prototype.getClass=function(){return Gr},Gr.orientation=function(t){return H.increasingDirection(t)===1},Gr.compareOriented=function(t,e,i,n){for(var a=e?1:-1,u=n?1:-1,d=e?t.length:-1,g=n?i.length:-1,_=e?0:t.length-1,M=n?0:i.length-1;;){var B=t[_].compareTo(i[M]);if(B!==0)return B;var G=(_+=a)===d,it=(M+=u)===g;if(G&&!it)return-1;if(!G&&it)return 1;if(G&&it)return 0}};var Tn=function(){this._edges=new F,this._ocaMap=new O};Tn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var i=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var n=i.getCoordinates(),a=0;a<n.length;a++)a>0&&t.print(","),t.print(n[a].x+" "+n[a].y);t.println(")")}t.print(")  ")},Tn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Tn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Tn.prototype.iterator=function(){return this._edges.iterator()},Tn.prototype.getEdges=function(){return this._edges},Tn.prototype.get=function(t){return this._edges.get(t)},Tn.prototype.findEqualEdge=function(t){var e=new Gr(t.getCoordinates());return this._ocaMap.get(e)},Tn.prototype.add=function(t){this._edges.add(t);var e=new Gr(t.getCoordinates());this._ocaMap.put(e,t)},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var io=function(){};io.prototype.processIntersections=function(t,e,i,n){},io.prototype.isDone=function(){},io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io};var _n=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};_n.prototype.isTrivialIntersection=function(t,e,i,n){if(t===i&&this._li.getIntersectionNum()===1){if(_n.isAdjacentSegments(e,n))return!0;
5if(t.isClosed()){var a=t.size()-1;if(e===0&&n===a||n===0&&e===a)return!0}}return!1},_n.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},_n.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},_n.prototype.getLineIntersector=function(){return this._li},_n.prototype.hasProperIntersection=function(){return this._hasProper},_n.prototype.processIntersections=function(t,e,i,n){if(t===i&&e===n)return null;this.numTests++;var a=t.getCoordinates()[e],u=t.getCoordinates()[e+1],d=i.getCoordinates()[n],g=i.getCoordinates()[n+1];this._li.computeIntersection(a,u,d,g),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,i,n)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},_n.prototype.hasIntersection=function(){return this._hasIntersection},_n.prototype.isDone=function(){return!1},_n.prototype.hasInteriorIntersection=function(){return this._hasInterior},_n.prototype.interfaces_=function(){return[io]},_n.prototype.getClass=function(){return _n},_n.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var $n=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],i=arguments[2];this.coord=new E(t),this.segmentIndex=e,this.dist=i};$n.prototype.getSegmentIndex=function(){return this.segmentIndex},$n.prototype.getCoordinate=function(){return this.coord},$n.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},$n.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},$n.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},$n.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},$n.prototype.getDistance=function(){return this.dist},$n.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},$n.prototype.interfaces_=function(){return[W]},$n.prototype.getClass=function(){return $n};var rr=function(){this._nodeMap=new O,this.edge=null;var t=arguments[0];this.edge=t};rr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},rr.prototype.iterator=function(){return this._nodeMap.values().iterator()},rr.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),i=e.next();e.hasNext();){var n=e.next(),a=this.createSplitEdge(i,n);t.add(a),i=n}},rr.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},rr.prototype.createSplitEdge=function(t,e){var i=e.segmentIndex-t.segmentIndex+2,n=this.edge.pts[e.segmentIndex],a=e.dist>0||!e.coord.equals2D(n);a||i--;var u=new Array(i).fill(null),d=0;u[d++]=new E(t.coord);for(var g=t.segmentIndex+1;g<=e.segmentIndex;g++)u[d++]=this.edge.pts[g];return a&&(u[d]=e.coord),new Ua(u,new he(this.edge._label))},rr.prototype.add=function(t,e,i){var n=new $n(t,e,i),a=this._nodeMap.get(n);return a!==null?a:(this._nodeMap.put(n,n),n)},rr.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr};var no=function(){};no.prototype.getChainStartIndices=function(t){var e=0,i=new F;i.add(new Me(e));do{var n=this.findChainEnd(t,e);i.add(new Me(n)),e=n}while(e<t.length-1);return no.toIntArray(i)},no.prototype.findChainEnd=function(t,e){for(var i=pe.quadrant(t[e],t[e+1]),n=e+1;n<t.length&&pe.quadrant(t[n-1],t[n])===i;)n++;return n-1},no.prototype.interfaces_=function(){return[]},no.prototype.getClass=function(){return no},no.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var _r=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ct,this.env2=new ct;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new no;this.startIndex=e.getChainStartIndices(this.pts)};_r.prototype.getCoordinates=function(){return this.pts},_r.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e>i?e:i},_r.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e<i?e:i},_r.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[i],e.startIndex[i+1],n)}else if(arguments.length===6){var a=arguments[0],u=arguments[1],d=arguments[2],g=arguments[3],_=arguments[4],M=arguments[5],B=this.pts[a],G=this.pts[u],it=d.pts[g],nt=d.pts[_];if(u-a==1&&_-g==1)return M.addIntersections(this.e,a,d.e,g),null;if(this.env1.init(B,G),this.env2.init(it,nt),!this.env1.intersects(this.env2))return null;var at=Math.trunc((a+u)/2),ut=Math.trunc((g+_)/2);a<at&&(g<ut&&this.computeIntersectsForChain(a,at,d,g,ut,M),ut<_&&this.computeIntersectsForChain(a,at,d,ut,_,M)),at<u&&(g<ut&&this.computeIntersectsForChain(at,u,d,g,ut,M),ut<_&&this.computeIntersectsForChain(at,u,d,ut,_,M))}},_r.prototype.getStartIndexes=function(){return this.startIndex},_r.prototype.computeIntersects=function(t,e){for(var i=0;i<this.startIndex.length-1;i++)for(var n=0;n<t.startIndex.length-1;n++)this.computeIntersectsForChain(i,t,n,e)},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var gi=function t(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var i=0;i<3;i++)this._depth[e][i]=t.NULL_VALUE},Th={NULL_VALUE:{configurable:!0}};gi.prototype.getDepth=function(t,e){return this._depth[t][e]}
5,gi.prototype.setDepth=function(t,e,i){this._depth[t][e]=i},gi.prototype.isNull=function(){if(arguments.length===0){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==gi.NULL_VALUE)return!1;return!0}if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===gi.NULL_VALUE}if(arguments.length===2){var n=arguments[0],a=arguments[1];return this._depth[n][a]===gi.NULL_VALUE}},gi.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var i=1;i<3;i++){var n=0;this._depth[t][i]>e&&(n=1),this._depth[t][i]=n}}},gi.prototype.getDelta=function(t){return this._depth[t][K.RIGHT]-this._depth[t][K.LEFT]},gi.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?L.EXTERIOR:L.INTERIOR},gi.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},gi.prototype.add=function(){if(arguments.length===1)for(var t=arguments[0],e=0;e<2;e++)for(var i=1;i<3;i++){var n=t.getLocation(e,i);n!==L.EXTERIOR&&n!==L.INTERIOR||(this.isNull(e,i)?this._depth[e][i]=gi.depthAtLocation(n):this._depth[e][i]+=gi.depthAtLocation(n))}else if(arguments.length===3){var a=arguments[0],u=arguments[1];arguments[2]===L.INTERIOR&&this._depth[a][u]++}},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},gi.depthAtLocation=function(t){return t===L.EXTERIOR?0:t===L.INTERIOR?1:gi.NULL_VALUE},Th.NULL_VALUE.get=function(){return-1},Object.defineProperties(gi,Th);var Ua=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new rr(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new gi,this._depthDelta=0,arguments.length===1){var i=arguments[0];e.call(this,i,null)}else if(arguments.length===2){var n=arguments[0],a=arguments[1];this.pts=n,this._label=a}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var i=new Array(2).fill(null);return i[0]=this.pts[0],i[1]=this.pts[1],new e(i,he.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(i){this._isIsolated=i},e.prototype.setName=function(i){this._name=i},e.prototype.equals=function(i){if(!(i instanceof e))return!1;var n=i;if(this.pts.length!==n.pts.length)return!1;for(var a=!0,u=!0,d=this.pts.length,g=0;g<this.pts.length;g++)if(this.pts[g].equals2D(n.pts[g])||(a=!1),this.pts[g].equals2D(n.pts[--d])||(u=!1),!a&&!u)return!1;return!0},e.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var i=arguments[0];return this.pts[i]}},e.prototype.print=function(i){i.print("edge "+this._name+": "),i.print("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&i.print(","),i.print(this.pts[n].x+" "+this.pts[n].y);i.print(")  "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(i){e.updateIM(this._label,i)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(i){i.print("edge "+this._name+": ");for(var n=this.pts.length-1;n>=0;n--)i.print(this.pts[n]+" ");i.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new _r(this)),this._mce},e.prototype.getEnvelope=function(){if(this._env===null){this._env=new ct;for(var i=0;i<this.pts.length;i++)this._env.expandToInclude(this.pts[i])}return this._env},e.prototype.addIntersection=function(i,n,a,u){var d=new E(i.getIntersection(u)),g=n,_=i.getEdgeDistance(a,u),M=g+1;if(M<this.pts.length){var B=this.pts[M];d.equals2D(B)&&(g=M,_=0)}this.eiList.add(d,g,_)},e.prototype.toString=function(){var i=new oi;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&i.append(","),i.append(this.pts[n].x+" "+this.pts[n].y);return i.append(")  "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(i){if(this.pts.length!==i.pts.length)return!1;for(var n=0;n<this.pts.length;n++)if(!this.pts[n].equals2D(i.pts[n]))return!1;return!0},e.prototype.setDepthDelta=function(i){this._depthDelta=i},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(i,n,a){for(var u=0;u<i.getIntersectionNum();u++)this.addIntersection(i,n,a,u)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length!==2)return t.prototype.updateIM.apply(this,arguments);var i=arguments[0],n=arguments[1];n.setAtLeastIfValid(i.getLocation(0,K.ON),i.getLocation(1,K.ON),1),i.isArea()&&(n.setAtLeastIfValid(i.getLocation(0,K.LEFT),i.getLocation(1,K.LEFT),2),n.setAtLeastIfValid(i.getLocation(0,K.RIGHT),i.getLocation(1,K.RIGHT),2))},e}(gn),Ri=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Tn,this._bufParams=t||null};Ri.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},Ri.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var i=e.getLabel(),n=t.getLabel();e.isPointwiseEqual(t)||(n=new he(t.getLabel())).flip(),i.merge(n);var a=Ri.depthDelta(n),u=e.getDepthDelta()+a;e.setDepthDelta(u)}else this._edgeList.add(t),t.setDepthDelta(Ri.depthDelta(t.getLabel()))},Ri.prototype.buildSubgraphs=function(t,e){for(var i=new F,n=t.iterator();n.hasNext();){var a=n.next(),u=a.getRightmostCoordinate(),d=new bo(i).getDepth(u);a.computeDepth(d),a.findResultEdges(),i.add(a),e.add(a.getDirectedEdges(),a.getNodes())}},Ri.prototype.createSubgraphs=function(t){for(var e=new F,i=t.getNodes().iterator();i.hasNext();){var n=i.next();if(!n.isVisited()){var a=new Ni;a.create(n),e.add(a)}}return An.sort(e,An.reverseOrder()),e},Ri.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},Ri.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new dl,i=new Jn;return i.setPrecisionModel(t),e.setSegmentIntersector(new _n(i)),e},Ri.prototype.buffer=function(t,e){var i=this._workingPrecisionModel;i===null&&(i=t.getPrecisionModel()),this._geomFact=t.getFactory();var n=new Vi(i,this._bufParams),a=new In(t,e,n).getCurves();if(a.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(a,i),this._graph=new Ne(new Ah),this._graph.addEdges(this._edgeList.getEdges());var u=this.createSubgraphs(this._graph),d=new cn(this._geomFact);this.buildSubgraphs(u,d);var g=d.getPolygons();return g.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(g)},Ri.prototype.computeNodedEdges=function(t,e){var i=this.getNoder(e);i.computeNodes(t);for(var n=i.getNodedSubstrings().iterator();n.hasNext();){var a=n.next(),u=a.getCoordinates();if(u.length!==2||!u[0].equals2D(u[1])){var d=a.getData(),g=new Ua(a.getCoordinates(),new he(d));this.insertUniqueEdge(g)}}}
5,Ri.prototype.setNoder=function(t){this._workingNoder=t},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.depthDelta=function(t){var e=t.getLocation(0,K.LEFT),i=t.getLocation(0,K.RIGHT);return e===L.INTERIOR&&i===L.EXTERIOR?1:e===L.EXTERIOR&&i===L.INTERIOR?-1:0},Ri.convertSegStrings=function(t){for(var e=new bt,i=new F;t.hasNext();){var n=t.next(),a=e.createLineString(n.getCoordinates());i.add(a)}return e.buildGeometry(i)};var zr=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var i=arguments[0],n=arguments[1],a=arguments[2],u=arguments[3];this._noder=i,this._scaleFactor=n,this._offsetX=a,this._offsetY=u,this._isScaled=!this.isIntegerPrecision()}};zr.prototype.rescale=function(){if(st(arguments[0],D))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var i=arguments[0],n=0;n<i.length;n++)i[n].x=i[n].x/this._scaleFactor+this._offsetX,i[n].y=i[n].y/this._scaleFactor+this._offsetY;i.length===2&&i[0].equals2D(i[1])&&si.out.println(i)}},zr.prototype.scale=function(){if(st(arguments[0],D)){for(var t=arguments[0],e=new F,i=t.iterator();i.hasNext();){var n=i.next();e.add(new Xe(this.scale(n.getCoordinates()),n.getData()))}return e}if(arguments[0]instanceof Array){for(var a=arguments[0],u=new Array(a.length).fill(null),d=0;d<a.length;d++)u[d]=new E(Math.round((a[d].x-this._offsetX)*this._scaleFactor),Math.round((a[d].y-this._offsetY)*this._scaleFactor),a[d].z);return H.removeRepeatedPoints(u)}},zr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},zr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},zr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},zr.prototype.interfaces_=function(){return[to]},zr.prototype.getClass=function(){return zr};var Hn=function(){this._li=new Jn,this._segStrings=null;var t=arguments[0];this._segStrings=t},Dh={fact:{configurable:!0}};Hn.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(arguments.length===2){for(var i=arguments[0],n=arguments[1].iterator();n.hasNext();)for(var a=n.next().getCoordinates(),u=1;u<a.length-1;u++)if(a[u].equals(i))throw new Ln("found endpt/interior pt intersection at index "+u+" :pt "+i)}},Hn.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),i=this._segStrings.iterator();i.hasNext();){var n=i.next();this.checkInteriorIntersections(e,n)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],d=a.getCoordinates(),g=u.getCoordinates(),_=0;_<d.length-1;_++)for(var M=0;M<g.length-1;M++)this.checkInteriorIntersections(a,_,u,M);else if(arguments.length===4){var B=arguments[0],G=arguments[1],it=arguments[2],nt=arguments[3];if(B===it&&G===nt)return null;var at=B.getCoordinates()[G],ut=B.getCoordinates()[G+1],de=it.getCoordinates()[nt],Qe=it.getCoordinates()[nt+1];if(this._li.computeIntersection(at,ut,de,Qe),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,at,ut)||this.hasInteriorIntersection(this._li,de,Qe)))throw new Ln("found non-noded intersection at "+at+"-"+ut+" and "+de+"-"+Qe)}},Hn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Hn.prototype.checkCollapses=function(){if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(arguments.length===1)for(var i=arguments[0].getCoordinates(),n=0;n<i.length-2;n++)this.checkCollapse(i[n],i[n+1],i[n+2])}
5,Hn.prototype.hasInteriorIntersection=function(t,e,i){for(var n=0;n<t.getIntersectionNum();n++){var a=t.getIntersection(n);if(!a.equals(e)&&!a.equals(i))return!0}return!1},Hn.prototype.checkCollapse=function(t,e,i){if(t.equals(i))throw new Ln("found non-noded collapse at "+Hn.fact.createLineString([t,e,i]))},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn},Dh.fact.get=function(){return new bt},Object.defineProperties(Hn,Dh);var Wi=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],i=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=i,e<=0)throw new T("Scale factor must be non-zero");e!==1&&(this._pt=new E(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new E,this._p1Scaled=new E),this.initCorners(this._pt)},Fh={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Wi.prototype.intersectsScaled=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.x,e.x),a=Math.min(t.y,e.y),u=Math.max(t.y,e.y),d=this._maxx<i||this._minx>n||this._maxy<a||this._miny>u;if(d)return!1;var g=this.intersectsToleranceSquare(t,e);return pt.isTrue(!(d&&g),"Found bad envelope test"),g},Wi.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 E(this._maxx,this._maxy),this._corner[1]=new E(this._minx,this._maxy),this._corner[2]=new E(this._minx,this._miny),this._corner[3]=new E(this._maxx,this._miny)},Wi.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Wi.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Wi.prototype.getCoordinate=function(){return this._originalPt},Wi.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Wi.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Wi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ct(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Wi.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())))},Wi.prototype.intersectsToleranceSquare=function(t,e){var i=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||
5(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!i||!n)||!!t.equals(this._pt)||!!e.equals(this._pt))))},Wi.prototype.addSnappedNode=function(t,e){var i=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(i,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},Wi.prototype.interfaces_=function(){return[]},Wi.prototype.getClass=function(){return Wi},Fh.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Wi,Fh);var js=function(){this.tempEnv1=new ct,this.selectedSegment=new lt};js.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},js.prototype.interfaces_=function(){return[]},js.prototype.getClass=function(){return js};var Qo=function(){this._index=null;var t=arguments[0];this._index=t},Bh={HotPixelSnapAction:{configurable:!0}};Qo.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}if(arguments.length===3){var e=arguments[0],i=arguments[1],n=arguments[2],a=e.getSafeEnvelope(),u=new qh(e,i,n);return this._index.query(a,{interfaces_:function(){return[Br]},visitItem:function(d){d.select(a,u)}}),u.isNodeAdded()}},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo},Bh.HotPixelSnapAction.get=function(){return qh},Object.defineProperties(Qo,Bh);var qh=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var i=arguments[0],n=arguments[1],a=arguments[2];this._hotPixel=i,this._parentEdge=n,this._hotPixelVertexIndex=a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length!==2)return t.prototype.select.apply(this,arguments);var i=arguments[0],n=arguments[1],a=i.getContext();if(this._parentEdge!==null&&a===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(a,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(js),Eo=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new F};Eo.prototype.processIntersections=function(t,e,i,n){if(t===i&&e===n)return null;var a=t.getCoordinates()[e],u=t.getCoordinates()[e+1],d=i.getCoordinates()[n],g=i.getCoordinates()[n+1];if(this._li.computeIntersection(a,u,d,g),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var _=0;_<this._li.getIntersectionNum();_++)this._interiorIntersections.add(this._li.getIntersection(_));t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1)}},Eo.prototype.isDone=function(){return!1},Eo.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Eo.prototype.interfaces_=function(){return[io]},Eo.prototype.getClass=function(){return Eo};var or=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Jn,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};or.prototype.checkCorrectness=function(t){var e=Xe.getNodedSubstrings(t),i=new Hn(e);try{i.checkValid()}catch(n){if(!(n instanceof vo))throw n;n.printStackTrace()}},or.prototype.getNodedSubstrings=function(){return Xe.getNodedSubstrings(this._nodedSegStrings)},or.prototype.snapRound=function(t,e){var i=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(i),this.computeVertexSnaps(t)},or.prototype.findInteriorIntersections=function(t,e){var i=new Eo(e);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(t),i.getInteriorIntersections()},or.prototype.computeVertexSnaps=function(){if(st(arguments[0],D))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof Xe)for(var i=arguments[0],n=i.getCoordinates(),a=0;a<n.length;a++){var u=new Wi(n[a],this._scaleFactor,this._li);this._pointSnapper.snap(u,i,a)&&i.addIntersection(n[a],a)}},or.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new dl,this._pointSnapper=new Qo(this._noder.getIndex()),this.snapRound(t,this._li)},or.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next(),n=new Wi(i,this._scaleFactor,this._li);this._pointSnapper.snap(n)}},or.prototype.interfaces_=function(){return[to]},or.prototype.getClass=function(){return or};var yi=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Kt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._argGeom=e,this._bufParams=i}},Jo={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};yi.prototype.bufferFixedPrecision=function(t){var e=new zr(new or(new Zt(1)),t.getScale()),i=new Ri(this._bufParams);i.setWorkingPrecisionModel(t),i.setNoder(e),this._resultGeometry=i.buffer(this._argGeom,this._distance)},yi.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=yi.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(u){if(!(u instanceof gr))throw u;t._saveException=u}if(t._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var i=arguments[0],n=yi.precisionScaleFactor(this._argGeom,this._distance,i),a=new Zt(n);this.bufferFixedPrecision(a)}},yi.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Zt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},yi.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},yi.prototype.bufferOriginalPrecision=function(){try{var t=new Ri(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof Ln))throw e;this._saveException=e}},yi.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},yi.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi},yi.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return new yi(t).getResultGeometry(e)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ht&&typeof arguments[1]=="number"){var i=arguments[0],n=arguments[1],a=arguments[2],u=new yi(i);return u.setQuadrantSegments(a),u.getResultGeometry(n)}
5if(arguments[2]instanceof Kt&&arguments[0]instanceof ht&&typeof arguments[1]=="number"){var d=arguments[0],g=arguments[1],_=arguments[2];return new yi(d,_).getResultGeometry(g)}}else if(arguments.length===4){var M=arguments[0],B=arguments[1],G=arguments[2],it=arguments[3],nt=new yi(M);return nt.setQuadrantSegments(G),nt.setEndCapStyle(it),nt.getResultGeometry(B)}},yi.precisionScaleFactor=function(t,e,i){var n=t.getEnvelopeInternal(),a=we.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),u=i-Math.trunc(Math.log(a)/Math.log(10)+1);return Math.pow(10,u)},Jo.CAP_ROUND.get=function(){return Kt.CAP_ROUND},Jo.CAP_BUTT.get=function(){return Kt.CAP_FLAT},Jo.CAP_FLAT.get=function(){return Kt.CAP_FLAT},Jo.CAP_SQUARE.get=function(){return Kt.CAP_SQUARE},Jo.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(yi,Jo);var Ai=function(){this._pt=[new E,new E],this._distance=P.NaN,this._isNull=!0};Ai.prototype.getCoordinates=function(){return this._pt},Ai.prototype.getCoordinate=function(t){return this._pt[t]},Ai.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n<this._distance&&this.initialize(e,i,n)}},Ai.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=a,this._isNull=!1}},Ai.prototype.getDistance=function(){return this._distance},Ai.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n>this._distance&&this.initialize(e,i,n)}},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var sr=function(){};sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},sr.computeDistance=function(){if(arguments[2]instanceof Ai&&arguments[0]instanceof Ae&&arguments[1]instanceof E)for(var t=arguments[0],e=arguments[1],i=arguments[2],n=t.getCoordinates(),a=new lt,u=0;u<n.length-1;u++){a.setCoordinates(n[u],n[u+1]);var d=a.closestPoint(e);i.setMinimum(d,e)}else if(arguments[2]instanceof Ai&&arguments[0]instanceof Ke&&arguments[1]instanceof E){var g=arguments[0],_=arguments[1],M=arguments[2];sr.computeDistance(g.getExteriorRing(),_,M);for(var B=0;B<g.getNumInteriorRing();B++)sr.computeDistance(g.getInteriorRingN(B),_,M)}else if(arguments[2]instanceof Ai&&arguments[0]instanceof ht&&arguments[1]instanceof E){var G=arguments[0],it=arguments[1],nt=arguments[2];if(G instanceof Ae)sr.computeDistance(G,it,nt);else if(G instanceof Ke)sr.computeDistance(G,it,nt);else if(G instanceof Pe)for(var at=G,ut=0;ut<at.getNumGeometries();ut++){var de=at.getGeometryN(ut);sr.computeDistance(de,it,nt)}else nt.setMinimum(G.getCoordinate(),it)}else if(arguments[2]instanceof Ai&&arguments[0]instanceof lt&&arguments[1]instanceof E){var Qe=arguments[0],Bi=arguments[1],ur=arguments[2],Vr=Qe.closestPoint(Bi);ur.setMinimum(Vr,Bi)}};var ro=function(t){this._maxPtDist=new Ai,this._inputGeom=t||null},fl={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};ro.prototype.computeMaxMidpointDistance=function(t){var e=new Ur(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ro.prototype.computeMaxVertexDistance=function(t){var e=new Co(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ro.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},ro.prototype.getDistancePoints=function(){return this._maxPtDist},ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro},fl.MaxPointDistanceFilter.get=function(){return Co},fl.MaxMidpointDistanceFilter.get=function(){return Ur},Object.defineProperties(ro,fl);var Co=function(t){this._maxPtDist=new Ai,this._minPtDist=new Ai,this._geom=t||null};Co.prototype.filter=function(t){this._minPtDist.initialize(),sr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Co.prototype.getMaxPointDistance=function(){return this._maxPtDist},Co.prototype.interfaces_=function(){return[R]},Co.prototype.getClass=function(){return Co};var Ur=function(t){this._maxPtDist=new Ai,this._minPtDist=new Ai,this._geom=t||null};Ur.prototype.filter=function(t,e){if(e===0)return null;
5var i=t.getCoordinate(e-1),n=t.getCoordinate(e),a=new E((i.x+n.x)/2,(i.y+n.y)/2);this._minPtDist.initialize(),sr.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ur.prototype.isDone=function(){return!1},Ur.prototype.isGeometryChanged=function(){return!1},Ur.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ur.prototype.interfaces_=function(){return[Ge]},Ur.prototype.getClass=function(){return Ur};var xr=function(t){this._comps=t||null};xr.prototype.filter=function(t){t instanceof Ke&&this._comps.add(t)},xr.prototype.interfaces_=function(){return[$e]},xr.prototype.getClass=function(){return xr},xr.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return xr.getPolygons(t,new F)}if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof Ke?i.add(e):e instanceof Pe&&e.apply(new xr(i)),i}};var vi=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._lines=e,this._isForcedToLineString=i}};vi.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Kn){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Ae&&this._lines.add(t)},vi.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},vi.prototype.interfaces_=function(){return[Zn]},vi.prototype.getClass=function(){return vi},vi.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(vi.getLines(t))}if(arguments.length===2){var e=arguments[0],i=arguments[1];return e.getFactory().buildGeometry(vi.getLines(e,i))}},vi.getLines=function(){if(arguments.length===1){var t=arguments[0];return vi.getLines(t,!1)}if(arguments.length===2){if(st(arguments[0],D)&&st(arguments[1],D)){for(var e=arguments[0],i=arguments[1],n=e.iterator();n.hasNext();){var a=n.next();vi.getLines(a,i)}return i}if(arguments[0]instanceof ht&&typeof arguments[1]=="boolean"){var u=arguments[0],d=arguments[1],g=new F;return u.apply(new vi(g,d)),g}if(arguments[0]instanceof ht&&st(arguments[1],D)){var _=arguments[0],M=arguments[1];return _ instanceof Ae?M.add(_):_.apply(new vi(M)),M}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&st(arguments[0],D)&&st(arguments[1],D)){for(var B=arguments[0],G=arguments[1],it=arguments[2],nt=B.iterator();nt.hasNext();){var at=nt.next();vi.getLines(at,G,it)}return G}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof ht&&st(arguments[1],D)){var ut=arguments[0],de=arguments[1],Qe=arguments[2];return ut.apply(new vi(de,Qe)),de}}};var Dn=function(){if(this._boundaryRule=m.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new T("Rule must be non-null");this._boundaryRule=t}}};Dn.prototype.locateInternal=function(){if(arguments[0]instanceof E&&arguments[1]instanceof Ke){var t=arguments[0],e=arguments[1];if(e.isEmpty())return L.EXTERIOR;var i=e.getExteriorRing(),n=this.locateInPolygonRing(t,i);if(n===L.EXTERIOR)return L.EXTERIOR;if(n===L.BOUNDARY)return L.BOUNDARY;for(var a=0;a<e.getNumInteriorRing();a++){var u=e.getInteriorRingN(a),d=this.locateInPolygonRing(t,u);if(d===L.INTERIOR)return L.EXTERIOR;if(d===L.BOUNDARY)return L.BOUNDARY}return L.INTERIOR}if(arguments[0]instanceof E&&arguments[1]instanceof Ae){var g=arguments[0],_=arguments[1];if(!_.getEnvelopeInternal().intersects(g))return L.EXTERIOR;var M=_.getCoordinates();return _.isClosed()||!g.equals(M[0])&&!g.equals(M[M.length-1])?tt.isOnLine(g,M)?L.INTERIOR:L.EXTERIOR:L.BOUNDARY}if(arguments[0]instanceof E&&arguments[1]instanceof an){var B=arguments[0];return arguments[1].getCoordinate().equals2D(B)?L.INTERIOR:L.EXTERIOR}},Dn.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?tt.locatePointInRing(t,e.getCoordinates()):L.EXTERIOR},Dn.prototype.intersects=function(t,e){return this.locate(t,e)!==L.EXTERIOR},Dn.prototype.updateLocationInfo=function(t){t===L.INTERIOR&&(this._isIn=!0),t===L.BOUNDARY&&this._numBoundaries++},Dn.prototype.computeLocation=function(t,e){if(e instanceof an&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Ae)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ke)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Mn)for(var i=e,n=0;n<i.getNumGeometries();n++){var a=i.getGeometryN(n);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof tr)for(var u=e,d=0;d<u.getNumGeometries();d++){var g=u.getGeometryN(d);this.updateLocationInfo(this.locateInternal(t,g))}else if(e instanceof Pe)for(var _=new nr(e);_.hasNext();){var M=_.next();M!==e&&this.computeLocation(t,M)}},Dn.prototype.locate=function(t,e){return e.isEmpty()?L.EXTERIOR:e instanceof Ae?this.locateInternal(t,e):e instanceof Ke?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?L.BOUNDARY:this._numBoundaries>0||this._isIn?L.INTERIOR:L.EXTERIOR)},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn};var Ti=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],i=arguments[1];t.call(this,e,t.INSIDE_AREA,i)}else if(arguments.length===3){var n=arguments[0],a=arguments[1],u=arguments[2];this._component=n,this._segIndex=a,this._pt=u}},Gh={INSIDE_AREA:{configurable:!0}};Ti.prototype.isInsideArea=function(){return this._segIndex===Ti.INSIDE_AREA},Ti.prototype.getCoordinate=function(){return this._pt},Ti.prototype.getGeometryComponent=function(){return this._component},Ti.prototype.getSegmentIndex=function(){return this._segIndex},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Gh.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ti,Gh);var Xr=function(t){this._pts=t||null};Xr.prototype.filter=function(t){t instanceof an&&this._pts.add(t)},Xr.prototype.interfaces_=function(){return[$e]},Xr.prototype.getClass=function(){return Xr},Xr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof an?An.singletonList(t):Xr.getPoints(t,new F)}if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof an?i.add(e):e instanceof Pe&&e.apply(new Xr(i)),i}};var Mo=function(){this._locations=null;var t=arguments[0];this._locations=t};Mo.prototype.filter=function(t){(t instanceof an||t instanceof Ae||t instanceof Ke)&&this._locations.add(new Ti(t,0,t.getCoordinate()))},Mo.prototype.interfaces_=function(){return[$e]},Mo.prototype.getClass=function(){return Mo},Mo.getLocations=function(t){var e=new F;return t.apply(new Mo(e)),e};var _i=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Dn,this._minDistanceLocation=null,this._minDistance=P.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=n,this._terminateDistance=a}};_i.prototype.computeContainmentDistance=function(){if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],n=1-e,a=xr.getPolygons(this._geom[e]);if(a.size()>0){var u=Mo.getLocations(this._geom[n]);if(this.computeContainmentDistance(u,a,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=i[0],this._minDistanceLocation[e]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&st(arguments[0],j)&&st(arguments[1],j)){for(var d=arguments[0],g=arguments[1],_=arguments[2],M=0;M<d.size();M++)for(var B=d.get(M),G=0;G<g.size();G++)if(this.computeContainmentDistance(B,g.get(G),_),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ti&&arguments[1]instanceof Ke){var it=arguments[0],nt=arguments[1],at=arguments[2],ut=it.getCoordinate();if(L.EXTERIOR!==this._ptLocator.locate(ut,nt))return this._minDistance=0,at[0]=it,at[1]=new Ti(nt,ut),null}}}
5,_i.prototype.computeMinDistanceLinesPoints=function(t,e,i){for(var n=0;n<t.size();n++)for(var a=t.get(n),u=0;u<e.size();u++){var d=e.get(u);if(this.computeMinDistance(a,d,i),this._minDistance<=this._terminateDistance)return null}},_i.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=vi.getLines(this._geom[0]),i=vi.getLines(this._geom[1]),n=Xr.getPoints(this._geom[0]),a=Xr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,a,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(i,n,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(n,a,t),void this.updateMinDistance(t,!1))))},_i.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},_i.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},_i.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},_i.prototype.computeMinDistance=function(){if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Ae&&arguments[1]instanceof an){var t=arguments[0],e=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var n=t.getCoordinates(),a=e.getCoordinate(),u=0;u<n.length-1;u++){var d=tt.distancePointLine(a,n[u],n[u+1]);if(d<this._minDistance){this._minDistance=d;var g=new lt(n[u],n[u+1]).closestPoint(a);i[0]=new Ti(t,u,g),i[1]=new Ti(e,0,a)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ae&&arguments[1]instanceof Ae){var _=arguments[0],M=arguments[1],B=arguments[2];if(_.getEnvelopeInternal().distance(M.getEnvelopeInternal())>this._minDistance)return null;for(var G=_.getCoordinates(),it=M.getCoordinates(),nt=0;nt<G.length-1;nt++)for(var at=0;at<it.length-1;at++){var ut=tt.distanceLineLine(G[nt],G[nt+1],it[at],it[at+1]);if(ut<this._minDistance){this._minDistance=ut;var de=new lt(G[nt],G[nt+1]),Qe=new lt(it[at],it[at+1]),Bi=de.closestPoints(Qe);B[0]=new Ti(_,nt,Bi[0]),B[1]=new Ti(M,at,Bi[1])}if(this._minDistance<=this._terminateDistance)return null}}}},_i.prototype.computeMinDistancePoints=function(t,e,i){for(var n=0;n<t.size();n++)for(var a=t.get(n),u=0;u<e.size();u++){var d=e.get(u),g=a.getCoordinate().distance(d.getCoordinate());if(g<this._minDistance&&(this._minDistance=g,i[0]=new Ti(a,0,a.getCoordinate()),i[1]=new Ti(d,0,d.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},_i.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new T("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},_i.prototype.computeMinDistanceLines=function(t,e,i){for(var n=0;n<t.size();n++)for(var a=t.get(n),u=0;u<e.size();u++){var d=e.get(u);if(this.computeMinDistance(a,d,i),this._minDistance<=this._terminateDistance)return null}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i},_i.distance=function(t,e){return new _i(t,e).distance()},_i.isWithinDistance=function(t,e,i){return new _i(t,e,i).distance()<=i},_i.nearestPoints=function(t,e){return new _i(t,e).nearestPoints()};var Mi=function(){this._pt=[new E,new E],this._distance=P.NaN,this._isNull=!0};Mi.prototype.getCoordinates=function(){return this._pt},Mi.prototype.getCoordinate=function(t){return this._pt[t]},Mi.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n<this._distance&&this.initialize(e,i,n)}},Mi.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=a,this._isNull=!1}},Mi.prototype.toString=function(){return mn.toLineString(this._pt[0],this._pt[1])},Mi.prototype.getDistance=function(){return this._distance},Mi.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n>this._distance&&this.initialize(e,i,n)}},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var Vn=function(){};Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Vn.computeDistance=function(){if(arguments[2]instanceof Mi&&arguments[0]instanceof Ae&&arguments[1]instanceof E)for(var t=arguments[0],e=arguments[1],i=arguments[2],n=new lt,a=t.getCoordinates(),u=0;u<a.length-1;
5u++){n.setCoordinates(a[u],a[u+1]);var d=n.closestPoint(e);i.setMinimum(d,e)}else if(arguments[2]instanceof Mi&&arguments[0]instanceof Ke&&arguments[1]instanceof E){var g=arguments[0],_=arguments[1],M=arguments[2];Vn.computeDistance(g.getExteriorRing(),_,M);for(var B=0;B<g.getNumInteriorRing();B++)Vn.computeDistance(g.getInteriorRingN(B),_,M)}else if(arguments[2]instanceof Mi&&arguments[0]instanceof ht&&arguments[1]instanceof E){var G=arguments[0],it=arguments[1],nt=arguments[2];if(G instanceof Ae)Vn.computeDistance(G,it,nt);else if(G instanceof Ke)Vn.computeDistance(G,it,nt);else if(G instanceof Pe)for(var at=G,ut=0;ut<at.getNumGeometries();ut++){var de=at.getGeometryN(ut);Vn.computeDistance(de,it,nt)}else nt.setMinimum(G.getCoordinate(),it)}else if(arguments[2]instanceof Mi&&arguments[0]instanceof lt&&arguments[1]instanceof E){var Qe=arguments[0],Bi=arguments[1],ur=arguments[2],Vr=Qe.closestPoint(Bi);ur.setMinimum(Vr,Bi)}};var Sn=function(){this._g0=null,this._g1=null,this._ptDist=new Mi,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},pl={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Sn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Sn.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new T("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Sn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Sn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Sn.prototype.computeOrientedDistance=function(t,e,i){var n=new Po(e);if(t.apply(n),i.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var a=new Yr(e,this._densifyFrac);t.apply(a),i.setMaximum(a.getMaxPointDistance())}},Sn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];return new Sn(t,e).distance()}if(arguments.length===3){var i=arguments[0],n=arguments[1],a=arguments[2],u=new Sn(i,n);return u.setDensifyFraction(a),u.distance()}},pl.MaxPointDistanceFilter.get=function(){return Po},pl.MaxDensifiedByFractionDistanceFilter.get=function(){return Yr},Object.defineProperties(Sn,pl);var Po=function(){this._maxPtDist=new Mi,this._minPtDist=new Mi,this._euclideanDist=new Vn,this._geom=null;var t=arguments[0];this._geom=t};Po.prototype.filter=function(t){this._minPtDist.initialize(),Vn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Po.prototype.getMaxPointDistance=function(){return this._maxPtDist},Po.prototype.interfaces_=function(){return[R]},Po.prototype.getClass=function(){return Po};var Yr=function(){this._maxPtDist=new Mi,this._minPtDist=new Mi,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Yr.prototype.filter=function(t,e){if(e===0)return null;for(var i=t.getCoordinate(e-1),n=t.getCoordinate(e),a=(n.x-i.x)/this._numSubSegs,u=(n.y-i.y)/this._numSubSegs,d=0;d<this._numSubSegs;d++){var g=i.x+d*a,_=i.y+d*u,M=new E(g,_);this._minPtDist.initialize(),Vn.computeDistance(this._geom,M,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Yr.prototype.isDone=function(){return!1},Yr.prototype.isGeometryChanged=function(){return!1},Yr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Yr.prototype.interfaces_=function(){return[Ge]},Yr.prototype.getClass=function(){return Yr};var un=function(t,e,i){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=i||null},ml={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};
5un.prototype.checkMaximumDistance=function(t,e,i){var n=new Sn(e,t);if(n.setDensifyFraction(.25),this._maxDistanceFound=n.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var a=n.getCoordinates();this._errorLocation=a[1],this._errorIndicator=t.getFactory().createLineString(a),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+mn.toLineString(a[0],a[1])+")"}},un.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=un.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),un.VERBOSE&&si.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},un.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ke||this._input instanceof tr||this._input instanceof Pe))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},un.prototype.getErrorIndicator=function(){return this._errorIndicator},un.prototype.checkMinimumDistance=function(t,e,i){var n=new _i(t,e,i);if(this._minDistanceFound=n.distance(),this._minDistanceFound<i){this._isValid=!1;var a=n.nearestPoints();this._errorLocation=n.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(a),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+mn.toLineString(a[0],a[1])+" )"}},un.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},un.prototype.getErrorLocation=function(){return this._errorLocation},un.prototype.getPolygonLines=function(t){for(var e=new F,i=new vi(e),n=xr.getPolygons(t).iterator();n.hasNext();)n.next().apply(i);return t.getFactory().buildGeometry(e)},un.prototype.getErrorMessage=function(){return this._errMsg},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},ml.VERBOSE.get=function(){return!1},ml.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(un,ml);var xi=function(t,e,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=i||null},gl={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};xi.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},xi.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*xi.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new ct(this._input.getEnvelopeInternal());e.expandBy(this._distance);var i=new ct(this._result.getEnvelopeInternal());i.expandBy(t),i.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},xi.prototype.checkDistance=function(){var t=new un(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},xi.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},xi.prototype.checkPolygonal=function(){this._result instanceof Ke||this._result instanceof tr||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},xi.prototype.getErrorIndicator=function(){return this._errorIndicator},xi.prototype.getErrorLocation=function(){return this._errorLocation},xi.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},xi.prototype.report=function(t){if(!xi.VERBOSE)return null;si.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},xi.prototype.getErrorMessage=function(){return this._errorMsg},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi}
5,xi.isValidMsg=function(t,e,i){var n=new xi(t,e,i);return n.isValid()?null:n.getErrorMessage()},xi.isValid=function(t,e,i){return!!new xi(t,e,i).isValid()},gl.VERBOSE.get=function(){return!1},gl.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(xi,gl);var Wn=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Wn.prototype.getCoordinates=function(){return this._pts},Wn.prototype.size=function(){return this._pts.length},Wn.prototype.getCoordinate=function(t){return this._pts[t]},Wn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Wn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:xo.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Wn.prototype.setData=function(t){this._data=t},Wn.prototype.getData=function(){return this._data},Wn.prototype.toString=function(){return mn.toLineString(new Ue(this._pts))},Wn.prototype.interfaces_=function(){return[ir]},Wn.prototype.getClass=function(){return Wn};var hi=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new F,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};hi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},hi.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},hi.prototype.getIntersectionSegments=function(){return this._intSegments},hi.prototype.count=function(){return this._intersectionCount},hi.prototype.getIntersections=function(){return this._intersections},hi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},hi.prototype.setKeepIntersections=function(t){this._keepIntersections=t},hi.prototype.processIntersections=function(t,e,i,n){if(!this._findAllIntersections&&this.hasIntersection()||t===i&&e===n||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(t,e)||this.isEndSegment(i,n)))return null;var a=t.getCoordinates()[e],u=t.getCoordinates()[e+1],d=i.getCoordinates()[n],g=i.getCoordinates()[n+1];this._li.computeIntersection(a,u,d,g),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=a,this._intSegments[1]=u,this._intSegments[2]=d,this._intSegments[3]=g,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},hi.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},hi.prototype.hasIntersection=function(){return this._interiorIntersection!==null},hi.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},hi.prototype.interfaces_=function(){return[io]},hi.prototype.getClass=function(){return hi},hi.createAllIntersectionsFinder=function(t){var e=new hi(t);return e.setFindAllIntersections(!0),e},hi.createAnyIntersectionFinder=function(t){return new hi(t)},hi.createIntersectionCounter=function(t){var e=new hi(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Fn=function(){this._li=new Jn,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Fn.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Fn.prototype.getIntersections=function(){return this._segInt.getIntersections()},Fn.prototype.isValid=function(){return this.execute(),this._isValid},Fn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Fn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new hi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new dl;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Fn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new gr(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Fn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections foun
5d";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+mn.toLineString(t[0],t[1])+" and "+mn.toLineString(t[2],t[3])},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.computeIntersections=function(t){var e=new Fn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var oo=function t(){this._nv=null;var e=arguments[0];this._nv=new Fn(t.toSegmentStrings(e))};oo.prototype.checkValid=function(){this._nv.checkValid()},oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.toSegmentStrings=function(t){for(var e=new F,i=t.iterator();i.hasNext();){var n=i.next();e.add(new Wn(n.getCoordinates(),n))}return e},oo.checkValid=function(t){new oo(t).checkValid()};var Io=function(t){this._mapOp=t};Io.prototype.map=function(t){for(var e=new F,i=0;i<t.getNumGeometries();i++){var n=this._mapOp.map(t.getGeometryN(i));n.isEmpty()||e.add(n)}return t.getFactory().createGeometryCollection(bt.toGeometryArray(e))},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io},Io.map=function(t,e){return new Io(e).map(t)};var Qn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new F,this._resultLineList=new F;var t=arguments[0],e=arguments[1],i=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=i};Qn.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var i=e.next();this.collectLineEdge(i,t,this._lineEdgesList),this.collectBoundaryTouchEdge(i,t,this._lineEdgesList)}},Qn.prototype.labelIsolatedLine=function(t,e){var i=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,i)},Qn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Qn.prototype.collectLineEdge=function(t,e,i){var n=t.getLabel(),a=t.getEdge();t.isLineEdge()&&(t.isVisited()||!mt.isResultOfOp(n,e)||a.isCovered()||(i.add(a),t.setVisitedEdge(!0)))},Qn.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var i=e.next(),n=i.getEdge();if(i.isLineEdge()&&!n.isCoveredSet()){var a=this._op.isCoveredByA(i.getCoordinate());n.setCovered(a)}}},Qn.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next(),n=i.getLabel();i.isIsolated()&&(n.isNull(0)?this.labelIsolatedLine(i,0):this.labelIsolatedLine(i,1))}},Qn.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var i=e.next(),n=this._geometryFactory.createLineString(i.getCoordinates());this._resultLineList.add(n),i.setInResult(!0)}},Qn.prototype.collectBoundaryTouchEdge=function(t,e,i){var n=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(pt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(mt.isResultOfOp(n,e)&&e===mt.INTERSECTION&&(i.add(t.getEdge()),t.setVisitedEdge(!0))))},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var So=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new F;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};So.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var i=this._geometryFactory.createPoint(e);this._resultPointList.add(i)}},So.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var i=e.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===mt.INTERSECTION)){var n=i.getLabel();mt.isResultOfOp(n,t)&&this.filterCoveredNodeToPoint(i)}}},So.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},So.prototype.interfaces_=function(){return[]},So.prototype.getClass=function(){return So};var Qi=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Qi.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Qi.prototype.transformPolygon=function(t,e){var i=!0,n=this.transformLinearRing(t.getExteriorRing(),t);n!==null&&n instanceof Kn&&!n.isEmpty()||(i=!1);for(var a=new F,u=0;u<t.getNumInteriorRing();u++){var d=this.transformLinearRing(t.getInteriorRingN(u),t);d===null||d.isEmpty()||(d instanceof Kn||(i=!1),a.add(d))}if(i)return this._factory.createPolygon(n,a.toArray([]));var g=new F;return n!==null&&g.add(n),g.addAll(a),this._factory.buildGeometry(g)},Qi.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Qi.prototype.getInputGeometry=function(){return this._inputGeom},Qi.prototype.transformMultiLineString=function(t,e){for(var i=new F,n=0;n<t.getNumGeometries();n++){var a=this.transformLineString(t.getGeometryN(n),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)},Qi.prototype.transformCoordinates=function(t,e){return this.copy(t)},Qi.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Qi.prototype.transformMultiPoint=function(t,e){for(var i=new F,n=0;n<t.getNumGeometries();n++){var a=this.transformPoint(t.getGeometryN(n),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)},Qi.prototype.transformMultiPolygon=function(t,e){for(var i=new F,n=0;n<t.getNumGeometries();n++){var a=this.transformPolygon(t.getGeometryN(n),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)},Qi.prototype.copy=function(t){return t.copy()},Qi.prototype.transformGeometryCollection=function(t,e){for(var i=new F,n=0;n<t.getNumGeometries();n++){var a=this.transform(t.getGeometryN(n));a!==null&&(this._pruneEmptyGeometry&&a.isEmpty()||i.add(a))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(bt.toGeometryArray(i)):this._factory.buildGeometry(i)},Qi.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof an)return this.transformPoint(t,null);if(t instanceof jo)return this.transformMultiPoint(t,null);if(t instanceof Kn)return this.transformLinearRing(t,null);if(t instanceof Ae)return this.transformLineString(t,null);if(t instanceof Mn)return this.transformMultiLineString(t,null);if(t instanceof Ke)return this.transformPolygon(t,null);if(t instanceof tr)return this.transformMultiPolygon(t,null);if(t instanceof Pe)return this.transformGeometryCollection(t,null);throw new T("Unknown Geometry subtype: "+t.getClass().getName())},Qi.prototype.transformLinearRing=function(t,e){var i=this.transformCoordinates(t.getCoordinateSequence(),t);if(i===null)return this._factory.createLinearRing(null);var n=i.size();return n>0&&n<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi};var ar=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new lt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ae&&typeof arguments[1]=="number"){var e=arguments[0],i=arguments[1];t.call(this,e.getCoordinates(),i)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],a=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=a}};ar.prototype.snapVertices=function(t,e){for(var i=this._isClosed?t.size()-1:t.size(),n=0;n<i;n++){var a=t.get(n),u=this.findSnapForVertex(a,e);u!==null&&(t.set(n,new E(u)),n===0&&this._isClosed&&t.set(t.size()-1,new E(u)))}},ar.prototype.findSnapForVertex=function(t,e){for(var i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<this._snapTolerance)return e[i]}return null},ar.prototype.snapTo=function(t){var e=new Q(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},ar.prototype.snapSegments=function(t,e){if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var n=0;n<i;n++){var a=e[n],u=this.findSegmentIndexToSnap(a,t);u>=0&&t.add(u+1,new E(a),!1)}},ar.prototype.findSegmentIndexToSnap=function(t,e){for(var i=P.MAX_VALUE,n=-1,a=0;a<e.size()-1;a++){if(this._seg.p0=e.get(a),this._seg.p1=e.get(a+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var u=this._seg.distance(t);u<this._snapTolerance&&u<i&&(i=u,n=a)}return n},ar.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ar.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Ye=function(t){this._srcGeom=t||null},zh={SNAP_PRECISION_FACTOR:{configurable:!0}};Ye.prototype.snapTo=function(t,e){var i=this.extractTargetCoordinates(t);return new Uh(e,i).transform(this._srcGeom)},Ye.prototype.snapToSelf=function(t,e){var i=this.extractTargetCoordinates(this._srcGeom),n=new Uh(t,i,!0).transform(this._srcGeom),a=n;return e&&st(a,Fr)&&(a=n.buffer(0)),a},Ye.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Ye.prototype.extractTargetCoordinates=function(t){for(var e=new z,i=t.getCoordinates(),n=0;n<i.length;n++)e.add(i[n]);return e.toArray(new Array(0).fill(null))},Ye.prototype.computeMinimumSegmentLength=function(t){for(var e=P.MAX_VALUE,i=0;i<t.length-1;i++){var n=t[i].distance(t[i+1]);n<e&&(e=n)}return e},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye}
5,Ye.snap=function(t,e,i){var n=new Array(2).fill(null),a=new Ye(t);n[0]=a.snapTo(e,i);var u=new Ye(e);return n[1]=u.snapTo(n[0],i),n},Ye.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Ye.computeSizeBasedSnapTolerance(t),i=t.getPrecisionModel();if(i.getType()===Zt.FIXED){var n=1/i.getScale()*2/1.415;n>e&&(e=n)}return e}if(arguments.length===2){var a=arguments[0],u=arguments[1];return Math.min(Ye.computeOverlaySnapTolerance(a),Ye.computeOverlaySnapTolerance(u))}},Ye.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Ye.SNAP_PRECISION_FACTOR},Ye.snapToSelf=function(t,e,i){return new Ye(t).snapToSelf(e,i)},zh.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Ye,zh);var Uh=function(t){function e(i,n,a){t.call(this),this._snapTolerance=i||null,this._snapPts=n||null,this._isSelfSnap=a!==void 0&&a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(i,n){var a=new ar(i,this._snapTolerance);return a.setAllowSnappingToSourceVertices(this._isSelfSnap),a.snapTo(n)},e.prototype.transformCoordinates=function(i,n){var a=i.toCoordinateArray(),u=this.snapLine(a,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(u)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qi),Di=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Di.prototype.getCommon=function(){return P.longBitsToDouble(this._commonBits)},Di.prototype.add=function(t){var e=P.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=Di.signExpBits(this._commonBits),this._isFirst=!1,null;if(Di.signExpBits(e)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Di.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=Di.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Di.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=P.longBitsToDouble(t),i="0000000000000000000000000000000000000000000000000000000000000000"+P.toBinaryString(t),n=i.substring(i.length-64);return n.substring(0,1)+"  "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.getBit=function(t,e){return t&1<<e?1:0},Di.signExpBits=function(t){return t>>52},Di.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Di.numCommonMostSigMantissaBits=function(t,e){for(var i=0,n=52;n>=0;n--){if(Di.getBit(t,n)!==Di.getBit(e,n))return i;i++}return 52};var jr=function(){this._commonCoord=null,this._ccFilter=new Oo},yl={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};jr.prototype.addCommonBits=function(t){var e=new $r(this._commonCoord);t.apply(e),t.geometryChanged()},jr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new E(this._commonCoord);e.x=-e.x,e.y=-e.y;var i=new $r(e);return t.apply(i),t.geometryChanged(),t},jr.prototype.getCommonCoordinate=function(){return this._commonCoord},jr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},yl.CommonCoordinateFilter.get=function(){return Oo},yl.Translater.get=function(){return $r},Object.defineProperties(jr,yl);var Oo=function(){this._commonBitsX=new Di,this._commonBitsY=new Di};Oo.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Oo.prototype.getCommonCoordinate=function(){return new E(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Oo.prototype.interfaces_=function(){return[R]},Oo.prototype.getClass=function(){return Oo};var $r=function(){this.trans=null;var t=arguments[0];this.trans=t};$r.prototype.filter=function(t,e){var i=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,i),t.setOrdinate(e,1,n)},$r.prototype.isDone=function(){return!1},$r.prototype.isGeometryChanged=function(){return!0},$r.prototype.interfaces_=function(){return[Ge]},$r.prototype.getClass=function(){return $r};var di=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};di.prototype.selfSnap=function(t){return new Ye(t).snapTo(t,this._snapTolerance)},di.prototype.removeCommonBits=function(t){this._cbr=new jr,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},di.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},di.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),i=mt.overlayOp(e[0],e[1],t);return this.prepareResult(i)},di.prototype.checkValid=function(t){t.isValid()||si.out.println("Snapped geometry is invali
5d")},di.prototype.computeSnapTolerance=function(){this._snapTolerance=Ye.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},di.prototype.snap=function(t){var e=this.removeCommonBits(t);return Ye.snap(e[0],e[1],this._snapTolerance)},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.overlayOp=function(t,e,i){return new di(t,e).getResultGeometry(i)},di.union=function(t,e){return di.overlayOp(t,e,mt.UNION)},di.intersection=function(t,e){return di.overlayOp(t,e,mt.INTERSECTION)},di.symDifference=function(t,e){return di.overlayOp(t,e,mt.SYMDIFFERENCE)},di.difference=function(t,e){return di.overlayOp(t,e,mt.DIFFERENCE)};var Fi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Fi.prototype.getResultGeometry=function(t){var e=null,i=!1,n=null;try{e=mt.overlayOp(this._geom[0],this._geom[1],t),i=!0}catch(a){if(!(a instanceof Ln))throw a;n=a}if(!i)try{e=di.overlayOp(this._geom[0],this._geom[1],t)}catch(a){throw a instanceof Ln?n:a}return e},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},Fi.overlayOp=function(t,e,i){return new Fi(t,e).getResultGeometry(i)},Fi.union=function(t,e){return Fi.overlayOp(t,e,mt.UNION)},Fi.intersection=function(t,e){return Fi.overlayOp(t,e,mt.INTERSECTION)},Fi.symDifference=function(t,e){return Fi.overlayOp(t,e,mt.SYMDIFFERENCE)},Fi.difference=function(t,e){return Fi.overlayOp(t,e,mt.DIFFERENCE)};var $s=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};$s.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},$s.prototype.interfaces_=function(){return[]},$s.prototype.getClass=function(){return $s};var hn=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],i=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=i}else if(arguments.length===3){var n=arguments[0],a=arguments[1],u=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=a,this._obj=u}},vl={INSERT:{configurable:!0},DELETE:{configurable:!0}};hn.prototype.isDelete=function(){return this._eventType===hn.DELETE},hn.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},hn.prototype.getObject=function(){return this._obj},hn.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},hn.prototype.getInsertEvent=function(){return this._insertEvent},hn.prototype.isInsert=function(){return this._eventType===hn.INSERT},hn.prototype.isSameLabel=function(t){return this._label!==null&&this._label===t._label},hn.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},hn.prototype.interfaces_=function(){return[W]},hn.prototype.getClass=function(){return hn},vl.INSERT.get=function(){return 1},vl.DELETE.get=function(){return 2},Object.defineProperties(hn,vl);var Xa=function(){};Xa.prototype.interfaces_=function(){return[]},Xa.prototype.getClass=function(){return Xa};var wi=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=i};wi.prototype.isTrivialIntersection=function(t,e,i,n){if(t===i&&this._li.getIntersectionNum()===1){if(wi.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var a=t.getNumPoints()-1;if(e===0&&n===a||n===0&&e===a)return!0}}return!1},wi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},wi.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},wi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},wi.prototype.isBoundaryPointInternal=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},wi.prototype.hasProperIntersection=function(){return this._hasProper},wi.prototype.hasIntersection=function(){return this._hasIntersection},wi.prototype.isDone=function(){return this._isDone},wi.prototype.isBoundaryPoint=function(t,e){return e!==null&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1])
5)},wi.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},wi.prototype.addIntersections=function(t,e,i,n){if(t===i&&e===n)return null;this.numTests++;var a=t.getCoordinates()[e],u=t.getCoordinates()[e+1],d=i.getCoordinates()[n],g=i.getCoordinates()[n+1];this._li.computeIntersection(a,u,d,g),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,i,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,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))))},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi},wi.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var z0=function(t){function e(){t.call(this),this.events=new F,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){An.sort(this.events);for(var i=0;i<this.events.size();i++){var n=this.events.get(i);n.isDelete()&&n.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var n=0;n<this.events.size();n++){var a=this.events.get(n);if(a.isInsert()&&this.processOverlaps(n,a.getDeleteEventIndex(),a,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof wi&&st(arguments[0],j)&&st(arguments[1],j)){var u=arguments[0],d=arguments[1],g=arguments[2];this.addEdges(u,u),this.addEdges(d,d),this.computeIntersections(g)}else if(typeof arguments[2]=="boolean"&&st(arguments[0],j)&&arguments[1]instanceof wi){var _=arguments[0],M=arguments[1];arguments[2]?this.addEdges(_,null):this.addEdges(_),this.computeIntersections(M)}}},e.prototype.addEdge=function(i,n){for(var a=i.getMonotoneChainEdge(),u=a.getStartIndexes(),d=0;d<u.length-1;d++){var g=new $s(a,d),_=new hn(n,a.getMinX(d),g);this.events.add(_),this.events.add(new hn(a.getMaxX(d),_))}},e.prototype.processOverlaps=function(i,n,a,u){for(var d=a.getObject(),g=i;g<n;g++){var _=this.events.get(g);if(_.isInsert()){var M=_.getObject();a.isSameLabel(_)||(d.computeIntersections(M,u),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(arguments.length===1)for(var i=arguments[0].iterator();i.hasNext();){var n=i.next();this.addEdge(n,n)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],d=a.iterator();d.hasNext();){var g=d.next();this.addEdge(g,u)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xa),cr=function(){this._min=P.POSITIVE_INFINITY,this._max=P.NEGATIVE_INFINITY},Xh={NodeComparator:{configurable:!0}};cr.prototype.getMin=function(){return this._min},cr.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},cr.prototype.getMax=function(){return this._max},cr.prototype.toString=function(){return mn.toLineString(new E(this._min,0),new E(this._max,0))},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},Xh.NodeComparator.get=function(){return Hs},Object.defineProperties(cr,Xh);var Hs=function(){};Hs.prototype.compare=function(t,e){var i=t,n=e,a=(i._min+i._max)/2,u=(n._min+n._max)/2;return a<u?-1:a>u?1:0},Hs.prototype.interfaces_=function(){return[et]},Hs.prototype.getClass=function(){return Hs};var U0=function(t){function e(){t.call(this),this._item=null;var i=arguments[0],n=arguments[1],a=arguments[2];this._min=i,this._max=n,this._item=a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(i,n,a){if(!this.intersects(i,n))return null;a.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),X0=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var i=arguments[0],n=arguments[1];this._node1=i,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(i,n){this._min=Math.min(i._min,n._min),this._max=Math.max(i._max,n._max)},e.prototype.query=function(i,n,a){if(!this.intersects(i,n))return null;this._node1!==null&&this._node1.query(i,n,a),this._node2!==null&&this._node2.query(i,n,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),lr=function(){this._leaves=new F,this._root=null,this._level=0};lr.prototype.buildTree=function(){An.sort(this._leaves,new cr.NodeComparator);for(var t=this._leaves,e=null,i=new F;;){if(this.buildLevel(t,i),i.size()===1)return i.get(0);e=t,t=i,i=e}}
5,lr.prototype.insert=function(t,e,i){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new U0(t,e,i))},lr.prototype.query=function(t,e,i){this.init(),this._root.query(t,e,i)},lr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},lr.prototype.printNode=function(t){si.out.println(mn.toLineString(new E(t._min,this._level),new E(t._max,this._level)))},lr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},lr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var i=0;i<t.size();i+=2){var n=t.get(i);if((i+1<t.size()?t.get(i):null)===null)e.add(n);else{var a=new X0(t.get(i),t.get(i+1));e.add(a)}}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr};var Zo=function(){this._items=new F};Zo.prototype.visitItem=function(t){this._items.add(t)},Zo.prototype.getItems=function(){return this._items},Zo.prototype.interfaces_=function(){return[Br]},Zo.prototype.getClass=function(){return Zo};var Ko=function(){this._index=null;var t=arguments[0];if(!st(t,Fr))throw new T("Argument must be Polygonal");this._index=new so(t)},_l={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Ko.prototype.locate=function(t){var e=new Cn(t),i=new ts(e);return this._index.query(t.y,t.y,i),e.getLocation()},Ko.prototype.interfaces_=function(){return[Wo]},Ko.prototype.getClass=function(){return Ko},_l.SegmentVisitor.get=function(){return ts},_l.IntervalIndexedGeometry.get=function(){return so},Object.defineProperties(Ko,_l);var ts=function(){this._counter=null;var t=arguments[0];this._counter=t};ts.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},ts.prototype.interfaces_=function(){return[Br]},ts.prototype.getClass=function(){return ts};var so=function(){this._index=new lr;var t=arguments[0];this.init(t)};so.prototype.init=function(t){for(var e=vi.getLines(t).iterator();e.hasNext();){var i=e.next().getCoordinates();this.addLine(i)}},so.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var i=new lt(t[e-1],t[e]),n=Math.min(i.p0.y,i.p1.y),a=Math.max(i.p0.y,i.p1.y);this._index.insert(n,a,i)}},so.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new Zo;return this._index.query(t,e,i),i.getItems()}if(arguments.length===3){var n=arguments[0],a=arguments[1],u=arguments[2];this._index.query(n,a,u)}},so.prototype.interfaces_=function(){return[]},so.prototype.getClass=function(){return so};var Vs=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new Ch,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Dn,arguments.length===2){var i=arguments[0],n=arguments[1],a=m.OGC_SFS_BOUNDARY_RULE;this._argIndex=i,this._parentGeom=n,this._boundaryNodeRule=a,n!==null&&this.add(n)}else if(arguments.length===3){var u=arguments[0],d=arguments[1],g=arguments[2];this._argIndex=u,this._parentGeom=d,this._boundaryNodeRule=g,d!==null&&this.add(d)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(i,n){var a=this._nodes.addNode(n).getLabel(),u=1;L.NONE,a.getLocation(i,K.ON)===L.BOUNDARY&&u++;var d=e.determineBoundary(this._boundaryNodeRule,u);a.setLocation(i,d)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var i=arguments[0],n=arguments[1];return this.computeSelfNodes(i,n,!1)}
5if(arguments.length===3){var a=arguments[0],u=arguments[1],d=arguments[2],g=new wi(a,!0,!1);g.setIsDoneIfProperInt(d);var _=this.createEdgeSetIntersector(),M=this._parentGeom instanceof Kn||this._parentGeom instanceof Ke||this._parentGeom instanceof tr,B=u||!M;return _.computeIntersections(this._edges,g,B),this.addSelfIntersectionNodes(this._argIndex),g}},e.prototype.computeSplitEdges=function(i){for(var n=this._edges.iterator();n.hasNext();)n.next().eiList.addSplitEdges(i)},e.prototype.computeEdgeIntersections=function(i,n,a){var u=new wi(n,a,!0);return u.setBoundaryNodes(this.getBoundaryNodes(),i.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,i._edges,u),u},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof an){var i=arguments[0].getCoordinate();this.insertPoint(this._argIndex,i,L.INTERIOR)}else if(arguments[0]instanceof E){var n=arguments[0];this.insertPoint(this._argIndex,n,L.INTERIOR)}},e.prototype.addPolygon=function(i){this.addPolygonRing(i.getExteriorRing(),L.EXTERIOR,L.INTERIOR);for(var n=0;n<i.getNumInteriorRing();n++){var a=i.getInteriorRingN(n);this.addPolygonRing(a,L.INTERIOR,L.EXTERIOR)}},e.prototype.addEdge=function(i){this.insertEdge(i);var n=i.getCoordinates();this.insertPoint(this._argIndex,n[0],L.BOUNDARY),this.insertPoint(this._argIndex,n[n.length-1],L.BOUNDARY)},e.prototype.addLineString=function(i){var n=H.removeRepeatedPoints(i.getCoordinates());if(n.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var a=new Ua(n,new he(this._argIndex,L.INTERIOR));this._lineEdgeMap.put(i,a),this.insertEdge(a),pt.isTrue(n.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,n[0]),this.insertBoundaryPoint(this._argIndex,n[n.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var i=this.getBoundaryNodes(),n=new Array(i.size()).fill(null),a=0,u=i.iterator();u.hasNext();){var d=u.next();n[a++]=d.getCoordinate().copy()}return n},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(i,n,a){if(this.isBoundaryNode(i,n))return null;a===L.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(i,n):this.insertPoint(i,n,a)},e.prototype.addPolygonRing=function(i,n,a){if(i.isEmpty())return null;var u=H.removeRepeatedPoints(i.getCoordinates());if(u.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=u[0],null;var d=n,g=a;tt.isCCW(u)&&(d=a,g=n);var _=new Ua(u,new he(this._argIndex,L.BOUNDARY,d,g));this._lineEdgeMap.put(i,_),this.insertEdge(_),this.insertPoint(this._argIndex,u[0],L.BOUNDARY)},e.prototype.insertPoint=function(i,n,a){var u=this._nodes.addNode(n),d=u.getLabel();d===null?u._label=new he(i,a):d.setLocation(i,a)},e.prototype.createEdgeSetIntersector=function(){return new z0},e.prototype.addSelfIntersectionNodes=function(i){for(var n=this._edges.iterator();n.hasNext();)for(var a=n.next(),u=a.getLabel().getLocation(i),d=a.eiList.iterator();d.hasNext();){var g=d.next();this.addSelfIntersectionNode(i,g.coord,u)}},e.prototype.add=function(){if(arguments.length!==1)return t.prototype.add.apply(this,arguments);var i=arguments[0];if(i.isEmpty())return null;if(i instanceof tr&&(this._useBoundaryDeterminationRule=!1),i instanceof Ke)this.addPolygon(i);else if(i instanceof Ae)this.addLineString(i);else if(i instanceof an)this.addPoint(i);else if(i instanceof jo)this.addCollection(i);else if(i instanceof Mn)this.addCollection(i);else if(i instanceof tr)this.addCollection(i);else{if(!(i instanceof Pe))throw new Error(i.getClass().getName());this.addCollection(i)}},e.prototype.addCollection=function(i){for(var n=0;n<i.getNumGeometries();n++){var a=i.getGeometryN(n);this.add(a)}},e.prototype.locate=function(i){return st(this._parentGeom,Fr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Ko(this._parentGeom)),this._areaPtLocator.locate(i)):this._ptLocator.locate(i,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var i=arguments[0];return this._lineEdgeMap.get(i)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(i,n){return i.isInBoundary(n)?L.BOUNDARY:L.INT
5ERIOR},e}(Ne),es=function(){if(this._li=new Jn,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Vs(0,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],n=m.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vs(0,e,n),this._arg[1]=new Vs(1,i,n)}else if(arguments.length===3){var a=arguments[0],u=arguments[1],d=arguments[2];a.getPrecisionModel().compareTo(u.getPrecisionModel())>=0?this.setComputationPrecision(a.getPrecisionModel()):this.setComputationPrecision(u.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Vs(0,a,d),this._arg[1]=new Vs(1,u,d)}};es.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},es.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var ao=function(){};ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.map=function(){if(arguments[0]instanceof ht&&st(arguments[1],ao.MapOp)){for(var t=arguments[0],e=arguments[1],i=new F,n=0;n<t.getNumGeometries();n++){var a=e.map(t.getGeometryN(n));a!==null&&i.add(a)}return t.getFactory().buildGeometry(i)}if(st(arguments[0],D)&&st(arguments[1],ao.MapOp)){for(var u=arguments[0],d=arguments[1],g=new F,_=u.iterator();_.hasNext();){var M=_.next(),B=d.map(M);B!==null&&g.add(B)}return g}},ao.MapOp=function(){};var mt=function(t){function e(){var i=arguments[0],n=arguments[1];t.call(this,i,n),this._ptLocator=new Dn,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Tn,this._resultPolyList=new F,this._resultLineList=new F,this._resultPointList=new F,this._graph=new Ne(new Ah),this._geomFact=i.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(i){var n=this._edgeList.findEqualEdge(i);if(n!==null){var a=n.getLabel(),u=i.getLabel();n.isPointwiseEqual(i)||(u=new he(i.getLabel())).flip();var d=n.getDepth();d.isNull()&&d.add(a),d.add(u),a.merge(u)}else this._edgeList.add(i)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var n=i.next(),a=n.getSym();n.isInResult()&&a.isInResult()&&(n.setInResult(!1),a.setInResult(!1))}},e.prototype.isCoveredByLA=function(i){return!!this.isCovered(i,this._resultLineList)||!!this.isCovered(i,this._resultPolyList)},e.prototype.computeGeometry=function(i,n,a,u){var d=new F;return d.addAll(i),d.addAll(n),d.addAll(a),d.isEmpty()?e.createEmptyResult(u,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(d)},e.prototype.mergeSymLabels=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();)i.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(i,n){for(var a=n.iterator();a.hasNext();){var u=a.next();if(this._ptLocator.locate(i,u)!==L.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var i=new F,n=this._edgeList.iterator();n.hasNext();){var a=n.next();a.isCollapsed()&&(n.remove(),i.add(a.getCollapsedEdge()))}this._edgeList.addAll(i)},e.prototype.updateNodeLabelling=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next(),a=n.getEdges().getLabel();n.getLabel().merge(a)}},e.prototype.getResultGeometry=function(i){return this.computeOverlay(i),this._resultGeom},e.prototype.insertUniqueEdges=function(i){for(var n=i.iterator();n.hasNext();){var a=n.next();this.insertUniqueEdge(a)}},e.prototype.computeOverlay=function(i){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var n=new F;this._arg[0].computeSplitEdges(n),this._arg[1].computeSplitEdges(n),this.insertUniqueEdges(n),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),oo.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(i),this.cancelDuplicateResultEdges();var a=new cn(this._geomFact);a.add(this._graph),this._resultPolyList=a.getPolygons();var u=new Qn(this,this._geomFact,this._ptLocator);this._resultLineList=u.build(i);var d=new So(this,this._geomFact,this._ptLocator);this._resultPointList=d.build(i),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,i)},e.prototype.labelIncompleteNode=function(i,n){var a=this._ptLocator.locate(i.getCoordinate(),this._arg[
5n].getGeometry());i.getLabel().setLocation(n,a)},e.prototype.copyPoints=function(i){for(var n=this._arg[i].getNodeIterator();n.hasNext();){var a=n.next();this._graph.addNode(a.getCoordinate()).setLabel(i,a.getLabel().getLocation(i))}},e.prototype.findResultAreaEdges=function(i){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var a=n.next(),u=a.getLabel();u.isArea()&&!a.isInteriorAreaEdge()&&e.isResultOfOp(u.getLocation(0,K.RIGHT),u.getLocation(1,K.RIGHT),i)&&a.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var i=this._edgeList.iterator();i.hasNext();){var n=i.next(),a=n.getLabel(),u=n.getDepth();if(!u.isNull()){u.normalize();for(var d=0;d<2;d++)a.isNull(d)||!a.isArea()||u.isNull(d)||(u.getDelta(d)===0?a.toLine(d):(pt.isTrue(!u.isNull(d,K.LEFT),"depth of LEFT side has not been initialized"),a.setLocation(d,K.LEFT,u.getLocation(d,K.LEFT)),pt.isTrue(!u.isNull(d,K.RIGHT),"depth of RIGHT side has not been initialized"),a.setLocation(d,K.RIGHT,u.getLocation(d,K.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();)i.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next(),a=n.getLabel();n.isIsolated()&&(a.isNull(0)?this.labelIncompleteNode(n,0):this.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(a)}},e.prototype.isCoveredByA=function(i){return!!this.isCovered(i,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(es);mt.overlayOp=function(t,e,i){return new mt(t,e).getResultGeometry(i)},mt.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return mt.createEmptyResult(mt.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var i=e;return Io.map(t,{interfaces_:function(){return[ao.MapOp]},map:function(n){return n.intersection(i)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Fi.overlayOp(t,e,mt.INTERSECTION)},mt.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return mt.createEmptyResult(mt.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Fi.overlayOp(t,e,mt.SYMDIFFERENCE)},mt.resultDimension=function(t,e,i){var n=e.getDimension(),a=i.getDimension(),u=-1;switch(t){case mt.INTERSECTION:u=Math.min(n,a);break;case mt.UNION:u=Math.max(n,a);break;case mt.DIFFERENCE:u=n;break;case mt.SYMDIFFERENCE:u=Math.max(n,a)}return u},mt.createEmptyResult=function(t,e,i,n){var a=null;switch(mt.resultDimension(t,e,i)){case-1:a=n.createGeometryCollection(new Array(0).fill(null));break;case 0:a=n.createPoint();break;case 1:a=n.createLineString();break;case 2:a=n.createPolygon()}return a},mt.difference=function(t,e){return t.isEmpty()?mt.createEmptyResult(mt.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Fi.overlayOp(t,e,mt.DIFFERENCE))},mt.isResultOfOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=t.getLocation(0),n=t.getLocation(1);return mt.isResultOfOp(i,n,e)}if(arguments.length===3){var a=arguments[0],u=arguments[1],d=arguments[2];switch(a===L.BOUNDARY&&(a=L.INTERIOR),u===L.BOUNDARY&&(u=L.INTERIOR),d){case mt.INTERSECTION:return a===L.INTERIOR&&u===L.INTERIOR;case mt.UNION:return a===L.INTERIOR||u===L.INTERIOR;case mt.DIFFERENCE:return a===L.INTERIOR&&u!==L.INTERIOR;case mt.SYMDIFFERENCE:return a===L.INTERIOR&&u!==L.INTERIOR||a!==L.INTERIOR&&u===L.INTERIOR}return!1}},mt.INTERSECTION=1,mt.UNION=2,mt.DIFFERENCE=3,mt.SYMDIFFERENCE=4;var Hr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Dn,this._seg=new lt;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Hr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var i=this._linework.getGeometryN(e).getCoordinateSequence(),n=0;n<i.size()-1;n++)if(i.getCoordinate(n,this._seg.p0),i.getCoordinate(n+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Hr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?L.BOUNDARY:this._ptLocator.locate(t,this._g)},Hr.prototype.extractLinework=function(t){var e=new is;t.apply(e);var i=e.getLinework(),n=bt.toLineStringArray(i);return t.getFactory().createMultiLineString(n)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var is=function(){this._linework=null,this._linework=new F};is.prototype.getLinework=function(){return this._linework},is.prototype.filter=function(t){if(t instanceof Ke){var e=t;this._linework.add(e.getExteriorRing());for(var i=0;i<e.getNumInteriorRing();i++)this._linework.add(e.getInteriorRingN(i))}},is.prototype.interfaces_=function(){return[$e]},is.prototype.getClass=function(){return is};var co=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};
5co.prototype.extractPoints=function(t,e,i){for(var n=t.getCoordinates(),a=0;a<n.length-1;a++)this.computeOffsetPoints(n[a],n[a+1],e,i)},co.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},co.prototype.getPoints=function(t){for(var e=new F,i=vi.getLines(this._g).iterator();i.hasNext();){var n=i.next();this.extractPoints(n,t,e)}return e},co.prototype.computeOffsetPoints=function(t,e,i,n){var a=e.x-t.x,u=e.y-t.y,d=Math.sqrt(a*a+u*u),g=i*a/d,_=i*u/d,M=(e.x+t.x)/2,B=(e.y+t.y)/2;if(this._doLeft){var G=new E(M-_,B+g);n.add(G)}if(this._doRight){var it=new E(M+_,B-g);n.add(it)}},co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var xn=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new F;var e=arguments[0],i=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,i),this._geom=[e,i,n],this._locFinder=[new Hr(this._geom[0],this._boundaryDistanceTolerance),new Hr(this._geom[1],this._boundaryDistanceTolerance),new Hr(this._geom[2],this._boundaryDistanceTolerance)]},Yh={TOLERANCE:{configurable:!0}};xn.prototype.reportResult=function(t,e,i){si.out.println("Overlay result invalid - A:"+L.toLocationSymbol(e[0])+" B:"+L.toLocationSymbol(e[1])+" expected:"+(i?"i":"e")+" actual:"+L.toLocationSymbol(e[2]))},xn.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},xn.prototype.checkValid=function(){if(arguments.length===1){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var i=this._testCoords.get(e);if(!this.checkValid(t,i))return this._invalidLocation=i,!1}return!0}if(arguments.length===2){var n=arguments[0],a=arguments[1];return this._location[0]=this._locFinder[0].getLocation(a),this._location[1]=this._locFinder[1].getLocation(a),this._location[2]=this._locFinder[2].getLocation(a),!!xn.hasLocation(this._location,L.BOUNDARY)||this.isValidResult(n,this._location)}},xn.prototype.addTestPts=function(t){var e=new co(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},xn.prototype.isValidResult=function(t,e){var i=mt.isResultOfOp(e[0],e[1],t),n=!(i^e[2]===L.INTERIOR);return n||this.reportResult(t,e,i),n},xn.prototype.getInvalidLocation=function(){return this._invalidLocation},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.hasLocation=function(t,e){for(var i=0;i<3;i++)if(t[i]===e)return!0;return!1},xn.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Ye.computeSizeBasedSnapTolerance(t),Ye.computeSizeBasedSnapTolerance(e))},xn.isValid=function(t,e,i,n){return new xn(t,e,n).isValid(i)},Yh.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(xn,Yh);var wn=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};wn.prototype.extractElements=function(t,e){if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var n=t.getGeometryN(i);this._skipEmpty&&n.isEmpty()||e.add(n)}},wn.prototype.combine=function(){for(var t=new F,e=this._inputGeoms.iterator();e.hasNext();){var i=e.next();this.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.combine=function(){if(arguments.length===1){var t=arguments[0];return new wn(t).combine()}if(arguments.length===2){var e=arguments[0],i=arguments[1];return new wn(wn.createList(e,i)).combine()}if(arguments.length===3){var n=arguments[0],a=arguments[1],u=arguments[2];return new wn(wn.createList(n,a,u)).combine()}},wn.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},wn.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new F;return i.add(t),i.add(e),i}if(arguments.length===3){var n=arguments[0],a=arguments[1],u=arguments[2],d=new F;return d.add(n),d.add(a),d.add(u),d}};var We=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new F)},jh={STRTREE_NODE_CAPACITY:{configurable:!0}};We.prototype.reduceToGeometries=function(t){for(var e=new F,i=t.iterator();i.hasNext();){var n=i.next(),a=null;st(n,j)?a=this.unionTree(n):n instanceof ht&&(a=n),e.add(a)}return e}
5,We.prototype.extractByEnvelope=function(t,e,i){for(var n=new F,a=0;a<e.getNumGeometries();a++){var u=e.getGeometryN(a);u.getEnvelopeInternal().intersects(t)?n.add(u):i.add(u)}return this._geomFactory.buildGeometry(n)},We.prototype.unionOptimized=function(t,e){var i=t.getEnvelopeInternal(),n=e.getEnvelopeInternal();if(!i.intersects(n))return wn.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var a=i.intersection(n);return this.unionUsingEnvelopeIntersection(t,e,a)},We.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Sh(We.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var i=e.next();t.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var n=t.itemsTree();return this.unionTree(n)},We.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(arguments.length===3){var e=arguments[0],i=arguments[1],n=arguments[2];if(n-i<=1){var a=We.getGeometry(e,i);return this.unionSafe(a,null)}if(n-i==2)return this.unionSafe(We.getGeometry(e,i),We.getGeometry(e,i+1));var u=Math.trunc((n+i)/2),d=this.binaryUnion(e,i,u),g=this.binaryUnion(e,u,n);return this.unionSafe(d,g)}},We.prototype.repeatedUnion=function(t){for(var e=null,i=t.iterator();i.hasNext();){var n=i.next();e=e===null?n.copy():e.union(n)}return e},We.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},We.prototype.unionActual=function(t,e){return We.restrictToPolygons(t.union(e))},We.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},We.prototype.unionUsingEnvelopeIntersection=function(t,e,i){var n=new F,a=this.extractByEnvelope(i,t,n),u=this.extractByEnvelope(i,e,n),d=this.unionActual(a,u);return n.add(d),wn.combine(n)},We.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(arguments.length===2){var e=arguments[0],i=arguments[1];return e.getFactory().createGeometryCollection([e,i]).buffer(0)}},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.restrictToPolygons=function(t){if(st(t,Fr))return t;var e=xr.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(bt.toPolygonArray(e))},We.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},We.union=function(t){return new We(t).union()},jh.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(We,jh);var Ws=function(){};Ws.prototype.interfaces_=function(){return[]},Ws.prototype.getClass=function(){return Ws},Ws.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return mt.createEmptyResult(mt.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Fi.overlayOp(t,e,mt.UNION)},r.GeoJSONReader=ul,r.GeoJSONWriter=Ph,r.OverlayOp=mt,r.UnionOp=Ws,r.BufferOp=yi,Object.defineProperty(r,"__esModule",{value:!0})})});var Td=(()=>{class r{static{this.\u0275fac=function(c){return new(c||r)}}static{this.\u0275mod=br({type:r})}static{this.\u0275inj=wr({imports:[oa,oa]})}}return r})();var Dd=(()=>{class r{static{this.\u0275fac=function(c){return new(c||r)}}static{this.\u0275mod=br({type:r})}static{this.\u0275inj=wr({imports:[od,us,oa,ud,hd,Td]})}}return r})();var Gi=63710088e-1,Gb={centimeters:Gi*100,centimetres:Gi*100,degrees:Gi/111325,feet:Gi*3.28084,inches:Gi*39.37,kilometers:Gi/1e3,kilometres:Gi/1e3,meters:Gi,metres:Gi,miles:Gi/1609.344,millimeters:Gi*1e3,millimetres:Gi*1e3,nauticalmiles:Gi/1852,radians:1,yards:Gi*1.0936},zb={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Gi,yards:1.093
vendor: 3,965 bytes, line 5
56133};function dn(r,s,o){o===void 0&&(o={});var c={type:"Feature"};return(o.id===0||o.id)&&(c.id=o.id),o.bbox&&(c.bbox=o.bbox),c.properties=s||{},c.geometry=r,c}function je(r,s,o){if(o===void 0&&(o={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Pr(r[0])||!Pr(r[1]))throw new Error("coordinates must contain numbers");var c={type:"Point",coordinates:r};return dn(c,s,o)}function Se(r,s,o){o===void 0&&(o={});for(var c=0,l=r;c<l.length;c++){var h=l[c];if(h.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var f=0;f<h[h.length-1].length;f++)if(h[h.length-1][f]!==h[0][f])throw new Error("First and last Position are not equivalent.")}var p={type:"Polygon",coordinates:r};return dn(p,s,o)}function zi(r,s,o){if(o===void 0&&(o={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var c={type:"LineString",coordinates:r};return dn(c,s,o)}function Ol(r,s,o){o===void 0&&(o={});var c={type:"MultiPoint",coordinates:r};return dn(c,s,o)}function Ir(r,s,o){o===void 0&&(o={});var c={type:"MultiPolygon",coordinates:r};return dn(c,s,o)}function Pr(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Pi(r,s,o){if(r!==null)for(var c,l,h,f,p,y,x,S=0,O=0,N,z=r.type,X=z==="FeatureCollection",$=z==="Feature",I=X?r.features.length:1,k=0;k<I;k++){x=X?r.features[k].geometry:$?r.geometry:r,N=x?x.type==="GeometryCollection":!1,p=N?x.geometries.length:1;for(var T=0;T<p;T++){var P=0,Y=0;if(f=N?x.geometries[T]:x,f!==null){y=f.coordinates;var W=f.type;switch(S=o&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(s(y,O,k,P,Y)===!1)return!1;O++,P++;break;case"LineString":case"MultiPoint":for(c=0;c<y.length;c++){if(s(y[c],O,k,P,Y)===!1)return!1;O++,W==="MultiPoint"&&P++}W==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(c=0;c<y.length;c++){for(l=0;l<y[c].length-S;l++){if(s(y[c][l],O,k,P,Y)===!1)return!1;O++}W==="MultiLineString"&&P++,W==="Polygon"&&Y++}W==="Polygon"&&P++;break;case"MultiPolygon":for(c=0;c<y.length;c++){for(Y=0,l=0;l<y[c].length;l++){for(h=0;h<y[c][l].length-S;h++){if(s(y[c][l][h],O,k,P,Y)===!1)return!1;O++}Y++}P++}break;case"GeometryCollection":for(c=0;c<f.geometries.length;c++)if(Pi(f.geometries[c],s,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Fd(r,s,o,c){var l=o;return Pi(r,function(h,f,p,y,x){f===0&&o===void 0?l=h:l=s(l,h,f,p,y,x)},c),l}function ho(r,s){var o,c,l,h,f,p,y,x,S,O,N=0,z=r.type==="FeatureCollection",X=r.type==="Feature",$=z?r.features.length:1;for(o=0;o<$;o++){for(p=z?r.features[o].geometry:X?r.geometry:r,x=z?r.features[o].properties:X?r.properties:{},S=z?r.features[o].bbox:X?r.bbox:void 0,O=z?r.features[o].id:X?r.id:void 0,y=p?p.type==="GeometryCollection":!1,f=y?p.geometries.length:1,l=0;l<f;l++){if(h=y?p.geometries[l]:p,h===null){if(s(null,N,x,S,O)===!1)return!1;continue}switch(h.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(s(h,N,x,S,O)===!1)return!1;break}case"GeometryCollection":{for(c=0;c<h.geometries.length;c++)if(s(h.geometries[c],N,x,S,O)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}N++}}function Bn(r,s){ho(r,function(o,c,l,h,f){var p=o===null?null:o.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return s(dn(o,l,{bbox:h,id:f}),c,0)===!1?!1:void 0}var y;switch(p){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var x=0;x<o.coordinates.length;x++){var S=o.coordinates[x],O={type:y,coordinates:S};if(s(dn(O,l),c,x)===!1)return!1}})}function kl(r){var s=[1/0,1/0,-1/0,-1/0];return Pi(r,function(o){s[0]>o[0]&&(s[0]=o[0]),s[1]>o[1]&&(s[1]=o[1]),s[2]<o[0]&&(s[2]=o[0]),s[3]<o[1]&&(s[3]=o[1])}),s}kl.default=kl;var Ki=kl;
5function tn(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Nl(r,s,o){if(!r)throw new Error("No feature passed");if(!o)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+o+", Feature with geometry required");if(!r.geometry||r.geometry.type!==s)throw new Error("Invalid input to "+o+": must be a "+s+", given "+r.geometry.type)}function Ii(r){return r.type==="Feature"?r.geometry:r}var J0=fi(oc(),1);var ty=fi($d(),1);var fe=11102230246251565e-32;var lc=(3+8*fe)*fe;function J(r){return new Float64Array(r)}var cE=(3+16*fe)*fe,lE=(2+12*fe)*fe,uE=(9+64*fe)*fe*fe,hE=J(4),dE=J(8),fE=J(12),pE=J(16),mE=J(4);var vE=(7+56*fe)*fe,_E=(3+28*fe)*fe,xE=(26+288*fe)*fe*fe,wE=J(4),bE=J(4),EE=J(4),CE=J(4),ME=J(4),PE=J(4),IE=J(4),SE=J(4),OE=J(4),kE=J(8),NE=J(8),LE=J(8),RE=J(4),AE=J(8),TE=J(8),DE=J(16),FE=J(12),BE=J(192),qE=J(192);var UE=(10+96*fe)*fe,XE=(4+48*fe)*fe,YE=(44+576*fe)*fe*fe,jE=J(4),$E=J(4),HE=J(4),VE=J(4),WE=J(4),QE=J(4),JE=J(4),ZE=J(4),KE=J(8),tC=J(8),eC=J(8),iC=J(8),nC=J(8),rC=J(8),oC=J(8),sC=J(8),aC=J(8),cC=J(4),lC=J(4),uC=J(4),hC=J(8),dC=J(16),fC=J(16),pC=J(16),mC=J(32),gC=J(32),yC=J(48),vC=J(64),_C=J(1152),xC=J(1152);var CC=(16+224*fe)*fe,MC=(5+72*fe)*fe,PC=(71+1408*fe)*fe*fe,IC=J(4),SC=J(4),OC=J(4),kC=J(4),NC=J(4),LC=J(4),RC=J(4),AC=J(4),TC=J(4),DC=J(4),FC=J(24),BC=J(24),qC=J(24),GC=J(24),zC=J(24),UC=J(24),XC=J(24),YC=J(24),jC=J(24),$C=J(24),HC=J(1152),VC=J(1152),WC=J(1152),QC=J(1152),JC=J(1152),ZC=J(2304),KC=J(2304),tM=J(3456),eM=J(5760),iM=J(8),nM=J(8),rM=J(8),oM=J(16),sM=J(24),aM=J(48),cM=J(48),lM=J(96),uM=J(192),hM=J(384),dM=J(384),fM=J(384),pM=J(768);var mM=J(96),gM=J(96),yM=J(96),vM=J(1152);function Ui(r,s,o){if(o===void 0&&(o={}),!r)throw new Error("point is required");if(!s)throw new Error("polygon is required");var c=tn(r),l=Ii(s),h=l.type,f=s.bbox,p=l.coordinates;if(f&&ey(c,f)===!1)return!1;h==="Polygon"&&(p=[p]);for(var y=!1,x=0;x<p.length&&!y;x++)if(Vd(c,p[x][0],o.ignoreBoundary)){for(var S=!1,O=1;O<p[x].length&&!S;)Vd(c,p[x][O],!o.ignoreBoundary)&&(S=!0),O++;S||(y=!0)}return y}function Vd(r,s,o){var c=!1;s[0][0]===s[s.length-1][0]&&s[0][1]===s[s.length-1][1]&&(s=s.slice(0,s.length-1));for(var l=0,h=s.length-1;l<s.length;h=l++){var f=s[l][0],p=s[l][1],y=s[h][0],x=s[h][1],S=r[1]*(f-y)+p*(y-r[0])+x*(r[0]-f)===0&&(f-r[0])*(y-r[0])<=0&&(p-r[1])*(x-r[1])<=0;if(S)return!o;var O=p>r[1]!=x>r[1]&&r[0]<(y-f)*(r[1]-p)/(x-p)+f;O&&(c=!c)}return c}function ey(r,s){return s[0]<=r[0]&&s[1]<=r[1]&&s[2]>=r[0]&&s[3]>=r[1]}var KM=function(){function r(s,o,c){this.a=s,this.b=o,this.c=c;var l=o.x-s.x,h=o.y-s.y,f=c.x-s.x,p=c.y-s.y,y=l*(s.x+o.x)+h*(s.y+o.y),x=f*(s.x+c.x)+p*(s.y+c.y),S=2*(l*(c.y-o.y)-h*(c.x-o.x)),O,N;this.x=(p*y-h*x)/S,this.y=(l*x-f*y)/S,O=this.x-s.x,N=this.y-s.y,this.r=O*O+N*N}return r}();var Jd=new ArrayBuffer(16),e2=new Float64Array(Jd),i2=new Uint32Array(Jd);var gy=fi(zl(),1);var SI=function(){function r(s){this.points=s.points||[],this.duration=s.duration||1e4,this.sharpness=s.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=s.stepLength||60,this.length=this.points.length,this.delay=0;for(var o=0;o<this.length;o++)this.points[o].z=this.points[o].z||0;for(var o=0;o<this.length-1;o++){var c=this.points[o],l=this.points[o+1];this.centers.push({x:(c.x+l.x)/2,y:(c.y+l.y)/2,z:(c.z+l.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var o=0;o<this.centers.length-1;o++){var h=this.points[o+1].x-(this.centers[o].x+this.centers[o+1].x)/2,f=this.points[o+1].y-(this.centers[o].y+this.centers[o+1].y)/2,p=this.points[o+1].z-(this.centers[o].y+this.centers[o+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[o+1].x+this.sharpness*(this.centers[o].x+h),y:(1-this.sharpness)*this.points[o+1].y+this.sharpness*(this.centers[o].y+f),z:(1-this.sharpness)*this.points[o+1].z+this.sharpness*(this.centers[o].z+p)},{x:(1-this.sharpness)*this.points[o+1].x+this.sharpness*(this.centers[o+1].x+h),y:(1-this.sharpness)*this.points[o+1].y+this.sharpness*(this.centers[o+1].y+f),z:(1-this.sharpness)*this.points[o+1].z+this.sharpness*(this.centers[o+1].z+p)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return r.prototype.cacheSteps=function(s){var o=[],c=this.pos(0);o.push(0);for(var l=0;l<this.duration;l+=10){var h=this.pos(l),f=Math.sqrt((h.x-c.x)*(h.x-c.x)+(h.y-c.y)*(h.y-c.y)+(h.z-c.z)*(h.z-c.z));f>s&&(o.push(l),c=h)}return o},r.prototype.vector=function(s){var o=this.pos(s+10),c=this.pos(s-10);return{angle:180*Math.atan2(o.y-c.y,o.x-c.x)/3.14,speed:Math.sqrt((c.x-o.x)*(c.x-o.x)+(c.y-o.y)*(c.y-o.y)+(c.z-o.z)*(c.z-o.z))}},r.prototype.pos=function(s){var o=s-this.delay;o<0&&(o=0),o>this.duration&&(o=this.duration-1);var c=o/this.duration;if(c>=1)return this.points[this.length-1];var l=Math.floor((this.points.length-1)*c),h=(this.length-1)*c-l;return yy(h,this.points[l],this.controls[l][1],this.controls[l+1][0],this.points[l+1])},r}();function yy(r,s,o,c,l){var h=vy(r),f={x:l.x*h[0]+c.x*h[1]+o.x*h[2]+s.x*h[3],y:l.y*h[0]+c.y*h[1]+o.y*h[2]+s.y*h[3],z:l.z*h[0]+c.z*h[1]+o.z*h[2]+s.z*h[3]};return f}function vy(r){var s=r*r,o=s*r;return[o,3*s*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}function la(r,s){s===void 0&&(s={});var o=Number(r[0]),c=Number(r[1]),l=Number(r[2]),h=Number(r[3]);if(r.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var f=[o,c],p=[o,h],y=[l,h],x=[l,c];return Se([[f,x,y,p,f]],s.properties,{bbox:r,id:s.id})}function _y(r){return la(Ki(r))}var Ul=_y;var Dy=fi(lf(),1);
5var lv=fi(xc(),1);var hv=fi(oc(),1);var pv=fi(zl(),1);var Sf=Math.PI/180,Of=180/Math.PI,ga=function(r,s){this.lon=r,this.lat=s,this.x=Sf*r,this.y=Sf*s};ga.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};ga.prototype.antipode=function(){var r=-1*this.lat,s=this.lon<0?180+this.lon:(180-this.lon)*-1;return new ga(s,r)};var kf=function(){this.coords=[],this.length=0};kf.prototype.move_to=function(r){this.length++,this.coords.push(r)};var hu=function(r){this.properties=r||{},this.geometries=[]};hu.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var r=[],s=0;s<this.geometries.length;s++)r.push(this.geometries[s].coords);return{geometry:{type:"MultiLineString",coordinates:r},type:"Feature",properties:this.properties}};hu.prototype.wkt=function(){for(var r="",s="LINESTRING(",o=function(h){s+=h[0]+" "+h[1]+","},c=0;c<this.geometries.length;c++){if(this.geometries[c].coords.length===0)return"LINESTRING(empty)";var l=this.geometries[c].coords;l.forEach(o),r+=s.substring(0,s.length-1)+")"}return r};var Nf=function(r,s,o){if(!r||r.x===void 0||r.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!s||s.x===void 0||s.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new ga(r.x,r.y),this.end=new ga(s.x,s.y),this.properties=o||{};var c=this.start.x-this.end.x,l=this.start.y-this.end.y,h=Math.pow(Math.sin(l/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(c/2),2);if(this.g=2*Math.asin(Math.sqrt(h)),this.g===Math.PI)throw new Error("it appears "+r.view()+" and "+s.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+r+" and "+s)};Nf.prototype.interpolate=function(r){var s=Math.sin((1-r)*this.g)/Math.sin(this.g),o=Math.sin(r*this.g)/Math.sin(this.g),c=s*Math.cos(this.start.y)*Math.cos(this.start.x)+o*Math.cos(this.end.y)*Math.cos(this.end.x),l=s*Math.cos(this.start.y)*Math.sin(this.start.x)+o*Math.cos(this.end.y)*Math.sin(this.end.x),h=s*Math.sin(this.start.y)+o*Math.sin(this.end.y),f=Of*Math.atan2(h,Math.sqrt(Math.pow(c,2)+Math.pow(l,2))),p=Of*Math.atan2(l,c);return[p,f]};Nf.prototype.Arc=function(r,s){var o=[];if(!r||r<=2)o.push([this.start.lon,this.start.lat]),o.push([this.end.lon,this.end.lat]);else for(var c=1/(r-1),l=0;l<r;++l){var h=c*l,f=this.interpolate(h);o.push(f)}for(var p=!1,y=0,x=s&&s.offset?s.offset:10,S=180-x,O=-180+x,N=360-x,z=1;z<o.length;++z){var X=o[z-1][0],$=o[z][0],I=Math.abs($-X);I>N&&($>S&&X<O||X>S&&$<O)?p=!0:I>y&&(y=I)}var k=[];if(p&&y<x){var T=[];k.push(T);for(var P=0;P<o.length;++P){var Y=parseFloat(o[P][0]);if(P>0&&Math.abs(Y-o[P-1][0])>N){var W=parseFloat(o[P-1][0]),Z=parseFloat(o[P-1][1]),et=parseFloat(o[P][0]),E=parseFloat(o[P][1]);if(W>-180&&W<O&&et===180&&P+1<o.length&&o[P-1][0]>-180&&o[P-1][0]<O){T.push([-180,o[P][1]]),P++,T.push([o[P][0],o[P][1]]);continue}else if(W>S&&W<180&&et===-180&&P+1<o.length&&o[P-1][0]>S&&o[P-1][0]<180){T.push([180,o[P][1]]),P++,T.push([o[P][0],o[P][1]]);continue}if(W<O&&et>S){var dt=W;W=et,et=dt;var wt=Z;Z=E,E=wt}if(W>S&&et<O&&(et+=360),W<=180&&et>=180&&W<et){var yt=(180-W)/(et-W),L=yt*E+(1-yt)*Z;T.push([o[P-1][0]>S?180:-180,L]),T=[],T.push([o[P-1][0]>S?-180:180,L]),k.push(T)}else T=[],k.push(T);T.push([Y,o[P][1]])}else T.push([o[P][0],o[P][1]])}}else{var Le=[];k.push(Le);for(var st=0;st<o.length;++st)Le.push([o[st][0],o[st][1]])}for(var we=new hu(this.properties),ri=0;ri<k.length;++ri){var oi=new kf;we.geometries.push(oi);for(var Me=k[ri],Ze=0;Ze<Me.length;++Ze)oi.move_to(Me[Ze])}return we};var yv=fi(xc(),1);var g1=fi(xc(),1);var y1=fi(qu(),1);var x1=fi(oc(),1);var St=[],Ot=[],kt=[],Nt=[],Lt=[],Rt=[],At=[],Tt=[],Dt=[],Ft=[],Bt=[],qt=[],Gt=[],zt=[],Ut=[],Xt=[],Yt=[],jt=[],$t=[],Ht=[],Vt=[],Wt=[],Qt=[],Jt=[];At[85]=Ft[85]=-1;Tt[85]=Bt[85]=0;Dt[85]=qt[85]=1;$t[85]=Wt[85]=1;Ht[85]=Qt[85]=0;Vt[85]=Jt[85]=1;St[85]=Nt[85]=0;Ot[85]=Lt[85]=-1;kt[85]=Ut[85]=0;Xt[85]=Gt[85]=0;Yt[85]=zt[85]=1;Rt[85]=jt[85]=1;Wt[1]=Wt[169]=0;Qt[1]=Qt[169]=-1;Jt[1]=Jt[169]=0;Gt[1]=Gt[169]=-1;zt[1]=zt[169]=0;Ut[1]=Ut[169]=0;Ft[4]=Ft[166]=0;Bt[4]=Bt[166]=-1;qt[4]=qt[166]=1;Xt[4]=Xt[166]=1;Yt[4]=Yt[166]=0;jt[4]=jt[166]=0;At[16]=At[154]=0;Tt[16]=Tt[154]=1;Dt[16]=Dt[154]=1;Nt[16]=Nt[154]=1;Lt[16]=Lt[154]=0;Rt[16]=Rt[154]=1;$t[64]=$t[106]=0;Ht[64]=Ht[106]=1;Vt[64]=Vt[106]=0;St[64]=St[106]=-1;Ot[64]=Ot[106]=0;kt[64]=kt[106]=1;$t[2]=$t[168]=0;Ht[2]=Ht[168]=-1;Vt[2]=Vt[168]=1;Wt[2]=Wt[168]=0;Qt[2]=Qt[168]=-1;Jt[2]=Jt[168]=0;Gt[2]=Gt[168]=-1;zt[2]=zt[168]=0;Ut[2]=Ut[168]=0;Xt[2]=Xt[168]=-1;Yt[2]=Yt[168]=0;jt[2]=jt[168]=1;At[8]=At[162]=0;Tt[8]=Tt[162]=-1;Dt[8]=Dt[162]=0;Ft[8]=Ft[162]=0;Bt[8]=Bt[162]=-1;qt[8]=qt[162]=1;Gt[8]=Gt[162]=1;zt[8]=zt[162]=0;Ut[8]=Ut[162]=1;Xt[8]=Xt[162]=1;Yt[8]=Yt[162]=0;jt[8]=jt[162]=0;At[32]=At[138]=0;Tt[32]=Tt[138]=1;Dt[32]=Dt[138]=1;Ft[32]=Ft[138]=0;Bt[32]=Bt[138]=1;qt[32]=qt[138]=0;St[32]=St[138]=1;Ot[32]=Ot[138]=0;kt[32]=kt[138]=0;Nt[32]=Nt[138]=1;Lt[32]=Lt[138]=0;Rt[32]=Rt[138]=1;Wt[128]=Wt[42]=0;Qt[128]=Qt[42]=1;Jt[128]=Jt[42]=1;$t[128]=$t[42]=0;Ht[128]=Ht[42]=1;Vt[128]=Vt[42]=0;St[128]=St[42]=-1;Ot[128]=Ot[42]=0;kt[128]=kt[42]=1;Nt[128]=Nt[42]=-1;Lt[128]=Lt[42]=0;Rt[128]=Rt[42]=0;Ft[5]=Ft[165]=-1;Bt[5]=Bt[165]=0;qt[5]=qt[165]=0;Wt[5]=Wt[165]=1;Qt[5]=Qt[165]=0;Jt[5]=Jt[165]=0;Xt[20]=Xt[150]=0;Yt[20]=Yt[150]=1;jt[20]=jt[150]=1;Nt[20]=Nt[150]=0;Lt[20]=Lt[150]=-1;Rt[20]=Rt[150]=1;At[80]=At[90]=-1;Tt[80]=Tt[90]=0;Dt[80]=Dt[90]=1;$t[80]=$t[90]=1;Ht[80]=Ht[90]=0;Vt[80]=Vt[90]=1;Gt[65]=Gt[105]=0;zt[65]=zt[105]=1;Ut[65]=Ut[105]=0;St[65]=St[105]=0;Ot[65]=Ot[105]=-1;kt[65]=kt[105]=0;At[160]=At[10]=-1;Tt[160]=Tt[10]=0;Dt[160]=Dt[10]=1;Ft[160]=Ft[10]=-1;Bt[160]=Bt[10]=0;qt[160]=qt[10]=0;Wt[160]=Wt[10]=1;Qt[160]=Qt[10]=0;Jt[160]=Jt[10]=0;$t[160]=$t[10]=1;Ht[160]=Ht[10]=0;Vt[160]=Vt[10]=1;Xt[130]=Xt[40]=0;Yt[130]=Yt[40]=1;jt[130]=jt[40]=1;Gt[130]=Gt[40]=0;zt[130]=zt[40]=1;Ut[130]=Ut[40]=0;St[130]=St[40]=0;Ot[130]=Ot[40]=-1;kt[130]=kt[40]=0;Nt[130]=Nt[40]=0;Lt[130]=Lt[40]=-1;Rt[130]=Rt[40]=1;Ft[37]=Ft[133]=0;Bt[37]=Bt[133]=1;qt[37]=qt[133]=1;Wt[37]=Wt[133]=0;Qt[37]=Qt[133]=1;Jt[37]=Jt[133]=0;St[37]=St[133]=-1;Ot[37]=Ot[133]=0;kt[37]=kt[133]=0;Nt[37]=Nt[133]=1;
5Lt[37]=Lt[133]=0;Rt[37]=Rt[133]=0;Xt[148]=Xt[22]=-1;Yt[148]=Yt[22]=0;jt[148]=jt[22]=0;Wt[148]=Wt[22]=0;Qt[148]=Qt[22]=-1;Jt[148]=Jt[22]=1;$t[148]=$t[22]=0;Ht[148]=Ht[22]=1;Vt[148]=Vt[22]=1;Nt[148]=Nt[22]=-1;Lt[148]=Lt[22]=0;Rt[148]=Rt[22]=1;At[82]=At[88]=0;Tt[82]=Tt[88]=-1;Dt[82]=Dt[88]=1;Xt[82]=Xt[88]=1;Yt[82]=Yt[88]=0;jt[82]=jt[88]=1;Gt[82]=Gt[88]=-1;zt[82]=zt[88]=0;Ut[82]=Ut[88]=1;$t[82]=$t[88]=0;Ht[82]=Ht[88]=-1;Vt[82]=Vt[88]=0;At[73]=At[97]=0;Tt[73]=Tt[97]=1;Dt[73]=Dt[97]=0;Ft[73]=Ft[97]=0;Bt[73]=Bt[97]=-1;qt[73]=qt[97]=0;Gt[73]=Gt[97]=1;zt[73]=zt[97]=0;Ut[73]=Ut[97]=0;St[73]=St[97]=1;Ot[73]=Ot[97]=0;kt[73]=kt[97]=1;At[145]=At[25]=0;Tt[145]=Tt[25]=-1;Dt[145]=Dt[25]=0;Gt[145]=Gt[25]=1;zt[145]=zt[25]=0;Ut[145]=Ut[25]=1;Wt[145]=Wt[25]=0;Qt[145]=Qt[25]=1;Jt[145]=Jt[25]=1;Nt[145]=Nt[25]=-1;Lt[145]=Lt[25]=0;Rt[145]=Rt[25]=0;Ft[70]=Ft[100]=0;Bt[70]=Bt[100]=1;qt[70]=qt[100]=0;Xt[70]=Xt[100]=-1;Yt[70]=Yt[100]=0;jt[70]=jt[100]=1;$t[70]=$t[100]=0;Ht[70]=Ht[100]=-1;Vt[70]=Vt[100]=1;St[70]=St[100]=1;Ot[70]=Ot[100]=0;kt[70]=kt[100]=0;Ft[101]=Ft[69]=0;Bt[101]=Bt[69]=1;qt[101]=qt[69]=0;St[101]=St[69]=1;Ot[101]=Ot[69]=0;kt[101]=kt[69]=0;Wt[149]=Wt[21]=0;Qt[149]=Qt[21]=1;Jt[149]=Jt[21]=1;Nt[149]=Nt[21]=-1;Lt[149]=Lt[21]=0;Rt[149]=Rt[21]=0;Xt[86]=Xt[84]=-1;Yt[86]=Yt[84]=0;jt[86]=jt[84]=1;$t[86]=$t[84]=0;Ht[86]=Ht[84]=-1;Vt[86]=Vt[84]=1;At[89]=At[81]=0;Tt[89]=Tt[81]=-1;Dt[89]=Dt[81]=0;Gt[89]=Gt[81]=1;zt[89]=zt[81]=0;Ut[89]=Ut[81]=1;At[96]=At[74]=0;Tt[96]=Tt[74]=1;Dt[96]=Dt[74]=0;Ft[96]=Ft[74]=-1;Bt[96]=Bt[74]=0;qt[96]=qt[74]=1;$t[96]=$t[74]=1;Ht[96]=Ht[74]=0;Vt[96]=Vt[74]=0;St[96]=St[74]=1;Ot[96]=Ot[74]=0;kt[96]=kt[74]=1;At[24]=At[146]=0;Tt[24]=Tt[146]=-1;Dt[24]=Dt[146]=1;Xt[24]=Xt[146]=1;Yt[24]=Yt[146]=0;jt[24]=jt[146]=1;Gt[24]=Gt[146]=0;zt[24]=zt[146]=1;Ut[24]=Ut[146]=1;Nt[24]=Nt[146]=0;Lt[24]=Lt[146]=-1;Rt[24]=Rt[146]=0;Ft[6]=Ft[164]=-1;Bt[6]=Bt[164]=0;qt[6]=qt[164]=1;Xt[6]=Xt[164]=-1;Yt[6]=Yt[164]=0;jt[6]=jt[164]=0;Wt[6]=Wt[164]=0;Qt[6]=Qt[164]=-1;Jt[6]=Jt[164]=1;$t[6]=$t[164]=1;Ht[6]=Ht[164]=0;Vt[6]=Vt[164]=0;Gt[129]=Gt[41]=0;zt[129]=zt[41]=1;Ut[129]=Ut[41]=1;Wt[129]=Wt[41]=0;Qt[129]=Qt[41]=1;Jt[129]=Jt[41]=0;St[129]=St[41]=-1;Ot[129]=Ot[41]=0;kt[129]=kt[41]=0;Nt[129]=Nt[41]=0;Lt[129]=Lt[41]=-1;Rt[129]=Rt[41]=0;Xt[66]=Xt[104]=0;Yt[66]=Yt[104]=1;jt[66]=jt[104]=0;Gt[66]=Gt[104]=-1;zt[66]=zt[104]=0;Ut[66]=Ut[104]=1;$t[66]=$t[104]=0;Ht[66]=Ht[104]=-1;Vt[66]=Vt[104]=0;St[66]=St[104]=0;Ot[66]=Ot[104]=-1;kt[66]=kt[104]=1;At[144]=At[26]=-1;Tt[144]=Tt[26]=0;Dt[144]=Dt[26]=0;Wt[144]=Wt[26]=1;Qt[144]=Qt[26]=0;Jt[144]=Jt[26]=1;$t[144]=$t[26]=0;Ht[144]=Ht[26]=1;Vt[144]=Vt[26]=1;Nt[144]=Nt[26]=-1;Lt[144]=Lt[26]=0;Rt[144]=Rt[26]=1;Ft[36]=Ft[134]=0;Bt[36]=Bt[134]=1;qt[36]=qt[134]=1;Xt[36]=Xt[134]=0;Yt[36]=Yt[134]=1;jt[36]=jt[134]=0;St[36]=St[134]=0;Ot[36]=Ot[134]=-1;kt[36]=kt[134]=1;Nt[36]=Nt[134]=1;Lt[36]=Lt[134]=0;Rt[36]=Rt[134]=0;At[9]=At[161]=-1;Tt[9]=Tt[161]=0;Dt[9]=Dt[161]=0;Ft[9]=Ft[161]=0;Bt[9]=Bt[161]=-1;qt[9]=qt[161]=0;Gt[9]=Gt[161]=1;zt[9]=zt[161]=0;Ut[9]=Ut[161]=0;Wt[9]=Wt[161]=1;Qt[9]=Qt[161]=0;Jt[9]=Jt[161]=1;At[136]=0;Tt[136]=1;Dt[136]=1;Ft[136]=0;Bt[136]=1;qt[136]=0;Xt[136]=-1;Yt[136]=0;jt[136]=1;Gt[136]=-1;zt[136]=0;Ut[136]=0;Wt[136]=0;Qt[136]=-1;Jt[136]=0;$t[136]=0;Ht[136]=-1;Vt[136]=1;St[136]=1;Ot[136]=0;kt[136]=0;Nt[136]=1;Lt[136]=0;Rt[136]=1;At[34]=0;Tt[34]=-1;Dt[34]=0;Ft[34]=0;Bt[34]=-1;qt[34]=1;Xt[34]=1;Yt[34]=0;jt[34]=0;Gt[34]=1;zt[34]=0;Ut[34]=1;Wt[34]=0;Qt[34]=1;Jt[34]=1;$t[34]=0;Ht[34]=1;Vt[34]=0;St[34]=-1;Ot[34]=0;kt[34]=1;Nt[34]=-1;Lt[34]=0;Rt[34]=0;At[35]=0;Tt[35]=1;Dt[35]=1;Ft[35]=0;Bt[35]=-1;qt[35]=1;Xt[35]=1;Yt[35]=0;jt[35]=0;Gt[35]=-1;zt[35]=0;Ut[35]=0;Wt[35]=0;Qt[35]=-1;Jt[35]=0;$t[35]=0;Ht[35]=1;Vt[35]=0;St[35]=-1;Ot[35]=0;kt[35]=1;Nt[35]=1;Lt[35]=0;Rt[35]=1;At[153]=0;Tt[153]=1;Dt[153]=1;Gt[153]=-1;zt[153]=0;Ut[153]=0;Wt[153]=0;Qt[153]=-1;Jt[153]=0;Nt[153]=1;Lt[153]=0;Rt[153]=1;Ft[102]=0;Bt[102]=-1;qt[102]=1;Xt[102]=1;Yt[102]=0;jt[102]=0;$t[102]=0;Ht[102]=1;Vt[102]=0;St[102]=-1;Ot[102]=0;kt[102]=1;At[155]=0;Tt[155]=-1;Dt[155]=0;Gt[155]=1;zt[155]=0;Ut[155]=1;Wt[155]=0;Qt[155]=1;Jt[155]=1;Nt[155]=-1;Lt[155]=0;Rt[155]=0;Ft[103]=0;Bt[103]=1;qt[103]=0;Xt[103]=-1;Yt[103]=0;jt[103]=1;$t[103]=0;Ht[103]=-1;Vt[103]=1;St[103]=1;Ot[103]=0;kt[103]=0;At[152]=0;Tt[152]=1;Dt[152]=1;Xt[152]=-1;Yt[152]=0;jt[152]=1;Gt[152]=-1;zt[152]=0;Ut[152]=0;Wt[152]=0;Qt[152]=-1;Jt[152]=0;$t[152]=0;Ht[152]=-1;Vt[152]=1;Nt[152]=1;Lt[152]=0;Rt[152]=1;At[156]=0;Tt[156]=-1;Dt[156]=1;Xt[156]=1;Yt[156]=0;jt[156]=1;Gt[156]=-1;zt[156]=0;Ut[156]=0;Wt[156]=0;Qt[156]=-1;Jt[156]=0;$t[156]=0;Ht[156]=1;Vt[156]=1;Nt[156]=-1;Lt[156]=0;Rt[156]=1;At[137]=0;Tt[137]=1;Dt[137]=1;Ft[137]=0;Bt[137]=1;qt[137]=0;Gt[137]=-1;zt[137]=0;Ut[137]=0;Wt[137]=0;Qt[137]=-1;Jt[137]=0;St[137]=1;Ot[137]=0;kt[137]=0;Nt[137]=1;Lt[137]=0;Rt[137]=1;At[139]=0;Tt[139]=1;Dt[139]=1;Ft[139]=0;Bt[139]=-1;qt[139]=0;Gt[139]=1;zt[139]=0;Ut[139]=0;Wt[139]=0;Qt[139]=1;Jt[139]=0;St[139]=-1;Ot[139]=0;kt[139]=0;Nt[139]=1;Lt[139]=0;Rt[139]=1;At[98]=0;Tt[98]=-1;Dt[98]=0;Ft[98]=0;Bt[98]=-1;qt[98]=1;Xt[98]=1;Yt[98]=0;jt[98]=0;Gt[98]=1;zt[98]=0;Ut[98]=1;$t[98]=0;Ht[98]=1;Vt[98]=0;St[98]=-1;Ot[98]=0;kt[98]=1;At[99]=0;Tt[99]=1;Dt[99]=0;Ft[99]=0;Bt[99]=-1;qt[99]=1;Xt[99]=1;Yt[99]=0;jt[99]=0;Gt[99]=-1;zt[99]=0;Ut[99]=1;$t[99]=0;Ht[99]=-1;Vt[99]=0;St[99]=1;Ot[99]=0;kt[99]=1;Ft[38]=0;Bt[38]=-1;qt[38]=1;Xt[38]=1;Yt[38]=0;jt[38]=0;Wt[38]=0;Qt[38]=1;Jt[38]=1;$t[38]=0;Ht[38]=1;Vt[38]=0;St[38]=-1;Ot[38]=0;kt[38]=1;Nt[38]=-1;Lt[38]=0;Rt[38]=0;Ft[39]=0;Bt[39]=1;qt[39]=1;Xt[39]=-1;Yt[39]=0;jt[39]=0;Wt[39]=0;Qt[39]=-1;Jt[39]=1;$t[39]=0;Ht[39]=1;Vt[39]=0;St[39]=-1;Ot[39]=0;kt[39]=1;Nt[39]=1;Lt[39]=0;Rt[39]=0;var Gu=function(r){return[[r.bottomleft,0],[0,0],[0,r.leftbottom]]},zu=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0]]},Uu=function(r){return[[r.topright,1],[1,1],[1,r.righttop]]},Xu=function(r){return[[0,r.lefttop],[0,1],[r.topleft,1]]},Yu=function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop]]},ju=function(r){return[[r.bottomright,0],[r.bottomleft,0],[1,r.righttop],[1,r.rightbottom]]},$u=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.topleft,1],[r.topright,1]]},Hu=function(r){return[[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},w1=function(r){return[[0,0],[0,r.leftbottom],[1,r.rightbottom],[1,0]]},b1=function(r){return[[1,0],[r.bottomright,0],[r.topright,1],[1,1]]},E1=function(r){return[[1,1],[1,r.righttop],[0,r.lefttop],[0,1]]},C1=function(r){return[[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},M1=function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.leftbottom],[0,r.lefttop]]},P1=function(r){return[[r.topleft,1],[r.topright,1],[r.bottomright,0],[r.bottomleft,0]]},I1=function(){return[[0,0],[0,1],[1,1],[1,0]]},S1=function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,1],[r.topleft,1]]},O1=function(r){return[[r.topright,1],[1,1],[1,0],[0,0],[0,r.leftbottom]]},k1=function(r){return[[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[1,1]]},N1=function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,1]]},L1=function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.lefttop],[0,1],[r.topleft,1]]},R1=function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[r.topright,1]]},A1=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop]]},T1=function(r){return[[r.topright,1],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1]]},D1=function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},F1=function(r){return[[1,1],[1,r.righttop],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},B1=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[r.topleft,1],[r.topright,1]]},q1=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom]]},G1=function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},z1=function(r){return[[1,1],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},U1=function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1]]},X1=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},Y1=function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},j1=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},$1=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},H1=function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},V1=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},W1=function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},Q1=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},J1=function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},Z1=function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},ie=[],ne=[],re=[],oe=[],se=[],ae=[],ce=[],le=[];oe[1]=se[1]=18;oe[169]=se[169]=18;re[4]=ne[4]=12;re[166]=ne[166]=12;ie[16]=le[16]=4;ie[154]=le[154]=4;ae[64]=ce[64]=22;ae[106]=ce[106]=22;re[2]=ae[2]=17;oe[2]=se[2]=18;re[168]=ae[168]=17;oe[168]=se[168]=18;ie[8]=oe[8]=9;ne[8]=re[8]=12;ie[162]=oe[162]=9;ne[162]=re[162]=12;ie[32]=le[32]=4;ne[32]=ce[32]=1;ie[138]=le[138]=4;ne[138]=ce[138]=1;se[128]=le[128]=21;ae[128]=ce[128]=22;se[42]=le[42]=21;ae[42]=ce[42]=22;ne[5]=se[5]=14;ne[165]=se[165]=14;re[20]=le[20]=6;re[150]=le[150]=6;ie[80]=ae[80]=11;ie[90]=ae[90]=11;oe[65]=ce[65]=3;oe[105]=ce[105]=3;ie[160]=ae[160]=11;ne[160]=se[160]=14;ie[10]=ae[10]=11;ne[10]=se[10]=14;re[130]=le[130]=6;oe[130]=ce[130]=3;re[40]=le[40]=6;oe[40]=ce[40]=3;ne[101]=ce[101]=1;ne[69]=ce[69]=1;se[149]=le[149]=21;se[21]=le[21]=21;re[86]=ae[86]=17;re[84]=ae[84]=17;ie[89]=oe[89]=9;ie[81]=oe[81]=9;ie[96]=ce[96]=0;ne[96]=ae[96]=15;ie[74]=ce[74]=0;ne[74]=ae[74]=15;ie[24]=re[24]=8;oe[24]=le[24]=7;ie[146]=re[146]=8;oe[146]=le[146]=7;ne[6]=ae[6]=15;re[6]=se[6]=16;ne[164]=ae[164]=15;re[164]=se[164]=16;oe[129]=le[129]=7;se[129]=ce[129]=20;oe[41]=le[41]=7;se[41]=ce[41]=20;re[66]=ce[66]=2;oe[66]=ae[66]=19;re[104]=ce[104]=2;oe[104]=ae[104]=19;ie[144]=se[144]=10;ae[144]=le[144]=23;ie[26]=se[26]=10;ae[26]=le[26]=23;ne[36]=le[36]=5;re[36]=ce[36]=2;ne[134]=le[134]=5;re[134]=ce[134]=2;ie[9]=se[9]=10;ne[9]=oe[9]=13;ie[161]=se[161]=10;ne[161]=oe[161]=13;ne[37]=le[37]=5;se[37]=ce[37]=20;ne[133]=le[133]=5;se[133]=ce[133]=20;re[148]=se[148]=16;ae[148]=le[148]=23;re[22]=se[22]=16;ae[22]=le[22]=23;ie[82]=re[82]=8;oe[82]=ae[82]=19;ie[88]=re[88]=8;oe[88]=ae[88]=19;ie[73]=ce[73]=0;ne[73]=oe[73]=13;ie[97]=ce[97]=0;ne[97]=oe[97]=13;ie[145]=oe[145]=9;se[145]=le[145]=21;ie[25]=oe[25]=9;se[25]=le[25]=21;ne[70]=ce[70]=1;re[70]=ae[70]=17;ne[100]=ce[100]=1;re[100]=ae[100]=17;ie[34]=oe[34]=9;ne[34]=re[34]=12;se[34]=le[34]=21;ae[34]=ce[34]=22;ie[136]=le[136]=4;ne[136]=ce[136]=1;re[136]=ae[136]=17;oe[136]=se[136]=18;ie[35]=le[35]=4;ne[35]=re[35]=12;oe[35]=se[35]=18;ae[35]=ce[35]=22;ie[153]=le[153]=4;oe[153]=se[153]=18;ne[102]=re[102]=12;ae[102]=ce[102]=22;ie[155]=oe[155]=9;se[155]=le[155]=23;ne[103]=ce[103]=1;re[103]=ae[103]=17;ie[152]=le[152]=4;re[152]=ae[152]=17;oe[152]=se[152]=18;ie[156]=re[156]=8;oe[156]=se[156]=18;ae[156]=le[156]=23;ie[137]=le[137]=4;ne[137]=ce[137]=1;oe[137]=se[137]=18;ie[139]=le[139]=4;ne[139]=oe[139]=13;se[139]=ce[139]=20;ie[98]=oe[98]=9;ne[98]=re[98]=12;ae[98]=ce[98]=22;ie[99]=ce[99]=0;ne[99]=re[99]=12;oe[99]=ae[99]=19;ne[38]=re[38]=12;se[38]=le[38]=21;ae[38]=ce[38]=22;ne[39]=le[39]=5;re[39]=se[39]=16;ae[39]=ce[39]=22;var ot=[];ot[1]=ot[169]=Gu;ot[4]=ot[166]=zu;ot[16]=ot[154]=Uu;ot[64]=ot[106]=Xu;ot[168]=ot[2]=Yu;ot[162]=ot[8]=ju;ot[138]=ot[32]=$u;ot[42]=ot[128]=Hu;ot[5]=ot[165]=w1;ot[20]=ot[150]=b1;ot[80]=ot[90]=E1;ot[65]=ot[105]=C1;ot[160]=ot[10]=M1;ot[130]=ot[40]=P1;ot[85]=I1;ot[101]=ot[69]=S1;ot[149]=ot[21]=O1;ot[86]=ot[84]=k1;ot[89]=ot[81]=N1;ot[96]=ot[74]=L1;ot[24]=ot[146]=R1;ot[6]=ot[164]=A1;ot[129]=ot[41]=T1;ot[66]=ot[104]=D1;ot[144]=ot[26]=F1;ot[36]=ot[134]=B1;ot[9]=ot[161]=q1;ot[37]=ot[133]=G1;ot[148]=ot[22]=z1;ot[82]=ot[88]=U1;ot[73]=ot[97]=X1;ot[145]=ot[25]=Y1;ot[70]=ot[100]=j1;ot[34]=function(r){return[Hu(r),ju(r)]};ot[35]=$1;ot[136]=function(r){return[$u(r),Yu(r)]};ot[153]=function(r){return[Uu(r),Gu(r)]};ot[102]=function(r){return[zu(r),Xu(r)]};ot[155]=H1;ot[103]=V1;ot[152]=function(r){return[Uu(r),Yu(r)]};ot[156]=W1;ot[137]=function(r){return[$u(r),Gu(r)]};ot[139]=Q1;ot[98]=function(r){return[ju(r),Xu(r)]};ot[99]=J1;ot[38]=function(r){return[zu(r),Hu(r)]};ot[39]=Z1;function tx(r){return(r>0)-(r<0)||+r}function Ps(r,s,o){var c=s[0]-r[0],l=s[1]-r[1],h=o[0]-s[0],f=o[1]-s[1];return tx(c*f-h*l)}function vg(r,s){var o=r.geometry.coordinates[0].map(function(f){return f[0]}),c=r.geometry.coordinates[0].map(function(f){return f[1]}),l=s.geometry.coordinates[0].map(function(f){return f[0]}),h=s.geometry.coordinates[0].map(function(f){return f[1]});return Math.max.apply(null,o)===Math.max.apply(null,l)&&Math.max.apply(null,c)===Math.max.apply(null,h)&&Math.min.apply(null,o)===Math.min.apply(null,l)&&Math.min.apply(null,c)===Math.min.apply(null,h)}function Vu(r,s){return s.geometry.coordinates[0].every(function(o){return Ui(je(o),r)})}function _g(r,s){return r[0]===s[0]&&r[1]===s[1]}var ex=function(){function r(s){this.id=r.buildId(s),this.coordinates=s,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return r.buildId=function(s){return s.join(",")},r.prototype.removeInnerEdge=function(s){this.innerEdges=this.innerEdges.filter(function(o){return o.from.id!==s.from.id})},r.prototype.removeOuterEdge=function(s){this.outerEdges=this.outerEdges.filter(function(o){return o.to.id!==s.to.id})},r.prototype.addOuterEdge=function(s){this.outerEdges.push(s),this.outerEdgesSorted=!1},r.prototype.sortOuterEdges=function(){var s=this;this.outerEdgesSorted||(this.outerEdges.sort(function(o,c){var l=o.to,h=c.to;if(l.coordinates[0]-s.coordinates[0]>=0&&h.coordinates[0]-s.coordinates[0]<0)return 1;if(l.coordinates[0]-s.coordinates[0]<0&&h.coordinates[0]-s.coordinates[0]>=0)return-1;if(l.coordinates[0]-s.coordinates[0]===0&&h.coordinates[0]-s.coordinates[0]===0)return l.coordinates[1]-s.coordinates[1]>=0||h.coordinates[1]-s.coordinates[1]>=0?l.coordinates[1]-h.coordinates[1]:h.coordinates[1]-l.coordinates[1];var f=Ps(s.coordinates,l.coordinates,h.coordinates);if(f<0)return 1;if(f>0)return-1;var p=Math.pow(l.coordinates[0]-s.coordinates[0],2)+Math.pow(l.coordinates[1]-s.coordinates[1],2),y=Math.pow(h.coordinates[0]-s.coordinates[0],2)+Math.pow(h.coordinates[1]-s.coordinates[1],2);return p-y}),this.outerEdgesSorted=!0)},r.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},r.prototype.getOuterEdge=function(s){return this.sortOuterEdges(),this.outerEdges[s]},r.prototype.addInnerEdge=function(s){this.innerEdges.push(s)},r}(),Wu=ex;var ix=function(){function r(s,o){this.from=s,this.to=o,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r.prototype.getSymetric=function(){return this.symetric||(this.symetric=new r(this.to,this.from),this.symetric.symetric=this),this.symetric},r.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},r.prototype.isEqual=function(s){return this.from.id===s.from.id&&this.to.id===s.to.id},r.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},r.prototype.toLineString=function(){return zi([this.from.coordinates,this.to.coordinates])},r.prototype.compareTo=function(s){return Ps(s.from.coordinates,s.to.coordinates,this.to.coordinates)},r}(),xg=ix;var nx=function(){function r(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return r.prototype.push=function(s){this.edges.push(s),this.polygon=this.envelope=void 0},r.prototype.get=function(s){return this.edges[s]},Object.defineProperty(r.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}
5),r.prototype.forEach=function(s){this.edges.forEach(s)},r.prototype.map=function(s){return this.edges.map(s)},r.prototype.some=function(s){return this.edges.some(s)},r.prototype.isValid=function(){return!0},r.prototype.isHole=function(){var s=this,o=this.edges.reduce(function(f,p,y){return p.from.coordinates[1]>s.edges[f].from.coordinates[1]&&(f=y),f},0),c=(o===0?this.length:o)-1,l=(o+1)%this.length,h=Ps(this.edges[c].from.coordinates,this.edges[o].from.coordinates,this.edges[l].from.coordinates);return h===0?this.edges[c].from.coordinates[0]>this.edges[l].from.coordinates[0]:h>0},r.prototype.toMultiPoint=function(){return Ol(this.edges.map(function(s){return s.from.coordinates}))},r.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var s=this.edges.map(function(o){return o.from.coordinates});return s.push(this.edges[0].from.coordinates),this.polygon=Se([s])},r.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Ul(this.toPolygon())},r.findEdgeRingContaining=function(s,o){var c=s.getEnvelope(),l,h;return o.forEach(function(f){var p=f.getEnvelope();if(h&&(l=h.getEnvelope()),!vg(p,c)&&Vu(p,c)){for(var y=s.map(function(X){return X.from.coordinates}),x=void 0,S=function(X){f.some(function($){return _g(X,$.from.coordinates)})||(x=X)},O=0,N=y;O<N.length;O++){var z=N[O];S(z)}x&&f.inside(je(x))&&(!h||Vu(l,p))&&(h=f)}}),h},r.prototype.inside=function(s){return Ui(s,this.toPolygon())},r}(),Qu=nx;function rx(r){if(!r)throw new Error("No geojson passed");if(r.type!=="FeatureCollection"&&r.type!=="GeometryCollection"&&r.type!=="MultiLineString"&&r.type!=="LineString"&&r.type!=="Feature")throw new Error("Invalid input type '"+r.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var DR=function(){function r(){this.edges=[],this.nodes={}}return r.fromGeoJson=function(s){rx(s);var o=new r;return Bn(s,function(c){Nl(c,"LineString","Graph::fromGeoJson"),Fd(c,function(l,h){if(l){var f=o.getNode(l),p=o.getNode(h);o.addEdge(f,p)}return h})}),o},r.prototype.getNode=function(s){var o=Wu.buildId(s),c=this.nodes[o];return c||(c=this.nodes[o]=new Wu(s)),c},r.prototype.addEdge=function(s,o){var c=new xg(s,o),l=c.getSymetric();this.edges.push(c),this.edges.push(l)},r.prototype.deleteDangles=function(){var s=this;Object.keys(this.nodes).map(function(o){return s.nodes[o]}).forEach(function(o){return s._removeIfDangle(o)})},r.prototype._removeIfDangle=function(s){var o=this;if(s.innerEdges.length<=1){var c=s.getOuterEdges().map(function(l){return l.to});this.removeNode(s),c.forEach(function(l){return o._removeIfDangle(l)})}},r.prototype.deleteCutEdges=function(){var s=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEac
5h(function(o){o.label===o.symetric.label&&(s.removeEdge(o.symetric),s.removeEdge(o))})},r.prototype._computeNextCWEdges=function(s){var o=this;typeof s>"u"?Object.keys(this.nodes).forEach(function(c){return o._computeNextCWEdges(o.nodes[c])}):s.getOuterEdges().forEach(function(c,l){s.getOuterEdge((l===0?s.getOuterEdges().length:l)-1).symetric.next=c})},r.prototype._computeNextCCWEdges=function(s,o){for(var c=s.getOuterEdges(),l,h,f=c.length-1;f>=0;--f){var p=c[f],y=p.symetric,x=void 0,S=void 0;p.label===o&&(x=p),y.label===o&&(S=y),!(!x||!S)&&(S&&(h=S),x&&(h&&(h.next=x,h=void 0),l||(l=x)))}h&&(h.next=l)},r.prototype._findLabeledEdgeRings=function(){var s=[],o=0;return this.edges.forEach(function(c){if(!(c.label>=0)){s.push(c);var l=c;do l.label=o,l=l.next;while(!c.isEqual(l));o++}}),s},r.prototype.getEdgeRings=function(){var s=this;this._computeNextCWEdges(),this.edges.forEach(function(c){c.label=void 0}),this._findLabeledEdgeRings().forEach(function(c){s._findIntersectionNodes(c).forEach(function(l){s._computeNextCCWEdges(l,c.label)})});var o=[];
5return this.edges.forEach(function(c){c.ring||o.push(s._findEdgeRing(c))}),o},r.prototype._findIntersectionNodes=function(s){var o=[],c=s,l=function(){var h=0;c.from.getOuterEdges().forEach(function(f){f.label===s.label&&++h}),h>1&&o.push(c.from),c=c.next};do l();while(!s.isEqual(c));return o},r.prototype._findEdgeRing=function(s){var o=s,c=new Qu;do c.push(o),o.ring=c,o=o.next;while(!s.isEqual(o));return c},r.prototype.removeNode=function(s){var o=this;s.getOuterEdges().forEach(function(c){return o.removeEdge(c)}),s.innerEdges.forEach(function(c){return o.removeEdge(c)}),delete this.nodes[s.id]},r.prototype.removeEdge=function(s){this.edges=this.edges.filter(function(o){return!o.isEqual(s)}),s.deleteEdge()},r}();var cx=fi(Ju(),1);var lx=fi(Ju(),1);var hx=fi(Og(),1);var vx=fi(qg(),1);function zg(r){for(var s=r,o=[];s.parent;)o.unshift(s),s=s.parent;return o}function xx(){return new Ug(function(r){return r.f})}var eh={search:function(r,s,o,c){r.cleanDirty(),c=c||{};var l=c.heuristic||eh.heuristics.manhattan,h=c.closest||!1,f=xx(),p=s;for(s.h=l(s,o),f.push(s);f.size()>0;){var y=f.pop();if(y===o)return zg(y);y.closed=!0;for(var x=r.neighbors(y),S=0,O=x.length;S<O;++S){var N=x[S];if(!(N.closed||N.isWall())){var z=y.g+N.getCost(y),X=N.visited;(!X||z<N.g)&&(N.visited=!0,N.parent=y,N.h=N.h||l(N,o),N.g=z,N.f=N.g+N.h,r.markDirty(N),h&&(N.h<p.h||N.h===p.h&&N.g<p.g)&&(p=N),X?f.rescoreElement(N):f.push(N))}}}return h?zg(p):[]},heuristics:{manhattan:function(r,s){var o=Math.abs(s.x-r.x),c=Math.abs(s.y-r.y);return o+c},diagonal:function(r,s){var o=1,c=Math.sqrt(2),l=Math.abs(s.x-r.x),h=Math.abs(s.y-r.y);return o*(l+h)+(c-2*o)*Math.min(l,h)}},cleanNode:function(r){r.f=0,r.g=0,r.h=0,r.visited=!1,r.closed=!1,r.parent=null}};function Ma(r,s){s=s||{},this.nodes=[],this.diagonal=!!s.diagonal,this.grid=[];for(var o=0;o<r.length;o++){this.grid[o]=[];for(var c=0,l=r[o];c<l.length;c++){var h=new $c(o,c,l[c]);this.grid[o][c]=h,this.nodes.push(h)}}this.init()}Ma.prototype.init=function(){this.dirtyNodes=[];for(var r=0;r<this.nodes.length;r++)eh.cleanNode(this.nodes[r])};Ma.prototype.cleanDirty=function(){for(var r=0;r<this.dirtyNodes.length;r++)eh.cleanNode(this.dirtyNodes[r]);this.dirtyNodes=[]};Ma.prototype.markDirty=function(r){this.dirtyNodes.push(r)};Ma.prototype.neighbors=function(r){var s=[],o=r.x,c=r.y,l=this.grid;return l[o-1]&&l[o-1][c]&&s.push(l[o-1][c]),l[o+1]&&l[o+1][c]&&s.push(l[o+1][c]),l[o]&&l[o][c-1]&&s.push(l[o][c-1]),l[o]&&l[o][c+1]&&s.push(l[o][c+1]),this.diagonal&&(l[o-1]&&l[o-1][c-1]&&s.push(l[o-1][c-1]),l[o+1]&&l[o+1][c-1]&&s.push(l[o+1][c-1]),l[o-1]&&l[o-1][c+1]&&s.push(l[o-1][c+1]),l[o+1]&&l[o+1][c+1]&&s.push(l[o+1][c+1])),s};Ma.prototype.toString=function(){for(var r=[],s=this.grid,o,c,l,h,f=0,p=s.length;f<p;f++){for(o=[],c=s[f],l=0,h=c.length;l<h;l++)o.push(c[l].weight);r.push(o.join(" "))}return r.join(`
6`)};function $c(r,s,o){this.x=r,this.y=s,this.weight=o}$c.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};$c.prototype.getCost=function(r){return r&&r.x!==this.x&&r.y!==this.y?this.weight*1.41421:this.weight};$c.prototype.isWall=function(){return this.weight===0};function Ug(r){this.content=[],this.scoreFunction=r}Ug.prototype={push:function(r){this.content.push(r),this.sinkDown(this.content.length-1)},pop:function(){var r=this.content[0],s=this.content.pop();return this.content.length>0&&(this.content[0]=s,this.bubbleUp(0)),r},remove:function(r){var s=this.content.indexOf(r),o=this.content.pop();s!==this.content.length-1&&(this.content[s]=o,this.scoreFunction(o)<this.scoreFunction(r)?this.sinkDown(s):this.bubbleUp(s))},size:function(){return this.content.length},rescoreElement:function(r){this.sinkDown(this.content.indexOf(r))},sinkDown:function(r){for(var s=this.content[r];r>0;){var o=(r+1>>1)-1,c=this.content[o];if(this.scoreFunction(s)<this.scoreFunction(c))this.content[o]=s,this.content[r]=c,r=o;else break}},bubbleUp:function(r){for(var s=this.content.length,o=this.content[r],c=this.scoreFunction(o);;){var l=r+1<<1,h=l-1,f=null,p;if(h<s){var y=this.content[h];p=this.scoreFunction(y),p<c&&(f=h)}if(l<s){var x=this.content[l],S=this.scoreFunction(x);S<(f===null?c:p)&&(f=l)}if(f!==null)this.content[r]=this.content[f],this.content[f]=o,r=f;else break}}};function ih(){this._=null}function Ss(r){r.U=r.C=r.L=r.R=r.P=r.N=null}ih.prototype={constructor:ih,insert:function(r,s){var o,c,l;if(r){if(s.P=r,s.N=r.N,r.N&&(r.N.P=s),r.N=s,r.R){for(r=r.R;r.L;)r=r.L;r.L=s}else r.R=s;o=r}else this._?(r=Xg(this._),s.P=null,s.N=r,r.P=r.L=s,o=r):(s.P=s.N=null,this._=s,o=null);
6for(s.L=s.R=null,s.U=o,s.C=!0,r=s;o&&o.C;)c=o.U,o===c.L?(l=c.R,l&&l.C?(o.C=l.C=!1,c.C=!0,r=c):(r===o.R&&(Pa(this,o),r=o,o=r.U),o.C=!1,c.C=!0,Ia(this,c))):(l=c.L,l&&l.C?(o.C=l.C=!1,c.C=!0,r=c):(r===o.L&&(Ia(this,o),r=o,o=r.U),o.C=!1,c.C=!0,Pa(this,c))),o=r.U;this._.C=!1},remove:function(r){r.N&&(r.N.P=r.P),r.P&&(r.P.N=r.N),r.N=r.P=null;var s=r.U,o,c=r.L,l=r.R,h,f;if(c?l?h=Xg(l):h=c:h=l,s?s.L===r?s.L=h:s.R=h:this._=h,c&&l?(f=h.C,h.C=r.C,h.L=c,c.U=h,h!==l?(s=h.U,h.U=r.U,r=h.R,s.L=r,h.R=l,l.U=h):(h.U=s,s=h,r=h.R)):(f=r.C,r=h),r&&(r.U=s),!f){if(r&&r.C){r.C=!1;return}do{if(r===this._)break;if(r===s.L){if(o=s.R,o.C&&(o.C=!1,s.C=!0,Pa(this,s),o=s.R),o.L&&o.L.C||o.R&&o.R.C){(!o.R||!o.R.C)&&(o.L.C=!1,o.C=!0,Ia(this,o),o=s.R),o.C=s.C,s.C=o.R.C=!1,Pa(this,s),r=this._;break}}else if(o=s.L,o.C&&(o.C=!1,s.C=!0,Ia(this,s),o=s.L),o.L&&o.L.C||o.R&&o.R.C){(!o.L||!o.L.C)&&(o.R.C=!1,o.C=!0,Pa(this,o),o=s.L),o.C=s.C,s.C=o.L.C=!1,Ia(this,s),r=this._;break}o.C=!0,r=s,s=s.U}while(!r.C);r&&(r.C=!1)}}};function Pa(r,s){var o=s,c=s.R,l=o.U;l?l.L===o?l.L=c:l.R=c:r._=c,c.U=l,o.U=c,o.R=c.L,o.R&&(o.R.U=o),c.L=o}function Ia(r,s){var o=s,c=s.L,l=o.U;l?l.L===o?l.L=c:l.R=c:r._=c,c.U=l,o.U=c,o.L=c.R,o.L&&(o.L.U=o),c.R=o}function Xg(r){for(;r.L;)r=r.L;return r}var nh=ih;function Os(r,s,o,c){var l=[null,null],h=Yi.push(l)-1;return l.left=r,l.right=s,o&&Sa(l,r,s,o),c&&Sa(l,s,r,c),bn[r.index].halfedges.push(h),bn[s.index].halfedges.push(h),l}function ks(r,s,o){var c=[s,o];return c.left=r,c}function Sa(r,s,o,c){!r[0]&&!r[1]?(r[0]=c,r.left=s,r.right=o):r.left===o?r[1]=c:r[0]=c}function wx(r,s,o,c,l){var h=r[0],f=r[1],p=h[0],y=h[1],x=f[0],S=f[1],O=0,N=1,z=x-p,X=S-y,$;if($=s-p,!(!z&&$>0)){if($/=z,z<0){if($<O)return;$<N&&(N=$)}else if(z>0){if($>N)return;$>O&&(O=$)}if($=c-p,!(!z&&$<0)){if($/=z,z<0){if($>N)return;$>O&&(O=$)}else if(z>0){if($<O)return;$<N&&(N=$)}if($=o-y,!(!X&&$>0)){if($/=X,X<0){if($<O)return;$<N&&(N=$)}else if(X>0){if($>N)return;$>O&&(O=$)}if($=l-y,!(!X&&$<0)){if($/=X,X<0){if($>N)return;$>O&&(O=$)}else if(X>0){if($<O)return;$<N&&(N=$)}return!(O>0)&&!(N<1)||(O>0&&(r[0]=[p+O*z,y+O*X]),N<1&&(r[1]=[p+N*z,y+N*X])),!0}}}}}function bx(r,s,o,c,l){var h=r[1];if(h)return!0;var f=r[0],p=r.left,y=r.right,x=p[0],S=p[1],O=y[0],N=y[1],z=(x+O)/2,X=(S+N)/2,$,I;if(N===S){if(z<s||z>=c)return;if(x>O){if(!f)f=[z,o];else if(f[1]>=l)return;h=[z,l]}else{if(!f)f=[z,l];else if(f[1]<o)return;h=[z,o]}}else if($=(x-O)/(N-S),I=X-$*z,$<-1||$>1)if(x>O){if(!f)f=[(o-I)/$,o];else if(f[1]>=l)return;h=[(l-I)/$,l]}else{if(!f)f=[(l-I)/$,l];else if(f[1]<o)return;h=[(o-I)/$,o]}else if(S<N){if(!f)f=[s,$*s+I];else if(f[0]>=c)return;h=[c,$*c+I]}else{if(!f)f=[c,$*c+I];else if(f[0]<s)return;h=[s,$*s+I]}return r[0]=f,r[1]=h,!0}function Yg(r,s,o,c){for(var l=Yi.length,h;l--;)(!bx(h=Yi[l],r,s,o,c)||!wx(h,r,s,o,c)||!(Math.abs(h[0][0]-h[1][0])>Oe||Math.abs(h[0][1]-h[1][1])>Oe))&&delete Yi[l]}function jg(r){return bn[r.index]={site:r,halfedges:[]}}function Ex(r,s){var o=r.site,c=s.left,l=s.right;return o===l&&(l=c,c=o),l?Math.atan2(l[1]-c[1],l[0]-c[0]):(o===c?(c=s[1],l=s[0]):(c=s[0],l=s[1]),Math.atan2(c[0]-l[0],l[1]-c[1]))}function rh(r,s){return s[+(s.left!==r.site)]}function Cx(r,s){return s[+(s.left===r.site)]}function $g(){for(var r=0,s=bn.length,o,c,l,h;r<s;++r)if((o=bn[r])&&(h=(c=o.halfedges).length)){var f=new Array(h),p=new Array(h);for(l=0;l<h;++l)f[l]=l,p[l]=Ex(o,Yi[c[l]]);for(f.sort(function(y,x){return p[x]-p[y]}),l=0;l<h;++l)p[l]=c[f[l]];for(l=0;l<h;++l)c[l]=p[l]}}function Hg(r,s,o,c){var l=bn.length,h,f,p,y,x,S,O,N,z,X,$,I,k=!0;for(h=0;h<l;++h)if(f=bn[h]){for(p=f.site,x=f.halfedges,y=x.length;y--;)Yi[x[y]]||x.splice(y,1);for(y=0,S=x.length;y<S;)X=Cx(f,Yi[x[y]]),$=X[0],I=X[1],O=rh(f,Yi[x[++y%S]]),N=O[0],z=O[1],(Math.abs($-N)>Oe||Math.abs(I-z)>Oe)&&(x.splice(y,0,Yi.push(ks(p,X,Math.abs($-r)<Oe&&c-I>Oe?[r,Math.abs(N-r)<Oe?z:c]:Math.abs(I-c)<Oe&&o-$>Oe?[Math.abs(z-c)<Oe?N:o,c]:Math.abs($-o)<Oe&&I-s>Oe?[o,Math.abs(N-o)<Oe?z:s]:Math.abs(I-s)<Oe&&$-r>Oe?[Math.abs(z-s)<Oe?N:r,s]:null))-1),++S);S&&(k=!1)}if(k){var T,P,Y,W=1/0;for(h=0,k=null;h<l;++h)(f=bn[h])&&(p=f.site,T=p[0]-r,P=p[1]-s,Y=T*T+P*P,Y<W&&(W=Y,k=f));if(k){var Z=[r,s],et=[r,c],E=[o,c],dt=[o,s];k.halfedges.push(Yi.push(ks(p=k.site,Z,et))-1,Yi.push(ks(p,et,E))-1,Yi.push(ks(p,E,dt))-1,Yi.push(ks(p,dt,Z))-1)}}for(h=0;h<l;++h)(f=bn[h])&&(f.halfedges.length||delete bn[h])}var Vg=[],Hc;function Mx(){Ss(this),this.x=this.y=this.arc=this.site=this.cy=null}function Bo(r){var s=r.P,o=r.N;if(!(!s||!o)){var c=s.site,l=r.site,h=o.site;if(c!==h){var f=l[0],p=l[1],y=c[0]-f,x=c[1]-p,S=h[0]-f,O=h[1]-p,N=2*(y*O-x*S);if(!(N>=-Wg)){var z=y*y+x*x,X=S*S+O*O,$=(O*z-x*X)/N,I=(y*X-S*z)/N,k=Vg.pop()||new Mx;k.arc=r,k.site=l,k.x=$+f,k.y=(k.cy=I+p)+Math.sqrt($*$+I*I),r.circle=k;for(var T=null,P=Ns._;P;)if(k.y<P.y||k.y===P.y&&k.x<=P.x)if(P.L)P=P.L;else{T=P.P;break}else if(P.R)P=P.R;else{T=P;break}Ns.insert(T,k),T||(Hc=k)}}}}function qo(r){var s=r.circle;s&&(s.P||(Hc=s.N),Ns.remove(s),Vg.push(s),Ss(s),r.circle=null)}var Jg=[];function Px(){Ss(this),this.edge=this.site=this.circle=null}function Qg(r){var s=Jg.pop()||new Px;return s.site=r,s}function oh(r){qo(r),Go.remove(r),Jg.push(r),Ss(r)}
6function Zg(r){var s=r.circle,o=s.x,c=s.cy,l=[o,c],h=r.P,f=r.N,p=[r];oh(r);for(var y=h;y.circle&&Math.abs(o-y.circle.x)<Oe&&Math.abs(c-y.circle.cy)<Oe;)h=y.P,p.unshift(y),oh(y),y=h;p.unshift(y),qo(y);for(var x=f;x.circle&&Math.abs(o-x.circle.x)<Oe&&Math.abs(c-x.circle.cy)<Oe;)f=x.N,p.push(x),oh(x),x=f;p.push(x),qo(x);var S=p.length,O;for(O=1;O<S;++O)x=p[O],y=p[O-1],Sa(x.edge,y.site,x.site,l);y=p[0],x=p[S-1],x.edge=Os(y.site,x.site,null,l),Bo(y),Bo(x)}function Kg(r){for(var s=r[0],o=r[1],c,l,h,f,p=Go._;p;)if(h=t0(p,o)-s,h>Oe)p=p.L;else if(f=s-Ix(p,o),f>Oe){if(!p.R){c=p;break}p=p.R}else{h>-Oe?(c=p.P,l=p):f>-Oe?(c=p,l=p.N):c=l=p;break}jg(r);var y=Qg(r);if(Go.insert(c,y),!(!c&&!l)){if(c===l){qo(c),l=Qg(c.site),Go.insert(y,l),y.edge=l.edge=Os(c.site,y.site),Bo(c),Bo(l);return}if(!l){y.edge=Os(c.site,y.site);return}qo(c),qo(l);var x=c.site,S=x[0],O=x[1],N=r[0]-S,z=r[1]-O,X=l.site,$=X[0]-S,I=X[1]-O,k=2*(N*I-z*$),T=N*N+z*z,P=$*$+I*I,Y=[(I*T-z*P)/k+S,(N*P-$*T)/k+O];Sa(l.edge,x,X,Y),y.edge=Os(x,r,null,Y),l.edge=Os(r,X,null,Y),Bo(c),Bo(l)}}function t0(r,s){var o=r.site,c=o[0],l=o[1],h=l-s;if(!h)return c;var f=r.P;if(!f)return-1/0;o=f.site;var p=o[0],y=o[1],x=y-s;if(!x)return p;var S=p-c,O=1/h-1/x,N=S/x;return O?(-N+Math.sqrt(N*N-2*O*(S*S/(-2*x)-y+x/2+l-h/2)))/O+c:(c+p)/2}function Ix(r,s){var o=r.N;if(o)return t0(o,s);var c=r.site;return c[1]===s?c[0]:1/0}var Oe=1e-6,Wg=1e-12,Go,bn,Ns,Yi;function Sx(r,s,o){return(r[0]-o[0])*(s[1]-r[1])-(r[0]-s[0])*(o[1]-r[1])}function Ox(r,s){return s[1]-r[1]||s[0]-r[0]}function Vc(r,s){var o=r.sort(Ox).pop(),c,l,h;for(Yi=[],bn=new Array(r.length),Go=new nh,Ns=new nh;;)if(h=Hc,o&&(!h||o[1]<h.y||o[1]===h.y&&o[0]<h.x))(o[0]!==c||o[1]!==l)&&(Kg(o),c=o[0],l=o[1]),o=r.pop();else if(h)Zg(h.arc);else break;if($g(),s){var f=+s[0][0],p=+s[0][1],y=+s[1][0],x=+s[1][1];Yg(f,p,y,x),Hg(f,p,y,x)}this.edges=Yi,this.cells=bn,Go=Ns=Yi=bn=null}Vc.prototype={constructor:Vc,polygons:function(){var r=this.edges;return this.cells.map(function(s){var o=s.halfedges.map(function(c){return rh(s,r[c])});return o.data=s.site.data,o})},triangles:function(){var r=[],s=this.edges;return this.cells.forEach(function(o,c){if(p=(h=o.halfedges).length)for(var l=o.site,h,f=-1,p,y,x=s[h[p-1]],S=x.left===l?x.right:x.left;++f<p;)y=S,x=s[h[f]],S=x.left===l?x.right:x.left,y&&S&&c<y.index&&c<S.index&&Sx(l,y,S)<0&&r.push([l.data,y.data,S.data])}),r},links:function(){return this.edges.filter(function(r){return r.right}).map(function(r){return{source:r.left.data,target:r.right.data}})},find:function(r,s,o){for(var c=this,l,h=c._found||0,f=c.cells.length,p;!(p=c.cells[h]);)if(++h>=f)return null;var y=r-p.site[0],x=s-p.site[1],S=y*y+x*x;
6do p=c.cells[l=h],h=null,p.halfedges.forEach(function(O){var N=c.edges[O],z=N.left;if(!((z===p.site||!z)&&!(z=N.right))){var X=r-z[0],$=s-z[1],I=X*X+$*$;I<S&&(S=I,h=z.index)}});while(h!==null);return c._found=l,o==null||S<=o*o?p.site:null}};var n0=fi(Ls(),1);function Fx(r,s){var o=Ii(r),c=Ii(s),l=r.properties||{},h=n0.default.difference(o.coordinates,c.coordinates);return h.length===0?null:h.length===1?Se(h[0],l):Ir(h,l)}var ch=Fx;var wh=fi(o0(),1);function On(){return new Jc}function Jc(){this.reset()}Jc.prototype={constructor:Jc,reset:function(){this.s=this.t=0},add:function(r){s0(Qc,r,this.t),s0(this,Qc.s,this.s),this.s?this.t+=Qc.t:this.s=Qc.t},valueOf:function(){return this.s}};var Qc=new Jc;function s0(r,s,o){var c=r.s=s+o,l=c-s,h=c-l;r.t=s-h+(o-l)}var ye=1e-6;var Ce=Math.PI,ki=Ce/2,Zc=Ce/4,Nr=Ce*2,zo=180/Ce,kn=Ce/180,li=Math.abs,fr=Math.atan,Nn=Math.atan2,ue=Math.cos;var Kc=Math.exp;var Oa=Math.log;var It=Math.sin;var nn=Math.sqrt,ka=Math.tan;function lh(r){return r>1?0:r<-1?Ce:Math.acos(r)}function En(r){return r>1?ki:r<-1?-ki:Math.asin(r)}function pr(){}var Bx=On(),kT=On();function Uo(r){var s=r[0],o=r[1],c=ue(o);return[c*ue(s),c*It(s),It(o)]}function Na(r,s){return[r[1]*s[2]-r[2]*s[1],r[2]*s[0]-r[0]*s[2],r[0]*s[1]-r[1]*s[0]]}function La(r){var s=nn(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=s,r[1]/=s,r[2]/=s}var GT=On();function c0(r,s){return[r>Ce?r-Nr:r<-Ce?r+Nr:r,s]}c0.invert=c0;function uh(){var r=[],s;return{point:function(o,c){s.push([o,c])},lineStart:function(){r.push(s=[])},lineEnd:pr,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var o=r;return r=[],s=null,o}}}function hh(r,s){return li(r[0]-s[0])<ye&&li(r[1]-s[1])<ye}function tl(r,s,o,c){this.x=r,this.z=s,this.o=o,this.e=c,this.v=!1,this.n=this.p=null}function dh(r,s,o,c,l){var h=[],f=[],p,y;if(r.forEach(function(X){if(!(($=X.length-1)<=0)){var $,I=X[0],k=X[$],T;if(hh(I,k)){for(l.lineStart(),p=0;p<$;++p)l.point((I=X[p])[0],I[1]);l.lineEnd();return}h.push(T=new tl(I,X,null,!0)),f.push(T.o=new tl(I,null,T,!1)),h.push(T=new tl(k,X,null,!1)),f.push(T.o=new tl(k,null,T,!0))}}),!!h.length){for(f.sort(s),l0(h),l0(f),p=0,y=f.length;p<y;++p)f[p].e=o=!o;for(var x=h[0],S,O;;){for(var N=x,z=!0;N.v;)if((N=N.n)===x)return;S=N.z,l.lineStart();do{if(N.v=N.o.v=!0,N.e){if(z)for(p=0,y=S.length;p<y;++p)l.point((O=S[p])[0],O[1]);else c(N.x,N.n.x,1,l);N=N.n}else{if(z)for(S=N.p.z,p=S.length-1;p>=0;--p)l.point((O=S[p])[0],O[1]);else c(N.x,N.p.x,-1,l);N=N.p}N=N.o,S=N.z,z=!z}while(!N.v);l.lineEnd()}}}function l0(r){if(s=r.length){for(var s,o=0,c=r[0],l;++o<s;)c.n=l=r[o],l.p=c,c=l;c.n=l=r[0],l.p=c}}function go(r,s){return r<s?-1:r>s?1:r>=s?0:NaN}function fh(r){return r.length===1&&(r=zx(r)),{left:function(s,o,c,l){for(c==null&&(c=0),l==null&&(l=s.length);c<l;){var h=c+l>>>1;r(s[h],o)<0?c=h+1:l=h}return c},right:function(s,o,c,l){for(c==null&&(c=0),l==null&&(l=s.length);c<l;){var h=c+l>>>1;r(s[h],o)>0?l=h:c=h+1}return c}}}function zx(r){return function(s,o){return go(r(s),o)}}var u0=fh(go),Ux=u0.right,Xx=u0.left;var h0=Array.prototype,jx=h0.slice,$x=h0.map;var L4=Math.sqrt(50),R4=Math.sqrt(10),A4=Math.sqrt(2);function il(r){for(var s=r.length,o,c=-1,l=0,h,f;++c<s;)l+=r[c].length;for(h=new Array(l);--s>=0;)for(f=r[s],o=f.length;--o>=0;)h[--l]=f[o];return h}var tw=1e9,yF=-tw;var ph=On();function mh(r,s){var o=s[0],c=s[1],l=[It(o),-ue(o),0],h=0,f=0;ph.reset();for(var p=0,y=r.length;p<y;++p)if(S=(x=r[p]).length)for(var x,S,O=x[S-1],N=O[0],z=O[1]/2+Zc,X=It(z),$=ue(z),I=0;I<S;++I,N=T,X=Y,$=W,O=k){var k=x[I],T=k[0],P=k[1]/2+Zc,Y=It(P),W=ue(P),Z=T-N,et=Z>=0?1:-1,E=et*Z,dt=E>Ce,wt=X*Y;if(ph.add(Nn(wt*et*It(E),$*W+wt*ue(E))),h+=dt?Z+et*Nr:Z,dt^N>=o^T>=o){var yt=Na(Uo(O),Uo(k));La(yt);var L=Na(l,yt);La(L);var Le=(dt^Z>=0?-1:1)*En(L[2]);(c>Le||c===Le&&(yt[0]||yt[1]))&&(f+=dt^Z>=0?1:-1)}}return(h<-ye||h<ye&&ph<-ye)^f&1}var IF=On();var $F=On(),HF=On();var nw=1/0;var QF=-nw;function gh(r){this._context=r}gh.prototype={_radius:4.5,pointRadius:function(r){return this._radius=r,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(r,s){switch(this._point){case 0:{this._context.moveTo(r,s),this._point=1;break}case 1:{this._context.lineTo(r,s);break}default:{this._context.moveTo(r+this._radius,s),this._context.arc(r,s,this._radius,0,Nr);break}}},result:pr};var s6=On();function yh(){this._string=[]}yh.prototype={_radius:4.5,_circle:p0(4.5),pointRadius:function(r){return(r=+r)!==this._radius&&(this._radius=r,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(r,s){switch(this._point){case 0:{this._string.push("M",r,",",s),this._point=1;break}case 1:{this._string.push("L",r,",",s);break}default:{this._circle==null&&(this._circle=p0(this._radius)),this._string.push("M",r,",",s,this._circle);break}}},result:function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}else return null}};function p0(r){return"m0,"+r+"a"+r+","+r+" 0 1,1 0,"+-2*r+"a"+r+","+r+" 0 1,1 0,"+2*r+"z"}function vh(r,s,o,c){return function(l,h){var f=s(h),p=l.invert(c[0],c[1]),y=uh(),x=s(y),S=!1,O,N,z,X={point:$,lineStart:k,lineEnd:T,polygonStart:function(){X.point=P,X.lineStart=Y,X.lineEnd=W,N=[],O=[]},polygonEnd:function(){X.point=$,X.lineStart=k,X.lineEnd=T,N=il(N);var Z=mh(O,p);N.length?(S||(h.polygonStart(),S=!0),dh(N,sw,Z,o,h)):Z&&(S||(h.polygonStart(),S=!0),h.lineStart(),o(null,null,1,h),h.lineEnd()),S&&(h.polygonEnd(),S=!1),N=O=null},sphere:function(){h.polygonStart(),h.lineStart(),o(null,null,1,h),h.lineEnd(),h.polygonEnd()}};function $(Z,et){var E=l(Z,et);r(Z=E[0],et=E[1])&&h.point(Z,et)}function I(Z,et){var E=l(Z,et);f.point(E[0],E[1])}function k(){X.point=I,f.lineStart()}function T(){X.point=$,f.lineEnd()}function P(Z,et){z.push([Z,et]);var E=l(Z,et);x.point(E[0],E[1])}function Y(){x.lineStart(),z=[]}function W(){P(z[0][0],z[0][1]),x.lineEnd();var Z=x.clean(),et=y.result(),E,dt=et.length,wt,yt,L;
vendor: 2,530 bytes, line 6
6if(z.pop(),O.push(z),z=null,!!dt){if(Z&1){if(yt=et[0],(wt=yt.length-1)>0){for(S||(h.polygonStart(),S=!0),h.lineStart(),E=0;E<wt;++E)h.point((L=yt[E])[0],L[1]);h.lineEnd()}return}dt>1&&Z&2&&et.push(et.pop().concat(et.shift())),N.push(et.filter(ow))}}return X}}function ow(r){return r.length>1}function sw(r,s){return((r=r.x)[0]<0?r[1]-ki-ye:ki-r[1])-((s=s.x)[0]<0?s[1]-ki-ye:ki-s[1])}var aw=vh(function(){return!0},cw,uw,[-Ce,-ki]);function cw(r){var s=NaN,o=NaN,c=NaN,l;return{lineStart:function(){r.lineStart(),l=1},point:function(h,f){var p=h>0?Ce:-Ce,y=li(h-s);li(y-Ce)<ye?(r.point(s,o=(o+f)/2>0?ki:-ki),r.point(c,o),r.lineEnd(),r.lineStart(),r.point(p,o),r.point(h,o),l=0):c!==p&&y>=Ce&&(li(s-c)<ye&&(s-=c*ye),li(h-p)<ye&&(h-=p*ye),o=lw(s,o,h,f),r.point(c,o),r.lineEnd(),r.lineStart(),r.point(p,o),l=0),r.point(s=h,o=f),c=p},lineEnd:function(){r.lineEnd(),s=o=NaN},clean:function(){return 2-l}}}function lw(r,s,o,c){var l,h,f=It(r-o);return li(f)>ye?fr((It(s)*(h=ue(c))*It(o)-It(c)*(l=ue(s))*It(r))/(l*h*f)):(s+c)/2}function uw(r,s,o,c){var l;if(r==null)l=o*ki,c.point(-Ce,l),c.point(0,l),c.point(Ce,l),c.point(Ce,0),c.point(Ce,-l),c.point(0,-l),c.point(-Ce,-l),c.point(-Ce,0),c.point(-Ce,l);else if(li(r[0]-s[0])>ye){var h=r[0]<s[0]?Ce:-Ce;l=o*h/2,c.point(-h,l),c.point(0,l),c.point(h,l)}else c.point(s[0],s[1])}function nl(r){return function(s){var o=new _h;for(var c in r)o[c]=r[c];return o.stream=s,o}}function _h(){}_h.prototype={constructor:_h,point:function(r,s){this.stream.point(r,s)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var H6=ue(30*kn);var aB=nl({point:function(r,s){this.stream.point(r*kn,s*kn)}});function rl(r){return function(s,o){var c=ue(s),l=ue(o),h=r(c*l);return[h*l*It(s),h*It(o)]}}function Lr(r){return function(s,o){var c=nn(s*s+o*o),l=r(c),h=It(l),f=ue(l);return[Nn(s*h,c*f),En(c&&o*h/c)]}}var w0=rl(function(r){return nn(2/(1+r))});w0.invert=Lr(function(r){return 2*En(r/2)});var b0=rl(function(r){return(r=lh(r))&&r/It(r)});b0.invert=Lr(function(r){return r});function xh(r,s){return[r,Oa(ka((ki+s)/2))]}xh.invert=function(r,s){return[r,2*fr(Kc(s))-ki]};function ol(r,s){return[r,s]}ol.invert=ol;function E0(r,s){var o=ue(s),c=ue(r)*o;return[o*It(r)/c,It(s)/c]}E0.invert=Lr(fr);function C0(r,s){var o=s*s,c=o*o;return[r*(.8707-.131979*o+c*(-.013791+c*(.003971*o-.001529*c))),s*(1.007226+o*(.015085+c*(-.04447
65+.028874*o-.005916*c)))]}C0.invert=function(r,s){var o=s,c=25,l;do{var h=o*o,f=h*h;o-=l=(o*(1.007226+h*(.015085+f*(-.044475+.028874*h-.005916*f)))-s)/(1.007226+h*(.015085*3+f*(-.044475*7+.028874*9*h-.005916*11*f)))}while(li(l)>ye&&--c>0);return[r/(.8707+(h=o*o)*(-.131979+h*(-.013791+h*h*h*(.003971-.001529*h)))),o]};function M0(r,s){return[ue(s)*It(r),It(s)]}M0.invert=Lr(En);function P0(r,s){var o=ue(s),c=1+ue(r)*o;return[o*It(r)/c,It(s)/c]}P0.invert=Lr(function(r){return 2*fr(r)});function I0(r,s){return[Oa(ka((ki+s)/2)),-r]}I0.invert=function(r,s){return[-s,2*fr(Kc(r))-ki]};var gw=fi(Ls(),1);var yw=fi(Ls(),1);var _w=fi(Ls(),1);var xw=fi(Ls(),1);var k0=(()=>{class r{constructor(o){this._localStorage=o,this.coordinateSubject=new $h(null),this.coordinate$=this.coordinateSubject.asObservable();let c=JSON.parse(this._localStorage.getItem("coordinates")||"null");c&&this.coordinateSubject.next(c)}updateCoordinate(o){this._localStorage.setItem("coordinates",JSON.stringify(o)),this.coordinateSubject.next(o)}static{this.\u0275fac=function(c){return new(c||r)(hr(xd))}}static{this.\u0275prov=ss({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N0=(()=>{class r{constructor(o){this.http=o,this.OVERPASS_API="https://overpass-api.de/api/interpreter",this.OVERPASS_APIS=["https://overpass-api.de/api/interpreter","https://overpass.kumi.systems/api/interpreter","https://lz4.overpass-api.de/api/interpreter"],this.OVERPASS_TIMEOUT=15}getBoundingBox(o){if(console.log("\u{1F50D} [OverpassService] getBoundingBox - GeoJSON recibido:",o),!o||!o.features||o.features.length===0)return console.warn("\u26A0\uFE0F [OverpassService] GeoJSON vac\xEDo o sin features"),null;try{let c=Ki(o);return console.log("\u2705 [OverpassService] Bounding box calculado:",c),c}catch(c){return console.error("\u274C [OverpassService] Error calculando bounding box:",c),null}}buildOverpassQuery(o){let{amenity:c=[],bbox:l}=o;if(!l)throw new Error("Bounding box es requerido");let h="";c.length>0?h=c.map(y=>`["amenity"="${y}"]`).join("|"):h="";let f=`[out:json][timeout:${this.OVERPASS_TIMEOUT}];
7(`;return c.length>0?c.forEach(p=>{f+=`
8  node["amenity"="${p}"](${l[1]},${l[0]},${l[3]},${l[2]});`}):f+=`
9  node(${l[1]},${l[0]},${l[3]},${l[2]});`,f+=`
10);
11out;`,console.log("\u{1F4DD} [OverpassService] Query construida:",f),console.log("\u{1F4DD} [OverpassService] Bbox usado:",l,`(minLat: ${l[1]}, minLon: ${l[0]}, maxLat: ${l[3]}, maxLon: ${l[2]})`),f}queryPOIs(o){if(!o.bbox)return pi([]);let c;try{c=this.buildOverpassQuery(o)}catch(l){return console.error("Error construyendo query Overpass:",l),pi([])}return this.queryPOIsWithFallback(c,0)}queryPOIsWithFallback(o,c){if(c>=this.OVERPASS_APIS.length)return console.error("\u274C [OverpassService] Todos los endpoints fallaron"),pi([]);let l=this.OVERPASS_APIS[c],h=new hs({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});return this.http.post(l,`data=${encodeURIComponent(o)}`,{headers:h}).pipe(ns(2e4),rs(f=>!f||!f.elements?[]:f.elements.map(p=>{if(p.type!=="node")return null;let y=p.lat,x=p.lon;return!y||!x?null:{type:p.type,id:p.id,lat:y,lon:x,tags:p.tags||{}}}).filter(p=>p!==null)),os(f=>(console.warn(`\u26A0\uFE0F [OverpassService] Endpoint ${l} fall\xF3 (${f?.status||f?.name||"unknown"}), probando siguiente...`),this.queryPOIsWithFallback(o,c+1))))}getSchools(o){console.log("\u{1F3EB} [OverpassService] getSchools - Iniciando b\xFAsqueda de colegios"),console.log("\u{1F3EB} [OverpassService] GeoJSON recibido:",o);let c=this.getBoundingBox(o);return c?(console.log("\u{1F50D} [OverpassService] Buscando colegios con amenities: school, kindergarten, university, college"),this.queryPOIs({amenity:["school","kindergarten","university","college"],bbox:c})):(console.warn("\u26A0\uFE0F [OverpassService] No se pudo calcular bounding box, retornando array vac\xEDo"),pi([]))}getBanks(o){console.log("\u{1F3E6} [OverpassService] getBanks - Iniciando b\xFAsqueda de bancos"),console.log("\u{1F3E6} [OverpassService] GeoJSON recibido:",o);let c=this.getBoundingBox(o);return c?(console.log("\u{1F50D} [OverpassService] Buscando bancos con amenities: bank, atm"),this.queryPOIs({amenity:["bank","atm"],bbox:c})):(console.warn("\u26A0\uFE0F [OverpassService] No se pudo calcular bounding box, retornando array vac\xEDo"),pi([]))}getComisarias(o){console.log("\u{1F694} [OverpassService] getComisarias - Iniciando b\xFAsqueda de comisar\xEDas"),console.log("\u{1F694} [OverpassService] GeoJSON recibido:",o);let c=this.getBoundingBox(o);return c?(console.log("\u{1F50D} [OverpassService] Buscando comisar\xEDas con amenities: police"),this.queryPOIs({amenity:["police"],bbox:c})):(console.warn("\u26A0\uFE0F [OverpassService] No se pudo calcular bounding box, retornando array vac\xEDo"),pi([]))}getSupermercados(o){console.log("\u{1F6D2} [OverpassService] getSupermercados - Iniciando b\xFAsqueda de supermercados"),console.log("\u{1F6D2} [OverpassService] GeoJSON recibido:",o);let c=this.getBoundingBox(o);if(!c)return console.warn("\u26A0\uFE0F [OverpassService] No se pudo calcular bounding box, retornando array vac\xEDo"),pi([]);console.log("\u{1F50D} [OverpassService] Buscando supermercados con shop: supermarket");let l=`[out:json][timeout:${this.OVERPASS_TIMEOUT}];
12(
13  node["shop"="supermarket"](${c[1]},${c[0]},${c[3]},${c[2]});
14);
15out;`,h=new hs({"Content-Type":"application/x-www-form-urlencoded"});return this.http.post(this.OVERPASS_API,`data=${encodeURIComponent(l)}`,{headers:h}).pipe(ns(2e4),Qs(1),rs(f=>{console.log("\u{1F6D2} [OverpassService] Respuesta de Overpass API:",f);let p=f.elements.map(y=>{if(y.type!=="node")return null;let x=y.lat,S=y.lon;return!x||!S||isNaN(x)||isNaN(S)?null:{type:y.type,id:y.id,lat:x,lon:S,tags:y.tags||{}}}).filter(y=>y!==null);return console.log("\u{1F6D2} [OverpassService] POIs procesados:",p.length),p}),os(f=>(console.error("\u274C [OverpassService] Error consultando Overpass API:",f),(f.status===504||f.name==="TimeoutError")&&console.warn("\u26A0\uFE0F [OverpassService] Timeout en Overpass API."),pi([]))))}getClinicas(o){console.log("\u{1F3E5} [OverpassService] getClinicas - Iniciando b\xFAsqueda de cl\xEDnicas");let c=this.getBoundingBox(o);return c?this.queryPOIs({amenity:["clinic"],bbox:c}):pi([])}getCentrosMedicos(o){console.log("\u{1F3E5} [OverpassService] getCentrosMedicos - Iniciando b\xFAsqueda de centros m\xE9dicos");let c=this.getBoundingBox(o);if(!c)return pi([]);let l=`[out:json][timeout:${this.OVERPASS_TIMEOUT}];
16(
17  node["amenity"="doctors"](${c[1]},${c[0]},${c[3]},${c[2]});
18  node["healthcare"="centre"](${c[1]},${c[0]},${c[3]},${c[2]});
19);
20out;`,h=new hs({"Content-Type":"application/x-www-form-urlencoded"});return this.http.post(this.OVERPASS_API,`data=${encodeURIComponent(l)}`,{headers:h}).pipe(ns(2e4),Qs(1),rs(f=>!f||!f.elements?[]:f.elements.map(p=>{if(p.type!=="node")return null;let y=p.lat,x=p.lon;return!y||!x||isNaN(y)||isNaN(x)?null:{type:p.type,id:p.id,lat:y,lon:x,tags:p.tags||{}}}).filter(p=>p!==null)),os(f=>(console.error("\u274C [OverpassService] Error consultando Overpass API:",f),pi([]))))}getHospitales(o){console.log("\u{1F3E5} [OverpassService] getHospitales - Iniciando b\xFAsqueda de hospitales");let c=this.getBoundingBox(o);return c?this.queryPOIs({amenity:["hospital"],bbox:c}):pi([])}getServiciosDeSalud(o){console.log("\u{1F3E5} [OverpassService] getServiciosDeSalud - Iniciando b\xFAsqueda de servicios de salud");let c=this.getBoundingBox(o);if(!c)return pi([]);let l=`[out:json][timeout:${this.OVERPASS_TIMEOUT}];
21(
22  node["healthcare"](${c[1]},${c[0]},${c[3]},${c[2]});
23);
24out;`,h=new hs({"Content-Type":"application/x-www-form-urlencoded"});return this.http.post(this.OVERPASS_API,`data=${encodeURIComponent(l)}`,{headers:h}).pipe(ns(2e4),Qs(1),rs(f=>!f||!f.elements?[]:f.elements.map(p=>{if(p.type!=="node")return null;let y=p.lat,x=p.lon;return!y||!x||isNaN(y)||isNaN(x)?null:{type:p.type,id:p.id,lat:y,lon:x,tags:p.tags||{}}}).filter(p=>p!==null)),os(f=>(console.error("\u274C [OverpassService] Error consultando Overpass API:",f),pi([]))))}getCajerosAutomaticos(o){console.log("\u{1F3E7} [OverpassService] getCajerosAutomaticos - Iniciando b\xFAsqueda de cajeros autom\xE1ticos");let c=this.getBoundingBox(o);return c?this.queryPOIs({amenity:["atm"],bbox:c}):pi([])}getBomberos(o){console.log("\u{1F692} [OverpassService] getBomberos - Iniciando b\xFAsqueda de bomberos");let c=this.getBoundingBox(o);return c?this.queryPOIs({amenity:["fire_station"],bbox:c}):pi([])}getMallChino(o){console.log("\u{1F6CD}\uFE0F [OverpassService] getMallChino - Iniciando b\xFAsqueda de malls chinos");let c=this.getBoundingBox(o);if(!c)return pi([]);let l=`[out:json][timeout:${this.OVERPASS_TIMEOUT}];
25(
26  node["shop"="shopping_centre"](${c[1]},${c[0]},${c[3]},${c[2]});
27  node["shop"="mall"](${c[1]},${c[0]},${c[3]},${c[2]});
28);
29out;`,h=new hs({"Content-Type":"application/x-www-form-urlencoded"});return this.http.post(this.OVERPASS_API,`data=${encodeURIComponent(l)}`,{headers:h}).pipe(ns(2e4),Qs(1),rs(f=>{if(!f||!f.elements)return[];let p=f.elements.map(y=>{if(y.type!=="node")return null;let x=y.lat,S=y.lon;return!x||!S?null:{type:y.type,id:y.id,lat:x,lon:S,tags:y.tags||{}}}).filter(y=>y!==null).filter(y=>{if(!y||!y.tags)return!1;let x=(y.tags.name||"").toLowerCase(),S=(y.tags["name:en"]||"").toLowerCase(),O=(y.tags.alt_name||"").toLowerCase();return x.includes("chino")||x.includes("chinese")||S.includes("chino")||S.includes("chinese")||O.includes("chino")||O.includes("chinese")});return console.log(`\u{1F6CD}\uFE0F [OverpassService] Malls chinos filtrados: ${p.length} de ${f.elements.length} totales`),p}),os(f=>(console.error("\u274C [OverpassService] Error consultando Overpass API para malls chinos:",f),pi([]))))}poisToGeoJSON(o,c="#63e6be",l="fa-school"){console.log("\u{1F504} [OverpassService] Convirtiendo POIs a GeoJSON. Total POIs:",o.length);let h=o.map(p=>({type:"Feature",properties:ko({name:p.tags.name||"Sin nombre",amenity:p.tags.amenity||"",id:p.id,type:p.type,color:c,icon:l},p.tags),geometry:{type:"Point",coordinates:[p.lon,p.lat]}})),f={type:"FeatureCollection",features:h};return console.log("\u2705 [OverpassService] GeoJSON generado:",f),console.log("\u{1F4CA} [OverpassService] Total features en GeoJSON:",h.length),f}static{this.\u0275fac=function(c){return new(c||r)(hr(id))}}static{this.\u0275prov=ss({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var L0=(()=>{class r{ngOnInit(){}static{this.\u0275fac=function(c){return new(c||r)}}static{this.\u0275cmp=lo({type:r,selectors:[["app-map-loader"]],inputs:{height:"height"},decls:5,vars:2,consts:[[1,"map-loader"],[1,"content-loader"],[1,"loaders"],[1,"text-loader"]],template:function(c,l){c&1&&(me(0,"div",0)(1,"div",1),Je(2,"span",2),me(3,"span",3),Zi(4,"Cargando Mapa..."),xe()()()),c&2&&No("height",l.height)},styles:['@charset "UTF-8";h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], h6[_ngcontent-%COMP%], p[_ngcontent-%COMP%], table[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%], tr[_ngcontent-%COMP%], span[_ngcontent-%COMP%], a[_ngcontent-%COMP%]{color:#b9b9b9;font-family:Pyme Sans,sans-serif;caret-color:transparent}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{color:#b9b9b9!important}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-ExtraLight-I6D6RJGG.ttf");font-weight:200;font-display:swap;font-style:extralight}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-Light-B5SPLMYK.ttf");font-weight:300;font-display:swap;font-style:light}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-Regular-6XQOZXLT.ttf");font-weight:400;font-display:swap;font-style:regular}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-Medium-G4SBLBRK.ttf");font-weight:500;font-display:swap;font-style:medium}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-SemiBold-763NFFIV.ttf");font-weight:600;font-display:swap;font-style:semibold}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-ExtraBold-A4MTSUSK.ttf");font-weight:800;font-display:swap;font-style:bold}.breadcrumb[_ngcontent-%COMP%]{padding:6px 0}@media only screen and (max-width: 992px){.breadcrumb[_ngcontent-%COMP%]{margin-bottom:0;padding:2px 15px}}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{display:flex;transition:.2s;color:#ffffffd5;font-weight:800;align-items:center;text-decoration:none;text-transform:uppercase}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:.85rem}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#ffffffd5;margin-top:2px;font-weight:600;font-size:.8rem;line-height:initial}@media only screen and (max-width: 992px){.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.7rem}}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover, .breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover   span[_ngcontent-%COMP%]{color:#fff}.content-body[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{padding:15px 36px;font-size:1.1rem;line-height:1.4rem}@media only screen and (max-width: 992px){.content-body[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{padding:30px 15px}}.content-body[_ngcontent-%COMP%]   .subtitle-branches[_ngcontent-%COMP%]{text-align:center;margin-bottom:20px}@media only screen and (max-width: 992px){.content-body[_ngcontent-%COMP%]   .subtitle-branches[_ngcontent-%COMP%]{font-size:1rem;line-height:1rem}}.content-body[_ngcontent-%COMP%]   .contact-information[_ngcontent-%COMP%]{padding:0 42px}@media only screen and (max-width: 992px){.content-body[_ngcontent-%COMP%]   .contact-information[_ngcontent-%COMP%]{padding:0 15px}}.content-body[_ngcontent-%COMP%]   .contact-information[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{font-weight:800;text-align:center}.column-scroll[_ngcontent-%COMP%]{z-index:99;overflow-y:scroll;height:calc(100vh - 56px)}.column-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;
29background-color:#dadada}.column-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:10px;background-color:#f1752b}.column-scroll[_ngcontent-%COMP%]::-moz-scrollbar{width:8px;background-color:#dadada}.column-scroll[_ngcontent-%COMP%]::-moz-scrollbar-thumb{border-radius:10px;background-color:#f1752b}.stripes[_ngcontent-%COMP%]{width:100%;height:10px;background-image:url("./media/stripe-overlay-UCKRDQKB.webp");background-repeat:repeat;opacity:.3;border:none;margin:20px 0}mat-sidenav[style][_ngcontent-%COMP%]{visibility:visible!important}.mat-drawer[_ngcontent-%COMP%]{transform:none!important}.loader[_ngcontent-%COMP%]{width:48px;height:48px;display:block;margin:0 30px;box-sizing:border-box;position:relative}@media only screen and (max-width: 992px){.loader[_ngcontent-%COMP%]{margin:0 22px 0 0}}.loader[_ngcontent-%COMP%]:after{content:"";width:48px;height:48px;left:0;bottom:0;position:absolute;border-radius:50% 50% 0;border:15px solid #f1752b;transform:rotate(45deg) translate(0);box-sizing:border-box;animation:_ngcontent-%COMP%_animMarker .4s ease-in-out infinite alternate}.loader[_ngcontent-%COMP%]:before{content:"";box-sizing:border-box;position:absolute;left:0;right:0;margin:auto;top:150%;width:24px;height:4px;border-radius:50%;background:rgba(0,0,0,.2);animation:_ngcontent-%COMP%_animShadow .4s ease-in-out infinite alternate}@keyframes _ngcontent-%COMP%_animMarker{0%{transform:rotate(45deg) translate(5px,5px)}to{transform:rotate(45deg) translate(-5px,-5px)}}@keyframes _ngcontent-%COMP%_animShadow{0%{transform:scale(.5)}to{transform:scale(1)}}  .mapboxgl-marker{z-index:0}  .mapboxgl-user-location-accuracy-circle{z-index:-1}.mapboxgl-marker-anchor-center[_ngcontent-%COMP%]{top:-29px!important}.breadcrumb-banner[_ngcontent-%COMP%]{bottom:7px;position:absolute;width:-webkit-fill-available}.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%], .breadcrumb-banner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#ffffffab}@media only screen and (max-width: 992px){.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%], .breadcrumb-banner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.85rem}}.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{transition:.2s;text-decoration:none}.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{color:#fff}.breadcrumb-banner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-weight:800}.distance[_ngcontent-%COMP%]{position:absolute;
29background:rgba(0,0,0,.4117647059);padding:2px 10px;right:5px;top:5px;border-radius:28px}.distance[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#fff;font-weight:600;font-size:.85rem}.visually-hidden[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}hr.stripes[_ngcontent-%COMP%]{width:80%;height:10px;opacity:.3;border:none;margin:40px 0;background-repeat:repeat;background-image:url("./media/stripe-overlay-UCKRDQKB.webp")}@media only screen and (max-width: 992px){hr.stripes[_ngcontent-%COMP%]{width:100%}}.btn-go[_ngcontent-%COMP%]{margin:0 8px;width:200px;display:flex;color:#fff;transition:.2s;overflow:hidden;position:relative;padding:12px 10px;border-radius:5px;align-items:center;text-decoration:none;justify-content:center}.btn-go[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1.3rem;margin-right:10px;color:#fff!important}.btn-go[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#fff;line-height:1rem}.btn-go[_ngcontent-%COMP%]:hover{opacity:.8}.btn-google[_ngcontent-%COMP%]{background-color:#1374e9}.btn-uber[_ngcontent-%COMP%]{background-color:#000}.banner-page[_ngcontent-%COMP%]{width:100%;position:relative;background-size:cover;background-position:center;padding:40px 0 20px;background-image:url("./media/background1-47AB4FGS.webp")}@media only screen and (max-width: 992px){.banner-page[_ngcontent-%COMP%]{padding:24px 0 8px}}.banner-page[_ngcontent-%COMP%]:before{content:"";position:absolute;bottom:0;left:0;right:0;height:100%;z-index:0;transition:.2s;background:linear-gradient(to top,#f9f9f9,rgba(0,0,0,0))}.banner-page[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{color:#4b4b4b;font-weight:700;margin-bottom:8px;position:relative;text-shadow:2px 2px 2px rgba(0,0,0,.1490196078)}@media only screen and (max-width: 992px){.banner-page[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.4rem}}.banner-page[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:#4b4b4b;font-weight:400;font-size:1.25rem;position:relative;line-height:1.6rem}@media only screen and (max-width: 992px){.banner-page[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:1rem;line-height:1.2rem}}.adsbygoogle[_ngcontent-%COMP%]{display:block;width:100%;min-height:100px}@keyframes _ngcontent-%COMP%_layers1{0%{box-shadow:0 0}90%,to{box-shadow:20px 20px 0 -4px}}@keyframes _ngcontent-%COMP%_layerTr{0%{transform:translate(0) scale(1)}to{transform:translate(-25px,-25px) scale(1)}}[_nghost-%COMP%]   .map-loader[_ngcontent-%COMP%]{position:absolute;z-index:3;width:100%;height:100%;background-color:#00000075}[_nghost-%COMP%]   .map-loader[_ngcontent-%COMP%]   .content-loader[_ngcontent-%COMP%]{top:45%;left:50%;width:100%;display:flex;position:absolute;align-items:center;flex-direction:column;transform:translate(-50%,-50%)}[_nghost-%COMP%]   .map-loader[_ngcontent-%COMP%]   .content-loader[_ngcontent-%COMP%]   .loaders[_ngcontent-%COMP%]{transform:translate(-50%,-50%);position:absolute;width:60px;height:60px;background:#f1752b;transform:rotateX(65deg) rotate(45deg);color:#ddb08d54;animation:_ngcontent-%COMP%_layers1 1s linear infinite alternate}[_nghost-%COMP%]   .map-loader[_ngcontent-%COMP%]   .content-loader[_ngcontent-%COMP%]   .loaders[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;background:rgba(236,173,119,.307);animation:_ngcontent-%COMP%_layerTr 1s linear infinite alternate}[_nghost-%COMP%]   .map-loader[_ngcontent-%COMP%]   .content-loader[_ngcontent-%COMP%]   .text-loader[_ngcontent-%COMP%]{color:#fff;margin-top:80px;font-weight:700;font-size:1.4rem}']})}}return r})();function Lw(r,s){if(r&1&&Je(0,"app-map-loader",3),r&2){let o=ve();Ie("height",o.height)}}function Rw(r,s){if(r&1){let o=ea();me(0,"button",4),Lo("click",function(){Er(o);let l=ve();return Cr(l.calculeDistance())}),Je(1,"span",5),me(2,"span",6),Zi(3,"Localizarme"),xe()()}if(r&2){let o=ve();Zs("recalculate",o.coordinate)}}function Aw(r,s){if(r&1&&(me(0,"div",31),Je(1,"i",32),me(2,"span"),Zi(3),xe()()),r&2){let o=ve().$implicit;Pt(3),Va(o.properties.amenity)}}function Tw(r,s){if(r&1&&(me(0,"div")(1,"strong"),Zi(2,"Operador:"),xe(),Zi(3),xe()),r&2){let o=ve(2).$implicit;Pt(3),Ro(" ",o.properties.operator," ")}}function Dw(r,s){if(r&1&&(me(0,"div")(1,"strong"),Zi(2,"Direcci\xF3n:"),xe(),Zi(3),xe()),r&2){let o=ve(2).$implicit;Pt(3),Ro(" ",o.properties["addr:street"]," ")}}function Fw(r,s){if(r&1&&(me(0,"div",33)(1,"div",34),Ji(2,Tw,4,1,"div",12)(3,Dw,4,1,"div",12),xe()()),r&2){let o=ve().$implicit;Pt(2),Ie("ngIf",o.properties.operator),Pt(),Ie("ngIf",o.properties["addr:street"])}}function Bw(r,s){if(r&1){let o=ea();me(0,"mgl-marker",18,19)(2,"div",20),Lo("mouseover",function(){let h=Er(o).$implicit,f=ve(3);return Cr(f.setHoverBranch("poi-"+h.properties.id))})("mouseout",function(){Er(o);let l=ve(3);return Cr(l.setHoverBranch(""))})("click",function(){let h=Er(o).$implicit,f=ve(3);return Cr(f.changeCenter(h.geometry.coordinates[0],h.geometry.coordinates[1]))}
29),Je(3,"i",21)(4,"i"),xe()(),me(5,"mgl-popup",22)(6,"div",23)(7,"div",24),Je(8,"div",25),me(9,"div",26)(10,"div",27),Je(11,"i",28),Zi(12),xe(),Ji(13,Aw,4,1,"div",29),xe()(),Ji(14,Fw,4,2,"div",30),xe()()}if(r&2){let o=s.$implicit,c=cs(1);Ie("feature",o),Wr("aria-label","POI: "+o.properties.name),Pt(2),Wr("aria-label","Punto de inter\xE9s: "+o.properties.name),Pt(),Ks("color: "+(o.properties.color||"#63e6be")),Pt(),ta("label fa "+(o.properties.icon||"fa-school")),Pt(),Ie("marker",c)("offset",25),Pt(2),No("background","linear-gradient(135deg, "+(o.properties.color||"#63e6be")+" 0%, "+(o.properties.color||"#63e6be")+"dd 100%)"),Pt(4),ta("fas "+(o.properties.icon||"fa-school")),Pt(),Ro(" ",o.properties.name||"Sin nombre"," "),Pt(),Ie("ngIf",o.properties.amenity),Pt(),Ie("ngIf",o.properties.operator||o.properties["addr:street"])}}function qw(r,s){if(r&1&&(me(0,"div",35),Zi(1),xe()),r&2){let o=s.$implicit;Pt(),Ro(" ",o.properties==null?null:o.properties.point_count," ")}}function Gw(r,s){if(r&1&&($a(0),Je(1,"mgl-geojson-source",14),me(2,"mgl-markers-for-clusters",15),Ji(3,Bw,15,16,"ng-template",16)(4,qw,2,1,"ng-template",17),xe(),Ha()),r&2){let o=ve(2);Pt(),Ie("data",o.poisGeo)("cluster",!0)("generateId",!0)("clusterRadius",15)("clusterMaxZoom",14)}}function zw(r,s){if(r&1){let o=ea();me(0,"div",20),Lo("mouseover",function(){Er(o);let l=ve().$implicit,h=ve(3);return Cr(h.setHoverBranch(l.properties.url))})("mouseout",function(){Er(o);let l=ve(4);return Cr(l.setHoverBranch(""))})("click",function(){Er(o);let l=ve().$implicit,h=ve(3);return Cr(h.changeCenter(l.properties.longitude,l.properties.latitude))}),Je(1,"i",21)(2,"i"),xe()}if(r&2){let o=ve().$implicit,c=ve(3);Zs("hover",c.hoverBranch===o.properties.url),Wr("aria-label","Icono de "+o.properties.name),Pt(),Ks("color: "+o.properties.color),Pt(),ta("label fa "+o.properties.icon)}}function Uw(r,s){if(r&1&&(me(0,"div",31),Je(1,"i",46),me(2,"span"),Zi(3),xe()()),r&2){let o=ve().$implicit;Pt(3),Va(o.properties.address)}}function Xw(r,s){if(r&1&&Je(0,"div",47),r&2){let o=ve().$implicit;Ie("innerHTML",(o.properties.description==null?null:o.properties.description.substring(0,130))+((o.properties.description==null?null:o.properties.description.length)>130?"...":""),Qh)}}function Yw(r,s){r&1&&(me(0,"div",48),Je(1,"i",32),me(2,"span"),Zi(3,"Sin descripci\xF3n disponible"),xe()())}var jw=r=>({"--colorFeria":r});function $w(r,s){if(r&1&&(me(0,"div",49),Je(1,"i"),me(2,"div",50)(3,"small"),Zi(4,"Feria"),xe(),me(5,"h6",51),Zi(6),xe()()()),r&2){let o=ve().$implicit;Ks(Mr(7,jw,o.properties.color)),No("background",o.properties.color),Pt(),ta("label fa "+o.properties.icon),Pt(5),Va(o.properties.name)}}var Hw=(r,s)=>["/",r,s],Vw=()=>[],Ww=r=>({primary:r,popup:null}),Qw=r=>({outlets:r}),R0=r=>[r];function Jw(r,s){if(r&1&&(me(0,"mgl-marker",18,38),Ji(2,zw,3,7,"div",39),xe(),me(3,"mgl-popup",22)(4,"div",23)(5,"div",24),Je(6,"div",25),me(7,"div",26)(8,"a",40),Zi(9),Je(10,"i",41),xe(),Ji(11,Uw,4,1,"div",42),xe()(),me(12,"div",33),Ji(13,Xw,1,1,"div",43)(14,Yw,4,0,"ng-template",null,44,Wa),xe()()(),Ji(16,$w,7,9,"ng-template",null,45,Wa)),r&2){let o=s.$implicit,c=cs(1),l=cs(15),h=cs(17),f=ve(3);Ie("feature",o),Wr("aria-label","Marker de "+o.properties.name),Pt(2),Ie("ngIf",!f.viewFerias)("ngIfElse",h),Pt(),Ie("marker",c)("offset",25),Pt(2),No("background-image","url("+o.properties.image+")"),Pt(3),Ie("routerLink",!f.disableLink&&o.properties.categoryUrl?Pl(13,Hw,o.properties.categoryUrl,o.properties.url):Mr(21,R0,Mr(19,Qw,Mr(17,Ww,ls(16,Vw))))),Pt(),Ro(" ",o.properties.name," "),Pt(2),as(11,f.viewFerias?-1:11),Pt(2),Ie("ngIf",o.properties.description)("ngIfElse",l)}}function Zw(r,s){if(r&1&&(me(0,"div",35),Zi(1),xe()),r&2){let o=s.$implicit;Pt(),Ro(" ",o.properties==null?null:o.properties.point_count," ")}}function Kw(r,s){if(r&1&&($a(0),Je(1,"mgl-geojson-source",36),me(2,"mgl-markers-for-clusters",37),Ji(3,Jw,18,23,"ng-template",16)(4,Zw,2,1,"ng-template",17),xe(),Ha()),r&2){let o=ve(2);Pt(),Ie("data",o.branchesGeo)("cluster",!0)("generateId",!0)("clusterRadius",15)("clusterMaxZoom",14)}}var tb=()=>[4,1],eb=r=>({"line-color":"#a43737","line-width":4,"line-dasharray":r});function ib(r,s){if(r&1&&Je(0,"mgl-layer",13),r&2){let o=ve(2);Ie("id","layer-zone")("type","line")("source",o.sourceMap)("paint",Mr(5,eb,ls(4,tb)))}}var nb=()=>({"fill-color":"#000","fill-opacity":.3});function rb(r,s){if(r&1&&Je(0,"mgl-layer",13),r&2){let o=ve(2);Ie("id","fill-zone")("type","fill")("source",o.backgroundPolygon)("paint",ls(4,nb))}}var ob=()=>({}),sb=r=>({type:"LineString",coordinates:r}),ab=(r,s)=>({type:"Feature",properties:r,geometry:s}),cb=r=>({type:"geojson",data:r}),lb=r=>({"line-color":r,"line-width":12}),ub=()=>({"line-join":"round","line-cap":"round"});function hb(r,s){if(r&1&&Je(0,"mgl-layer",54),r&2){let o=ve().$implicit;Ie("id",o.id==null?null:o.id.toString())("type","line")("source",Mr(11,cb,Pl(8,ab,ls(5,ob),Mr(6,sb,o.coordinates))))("paint",Mr(13,lb,o.type==="Bazar"?"#2bbada":"#32b352"))("layout",ls(15,ub))}}function db(r,s){if(r&1&&($a(0),Ji(1,hb,1,16,"mgl-layer",53),Ha()),r&2){let o=s.$implicit;Pt(),Ie("ngIf",o.id&&o.coordinates&&o.coordinates.length>0)}}function fb(r,s){if(r&1&&Ji(0,db,2,1,"ng-container",52),r&2){let o=ve(2);Ie("ngForOf",o.branches)}}function pb(r,s){if(r&1){let o=ea();me(0,"mgl-map",7),Lo("idle",function(){Er(o);let l=ve();return Cr(l.onIdle())}),Je(1,"mgl-control",8),me(2,"mgl-control",9,10),Lo("geolocate",function(l){Er(o);let h=ve();return Cr(h.onGeolocate(l))}),xe(),Je(4,"mgl-control",11),Ji(5,Gw,5,5,"ng-container",12)(6,Kw,5,5,"ng-container",12)(7,ib,1,7,"mgl-layer",13)(8,rb,1,5,"mgl-layer",13)(9,fb,1,1,"ng-container"),xe()}if(r&2){let o=ve();Ks(o.mapStyle),No("height",o.height||"100vh"),Ie("zoom",Mr(13,R0,o.zoom))("center",o.center)("minZoom",o.minZoom)("fitBounds",o.bounds),Pt(5),Ie("ngIf",(o.viewColegios||o.viewBancos||o.viewComisarias||o.viewSupermercados||o.viewClinicas||o.viewCentrosMedicos||o.viewHospitales||o.viewServiciosDeSalud||o.viewCajerosAutomaticos||o.viewBomberos||o.viewMallChino)&&(o.poisGeo==null||o.poisGeo.features==null?null:o.poisGeo.features.length)>0),Pt(),Ie("ngIf",(o.branchesGeo==null||o.branchesGeo.features==null?null:o.branchesGeo.features.length)>0),Pt(),as(7,o.sourceMap.data?7:-1),Pt(),as(8,o.backgroundPolygon.data?8:-1),Pt(),as(9,o.viewFerias?9:-1)}}var P9=(()=>{class r{set branches(o){this._branches=o,this.getFitBounds()}get branches(){return this._branches}constructor(o,c,l,h,f,p,y){this._platformId=o,this._document=c,this._ga4=l,this._configService=h,this._mapPymentonService=f,this._overpassService=p,this._cdr=y,this.viewFerias=!1,this.viewColegios=!1,this.viewBancos=!1,this.viewComisarias=!1,this.viewSupermercados=!1,this.viewClinicas=!1,this.viewCentrosMedicos=!1,this.viewHospitales=!1,this.viewServiciosDeSalud=!1,this.viewCajerosAutomaticos=!1,this.viewBomberos=!1,this.viewMallChino=!1,this.center=this._configService.config?.map?.centerZone,this.disableLink=!1,this._branches=[],this.hoverBranchCategory=new Jh,this.firstIdle=!0,this.minZoom=this._configService.config?.map?.minZoom,this.maxBounds=this._configService.config?.map?.maxBounds,this.mapStyle="mapbox://styles/mapbox/dark-v11",this.worldPolygon=Se([[[-180,-90],[-180,90],[180,90],[180,-90],[-180,-90]]]),this.isBrowser=Ja(o)}ngOnInit(){if(this.isBrowser){this.applyTheme(),window.addEventListener("theme-changed",()=>{this.applyTheme(),this._cdr.detectChanges()}),window.addEventListener("storage",()=>{this.applyTheme(),this._cdr.detectChanges()});let o=this._document.body;this.mutationObserver=new MutationObserver(c=>
29{c.forEach(l=>{l.type==="attributes"&&l.attributeName==="class"&&(this.applyTheme(),this._cdr.detectChanges())})}),o&&this.mutationObserver.observe(o,{attributes:!0,attributeFilter:["class"]}),this.backgroundPolygon=[],this.geojson=this._configService.config.geojson,this.sourceMap={type:"geojson",data:this.geojson},this.center=this._configService.config.map.centerZone,fetch(this.geojson).then(c=>c?.json()).then(c=>{c&&(c.features.forEach(l=>{let h;if(l.geometry.type==="Polygon"?h=l.geometry.coordinates:l.geometry.type==="GeometryCollection"&&l.geometry.geometries.forEach(f=>{f.type==="Polygon"&&(h=f.coordinates)}),h){let f=Se(h),p=ch(this.worldPolygon,f);this.backgroundPolygon={type:"geojson",data:p}}}),(this.viewColegios||this.viewBancos||this.viewComisarias||this.viewSupermercados||this.viewClinicas||this.viewCentrosMedicos||this.viewHospitales||this.viewServiciosDeSalud||this.viewCajerosAutomaticos||this.viewBomberos||this.viewMallChino)&&this.loadPOIs(c))})}this._mapPymentonService.coordinate$.subscribe(o=>this.coordinate=o)}getFitBounds(){if(this.branches.length){let c=[],l=[],h=[];this.branches.forEach(f=>{if(!f||!f.latitude||!f.longitude){console.warn("\u26A0\uFE0F Branch sin coordenadas:",f);return}if(!f.store){console.warn("\u26A0\uFE0F Branch sin store:",f);return}c.push(f.latitude),l.push(f.longitude),h.push({type:"Feature",properties:{address:f?.address||"Sin direcci\xF3n",name:f?.store?.name||"Sin nombre",url:f?.store?.url||"",latitude:f?.latitude,longitude:f?.longitude,icon:f?.store?.category?.icon||"fa-store",type:f?.store?.category?.type||"",color:f?.store?.category?.color||"#12bd41",image:f?.image?.length&&f?.image[0]?.formats?.medium,description:f?.store?.description||"",categoryUrl:f?.store?.category?.url||""},geometry:{type:"Point",coordinates:[f.longitude,f.latitude]}})}),c.length>0&&l.length>0?(this.bounds=[[Math.min(...l)-.0026,Math.min(...c)-.0026],[Math.max(...l)+.0026,Math.max(...c)+.0026]],this.branchesGeo={type:"FeatureCollection",features:h}):(console.warn("\u26A0\uFE0F No hay branches v\xE1lidas con coordenadas"),this.bounds=this.maxBounds)}else this.bounds=this.maxBounds}changeCenter(o,c){this._ga4.event("clickMarker"),this.center=[o,c],this._ga4.gtag("event","test_view",{page_title:"openMarkerFromMap",page_path:"APP",page_location:this._document.location.href})}onGeolocate(o){this._mapPymentonService.updateCoordinate({lat:o.coords.latitude,lng:o.coords.longitude})}setHoverBranch(o){this.hoverBranchCategory.emit(o)}calculeDistance(){if(this.mapComponent&&this.mapComponent.mapInstance){let c=this.mapComponent.mapInstance._controls?.find(l=>l._geolocateButton);if(c&&c.trigger){c.trigger();return}}"geolocation"in navigator?navigator.geolocation.getCurrentPosition(o=>{let c={lat:Number(o.coords.latitude),lng:Number(o.coords.longitude)};this._mapPymentonService.updateCoordinate(c),this.center=[c.lng,c.lat],this.zoom=15},o=>{console.error("Error obteniendo ubicaci\xF3n:",o);let c="No se pudo obtener tu ubicaci\xF3n.";switch(o.code){case o.PERMISSION_DENIED:c="Debes permitir el acceso a tu ubicaci\xF3n para usar esta funci\xF3n.";break;case o.POSITION_UNAVAILABLE:c="Tu ubicaci\xF3n no est\xE1 disponible en este momento.";break;case o.TIMEOUT:c="El tiempo de espera se agot\xF3 al obtener tu ubicaci\xF3n.";break}alert(c)}):alert("La geolocalizaci\xF3n no est\xE1 disponible en este navegador.")}onIdle(){this.mapLoaded=!0}ngOnDestroy(){this.mutationObserver&&this.mutationObserver.disconnect(),Ja(this._platformId)&&(window.removeEventListener("theme-changed",()=>{}),window.removeEventListener("storage",()=>{}))}applyTheme(){if(!Ja(this._platformId))return;localStorage.getItem("theme")==="light"?this.mapStyle="mapbox://styles/mapbox/light-v11":this.mapStyle="mapbox://styles/mapbox/dark-v11",setTimeout(()=>{this._cdr.detectChanges()},0)}loadPOIs(o){console.log("\u{1F5FA}\uFE0F [MapBoxComponent] loadPOIs - Iniciando carga de POIs"),console.log("\u{1F5FA}\uFE0F [MapBoxComponent] GeoJSON data recibida:",o);let c,l="#63e6be",h="fa-school",f="colegios";if(this.viewBomberos)c=this._overpassService.getBomberos(o),l="#e67e22",h="fa-fire",f="bomberos";else if(this.viewCajerosAutomaticos)c=this._overpassService.getCajerosAutomaticos(o),l="#16a085",h="fa-credit-card",f="cajeros-automaticos";else if(this.viewServiciosDeSalud)c=this._overpassService.getServiciosDeSalud(o),l="#9b59b6",h="fa-heartbeat",f="servicios-de-salud";else if(this.viewHospitales)c=this._overpassService.getHospitales(o),l="#c0392b",h="fa-hospital-alt",f="hospitales";else if(this.viewCentrosMedicos)c=this._overpassService.getCentrosMedicos(o),l="#3498db",h="fa-user-md",f="centros-medicos";else if(this.viewClinicas)c=this._overpassService.getClinicas(o),l="#e74c3c",h="fa-hospital",f="clinicas";else if(this.viewMallChino)c=this._overpassService.getMallChino(o),l="#f39c12",h="fa-store",f="mall-chino";else if(this.viewSupermercados)c=this._overpassService.getSupermercados(o),l="#f39c12",h="fa-shopping-cart",f="supermercados";else if(this.viewComisarias)c=this._overpassService.getComisarias(o),l="#1d7d5f",h="fa-shield-alt",f="comisarias";else if(this.viewBancos)c=this._overpassService.getBanks(o),l="#7885d7",h="fa-university",f="bancos";else if(this.viewColegios)c=this._overpassService.getSchools(o),l="#63e6be",h="fa-school",f="colegios";else return;c.subscribe({next:p=>{console.log("\u{1F4E5} [MapBoxComponent] POIs recibidos del servicio:",p),console.log("\u{1F4E5} [MapBoxComponent] Cantidad de POIs:",p?.length||0),p&&p.length>0?(this.poisGeo=this._overpassService.poisToGeoJSON(p,l,h),console.log("\u2705 [MapBoxComponent] POIs GeoJSON asignado a poisGeo:",this.poisGeo),console.log("\u2705 [MapBoxComponent] Features en poisGeo:",this.poisGeo?.features?.length||0),this._cdr.detectChanges(),console.log(`\u2705 [MapBoxComponent] Cargados ${p.length} puntos de inter\xE9s (${f})`)):(console.warn("\u26A0\uFE0F [MapBoxComponent] No se encontraron POIs, inicializando con array vac\xEDo"),this.poisGeo={type:"FeatureCollection",features:[]})},error:p=>{console.error("\u274C [MapBoxComponent] Error cargando POIs:",p),console.error("\u274C [MapBoxComponent] Detalles del error:",{message:p.message,status:p.status,statusText:p.statusText,error:p.error}),this.poisGeo={type:"FeatureCollection",features:[]}}})}static{this.\u0275fac=function(c){return new(c||r)(qi(Wh),qi(Qa),qi(yd),qi(wd),qi(k0),qi(N0),qi(El))}}static{this.\u0275cmp=lo({type:r,selectors:[["app-mapbox"]],viewQuery:function(c,l){if(c&1&&na(rc,5),c&2){let h;ia(h=ra())&&(l.mapComponent=h.first)}},inputs:{hoverBranch:"hoverBranch",viewFerias:"viewFerias",viewColegios:"viewColegios",viewBancos:"viewBancos",viewComisarias:"viewComisarias",viewSupermercados:"viewSupermercados",viewClinicas:"viewClinicas",viewCentrosMedicos:"viewCentrosMedicos",viewHospitales:"viewHospitales",viewServiciosDeSalud:"viewServiciosDeSalud",viewCajerosAutomaticos:"viewCajerosAutomaticos",viewBomberos:"viewB
29omberos",viewMallChino:"viewMallChino",height:"height",center:"center",disableLink:"disableLink",zoom:"zoom",branches:"branches",geojson:"geojson"},outputs:{hoverBranchCategory:"hoverBranchCategory"},decls:3,vars:3,consts:[[3,"height",4,"ngIf"],["class","calculate-distance",3,"recalculate","click",4,"ngIf"],["class","mgl-map",3,"height","style","zoom","center","minZoom","fitBounds","idle",4,"ngIf"],[3,"height"],[1,"calculate-distance",3,"click"],[1,"pulse-dot"],[1,"button-text"],[1,"mgl-map",3,"zoom","center","minZoom","fitBounds","idle"],["mglNavigation","","position","top-right"],["mglGeolocate","","position","top-right",3,"geolocate"],["geolocateControl",""],["mglFullscreen","","position","top-right"],[4,"ngIf"],[3,"id","type","source","paint"],["id","pois",3,"data","cluster","generateId","clusterRadius","clusterMaxZoom"],["source","pois"],["mglPoint",""],["mglClusterPoint",""],[3,"feature"],["poiMarker",""],[1,"icon-marker",3,"mouseover","mouseout","click"],["aria-hidden","true",1,"fas","fa-location-pin","mas"],["anchor","bottom",3,"marker","offset"],[1,"popup-modern"],[1,"popup-header"],[1,"popup-header-overlay"],[1,"popup-header-content"],[1,"popup-title",2,"color","white"],[2,"margin-right","8px"],["class","popup-address",4,"ngIf"],["class","popup-body",4,"ngIf"],[1,"popup-address"],[1,"fa","fa-info-circle"],[1,"popup-body"],[1,"popup-description"],[1,"marker-cluster"],["id","pymes",3,"data","cluster","generateId","clusterRadius","clusterMaxZoom"],["source","pymes"],["myMarker",""],["class","icon-marker",3,"hover","mouseover","mouseout","click",4,"ngIf","ngIfElse"],["gtagEvent","","trackOn","click","action","openNamePopupMarker",1,"popup-title",3,"routerLink"],[1,"fa","fa-arrow-right"],["class","popup-address"],["class","popup-description",3,"innerHTML",4,"ngIf","ngIfElse"],["noDescriptionTpl",""],["markerFeriasTpl",""],[1,"fa","fa-map-marker-alt"],[1,"popup-description",3,"innerHTML"],[1,"popup-no-description"],[1,"d-flex","align-items-center","ferias-marker"],[1,"d-flex","flex-column"],[1,"text-white"],[4,"ngFor","ngForOf"],[3,"id","type","source","paint","layout",4,"ngIf"],[3,"id","type","source","paint","layout"]],template:function(c,l){c&1&&Ji(0,Lw,1,1,"app-map-loader",0)(1,Rw,4,2,"button",1)(2,pb,10,15,"mgl-map",2),c&2&&(Ie("ngIf",!l.mapLoaded),Pt(),Ie("ngIf",l.mapLoaded),Pt(),Ie("ngIf",l.isBrowser))},dependencies:[_d,td,ed,L0,rc,Id,Sd,Od,Rd,Ed,Cd,Pd,Md,kd,Nd,Ld],styles:['@charset "UTF-8";h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], h6[_ngcontent-%COMP%], p[_ngcontent-%COMP%], table[_ngcontent-%COMP%], th[_ngcontent-%COMP%], td[_ngcontent-%COMP%], tr[_ngcontent-%COMP%], span[_ngcontent-%COMP%], a[_ngcontent-%COMP%]{color:#b9b9b9;font-family:Pyme Sans,sans-serif;caret-color:transparent}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{color:#b9b9b9!important}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-ExtraLight-I6D6RJGG.ttf");font-weight:200;font-display:swap;font-style:extralight}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-Light-B5SPLMYK.ttf");font-weight:300;font-display:swap;font-style:light}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-Regular-6XQOZXLT.ttf");font-weight:400;font-display:swap;font-style:regular}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-Medium-G4SBLBRK.ttf");font-weight:500;font-display:swap;font-style:medium}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-SemiBold-763NFFIV.ttf");font-weight:600;font-display:swap;font-style:semibold}@font-face{font-family:Pyme Sans;src:url("./media/Nunito-ExtraBold-A4MTSUSK.ttf");font-weight:800;font-display:swap;font-style:bold}.breadcrumb[_ngcontent-%COMP%]{padding:6px 0}@media only screen and (max-width: 992px){.breadcrumb[_ngcontent-%COMP%]{margin-bottom:0;padding:2px 15px}}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{display:flex;transition:.2s;color:#ffffffd5;font-weight:800;align-items:center;text-decoration:none;text-transform:uppercase}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:.85rem}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#ffffffd5;margin-top:2px;font-weight:600;font-size:.8rem;line-height:initial}@media only screen and (max-width: 992px){.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.7rem}}.breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover, .breadcrumb[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover   span[_ngcontent-%COMP%]{color:#fff}.content-body[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{padding:15px 36px;font-size:1.1rem;line-height:1.4rem}@media only screen and (max-width: 992px){.content-body[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{padding:30px 15px}}.content-body[_ngcontent-%COMP%]   .subtitle-branches[_ngcontent-%COMP%]{text-align:center;margin-bottom:20px}@media only screen and (max-width: 992px){.content-body[_ngcontent-%COMP%]   .subtitle-branches[_ngcontent-%COMP%]{font-size:1rem;line-height:1rem}}.content-body[_ngcontent-%COMP%]   .contact-information[_ngcontent-%COMP%]{padding:0 42px}@media only screen and (max-width: 992px){.content-body[_ngcontent-%COMP%]   .contact-information[_ngcontent-%COMP%]{padding:0 15px}}.content-body[_ngcontent-%COMP%]   .contact-information[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{font-weight:800;text-align:center}.column-scroll[_ngcontent-%COMP%]{z-index:99;overflow-y:scroll;height:calc(100vh - 56px)}.column-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;
29background-color:#dadada}.column-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:10px;background-color:#f1752b}.column-scroll[_ngcontent-%COMP%]::-moz-scrollbar{width:8px;background-color:#dadada}.column-scroll[_ngcontent-%COMP%]::-moz-scrollbar-thumb{border-radius:10px;background-color:#f1752b}.stripes[_ngcontent-%COMP%]{width:100%;height:10px;background-image:url("./media/stripe-overlay-UCKRDQKB.webp");background-repeat:repeat;opacity:.3;border:none;margin:20px 0}mat-sidenav[style][_ngcontent-%COMP%]{visibility:visible!important}.mat-drawer[_ngcontent-%COMP%]{transform:none!important}.loader[_ngcontent-%COMP%]{width:48px;height:48px;display:block;margin:0 30px;box-sizing:border-box;position:relative}@media only screen and (max-width: 992px){.loader[_ngcontent-%COMP%]{margin:0 22px 0 0}}.loader[_ngcontent-%COMP%]:after{content:"";width:48px;height:48px;left:0;bottom:0;position:absolute;border-radius:50% 50% 0;border:15px solid #f1752b;transform:rotate(45deg) translate(0);box-sizing:border-box;animation:_ngcontent-%COMP%_animMarker .4s ease-in-out infinite alternate}.loader[_ngcontent-%COMP%]:before{content:"";box-sizing:border-box;position:absolute;left:0;right:0;margin:auto;top:150%;width:24px;height:4px;border-radius:50%;background:rgba(0,0,0,.2);animation:_ngcontent-%COMP%_animShadow .4s ease-in-out infinite alternate}@keyframes _ngcontent-%COMP%_animMarker{0%{transform:rotate(45deg) translate(5px,5px)}to{transform:rotate(45deg) translate(-5px,-5px)}}@keyframes _ngcontent-%COMP%_animShadow{0%{transform:scale(.5)}to{transform:scale(1)}}  .mapboxgl-marker{z-index:0}  .mapboxgl-user-location-accuracy-circle{z-index:-1}.mapboxgl-marker-anchor-center[_ngcontent-%COMP%]{top:-29px!important}.breadcrumb-banner[_ngcontent-%COMP%]{bottom:7px;position:absolute;width:-webkit-fill-available}.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%], .breadcrumb-banner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#ffffffab}@media only screen and (max-width: 992px){.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%], .breadcrumb-banner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.85rem}}.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{transition:.2s;text-decoration:none}.breadcrumb-banner[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{color:#fff}.breadcrumb-banner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-weight:800}.distance[_ngcontent-%COMP%]{position:absolute;
29background:rgba(0,0,0,.4117647059);padding:2px 10px;right:5px;top:5px;border-radius:28px}.distance[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#fff;font-weight:600;font-size:.85rem}.visually-hidden[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}hr.stripes[_ngcontent-%COMP%]{width:80%;height:10px;opacity:.3;border:none;margin:40px 0;background-repeat:repeat;background-image:url("./media/stripe-overlay-UCKRDQKB.webp")}@media only screen and (max-width: 992px){hr.stripes[_ngcontent-%COMP%]{width:100%}}.btn-go[_ngcontent-%COMP%]{margin:0 8px;width:200px;display:flex;color:#fff;transition:.2s;overflow:hidden;position:relative;padding:12px 10px;border-radius:5px;align-items:center;text-decoration:none;justify-content:center}.btn-go[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1.3rem;margin-right:10px;color:#fff!important}.btn-go[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#fff;line-height:1rem}.btn-go[_ngcontent-%COMP%]:hover{opacity:.8}.btn-google[_ngcontent-%COMP%]{background-color:#1374e9}.btn-uber[_ngcontent-%COMP%]{background-color:#000}.banner-page[_ngcontent-%COMP%]{width:100%;position:relative;background-size:cover;background-position:center;padding:40px 0 20px;background-image:url("./media/background1-47AB4FGS.webp")}@media only screen and (max-width: 992px){.banner-page[_ngcontent-%COMP%]{padding:24px 0 8px}}.banner-page[_ngcontent-%COMP%]:before{content:"";position:absolute;bottom:0;left:0;right:0;height:100%;z-index:0;transition:.2s;background:linear-gradient(to top,#f9f9f9,rgba(0,0,0,0))}.banner-page[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{color:#4b4b4b;font-weight:700;margin-bottom:8px;position:relative;text-shadow:2px 2px 2px rgba(0,0,0,.1490196078)}@media only screen and (max-width: 992px){.banner-page[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.4rem}}.banner-page[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:#4b4b4b;font-weight:400;font-size:1.25rem;position:relative;line-height:1.6rem}@media only screen and (max-width: 992px){.banner-page[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:1rem;line-height:1.2rem}}.adsbygoogle[_ngcontent-%COMP%]{display:block;width:100%;min-height:100px}@keyframes _ngcontent-%COMP%_swing{0%,30%,50%,70%,to{transform:rotate(0)}10%{transform:rotate(10deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}[_nghost-%COMP%]{flex:1;display:flex;position:absolute;inset:0;width:100%;height:100%;z-index:1}[_nghost-%COMP%]   .marker-cluster[_ngcontent-%COMP%]{width:35px;height:35px;border-radius:50%;background-color:#f1752b;display:flex;font-size:.95rem;justify-content:center;align-items:center;color:#fff;border:3px solid rgba(198,106,106,.655);cursor:pointer}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup{min-width:340px!important;max-width:340px!important}@media only screen and (max-width: 992px){[_nghost-%COMP%]     .mgl-map .mapboxgl-popup{min-width:300px!important;max-width:300px!important}}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content{padding:0;background:rgba(20,20,20,.98);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.1);border-radius:16px;overflow:hidden;box-shadow:0 8px 32px #00000080}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-modern{display:flex;flex-direction:column}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header{position:relative;height:140px;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important;display:flex;align-items:flex-end;overflow:hidden}@media only screen and (max-width: 992px){[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header{height:120px}}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-header-overlay{position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.85) 0%,rgba(0,0,0,.4) 50%,rgba(0,0,0,.1) 100%);z-index:1}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-header-content{position:relative;z-index:2;padding:16px;width:100%;display:flex;flex-direction:column;gap:8px}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-title{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#fff;font-size:1.1rem;font-weight:700;text-decoration:none;transition:all .3s ease;line-height:1.3}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-title i{font-size:.9rem;opacity:0;transform:translate(-8px);transition:all .3s ease;flex-shrink:0}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-title:hover{color:#f1752b;transform:translate(2px)}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-title:hover i{opacity:1;transform:translate(0)}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-address{display:flex;align-items:center;gap:8px;color:#ffffffe6;font-size:.85rem;font-weight:400}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-address i{color:#f1752b;font-size:.9rem;flex-shrink:0}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-header .popup-address span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-body{padding:16px;background:rgba(30,30,30,.5)}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-description{color:#fffc;font-size:.9rem;line-height:1.5}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-description p{margin:0!important;color:#fffc}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-no-description{dis
29play:flex;align-items:center;gap:8px;color:#ffffff80;font-size:.85rem;font-style:italic}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .popup-no-description i{font-size:1rem}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .header, [_nghost-%COMP%]     .mgl-map .mapboxgl-popup-content .body{display:none}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-close-button{top:8px;right:8px;width:32px;height:32px;padding:0 0 4px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.3rem;border-radius:50%;background:rgba(0,0,0,.5);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.1);transition:all .3s ease;z-index:10}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-close-button:hover{background:rgba(0,0,0,.7);border-color:#fff3;transform:rotate(90deg)}[_nghost-%COMP%]     .mgl-map .mapboxgl-popup-close-button:active{transform:rotate(90deg) scale(.95)}[_nghost-%COMP%]     .mgl-map .hover .fa-location-pin{filter:brightness(.9)}[_nghost-%COMP%]     .mgl-map .hover i:before{animation:_ngcontent-%COMP%_swing ease-in-out .5s 1 alternate}[_nghost-%COMP%]     .mgl-map .icon-marker{transition:.2s;font-size:3.5rem}[_nghost-%COMP%]     .mgl-map .icon-marker:hover .fa-location-pin{filter:brightness(.9)}[_nghost-%COMP%]     .mgl-map .icon-marker:hover i:before{animation:_ngcontent-%COMP%_swing ease-in-out .5s 1 alternate}[_nghost-%COMP%]     .mgl-map .icon-marker .label{inset:-12px 0 0;margin:auto;display:flex;color:#fff;position:absolute;font-size:1.25rem;align-items:center;justify-content:center}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-top-right, [_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-bottom-right{top:50%!important;bottom:auto!important;transform:translateY(-50%);right:10px}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-group{background:rgba(26,26,26,.9)!important;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.1)!important;border-radius:12px!important;box-shadow:0 4px 12px #0000004d!important}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-group button{background:transparent!important;border:none!important;border-bottom:1px solid rgba(255,255,255,.1)!important;transition:all .3s ease}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-group button:last-child{border-bottom:none!important}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-group button:hover{background:rgba(241,117,43,.2)!important}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-group button:focus{box-shadow:none!important}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon{filter:invert(1)}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-geolocate{background:rgba(26,26,26,.9)!important;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.1)!important;border-radius:12px!important;box-shadow:0 4px 12px #0000004d!important}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-geolocate:hover{background:rgba(241,117,43,.2)!important}[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{filter:invert(1)}@media only screen and (max-width: 992px){[_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-top-right, [_nghost-%COMP%]     .mgl-map .mapboxgl-ctrl-bottom-right{top:auto!important;bottom:10px!important;transform:none}}[_nghost-%COMP%]   .ferias-marker[_ngcontent-%COMP%]{color:#fff;padding:6px 12px;border-radius:5px;position:relative;top:-20px!important}[_nghost-%COMP%]   .ferias-marker[_ngcontent-%COMP%]:before{content:"";left:50%;z-index:-1;width:20px;height:20px;bottom:-10px;position:absolute;border-radius:2px;background-color:var(--colorFeria);transform:translate(-50%) rotate(45deg)}[_nghost-%COMP%]   .ferias-marker[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1.7rem;margin-right:8px}[_nghost-%COMP%]   .ferias-marker[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{font-size:.9rem;font-weight:700}[_nghost-%COMP%]   .ferias-marker[_ngcontent-%COMP%]   h6[_ngcontent-%COMP%]{font-size:.9rem;margin-bottom:0}[_nghost-%COMP%]   .prices-gasoline[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{background:red}']})}}return r})();var A0=(()=>{class r{static{this.\u0275fac=function(c){return new(c||r)}}static{this.\u0275mod=br({type:r})}static{this.\u0275inj=wr({imports:[nc,us]})}}return r})();var U9=(()=>{class r{static{this.\u0275fac=function(c){return new(c||r)}}static{this.\u0275mod=br({type:r})}static{this.\u0275inj=wr({providers:[bd],imports:[nc,us,Dd,A0,Ad.withConfig({accessToken:vd.MAPBOX_TOKEN})]})}}return r})();function gb(r,s){}var Aa=class{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.ariaModal=!0,this.autoFocus="first-tabbable",this.restoreFocus=!0,this.closeOnNavigation=!0,this.closeOnDestroy=!0,this.closeOnOverlayDetachments=!0}};var T0=(()=>{class r extends fd{constructor(o,c,l,h,f,p,y,x){super(),this._elementRef=o,this._focusTrapFactory=c,this._config=h,this._interactivityChecker=f,this._ngZone=p,this._overlayRef=y,this._focusMonitor=x,this._platform=wl(nd),this._focusTrap=null,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this._ariaLabelledByQueue=[],this.attachDomPortal=S=>{this._portalOutlet.hasAttached();let O=this._portalOutlet.attachDomPortal(S);return this._contentAttached(),O},this._document=l,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_contentAttached(){this._initializeFocusTrap(),this._handleBackdropClicks(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._restoreFocus()}attachComponentPortal(o){this._portalOutlet.hasAttached();let c=this._portalOutlet.attachComponentPortal(o);return this._contentAttached(),c}attachTemplatePortal(o){this._portalOutlet.hasAttached();let c=this._portalOutlet.attachTemplatePortal(o);return this._contentAttached(),c}_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(o,c){this._interactivityChecker.isFocusable(o)||(o.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let l=()=>{o.removeEventListener("blur",l),o.removeEventListener("mousedown",l),o.removeAttribute("tabindex")};o.addEventListener("blur",l),o.addEventListener("mousedown",l)})),o.focus(c)}_focusByCssSelector(o,c){let l=this._elementRef.nativeElement.querySelector(o);l&&this._forceFocus(l,c)}_trapFocus(){let o=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||o.focus();break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElementWhenReady().then(c=>{c||this._focusDialogContainer()});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this._config.autoFocus);break}}_restoreFocus(){let o=this._config.restoreFocus,c=null;
29if(typeof o=="string"?c=this._document.querySelector(o):typeof o=="boolean"?c=o?this._elementFocusedBeforeDialogWasOpened:null:o&&(c=o),this._config.restoreFocus&&c&&typeof c.focus=="function"){let l=Za(),h=this._elementRef.nativeElement;(!l||l===this._document.body||l===h||h.contains(l))&&(this._focusMonitor?(this._focusMonitor.focusVia(c,this._closeInteractionType),this._closeInteractionType=null):c.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){let o=this._elementRef.nativeElement,c=Za();return o===c||o.contains(c)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Za()))}_handleBackdropClicks(){this._overlayRef.backdropClick().subscribe(()=>{this._config.disableClose&&this._recaptureFocus()})}static{this.\u0275fac=function(c){return new(c||r)(qi(bl),qi(ad),qi(Qa,8),qi(Aa),qi(sd),qi(Cl),qi(ec),qi(cd))}}static{this.\u0275cmp=lo({type:r,selectors:[["cdk-dialog-container"]],viewQuery:function(c,l){if(c&1&&na(Ka,7),c&2){let h;ia(h=ra())&&(l._portalOutlet=h.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(c,l){c&2&&Wr("id",l._config.id||null)("role",l._config.role)("aria-modal",l._config.ariaModal)("aria-labelledby",l._config.ariaLabel?null:l._ariaLabelledByQueue[0])("aria-label",l._config.ariaLabel)("aria-describedby",l._config.ariaDescribedBy||null)},standalone:!0,features:[Ml,Zh],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(c,l){c&1&&Ji(0,gb,0,0,"ng-template",0)},dependencies:[tc,Ka],styles:[".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}"],encapsulation:2})}}return r})(),Ra=class{constructor(s,o){this.overlayRef=s,this.config=o,this.closed=new Ya,this.disableClose=o.disableClose,this.backdropClick=s.backdropClick(),this.keydownEvents=s.keydownEvents(),this.outsidePointerEvents=s.outsidePointerEvents(),this.id=o.id,this.keydownEvents.subscribe(c=>{c.keyCode===27&&!this.disableClose&&!rd(c)&&(c.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{this.disableClose||this.close(void 0,{focusOrigin:"mouse"})}),this._detachSubscription=s.detachments().subscribe(()=>{o.closeOnOverlayDetachments!==!1&&this.close()})}close(s,o){if(this.containerInstance){let c=this.closed;this.containerInstance._closeInteractionType=o?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),c.next(s),c.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(s="",o=""){return this.overlayRef.updateSize({width:s,height:o}),this}addPanelClass(s){return this.overlayRef.addPanelClass(s),this}removePanelClass(s){return this.overlayRef.removePanelClass(s),this}},yb=new ja("DialogScrollStrategy",{providedIn:"root",factory:()=>{let r=wl(ic);return()=>r.scrollStrategies.block()}}),vb=new ja("DialogData"),_b=new ja("DefaultDialogConfig");var xb=0,wb=(()=>{class r{get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}constructor(o,c,l,h,f,p){this._overlay=o,this._injector=c,this._defaultOptions=l,this._parentDialog=h,this._overlayContainer=f,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new Ya,this._afterOpenedAtThisLevel=new Ya,this._ariaHiddenElements=new Map,this.afterAllClosed=Hh(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Vh(void 0))),this._scrollStrategy=p}open(o,c){let l=this._defaultOptions||new Aa;c=ko(ko({},l),c),c.id=c.id||`cdk-dialog-${xb++}`,c.id&&this.getDialogById(c.id);let h=this._getOverlayConfig(c),f=this._overlay.create(h),p=new Ra(f,c),y=this._attachContainer(f,p,c);return p.containerInstance=y,this._attachDialogContent(o,p,y,c),this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(p),p.closed.subscribe(()=>this._removeOpenDialog(p,!0)),this.afterOpened.next(p),p}closeAll(){bh(this.openDialogs,o=>o.close())}getDialogById(o){return this.openDialogs.find(c=>c.id===o)}ngOnDestroy(){bh(this._openDialogsAtThisLevel,o=>{o.config.closeOnDestroy===!1&&this._removeOpenDialog(o,!1)}),bh(this._openDialogsAtThisLevel,o=>o.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(o){let c=new pd({positionStrategy:o.positionStrategy||this._overlay.position().global().centerHorizontally().centerVertically(),scrollStrategy:o.scrollStrategy||this._scrollStrategy(),panelClass:o.panelClass,hasBackdrop:o.hasBackdrop,direction:o.direction,minWidth:o.minWidth,minHeight:o.minHeight,maxWidth:o.maxWidth,maxHeight:o.maxHeight,width:o.width,height:o.height,disposeOnNavigation:o.closeOnNavigation});return o.backdropClass&&(c.backdropClass=o.backdropClass),c}_attachContainer(o,c,l){let h=l.injector||l.viewContainerRef?.injector,f=[{provide:Aa,useValue:l},{provide:Ra,useValue:c},{provide:ec,useValue:o}],p;l.container?typeof l.container=="function"?p=l.container:(p=l.container.type,f.push(...l.container.providers(l))):p=T0;let y=new Sl(p,l.viewContainerRef,Js.create({parent:h||this._injector,providers:f}),l.componentFactoryResolver);return o.attach(y).instance}_attachDialogContent(o,c,l,h){if(o instanceof Kh){let f=this._createInjector(h,c,l,void 0),p={$implicit:h.data,dialogRef:c};h.templateContext&&(p=ko(ko({},p),typeof h.templateContext=="function"?h.templateContext():h.templateContext)),l.attachTemplatePortal(new dd(o,null,p,f))}else{let f=this._createInjector(h,c,l,this._injector),p=l.attachComponentPortal(new Sl(o,h.viewContainerRef,f,h.componentFactoryResolver));c.componentRef=p,c.componentInstance=p.instance}}_createInjector(o,c,l,h){let f=o.injector||o.viewContainerRef?.injector,p=[{provide:vb,useValue:o.data},{provide:Ra,useValue:c}];return o.providers&&(typeof o.providers=="function"?p.push(...o.providers(c,o,l)):p.push(...o.providers)),o.direction&&(!f||!f.get(Il,null,{optional:!0}))&&p.push({provide:Il,useValue:{value:o.direction,change:pi()}}),Js.create({parent:f||h,providers:p})}_removeOpenDialog(o,c){let l=this.openDialogs.indexOf(o);l>-1&&(this.openDialogs.splice(l,1),this.openDialogs.length||(this._ariaHiddenElements.forEac
29h((h,f)=>{h?f.setAttribute("aria-hidden",h):f.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),c&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){let o=this._overlayContainer.getContainerElement();if(o.parentElement){let c=o.parentElement.children;for(let l=c.length-1;l>-1;l--){let h=c[l];h!==o&&h.nodeName!=="SCRIPT"&&h.nodeName!=="STYLE"&&!h.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(h,h.getAttribute("aria-hidden")),h.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let o=this._parentDialog;return o?o._getAfterAllClosed():this._afterAllClosedAtThisLevel}static{this.\u0275fac=function(c){return new(c||r)(hr(ic),hr(Js),hr(_b,8),hr(r,12),hr(md),hr(yb))}}static{this.\u0275prov=ss({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function bh(r,s){let o=r.length;for(;o--;)s(r[o])}var d7=(()=>{class r{static{this.\u0275fac=function(c){return new(c||r)}}static{this.\u0275mod=br({type:r})}static{this.\u0275inj=wr({providers:[wb],imports:[gd,tc,ld,T0,tc]})}}return r})();export{Dd as a,k0 as b,N0 as c,P9 as d,U9 as e,Aa as f,T0 as g,wb as h,d7 as i};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.