@maptiler/geocoding-control 0.0.88 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ClearIcon.svelte +2 -2
- package/FailIcon.svelte +12 -0
- package/FailIcon.svelte.d.ts +23 -0
- package/FeatureItem.svelte +95 -0
- package/FeatureItem.svelte.d.ts +22 -0
- package/GeocodingControl.svelte +104 -131
- package/README.md +2 -2
- package/SearchIcon.svelte +2 -2
- package/leaflet.js +4822 -4676
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +5 -5
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +4850 -4704
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +5 -5
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +4849 -4703
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +5 -5
- package/maptilersdk.umd.js.map +1 -1
- package/package.json +7 -7
- package/react.js +776 -630
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/types.d.ts +2 -2
package/leaflet.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Rt,Kt){typeof exports=="object"&&typeof module<"u"?Kt(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],Kt):(Rt=typeof globalThis<"u"?globalThis:Rt||self,Kt(Rt.leafletMaptilerGeocoder={},Rt.leaflet))})(this,function(Rt,Kt){var Fn,oi;"use strict";var ju=(Rt,Kt,Ze)=>{if(!Kt.has(Rt))throw TypeError("Cannot "+Ze)};var nr=(Rt,Kt,Ze)=>(ju(Rt,Kt,"read from private field"),Ze?Ze.call(Rt):Kt.get(Rt)),Zs=(Rt,Kt,Ze)=>{if(Kt.has(Rt))throw TypeError("Cannot add the same private member more than once");Kt instanceof WeakSet?Kt.add(Rt):Kt.set(Rt,Ze)},as=(Rt,Kt,Ze,$e)=>(ju(Rt,Kt,"write to private field"),$e?$e.call(Rt,Ze):Kt.set(Rt,Ze),Ze);function Ze(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const $e=Ze(Kt);function Qt(){}function Ku(r,t){for(const e in t)r[e]=t[e];return r}function $s(r){return r()}function ta(){return Object.create(null)}function yr(r){r.forEach($s)}function ea(r){return typeof r=="function"}function li(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function Qu(r){return Object.keys(r).length===0}function Ju(r,t,e,n){if(r){const i=na(r,t,e,n);return r[0](i)}}function na(r,t,e,n){return r[1]&&n?Ku(e.ctx.slice(),r[1](n(t))):e.ctx}function Zu(r,t,e,n){if(r[2]&&n){const i=r[2](n(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(t.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=t.dirty[a]|i[a];return o}return t.dirty|i}return t.dirty}function $u(r,t,e,n,i,o){if(i){const s=na(t,e,n,o);r.p(s,i)}}function tl(r){if(r.ctx.length>32){const t=[],e=r.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function ra(r){return r??""}function ct(r,t){r.appendChild(t)}function Ge(r,t,e){r.insertBefore(t,e||null)}function Pe(r){r.parentNode&&r.parentNode.removeChild(r)}function el(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function se(r){return document.createElement(r)}function mr(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function zr(r){return document.createTextNode(r)}function rr(){return zr(" ")}function ke(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function nl(r){return function(t){return t.preventDefault(),r.call(this,t)}}function B(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function rl(r){return Array.from(r.childNodes)}function qi(r,t){t=""+t,r.data!==t&&(r.data=t)}function ia(r,t){r.value=t??""}function tn(r,t,e){r.classList[e?"add":"remove"](t)}function il(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Xi;function Yi(r){Xi=r}function oa(){if(!Xi)throw new Error("Function called outside component initialization");return Xi}function ol(r){oa().$$.on_destroy.push(r)}function sl(){const r=oa();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=il(t,e,{cancelable:n});return i.slice().forEach(s=>{s.call(r,o)}),!o.defaultPrevented}return!0}}const ci=[],us=[];let fi=[];const sa=[],al=Promise.resolve();let ls=!1;function ul(){ls||(ls=!0,al.then(aa))}function cs(r){fi.push(r)}const fs=new Set;let hi=0;function aa(){if(hi!==0)return;const r=Xi;do{try{for(;hi<ci.length;){const t=ci[hi];hi++,Yi(t),ll(t.$$)}}catch(t){throw ci.length=0,hi=0,t}for(Yi(null),ci.length=0,hi=0;us.length;)us.pop()();for(let t=0;t<fi.length;t+=1){const e=fi[t];fs.has(e)||(fs.add(e),e())}fi.length=0}while(ci.length);for(;sa.length;)sa.pop()();ls=!1,fs.clear(),Yi(r)}function ll(r){if(r.fragment!==null){r.update(),yr(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(cs)}}function cl(r){const t=[],e=[];fi.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),fi=t}const xo=new Set;let Vr;function ua(){Vr={r:0,c:[],p:Vr}}function la(){Vr.r||yr(Vr.c),Vr=Vr.p}function en(r,t){r&&r.i&&(xo.delete(r),r.i(t))}function ir(r,t,e,n){if(r&&r.o){if(xo.has(r))return;xo.add(r),Vr.c.push(()=>{xo.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function So(r){r&&r.c()}function Hi(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||cs(()=>{const s=r.$$.on_mount.map($s).filter(ea);r.$$.on_destroy?r.$$.on_destroy.push(...s):yr(s),r.$$.on_mount=[]}),o.forEach(cs)}function Wi(r,t){const e=r.$$;e.fragment!==null&&(cl(e.after_update),yr(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function fl(r,t){r.$$.dirty[0]===-1&&(ci.push(r),ul(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function gi(r,t,e,n,i,o,s,a=[-1]){const u=Xi;Yi(r);const l=r.$$={fragment:null,ctx:[],props:o,update:Qt,not_equal:i,bound:ta(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ta(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=e?e(r,t.props||{},(f,h,...g)=>{const p=g.length?g[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&fl(r,f)),h}):[],l.update(),c=!0,yr(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const f=rl(t.target);l.fragment&&l.fragment.l(f),f.forEach(Pe)}else l.fragment&&l.fragment.c();t.intro&&en(r.$$.fragment),Hi(r,t.target,t.anchor,t.customElement),aa()}Yi(u)}class pi{$destroy(){Wi(this,1),this.$destroy=Qt}$on(t,e){if(!ea(e))return Qt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Qu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const gf="";function hl(r){let t,e;return{c(){t=mr("svg"),e=mr("path"),B(e,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),B(t,"viewBox","0 0 18 18"),B(t,"width","16"),B(t,"height","16"),B(t,"class","svelte-en2qvf")},m(n,i){Ge(n,t,i),ct(t,e)},p:Qt,i:Qt,o:Qt,d(n){n&&Pe(t)}}}class gl extends pi{constructor(t){super(),gi(this,t,null,hl,li,{})}}const pf="";function pl(r){let t;return{c(){t=se("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',B(t,"class","svelte-7cmwmc")},m(e,n){Ge(e,t,n)},p:Qt,i:Qt,o:Qt,d(e){e&&Pe(t)}}}class dl extends pi{constructor(t){super(),gi(this,t,null,pl,li,{})}}const df="";function vl(r){let t,e;return{c(){t=mr("svg"),e=mr("path"),B(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),B(t,"viewBox","0 0 60.006 21.412"),B(t,"width","14"),B(t,"height","20"),B(t,"class","svelte-en2qvf")},m(n,i){Ge(n,t,i),ct(t,e)},p:Qt,i:Qt,o:Qt,d(n){n&&Pe(t)}}}class yl extends pi{constructor(t){super(),gi(this,t,null,vl,li,{})}}const vf="";function ml(r){let t,e;return{c(){t=mr("svg"),e=mr("path"),B(e,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),B(t,"viewBox","0 0 18 18"),B(t,"xml:space","preserve"),B(t,"width","20"),B(t,"class","svelte-en2qvf")},m(n,i){Ge(n,t,i),ct(t,e)},p:Qt,i:Qt,o:Qt,d(n){n&&Pe(t)}}}class _l extends pi{constructor(t){super(),gi(this,t,null,ml,li,{})}}const yf="";function ca(r,t,e){const n=r.slice();return n[69]=t[e],n[71]=e,n}function fa(r){let t,e;return t=new dl({}),{c(){So(t.$$.fragment)},m(n,i){Hi(t,n,i),e=!0},i(n){e||(en(t.$$.fragment,n),e=!0)},o(n){ir(t.$$.fragment,n),e=!1},d(n){Wi(t,n)}}}function ha(r){let t,e,n,i,o;return e=new yl({}),{c(){t=se("button"),So(e.$$.fragment),B(t,"type","button"),B(t,"title",r[9]),B(t,"class","svelte-p509gh"),tn(t,"active",r[0])},m(s,a){Ge(s,t,a),Hi(e,t,null),n=!0,i||(o=ke(t,"click",r[56]),i=!0)},p(s,a){(!n||a[0]&512)&&B(t,"title",s[9]),(!n||a[0]&1)&&tn(t,"active",s[0])},i(s){n||(en(e.$$.fragment,s),n=!0)},o(s){ir(e.$$.fragment,s),n=!1},d(s){s&&Pe(t),Wi(e),i=!1,o()}}}function El(r){let t,e,n,i=r[12],o=[];for(let s=0;s<i.length;s+=1)o[s]=pa(ca(r,i,s));return{c(){t=se("ul");for(let s=0;s<o.length;s+=1)o[s].c();B(t,"class","svelte-p509gh")},m(s,a){Ge(s,t,a);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(t,null);e||(n=[ke(t,"mouseleave",r[59]),ke(t,"blur",r[60])],e=!0)},p(s,a){if(a[0]&2110464){i=s[12];let u;for(u=0;u<i.length;u+=1){const l=ca(s,i,u);o[u]?o[u].p(l,a):(o[u]=pa(l),o[u].c(),o[u].m(t,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=i.length}},d(s){s&&Pe(t),el(o,s),e=!1,yr(n)}}}function Il(r){let t,e;return{c(){t=se("div"),e=zr(r[7]),B(t,"class","no-results svelte-p509gh")},m(n,i){Ge(n,t,i),ct(t,e)},p(n,i){i[0]&128&&qi(e,n[7])},d(n){n&&Pe(t)}}}function Cl(r){let t="",e;return{c(){e=zr(t)},m(n,i){Ge(n,e,i)},p:Qt,d(n){n&&Pe(e)}}}function Nl(r){let t,e;return{c(){t=se("div"),e=zr(r[6]),B(t,"class","error svelte-p509gh")},m(n,i){Ge(n,t,i),ct(t,e)},p(n,i){i[0]&64&&qi(e,n[6])},d(n){n&&Pe(t)}}}function ga(r){var i,o;let t,e=(((o=(i=r[69].properties)==null?void 0:i.place_type_name)==null?void 0:o[0])??r[69].place_type[0])+"",n;return{c(){t=se("span"),n=zr(e),B(t,"class","line2 svelte-p509gh")},m(s,a){Ge(s,t,a),ct(t,n)},p(s,a){var u,l;a[0]&4096&&e!==(e=(((l=(u=s[69].properties)==null?void 0:u.place_type_name)==null?void 0:l[0])??s[69].place_type[0])+"")&&qi(n,e)},d(s){s&&Pe(t)}}}function pa(r){let t,e,n,i,o=r[69].place_name.replace(/,.*/,"")+"",s,a,u,l=r[69].place_name.replace(/[^,]*,?\s*/,"")+"",c,f,h,g,p,_,d=r[10]&&ga(r);function y(){return r[57](r[71])}function C(){return r[58](r[69])}return{c(){t=se("li"),e=se("span"),n=se("span"),i=se("span"),s=zr(o),a=rr(),u=se("span"),c=zr(l),f=rr(),d&&d.c(),h=rr(),B(i,"class","primary svelte-p509gh"),B(u,"class","secondary svelte-p509gh"),B(n,"class","line1 svelte-p509gh"),B(e,"class","texts svelte-p509gh"),B(t,"tabindex","0"),B(t,"data-selected",g=r[13]===r[71]),B(t,"class","svelte-p509gh"),tn(t,"selected",r[13]===r[71])},m(I,N){Ge(I,t,N),ct(t,e),ct(e,n),ct(n,i),ct(i,s),ct(n,a),ct(n,u),ct(u,c),ct(e,f),d&&d.m(e,null),ct(t,h),p||(_=[ke(t,"mouseenter",y),ke(t,"focus",C)],p=!0)},p(I,N){r=I,N[0]&4096&&o!==(o=r[69].place_name.replace(/,.*/,"")+"")&&qi(s,o),N[0]&4096&&l!==(l=r[69].place_name.replace(/[^,]*,?\s*/,"")+"")&&qi(c,l),r[10]?d?d.p(r,N):(d=ga(r),d.c(),d.m(e,null)):d&&(d.d(1),d=null),N[0]&8192&&g!==(g=r[13]===r[71])&&B(t,"data-selected",g),N[0]&8192&&tn(t,"selected",r[13]===r[71])},d(I){I&&Pe(t),d&&d.d(),p=!1,yr(_)}}}function xl(r){let t,e,n,i,o,s,a,u,l,c,f,h,g,p,_,d,y,C;i=new _l({}),c=new gl({});let I=r[17]&&fa(),N=r[5]===!0&&ha(r);const w=r[48].default,b=Ju(w,r,r[47],null);function A(R,z){var X,it;if(R[16])return Nl;if(!R[14])return Cl;if(((X=R[12])==null?void 0:X.length)===0)return Il;if(R[14]&&((it=R[12])!=null&&it.length))return El}let F=A(r),D=F&&F(r);return{c(){t=se("form"),e=se("div"),n=se("button"),So(i.$$.fragment),o=rr(),s=se("input"),a=rr(),u=se("div"),l=se("button"),So(c.$$.fragment),f=rr(),I&&I.c(),h=rr(),N&&N.c(),g=rr(),b&&b.c(),p=rr(),D&&D.c(),B(n,"type","button"),B(n,"class","svelte-p509gh"),B(s,"placeholder",r[8]),B(s,"aria-label",r[8]),B(s,"class","svelte-p509gh"),B(l,"type","button"),B(l,"title",r[3]),B(l,"class","svelte-p509gh"),B(u,"class","clear-button-container svelte-p509gh"),tn(u,"displayable",r[1]!==""),B(e,"class","input-group svelte-p509gh"),B(t,"tabindex","0"),B(t,"class",_=ra(r[2])+" svelte-p509gh"),tn(t,"can-collapse",r[4]&&r[1]==="")},m(R,z){Ge(R,t,z),ct(t,e),ct(e,n),Hi(i,n,null),ct(e,o),ct(e,s),r[50](s),ia(s,r[1]),ct(e,a),ct(e,u),ct(u,l),Hi(c,l,null),ct(u,f),I&&I.m(u,null),ct(e,h),N&&N.m(e,null),ct(e,g),b&&b.m(e,null),ct(t,p),D&&D.m(t,null),d=!0,y||(C=[ke(n,"click",r[49]),ke(s,"input",r[51]),ke(s,"focus",r[52]),ke(s,"blur",r[53]),ke(s,"keydown",r[19]),ke(s,"input",r[54]),ke(l,"click",r[55]),ke(t,"submit",nl(r[18]))],y=!0)},p(R,z){(!d||z[0]&256)&&B(s,"placeholder",R[8]),(!d||z[0]&256)&&B(s,"aria-label",R[8]),z[0]&2&&s.value!==R[1]&&ia(s,R[1]),(!d||z[0]&8)&&B(l,"title",R[3]),R[17]?I?z[0]&131072&&en(I,1):(I=fa(),I.c(),en(I,1),I.m(u,null)):I&&(ua(),ir(I,1,1,()=>{I=null}),la()),(!d||z[0]&2)&&tn(u,"displayable",R[1]!==""),R[5]===!0?N?(N.p(R,z),z[0]&32&&en(N,1)):(N=ha(R),N.c(),en(N,1),N.m(e,g)):N&&(ua(),ir(N,1,1,()=>{N=null}),la()),b&&b.p&&(!d||z[1]&65536)&&$u(b,w,R,R[47],d?Zu(w,R[47],z,null):tl(R[47]),null),F===(F=A(R))&&D?D.p(R,z):(D&&D.d(1),D=F&&F(R),D&&(D.c(),D.m(t,null))),(!d||z[0]&4&&_!==(_=ra(R[2])+" svelte-p509gh"))&&B(t,"class",_),(!d||z[0]&22)&&tn(t,"can-collapse",R[4]&&R[1]==="")},i(R){d||(en(i.$$.fragment,R),en(c.$$.fragment,R),en(I),en(N),en(b,R),d=!0)},o(R){ir(i.$$.fragment,R),ir(c.$$.fragment,R),ir(I),ir(N),ir(b,R),d=!1},d(R){R&&Pe(t),Wi(i),r[50](null),Wi(c),I&&I.d(),N&&N.d(),b&&b.d(R),D&&D.d(),y=!1,yr(C)}}}function Sl(r,t,e){const n=t[1],i=t[0],o=n-i;return r===n&&e?r:((r-i)%o+o)%o+i}function da(r){let t=[...r];return t[2]<t[0]&&(t[2]+=360),t}function wl(r,t,e){let n,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:p=!1}=t,{errorMessage:_="Searching failed"}=t,{filter:d=()=>!0}=t,{flyTo:y=!0}=t,{fuzzyMatch:C=!0}=t,{language:I=void 0}=t,{limit:N=void 0}=t,{mapController:w=void 0}=t,{minLength:b=2}=t,{noResultsMessage:A="No results found"}=t,{placeholder:F="Search"}=t,{proximity:D=void 0}=t,{reverseActive:R=p==="always"}=t,{reverseButtonTitle:z="toggle reverse geocoding"}=t,{searchValue:X=""}=t,{showFullGeometry:it=!0}=t,{showPlaceType:O=!1}=t,{showResultsWhileTyping:W=!0}=t,{trackProximity:at=!0}=t,{types:Pt=void 0}=t,{zoom:jt=16}=t,{fetchParameters:ye={}}=t;function si(){tr.focus()}function Bn(){tr.blur()}function $n(x,qt=!0){e(1,X=x),qt?(e(13,Ut=-1),Hu()):(js(),setTimeout(()=>{tr.focus(),tr.select()}))}let me=!1,nt,Ot,Et,Yu="",tr,Ut=-1,Br,os=[],ai,Ui,ss;const Gr=sl();ol(()=>{w&&(w.setEventHandler(void 0),w.indicateReverse(!1),w.setSelectedMarker(-1),w.setMarkers(void 0,void 0))});function Hu(x){if(Ui&&(clearTimeout(Ui),Ui=void 0),Ut>-1&&nt)e(45,Et=nt[Ut]),e(1,X=Et.place_name.replace(/,.*/,"")),e(16,Br=void 0),e(44,Ot=void 0),e(13,Ut=-1);else if(X){const qt=x||!Wu();Ws(X,{exact:!0}).then(()=>{e(44,Ot=nt),e(45,Et=void 0),qt&&Jc()}).catch(er=>e(16,Br=er))}}function Wu(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(X)}async function Ws(x,{byId:qt=!1,exact:er=!1}={}){e(16,Br=void 0);const No=Wu(),Je=new URLSearchParams;I!=null&&Je.set("language",Array.isArray(I)?I.join(","):I),Pt&&Je.set("types",Pt.join(",")),No||(u&&Je.set("bbox",u.map(kr=>kr.toFixed(6)).join(",")),h&&Je.set("country",Array.isArray(h)?h.join(","):h)),qt||(D&&Je.set("proximity",D.map(kr=>kr.toFixed(6)).join(",")),(er||!W)&&Je.set("autocomplete","false"),Je.set("fuzzyMatch",String(C))),N!==void 0&&Je.set("limit",String(N)),Je.set("key",a);const ui="https://api.maptiler.com/geocoding/"+encodeURIComponent(x)+".json?"+Je.toString();if(ui===Yu){qt?(e(12,nt=void 0),e(45,Et=os[0])):e(12,nt=os);return}Yu=ui,ai==null||ai.abort();const be=new AbortController;e(17,ai=be);let Qs;try{Qs=await fetch(ui,{signal:be.signal,...ye}).finally(()=>{be===ai&&e(17,ai=void 0)})}catch(kr){if(kr&&typeof kr=="object"&&"name"in kr&&kr.name==="AbortError")return;throw new Error}if(!Qs.ok)throw new Error;const Js=await Qs.json();Gr("response",{url:ui,featureCollection:Js}),qt?(e(12,nt=void 0),e(45,Et=Js.features[0]),os=[Et]):(e(12,nt=Js.features.filter(d)),os=nt,No&&tr.focus())}function Jc(){var er,No,Je,ui;if(!(Ot!=null&&Ot.length)||!y)return;const x=[180,90,-180,-90],qt=!Ot.some(be=>!be.matching_text);for(const be of Ot)(qt||!be.matching_text)&&(x[0]=Math.min(x[0],((er=be.bbox)==null?void 0:er[0])??be.center[0]),x[1]=Math.min(x[1],((No=be.bbox)==null?void 0:No[1])??be.center[1]),x[2]=Math.max(x[2],((Je=be.bbox)==null?void 0:Je[2])??be.center[0]),x[3]=Math.max(x[3],((ui=be.bbox)==null?void 0:ui[3])??be.center[1]));w&&Ot.length>0&&(Et&&x[0]===x[2]&&x[1]===x[3]?w.flyTo(Et.center,jt):w.fitBounds(da(x),50))}function Zc(x){e(0,R=p==="always"),$n(Sl(x[0],[-180,180],!0).toFixed(6)+","+x[1].toFixed(6))}function $c(x){if(!nt)return;let qt=x.key==="ArrowDown"?1:x.key==="ArrowUp"?-1:0;qt?(Ut===-1&&qt===-1&&e(13,Ut=nt.length),e(13,Ut+=qt),Ut>=nt.length&&e(13,Ut=-1),x.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(x.key)&&e(13,Ut=-1)}function js(x=!0){if(W&&X.length>b){Ui&&clearTimeout(Ui);const qt=X;Ui=window.setTimeout(()=>{Ws(qt).catch(er=>e(16,Br=er))},x?g:0)}else e(12,nt=void 0),e(16,Br=void 0)}function Ks(x){e(45,Et=x),e(1,X=x.place_name),e(13,Ut=-1)}const tf=()=>tr.focus();function ef(x){us[x?"unshift":"push"](()=>{tr=x,e(15,tr)})}function nf(){X=this.value,e(1,X),e(11,me),e(25,c)}const rf=()=>e(11,me=!0),of=()=>e(11,me=!1),sf=()=>js(),af=()=>{e(1,X=""),tr.focus()},uf=()=>e(0,R=!R),lf=x=>e(13,Ut=x),cf=x=>Ks(x),ff=()=>e(13,Ut=-1),hf=()=>{};return r.$$set=x=>{"class"in x&&e(2,s=x.class),"apiKey"in x&&e(23,a=x.apiKey),"bbox"in x&&e(24,u=x.bbox),"clearButtonTitle"in x&&e(3,l=x.clearButtonTitle),"clearOnBlur"in x&&e(25,c=x.clearOnBlur),"collapsed"in x&&e(4,f=x.collapsed),"country"in x&&e(26,h=x.country),"debounceSearch"in x&&e(27,g=x.debounceSearch),"enableReverse"in x&&e(5,p=x.enableReverse),"errorMessage"in x&&e(6,_=x.errorMessage),"filter"in x&&e(28,d=x.filter),"flyTo"in x&&e(29,y=x.flyTo),"fuzzyMatch"in x&&e(30,C=x.fuzzyMatch),"language"in x&&e(31,I=x.language),"limit"in x&&e(32,N=x.limit),"mapController"in x&&e(33,w=x.mapController),"minLength"in x&&e(34,b=x.minLength),"noResultsMessage"in x&&e(7,A=x.noResultsMessage),"placeholder"in x&&e(8,F=x.placeholder),"proximity"in x&&e(22,D=x.proximity),"reverseActive"in x&&e(0,R=x.reverseActive),"reverseButtonTitle"in x&&e(9,z=x.reverseButtonTitle),"searchValue"in x&&e(1,X=x.searchValue),"showFullGeometry"in x&&e(35,it=x.showFullGeometry),"showPlaceType"in x&&e(10,O=x.showPlaceType),"showResultsWhileTyping"in x&&e(36,W=x.showResultsWhileTyping),"trackProximity"in x&&e(37,at=x.trackProximity),"types"in x&&e(38,Pt=x.types),"zoom"in x&&e(39,jt=x.zoom),"fetchParameters"in x&&e(40,ye=x.fetchParameters),"$$scope"in x&&e(47,o=x.$$scope)},r.$$.update=()=>{if(r.$$.dirty[1]&64&&(at||e(22,D=void 0)),r.$$.dirty[0]&33556480&&setTimeout(()=>{e(14,ss=me),c&&!me&&e(1,X="")}),r.$$.dirty[0]&4098&&(X||(e(45,Et=void 0),e(12,nt=void 0),e(16,Br=void 0),e(44,Ot=nt))),r.$$.dirty[1]&16400&&it&&Et&&!Et.address&&Et.geometry.type==="Point"&&Ws(Et.id,{byId:!0}).catch(x=>e(16,Br=x)),r.$$.dirty[0]&536870912|r.$$.dirty[1]&16644&&w&&Et&&y&&(!Et.bbox||Et.bbox[0]===Et.bbox[2]&&Et.bbox[1]===Et.bbox[3]?w.flyTo(Et.center,jt):w.fitBounds(da(Et.bbox),50),e(12,nt=void 0),e(44,Ot=void 0),e(13,Ut=-1)),r.$$.dirty[0]&4096|r.$$.dirty[1]&8192&&Ot!==nt&&e(44,Ot=void 0),r.$$.dirty[1]&24580&&w&&w.setMarkers(Ot,Et),r.$$.dirty[0]&2&&e(13,Ut=-1),r.$$.dirty[0]&20481|r.$$.dirty[1]&68&&w&&w.setEventHandler(x=>{switch(x.type){case"mapClick":R&&Zc(x.coordinates);break;case"proximityChange":e(22,D=at?x.proximity:void 0);break;case"markerClick":{const qt=nt==null?void 0:nt.find(er=>er.id===x.id);qt&&Ks(qt)}break;case"markerMouseEnter":e(13,Ut=ss?(nt==null?void 0:nt.findIndex(qt=>qt.id===x.id))??-1:-1);break;case"markerMouseLeave":e(13,Ut=-1);break}}),r.$$.dirty[0]&8192|r.$$.dirty[1]&4&&(w==null||w.setSelectedMarker(Ut)),r.$$.dirty[0]&12288&&e(46,n=nt==null?void 0:nt[Ut]),r.$$.dirty[0]&2|r.$$.dirty[1]&4){const x=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(X);w==null||w.setReverseMarker(x?[Number(x[1]),Number(x[2])]:void 0)}r.$$.dirty[1]&32768&&Gr("select",n),r.$$.dirty[1]&16384&&Gr("pick",Et),r.$$.dirty[0]&20480&&Gr("optionsVisibilityChange",ss&&!!nt),r.$$.dirty[0]&4096&&Gr("featuresListed",nt),r.$$.dirty[1]&8192&&Gr("featuresMarked",Ot),r.$$.dirty[0]&1&&Gr("reverseToggle",R),r.$$.dirty[0]&2&&Gr("queryChange",X),r.$$.dirty[0]&1|r.$$.dirty[1]&4&&w&&w.indicateReverse(R)},[R,X,s,l,f,p,_,A,F,z,O,me,nt,Ut,ss,tr,Br,ai,Hu,$c,js,Ks,D,a,u,c,h,g,d,y,C,I,N,w,b,it,W,at,Pt,jt,ye,si,Bn,$n,Ot,Et,n,o,i,tf,ef,nf,rf,of,sf,af,uf,lf,cf,ff,hf]}let Ll=class extends pi{constructor(t){super(),gi(this,t,wl,xl,li,{class:2,apiKey:23,bbox:24,clearButtonTitle:3,clearOnBlur:25,collapsed:4,country:26,debounceSearch:27,enableReverse:5,errorMessage:6,filter:28,flyTo:29,fuzzyMatch:30,language:31,limit:32,mapController:33,minLength:34,noResultsMessage:7,placeholder:8,proximity:22,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:35,showPlaceType:10,showResultsWhileTyping:36,trackProximity:37,types:38,zoom:39,fetchParameters:40,focus:41,blur:42,setQuery:43},null,[-1,-1,-1])}get focus(){return this.$$.ctx[41]}get blur(){return this.$$.ctx[42]}get setQuery(){return this.$$.ctx[43]}};/**
|
|
1
|
+
(function(Ot,Zt){typeof exports=="object"&&typeof module<"u"?Zt(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],Zt):(Ot=typeof globalThis<"u"?globalThis:Ot||self,Zt(Ot.leafletMaptilerGeocoder={},Ot.leaflet))})(this,function(Ot,Zt){var Gn,fi;"use strict";var Ju=(Ot,Zt,tn)=>{if(!Zt.has(Ot))throw TypeError("Cannot "+tn)};var sr=(Ot,Zt,tn)=>(Ju(Ot,Zt,"read from private field"),tn?tn.call(Ot):Zt.get(Ot)),ta=(Ot,Zt,tn)=>{if(Zt.has(Ot))throw TypeError("Cannot add the same private member more than once");Zt instanceof WeakSet?Zt.add(Ot):Zt.set(Ot,tn)},ls=(Ot,Zt,tn,en)=>(Ju(Ot,Zt,"write to private field"),en?en.call(Ot,tn):Zt.set(Ot,tn),tn);function tn(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const en=tn(Zt);function vt(){}function Zu(r,t){for(const e in t)r[e]=t[e];return r}function ea(r){return r()}function na(){return Object.create(null)}function Ir(r){r.forEach(ea)}function ra(r){return typeof r=="function"}function Cr(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function $u(r){return Object.keys(r).length===0}function tl(r,t,e,n){if(r){const i=ia(r,t,e,n);return r[0](i)}}function ia(r,t,e,n){return r[1]&&n?Zu(e.ctx.slice(),r[1](n(t))):e.ctx}function el(r,t,e,n){if(r[2]&&n){const i=r[2](n(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(t.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=t.dirty[a]|i[a];return o}return t.dirty|i}return t.dirty}function nl(r,t,e,n,i,o){if(i){const s=ia(t,e,n,o);r.p(s,i)}}function rl(r){if(r.ctx.length>32){const t=[],e=r.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function oa(r){return r??""}function nt(r,t){r.appendChild(t)}function De(r,t,e){r.insertBefore(t,e||null)}function Ie(r){r.parentNode&&r.parentNode.removeChild(r)}function il(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function Bt(r){return document.createElement(r)}function zn(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Hr(r){return document.createTextNode(r)}function Nn(){return Hr(" ")}function Te(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function ol(r){return function(t){return t.preventDefault(),r.call(this,t)}}function D(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function sl(r){return Array.from(r.childNodes)}function Hi(r,t){t=""+t,r.data!==t&&(r.data=t)}function sa(r,t){r.value=t??""}function nn(r,t,e){r.classList[e?"add":"remove"](t)}function al(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Wi;function ji(r){Wi=r}function aa(){if(!Wi)throw new Error("Function called outside component initialization");return Wi}function ul(r){aa().$$.on_destroy.push(r)}function ll(){const r=aa();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=al(t,e,{cancelable:n});return i.slice().forEach(s=>{s.call(r,o)}),!o.defaultPrevented}return!0}}function ua(r,t){const e=r.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const di=[],cs=[];let vi=[];const la=[],cl=Promise.resolve();let fs=!1;function fl(){fs||(fs=!0,cl.then(ca))}function hs(r){vi.push(r)}const gs=new Set;let yi=0;function ca(){if(yi!==0)return;const r=Wi;do{try{for(;yi<di.length;){const t=di[yi];yi++,ji(t),hl(t.$$)}}catch(t){throw di.length=0,yi=0,t}for(ji(null),di.length=0,yi=0;cs.length;)cs.pop()();for(let t=0;t<vi.length;t+=1){const e=vi[t];gs.has(e)||(gs.add(e),e())}vi.length=0}while(di.length);for(;la.length;)la.pop()();fs=!1,gs.clear(),ji(r)}function hl(r){if(r.fragment!==null){r.update(),Ir(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(hs)}}function gl(r){const t=[],e=[];vi.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),vi=t}const So=new Set;let Wr;function wo(){Wr={r:0,c:[],p:Wr}}function Lo(){Wr.r||Ir(Wr.c),Wr=Wr.p}function Tt(r,t){r&&r.i&&(So.delete(r),r.i(t))}function ue(r,t,e,n){if(r&&r.o){if(So.has(r))return;So.add(r),Wr.c.push(()=>{So.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function Nr(r){r&&r.c()}function ar(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||hs(()=>{const s=r.$$.on_mount.map(ea).filter(ra);r.$$.on_destroy?r.$$.on_destroy.push(...s):Ir(s),r.$$.on_mount=[]}),o.forEach(hs)}function ur(r,t){const e=r.$$;e.fragment!==null&&(gl(e.after_update),Ir(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function pl(r,t){r.$$.dirty[0]===-1&&(di.push(r),fl(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function xr(r,t,e,n,i,o,s,a=[-1]){const u=Wi;ji(r);const l=r.$$={fragment:null,ctx:[],props:o,update:vt,not_equal:i,bound:na(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:na(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=e?e(r,t.props||{},(f,h,...g)=>{const p=g.length?g[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&pl(r,f)),h}):[],l.update(),c=!0,Ir(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const f=sl(t.target);l.fragment&&l.fragment.l(f),f.forEach(Ie)}else l.fragment&&l.fragment.c();t.intro&&Tt(r.$$.fragment),ar(r,t.target,t.anchor,t.customElement),ca()}ji(u)}class Sr{$destroy(){ur(this,1),this.$destroy=vt}$on(t,e){if(!ra(e))return vt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!$u(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ef="";function dl(r){let t,e;return{c(){t=zn("svg"),e=zn("path"),D(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),D(t,"viewBox","0 0 14 14"),D(t,"width","13"),D(t,"height","13"),D(t,"class","svelte-en2qvf")},m(n,i){De(n,t,i),nt(t,e)},p:vt,i:vt,o:vt,d(n){n&&Ie(t)}}}class fa extends Sr{constructor(t){super(),xr(this,t,null,dl,Cr,{})}}const If="";function vl(r){let t,e;return{c(){t=zn("svg"),e=zn("path"),D(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),D(t,"viewBox","0 0 30 30"),D(t,"fill","none"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"class","svelte-d2loi5")},m(n,i){De(n,t,i),nt(t,e)},p:vt,i:vt,o:vt,d(n){n&&Ie(t)}}}class ha extends Sr{constructor(t){super(),xr(this,t,null,vl,Cr,{})}}const Cf="";function ga(r){var i,o;let t,e=(((o=(i=r[0].properties)==null?void 0:i.place_type_name)==null?void 0:o[0])??r[0].place_type[0])+"",n;return{c(){t=Bt("span"),n=Hr(e),D(t,"class","line2 svelte-ewziy4")},m(s,a){De(s,t,a),nt(t,n)},p(s,a){var u,l;a&1&&e!==(e=(((l=(u=s[0].properties)==null?void 0:u.place_type_name)==null?void 0:l[0])??s[0].place_type[0])+"")&&Hi(n,e)},d(s){s&&Ie(t)}}}function yl(r){let t,e,n,i,o=r[0].place_name.replace(/,.*/,"")+"",s,a,u,l=r[0].place_name.replace(/[^,]*,?\s*/,"")+"",c,f,h,g,p=r[2]&&ga(r);return{c(){t=Bt("li"),e=Bt("span"),n=Bt("span"),i=Bt("span"),s=Hr(o),a=Nn(),u=Bt("span"),c=Hr(l),f=Nn(),p&&p.c(),D(i,"class","primary svelte-ewziy4"),D(u,"class","secondary svelte-ewziy4"),D(n,"class","svelte-ewziy4"),D(e,"class","texts svelte-ewziy4"),D(t,"tabindex","0"),D(t,"data-selected",r[1]),D(t,"class","svelte-ewziy4"),nn(t,"selected",r[1])},m(y,d){De(y,t,d),nt(t,e),nt(e,n),nt(n,i),nt(i,s),nt(n,a),nt(n,u),nt(u,c),nt(e,f),p&&p.m(e,null),h||(g=[Te(t,"mouseenter",r[3]),Te(t,"focus",r[4])],h=!0)},p(y,[d]){d&1&&o!==(o=y[0].place_name.replace(/,.*/,"")+"")&&Hi(s,o),d&1&&l!==(l=y[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Hi(c,l),y[2]?p?p.p(y,d):(p=ga(y),p.c(),p.m(e,null)):p&&(p.d(1),p=null),d&2&&D(t,"data-selected",y[1]),d&2&&nn(t,"selected",y[1])},i:vt,o:vt,d(y){y&&Ie(t),p&&p.d(),h=!1,Ir(g)}}}function ml(r,t,e){let{feature:n}=t,{selected:i=!1}=t,{showPlaceType:o=!1}=t;function s(u){ua.call(this,r,u)}function a(u){ua.call(this,r,u)}return r.$$set=u=>{"feature"in u&&e(0,n=u.feature),"selected"in u&&e(1,i=u.selected),"showPlaceType"in u&&e(2,o=u.showPlaceType)},[n,i,o,s,a]}class _l extends Sr{constructor(t){super(),xr(this,t,ml,yl,Cr,{feature:0,selected:1,showPlaceType:2})}}const Nf="";function El(r){let t;return{c(){t=Bt("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',D(t,"class","svelte-7cmwmc")},m(e,n){De(e,t,n)},p:vt,i:vt,o:vt,d(e){e&&Ie(t)}}}class Il extends Sr{constructor(t){super(),xr(this,t,null,El,Cr,{})}}const xf="";function Cl(r){let t,e;return{c(){t=zn("svg"),e=zn("path"),D(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),D(t,"viewBox","0 0 60.006 21.412"),D(t,"width","14"),D(t,"height","20"),D(t,"class","svelte-en2qvf")},m(n,i){De(n,t,i),nt(t,e)},p:vt,i:vt,o:vt,d(n){n&&Ie(t)}}}class Nl extends Sr{constructor(t){super(),xr(this,t,null,Cl,Cr,{})}}const Sf="";function xl(r){let t,e;return{c(){t=zn("svg"),e=zn("path"),D(e,"d","M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"),D(t,"width","14"),D(t,"height","14"),D(t,"viewBox","0 0 15 15"),D(t,"class","svelte-en2qvf")},m(n,i){De(n,t,i),nt(t,e)},p:vt,i:vt,o:vt,d(n){n&&Ie(t)}}}class Sl extends Sr{constructor(t){super(),xr(this,t,null,xl,Cr,{})}}const wf="";function pa(r,t,e){const n=r.slice();return n[70]=t[e],n[72]=e,n}function da(r){let t,e;return t=new Il({}),{c(){Nr(t.$$.fragment)},m(n,i){ar(t,n,i),e=!0},i(n){e||(Tt(t.$$.fragment,n),e=!0)},o(n){ue(t.$$.fragment,n),e=!1},d(n){ur(t,n)}}}function va(r){let t,e,n,i,o;return e=new Nl({}),{c(){t=Bt("button"),Nr(e.$$.fragment),D(t,"type","button"),D(t,"title",r[9]),D(t,"class","svelte-1r7dvt7"),nn(t,"active",r[0])},m(s,a){De(s,t,a),ar(e,t,null),n=!0,i||(o=Te(t,"click",r[56]),i=!0)},p(s,a){(!n||a[0]&512)&&D(t,"title",s[9]),(!n||a[0]&1)&&nn(t,"active",s[0])},i(s){n||(Tt(e.$$.fragment,s),n=!0)},o(s){ue(e.$$.fragment,s),n=!1},d(s){s&&Ie(t),ur(e),i=!1,o()}}}function wl(r){let t,e,n,i,o=r[12],s=[];for(let u=0;u<o.length;u+=1)s[u]=ya(pa(r,o,u));const a=u=>ue(s[u],1,1,()=>{s[u]=null});return{c(){t=Bt("ul");for(let u=0;u<s.length;u+=1)s[u].c();D(t,"class","svelte-1r7dvt7")},m(u,l){De(u,t,l);for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(t,null);e=!0,n||(i=[Te(t,"mouseleave",r[60]),Te(t,"blur",r[61])],n=!0)},p(u,l){if(l[0]&2110464){o=u[12];let c;for(c=0;c<o.length;c+=1){const f=pa(u,o,c);s[c]?(s[c].p(f,l),Tt(s[c],1)):(s[c]=ya(f),s[c].c(),Tt(s[c],1),s[c].m(t,null))}for(wo(),c=o.length;c<s.length;c+=1)a(c);Lo()}},i(u){if(!e){for(let l=0;l<o.length;l+=1)Tt(s[l]);e=!0}},o(u){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)ue(s[l]);e=!1},d(u){u&&Ie(t),il(s,u),n=!1,Ir(i)}}}function Ll(r){let t,e,n,i,o,s;return e=new ha({}),{c(){t=Bt("div"),Nr(e.$$.fragment),n=Nn(),i=Bt("div"),o=Hr(r[7]),D(i,"class","svelte-1r7dvt7"),D(t,"class","no-results svelte-1r7dvt7")},m(a,u){De(a,t,u),ar(e,t,null),nt(t,n),nt(t,i),nt(i,o),s=!0},p(a,u){(!s||u[0]&128)&&Hi(o,a[7])},i(a){s||(Tt(e.$$.fragment,a),s=!0)},o(a){ue(e.$$.fragment,a),s=!1},d(a){a&&Ie(t),ur(e)}}}function bl(r){let t="",e;return{c(){e=Hr(t)},m(n,i){De(n,e,i)},p:vt,i:vt,o:vt,d(n){n&&Ie(e)}}}function Pl(r){let t,e,n,i,o,s,a,u,l,c,f;return e=new ha({}),u=new fa({}),{c(){t=Bt("div"),Nr(e.$$.fragment),n=Nn(),i=Bt("div"),o=Hr(r[6]),s=Nn(),a=Bt("button"),Nr(u.$$.fragment),D(i,"class","svelte-1r7dvt7"),D(a,"class","svelte-1r7dvt7"),D(t,"class","error svelte-1r7dvt7")},m(h,g){De(h,t,g),ar(e,t,null),nt(t,n),nt(t,i),nt(i,o),nt(t,s),nt(t,a),ar(u,a,null),l=!0,c||(f=Te(a,"click",r[57]),c=!0)},p(h,g){(!l||g[0]&64)&&Hi(o,h[6])},i(h){l||(Tt(e.$$.fragment,h),Tt(u.$$.fragment,h),l=!0)},o(h){ue(e.$$.fragment,h),ue(u.$$.fragment,h),l=!1},d(h){h&&Ie(t),ur(e),ur(u),c=!1,f()}}}function ya(r){let t,e;function n(){return r[58](r[72])}function i(){return r[59](r[70])}return t=new _l({props:{feature:r[70],showPlaceType:r[10],selected:r[13]===r[72]}}),t.$on("mouseenter",n),t.$on("focus",i),{c(){Nr(t.$$.fragment)},m(o,s){ar(t,o,s),e=!0},p(o,s){r=o;const a={};s[0]&4096&&(a.feature=r[70]),s[0]&1024&&(a.showPlaceType=r[10]),s[0]&8192&&(a.selected=r[13]===r[72]),t.$set(a)},i(o){e||(Tt(t.$$.fragment,o),e=!0)},o(o){ue(t.$$.fragment,o),e=!1},d(o){ur(t,o)}}}function Rl(r){let t,e,n,i,o,s,a,u,l,c,f,h,g,p,y,d,_,I,C,L;i=new Sl({}),c=new fa({});let x=r[17]&&da(),w=r[5]===!0&&va(r);const A=r[48].default,B=tl(A,r,r[47],null),F=[Pl,bl,Ll,wl],q=[];function j(P,X){var R,Y;return P[16]?0:P[14]?((R=P[12])==null?void 0:R.length)===0?2:P[14]&&((Y=P[12])!=null&&Y.length)?3:-1:1}return~(y=j(r))&&(d=q[y]=F[y](r)),{c(){t=Bt("form"),e=Bt("div"),n=Bt("button"),Nr(i.$$.fragment),o=Nn(),s=Bt("input"),a=Nn(),u=Bt("div"),l=Bt("button"),Nr(c.$$.fragment),f=Nn(),x&&x.c(),h=Nn(),w&&w.c(),g=Nn(),B&&B.c(),p=Nn(),d&&d.c(),D(n,"class","search-button svelte-1r7dvt7"),D(n,"type","button"),D(s,"placeholder",r[8]),D(s,"aria-label",r[8]),D(s,"class","svelte-1r7dvt7"),D(l,"type","button"),D(l,"title",r[3]),D(l,"class","svelte-1r7dvt7"),D(u,"class","clear-button-container svelte-1r7dvt7"),nn(u,"displayable",r[1]!==""),D(e,"class","input-group svelte-1r7dvt7"),D(t,"tabindex","0"),D(t,"class",_=oa(r[2])+" svelte-1r7dvt7"),nn(t,"can-collapse",r[4]&&r[1]==="")},m(P,X){De(P,t,X),nt(t,e),nt(e,n),ar(i,n,null),nt(e,o),nt(e,s),r[50](s),sa(s,r[1]),nt(e,a),nt(e,u),nt(u,l),ar(c,l,null),nt(u,f),x&&x.m(u,null),nt(e,h),w&&w.m(e,null),nt(e,g),B&&B.m(e,null),nt(t,p),~y&&q[y].m(t,null),I=!0,C||(L=[Te(n,"click",r[49]),Te(s,"input",r[51]),Te(s,"focus",r[52]),Te(s,"blur",r[53]),Te(s,"keydown",r[19]),Te(s,"input",r[54]),Te(l,"click",r[55]),Te(t,"submit",ol(r[18]))],C=!0)},p(P,X){(!I||X[0]&256)&&D(s,"placeholder",P[8]),(!I||X[0]&256)&&D(s,"aria-label",P[8]),X[0]&2&&s.value!==P[1]&&sa(s,P[1]),(!I||X[0]&8)&&D(l,"title",P[3]),P[17]?x?X[0]&131072&&Tt(x,1):(x=da(),x.c(),Tt(x,1),x.m(u,null)):x&&(wo(),ue(x,1,1,()=>{x=null}),Lo()),(!I||X[0]&2)&&nn(u,"displayable",P[1]!==""),P[5]===!0?w?(w.p(P,X),X[0]&32&&Tt(w,1)):(w=va(P),w.c(),Tt(w,1),w.m(e,g)):w&&(wo(),ue(w,1,1,()=>{w=null}),Lo()),B&&B.p&&(!I||X[1]&65536)&&nl(B,A,P,P[47],I?el(A,P[47],X,null):rl(P[47]),null);let R=y;y=j(P),y===R?~y&&q[y].p(P,X):(d&&(wo(),ue(q[R],1,1,()=>{q[R]=null}),Lo()),~y?(d=q[y],d?d.p(P,X):(d=q[y]=F[y](P),d.c()),Tt(d,1),d.m(t,null)):d=null),(!I||X[0]&4&&_!==(_=oa(P[2])+" svelte-1r7dvt7"))&&D(t,"class",_),(!I||X[0]&22)&&nn(t,"can-collapse",P[4]&&P[1]==="")},i(P){I||(Tt(i.$$.fragment,P),Tt(c.$$.fragment,P),Tt(x),Tt(w),Tt(B,P),Tt(d),I=!0)},o(P){ue(i.$$.fragment,P),ue(c.$$.fragment,P),ue(x),ue(w),ue(B,P),ue(d),I=!1},d(P){P&&Ie(t),ur(i),r[50](null),ur(c),x&&x.d(),w&&w.d(),B&&B.d(P),~y&&q[y].d(),C=!1,Ir(L)}}}function Ol(r,t,e){const n=t[1],i=t[0],o=n-i;return r===n&&e?r:((r-i)%o+o)%o+i}function ma(r){let t=[...r];return t[2]<t[0]&&(t[2]+=360),t}function Dl(r,t,e){let n,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:p=!1}=t,{errorMessage:y="Something went wrong…"}=t,{filter:d=()=>!0}=t,{flyTo:_=!0}=t,{fuzzyMatch:I=!0}=t,{language:C=void 0}=t,{limit:L=void 0}=t,{mapController:x=void 0}=t,{minLength:w=2}=t,{noResultsMessage:A="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:B="Search"}=t,{proximity:F=void 0}=t,{reverseActive:q=p==="always"}=t,{reverseButtonTitle:j="toggle reverse geocoding"}=t,{searchValue:P=""}=t,{showFullGeometry:X=!0}=t,{showPlaceType:R=!1}=t,{showResultsWhileTyping:Y=!0}=t,{trackProximity:ut=!0}=t,{types:Rt=void 0}=t,{zoom:Jt=16}=t,{fetchParameters:_e={}}=t;function hi(){rr.focus()}function kn(){rr.blur()}function nr(N,Ht=!0){e(1,P=N),Ht?(e(13,Yt=-1),Ku()):(Qs(),setTimeout(()=>{rr.focus(),rr.select()}))}let Ee=!1,it,Dt,It,ju="",rr,Yt=-1,ir,as=[],gi,Yi,us;const Xr=ll();ul(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Ku(N){if(Yi&&(clearTimeout(Yi),Yi=void 0),Yt>-1&&it)e(45,It=it[Yt]),e(1,P=It.place_name.replace(/,.*/,"")),e(16,ir=void 0),e(44,Dt=void 0),e(13,Yt=-1);else if(P){const Ht=N||!Qu();Ks(P,{exact:!0}).then(()=>{e(44,Dt=it),e(45,It=void 0),Ht&&rf()}).catch(or=>e(16,ir=or))}}function Qu(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(P)}async function Ks(N,{byId:Ht=!1,exact:or=!1}={}){e(16,ir=void 0);const xo=Qu(),$e=new URLSearchParams;C!=null&&$e.set("language",Array.isArray(C)?C.join(","):C),Rt&&$e.set("types",Rt.join(",")),xo||(u&&$e.set("bbox",u.map(Yr=>Yr.toFixed(6)).join(",")),h&&$e.set("country",Array.isArray(h)?h.join(","):h)),Ht||(F&&$e.set("proximity",F.map(Yr=>Yr.toFixed(6)).join(",")),(or||!Y)&&$e.set("autocomplete","false"),$e.set("fuzzyMatch",String(I))),L!==void 0&&$e.set("limit",String(L)),$e.set("key",a);const pi="https://api.maptiler.com/geocoding/"+encodeURIComponent(N)+".json?"+$e.toString();if(pi===ju){Ht?(e(12,it=void 0),e(45,It=as[0])):e(12,it=as);return}ju=pi,gi==null||gi.abort();const Oe=new AbortController;e(17,gi=Oe);let Zs;try{Zs=await fetch(pi,{signal:Oe.signal,..._e}).finally(()=>{Oe===gi&&e(17,gi=void 0)})}catch(Yr){if(Yr&&typeof Yr=="object"&&"name"in Yr&&Yr.name==="AbortError")return;throw new Error}if(!Zs.ok)throw new Error;const $s=await Zs.json();Xr("response",{url:pi,featureCollection:$s}),Ht?(e(12,it=void 0),e(45,It=$s.features[0]),as=[It]):(e(12,it=$s.features.filter(d)),as=it,xo&&rr.focus())}function rf(){var or,xo,$e,pi;if(!(Dt!=null&&Dt.length)||!_)return;const N=[180,90,-180,-90],Ht=!Dt.some(Oe=>!Oe.matching_text);for(const Oe of Dt)(Ht||!Oe.matching_text)&&(N[0]=Math.min(N[0],((or=Oe.bbox)==null?void 0:or[0])??Oe.center[0]),N[1]=Math.min(N[1],((xo=Oe.bbox)==null?void 0:xo[1])??Oe.center[1]),N[2]=Math.max(N[2],(($e=Oe.bbox)==null?void 0:$e[2])??Oe.center[0]),N[3]=Math.max(N[3],((pi=Oe.bbox)==null?void 0:pi[3])??Oe.center[1]));x&&Dt.length>0&&(It&&N[0]===N[2]&&N[1]===N[3]?x.flyTo(It.center,Jt):x.fitBounds(ma(N),50))}function of(N){e(0,q=p==="always"),nr(Ol(N[0],[-180,180],!0).toFixed(6)+","+N[1].toFixed(6))}function sf(N){if(!it)return;let Ht=N.key==="ArrowDown"?1:N.key==="ArrowUp"?-1:0;Ht?(Yt===-1&&Ht===-1&&e(13,Yt=it.length),e(13,Yt+=Ht),Yt>=it.length&&e(13,Yt=-1),N.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(N.key)&&e(13,Yt=-1)}function Qs(N=!0){if(e(16,ir=void 0),Y){if(Yi&&clearTimeout(Yi),P.length<=w)return;const Ht=P;Yi=window.setTimeout(()=>{Ks(Ht).catch(or=>e(16,ir=or))},N?g:0)}else e(12,it=void 0),e(16,ir=void 0)}function Js(N){e(45,It=N),e(1,P=N.place_name),e(13,Yt=-1)}const af=()=>rr.focus();function uf(N){cs[N?"unshift":"push"](()=>{rr=N,e(15,rr)})}function lf(){P=this.value,e(1,P),e(11,Ee),e(25,c)}const cf=()=>e(11,Ee=!0),ff=()=>e(11,Ee=!1),hf=()=>Qs(),gf=()=>{e(1,P=""),rr.focus()},pf=()=>e(0,q=!q),df=()=>e(16,ir=void 0),vf=N=>e(13,Yt=N),yf=N=>Js(N),mf=()=>e(13,Yt=-1),_f=()=>{};return r.$$set=N=>{"class"in N&&e(2,s=N.class),"apiKey"in N&&e(23,a=N.apiKey),"bbox"in N&&e(24,u=N.bbox),"clearButtonTitle"in N&&e(3,l=N.clearButtonTitle),"clearOnBlur"in N&&e(25,c=N.clearOnBlur),"collapsed"in N&&e(4,f=N.collapsed),"country"in N&&e(26,h=N.country),"debounceSearch"in N&&e(27,g=N.debounceSearch),"enableReverse"in N&&e(5,p=N.enableReverse),"errorMessage"in N&&e(6,y=N.errorMessage),"filter"in N&&e(28,d=N.filter),"flyTo"in N&&e(29,_=N.flyTo),"fuzzyMatch"in N&&e(30,I=N.fuzzyMatch),"language"in N&&e(31,C=N.language),"limit"in N&&e(32,L=N.limit),"mapController"in N&&e(33,x=N.mapController),"minLength"in N&&e(34,w=N.minLength),"noResultsMessage"in N&&e(7,A=N.noResultsMessage),"placeholder"in N&&e(8,B=N.placeholder),"proximity"in N&&e(22,F=N.proximity),"reverseActive"in N&&e(0,q=N.reverseActive),"reverseButtonTitle"in N&&e(9,j=N.reverseButtonTitle),"searchValue"in N&&e(1,P=N.searchValue),"showFullGeometry"in N&&e(35,X=N.showFullGeometry),"showPlaceType"in N&&e(10,R=N.showPlaceType),"showResultsWhileTyping"in N&&e(36,Y=N.showResultsWhileTyping),"trackProximity"in N&&e(37,ut=N.trackProximity),"types"in N&&e(38,Rt=N.types),"zoom"in N&&e(39,Jt=N.zoom),"fetchParameters"in N&&e(40,_e=N.fetchParameters),"$$scope"in N&&e(47,o=N.$$scope)},r.$$.update=()=>{if(r.$$.dirty[1]&64&&(ut||e(22,F=void 0)),r.$$.dirty[0]&33556480&&setTimeout(()=>{e(14,us=Ee),c&&!Ee&&e(1,P="")}),r.$$.dirty[0]&4098&&(P||(e(45,It=void 0),e(12,it=void 0),e(16,ir=void 0),e(44,Dt=it))),r.$$.dirty[1]&16400&&X&&It&&!It.address&&It.geometry.type==="Point"&&Ks(It.id,{byId:!0}).catch(N=>e(16,ir=N)),r.$$.dirty[0]&536870912|r.$$.dirty[1]&16644&&x&&It&&_&&(!It.bbox||It.bbox[0]===It.bbox[2]&&It.bbox[1]===It.bbox[3]?x.flyTo(It.center,Jt):x.fitBounds(ma(It.bbox),50),e(12,it=void 0),e(44,Dt=void 0),e(13,Yt=-1)),r.$$.dirty[0]&4096|r.$$.dirty[1]&8192&&Dt!==it&&e(44,Dt=void 0),r.$$.dirty[1]&24580&&x&&x.setMarkers(Dt,It),r.$$.dirty[0]&2&&e(13,Yt=-1),r.$$.dirty[0]&20481|r.$$.dirty[1]&68&&x&&x.setEventHandler(N=>{switch(N.type){case"mapClick":q&&of(N.coordinates);break;case"proximityChange":e(22,F=ut?N.proximity:void 0);break;case"markerClick":{const Ht=it==null?void 0:it.find(or=>or.id===N.id);Ht&&Js(Ht)}break;case"markerMouseEnter":e(13,Yt=us?(it==null?void 0:it.findIndex(Ht=>Ht.id===N.id))??-1:-1);break;case"markerMouseLeave":e(13,Yt=-1);break}}),r.$$.dirty[0]&8192|r.$$.dirty[1]&4&&(x==null||x.setSelectedMarker(Yt)),r.$$.dirty[0]&12288&&e(46,n=it==null?void 0:it[Yt]),r.$$.dirty[0]&2|r.$$.dirty[1]&4){const N=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(P);x==null||x.setReverseMarker(N?[Number(N[1]),Number(N[2])]:void 0)}r.$$.dirty[1]&32768&&Xr("select",n),r.$$.dirty[1]&16384&&Xr("pick",It),r.$$.dirty[0]&20480&&Xr("optionsVisibilityChange",us&&!!it),r.$$.dirty[0]&4096&&Xr("featuresListed",it),r.$$.dirty[1]&8192&&Xr("featuresMarked",Dt),r.$$.dirty[0]&1&&Xr("reverseToggle",q),r.$$.dirty[0]&2&&Xr("queryChange",P),r.$$.dirty[0]&1|r.$$.dirty[1]&4&&x&&x.indicateReverse(q)},[q,P,s,l,f,p,y,A,B,j,R,Ee,it,Yt,us,rr,ir,gi,Ku,sf,Qs,Js,F,a,u,c,h,g,d,_,I,C,L,x,w,X,Y,ut,Rt,Jt,_e,hi,kn,nr,Dt,It,n,o,i,af,uf,lf,cf,ff,hf,gf,pf,df,vf,yf,mf,_f]}let Tl=class extends Sr{constructor(t){super(),xr(this,t,Dl,Rl,Cr,{class:2,apiKey:23,bbox:24,clearButtonTitle:3,clearOnBlur:25,collapsed:4,country:26,debounceSearch:27,enableReverse:5,errorMessage:6,filter:28,flyTo:29,fuzzyMatch:30,language:31,limit:32,mapController:33,minLength:34,noResultsMessage:7,placeholder:8,proximity:22,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:35,showPlaceType:10,showResultsWhileTyping:36,trackProximity:37,types:38,zoom:39,fetchParameters:40,focus:41,blur:42,setQuery:43},null,[-1,-1,-1])}get focus(){return this.$$.ctx[41]}get blur(){return this.$$.ctx[42]}get setQuery(){return this.$$.ctx[43]}};/**
|
|
2
2
|
* splaytree v3.1.1
|
|
3
3
|
* Fast Splay tree for Node and browser
|
|
4
4
|
*
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
20
|
and limitations under the License.
|
|
21
|
-
***************************************************************************** */function
|
|
22
|
-
`);var o=t+(e?" ":"│ ");r.left&&gs(r.left,o,!1,n,i),r.right&&gs(r.right,o,!0,n,i)}}var ps=function(){function r(t){t===void 0&&(t=Pl),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=hs(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new _r(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=Er(t,this._root,i),s=i(t,o.key);return s===0?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=Er(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=Er(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Er(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=Er(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,e),u>0)break;if(s(a.key,t)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},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(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return Dl(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&ys(t,e,0,i-1,o),this._root===null)this._root=ds(t,e,0,i),this._size=i;else{var s=Tl(this.toList(),Ol(t,e),o);i=this._size+i,this._root=vs({head:s},0,i)}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(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return gs(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=va(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=hs(e,n,a,i):s=hs(e,n,s,i),this._root=Rl(s,a,i)},r.prototype.split=function(t){return va(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t;return bl(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},r}();function ds(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),s=r[o],a=t[o],u=new _r(s,a);return u.left=ds(r,t,e,o),u.right=ds(r,t,o+1,n),u}return null}function Ol(r,t){for(var e=new _r(null,null),n=e,i=0;i<r.length;i++)n=n.next=new _r(r[i],t[i]);return n.next=null,e.next}function Dl(r){for(var t=r,e=[],n=!1,i=new _r(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function vs(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=vs(r,t,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=vs(r,i+1,e),s}return null}function Tl(r,t,e){for(var n=new _r(null,null),i=n,o=r,s=t;o!==null&&s!==null;)e(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),n.next}function ys(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],s=e-1,a=n+1;;){do s++;while(i(r[s],o)<0);do a--;while(i(r[a],o)>0);if(s>=a)break;var u=r[s];r[s]=r[a],r[a]=u,u=t[s],t[s]=t[a],t[a]=u}ys(r,t,e,a,i),ys(r,t,a+1,n,i)}}function nn(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function ya(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function _e(r,t,e){return t&&ya(r.prototype,t),e&&ya(r,e),r}var ji=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},ms=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,s=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:n,y:o},ur:{x:i,y:s}}},Ir=Number.EPSILON;Ir===void 0&&(Ir=Math.pow(2,-52));var Ml=Ir*Ir,_s=function(t,e){if(-Ir<t&&t<Ir&&-Ir<e&&e<Ir)return 0;var n=t-e;return n*n<Ml*t*e?0:t<e?-1:1},Al=function(){function r(){nn(this,r),this.reset()}return _e(r,[{key:"reset",value:function(){this.xRounder=new ma,this.yRounder=new ma}},{key:"round",value:function(e,n){return{x:this.xRounder.round(e),y:this.yRounder.round(n)}}}]),r}(),ma=function(){function r(){nn(this,r),this.tree=new ps,this.round(0)}return _e(r,[{key:"round",value:function(e){var n=this.tree.add(e),i=this.tree.prev(n);if(i!==null&&_s(n.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(n);return o!==null&&_s(n.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),r}(),Ki=new Al,Qi=function(t,e){return t.x*e.y-t.y*e.x},_a=function(t,e){return t.x*e.x+t.y*e.y},Ea=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y},s=Qi(i,o);return _s(s,0)},wo=function(t){return Math.sqrt(_a(t,t))},Fl=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return Qi(o,i)/wo(o)/wo(i)},Bl=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return _a(o,i)/wo(o)/wo(i)},Ia=function(t,e,n){return e.y===0?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},Ca=function(t,e,n){return e.x===0?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},Gl=function(t,e,n,i){if(e.x===0)return Ca(n,i,t.x);if(i.x===0)return Ca(t,e,n.x);if(e.y===0)return Ia(n,i,t.y);if(i.y===0)return Ia(t,e,n.y);var o=Qi(e,i);if(o==0)return null;var s={x:n.x-t.x,y:n.y-t.y},a=Qi(s,e)/o,u=Qi(s,i)/o,l=t.x+u*e.x,c=n.x+a*i.x,f=t.y+u*e.y,h=n.y+a*i.y,g=(l+c)/2,p=(f+h)/2;return{x:g,y:p}},Gn=function(){_e(r,null,[{key:"compare",value:function(e,n){var i=r.comparePoints(e.point,n.point);return i!==0?i:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Lo.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(e,n){return e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0}}]);function r(t,e){nn(this,r),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return _e(r,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,i=0,o=n.length;i<o;i++){var s=n[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,n=0;n<e;n++){var i=this.point.events[n];if(i.segment.consumedBy===void 0)for(var o=n+1;o<e;o++){var s=this.point.events[o];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],n=0,i=this.point.events.length;n<i;n++){var o=this.point.events[n];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var n=this,i=new Map,o=function(a){var u=a.otherSE;i.set(a,{sine:Fl(n.point,e.point,u.point),cosine:Bl(n.point,e.point,u.point)})};return function(s,a){i.has(s)||o(s),i.has(a)||o(a);var u=i.get(s),l=u.sine,c=u.cosine,f=i.get(a),h=f.sine,g=f.cosine;return l>=0&&h>=0?c<g?1:c>g?-1:0:l<0&&h<0?c<g?-1:c>g?1:0:h<l?-1:h>l?1:0}}}]),r}(),kl=0,Lo=function(){_e(r,null,[{key:"compare",value:function(e,n){var i=e.leftSE.point.x,o=n.leftSE.point.x,s=e.rightSE.point.x,a=n.rightSE.point.x;if(a<i)return 1;if(s<o)return-1;var u=e.leftSE.point.y,l=n.leftSE.point.y,c=e.rightSE.point.y,f=n.rightSE.point.y;if(i<o){if(l<u&&l<c)return 1;if(l>u&&l>c)return-1;var h=e.comparePoint(n.leftSE.point);if(h<0)return 1;if(h>0)return-1;var g=n.comparePoint(e.rightSE.point);return g!==0?g:-1}if(i>o){if(u<l&&u<f)return-1;if(u>l&&u>f)return 1;var p=n.comparePoint(e.leftSE.point);if(p!==0)return p;var _=e.comparePoint(n.rightSE.point);return _<0?1:_>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var d=n.comparePoint(e.rightSE.point);if(d!==0)return d}if(s>a){var y=e.comparePoint(n.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(s!==a){var C=c-u,I=s-i,N=f-l,w=a-o;if(C>I&&N<w)return 1;if(C<I&&N>w)return-1}return s>a?1:s<a||c<f?-1:c>f?1:e.id<n.id?-1:e.id>n.id?1:0}}]);function r(t,e,n,i){nn(this,r),this.id=++kl,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}return _e(r,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<n?e:n},ur:{x:this.rightSE.point.x,y:e>n?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(n.x===i.x)return e.x===n.x?0:e.x<n.x?1:-1;var s=(e.y-n.y)/o.y,a=n.x+s*o.x;if(e.x===a)return 0;var u=(e.x-n.x)/o.x,l=n.y+u*o.y;return e.y===l?0:e.y<l?-1:1}},{key:"getIntersection",value:function(e){var n=this.bbox(),i=e.bbox(),o=ms(n,i);if(o===null)return null;var s=this.leftSE.point,a=this.rightSE.point,u=e.leftSE.point,l=e.rightSE.point,c=ji(n,u)&&this.comparePoint(u)===0,f=ji(i,s)&&e.comparePoint(s)===0,h=ji(n,l)&&this.comparePoint(l)===0,g=ji(i,a)&&e.comparePoint(a)===0;if(f&&c)return g&&!h?a:!g&&h?l:null;if(f)return h&&s.x===l.x&&s.y===l.y?null:s;if(c)return g&&a.x===u.x&&a.y===u.y?null:u;if(g&&h)return null;if(g)return a;if(h)return l;var p=Gl(s,this.vector(),u,e.vector());return p===null||!ji(o,p)?null:Ki.round(p.x,p.y)}},{key:"split",value:function(e){var n=[],i=e.events!==void 0,o=new Gn(e,!0),s=new Gn(e,!1),a=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(o);var u=new r(o,a,this.rings.slice(),this.windings.slice());return Gn.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Gn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}},{key:"consume",value:function(e){for(var n=this,i=e;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=r.compare(n,i);if(o!==0){if(o>0){var s=n;n=i,i=s}if(n.prev===i){var a=n;n=i,i=a}for(var u=0,l=i.rings.length;u<l;u++){var c=i.rings[u],f=i.windings[u],h=n.rings.indexOf(c);h===-1?(n.rings.push(c),n.windings.push(f)):n.windings[h]+=f}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){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)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var n=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,s=0,a=this.rings.length;s<a;s++){var u=this.rings[s],l=this.windings[s],c=n.indexOf(u);c===-1?(n.push(u),i.push(l)):i[c]+=l}for(var f=[],h=[],g=0,p=n.length;g<p;g++)if(i[g]!==0){var _=n[g],d=_.poly;if(h.indexOf(d)===-1)if(_.isExterior)f.push(d);else{h.indexOf(d)===-1&&h.push(d);var y=f.indexOf(_.poly);y!==-1&&f.splice(y,1)}}for(var C=0,I=f.length;C<I;C++){var N=f[C].multiPoly;o.indexOf(N)===-1&&o.push(N)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(Cn.type){case"union":{var i=e.length===0,o=n.length===0;this._isInResult=i!==o;break}case"intersection":{var s,a;e.length<n.length?(s=e.length,a=n.length):(s=n.length,a=e.length),this._isInResult=a===Cn.numMultiPolys&&s<a;break}case"xor":{var u=Math.abs(e.length-n.length);this._isInResult=u%2===1;break}case"difference":{var l=function(f){return f.length===1&&f[0].isSubject};this._isInResult=l(e)!==l(n);break}default:throw new Error("Unrecognized operation type found ".concat(Cn.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,i){var o,s,a,u=Gn.comparePoints(e,n);if(u<0)o=e,s=n,a=1;else if(u>0)o=n,s=e,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new Gn(o,!0),c=new Gn(s,!1);return new r(l,c,[i],[a])}}]),r}(),Na=function(){function r(t,e,n){if(nn(this,r),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=Ki.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=Ki.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Lo.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Lo.fromRing(o,i,this))}return _e(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.segments.length;n<i;n++){var o=this.segments[n];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),r}(),zl=function(){function r(t,e){if(nn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Na(t[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(var n=1,i=t.length;n<i;n++){var o=new Na(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return _e(r,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;n<i;n++)for(var o=this.interiorRings[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),xa=function(){function r(t,e){if(nn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,i=t.length;n<i;n++){var o=new zl(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return _e(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++)for(var o=this.polys[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),Vl=function(){_e(r,null,[{key:"factory",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!(!s.isInResult()||s.ringOut)){for(var a=null,u=s.leftSE,l=s.rightSE,c=[u],f=u.point,h=[];a=u,u=l,c.push(u),u.point!==f;)for(;;){var g=u.getAvailableLinkedEvents();if(g.length===0){var p=c[0].point,_=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(_.x,", ").concat(_.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var d=null,y=0,C=h.length;y<C;y++)if(h[y].point===u.point){d=y;break}if(d!==null){var I=h.splice(d)[0],N=c.splice(I.index);N.unshift(N[0].otherSE),n.push(new r(N.reverse()));continue}h.push({index:c.length,point:u.point});var w=u.getLeftmostComparator(a);l=g.sort(w)[0].otherSE;break}n.push(new r(c))}}return n}}]);function r(t){nn(this,r),this.events=t;for(var e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}return _e(r,[{key:"getGeom",value:function(){for(var e=this.events[0].point,n=[e],i=1,o=this.events.length-1;i<o;i++){var s=this.events[i].point,a=this.events[i+1].point;Ea(s,e,a)!==0&&(n.push(s),e=s)}if(n.length===1)return null;var u=n[0],l=n[1];Ea(u,e,l)===0&&n.shift(),n.push(n[0]);for(var c=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:n.length-1,h=this.isExteriorRing()?n.length:-1,g=[],p=f;p!=h;p+=c)g.push([n[p].x,n[p].y]);return g}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],n=1,i=this.events.length;n<i;n++){var o=this.events[n];Gn.compare(e,o)>0&&(e=o)}for(var s=e.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),r}(),Sa=function(){function r(t){nn(this,r),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return _e(r,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,i=this.interiorRings.length;n<i;n++){var o=this.interiorRings[n].getGeom();o!==null&&e.push(o)}return e}}]),r}(),Ul=function(){function r(t){nn(this,r),this.rings=t,this.polys=this._composePolys(t)}return _e(r,[{key:"getGeom",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++){var o=this.polys[n].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!s.poly)if(s.isExteriorRing())n.push(new Sa(s));else{var a=s.enclosingRing();a.poly||n.push(new Sa(a)),a.poly.addInterior(s)}}return n}}]),r}(),ql=function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lo.compare;nn(this,r),this.queue=t,this.tree=new ps(e),this.segments=[]}return _e(r,[{key:"process",value:function(e){var n=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),i;var o=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,u=void 0,l=void 0;u===void 0;)s=this.tree.prev(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){var c=null;if(u){var f=u.getIntersection(n);if(f!==null&&(n.isAnEndpoint(f)||(c=f),!u.isAnEndpoint(f)))for(var h=this._splitSafely(u,f),g=0,p=h.length;g<p;g++)i.push(h[g])}var _=null;if(l){var d=l.getIntersection(n);if(d!==null&&(n.isAnEndpoint(d)||(_=d),!l.isAnEndpoint(d)))for(var y=this._splitSafely(l,d),C=0,I=y.length;C<I;C++)i.push(y[C])}if(c!==null||_!==null){var N=null;if(c===null)N=_;else if(_===null)N=c;else{var w=Gn.comparePoints(c,_);N=w<=0?c:_}this.queue.remove(n.rightSE),i.push(n.rightSE);for(var b=n.split(N),A=0,F=b.length;A<F;A++)i.push(b[A])}i.length>0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&l){var D=u.getIntersection(l);if(D!==null){if(!u.isAnEndpoint(D))for(var R=this._splitSafely(u,D),z=0,X=R.length;z<X;z++)i.push(R[z]);if(!l.isAnEndpoint(D))for(var it=this._splitSafely(l,D),O=0,W=it.length;O<W;O++)i.push(it[O])}}this.tree.remove(n)}return i}},{key:"_splitSafely",value:function(e,n){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(n);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),r}(),wa=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Xl=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Yl=function(){function r(){nn(this,r)}return _e(r,[{key:"run",value:function(e,n,i){Cn.type=e,Ki.reset();for(var o=[new xa(n,!0)],s=0,a=i.length;s<a;s++)o.push(new xa(i[s],!1));if(Cn.numMultiPolys=o.length,Cn.type==="difference")for(var u=o[0],l=1;l<o.length;)ms(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(Cn.type==="intersection"){for(var c=0,f=o.length;c<f;c++)for(var h=o[c],g=c+1,p=o.length;g<p;g++)if(ms(h.bbox,o[g].bbox)===null)return[]}for(var _=new ps(Gn.compare),d=0,y=o.length;d<y;d++)for(var C=o[d].getSweepEvents(),I=0,N=C.length;I<N;I++)if(_.insert(C[I]),_.size>wa)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new ql(_),b=_.size,A=_.pop();A;){var F=A.key;if(_.size===b){var D=F.segment;throw new Error("Unable to pop() ".concat(F.isLeft?"left":"right"," SweepEvent ")+"[".concat(F.point.x,", ").concat(F.point.y,"] from segment #").concat(D.id," ")+"[".concat(D.leftSE.point.x,", ").concat(D.leftSE.point.y,"] -> ")+"[".concat(D.rightSE.point.x,", ").concat(D.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(_.size>wa)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>Xl)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var R=w.process(F),z=0,X=R.length;z<X;z++){var it=R[z];it.consumedBy===void 0&&_.insert(it)}b=_.size,A=_.pop()}Ki.reset();var O=Vl.factory(w.segments),W=new Ul(O);return W.getGeom()}}]),r}(),Cn=new Yl,Hl=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Cn.run("union",t,n)},Wl=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Cn.run("intersection",t,n)},jl=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Cn.run("xor",t,n)},Kl=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Cn.run("difference",t,n)},La={union:Hl,intersection:Wl,xor:jl,difference:Kl},Ee=63710088e-1,ba={centimeters:Ee*100,centimetres:Ee*100,degrees:Ee/111325,feet:Ee*3.28084,inches:Ee*39.37,kilometers:Ee/1e3,kilometres:Ee/1e3,meters:Ee,metres:Ee,miles:Ee/1609.344,millimeters:Ee*1e3,millimetres:Ee*1e3,nauticalmiles:Ee/1852,radians:1,yards:Ee*1.0936};function bo(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function Ql(r,t,e){if(e===void 0&&(e={}),!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(!Oa(r[0])||!Oa(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return bo(n,t,e)}function Pa(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return bo(a,t,e)}function Es(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Ra(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return bo(n,t,e)}function Jl(r,t){t===void 0&&(t="kilometers");var e=ba[t];if(!e)throw new Error(t+" units is invalid");return r*e}function Zl(r,t){t===void 0&&(t="kilometers");var e=ba[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Oa(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Po(r){return r.type==="Feature"?r.geometry:r}function $l(r,t,e){e===void 0&&(e={});var n=Po(r),i=Po(t),o=La.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?Pa(o[0],e.properties):Ra(o,e.properties)}const mf="";function tc(r){let t,e,n;return{c(){t=mr("svg"),e=mr("path"),B(e,"stroke-width","4"),B(e,"fill-rule","evenodd"),B(e,"clip-rule","evenodd"),B(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),B(e,"class","svelte-1k1cmht"),B(t,"width",n=r[0]!=="list"?void 0:"20"),B(t,"viewBox","0 0 70 85"),B(t,"fill","none"),B(t,"class","svelte-1k1cmht"),tn(t,"in-map",r[0]!=="list"),tn(t,"list-icon",r[0]==="list")},m(i,o){Ge(i,t,o),ct(t,e)},p(i,[o]){o&1&&n!==(n=i[0]!=="list"?void 0:"20")&&B(t,"width",n),o&1&&tn(t,"in-map",i[0]!=="list"),o&1&&tn(t,"list-icon",i[0]==="list")},i:Qt,o:Qt,d(i){i&&Pe(t)}}}function ec(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class nc extends pi{constructor(t){super(),gi(this,t,ec,tc,li,{displayIn:0})}}function Da(r,t,e){if(r!==null)for(var n,i,o,s,a,u,l,c=0,f=0,h,g=r.type,p=g==="FeatureCollection",_=g==="Feature",d=p?r.features.length:1,y=0;y<d;y++){l=p?r.features[y].geometry:_?r.geometry:r,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var C=0;C<a;C++){var I=0,N=0;if(s=h?l.geometries[C]:l,s!==null){u=s.coordinates;var w=s.type;switch(c=e&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(t(u,f,y,I,N)===!1)return!1;f++,I++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,y,I,N)===!1)return!1;f++,w==="MultiPoint"&&I++}w==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(t(u[n][i],f,y,I,N)===!1)return!1;f++}w==="MultiLineString"&&I++,w==="Polygon"&&N++}w==="Polygon"&&I++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(N=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-c;o++){if(t(u[n][i][o],f,y,I,N)===!1)return!1;f++}N++}I++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Da(s.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ta(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function Ma(r,t){var e,n,i,o,s,a,u,l,c,f,h=0,g=r.type==="FeatureCollection",p=r.type==="Feature",_=g?r.features.length:1;for(e=0;e<_;e++){for(a=g?r.features[e].geometry:p?r.geometry:r,l=g?r.features[e].properties:p?r.properties:{},c=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(t(null,h,l,c,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,h,l,c,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],h,l,c,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Is(r){var t=[1/0,1/0,-1/0,-1/0];return Da(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Is.default=Is;function rc(r,t){t===void 0&&(t={});var e=Is(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return Ql([n,i],t.properties,t)}"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),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(o=o<0?Math.max(n+arguments[2],0):Math.min(o,n);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var Ur=function(){};Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var lt=function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),V=function(){},Aa={MAX_VALUE:{configurable:!0}};V.isNaN=function(t){return Number.isNaN(t)},V.doubleToLongBits=function(t){return t},V.longBitsToDouble=function(t){return t},V.isInfinite=function(t){return!Number.isFinite(t)},Aa.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(V,Aa);var Re=function(){},Ro=function(){},di=function(){};function Oe(){}var v=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},qr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};v.prototype.setOrdinate=function(t,e){switch(t){case v.X:this.x=e;break;case v.Y:this.y=e;break;case v.Z:this.z=e;break;default:throw new lt("Invalid ordinate index: "+t)}},v.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!Ur.equalsWithTolerance(this.x,e.x,n)||!Ur.equalsWithTolerance(this.y,e.y,n))}},v.prototype.getOrdinate=function(t){switch(t){case v.X:return this.x;case v.Y:return this.y;case v.Z:return this.z}throw new lt("Invalid ordinate index: "+t)},v.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||V.isNaN(this.z))&&V.isNaN(t.z)},v.prototype.equals=function(t){return t instanceof v?this.equals2D(t):!1},v.prototype.equalInZ=function(t,e){return Ur.equalsWithTolerance(this.z,t.z,e)},v.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},v.prototype.clone=function(){},v.prototype.copy=function(){return new v(this)},v.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},v.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},v.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},v.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this.x),t=37*t+v.hashCode(this.y),t},v.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},v.prototype.interfaces_=function(){return[Re,Ro,Oe]},v.prototype.getClass=function(){return v},v.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=V.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},qr.DimensionalComparator.get=function(){return or},qr.serialVersionUID.get=function(){return 6683108902428367e3},qr.NULL_ORDINATE.get=function(){return V.NaN},qr.X.get=function(){return 0},qr.Y.get=function(){return 1},qr.Z.get=function(){return 2},Object.defineProperties(v,qr);var or=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new lt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};or.prototype.compare=function(t,e){var n=t,i=e,o=or.compare(n.x,i.x);if(o!==0)return o;var s=or.compare(n.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=or.compare(n.z,i.z);return a},or.prototype.interfaces_=function(){return[di]},or.prototype.getClass=function(){return or},or.compare=function(t,e){return t<e?-1:t>e?1:V.isNaN(t)?V.isNaN(e)?0:-1:V.isNaN(e)?1:0};var vi=function(){};vi.prototype.create=function(){},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi};var m=function(){},Ji={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.toLocationSymbol=function(t){switch(t){case m.EXTERIOR:return"e";case m.BOUNDARY:return"b";case m.INTERIOR:return"i";case m.NONE:return"-"}throw new lt("Unknown location value: "+t)},Ji.INTERIOR.get=function(){return 0},Ji.BOUNDARY.get=function(){return 1},Ji.EXTERIOR.get=function(){return 2},Ji.NONE.get=function(){return-1},Object.defineProperties(m,Ji);var k=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},Ie=function(){},Fa={LOG_10:{configurable:!0}};Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.log10=function(t){var e=Math.log(t);return V.isInfinite(e)||V.isNaN(e)?e:e/Ie.LOG_10},Ie.min=function(t,e,n,i){var o=t;return e<o&&(o=e),n<o&&(o=n),i<o&&(o=i),o},Ie.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}},Ie.wrap=function(t,e){return t<0?e- -t%e:t%e},Ie.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}},Ie.average=function(t,e){return(t+e)/2},Fa.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ie,Fa);var rn=function(t){this.str=t};rn.prototype.append=function(t){this.str+=t},rn.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},rn.prototype.toString=function(t){return this.str};var on=function(t){this.value=t};on.prototype.intValue=function(){return this.value},on.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},on.isNaN=function(t){return Number.isNaN(t)};var Zi=function(){};Zi.isWhitespace=function(t){return t<=32&&t>=0||t===127},Zi.toUpperCase=function(t){return t.toUpperCase()};var E=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},ze={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}};E.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},E.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=E.magnitude(n._hi),o=E.TEN.pow(i);n=n.divide(o),n.gt(E.TEN)?(n=n.divide(E.TEN),i+=1):n.lt(E.ONE)&&(n=n.multiply(E.TEN),i-=1);for(var s=i+1,a=new rn,u=E.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var f=!1,h=0;c>9?(f=!0,h="9"):h="0"+c,a.append(h),n=n.subtract(E.valueOf(c)).multiply(E.TEN),f&&n.selfAdd(E.TEN);var g=!0,p=E.magnitude(n._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return e[0]=i,a.toString()},E.prototype.sqr=function(){return this.multiply(this)},E.prototype.doubleValue=function(){return this._hi+this._lo},E.prototype.subtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},E.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},E.prototype.isZero=function(){return this._hi===0&&this._lo===0},E.prototype.selfSubtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},E.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},E.prototype.min=function(t){return this.le(t)?this:t},E.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,h=null;return l=this._hi/n,c=E.SPLIT*l,o=c-l,h=E.SPLIT*n,o=c-o,s=l-o,a=h-n,f=l*n,a=h-a,u=n-a,h=o*a-f+o*u+s*a+s*u,c=(this._hi-f-h+this._lo-l*i)/n,h=l+c,this._hi=h,this._lo=l-h+c,this}},E.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},E.prototype.divide=function(){if(arguments[0]instanceof E){var t=arguments[0],e=null,n=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=E.SPLIT*s,e=a-s,l=E.SPLIT*t._hi,e=a-e,n=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+n*i+n*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new E(c,f)}else if(typeof arguments[0]=="number"){var h=arguments[0];return V.isNaN(h)?E.createNaN():E.copy(this).selfDivide(h,0)}},E.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},E.prototype.pow=function(t){if(t===0)return E.valueOf(1);var e=new E(this),n=E.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},E.prototype.ceil=function(){if(this.isNaN())return E.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new E(t,e)},E.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},E.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},E.prototype.setValue=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},E.prototype.max=function(t){return this.ge(t)?this:t},E.prototype.sqrt=function(){if(this.isZero())return E.valueOf(0);if(this.isNegative())return E.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=E.valueOf(e),i=this.subtract(n.sqr()),o=i._hi*(t*.5);return n.add(o)},E.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,n=o+u,i=u+(o-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,h=null,g=null,p=null,_=null,d=null,y=null,C=null;_=this._hi+l,g=this._lo+c,y=_-this._hi,C=g-this._lo,d=_-y,p=g-C,d=l-y+(this._hi-d),p=c-C+(this._lo-p),y=d+g,f=_+y,h=y+(_-f),y=p+h;var I=f+y,N=y+(f-I);return this._hi=I,this._lo=N,this}},E.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=E.SPLIT*this._hi,o=l-this._hi,c=E.SPLIT*n,o=l-o,s=this._hi-o,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*n);var f=l+c;o=l-f;var h=c+o;return this._hi=f,this._lo=h,this}},E.prototype.selfSqr=function(){return this.selfMultiply(this)},E.prototype.floor=function(){if(this.isNaN())return E.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new E(t,e)},E.prototype.negate=function(){return this.isNaN()?this:new E(-this._hi,-this._lo)},E.prototype.clone=function(){},E.prototype.multiply=function(){if(arguments[0]instanceof E){var t=arguments[0];return t.isNaN()?E.createNaN():E.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return V.isNaN(e)?E.createNaN():E.copy(this).selfMultiply(e,0)}},E.prototype.isNaN=function(){return V.isNaN(this._hi)},E.prototype.intValue=function(){return Math.trunc(this._hi)},E.prototype.toString=function(){var t=E.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},E.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,o=n;if(n.charAt(0)===".")o="0"+n;else if(i<0)o="0."+E.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var s=i-n.length,a=E.stringOfChar("0",s);o=n+a+".0"}return this.isNegative()?"-"+o:o},E.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=E.SPLIT*o,t=s-o,u=E.SPLIT*this._hi,t=s-t,e=o-t,n=u-this._hi,a=o*this._hi,n=u-n,i=this._hi-n,u=t*n-a+t*i+e*n+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new E(l,c)},E.prototype.toSciNotation=function(){if(this.isZero())return E.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=E.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var o="";n.length>1&&(o=n.substring(1));var s=n.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i},E.prototype.abs=function(){return this.isNaN()?E.NaN:this.isNegative()?this.negate():new E(this)},E.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},E.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},E.prototype.add=function(){if(arguments[0]instanceof E){var t=arguments[0];return E.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return E.copy(this).selfAdd(e)}},E.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 E){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},E.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},E.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},E.prototype.trunc=function(){return this.isNaN()?E.NaN:this.isPositive()?this.floor():this.ceil()},E.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},E.prototype.interfaces_=function(){return[Oe,Re,Ro]},E.prototype.getClass=function(){return E},E.sqr=function(t){return E.valueOf(t).selfMultiply(t)},E.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return E.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new E(e)}},E.sqrt=function(t){return E.valueOf(t).sqrt()},E.parse=function(t){for(var e=0,n=t.length;Zi.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new E,a=0,u=0,l=0;!(e>=n);){var c=t.charAt(e);if(e++,Zi.isDigit(c)){var f=c-"0";s.selfMultiply(E.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var h=t.substring(e);try{l=on.parseInt(h)}catch(y){throw y instanceof Error?new Error("Invalid exponent "+h+" in string "+t):y}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=s,p=a-u-l;if(p===0)g=s;else if(p>0){var _=E.TEN.pow(p);g=s.divide(_)}else if(p<0){var d=E.TEN.pow(-p);g=s.multiply(d)}return i?g.negate():g},E.createNaN=function(){return new E(V.NaN,V.NaN)},E.copy=function(t){return new E(t)},E.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},E.stringOfChar=function(t,e){for(var n=new rn,i=0;i<e;i++)n.append(t);return n.toString()},ze.PI.get=function(){return new E(3.141592653589793,12246467991473532e-32)},ze.TWO_PI.get=function(){return new E(6.283185307179586,24492935982947064e-32)},ze.PI_2.get=function(){return new E(1.5707963267948966,6123233995736766e-32)},ze.E.get=function(){return new E(2.718281828459045,14456468917292502e-32)},ze.NaN.get=function(){return new E(V.NaN,V.NaN)},ze.EPS.get=function(){return 123259516440783e-46},ze.SPLIT.get=function(){return 134217729},ze.MAX_PRINT_DIGITS.get=function(){return 32},ze.TEN.get=function(){return E.valueOf(10)},ze.ONE.get=function(){return E.valueOf(1)},ze.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},ze.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(E,ze);var ae=function(){},Ba={DP_SAFE_EPSILON:{configurable:!0}};ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.orientationIndex=function(t,e,n){var i=ae.orientationIndexFilter(t,e,n);if(i<=1)return i;var o=E.valueOf(e.x).selfAdd(-t.x),s=E.valueOf(e.y).selfAdd(-t.y),a=E.valueOf(n.x).selfAdd(-e.x),u=E.valueOf(n.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()},ae.signOfDet2x2=function(t,e,n,i){var o=t.multiply(i).selfSubtract(e.multiply(n));return o.signum()},ae.intersection=function(t,e,n,i){var o=E.valueOf(i.y).selfSubtract(n.y).selfMultiply(E.valueOf(e.x).selfSubtract(t.x)),s=E.valueOf(i.x).selfSubtract(n.x).selfMultiply(E.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=E.valueOf(i.x).selfSubtract(n.x).selfMultiply(E.valueOf(t.y).selfSubtract(n.y)),l=E.valueOf(i.y).selfSubtract(n.y).selfMultiply(E.valueOf(t.x).selfSubtract(n.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),h=E.valueOf(t.x).selfAdd(E.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=E.valueOf(e.x).selfSubtract(t.x).selfMultiply(E.valueOf(t.y).selfSubtract(n.y)),p=E.valueOf(e.y).selfSubtract(t.y).selfMultiply(E.valueOf(t.x).selfSubtract(n.x)),_=g.subtract(p),d=_.selfDivide(a).doubleValue(),y=E.valueOf(n.y).selfAdd(E.valueOf(i.y).selfSubtract(n.y).selfMultiply(d)).doubleValue();return new v(h,y)},ae.orientationIndexFilter=function(t,e,n){var i=null,o=(t.x-n.x)*(e.y-n.y),s=(t.y-n.y)*(e.x-n.x),a=o-s;if(o>0){if(s<=0)return ae.signum(a);i=o+s}else if(o<0){if(s>=0)return ae.signum(a);i=-o-s}else return ae.signum(a);var u=ae.DP_SAFE_EPSILON*i;return a>=u||-a>=u?ae.signum(a):2},ae.signum=function(t){return t>0?1:t<0?-1:0},Ba.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(ae,Ba);var K=function(){},$i={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};$i.X.get=function(){return 0},$i.Y.get=function(){return 1},$i.Z.get=function(){return 2},$i.M.get=function(){return 3},K.prototype.setOrdinate=function(t,e,n){},K.prototype.size=function(){},K.prototype.getOrdinate=function(t,e){},K.prototype.getCoordinate=function(){},K.prototype.getCoordinateCopy=function(t){},K.prototype.getDimension=function(){},K.prototype.getX=function(t){},K.prototype.clone=function(){},K.prototype.expandEnvelope=function(t){},K.prototype.copy=function(){},K.prototype.getY=function(t){},K.prototype.toCoordinateArray=function(){},K.prototype.interfaces_=function(){return[Ro]},K.prototype.getClass=function(){return K},Object.defineProperties(K,$i);var Ga=function(){},yi=function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ga),At=function(){};At.arraycopy=function(t,e,n,i,o){for(var s=0,a=e;a<e+o;a++)n[i+s]=t[a],s++},At.getProperty=function(t){return{"line.separator":`
|
|
23
|
-
`}[t]};var Ve=function r(){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 t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],h=arguments[1],g=arguments[2],p=arguments[3],_=f.y-h.y,d=h.x-f.x,y=f.x*h.y-h.x*f.y,C=g.y-p.y,I=p.x-g.x,N=g.x*p.y-p.x*g.y;this.x=d*N-I*y,this.y=C*y-_*N,this.w=_*I-C*d}};Ve.prototype.getY=function(){var t=this.y/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new yi;return t},Ve.prototype.getX=function(){var t=this.x/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new yi;return t},Ve.prototype.getCoordinate=function(){var t=new v;return t.x=this.getX(),t.y=this.getY(),t},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.intersection=function(t,e,n,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,f=s*c-l*a,h=u*a-o*c,g=o*l-u*s,p=f/g,_=h/g;if(V.isNaN(p)||V.isInfinite(p)||V.isNaN(_)||V.isInfinite(_))throw new yi;return new v(p,_)};var T=function r(){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 v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},ka={serialVersionUID:{configurable:!0}};T.prototype.getArea=function(){return this.getWidth()*this.getHeight()},T.prototype.equals=function(t){if(!(t instanceof T))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()},T.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new T;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new T(e,i,n,o)},T.prototype.isNull=function(){return this._maxx<this._minx},T.prototype.getMaxX=function(){return this._maxx},T.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof T){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},T.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof T){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof v){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},T.prototype.getMinY=function(){return this._miny},T.prototype.getMinX=function(){return this._minx},T.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof T){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 n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},T.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},T.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},T.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},T.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},T.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},T.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},T.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},T.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},T.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},T.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof T){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},T.prototype.centre=function(){return this.isNull()?null:new v((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},T.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof T){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 n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},T.prototype.getMaxY=function(){return this._maxy},T.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},T.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this._minx),t=37*t+v.hashCode(this._maxx),t=37*t+v.hashCode(this._miny),t=37*t+v.hashCode(this._maxy),t},T.prototype.interfaces_=function(){return[Re,Oe]},T.prototype.getClass=function(){return T},T.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}},ka.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(T,ka);var sn={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*$/},Oo=function(t){this.geometryFactory=t||new H};Oo.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var o=sn.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=sn.emptyTypeStr.exec(t),o[2]=void 0),o&&(n=o[1].toLowerCase(),i=o[2],mi[n]&&(e=mi[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Oo.prototype.write=function(t){return this.extractGeometry(t)},Oo.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!kn[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+kn[e].apply(this,[t])+")",i};var kn={coordinate:function(t){return t.x+" "+t.y},point:function(t){return kn.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+kn.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(kn.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(kn.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+kn.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+kn.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)n.push("("+kn.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+kn.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},mi={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(sn.spaces);return this.geometryFactory.createPoint(new v(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(sn.trimParens,"$1"),o.push(mi.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(sn.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(sn.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(sn.parenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(sn.trimParens,"$1"),o.push(mi.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,o,s=t.trim().split(sn.parenComma),a,u=[],l=0,c=s.length;l<c;++l)n=s[l].replace(sn.trimParens,"$1"),i=mi.linestring.apply(e,[n]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(sn.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(sn.trimParens,"$1"),o.push(mi.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],o=0,s=n.length;o<s;++o)i.push(e.read(n[o]));return this.geometryFactory.createGeometryCollection(i)}},Ue=function(t){this.parser=new Oo(t)};Ue.prototype.write=function(t){return this.parser.write(t)},Ue.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var zn=function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),Do=function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(zn),q=function(){};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.shouldNeverReachHere=function(){if(arguments.length===0)q.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Do("Should never reach here"+(t!==null?": "+t:""))}},q.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],q.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Do:new Do(e)},q.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],q.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new Do("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var ft=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 v,this._intPt[1]=new v,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Xr={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ft.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ft.prototype.getTopologySummary=function(){var t=new rn;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ft.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},ft.prototype.getIntersectionNum=function(){return this._result},ft.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],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ft.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ft.prototype.setPrecisionModel=function(t){this._precisionModel=t},ft.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},ft.prototype.getIntersection=function(t){return this._intPt[t]},ft.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ft.prototype.hasIntersection=function(){return this._result!==ft.NO_INTERSECTION},ft.prototype.getEdgeDistance=function(t,e){var n=ft.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},ft.prototype.isCollinear=function(){return this._result===ft.COLLINEAR_INTERSECTION},ft.prototype.toString=function(){return Ue.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Ue.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ft.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ft.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},ft.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),o=Math.abs(n.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(n))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return q.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s},ft.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return q.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s},Xr.DONT_INTERSECT.get=function(){return 0},Xr.DO_INTERSECT.get=function(){return 1},Xr.COLLINEAR.get=function(){return 2},Xr.NO_INTERSECTION.get=function(){return 0},Xr.POINT_INTERSECTION.get=function(){return 1},Xr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ft,Xr);var Cr=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new T(this._inputLines[0][0],this._inputLines[0][1]),o=new T(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&o.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,T.intersects(i,o,n)&&P.orientationIndex(i,o,n)===0&&P.orientationIndex(o,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(o))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,o,s,a){a.x=this.smallestInAbsValue(n.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(n.y,i.y,o.y,s.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,i,o,s){var a=null;try{a=Ve.intersection(n,i,o,s)}catch(u){if(u instanceof yi)a=t.nearestEndpoint(n,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(n,i,o,s){var a=this.intersectionWithNormalization(n,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new v(t.nearestEndpoint(n,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,i,o,s){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(n,i,o,s,a){var u=ae.intersection(n,i,o,s),l=this.isInSegmentEnvelopes(u);At.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&At.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,o,s){var a=new v(n),u=new v(i),l=new v(o),c=new v(s),f=new v;this.normalizeToEnvCentre(a,u,l,c,f);var h=this.safeHCoordinateIntersection(a,u,l,c);return h.x+=f.x,h.y+=f.y,h},t.prototype.computeCollinearIntersection=function(n,i,o,s){var a=T.intersects(n,i,o),u=T.intersects(n,i,s),l=T.intersects(o,s,n),c=T.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,o,s,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,h=o.x<s.x?o.x:s.x,g=o.y<s.y?o.y:s.y,p=o.x>s.x?o.x:s.x,_=o.y>s.y?o.y:s.y,d=u>h?u:h,y=c<p?c:p,C=l>g?l:g,I=f<_?f:_,N=(d+y)/2,w=(C+I)/2;a.x=N,a.y=w,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(n,i,o,s){if(this._isProper=!1,!T.intersects(n,i,o,s))return r.NO_INTERSECTION;var a=P.orientationIndex(n,i,o),u=P.orientationIndex(n,i,s);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=P.orientationIndex(o,s,n),c=P.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(n,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(o)||n.equals2D(s)?this._intPt[0]=n:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new v(o):u===0?this._intPt[0]=new v(s):l===0?this._intPt[0]=new v(n):c===0&&(this._intPt[0]=new v(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,o,s)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,o,s){var a=n,u=P.distancePointLine(n,o,s),l=P.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=P.distancePointLine(o,n,i),l<u&&(u=l,a=o),l=P.distancePointLine(s,n,i),l<u&&(u=l,a=s),a},t}(ft),Yr=function(){};Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.orientationIndex=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=n.x-e.x,a=n.y-e.y;return Yr.signOfDet2x2(i,o,s,a)},Yr.signOfDet2x2=function(t,e,n,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-o:o:n>0?o:-o;if(e===0||n===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=n,n=s,s=e,e=i,i=s):e<=-i?(o=-o,n=-n,i=-i):(s=t,t=-n,n=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=n,n=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,n=-n,i=-i):(o=-o,s=-t,t=-n,n=s,s=-e,e=-i,i=s),t>0)if(n>0){if(!(t<=n))return o}else return o;else{if(n>0)return-o;if(t>=n)o=-o,t=-t,n=-n;else return-o}for(;;){if(a=Math.floor(n/t),n=n-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>n+n){if(e<i+i)return o}else{if(e>i+i)return-o;n=t-n,i=e-i,o=-o}if(i===0)return n===0?0:-o;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*i,e<0))return o;if(e>i)return-o;if(n>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=n-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var an=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};an.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=Yr.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},an.prototype.isPointInPolygon=function(){return this.getLocation()!==m.EXTERIOR},an.prototype.getLocation=function(){return this._isPointOnSegment?m.BOUNDARY:this._crossingCount%2===1?m.INTERIOR:m.EXTERIOR},an.prototype.isOnSegment=function(){return this._isPointOnSegment},an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},an.locatePointInRing=function(){if(arguments[0]instanceof v&&k(arguments[1],K)){for(var t=arguments[0],e=arguments[1],n=new an(t),i=new v,o=new v,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),n.countSegment(i,o),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof v&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new an(a),c=1;c<u.length;c++){var f=u[c],h=u[c-1];if(l.countSegment(f,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var P=function(){},Hr={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.orientationIndex=function(t,e,n){return ae.orientationIndex(t,e,n)},P.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-n,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(k(arguments[0],K)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new v,f=new v,h=new v;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,_=1;_<l-1;_++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(_+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},P.distanceLineLine=function(t,e,n,i){if(t.equals(e))return P.distancePointLine(t,n,i);if(n.equals(i))return P.distancePointLine(i,t,e);var o=!1;if(!T.intersects(t,e,n,i))o=!0;else{var s=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(s===0)o=!0;else{var a=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?Ie.min(P.distancePointLine(t,n,i),P.distancePointLine(e,n,i),P.distancePointLine(n,t,e),P.distancePointLine(i,t,e)):0},P.isPointInRing=function(t,e){return P.locatePointInRing(t,e)!==m.EXTERIOR},P.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new v;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;n+=Math.sqrt(c*c+f*f),o=u,s=l}return n},P.isCCW=function(t){var e=t.length-1;if(e<3)throw new lt("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>n.y&&(n=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var f=P.computeOrientation(l,n,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},P.locatePointInRing=function(t,e){return an.locatePointInRing(t,e)},P.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},P.computeOrientation=function(t,e,n){return P.orientationIndex(t,e,n)},P.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new lt("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=P.distancePointLine(t,e[i],e[i+1]);o<n&&(n=o)}return n}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}},P.isOnLine=function(t,e){for(var n=new Cr,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(n.computeIntersection(t,o,s),n.hasIntersection())return!0}return!1},Hr.CLOCKWISE.get=function(){return-1},Hr.RIGHT.get=function(){return P.CLOCKWISE},Hr.COUNTERCLOCKWISE.get=function(){return 1},Hr.LEFT.get=function(){return P.COUNTERCLOCKWISE},Hr.COLLINEAR.get=function(){return 0},Hr.STRAIGHT.get=function(){return P.COLLINEAR},Object.defineProperties(P,Hr);var Vn=function(){};Vn.prototype.filter=function(t){},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var G=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Nn={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}};G.prototype.isGeometryCollection=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION},G.prototype.getFactory=function(){return this._factory},G.prototype.getGeometryN=function(t){return this},G.prototype.getArea=function(){return 0},G.prototype.isRectangle=function(){return!1},G.prototype.equals=function(){if(arguments[0]instanceof G){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof G))return!1;var n=e;return this.equalsExact(n)}},G.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},G.prototype.geometryChanged=function(){this.apply(G.geometryChangedFilter)},G.prototype.geometryChangedAction=function(){this._envelope=null},G.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},G.prototype.getLength=function(){return 0},G.prototype.getNumGeometries=function(){return 1},G.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)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},G.prototype.getUserData=function(){return this._userData},G.prototype.getSRID=function(){return this._SRID},G.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},G.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION)throw new lt("This method does not support GeometryCollection arguments")},G.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},G.prototype.norm=function(){var t=this.copy();return t.normalize(),t},G.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},G.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new T(this._envelope)},G.prototype.setSRID=function(t){this._SRID=t},G.prototype.setUserData=function(t){this._userData=t},G.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var o=n.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},G.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},G.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===G.SORTINDEX_MULTIPOINT||this.getSortIndex()===G.SORTINDEX_MULTILINESTRING||this.getSortIndex()===G.SORTINDEX_MULTIPOLYGON},G.prototype.interfaces_=function(){return[Ro,Re,Oe]},G.prototype.getClass=function(){return G},G.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},G.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Nn.serialVersionUID.get=function(){return 8763622679187377e3},Nn.SORTINDEX_POINT.get=function(){return 0},Nn.SORTINDEX_MULTIPOINT.get=function(){return 1},Nn.SORTINDEX_LINESTRING.get=function(){return 2},Nn.SORTINDEX_LINEARRING.get=function(){return 3},Nn.SORTINDEX_MULTILINESTRING.get=function(){return 4},Nn.SORTINDEX_POLYGON.get=function(){return 5},Nn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Nn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Nn.geometryChangedFilter.get=function(){return Cs},Object.defineProperties(G,Nn);var Cs=function(){};Cs.interfaces_=function(){return[Vn]},Cs.filter=function(t){t.geometryChangedAction()};var xn=function(){};xn.prototype.filter=function(t){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var De=function(){},Un={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}};De.prototype.isInBoundary=function(t){},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},Un.Mod2BoundaryNodeRule.get=function(){return _i},Un.EndPointBoundaryNodeRule.get=function(){return Ei},Un.MultiValentEndPointBoundaryNodeRule.get=function(){return Ii},Un.MonoValentEndPointBoundaryNodeRule.get=function(){return Ci},Un.MOD2_BOUNDARY_RULE.get=function(){return new _i},Un.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ei},Un.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ii},Un.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ci},Un.OGC_SFS_BOUNDARY_RULE.get=function(){return De.MOD2_BOUNDARY_RULE},Object.defineProperties(De,Un);var _i=function(){};_i.prototype.isInBoundary=function(t){return t%2===1},_i.prototype.interfaces_=function(){return[De]},_i.prototype.getClass=function(){return _i};var Ei=function(){};Ei.prototype.isInBoundary=function(t){return t>0},Ei.prototype.interfaces_=function(){return[De]},Ei.prototype.getClass=function(){return Ei};var Ii=function(){};Ii.prototype.isInBoundary=function(t){return t>1},Ii.prototype.interfaces_=function(){return[De]},Ii.prototype.getClass=function(){return Ii};var Ci=function(){};Ci.prototype.isInBoundary=function(t){return t===1},Ci.prototype.interfaces_=function(){return[De]},Ci.prototype.getClass=function(){return Ci};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){};function Ns(r){this.message=r||""}Ns.prototype=new Error,Ns.prototype.name="IndexOutOfBoundsException";var Ni=function(){};Ni.prototype.hasNext=function(){},Ni.prototype.next=function(){},Ni.prototype.remove=function(){};var qe=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(xt);function xi(r){this.message=r||""}xi.prototype=new Error,xi.prototype.name="NoSuchElementException";var L=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,xt]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(n,i){var o=this.array_[n];return this.array_[n]=i,o},t.prototype.iterator=function(){return new ic(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Ns;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.remove=function(n){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===n){i.array_.splice(s,1),o=!0;break}return o},t}(qe),ic=function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new xi;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(Ni),to=function(r){function t(){if(r.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 i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=r.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];r.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof v&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],h=arguments[1];return this.add(f,h),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],_=arguments[2];if(_)for(var d=0;d<g.length;d++)i.add(g[d],p);else for(var y=g.length-1;y>=0;y--)i.add(g[y],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof v){var C=arguments[0],I=arguments[1],N=arguments[2];if(!N){var w=this.size();if(w>0){if(C>0){var b=this.get(C-1);if(b.equals2D(I))return null}if(C<w){var A=this.get(C);if(A.equals2D(I))return null}}}r.prototype.add.call(this,C,I)}}else if(arguments.length===4){var F=arguments[0],D=arguments[1],R=arguments[2],z=arguments[3],X=1;R>z&&(X=-1);for(var it=R;it!==z;it+=X)i.add(F[it],D);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new v(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(L),Y=function(){},To={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};To.ForwardComparator.get=function(){return eo},To.BidirectionalComparator.get=function(){return Si},To.coordArrayType.get=function(){return new Array(0).fill(null)},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Y.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(Y.indexOf(i,e)<0)return i}return null},Y.scroll=function(t,e){var n=Y.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);At.arraycopy(t,n,i,0,t.length-n),At.arraycopy(t,0,i,t.length-n,n),At.arraycopy(i,0,t,0,t.length)},Y.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}},Y.intersection=function(t,e){for(var n=new to,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},Y.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Y.removeRepeatedPoints=function(t){if(!Y.hasRepeatedPoints(t))return t;var e=new to(t,!1);return e.toCoordinateArray()},Y.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},Y.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i},Y.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new v(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new v(i[o+l])},Y.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[t.length-n-1];if(i.compareTo(o)!==0)return!1}return!0},Y.envelope=function(t){for(var e=new T,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Y.toCoordinateArray=function(t){return t.toArray(Y.coordArrayType)},Y.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Y.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Y.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},Y.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},Y.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},Y.extract=function(t,e,n){e=Ie.clamp(e,0,t.length),n=Ie.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=n;a++)o[s++]=t[a];return o},Object.defineProperties(Y,To);var eo=function(){};eo.prototype.compare=function(t,e){var n=t,i=e;return Y.compare(n,i)},eo.prototype.interfaces_=function(){return[di]},eo.prototype.getClass=function(){return eo};var Si=function(){};Si.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var o=Y.compare(n,i),s=Y.isEqualReversed(n,i);return s?0:o},Si.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var o=Y.increasingDirection(n),s=Y.increasingDirection(i),a=o>0?0:n.length-1,u=s>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0},Si.prototype.interfaces_=function(){return[di]},Si.prototype.getClass=function(){return Si};var Wr=function(){};Wr.prototype.get=function(){},Wr.prototype.put=function(){},Wr.prototype.size=function(){},Wr.prototype.values=function(){},Wr.prototype.entrySet=function(){};var oc=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Wr);function no(r){this.message=r||""}no.prototype=new Error,no.prototype.name="OperationNotSupported";function Mo(){}Mo.prototype=new xt,Mo.prototype.contains=function(){};var xs=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.iterator=function(){return new sc(this)},t}(Mo),sc=function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new xi;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new no},t}(Ni),qn=0,Nr=1;function za(r){return r===null?qn:r.color}function ot(r){return r===null?null:r.parent}function Xn(r,t){r!==null&&(r.color=t)}function Ss(r){return r===null?null:r.left}function Va(r){return r===null?null:r.right}function Xt(){this.root_=null,this.size_=0}Xt.prototype=new oc,Xt.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Xt.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:qn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:r,left:null,right:null,value:t,parent:n,color:qn,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Xt.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=Nr;r!=null&&r!==this.root_&&r.parent.color===Nr;)if(ot(r)===Ss(ot(ot(r)))){var e=Va(ot(ot(r)));za(e)===Nr?(Xn(ot(r),qn),Xn(e,qn),Xn(ot(ot(r)),Nr),r=ot(ot(r))):(r===Va(ot(r))&&(r=ot(r),t.rotateLeft(r)),Xn(ot(r),qn),Xn(ot(ot(r)),Nr),t.rotateRight(ot(ot(r))))}else{var n=Ss(ot(ot(r)));za(n)===Nr?(Xn(ot(r),qn),Xn(n,qn),Xn(ot(ot(r)),Nr),r=ot(ot(r))):(r===Ss(ot(r))&&(r=ot(r),t.rotateRight(r)),Xn(ot(r),qn),Xn(ot(ot(r)),Nr),t.rotateLeft(ot(ot(r))))}this.root_.color=qn},Xt.prototype.values=function(){var r=new L,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=Xt.successor(t))!==null;)r.add(t.value);return r},Xt.prototype.entrySet=function(){var r=new xs,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=Xt.successor(t))!==null;)r.add(t);return r},Xt.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},Xt.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},Xt.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Xt.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},Xt.prototype.size=function(){return this.size_};var ro=function(){};ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro};function Ua(){}Ua.prototype=new Mo;function un(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}un.prototype=new Ua,un.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},un.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},un.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},un.prototype.remove=function(r){throw new no},un.prototype.size=function(){return this.array_.length},un.prototype.isEmpty=function(){return this.array_.length===0},un.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},un.prototype.iterator=function(){return new Ao(this)};var Ao=function(r){this.treeSet_=r,this.position_=0};Ao.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new xi;return this.treeSet_.array_[this.position_++]},Ao.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ao.prototype.remove=function(){throw new no};var xr=function(){};xr.sort=function(){var t=arguments[0],e,n,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},n.sort(o),s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])},xr.asList=function(t){for(var e=new L,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var Q=function(){},Xe={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}};Xe.P.get=function(){return 0},Xe.L.get=function(){return 1},Xe.A.get=function(){return 2},Xe.FALSE.get=function(){return-1},Xe.TRUE.get=function(){return-2},Xe.DONTCARE.get=function(){return-3},Xe.SYM_FALSE.get=function(){return"F"},Xe.SYM_TRUE.get=function(){return"T"},Xe.SYM_DONTCARE.get=function(){return"*"},Xe.SYM_P.get=function(){return"0"},Xe.SYM_L.get=function(){return"1"},Xe.SYM_A.get=function(){return"2"},Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q},Q.toDimensionSymbol=function(t){switch(t){case Q.FALSE:return Q.SYM_FALSE;case Q.TRUE:return Q.SYM_TRUE;case Q.DONTCARE:return Q.SYM_DONTCARE;case Q.P:return Q.SYM_P;case Q.L:return Q.SYM_L;case Q.A:return Q.SYM_A}throw new lt("Unknown dimension value: "+t)},Q.toDimensionValue=function(t){switch(Zi.toUpperCase(t)){case Q.SYM_FALSE:return Q.FALSE;case Q.SYM_TRUE:return Q.TRUE;case Q.SYM_DONTCARE:return Q.DONTCARE;case Q.SYM_P:return Q.P;case Q.SYM_L:return Q.L;case Q.SYM_A:return Q.A}throw new lt("Unknown dimension symbol: "+t)},Object.defineProperties(Q,Xe);var ln=function(){};ln.prototype.filter=function(t){},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var Ye=function(){};Ye.prototype.filter=function(t,e){},Ye.prototype.isDone=function(){},Ye.prototype.isGeometryChanged=function(){},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var Jt=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new lt("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new T,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();xr.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=Q.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=Q.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new un(xr.asList(this._geometries)),a=new un(xr.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),h=c.getNumGeometries(),g=0;g<f&&g<h;){var p=i.getGeometryN(g),_=c.getGeometryN(g),d=p.compareToSameClass(_,l);if(d!==0)return d;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(k(arguments[0],xn))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(k(arguments[0],Ye)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],ln)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(k(arguments[0],Vn)){var f=arguments[0];f.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),q.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(G),Sr=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Q.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Te(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[ro]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(Jt),Te=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=De.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};Te.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)},Te.prototype.getBoundary=function(){return this._geom instanceof gt?this.boundaryLineString(this._geom):this._geom instanceof Sr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Te.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Te.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Te.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new L;this._endpointMap=new Xt;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&n.add(a.getKey())}return Y.toCoordinateArray(n)},Te.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Fo,this._endpointMap.put(t,e)),e.count++},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Te(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Te(n,i);return o.getBoundary()}};var Fo=function(){this.count=null};Fo.prototype.interfaces_=function(){return[]},Fo.prototype.getClass=function(){return Fo};function ac(){}function uc(){}var lc=function(){};function cc(){}function fc(){}function hc(){}var Me=function(){},ws={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},Me.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new cc,n=new ac;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new uc(Me.getStackTrace(i));for(var a=new hc,u=0;u<o;u++)try{s+=a.readLine()+Me.NEWLINE}catch(l){if(l instanceof fc)q.shouldNeverReachHere();else throw l}finally{}return s}},Me.split=function(t,e){for(var n=e.length,i=new L,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+n),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Me.toString=function(){if(arguments.length===1){var t=arguments[0];return Me.SIMPLE_ORDINATE_FORMAT.format(t)}},Me.spaces=function(t){return Me.chars(" ",t)},ws.NEWLINE.get=function(){return At.getProperty("line.separator")},ws.SIMPLE_ORDINATE_FORMAT.get=function(){return new lc},Object.defineProperties(Me,ws);var vt=function(){};vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.copyCoord=function(t,e,n,i){for(var o=Math.min(t.getDimension(),n.getDimension()),s=0;s<o;s++)n.setOrdinate(i,s,t.getOrdinate(e,s))},vt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,K.X)===t.getOrdinate(e-1,K.X)&&t.getOrdinate(0,K.Y)===t.getOrdinate(e-1,K.Y)},vt.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<n;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(V.isNaN(u)&&V.isNaN(l)))return!1}return!0},vt.extend=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();if(vt.copy(e,0,i,0,o),o>0)for(var s=o;s<n;s++)vt.copy(e,o-1,i,s,1);return i},vt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)vt.swap(t,i,e-i)},vt.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,o)}},vt.copy=function(t,e,n,i,o){for(var s=0;s<o;s++)vt.copyCoord(t,e+s,n,i+s)},vt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new rn;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<n;s++)s>0&&i.append(","),i.append(Me.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},vt.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return vt.createClosedRing(t,e,4);var i=e.getOrdinate(0,K.X)===e.getOrdinate(n-1,K.X)&&e.getOrdinate(0,K.Y)===e.getOrdinate(n-1,K.Y);return i?e:vt.createClosedRing(t,e,n+1)},vt.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();vt.copy(e,0,i,0,o);for(var s=o;s<n;s++)vt.copy(e,0,i,s,1);return i};var gt=function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new T:this._points.expandEnvelope(new T)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&vt.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Q.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return P.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();vt.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],h=c;return f.compare(this._points,h._points)}},t.prototype.apply=function(){var i=this;if(k(arguments[0],xn))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(k(arguments[0],Ye)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],ln)){var l=arguments[0];l.filter(this)}else if(k(arguments[0],Vn)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Te(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new lt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[ro]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(G),io=function(){};io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io};var he=function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new T;var i=new T;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Q.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(k(arguments[0],xn)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(k(arguments[0],Ye)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],ln)){var s=arguments[0];s.filter(this)}else if(k(arguments[0],Vn)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),q.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[io]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(G),sr=function(){};sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr};var St=function(r){function t(n,i,o){if(r.call(this,o),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new lt("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new lt("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(P.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(P.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var h=i.getX(f),g=i.getY(f),p=h!==l,_=g!==c;if(p===_)return!1;l=h,c=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);xr.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);At.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=Y.minCoordinate(s.getCoordinates());Y.scroll(u,l),At.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],P.isCCW(s.getCoordinates())===a&&Y.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,h=c._shell,g=f.compareToSameClass(h,l);if(g!==0)return g;for(var p=this.getNumInteriorRing(),_=c.getNumInteriorRing(),d=0;d<p&&d<_;){var y=i.getInteriorRingN(d),C=c.getInteriorRingN(d),I=y.compareToSameClass(C,l);if(I!==0)return I;d++}return d<p?1:d<_?-1:0}},t.prototype.apply=function(i){var o=this;if(k(i,xn)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(k(i,Ye)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(k(i,ln))i.filter(this);else if(k(i,Vn)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[sr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(G),wi=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Q.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[io]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(Jt),Sn=function(r){function t(n,i){n instanceof v&&i instanceof H&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Q.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();vt.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new lt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new lt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(gt),wn=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new L,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[sr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(Jt),Ae=function(t){this._factory=t||null,this._isUserDataCopied=!1},Bo={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ae.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Ae.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Ae.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof Jt?this.editGeometryCollection(t,e):t instanceof St?this.editPolygon(t,e):t instanceof he?e.edit(t,this._factory):t instanceof gt?e.edit(t,this._factory):(q.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Ae.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),o=new L,s=0;s<i.getNumGeometries();s++){var a=n.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===wi?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Sr?this._factory.createMultiLineString(o.toArray([])):i.getClass()===wn?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Ae.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new L,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Ae.GeometryEditorOperation=function(){},Bo.NoOpGeometryOperation.get=function(){return oo},Bo.CoordinateOperation.get=function(){return so},Bo.CoordinateSequenceOperation.get=function(){return ao},Object.defineProperties(Ae,Bo);var oo=function(){};oo.prototype.edit=function(t,e){return t},oo.prototype.interfaces_=function(){return[Ae.GeometryEditorOperation]},oo.prototype.getClass=function(){return oo};var so=function(){};so.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Sn?e.createLinearRing(n):t instanceof gt?e.createLineString(n):t instanceof he?n.length>0?e.createPoint(n[0]):e.createPoint():t},so.prototype.interfaces_=function(){return[Ae.GeometryEditorOperation]},so.prototype.getClass=function(){return so};var ao=function(){};ao.prototype.edit=function(t,e){return t instanceof Sn?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof gt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof he?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ao.prototype.interfaces_=function(){return[Ae.GeometryEditorOperation]},ao.prototype.getClass=function(){return ao};var yt=function(){var t=this;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 e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new v}else if(k(arguments[0],K)){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 o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new v}}},qa={serialVersionUID:{configurable:!0}};yt.prototype.setOrdinate=function(t,e,n){switch(e){case K.X:this._coordinates[t].x=n;break;case K.Y:this._coordinates[t].y=n;break;case K.Z:this._coordinates[t].z=n;break;default:throw new lt("invalid ordinateIndex")}},yt.prototype.size=function(){return this._coordinates.length},yt.prototype.getOrdinate=function(t,e){switch(e){case K.X:return this._coordinates[t].x;case K.Y:return this._coordinates[t].y;case K.Z:return this._coordinates[t].z}return V.NaN},yt.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},yt.prototype.getCoordinateCopy=function(t){return new v(this._coordinates[t])},yt.prototype.getDimension=function(){return this._dimension},yt.prototype.getX=function(t){return this._coordinates[t].x},yt.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new yt(e,this._dimension)},yt.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},yt.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new yt(e,this._dimension)},yt.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new rn(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},yt.prototype.getY=function(t){return this._coordinates[t].y},yt.prototype.toCoordinateArray=function(){return this._coordinates},yt.prototype.interfaces_=function(){return[K,Oe]},yt.prototype.getClass=function(){return yt},qa.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(yt,qa);var Ln=function(){},Ls={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ln.prototype.readResolve=function(){return Ln.instance()},Ln.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new yt(t)}else if(k(arguments[0],K)){var e=arguments[0];return new yt(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new yt(n):new yt(n,i)}},Ln.prototype.interfaces_=function(){return[vi,Oe]},Ln.prototype.getClass=function(){return Ln},Ln.instance=function(){return Ln.instanceObject},Ls.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ls.instanceObject.get=function(){return new Ln},Object.defineProperties(Ln,Ls);var Xa=function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new L,i=this.map_.values(),o=i.next();!o.done;)n.add(o.value),o=i.next();return n},t.prototype.entrySet=function(){var n=new xs;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}(Wr),J=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof cn){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},bs={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},J.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new on(n).compareTo(new on(i))},J.prototype.getScale=function(){return this._scale},J.prototype.isFloating=function(){return this._modelType===J.FLOATING||this._modelType===J.FLOATING_SINGLE},J.prototype.getType=function(){return this._modelType},J.prototype.toString=function(){var t="UNKNOWN";return this._modelType===J.FLOATING?t="Floating":this._modelType===J.FLOATING_SINGLE?t="Floating-Single":this._modelType===J.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},J.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(V.isNaN(t))return t;if(this._modelType===J.FLOATING_SINGLE){var e=t;return e}return this._modelType===J.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof v){var n=arguments[0];if(this._modelType===J.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},J.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===J.FLOATING?t=16:this._modelType===J.FLOATING_SINGLE?t=6:this._modelType===J.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},J.prototype.setScale=function(t){this._scale=Math.abs(t)},J.prototype.interfaces_=function(){return[Oe,Re]},J.prototype.getClass=function(){return J},J.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},bs.serialVersionUID.get=function(){return 7777263578777804e3},bs.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(J,bs);var cn=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},Ps={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};cn.prototype.readResolve=function(){return cn.nameToTypeMap.get(this._name)},cn.prototype.toString=function(){return this._name},cn.prototype.interfaces_=function(){return[Oe]},cn.prototype.getClass=function(){return cn},Ps.serialVersionUID.get=function(){return-552860263173159e4},Ps.nameToTypeMap.get=function(){return new Xa},Object.defineProperties(cn,Ps),J.Type=cn,J.FIXED=new cn("FIXED"),J.FLOATING=new cn("FLOATING"),J.FLOATING_SINGLE=new cn("FLOATING SINGLE");var H=function r(){this._precisionModel=new J,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?k(arguments[0],vi)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof J&&(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]))},Ya={serialVersionUID:{configurable:!0}};H.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new v(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new v(t.getMinX(),t.getMinY()),new v(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new v(t.getMinX(),t.getMinY()),new v(t.getMinX(),t.getMaxY()),new v(t.getMaxX(),t.getMaxY()),new v(t.getMaxX(),t.getMinY()),new v(t.getMinX(),t.getMinY())]),null)},H.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new gt(this.getCoordinateSequenceFactory().create(t),this);if(k(t,K))return new gt(t,this)}else return new gt(this.getCoordinateSequenceFactory().create([]),this)},H.prototype.createMultiLineString=function(){if(arguments.length===0)return new Sr(null,this);if(arguments.length===1){var t=arguments[0];return new Sr(t,this)}},H.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(n=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(H.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof St)return this.createMultiPolygon(H.toPolygonArray(t));if(u instanceof gt)return this.createMultiLineString(H.toLineStringArray(t));if(u instanceof he)return this.createMultiPoint(H.toPointArray(t));q.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},H.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},H.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(k(arguments[0],K)){var e=arguments[0];return new he(e,this)}}},H.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},H.prototype.createPolygon=function(){if(arguments.length===0)return new St(null,null,this);if(arguments.length===1){if(k(arguments[0],K)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Sn){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new St(i,o,this)}},H.prototype.getSRID=function(){return this._SRID},H.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Jt(null,this);if(arguments.length===1){var t=arguments[0];return new Jt(t,this)}},H.prototype.createGeometry=function(t){var e=new Ae(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},H.prototype.getPrecisionModel=function(){return this._precisionModel},H.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)}else if(k(arguments[0],K)){var e=arguments[0];return new Sn(e,this)}}},H.prototype.createMultiPolygon=function(){if(arguments.length===0)return new wn(null,this);if(arguments.length===1){var t=arguments[0];return new wn(t,this)}},H.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new wi(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new wi(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(k(arguments[0],K)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());vt.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},H.prototype.interfaces_=function(){return[Oe]},H.prototype.getClass=function(){return H},H.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},H.getDefaultCoordinateSequenceFactory=function(){return Ln.instance()},H.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},H.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Ya.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(H,Ya);var gc=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Go=function(t){this.geometryFactory=t||new H};Go.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!fn[n])throw new Error("Unknown GeoJSON type: "+e.type);return gc.indexOf(n)!==-1?fn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?fn[n].apply(this,[e.geometries]):fn[n].apply(this,[e])},Go.prototype.write=function(t){var e=t.getGeometryType();if(!Yn[e])throw new Error("Geometry is not supported");return Yn[e].apply(this,[t])};var fn={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!fn[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=fn.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new v(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new v(r[0],r[1]),new v(r[2],r[1]),new v(r[2],r[3]),new v(r[0],r[3]),new v(r[0],r[1])])},Point:function(r){var t=new v(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(fn.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=fn.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(fn.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=fn.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],o=1;o<r.length;++o){var s=r[o],a=fn.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(fn.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Yn={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=Yn.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Yn.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var o=n[i];e.push(Yn.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Yn.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=Yn.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var o=r._holes[i],s=Yn.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Yn.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=i.getGeometryType();e.push(Yn[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Rs=function(t){this.geometryFactory=t||new H,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Go(this.geometryFactory)};Rs.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===J.FIXED&&this.reducePrecision(e),e},Rs.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var Ha=function(){this.parser=new Go(this.geometryFactory)};Ha.prototype.write=function(t){return this.parser.write(t)};var S=function(){},ko={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.opposite=function(t){return t===S.LEFT?S.RIGHT:t===S.RIGHT?S.LEFT:t},ko.ON.get=function(){return 0},ko.LEFT.get=function(){return 1},ko.RIGHT.get=function(){return 2},Object.defineProperties(S,ko);function zo(r){this.message=r||""}zo.prototype=new Error,zo.prototype.name="EmptyStackException";function hn(){this.array_=[]}hn.prototype=new qe,hn.prototype.add=function(r){return this.array_.push(r),!0},hn.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},hn.prototype.push=function(r){return this.array_.push(r),r},hn.prototype.pop=function(r){if(this.array_.length===0)throw new zo;return this.array_.pop()},hn.prototype.peek=function(){if(this.array_.length===0)throw new zo;return this.array_[this.array_.length-1]},hn.prototype.empty=function(){return this.array_.length===0},hn.prototype.isEmpty=function(){return this.empty()},hn.prototype.search=function(r){return this.array_.indexOf(r)},hn.prototype.size=function(){return this.array_.length},hn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var gn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};gn.prototype.getCoordinate=function(){return this._minCoord},gn.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},gn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();q.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=P.computeOrientation(this._minCoord,n,e),o=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===P.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===P.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},gn.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=S.LEFT;return i[e].y<i[e+1].y&&(o=S.RIGHT),o},gn.prototype.getEdge=function(){return this._orientedDe},gn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},gn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},gn.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}q.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;var o=this.getRightmostSide(this._minDe,this._minIndex);o===S.LEFT&&(this._orientedDe=this._minDe.getSym())},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Hn=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new v(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t}(zn),Vo=function(){this.array_=[]};Vo.prototype.addLast=function(t){this.array_.push(t)},Vo.prototype.removeFirst=function(){return this.array_.shift()},Vo.prototype.isEmpty=function(){return this.array_.length===0};var Zt=function(){this._finder=null,this._dirEdgeList=new L,this._nodes=new L,this._rightMostCoord=null,this._env=null,this._finder=new gn};Zt.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},Zt.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Zt.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){n=o;break}}if(n===null)throw new Hn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}},Zt.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(S.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Zt.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Zt.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(S.RIGHT)>=1&&e.getDepth(S.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Zt.prototype.computeDepths=function(t){var e=this,n=new xs,i=new Vo,o=t.getNode();for(i.addLast(o),n.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();n.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},Zt.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Zt.prototype.getEnvelope=function(){if(this._env===null){for(var t=new T,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},Zt.prototype.addReachable=function(t){var e=this,n=new hn;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},Zt.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(S.LEFT,t.getDepth(S.RIGHT)),e.setDepth(S.RIGHT,t.getDepth(S.LEFT))},Zt.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();n._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}},Zt.prototype.getNodes=function(){return this._nodes},Zt.prototype.getDirectedEdges=function(){return this._dirEdgeList},Zt.prototype.interfaces_=function(){return[Re]},Zt.prototype.getClass=function(){return Zt};var st=function r(){var t=this;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 n=arguments[0];this.init(1),this.location[S.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[S.ON]=s,this.location[S.LEFT]=a,this.location[S.RIGHT]=u}};st.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},st.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==m.NONE)return!1;return!0},st.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===m.NONE&&(e.location[n]=t)},st.prototype.isLine=function(){return this.location.length===1},st.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[S.ON]=this.location[S.ON],n[S.LEFT]=m.NONE,n[S.RIGHT]=m.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===m.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},st.prototype.getLocations=function(){return this.location},st.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[S.LEFT];this.location[S.LEFT]=this.location[S.RIGHT],this.location[S.RIGHT]=t},st.prototype.toString=function(){var t=new rn;return this.location.length>1&&t.append(m.toLocationSymbol(this.location[S.LEFT])),t.append(m.toLocationSymbol(this.location[S.ON])),this.location.length>1&&t.append(m.toLocationSymbol(this.location[S.RIGHT])),t.toString()},st.prototype.setLocations=function(t,e,n){this.location[S.ON]=t,this.location[S.LEFT]=e,this.location[S.RIGHT]=n},st.prototype.get=function(t){return t<this.location.length?this.location[t]:m.NONE},st.prototype.isArea=function(){return this.location.length>1},st.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===m.NONE)return!0;return!1},st.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(S.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},st.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(m.NONE)},st.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},st.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st};var tt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new st(t),this.elt[1]=new st(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new st(e.elt[0]),this.elt[1]=new st(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new st(m.NONE),this.elt[1]=new st(m.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new st(o,s,a),this.elt[1]=new st(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new st(m.NONE,m.NONE,m.NONE),this.elt[1]=new st(m.NONE,m.NONE,m.NONE),this.elt[u].setLocations(l,c,f)}};tt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},tt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},tt.prototype.isNull=function(t){return this.elt[t].isNull()},tt.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],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},tt.prototype.isLine=function(t){return this.elt[t].isLine()},tt.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new st(t.elt[n]):e.elt[n].merge(t.elt[n])},tt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},tt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(S.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},tt.prototype.toString=function(){var t=new rn;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()},tt.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()}},tt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},tt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(S.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this.elt[n].setLocation(i,o)}},tt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},tt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},tt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new st(this.elt[t].location[0]))},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.toLineLabel=function(t){for(var e=new tt(m.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var It=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new L,this._pts=new L,this._label=new tt(m.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new L,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};It.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=P.isCCW(this._ring.getCoordinates())},It.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},It.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Hn("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Hn("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var o=n.getLabel();q.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},It.prototype.getLinearRing=function(){return this._ring},It.prototype.getCoordinate=function(t){return this._pts.get(t)},It.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},It.prototype.addPoints=function(t,e,n){var i=this,o=t.getCoordinates();if(e){var s=1;n&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;n&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}},It.prototype.isHole=function(){return this._isHole},It.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},It.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!P.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},It.prototype.addHole=function(t){this._holes.add(t)},It.prototype.isShell=function(){return this._shell===null},It.prototype.getLabel=function(){return this._label},It.prototype.getEdges=function(){return this._edges},It.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},It.prototype.getShell=function(){return this._shell},It.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],n=arguments[1],i=e.getLocation(n,S.RIGHT);if(i===m.NONE)return null;if(this._label.getLocation(n)===m.NONE)return this._label.setLocation(n,i),null}},It.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},It.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),n);return o},It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It};var pc=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(It),dc=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new L,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new pc(o,n._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(It),Ce=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}}};Ce.prototype.setVisited=function(t){this._isVisited=t},Ce.prototype.setInResult=function(t){this._isInResult=t},Ce.prototype.isCovered=function(){return this._isCovered},Ce.prototype.isCoveredSet=function(){return this._isCoveredSet},Ce.prototype.setLabel=function(t){this._label=t},Ce.prototype.getLabel=function(){return this._label},Ce.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ce.prototype.updateIM=function(t){q.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ce.prototype.isInResult=function(){return this._isInResult},Ce.prototype.isVisited=function(){return this._isVisited},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Uo=function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new tt(0,m.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var o=m.NONE;if(o=this._label.getLocation(i),!n.isNull(i)){var s=n.getLocation(i);o!==m.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new tt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof tt)for(var o=arguments[0],s=0;s<2;s++){var a=n.computeMergedLocation(o,s),u=n._label.getLocation(s);u===m.NONE&&n._label.setLocation(s,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=m.NONE;this._label!==null&&(i=this._label.getLocation(n));var o=null;switch(i){case m.BOUNDARY:o=m.INTERIOR;break;case m.INTERIOR:o=m.BOUNDARY;break;default:o=m.BOUNDARY;break}this._label.setLocation(n,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ce),pn=function(){this.nodeMap=new Xt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};pn.prototype.find=function(t){return this.nodeMap.get(t)},pn.prototype.addNode=function(){if(arguments[0]instanceof v){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Uo){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},pn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},pn.prototype.iterator=function(){return this.nodeMap.values().iterator()},pn.prototype.values=function(){return this.nodeMap.values()},pn.prototype.getBoundaryNodes=function(t){for(var e=new L,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===m.BOUNDARY&&e.add(i)}return e},pn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var et=function(){},uo={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.isNorthern=function(t){return t===et.NE||t===et.NW},et.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},et.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},et.isInHalfPlane=function(t,e){return e===et.SE?t===et.SE||t===et.SW:t===e||t===e+1},et.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 lt("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?et.NE:et.SE:e>=0?et.NW:et.SW}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new lt("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?et.NE:et.SE:i.y>=n.y?et.NW:et.SW}},uo.NE.get=function(){return 0},uo.NW.get=function(){return 1},uo.SW.get=function(){return 2},uo.SE.get=function(){return 3},Object.defineProperties(et,uo);var Yt=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],n=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(n,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};Yt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:P.computeOrientation(t._p0,t._p1,this._p1)},Yt.prototype.getDy=function(){return this._dy},Yt.prototype.getCoordinate=function(){return this._p0},Yt.prototype.setNode=function(t){this._node=t},Yt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),o=n.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Yt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Yt.prototype.getDirectedCoordinate=function(){return this._p1},Yt.prototype.getDx=function(){return this._dx},Yt.prototype.getLabel=function(){return this._label},Yt.prototype.getEdge=function(){return this._edge},Yt.prototype.getQuadrant=function(){return this._quadrant},Yt.prototype.getNode=function(){return this._node},Yt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Yt.prototype.computeLabel=function(t){},Yt.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=et.quadrant(this._dx,this._dy),q.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Yt.prototype.interfaces_=function(){return[Re]},Yt.prototype.getClass=function(){return Yt};var Os=function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),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(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new tt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Hn("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,o=0;o<2;o++)n._label.isArea(o)&&n._label.getLocation(o,S.LEFT)===m.INTERIOR&&n._label.getLocation(o,S.RIGHT)===m.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[S.LEFT]+"/"+this._depth[S.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,m.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,m.EXTERIOR);return n&&i&&o},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;n===S.LEFT&&(s=-1);var a=S.opposite(n),u=o*s,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===m.EXTERIOR&&i===m.INTERIOR?1:n===m.INTERIOR&&i===m.EXTERIOR?-1:0},t}(Yt),Li=function(){};Li.prototype.createNode=function(t){return new Uo(t,null)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var ht=function(){if(this._edges=new L,this._nodes=null,this._edgeEndList=new L,arguments.length===0)this._nodes=new pn(new Li);else if(arguments.length===1){var t=arguments[0];this._nodes=new pn(t)}};ht.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},ht.prototype.find=function(t){return this._nodes.find(t)},ht.prototype.addNode=function(){if(arguments[0]instanceof Uo){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this._nodes.addNode(e)}},ht.prototype.getNodeIterator=function(){return this._nodes.iterator()},ht.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},ht.prototype.debugPrintln=function(t){At.out.println(t)},ht.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===m.BOUNDARY},ht.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},ht.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?P.computeOrientation(t,e,i)===P.COLLINEAR&&et.quadrant(t,e)===et.quadrant(n,i):!1},ht.prototype.getEdgeEnds=function(){return this._edgeEndList},ht.prototype.debugPrint=function(t){At.out.print(t)},ht.prototype.getEdgeIterator=function(){return this._edges.iterator()},ht.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(n.matchInSameDirection(t,e,s[0],s[1])||n.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null},ht.prototype.insertEdge=function(t){this._edges.add(t)},ht.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},ht.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var o=new Os(i,!0),s=new Os(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}},ht.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},ht.prototype.getNodes=function(){return this._nodes.values()},ht.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},ht.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var ge=function(){this._geometryFactory=null,this._shellList=new L;var t=arguments[0];this._geometryFactory=t};ge.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?n.add(o):e.add(o)}},ge.prototype.computePolygons=function(t){for(var e=this,n=new L,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);n.add(s)}return n},ge.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=n.findEdgeRingContaining(o,t);if(s===null)throw new Hn("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},ge.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,o=new L,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):n.addAll(u)}else o.add(a)}return o},ge.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},ge.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new L,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new dc(o,e._geometryFactory);n.add(s),s.setInResult()}}return n},ge.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},ge.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},ge.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),o=n.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var h=!1;f.contains(i)&&P.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},ge.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(n=o,e++)}return q.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},ge.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],n=arguments[1];ht.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),o=new L,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var bi=function(){};bi.prototype.getBounds=function(){},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[bi,Oe]},He.prototype.getClass=function(){return He};var Wn=function(){this._size=null,this._items=null,this._size=0,this._items=new L,this._items.add(null)};Wn.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},Wn.prototype.size=function(){return this._size},Wn.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},Wn.prototype.clear=function(){this._size=0,this._items.clear()},Wn.prototype.isEmpty=function(){return this._size===0},Wn.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var ar=function(){};ar.prototype.visitItem=function(t){},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar};var jr=function(){};jr.prototype.insert=function(t,e){},jr.prototype.remove=function(t,e){},jr.prototype.query=function(){},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var wt=function(){if(this._childBoundables=new L,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Wa={serialVersionUID:{configurable:!0}};wt.prototype.getLevel=function(){return this._level},wt.prototype.size=function(){return this._childBoundables.size()},wt.prototype.getChildBoundables=function(){return this._childBoundables},wt.prototype.addChildBoundable=function(t){q.isTrue(this._bounds===null),this._childBoundables.add(t)},wt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},wt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},wt.prototype.interfaces_=function(){return[bi,Oe]},wt.prototype.getClass=function(){return wt},Wa.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(wt,Wa);var We=function(){};We.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},We.min=function(t){return We.sort(t),t.get(0)},We.sort=function(t,e){var n=t.toArray();e?xr.sort(n,e):xr.sort(n);for(var i=t.iterator(),o=0,s=n.length;o<s;o++)i.next(),i.set(n[o])},We.singletonList=function(t){var e=new L;return e.add(t),e};var Ct=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Ct.prototype.expandToQueue=function(t,e){var n=Ct.isComposite(this._boundable1),i=Ct.isComposite(this._boundable2);if(n&&i)return Ct.area(this._boundable1)>Ct.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new lt("neither boundable is composite")},Ct.prototype.isLeaves=function(){return!(Ct.isComposite(this._boundable1)||Ct.isComposite(this._boundable2))},Ct.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Ct.prototype.expand=function(t,e,n,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new Ct(u,e,o._itemDistance);l.getDistance()<i&&n.add(l)}},Ct.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Ct.prototype.getDistance=function(){return this._distance},Ct.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Ct.prototype.interfaces_=function(){return[Re]},Ct.prototype.getClass=function(){return Ct},Ct.area=function(t){return t.getBounds().getArea()},Ct.isComposite=function(t){return t instanceof wt};var Dt=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new L,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];q.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},qo={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Dt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Dt.prototype.lastNode=function(t){return t.get(t.size()-1)},Dt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof wt?n+=t.size(o):o instanceof He&&(n+=1)}return n}},Dt.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof He&&o.getItem()===e&&(n=o)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Dt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new L:e}else if(arguments.length===1){for(var n=arguments[0],i=new L,o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof wt){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof He?i.add(s.getItem()):q.shouldNeverReachHere()}return i.size()<=0?null:i}},Dt.prototype.insert=function(t,e){q.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},Dt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new L;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(q.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof wt?t.boundablesAtLevel(i,u,s):(q.isTrue(u instanceof He),i===-1&&s.add(u))}return null}},Dt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new L;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(k(arguments[2],ar)&&arguments[0]instanceof Object&&arguments[1]instanceof wt)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof wt?t.query(s,f,u):f instanceof He?u.visitItem(f.getItem()):q.shouldNeverReachHere())}else if(k(arguments[2],qe)&&arguments[0]instanceof Object&&arguments[1]instanceof wt)for(var h=arguments[0],g=arguments[1],p=arguments[2],_=g.getChildBoundables(),d=0;d<_.size();d++){var y=_.get(d);t.getIntersectsOp().intersects(y.getBounds(),h)&&(y instanceof wt?t.query(h,y,p):y instanceof He?p.add(y.getItem()):q.shouldNeverReachHere())}}},Dt.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},Dt.prototype.getRoot=function(){return this.build(),this._root},Dt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof wt&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},Dt.prototype.createHigherLevels=function(t,e){q.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},Dt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof wt){var s=t.depth(o);s>n&&(n=s)}}return n+1}},Dt.prototype.createParentBoundables=function(t,e){var n=this;q.isTrue(!t.isEmpty());var i=new L;i.add(this.createNode(e));var o=new L(t);We.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(a)}return i},Dt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Dt.prototype.interfaces_=function(){return[Oe]},Dt.prototype.getClass=function(){return Dt},Dt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},qo.IntersectsOp.get=function(){return vc},qo.serialVersionUID.get=function(){return-3886435814360241e3},qo.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Dt,qo);var vc=function(){},Pi=function(){};Pi.prototype.distance=function(t,e){},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var ja=function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;q.isTrue(i.length>0);for(var a=new L,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new Ka(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,o)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new L;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];r.prototype.query.call(this,o,s)}else if(arguments.length===3){if(k(arguments[2],ar)&&arguments[0]instanceof Object&&arguments[1]instanceof wt){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(k(arguments[2],qe)&&arguments[0]instanceof Object&&arguments[1]instanceof wt){var c=arguments[0],f=arguments[1],h=arguments[2];r.prototype.query.call(this,c,f,h)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return r.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return r.prototype.remove.call(this,i,o)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){q.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new L(i);We.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(k(arguments[0],Pi)){var i=arguments[0],o=new Ct(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof Ct){var s=arguments[0];return this.nearestNeighbour(s,V.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&k(arguments[1],Pi)){var a=arguments[0],u=arguments[1],l=new Ct(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Ct&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=f,g=null,p=new Wn;for(p.add(c);!p.isEmpty()&&h>0;){var _=p.poll(),d=_.getDistance();if(d>=h)break;_.isLeaves()?(h=d,g=_):_.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var y=arguments[0],C=arguments[1],I=arguments[2],N=new He(y,C),w=new Ct(this.getRoot(),N,I);return this.nearestNeighbour(w)[0]}},t.prototype.interfaces_=function(){return[jr,Oe]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return Ka},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[di]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[di]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Dt),Ka=function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();n===null?n=new T(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wt),ue=function(){};ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue},ue.relativeSign=function(t,e){return t<e?-1:t>e?1:0},ue.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=ue.relativeSign(e.x,n.x),o=ue.relativeSign(e.y,n.y);switch(t){case 0:return ue.compareValue(i,o);case 1:return ue.compareValue(o,i);case 2:return ue.compareValue(o,-i);case 3:return ue.compareValue(-i,o);case 4:return ue.compareValue(-i,-o);case 5:return ue.compareValue(-o,-i);case 6:return ue.compareValue(-o,i);case 7:return ue.compareValue(i,-o)}return q.shouldNeverReachHere("invalid octant value"),0},ue.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ur=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new v(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};ur.prototype.getCoordinate=function(){return this.coord},ur.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ur.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:ue.compare(this._segmentOctant,this.coord,e.coord)},ur.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},ur.prototype.isInterior=function(){return this._isInterior},ur.prototype.interfaces_=function(){return[Re]},ur.prototype.getClass=function(){return ur};var $t=function(){this._nodeMap=new Xt,this._edge=null;var t=arguments[0];this._edge=t};$t.prototype.getSplitCoordinates=function(){var t=this,e=new to;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},$t.prototype.addCollapsedNodes=function(){var t=this,e=new L;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},$t.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},$t.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),o=e._edge.getCoordinate(n+2);i.equals2D(o)&&t.add(new on(n+1))}},$t.prototype.addEdgeCoordinates=function(t,e,n){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);n.add(new v(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));s&&n.add(new v(e.coord))},$t.prototype.iterator=function(){return this._nodeMap.values().iterator()},$t.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},$t.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},$t.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,n);a&&t.add(new on(n[0])),o=s}},$t.prototype.getEdge=function(){return this._edge},$t.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},$t.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return s&&(a[u]=new v(e.coord)),new mt(a,this._edge.getData())},$t.prototype.add=function(t,e){var n=new ur(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(q.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},$t.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new zn("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new zn("bad split edge end point at "+a)},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Kr=function(){};Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.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 lt("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new lt("Cannot compute the octant for two identical points "+o);return Kr.octant(a,u)}};var bn=function(){};bn.prototype.getCoordinates=function(){},bn.prototype.size=function(){},bn.prototype.getCoordinate=function(t){},bn.prototype.isClosed=function(){},bn.prototype.setData=function(t){},bn.prototype.getData=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn};var lo=function(){};lo.prototype.addIntersection=function(t,e){},lo.prototype.interfaces_=function(){return[bn]},lo.prototype.getClass=function(){return lo};var mt=function(){this._nodeList=new $t(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};mt.prototype.getCoordinates=function(){return this._pts},mt.prototype.size=function(){return this._pts.length},mt.prototype.getCoordinate=function(t){return this._pts[t]},mt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},mt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},mt.prototype.setData=function(t){this._data=t},mt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Kr.octant(t,e)},mt.prototype.getData=function(){return this._data},mt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[3],s=new v(n.getIntersection(o));this.addIntersection(s,i)}},mt.prototype.toString=function(){return Ue.toLineString(new yt(this._pts))},mt.prototype.getNodeList=function(){return this._nodeList},mt.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(n=i)}var s=this._nodeList.add(t,n);return s},mt.prototype.addIntersections=function(t,e,n){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,n,o)},mt.prototype.interfaces_=function(){return[lo]},mt.prototype.getClass=function(){return mt},mt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new L;return mt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],o=n.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var M=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new v,this.p1=new v;else if(arguments.length===1){var t=arguments[0];this.p0=new v(t.p0),this.p1=new v(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],o=arguments[3];this.p0=new v(e,n),this.p1=new v(i,o)}},Qa={serialVersionUID:{configurable:!0}};M.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},M.prototype.orientationIndex=function(){if(arguments[0]instanceof M){var t=arguments[0],e=P.orientationIndex(this.p0,this.p1,t.p0),n=P.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof v){var i=arguments[0];return P.orientationIndex(this.p0,this.p1,i)}},M.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},M.prototype.isVertical=function(){return this.p0.x===this.p1.x},M.prototype.equals=function(t){if(!(t instanceof M))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},M.prototype.intersection=function(t){var e=new Cr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},M.prototype.project=function(){if(arguments[0]instanceof v){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new v(t);var e=this.projectionFactor(t),n=new v;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof M){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new M(a,u)}},M.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},M.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},M.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},M.prototype.distancePerpendicular=function(t){return P.distancePointLinePerpendicular(t,this.p0,this.p1)},M.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},M.prototype.midPoint=function(){return M.midPoint(this.p0,this.p1)},M.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,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return V.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return o},M.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=V.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,n[0]=this.p1,n[1]=l),n},M.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},M.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},M.prototype.getLength=function(){return this.p0.distance(this.p1)},M.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},M.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},M.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)},M.prototype.lineIntersection=function(t){try{var e=Ve.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof yi))throw n}finally{}return null},M.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},M.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=n-l,f=i+u,h=new v(c,f);return h},M.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],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},M.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||V.isNaN(e))&&(e=1),e},M.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},M.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},M.prototype.distance=function(){if(arguments[0]instanceof M){var t=arguments[0];return P.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof v){var e=arguments[0];return P.distancePointLine(e,this.p0,this.p1)}},M.prototype.pointAlong=function(t){var e=new v;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},M.prototype.hashCode=function(){var t=V.doubleToLongBits(this.p0.x);t^=V.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=V.doubleToLongBits(this.p1.x);n^=V.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},M.prototype.interfaces_=function(){return[Re,Oe]},M.prototype.getClass=function(){return M},M.midPoint=function(t,e){return new v((t.x+e.x)/2,(t.y+e.y)/2)},Qa.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(M,Qa);var co=function(){this.tempEnv1=new T,this.tempEnv2=new T,this._overlapSeg1=new M,this._overlapSeg2=new M};co.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var pe=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],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};pe.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},pe.prototype.computeSelect=function(t,e,n,i){var o=this._pts[e],s=this._pts[n];if(i.tempEnv1.init(o,s),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,i),a<n&&this.computeSelect(t,a,n,i)},pe.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},pe.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},pe.prototype.setId=function(t){this._id=t},pe.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},pe.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new T(t,e)}return this._env},pe.prototype.getEndIndex=function(){return this._end},pe.prototype.getStartIndex=function(){return this._start},pe.prototype.getContext=function(){return this._context},pe.prototype.getId=function(){return this._id},pe.prototype.computeOverlapsInternal=function(t,e,n,i,o,s){var a=this._pts[t],u=this._pts[e],l=n._pts[i],c=n._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,n,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),h=Math.trunc((i+o)/2);t<f&&(i<h&&this.computeOverlapsInternal(t,f,n,i,h,s),h<o&&this.computeOverlapsInternal(t,f,n,h,o,s)),f<e&&(i<h&&this.computeOverlapsInternal(f,e,n,i,h,s),h<o&&this.computeOverlapsInternal(f,e,n,h,o,s))},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe};var dn=function(){};dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.getChainStartIndices=function(t){var e=0,n=new L;n.add(new on(e));do{var i=dn.findChainEnd(t,e);n.add(new on(i)),e=i}while(e<t.length-1);var o=dn.toIntArray(n);return o},dn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=et.quadrant(t[n],t[n+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=et.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1},dn.getChains=function(){if(arguments.length===1){var t=arguments[0];return dn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new L,o=dn.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new pe(e,o[s],o[s+1],n);i.add(a)}return i}},dn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var wr=function(){};wr.prototype.computeNodes=function(t){},wr.prototype.getNodedSubstrings=function(){},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr};var fo=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};fo.prototype.setSegmentIntersector=function(t){this._segInt=t},fo.prototype.interfaces_=function(){return[wr]},fo.prototype.getClass=function(){return fo};var Ds=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new L,this._index=new ja,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return mt.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=dn.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new Ja(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Ja},Object.defineProperties(t,e),t}(fo),Ja=function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=n.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(co),Z=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},jn={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}};Z.prototype.getEndCapStyle=function(){return this._endCapStyle},Z.prototype.isSingleSided=function(){return this._isSingleSided},Z.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Z.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Z.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Z.JOIN_ROUND&&(this._quadrantSegments=Z.DEFAULT_QUADRANT_SEGMENTS)},Z.prototype.getJoinStyle=function(){return this._joinStyle},Z.prototype.setJoinStyle=function(t){this._joinStyle=t},Z.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Z.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Z.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Z.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Z.prototype.getMitreLimit=function(){return this._mitreLimit},Z.prototype.setMitreLimit=function(t){this._mitreLimit=t},Z.prototype.setSingleSided=function(t){this._isSingleSided=t},Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},jn.CAP_ROUND.get=function(){return 1},jn.CAP_FLAT.get=function(){return 2},jn.CAP_SQUARE.get=function(){return 3},jn.JOIN_ROUND.get=function(){return 1},jn.JOIN_MITRE.get=function(){return 2},jn.JOIN_BEVEL.get=function(){return 3},jn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},jn.DEFAULT_MITRE_LIMIT.get=function(){return 5},jn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Z,jn);var pt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=P.COUNTERCLOCKWISE,this._inputLine=t||null},ho={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};pt.prototype.isDeletable=function(t,e,n,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,n,i)},pt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=pt.DELETE,s=!0,o=!0),s?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return o},pt.prototype.isShallowConcavity=function(t,e,n,i){var o=P.computeOrientation(t,e,n),s=o===this._angleOrientation;if(!s)return!1;var a=P.distancePointLine(e,t,n);return a<i},pt.prototype.isShallowSampled=function(t,e,n,i,o){var s=this,a=Math.trunc((i-n)/pt.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0},pt.prototype.isConcave=function(t,e,n){var i=P.computeOrientation(t,e,n),o=i===this._angleOrientation;return o},pt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=P.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},pt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===pt.DELETE;)e++;return e},pt.prototype.isShallow=function(t,e,n,i){var o=P.distancePointLine(e,t,n);return o<i},pt.prototype.collapseLine=function(){for(var t=this,e=new to,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==pt.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},pt.simplify=function(t,e){var n=new pt(t);return n.simplify(e)},ho.INIT.get=function(){return 0},ho.DELETE.get=function(){return 1},ho.KEEP.get=function(){return 1},ho.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(pt,ho);var Ne=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new L},Za={COORDINATE_ARRAY_TYPE:{configurable:!0}};Ne.prototype.getCoordinates=function(){var t=this._ptList.toArray(Ne.COORDINATE_ARRAY_TYPE);return t},Ne.prototype.setPrecisionModel=function(t){this._precisionModel=t},Ne.prototype.addPt=function(t){var e=new v(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Ne.prototype.revere=function(){},Ne.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)n.addPt(t[o])},Ne.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},Ne.prototype.toString=function(){var t=new H,e=t.createLineString(this.getCoordinates());return e.toString()},Ne.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new v(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Ne.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Za.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Ne,Za);var j=function(){},Qr={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.toDegrees=function(t){return t*180/Math.PI},j.normalize=function(t){for(;t>Math.PI;)t-=j.PI_TIMES_2;for(;t<=-Math.PI;)t+=j.PI_TIMES_2;return t},j.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,o=n.y-e.y;return Math.atan2(o,i)}},j.isAcute=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u>0},j.isObtuse=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u<0},j.interiorAngle=function(t,e,n){var i=j.angle(e,t),o=j.angle(e,n);return Math.abs(o-i)},j.normalizePositive=function(t){if(t<0){for(;t<0;)t+=j.PI_TIMES_2;t>=j.PI_TIMES_2&&(t=0)}else{for(;t>=j.PI_TIMES_2;)t-=j.PI_TIMES_2;t<0&&(t=0)}return t},j.angleBetween=function(t,e,n){var i=j.angle(e,t),o=j.angle(e,n);return j.diff(i,o)},j.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},j.toRadians=function(t){return t*Math.PI/180},j.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?j.COUNTERCLOCKWISE:n<0?j.CLOCKWISE:j.NONE},j.angleBetweenOriented=function(t,e,n){var i=j.angle(e,t),o=j.angle(e,n),s=o-i;return s<=-Math.PI?s+j.PI_TIMES_2:s>Math.PI?s-j.PI_TIMES_2:s},Qr.PI_TIMES_2.get=function(){return 2*Math.PI},Qr.PI_OVER_2.get=function(){return Math.PI/2},Qr.PI_OVER_4.get=function(){return Math.PI/4},Qr.COUNTERCLOCKWISE.get=function(){return P.COUNTERCLOCKWISE},Qr.CLOCKWISE.get=function(){return P.CLOCKWISE},Qr.NONE.get=function(){return P.COLLINEAR},Object.defineProperties(j,Qr);var ut=function r(){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 M,this._seg1=new M,this._offset0=new M,this._offset1=new M,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Cr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Z.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},go={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}};ut.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=P.computeOrientation(this._s0,this._s1,this._s2),i=n===P.CLOCKWISE&&this._side===S.LEFT||n===P.COUNTERCLOCKWISE&&this._side===S.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},ut.prototype.addLineEndCap=function(t,e){var n=new M(t,e),i=new M;this.computeOffsetSegment(n,S.LEFT,this._distance,i);var o=new M;this.computeOffsetSegment(n,S.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case Z.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,P.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case Z.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case Z.CAP_SQUARE:var l=new v;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new v(i.p1.x+l.x,i.p1.y+l.y),f=new v(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},ut.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ut.prototype.addMitreJoin=function(t,e,n,i){var o=!0,s=null;try{s=Ve.intersection(e.p0,e.p1,n.p0,n.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof yi)s=new v(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},ut.prototype.addFilletCorner=function(t,e,n,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=n.x-t.x,c=n.y-t.y,f=Math.atan2(c,l);i===P.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(n)},ut.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ut.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Z.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Z.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))},ut.prototype.createSquare=function(t){this._segList.addPt(new v(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new v(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ut.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ut.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ut.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ut.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},ut.prototype.addLimitedMitreJoin=function(t,e,n,i){var o=this._seg0.p1,s=j.angle(o,this._seg0.p0),a=j.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=j.normalize(s+u),c=j.normalize(l+Math.PI),f=i*n,h=f*Math.abs(Math.sin(u)),g=n-h,p=o.x+f*Math.cos(c),_=o.y+f*Math.sin(c),d=new v(p,_),y=new M(o,d),C=y.pointAlongOffset(1,g),I=y.pointAlongOffset(1,-g);this._side===S.LEFT?(this._segList.addPt(C),this._segList.addPt(I)):(this._segList.addPt(I),this._segList.addPt(C))},ut.prototype.computeOffsetSegment=function(t,e,n,i){var o=e===S.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*n*s/u,c=o*n*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l},ut.prototype.addFilletArc=function(t,e,n,i,o){var s=this,a=i===P.CLOCKWISE?-1:1,u=Math.abs(e-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,h=c,g=new v;h<u;){var p=e+a*h;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),s._segList.addPt(g),h+=f}},ut.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*ut.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new v((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new v((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},ut.prototype.createCircle=function(t){var e=new v(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ut.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ut.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ne,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ut.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ut.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===Z.JOIN_BEVEL||this._bufParams.getJoinStyle()===Z.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,P.CLOCKWISE,this._distance))},ut.prototype.closeRing=function(){this._segList.closeRing()},ut.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut},go.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},go.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},go.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},go.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ut,go);var le=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};le.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,n,o);var s=o.getCoordinates();return n&&Y.reverse(s),s},le.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var o=pt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],S.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{n.addSegments(t,!1);var u=pt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],S.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},le.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===S.RIGHT&&(i=-i);var o=pt.simplify(t,i),s=o.length-1;n.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;n.addNextSegment(o[a],u)}n.closeRing()},le.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=pt.simplify(t,n),o=i.length-1;e.initSideSegments(i[0],i[1],S.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=pt.simplify(t,-n),u=a.length-1;e.initSideSegments(a[u],a[u-1],S.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},le.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Z.CAP_ROUND:e.createCircle(t);break;case Z.CAP_SQUARE:e.createSquare(t);break}},le.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s},le.prototype.getBufferParameters=function(){return this._bufParams},le.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},le.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return le.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},le.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var o=pt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],S.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{var u=pt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],S.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},le.prototype.getSegGen=function(t){return new ut(this._precisionModel,this._bufParams,t)},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new v(t[n]);return e};var Jr=function(){this._subgraphs=null,this._seg=new M,this._cga=new P;var t=arguments[0];this._subgraphs=t},$a={DepthSegment:{configurable:!0}};Jr.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new L,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(k(arguments[2],qe)&&arguments[0]instanceof v&&arguments[1]instanceof Os)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(h<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&P.computeOrientation(t._seg.p0,t._seg.p1,a)!==P.RIGHT){var g=u.getDepth(S.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(S.RIGHT));var p=new Lr(t._seg,g);l.add(p)}}else if(k(arguments[2],qe)&&arguments[0]instanceof v&&k(arguments[1],qe))for(var _=arguments[0],d=arguments[1],y=arguments[2],C=d.iterator();C.hasNext();){var I=C.next();I.isForward()&&t.findStabbedSegments(_,I,y)}}},Jr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=We.min(e);return n._leftDepth},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},$a.DepthSegment.get=function(){return Lr},Object.defineProperties(Jr,$a);var Lr=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new M(t),this._leftDepth=e};Lr.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Lr.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Lr.prototype.toString=function(){return this._upwardSeg.toString()},Lr.prototype.interfaces_=function(){return[Re]},Lr.prototype.getClass=function(){return Lr};var $=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};$.prototype.area=function(){return $.area(this.p0,this.p1,this.p2)},$.prototype.signedArea=function(){return $.signedArea(this.p0,this.p1,this.p2)},$.prototype.interpolateZ=function(t){if(t===null)throw new lt("Supplied point is null.");return $.interpolateZ(t,this.p0,this.p1,this.p2)},$.prototype.longestSideLength=function(){return $.longestSideLength(this.p0,this.p1,this.p2)},$.prototype.isAcute=function(){return $.isAcute(this.p0,this.p1,this.p2)},$.prototype.circumcentre=function(){return $.circumcentre(this.p0,this.p1,this.p2)},$.prototype.area3D=function(){return $.area3D(this.p0,this.p1,this.p2)},$.prototype.centroid=function(){return $.centroid(this.p0,this.p1,this.p2)},$.prototype.inCentre=function(){return $.inCentre(this.p0,this.p1,this.p2)},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},$.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},$.det=function(t,e,n,i){return t*i-e*n},$.interpolateZ=function(t,e,n,i){var o=e.x,s=e.y,a=n.x-o,u=i.x-o,l=n.y-s,c=i.y-s,f=a*c-u*l,h=t.x-o,g=t.y-s,p=(c*h-u*g)/f,_=(-l*h+a*g)/f,d=e.z+p*(n.z-e.z)+_*(i.z-e.z);return d},$.longestSideLength=function(t,e,n){var i=t.distance(e),o=e.distance(n),s=n.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a},$.isAcute=function(t,e,n){return!(!j.isAcute(t,e,n)||!j.isAcute(e,n,t)||!j.isAcute(n,t,e))},$.circumcentre=function(t,e,n){var i=n.x,o=n.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*$.det(s,a,u,l),f=$.det(a,s*s+a*a,l,u*u+l*l),h=$.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new v(g,p)},$.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,o=new Ve(t.x+n/2,t.y+i/2,1),s=new Ve(t.x-i+n/2,t.y+n+i/2,1);return new Ve(o,s)},$.angleBisector=function(t,e,n){var i=e.distance(t),o=e.distance(n),s=i/(i+o),a=n.x-t.x,u=n.y-t.y,l=new v(t.x+s*a,t.y+s*u);return l},$.area3D=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=n.x-t.x,u=n.y-t.y,l=n.z-t.z,c=o*l-s*u,f=s*a-i*l,h=i*u-o*a,g=c*c+f*f+h*h,p=Math.sqrt(g)/2;return p},$.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,o=(t.y+e.y+n.y)/3;return new v(i,o)},$.inCentre=function(t,e,n){var i=e.distance(n),o=t.distance(n),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*n.x)/a,l=(i*t.y+o*e.y+s*n.y)/a;return new v(u,l)};var Fe=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new L;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Fe.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,m.EXTERIOR,m.INTERIOR)},Fe.prototype.addPolygon=function(t){var e=this,n=this._distance,i=S.LEFT;this._distance<0&&(n=-this._distance,i=S.RIGHT);var o=t.getExteriorRing(),s=Y.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,n,i,m.EXTERIOR,m.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=Y.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,n,S.opposite(i),m.INTERIOR,m.EXTERIOR)}},Fe.prototype.isTriangleErodedCompletely=function(t,e){var n=new $(t[0],t[1],t[2]),i=n.inCentre(),o=P.distancePointLine(i,n.p0,n.p1);return o<Math.abs(e)},Fe.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Y.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,m.EXTERIOR,m.INTERIOR)},Fe.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new mt(t,new tt(0,m.BOUNDARY,e,n));this._curveList.add(i)},Fe.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Fe.prototype.addPolygonRing=function(t,e,n,i,o){if(e===0&&t.length<Sn.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Sn.MINIMUM_VALID_SIZE&&P.isCCW(t)&&(s=o,a=i,n=S.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,s,a)},Fe.prototype.add=function(t){if(t.isEmpty())return null;t instanceof St?this.addPolygon(t):t instanceof gt?this.addLineString(t):t instanceof he?this.addPoint(t):t instanceof wi?this.addCollection(t):t instanceof Sr?this.addCollection(t):t instanceof wn?this.addCollection(t):t instanceof Jt&&this.addCollection(t)},Fe.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},Fe.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Ri=function(){};Ri.prototype.locate=function(t){},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var Pn=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()};Pn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Pn.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 xi;var t=this._parent.getGeometryN(this._index++);return t instanceof Jt?(this._subcollectionIterator=new Pn(t),this._subcollectionIterator.next()):t},Pn.prototype.remove=function(){throw new Error(this.getClass().getName())},Pn.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)},Pn.prototype.interfaces_=function(){return[Ni]},Pn.prototype.getClass=function(){return Pn},Pn.isAtomic=function(t){return!(t instanceof Jt)};var xe=function(){this._geom=null;var t=arguments[0];this._geom=t};xe.prototype.locate=function(t){return xe.locate(t,this._geom)},xe.prototype.interfaces_=function(){return[Ri]},xe.prototype.getClass=function(){return xe},xe.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?P.isPointInRing(t,e.getCoordinates()):!1},xe.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!xe.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(xe.isPointInRing(t,o))return!1}return!0},xe.containsPoint=function(t,e){if(e instanceof St)return xe.containsPointInPolygon(t,e);if(e instanceof Jt)for(var n=new Pn(e);n.hasNext();){var i=n.next();if(i!==e&&xe.containsPoint(t,i))return!0}return!1},xe.locate=function(t,e){return e.isEmpty()?m.EXTERIOR:xe.containsPoint(t,e)?m.INTERIOR:m.EXTERIOR};var Ht=function(){this._edgeMap=new Xt,this._edgeList=null,this._ptInAreaLocation=[m.NONE,m.NONE]};Ht.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Ht.prototype.propagateSideLabels=function(t){for(var e=m.NONE,n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,S.LEFT)!==m.NONE&&(e=o.getLocation(t,S.LEFT))}if(e===m.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,S.ON)===m.NONE&&l.setLocation(t,S.ON,s),l.isArea(t)){var c=l.getLocation(t,S.LEFT),f=l.getLocation(t,S.RIGHT);if(f!==m.NONE){if(f!==s)throw new Hn("side location conflict",u.getCoordinate());c===m.NONE&&q.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else q.isTrue(l.getLocation(t,S.LEFT)===m.NONE,"found single null side"),l.setLocation(t,S.RIGHT,s),l.setLocation(t,S.LEFT,s)}}},Ht.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Ht.prototype.print=function(t){At.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Ht.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ht.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),o=i.getLocation(t,S.LEFT);q.isTrue(o!==m.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();q.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,S.LEFT),f=l.getLocation(t,S.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},Ht.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},Ht.prototype.iterator=function(){return this.getEdges().iterator()},Ht.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new L(this._edgeMap.values())),this._edgeList},Ht.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===m.NONE&&(this._ptInAreaLocation[t]=xe.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Ht.prototype.toString=function(){var t=new rn;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
|
|
21
|
+
***************************************************************************** */function Ml(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){e.label=l[1];break}if(l[0]===6&&e.label<o[1]){e.label=o[1],o=l;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(l);break}o[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var wr=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function Al(r,t){return r>t?1:r<t?-1:0}function Lr(r,t,e){for(var n=new wr(null,null),i=n,o=n;;){var s=e(r,t.key);if(s<0){if(t.left===null)break;if(e(r,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}o.left=t,o=t,t=t.left}else if(s>0){if(t.right===null)break;if(e(r,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function ps(r,t,e,n){var i=new wr(r,t);if(e===null)return i.left=i.right=null,i;e=Lr(r,e,n);var o=n(r,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function _a(r,t,e){var n=null,i=null;if(t){t=Lr(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function Fl(r,t,e){return t===null?r:(r===null||(t=Lr(r.key,t,e),t.left=r),t)}function ds(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
|
|
22
|
+
`);var o=t+(e?" ":"│ ");r.left&&ds(r.left,o,!1,n,i),r.right&&ds(r.right,o,!0,n,i)}}var vs=function(){function r(t){t===void 0&&(t=Al),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ps(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new wr(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=Lr(t,this._root,i),s=i(t,o.key);return s===0?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=Lr(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=Lr(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Lr(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=Lr(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,e),u>0)break;if(s(a.key,t)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},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(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return Gl(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&_s(t,e,0,i-1,o),this._root===null)this._root=ys(t,e,0,i),this._size=i;else{var s=kl(this.toList(),Bl(t,e),o);i=this._size+i,this._root=ms({head:s},0,i)}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(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return ds(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=_a(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=ps(e,n,a,i):s=ps(e,n,s,i),this._root=Fl(s,a,i)},r.prototype.split=function(t){return _a(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t;return Ml(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},r}();function ys(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),s=r[o],a=t[o],u=new wr(s,a);return u.left=ys(r,t,e,o),u.right=ys(r,t,o+1,n),u}return null}function Bl(r,t){for(var e=new wr(null,null),n=e,i=0;i<r.length;i++)n=n.next=new wr(r[i],t[i]);return n.next=null,e.next}function Gl(r){for(var t=r,e=[],n=!1,i=new wr(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function ms(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=ms(r,t,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=ms(r,i+1,e),s}return null}function kl(r,t,e){for(var n=new wr(null,null),i=n,o=r,s=t;o!==null&&s!==null;)e(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),n.next}function _s(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],s=e-1,a=n+1;;){do s++;while(i(r[s],o)<0);do a--;while(i(r[a],o)>0);if(s>=a)break;var u=r[s];r[s]=r[a],r[a]=u,u=t[s],t[s]=t[a],t[a]=u}_s(r,t,e,a,i),_s(r,t,a+1,n,i)}}function rn(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function Ea(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Ce(r,t,e){return t&&Ea(r.prototype,t),e&&Ea(r,e),r}var Ki=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Es=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,s=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:n,y:o},ur:{x:i,y:s}}},br=Number.EPSILON;br===void 0&&(br=Math.pow(2,-52));var zl=br*br,Is=function(t,e){if(-br<t&&t<br&&-br<e&&e<br)return 0;var n=t-e;return n*n<zl*t*e?0:t<e?-1:1},Vl=function(){function r(){rn(this,r),this.reset()}return Ce(r,[{key:"reset",value:function(){this.xRounder=new Ia,this.yRounder=new Ia}},{key:"round",value:function(e,n){return{x:this.xRounder.round(e),y:this.yRounder.round(n)}}}]),r}(),Ia=function(){function r(){rn(this,r),this.tree=new vs,this.round(0)}return Ce(r,[{key:"round",value:function(e){var n=this.tree.add(e),i=this.tree.prev(n);if(i!==null&&Is(n.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(n);return o!==null&&Is(n.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),r}(),Qi=new Vl,Ji=function(t,e){return t.x*e.y-t.y*e.x},Ca=function(t,e){return t.x*e.x+t.y*e.y},Na=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y},s=Ji(i,o);return Is(s,0)},bo=function(t){return Math.sqrt(Ca(t,t))},Ul=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return Ji(o,i)/bo(o)/bo(i)},ql=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return Ca(o,i)/bo(o)/bo(i)},xa=function(t,e,n){return e.y===0?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},Sa=function(t,e,n){return e.x===0?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},Xl=function(t,e,n,i){if(e.x===0)return Sa(n,i,t.x);if(i.x===0)return Sa(t,e,n.x);if(e.y===0)return xa(n,i,t.y);if(i.y===0)return xa(t,e,n.y);var o=Ji(e,i);if(o==0)return null;var s={x:n.x-t.x,y:n.y-t.y},a=Ji(s,e)/o,u=Ji(s,i)/o,l=t.x+u*e.x,c=n.x+a*i.x,f=t.y+u*e.y,h=n.y+a*i.y,g=(l+c)/2,p=(f+h)/2;return{x:g,y:p}},Vn=function(){Ce(r,null,[{key:"compare",value:function(e,n){var i=r.comparePoints(e.point,n.point);return i!==0?i:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Po.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(e,n){return e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0}}]);function r(t,e){rn(this,r),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return Ce(r,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,i=0,o=n.length;i<o;i++){var s=n[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,n=0;n<e;n++){var i=this.point.events[n];if(i.segment.consumedBy===void 0)for(var o=n+1;o<e;o++){var s=this.point.events[o];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],n=0,i=this.point.events.length;n<i;n++){var o=this.point.events[n];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var n=this,i=new Map,o=function(a){var u=a.otherSE;i.set(a,{sine:Ul(n.point,e.point,u.point),cosine:ql(n.point,e.point,u.point)})};return function(s,a){i.has(s)||o(s),i.has(a)||o(a);var u=i.get(s),l=u.sine,c=u.cosine,f=i.get(a),h=f.sine,g=f.cosine;return l>=0&&h>=0?c<g?1:c>g?-1:0:l<0&&h<0?c<g?-1:c>g?1:0:h<l?-1:h>l?1:0}}}]),r}(),Yl=0,Po=function(){Ce(r,null,[{key:"compare",value:function(e,n){var i=e.leftSE.point.x,o=n.leftSE.point.x,s=e.rightSE.point.x,a=n.rightSE.point.x;if(a<i)return 1;if(s<o)return-1;var u=e.leftSE.point.y,l=n.leftSE.point.y,c=e.rightSE.point.y,f=n.rightSE.point.y;if(i<o){if(l<u&&l<c)return 1;if(l>u&&l>c)return-1;var h=e.comparePoint(n.leftSE.point);if(h<0)return 1;if(h>0)return-1;var g=n.comparePoint(e.rightSE.point);return g!==0?g:-1}if(i>o){if(u<l&&u<f)return-1;if(u>l&&u>f)return 1;var p=n.comparePoint(e.leftSE.point);if(p!==0)return p;var y=e.comparePoint(n.rightSE.point);return y<0?1:y>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var d=n.comparePoint(e.rightSE.point);if(d!==0)return d}if(s>a){var _=e.comparePoint(n.rightSE.point);if(_<0)return 1;if(_>0)return-1}if(s!==a){var I=c-u,C=s-i,L=f-l,x=a-o;if(I>C&&L<x)return 1;if(I<C&&L>x)return-1}return s>a?1:s<a||c<f?-1:c>f?1:e.id<n.id?-1:e.id>n.id?1:0}}]);function r(t,e,n,i){rn(this,r),this.id=++Yl,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}return Ce(r,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<n?e:n},ur:{x:this.rightSE.point.x,y:e>n?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(n.x===i.x)return e.x===n.x?0:e.x<n.x?1:-1;var s=(e.y-n.y)/o.y,a=n.x+s*o.x;if(e.x===a)return 0;var u=(e.x-n.x)/o.x,l=n.y+u*o.y;return e.y===l?0:e.y<l?-1:1}},{key:"getIntersection",value:function(e){var n=this.bbox(),i=e.bbox(),o=Es(n,i);if(o===null)return null;var s=this.leftSE.point,a=this.rightSE.point,u=e.leftSE.point,l=e.rightSE.point,c=Ki(n,u)&&this.comparePoint(u)===0,f=Ki(i,s)&&e.comparePoint(s)===0,h=Ki(n,l)&&this.comparePoint(l)===0,g=Ki(i,a)&&e.comparePoint(a)===0;if(f&&c)return g&&!h?a:!g&&h?l:null;if(f)return h&&s.x===l.x&&s.y===l.y?null:s;if(c)return g&&a.x===u.x&&a.y===u.y?null:u;if(g&&h)return null;if(g)return a;if(h)return l;var p=Xl(s,this.vector(),u,e.vector());return p===null||!Ki(o,p)?null:Qi.round(p.x,p.y)}},{key:"split",value:function(e){var n=[],i=e.events!==void 0,o=new Vn(e,!0),s=new Vn(e,!1),a=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(o);var u=new r(o,a,this.rings.slice(),this.windings.slice());return Vn.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Vn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}},{key:"consume",value:function(e){for(var n=this,i=e;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=r.compare(n,i);if(o!==0){if(o>0){var s=n;n=i,i=s}if(n.prev===i){var a=n;n=i,i=a}for(var u=0,l=i.rings.length;u<l;u++){var c=i.rings[u],f=i.windings[u],h=n.rings.indexOf(c);h===-1?(n.rings.push(c),n.windings.push(f)):n.windings[h]+=f}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){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)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var n=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,s=0,a=this.rings.length;s<a;s++){var u=this.rings[s],l=this.windings[s],c=n.indexOf(u);c===-1?(n.push(u),i.push(l)):i[c]+=l}for(var f=[],h=[],g=0,p=n.length;g<p;g++)if(i[g]!==0){var y=n[g],d=y.poly;if(h.indexOf(d)===-1)if(y.isExterior)f.push(d);else{h.indexOf(d)===-1&&h.push(d);var _=f.indexOf(y.poly);_!==-1&&f.splice(_,1)}}for(var I=0,C=f.length;I<C;I++){var L=f[I].multiPoly;o.indexOf(L)===-1&&o.push(L)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(xn.type){case"union":{var i=e.length===0,o=n.length===0;this._isInResult=i!==o;break}case"intersection":{var s,a;e.length<n.length?(s=e.length,a=n.length):(s=n.length,a=e.length),this._isInResult=a===xn.numMultiPolys&&s<a;break}case"xor":{var u=Math.abs(e.length-n.length);this._isInResult=u%2===1;break}case"difference":{var l=function(f){return f.length===1&&f[0].isSubject};this._isInResult=l(e)!==l(n);break}default:throw new Error("Unrecognized operation type found ".concat(xn.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,i){var o,s,a,u=Vn.comparePoints(e,n);if(u<0)o=e,s=n,a=1;else if(u>0)o=n,s=e,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new Vn(o,!0),c=new Vn(s,!1);return new r(l,c,[i],[a])}}]),r}(),wa=function(){function r(t,e,n){if(rn(this,r),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=Qi.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=Qi.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Po.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Po.fromRing(o,i,this))}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.segments.length;n<i;n++){var o=this.segments[n];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),r}(),Hl=function(){function r(t,e){if(rn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new wa(t[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(var n=1,i=t.length;n<i;n++){var o=new wa(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;n<i;n++)for(var o=this.interiorRings[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),La=function(){function r(t,e){if(rn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,i=t.length;n<i;n++){var o=new Hl(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++)for(var o=this.polys[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),Wl=function(){Ce(r,null,[{key:"factory",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!(!s.isInResult()||s.ringOut)){for(var a=null,u=s.leftSE,l=s.rightSE,c=[u],f=u.point,h=[];a=u,u=l,c.push(u),u.point!==f;)for(;;){var g=u.getAvailableLinkedEvents();if(g.length===0){var p=c[0].point,y=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(y.x,", ").concat(y.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var d=null,_=0,I=h.length;_<I;_++)if(h[_].point===u.point){d=_;break}if(d!==null){var C=h.splice(d)[0],L=c.splice(C.index);L.unshift(L[0].otherSE),n.push(new r(L.reverse()));continue}h.push({index:c.length,point:u.point});var x=u.getLeftmostComparator(a);l=g.sort(x)[0].otherSE;break}n.push(new r(c))}}return n}}]);function r(t){rn(this,r),this.events=t;for(var e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}return Ce(r,[{key:"getGeom",value:function(){for(var e=this.events[0].point,n=[e],i=1,o=this.events.length-1;i<o;i++){var s=this.events[i].point,a=this.events[i+1].point;Na(s,e,a)!==0&&(n.push(s),e=s)}if(n.length===1)return null;var u=n[0],l=n[1];Na(u,e,l)===0&&n.shift(),n.push(n[0]);for(var c=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:n.length-1,h=this.isExteriorRing()?n.length:-1,g=[],p=f;p!=h;p+=c)g.push([n[p].x,n[p].y]);return g}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],n=1,i=this.events.length;n<i;n++){var o=this.events[n];Vn.compare(e,o)>0&&(e=o)}for(var s=e.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),r}(),ba=function(){function r(t){rn(this,r),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Ce(r,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,i=this.interiorRings.length;n<i;n++){var o=this.interiorRings[n].getGeom();o!==null&&e.push(o)}return e}}]),r}(),jl=function(){function r(t){rn(this,r),this.rings=t,this.polys=this._composePolys(t)}return Ce(r,[{key:"getGeom",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++){var o=this.polys[n].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!s.poly)if(s.isExteriorRing())n.push(new ba(s));else{var a=s.enclosingRing();a.poly||n.push(new ba(a)),a.poly.addInterior(s)}}return n}}]),r}(),Kl=function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Po.compare;rn(this,r),this.queue=t,this.tree=new vs(e),this.segments=[]}return Ce(r,[{key:"process",value:function(e){var n=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),i;var o=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,u=void 0,l=void 0;u===void 0;)s=this.tree.prev(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){var c=null;if(u){var f=u.getIntersection(n);if(f!==null&&(n.isAnEndpoint(f)||(c=f),!u.isAnEndpoint(f)))for(var h=this._splitSafely(u,f),g=0,p=h.length;g<p;g++)i.push(h[g])}var y=null;if(l){var d=l.getIntersection(n);if(d!==null&&(n.isAnEndpoint(d)||(y=d),!l.isAnEndpoint(d)))for(var _=this._splitSafely(l,d),I=0,C=_.length;I<C;I++)i.push(_[I])}if(c!==null||y!==null){var L=null;if(c===null)L=y;else if(y===null)L=c;else{var x=Vn.comparePoints(c,y);L=x<=0?c:y}this.queue.remove(n.rightSE),i.push(n.rightSE);for(var w=n.split(L),A=0,B=w.length;A<B;A++)i.push(w[A])}i.length>0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&l){var F=u.getIntersection(l);if(F!==null){if(!u.isAnEndpoint(F))for(var q=this._splitSafely(u,F),j=0,P=q.length;j<P;j++)i.push(q[j]);if(!l.isAnEndpoint(F))for(var X=this._splitSafely(l,F),R=0,Y=X.length;R<Y;R++)i.push(X[R])}}this.tree.remove(n)}return i}},{key:"_splitSafely",value:function(e,n){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(n);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),r}(),Pa=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ql=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Jl=function(){function r(){rn(this,r)}return Ce(r,[{key:"run",value:function(e,n,i){xn.type=e,Qi.reset();for(var o=[new La(n,!0)],s=0,a=i.length;s<a;s++)o.push(new La(i[s],!1));if(xn.numMultiPolys=o.length,xn.type==="difference")for(var u=o[0],l=1;l<o.length;)Es(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(xn.type==="intersection"){for(var c=0,f=o.length;c<f;c++)for(var h=o[c],g=c+1,p=o.length;g<p;g++)if(Es(h.bbox,o[g].bbox)===null)return[]}for(var y=new vs(Vn.compare),d=0,_=o.length;d<_;d++)for(var I=o[d].getSweepEvents(),C=0,L=I.length;C<L;C++)if(y.insert(I[C]),y.size>Pa)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var x=new Kl(y),w=y.size,A=y.pop();A;){var B=A.key;if(y.size===w){var F=B.segment;throw new Error("Unable to pop() ".concat(B.isLeft?"left":"right"," SweepEvent ")+"[".concat(B.point.x,", ").concat(B.point.y,"] from segment #").concat(F.id," ")+"[".concat(F.leftSE.point.x,", ").concat(F.leftSE.point.y,"] -> ")+"[".concat(F.rightSE.point.x,", ").concat(F.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(y.size>Pa)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(x.segments.length>Ql)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var q=x.process(B),j=0,P=q.length;j<P;j++){var X=q[j];X.consumedBy===void 0&&y.insert(X)}w=y.size,A=y.pop()}Qi.reset();var R=Wl.factory(x.segments),Y=new jl(R);return Y.getGeom()}}]),r}(),xn=new Jl,Zl=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("union",t,n)},$l=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("intersection",t,n)},tc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("xor",t,n)},ec=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("difference",t,n)},Ra={union:Zl,intersection:$l,xor:tc,difference:ec},Ne=63710088e-1,Oa={centimeters:Ne*100,centimetres:Ne*100,degrees:Ne/111325,feet:Ne*3.28084,inches:Ne*39.37,kilometers:Ne/1e3,kilometres:Ne/1e3,meters:Ne,metres:Ne,miles:Ne/1609.344,millimeters:Ne*1e3,millimetres:Ne*1e3,nauticalmiles:Ne/1852,radians:1,yards:Ne*1.0936};function Ro(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function nc(r,t,e){if(e===void 0&&(e={}),!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(!Ma(r[0])||!Ma(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Ro(n,t,e)}function Da(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return Ro(a,t,e)}function Cs(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Ta(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return Ro(n,t,e)}function rc(r,t){t===void 0&&(t="kilometers");var e=Oa[t];if(!e)throw new Error(t+" units is invalid");return r*e}function ic(r,t){t===void 0&&(t="kilometers");var e=Oa[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Ma(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Oo(r){return r.type==="Feature"?r.geometry:r}function oc(r,t,e){e===void 0&&(e={});var n=Oo(r),i=Oo(t),o=Ra.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?Da(o[0],e.properties):Ta(o,e.properties)}const Lf="";function sc(r){let t,e,n;return{c(){t=zn("svg"),e=zn("path"),D(e,"stroke-width","4"),D(e,"fill-rule","evenodd"),D(e,"clip-rule","evenodd"),D(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),D(e,"class","svelte-1k1cmht"),D(t,"width",n=r[0]!=="list"?void 0:"20"),D(t,"viewBox","0 0 70 85"),D(t,"fill","none"),D(t,"class","svelte-1k1cmht"),nn(t,"in-map",r[0]!=="list"),nn(t,"list-icon",r[0]==="list")},m(i,o){De(i,t,o),nt(t,e)},p(i,[o]){o&1&&n!==(n=i[0]!=="list"?void 0:"20")&&D(t,"width",n),o&1&&nn(t,"in-map",i[0]!=="list"),o&1&&nn(t,"list-icon",i[0]==="list")},i:vt,o:vt,d(i){i&&Ie(t)}}}function ac(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class uc extends Sr{constructor(t){super(),xr(this,t,ac,sc,Cr,{displayIn:0})}}function Aa(r,t,e){if(r!==null)for(var n,i,o,s,a,u,l,c=0,f=0,h,g=r.type,p=g==="FeatureCollection",y=g==="Feature",d=p?r.features.length:1,_=0;_<d;_++){l=p?r.features[_].geometry:y?r.geometry:r,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var I=0;I<a;I++){var C=0,L=0;if(s=h?l.geometries[I]:l,s!==null){u=s.coordinates;var x=s.type;switch(c=e&&(x==="Polygon"||x==="MultiPolygon")?1:0,x){case null:break;case"Point":if(t(u,f,_,C,L)===!1)return!1;f++,C++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,_,C,L)===!1)return!1;f++,x==="MultiPoint"&&C++}x==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(t(u[n][i],f,_,C,L)===!1)return!1;f++}x==="MultiLineString"&&C++,x==="Polygon"&&L++}x==="Polygon"&&C++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(L=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-c;o++){if(t(u[n][i][o],f,_,C,L)===!1)return!1;f++}L++}C++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Aa(s.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Fa(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function Ba(r,t){var e,n,i,o,s,a,u,l,c,f,h=0,g=r.type==="FeatureCollection",p=r.type==="Feature",y=g?r.features.length:1;for(e=0;e<y;e++){for(a=g?r.features[e].geometry:p?r.geometry:r,l=g?r.features[e].properties:p?r.properties:{},c=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(t(null,h,l,c,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,h,l,c,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],h,l,c,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Ns(r){var t=[1/0,1/0,-1/0,-1/0];return Aa(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Ns.default=Ns;function lc(r,t){t===void 0&&(t={});var e=Ns(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return nc([n,i],t.properties,t)}"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),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(o=o<0?Math.max(n+arguments[2],0):Math.min(o,n);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var jr=function(){};jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var ct=function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),z=function(){},Ga={MAX_VALUE:{configurable:!0}};z.isNaN=function(t){return Number.isNaN(t)},z.doubleToLongBits=function(t){return t},z.longBitsToDouble=function(t){return t},z.isInfinite=function(t){return!Number.isFinite(t)},Ga.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(z,Ga);var Me=function(){},Do=function(){},mi=function(){};function Ae(){}var v=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Kr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};v.prototype.setOrdinate=function(t,e){switch(t){case v.X:this.x=e;break;case v.Y:this.y=e;break;case v.Z:this.z=e;break;default:throw new ct("Invalid ordinate index: "+t)}},v.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!jr.equalsWithTolerance(this.x,e.x,n)||!jr.equalsWithTolerance(this.y,e.y,n))}},v.prototype.getOrdinate=function(t){switch(t){case v.X:return this.x;case v.Y:return this.y;case v.Z:return this.z}throw new ct("Invalid ordinate index: "+t)},v.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||z.isNaN(this.z))&&z.isNaN(t.z)},v.prototype.equals=function(t){return t instanceof v?this.equals2D(t):!1},v.prototype.equalInZ=function(t,e){return jr.equalsWithTolerance(this.z,t.z,e)},v.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},v.prototype.clone=function(){},v.prototype.copy=function(){return new v(this)},v.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},v.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},v.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},v.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this.x),t=37*t+v.hashCode(this.y),t},v.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},v.prototype.interfaces_=function(){return[Me,Do,Ae]},v.prototype.getClass=function(){return v},v.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=z.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Kr.DimensionalComparator.get=function(){return lr},Kr.serialVersionUID.get=function(){return 6683108902428367e3},Kr.NULL_ORDINATE.get=function(){return z.NaN},Kr.X.get=function(){return 0},Kr.Y.get=function(){return 1},Kr.Z.get=function(){return 2},Object.defineProperties(v,Kr);var lr=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ct("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};lr.prototype.compare=function(t,e){var n=t,i=e,o=lr.compare(n.x,i.x);if(o!==0)return o;var s=lr.compare(n.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=lr.compare(n.z,i.z);return a},lr.prototype.interfaces_=function(){return[mi]},lr.prototype.getClass=function(){return lr},lr.compare=function(t,e){return t<e?-1:t>e?1:z.isNaN(t)?z.isNaN(e)?0:-1:z.isNaN(e)?1:0};var _i=function(){};_i.prototype.create=function(){},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var m=function(){},Zi={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.toLocationSymbol=function(t){switch(t){case m.EXTERIOR:return"e";case m.BOUNDARY:return"b";case m.INTERIOR:return"i";case m.NONE:return"-"}throw new ct("Unknown location value: "+t)},Zi.INTERIOR.get=function(){return 0},Zi.BOUNDARY.get=function(){return 1},Zi.EXTERIOR.get=function(){return 2},Zi.NONE.get=function(){return-1},Object.defineProperties(m,Zi);var k=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},xe=function(){},ka={LOG_10:{configurable:!0}};xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe},xe.log10=function(t){var e=Math.log(t);return z.isInfinite(e)||z.isNaN(e)?e:e/xe.LOG_10},xe.min=function(t,e,n,i){var o=t;return e<o&&(o=e),n<o&&(o=n),i<o&&(o=i),o},xe.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}},xe.wrap=function(t,e){return t<0?e- -t%e:t%e},xe.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}},xe.average=function(t,e){return(t+e)/2},ka.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(xe,ka);var on=function(t){this.str=t};on.prototype.append=function(t){this.str+=t},on.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},on.prototype.toString=function(t){return this.str};var sn=function(t){this.value=t};sn.prototype.intValue=function(){return this.value},sn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},sn.isNaN=function(t){return Number.isNaN(t)};var $i=function(){};$i.isWhitespace=function(t){return t<=32&&t>=0||t===127},$i.toUpperCase=function(t){return t.toUpperCase()};var E=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},Ue={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}};E.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},E.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=E.magnitude(n._hi),o=E.TEN.pow(i);n=n.divide(o),n.gt(E.TEN)?(n=n.divide(E.TEN),i+=1):n.lt(E.ONE)&&(n=n.multiply(E.TEN),i-=1);for(var s=i+1,a=new on,u=E.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var f=!1,h=0;c>9?(f=!0,h="9"):h="0"+c,a.append(h),n=n.subtract(E.valueOf(c)).multiply(E.TEN),f&&n.selfAdd(E.TEN);var g=!0,p=E.magnitude(n._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return e[0]=i,a.toString()},E.prototype.sqr=function(){return this.multiply(this)},E.prototype.doubleValue=function(){return this._hi+this._lo},E.prototype.subtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},E.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},E.prototype.isZero=function(){return this._hi===0&&this._lo===0},E.prototype.selfSubtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},E.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},E.prototype.min=function(t){return this.le(t)?this:t},E.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,h=null;return l=this._hi/n,c=E.SPLIT*l,o=c-l,h=E.SPLIT*n,o=c-o,s=l-o,a=h-n,f=l*n,a=h-a,u=n-a,h=o*a-f+o*u+s*a+s*u,c=(this._hi-f-h+this._lo-l*i)/n,h=l+c,this._hi=h,this._lo=l-h+c,this}},E.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},E.prototype.divide=function(){if(arguments[0]instanceof E){var t=arguments[0],e=null,n=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=E.SPLIT*s,e=a-s,l=E.SPLIT*t._hi,e=a-e,n=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+n*i+n*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new E(c,f)}else if(typeof arguments[0]=="number"){var h=arguments[0];return z.isNaN(h)?E.createNaN():E.copy(this).selfDivide(h,0)}},E.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},E.prototype.pow=function(t){if(t===0)return E.valueOf(1);var e=new E(this),n=E.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},E.prototype.ceil=function(){if(this.isNaN())return E.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new E(t,e)},E.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},E.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},E.prototype.setValue=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},E.prototype.max=function(t){return this.ge(t)?this:t},E.prototype.sqrt=function(){if(this.isZero())return E.valueOf(0);if(this.isNegative())return E.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=E.valueOf(e),i=this.subtract(n.sqr()),o=i._hi*(t*.5);return n.add(o)},E.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,n=o+u,i=u+(o-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,h=null,g=null,p=null,y=null,d=null,_=null,I=null;y=this._hi+l,g=this._lo+c,_=y-this._hi,I=g-this._lo,d=y-_,p=g-I,d=l-_+(this._hi-d),p=c-I+(this._lo-p),_=d+g,f=y+_,h=_+(y-f),_=p+h;var C=f+_,L=_+(f-C);return this._hi=C,this._lo=L,this}},E.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=E.SPLIT*this._hi,o=l-this._hi,c=E.SPLIT*n,o=l-o,s=this._hi-o,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*n);var f=l+c;o=l-f;var h=c+o;return this._hi=f,this._lo=h,this}},E.prototype.selfSqr=function(){return this.selfMultiply(this)},E.prototype.floor=function(){if(this.isNaN())return E.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new E(t,e)},E.prototype.negate=function(){return this.isNaN()?this:new E(-this._hi,-this._lo)},E.prototype.clone=function(){},E.prototype.multiply=function(){if(arguments[0]instanceof E){var t=arguments[0];return t.isNaN()?E.createNaN():E.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return z.isNaN(e)?E.createNaN():E.copy(this).selfMultiply(e,0)}},E.prototype.isNaN=function(){return z.isNaN(this._hi)},E.prototype.intValue=function(){return Math.trunc(this._hi)},E.prototype.toString=function(){var t=E.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},E.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,o=n;if(n.charAt(0)===".")o="0"+n;else if(i<0)o="0."+E.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var s=i-n.length,a=E.stringOfChar("0",s);o=n+a+".0"}return this.isNegative()?"-"+o:o},E.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=E.SPLIT*o,t=s-o,u=E.SPLIT*this._hi,t=s-t,e=o-t,n=u-this._hi,a=o*this._hi,n=u-n,i=this._hi-n,u=t*n-a+t*i+e*n+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new E(l,c)},E.prototype.toSciNotation=function(){if(this.isZero())return E.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=E.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var o="";n.length>1&&(o=n.substring(1));var s=n.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i},E.prototype.abs=function(){return this.isNaN()?E.NaN:this.isNegative()?this.negate():new E(this)},E.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},E.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},E.prototype.add=function(){if(arguments[0]instanceof E){var t=arguments[0];return E.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return E.copy(this).selfAdd(e)}},E.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 E){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},E.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},E.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},E.prototype.trunc=function(){return this.isNaN()?E.NaN:this.isPositive()?this.floor():this.ceil()},E.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},E.prototype.interfaces_=function(){return[Ae,Me,Do]},E.prototype.getClass=function(){return E},E.sqr=function(t){return E.valueOf(t).selfMultiply(t)},E.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return E.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new E(e)}},E.sqrt=function(t){return E.valueOf(t).sqrt()},E.parse=function(t){for(var e=0,n=t.length;$i.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new E,a=0,u=0,l=0;!(e>=n);){var c=t.charAt(e);if(e++,$i.isDigit(c)){var f=c-"0";s.selfMultiply(E.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var h=t.substring(e);try{l=sn.parseInt(h)}catch(_){throw _ instanceof Error?new Error("Invalid exponent "+h+" in string "+t):_}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=s,p=a-u-l;if(p===0)g=s;else if(p>0){var y=E.TEN.pow(p);g=s.divide(y)}else if(p<0){var d=E.TEN.pow(-p);g=s.multiply(d)}return i?g.negate():g},E.createNaN=function(){return new E(z.NaN,z.NaN)},E.copy=function(t){return new E(t)},E.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},E.stringOfChar=function(t,e){for(var n=new on,i=0;i<e;i++)n.append(t);return n.toString()},Ue.PI.get=function(){return new E(3.141592653589793,12246467991473532e-32)},Ue.TWO_PI.get=function(){return new E(6.283185307179586,24492935982947064e-32)},Ue.PI_2.get=function(){return new E(1.5707963267948966,6123233995736766e-32)},Ue.E.get=function(){return new E(2.718281828459045,14456468917292502e-32)},Ue.NaN.get=function(){return new E(z.NaN,z.NaN)},Ue.EPS.get=function(){return 123259516440783e-46},Ue.SPLIT.get=function(){return 134217729},Ue.MAX_PRINT_DIGITS.get=function(){return 32},Ue.TEN.get=function(){return E.valueOf(10)},Ue.ONE.get=function(){return E.valueOf(1)},Ue.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ue.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(E,Ue);var le=function(){},za={DP_SAFE_EPSILON:{configurable:!0}};le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.orientationIndex=function(t,e,n){var i=le.orientationIndexFilter(t,e,n);if(i<=1)return i;var o=E.valueOf(e.x).selfAdd(-t.x),s=E.valueOf(e.y).selfAdd(-t.y),a=E.valueOf(n.x).selfAdd(-e.x),u=E.valueOf(n.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()},le.signOfDet2x2=function(t,e,n,i){var o=t.multiply(i).selfSubtract(e.multiply(n));return o.signum()},le.intersection=function(t,e,n,i){var o=E.valueOf(i.y).selfSubtract(n.y).selfMultiply(E.valueOf(e.x).selfSubtract(t.x)),s=E.valueOf(i.x).selfSubtract(n.x).selfMultiply(E.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=E.valueOf(i.x).selfSubtract(n.x).selfMultiply(E.valueOf(t.y).selfSubtract(n.y)),l=E.valueOf(i.y).selfSubtract(n.y).selfMultiply(E.valueOf(t.x).selfSubtract(n.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),h=E.valueOf(t.x).selfAdd(E.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=E.valueOf(e.x).selfSubtract(t.x).selfMultiply(E.valueOf(t.y).selfSubtract(n.y)),p=E.valueOf(e.y).selfSubtract(t.y).selfMultiply(E.valueOf(t.x).selfSubtract(n.x)),y=g.subtract(p),d=y.selfDivide(a).doubleValue(),_=E.valueOf(n.y).selfAdd(E.valueOf(i.y).selfSubtract(n.y).selfMultiply(d)).doubleValue();return new v(h,_)},le.orientationIndexFilter=function(t,e,n){var i=null,o=(t.x-n.x)*(e.y-n.y),s=(t.y-n.y)*(e.x-n.x),a=o-s;if(o>0){if(s<=0)return le.signum(a);i=o+s}else if(o<0){if(s>=0)return le.signum(a);i=-o-s}else return le.signum(a);var u=le.DP_SAFE_EPSILON*i;return a>=u||-a>=u?le.signum(a):2},le.signum=function(t){return t>0?1:t<0?-1:0},za.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(le,za);var Q=function(){},to={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};to.X.get=function(){return 0},to.Y.get=function(){return 1},to.Z.get=function(){return 2},to.M.get=function(){return 3},Q.prototype.setOrdinate=function(t,e,n){},Q.prototype.size=function(){},Q.prototype.getOrdinate=function(t,e){},Q.prototype.getCoordinate=function(){},Q.prototype.getCoordinateCopy=function(t){},Q.prototype.getDimension=function(){},Q.prototype.getX=function(t){},Q.prototype.clone=function(){},Q.prototype.expandEnvelope=function(t){},Q.prototype.copy=function(){},Q.prototype.getY=function(t){},Q.prototype.toCoordinateArray=function(){},Q.prototype.interfaces_=function(){return[Do]},Q.prototype.getClass=function(){return Q},Object.defineProperties(Q,to);var Va=function(){},Ei=function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Va),Gt=function(){};Gt.arraycopy=function(t,e,n,i,o){for(var s=0,a=e;a<e+o;a++)n[i+s]=t[a],s++},Gt.getProperty=function(t){return{"line.separator":`
|
|
23
|
+
`}[t]};var qe=function r(){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 t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],h=arguments[1],g=arguments[2],p=arguments[3],y=f.y-h.y,d=h.x-f.x,_=f.x*h.y-h.x*f.y,I=g.y-p.y,C=p.x-g.x,L=g.x*p.y-p.x*g.y;this.x=d*L-C*_,this.y=I*_-y*L,this.w=y*C-I*d}};qe.prototype.getY=function(){var t=this.y/this.w;if(z.isNaN(t)||z.isInfinite(t))throw new Ei;return t},qe.prototype.getX=function(){var t=this.x/this.w;if(z.isNaN(t)||z.isInfinite(t))throw new Ei;return t},qe.prototype.getCoordinate=function(){var t=new v;return t.x=this.getX(),t.y=this.getY(),t},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.intersection=function(t,e,n,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,f=s*c-l*a,h=u*a-o*c,g=o*l-u*s,p=f/g,y=h/g;if(z.isNaN(p)||z.isInfinite(p)||z.isNaN(y)||z.isInfinite(y))throw new Ei;return new v(p,y)};var T=function r(){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 v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Ua={serialVersionUID:{configurable:!0}};T.prototype.getArea=function(){return this.getWidth()*this.getHeight()},T.prototype.equals=function(t){if(!(t instanceof T))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()},T.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new T;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new T(e,i,n,o)},T.prototype.isNull=function(){return this._maxx<this._minx},T.prototype.getMaxX=function(){return this._maxx},T.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof T){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},T.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof T){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof v){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},T.prototype.getMinY=function(){return this._miny},T.prototype.getMinX=function(){return this._minx},T.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof T){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 n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},T.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},T.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},T.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},T.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},T.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},T.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},T.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},T.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},T.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},T.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof T){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},T.prototype.centre=function(){return this.isNull()?null:new v((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},T.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof T){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 n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},T.prototype.getMaxY=function(){return this._maxy},T.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},T.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this._minx),t=37*t+v.hashCode(this._maxx),t=37*t+v.hashCode(this._miny),t=37*t+v.hashCode(this._maxy),t},T.prototype.interfaces_=function(){return[Me,Ae]},T.prototype.getClass=function(){return T},T.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}},Ua.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(T,Ua);var an={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*$/},To=function(t){this.geometryFactory=t||new W};To.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var o=an.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=an.emptyTypeStr.exec(t),o[2]=void 0),o&&(n=o[1].toLowerCase(),i=o[2],Ii[n]&&(e=Ii[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},To.prototype.write=function(t){return this.extractGeometry(t)},To.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Un[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+Un[e].apply(this,[t])+")",i};var Un={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Un.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+Un.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(Un.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(Un.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+Un.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+Un.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)n.push("("+Un.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+Un.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},Ii={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(an.spaces);return this.geometryFactory.createPoint(new v(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(an.trimParens,"$1"),o.push(Ii.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(an.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(an.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(an.parenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(an.trimParens,"$1"),o.push(Ii.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,o,s=t.trim().split(an.parenComma),a,u=[],l=0,c=s.length;l<c;++l)n=s[l].replace(an.trimParens,"$1"),i=Ii.linestring.apply(e,[n]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(an.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(an.trimParens,"$1"),o.push(Ii.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],o=0,s=n.length;o<s;++o)i.push(e.read(n[o]));return this.geometryFactory.createGeometryCollection(i)}},Xe=function(t){this.parser=new To(t)};Xe.prototype.write=function(t){return this.parser.write(t)},Xe.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var qn=function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),Mo=function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(qn),U=function(){};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.shouldNeverReachHere=function(){if(arguments.length===0)U.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Mo("Should never reach here"+(t!==null?": "+t:""))}},U.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],U.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Mo:new Mo(e)},U.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],U.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new Mo("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var ft=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 v,this._intPt[1]=new v,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Qr={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ft.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ft.prototype.getTopologySummary=function(){var t=new on;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ft.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},ft.prototype.getIntersectionNum=function(){return this._result},ft.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],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ft.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ft.prototype.setPrecisionModel=function(t){this._precisionModel=t},ft.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},ft.prototype.getIntersection=function(t){return this._intPt[t]},ft.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ft.prototype.hasIntersection=function(){return this._result!==ft.NO_INTERSECTION},ft.prototype.getEdgeDistance=function(t,e){var n=ft.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},ft.prototype.isCollinear=function(){return this._result===ft.COLLINEAR_INTERSECTION},ft.prototype.toString=function(){return Xe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Xe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ft.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ft.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},ft.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),o=Math.abs(n.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(n))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return U.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s},ft.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return U.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s},Qr.DONT_INTERSECT.get=function(){return 0},Qr.DO_INTERSECT.get=function(){return 1},Qr.COLLINEAR.get=function(){return 2},Qr.NO_INTERSECTION.get=function(){return 0},Qr.POINT_INTERSECTION.get=function(){return 1},Qr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ft,Qr);var Pr=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new T(this._inputLines[0][0],this._inputLines[0][1]),o=new T(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&o.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,T.intersects(i,o,n)&&O.orientationIndex(i,o,n)===0&&O.orientationIndex(o,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(o))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,o,s,a){a.x=this.smallestInAbsValue(n.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(n.y,i.y,o.y,s.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,i,o,s){var a=null;try{a=qe.intersection(n,i,o,s)}catch(u){if(u instanceof Ei)a=t.nearestEndpoint(n,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(n,i,o,s){var a=this.intersectionWithNormalization(n,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new v(t.nearestEndpoint(n,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,i,o,s){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(n,i,o,s,a){var u=le.intersection(n,i,o,s),l=this.isInSegmentEnvelopes(u);Gt.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Gt.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,o,s){var a=new v(n),u=new v(i),l=new v(o),c=new v(s),f=new v;this.normalizeToEnvCentre(a,u,l,c,f);var h=this.safeHCoordinateIntersection(a,u,l,c);return h.x+=f.x,h.y+=f.y,h},t.prototype.computeCollinearIntersection=function(n,i,o,s){var a=T.intersects(n,i,o),u=T.intersects(n,i,s),l=T.intersects(o,s,n),c=T.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,o,s,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,h=o.x<s.x?o.x:s.x,g=o.y<s.y?o.y:s.y,p=o.x>s.x?o.x:s.x,y=o.y>s.y?o.y:s.y,d=u>h?u:h,_=c<p?c:p,I=l>g?l:g,C=f<y?f:y,L=(d+_)/2,x=(I+C)/2;a.x=L,a.y=x,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(n,i,o,s){if(this._isProper=!1,!T.intersects(n,i,o,s))return r.NO_INTERSECTION;var a=O.orientationIndex(n,i,o),u=O.orientationIndex(n,i,s);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=O.orientationIndex(o,s,n),c=O.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(n,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(o)||n.equals2D(s)?this._intPt[0]=n:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new v(o):u===0?this._intPt[0]=new v(s):l===0?this._intPt[0]=new v(n):c===0&&(this._intPt[0]=new v(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,o,s)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,o,s){var a=n,u=O.distancePointLine(n,o,s),l=O.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=O.distancePointLine(o,n,i),l<u&&(u=l,a=o),l=O.distancePointLine(s,n,i),l<u&&(u=l,a=s),a},t}(ft),Jr=function(){};Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.orientationIndex=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=n.x-e.x,a=n.y-e.y;return Jr.signOfDet2x2(i,o,s,a)},Jr.signOfDet2x2=function(t,e,n,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-o:o:n>0?o:-o;if(e===0||n===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=n,n=s,s=e,e=i,i=s):e<=-i?(o=-o,n=-n,i=-i):(s=t,t=-n,n=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=n,n=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,n=-n,i=-i):(o=-o,s=-t,t=-n,n=s,s=-e,e=-i,i=s),t>0)if(n>0){if(!(t<=n))return o}else return o;else{if(n>0)return-o;if(t>=n)o=-o,t=-t,n=-n;else return-o}for(;;){if(a=Math.floor(n/t),n=n-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>n+n){if(e<i+i)return o}else{if(e>i+i)return-o;n=t-n,i=e-i,o=-o}if(i===0)return n===0?0:-o;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*i,e<0))return o;if(e>i)return-o;if(n>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=n-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var un=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};un.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=Jr.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},un.prototype.isPointInPolygon=function(){return this.getLocation()!==m.EXTERIOR},un.prototype.getLocation=function(){return this._isPointOnSegment?m.BOUNDARY:this._crossingCount%2===1?m.INTERIOR:m.EXTERIOR},un.prototype.isOnSegment=function(){return this._isPointOnSegment},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.locatePointInRing=function(){if(arguments[0]instanceof v&&k(arguments[1],Q)){for(var t=arguments[0],e=arguments[1],n=new un(t),i=new v,o=new v,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),n.countSegment(i,o),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof v&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new un(a),c=1;c<u.length;c++){var f=u[c],h=u[c-1];if(l.countSegment(f,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var O=function(){},Zr={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.orientationIndex=function(t,e,n){return le.orientationIndex(t,e,n)},O.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-n,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(k(arguments[0],Q)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new v,f=new v,h=new v;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,y=1;y<l-1;y++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(y+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},O.distanceLineLine=function(t,e,n,i){if(t.equals(e))return O.distancePointLine(t,n,i);if(n.equals(i))return O.distancePointLine(i,t,e);var o=!1;if(!T.intersects(t,e,n,i))o=!0;else{var s=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(s===0)o=!0;else{var a=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?xe.min(O.distancePointLine(t,n,i),O.distancePointLine(e,n,i),O.distancePointLine(n,t,e),O.distancePointLine(i,t,e)):0},O.isPointInRing=function(t,e){return O.locatePointInRing(t,e)!==m.EXTERIOR},O.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new v;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;n+=Math.sqrt(c*c+f*f),o=u,s=l}return n},O.isCCW=function(t){var e=t.length-1;if(e<3)throw new ct("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>n.y&&(n=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var f=O.computeOrientation(l,n,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},O.locatePointInRing=function(t,e){return un.locatePointInRing(t,e)},O.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},O.computeOrientation=function(t,e,n){return O.orientationIndex(t,e,n)},O.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ct("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=O.distancePointLine(t,e[i],e[i+1]);o<n&&(n=o)}return n}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}},O.isOnLine=function(t,e){for(var n=new Pr,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(n.computeIntersection(t,o,s),n.hasIntersection())return!0}return!1},Zr.CLOCKWISE.get=function(){return-1},Zr.RIGHT.get=function(){return O.CLOCKWISE},Zr.COUNTERCLOCKWISE.get=function(){return 1},Zr.LEFT.get=function(){return O.COUNTERCLOCKWISE},Zr.COLLINEAR.get=function(){return 0},Zr.STRAIGHT.get=function(){return O.COLLINEAR},Object.defineProperties(O,Zr);var Xn=function(){};Xn.prototype.filter=function(t){},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var G=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Sn={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}};G.prototype.isGeometryCollection=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION},G.prototype.getFactory=function(){return this._factory},G.prototype.getGeometryN=function(t){return this},G.prototype.getArea=function(){return 0},G.prototype.isRectangle=function(){return!1},G.prototype.equals=function(){if(arguments[0]instanceof G){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof G))return!1;var n=e;return this.equalsExact(n)}},G.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},G.prototype.geometryChanged=function(){this.apply(G.geometryChangedFilter)},G.prototype.geometryChangedAction=function(){this._envelope=null},G.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},G.prototype.getLength=function(){return 0},G.prototype.getNumGeometries=function(){return 1},G.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)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},G.prototype.getUserData=function(){return this._userData},G.prototype.getSRID=function(){return this._SRID},G.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},G.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION)throw new ct("This method does not support GeometryCollection arguments")},G.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},G.prototype.norm=function(){var t=this.copy();return t.normalize(),t},G.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},G.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new T(this._envelope)},G.prototype.setSRID=function(t){this._SRID=t},G.prototype.setUserData=function(t){this._userData=t},G.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var o=n.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},G.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},G.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===G.SORTINDEX_MULTIPOINT||this.getSortIndex()===G.SORTINDEX_MULTILINESTRING||this.getSortIndex()===G.SORTINDEX_MULTIPOLYGON},G.prototype.interfaces_=function(){return[Do,Me,Ae]},G.prototype.getClass=function(){return G},G.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},G.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},Sn.serialVersionUID.get=function(){return 8763622679187377e3},Sn.SORTINDEX_POINT.get=function(){return 0},Sn.SORTINDEX_MULTIPOINT.get=function(){return 1},Sn.SORTINDEX_LINESTRING.get=function(){return 2},Sn.SORTINDEX_LINEARRING.get=function(){return 3},Sn.SORTINDEX_MULTILINESTRING.get=function(){return 4},Sn.SORTINDEX_POLYGON.get=function(){return 5},Sn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Sn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Sn.geometryChangedFilter.get=function(){return xs},Object.defineProperties(G,Sn);var xs=function(){};xs.interfaces_=function(){return[Xn]},xs.filter=function(t){t.geometryChangedAction()};var wn=function(){};wn.prototype.filter=function(t){},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var Fe=function(){},Yn={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}};Fe.prototype.isInBoundary=function(t){},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Yn.Mod2BoundaryNodeRule.get=function(){return Ci},Yn.EndPointBoundaryNodeRule.get=function(){return Ni},Yn.MultiValentEndPointBoundaryNodeRule.get=function(){return xi},Yn.MonoValentEndPointBoundaryNodeRule.get=function(){return Si},Yn.MOD2_BOUNDARY_RULE.get=function(){return new Ci},Yn.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ni},Yn.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new xi},Yn.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Si},Yn.OGC_SFS_BOUNDARY_RULE.get=function(){return Fe.MOD2_BOUNDARY_RULE},Object.defineProperties(Fe,Yn);var Ci=function(){};Ci.prototype.isInBoundary=function(t){return t%2===1},Ci.prototype.interfaces_=function(){return[Fe]},Ci.prototype.getClass=function(){return Ci};var Ni=function(){};Ni.prototype.isInBoundary=function(t){return t>0},Ni.prototype.interfaces_=function(){return[Fe]},Ni.prototype.getClass=function(){return Ni};var xi=function(){};xi.prototype.isInBoundary=function(t){return t>1},xi.prototype.interfaces_=function(){return[Fe]},xi.prototype.getClass=function(){return xi};var Si=function(){};Si.prototype.isInBoundary=function(t){return t===1},Si.prototype.interfaces_=function(){return[Fe]},Si.prototype.getClass=function(){return Si};var St=function(){};St.prototype.add=function(){},St.prototype.addAll=function(){},St.prototype.isEmpty=function(){},St.prototype.iterator=function(){},St.prototype.size=function(){},St.prototype.toArray=function(){},St.prototype.remove=function(){};function Ss(r){this.message=r||""}Ss.prototype=new Error,Ss.prototype.name="IndexOutOfBoundsException";var wi=function(){};wi.prototype.hasNext=function(){},wi.prototype.next=function(){},wi.prototype.remove=function(){};var Ye=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(St);function Li(r){this.message=r||""}Li.prototype=new Error,Li.prototype.name="NoSuchElementException";var b=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof St&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,St]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(n,i){var o=this.array_[n];return this.array_[n]=i,o},t.prototype.iterator=function(){return new cc(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Ss;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.remove=function(n){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===n){i.array_.splice(s,1),o=!0;break}return o},t}(Ye),cc=function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Li;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(wi),eo=function(r){function t(){if(r.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 i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=r.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];r.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof v&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],h=arguments[1];return this.add(f,h),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],y=arguments[2];if(y)for(var d=0;d<g.length;d++)i.add(g[d],p);else for(var _=g.length-1;_>=0;_--)i.add(g[_],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof v){var I=arguments[0],C=arguments[1],L=arguments[2];if(!L){var x=this.size();if(x>0){if(I>0){var w=this.get(I-1);if(w.equals2D(C))return null}if(I<x){var A=this.get(I);if(A.equals2D(C))return null}}}r.prototype.add.call(this,I,C)}}else if(arguments.length===4){var B=arguments[0],F=arguments[1],q=arguments[2],j=arguments[3],P=1;q>j&&(P=-1);for(var X=q;X!==j;X+=P)i.add(B[X],F);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new v(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(b),H=function(){},Ao={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ao.ForwardComparator.get=function(){return no},Ao.BidirectionalComparator.get=function(){return bi},Ao.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 n=0;n<t.length;n++){var i=t[n];if(H.indexOf(i,e)<0)return i}return null},H.scroll=function(t,e){var n=H.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);Gt.arraycopy(t,n,i,0,t.length-n),Gt.arraycopy(t,0,i,t.length-n,n),Gt.arraycopy(i,0,t,0,t.length)},H.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}},H.intersection=function(t,e){for(var n=new eo,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.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){if(!H.hasRepeatedPoints(t))return t;var e=new eo(t,!1);return e.toCoordinateArray()},H.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},H.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i},H.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new v(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new v(i[o+l])},H.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[t.length-n-1];if(i.compareTo(o)!==0)return!1}return!0},H.envelope=function(t){for(var e=new T,n=0;n<t.length;n++)e.expandToInclude(t[n]);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 n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},H.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},H.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},H.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},H.extract=function(t,e,n){e=xe.clamp(e,0,t.length),n=xe.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=n;a++)o[s++]=t[a];return o},Object.defineProperties(H,Ao);var no=function(){};no.prototype.compare=function(t,e){var n=t,i=e;return H.compare(n,i)},no.prototype.interfaces_=function(){return[mi]},no.prototype.getClass=function(){return no};var bi=function(){};bi.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var o=H.compare(n,i),s=H.isEqualReversed(n,i);return s?0:o},bi.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var o=H.increasingDirection(n),s=H.increasingDirection(i),a=o>0?0:n.length-1,u=s>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0},bi.prototype.interfaces_=function(){return[mi]},bi.prototype.getClass=function(){return bi};var $r=function(){};$r.prototype.get=function(){},$r.prototype.put=function(){},$r.prototype.size=function(){},$r.prototype.values=function(){},$r.prototype.entrySet=function(){};var fc=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}($r);function ro(r){this.message=r||""}ro.prototype=new Error,ro.prototype.name="OperationNotSupported";function Fo(){}Fo.prototype=new St,Fo.prototype.contains=function(){};var ws=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof St&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.iterator=function(){return new hc(this)},t}(Fo),hc=function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Li;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new ro},t}(wi),Hn=0,Rr=1;function qa(r){return r===null?Hn:r.color}function st(r){return r===null?null:r.parent}function Wn(r,t){r!==null&&(r.color=t)}function Ls(r){return r===null?null:r.left}function Xa(r){return r===null?null:r.right}function Wt(){this.root_=null,this.size_=0}Wt.prototype=new fc,Wt.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Wt.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:r,left:null,right:null,value:t,parent:n,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Wt.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=Rr;r!=null&&r!==this.root_&&r.parent.color===Rr;)if(st(r)===Ls(st(st(r)))){var e=Xa(st(st(r)));qa(e)===Rr?(Wn(st(r),Hn),Wn(e,Hn),Wn(st(st(r)),Rr),r=st(st(r))):(r===Xa(st(r))&&(r=st(r),t.rotateLeft(r)),Wn(st(r),Hn),Wn(st(st(r)),Rr),t.rotateRight(st(st(r))))}else{var n=Ls(st(st(r)));qa(n)===Rr?(Wn(st(r),Hn),Wn(n,Hn),Wn(st(st(r)),Rr),r=st(st(r))):(r===Ls(st(r))&&(r=st(r),t.rotateRight(r)),Wn(st(r),Hn),Wn(st(st(r)),Rr),t.rotateLeft(st(st(r))))}this.root_.color=Hn},Wt.prototype.values=function(){var r=new b,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=Wt.successor(t))!==null;)r.add(t.value);return r},Wt.prototype.entrySet=function(){var r=new ws,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=Wt.successor(t))!==null;)r.add(t);return r},Wt.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},Wt.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},Wt.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Wt.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},Wt.prototype.size=function(){return this.size_};var io=function(){};io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io};function Ya(){}Ya.prototype=new Fo;function ln(){this.array_=[],arguments[0]instanceof St&&this.addAll(arguments[0])}ln.prototype=new Ya,ln.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},ln.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},ln.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},ln.prototype.remove=function(r){throw new ro},ln.prototype.size=function(){return this.array_.length},ln.prototype.isEmpty=function(){return this.array_.length===0},ln.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},ln.prototype.iterator=function(){return new Bo(this)};var Bo=function(r){this.treeSet_=r,this.position_=0};Bo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Li;return this.treeSet_.array_[this.position_++]},Bo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Bo.prototype.remove=function(){throw new ro};var Or=function(){};Or.sort=function(){var t=arguments[0],e,n,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},n.sort(o),s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])},Or.asList=function(t){for(var e=new b,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var J=function(){},He={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}};He.P.get=function(){return 0},He.L.get=function(){return 1},He.A.get=function(){return 2},He.FALSE.get=function(){return-1},He.TRUE.get=function(){return-2},He.DONTCARE.get=function(){return-3},He.SYM_FALSE.get=function(){return"F"},He.SYM_TRUE.get=function(){return"T"},He.SYM_DONTCARE.get=function(){return"*"},He.SYM_P.get=function(){return"0"},He.SYM_L.get=function(){return"1"},He.SYM_A.get=function(){return"2"},J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.toDimensionSymbol=function(t){switch(t){case J.FALSE:return J.SYM_FALSE;case J.TRUE:return J.SYM_TRUE;case J.DONTCARE:return J.SYM_DONTCARE;case J.P:return J.SYM_P;case J.L:return J.SYM_L;case J.A:return J.SYM_A}throw new ct("Unknown dimension value: "+t)},J.toDimensionValue=function(t){switch($i.toUpperCase(t)){case J.SYM_FALSE:return J.FALSE;case J.SYM_TRUE:return J.TRUE;case J.SYM_DONTCARE:return J.DONTCARE;case J.SYM_P:return J.P;case J.SYM_L:return J.L;case J.SYM_A:return J.A}throw new ct("Unknown dimension symbol: "+t)},Object.defineProperties(J,He);var cn=function(){};cn.prototype.filter=function(t){},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var We=function(){};We.prototype.filter=function(t,e){},We.prototype.isDone=function(){},We.prototype.isGeometryChanged=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var $t=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new ct("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new T,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();Or.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=J.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=J.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new ln(Or.asList(this._geometries)),a=new ln(Or.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),h=c.getNumGeometries(),g=0;g<f&&g<h;){var p=i.getGeometryN(g),y=c.getGeometryN(g),d=p.compareToSameClass(y,l);if(d!==0)return d;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(k(arguments[0],wn))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(k(arguments[0],We)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],cn)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(k(arguments[0],Xn)){var f=arguments[0];f.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),U.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(G),Dr=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?J.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Be(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[io]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}($t),Be=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Fe.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};Be.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)},Be.prototype.getBoundary=function(){return this._geom instanceof gt?this.boundaryLineString(this._geom):this._geom instanceof Dr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Be.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Be.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Be.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new b;this._endpointMap=new Wt;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&n.add(a.getKey())}return H.toCoordinateArray(n)},Be.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Go,this._endpointMap.put(t,e)),e.count++},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Be(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Be(n,i);return o.getBoundary()}};var Go=function(){this.count=null};Go.prototype.interfaces_=function(){return[]},Go.prototype.getClass=function(){return Go};function gc(){}function pc(){}var dc=function(){};function vc(){}function yc(){}function mc(){}var Ge=function(){},bs={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},Ge.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new vc,n=new gc;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new pc(Ge.getStackTrace(i));for(var a=new mc,u=0;u<o;u++)try{s+=a.readLine()+Ge.NEWLINE}catch(l){if(l instanceof yc)U.shouldNeverReachHere();else throw l}finally{}return s}},Ge.split=function(t,e){for(var n=e.length,i=new b,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+n),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Ge.toString=function(){if(arguments.length===1){var t=arguments[0];return Ge.SIMPLE_ORDINATE_FORMAT.format(t)}},Ge.spaces=function(t){return Ge.chars(" ",t)},bs.NEWLINE.get=function(){return Gt.getProperty("line.separator")},bs.SIMPLE_ORDINATE_FORMAT.get=function(){return new dc},Object.defineProperties(Ge,bs);var yt=function(){};yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},yt.copyCoord=function(t,e,n,i){for(var o=Math.min(t.getDimension(),n.getDimension()),s=0;s<o;s++)n.setOrdinate(i,s,t.getOrdinate(e,s))},yt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Q.X)===t.getOrdinate(e-1,Q.X)&&t.getOrdinate(0,Q.Y)===t.getOrdinate(e-1,Q.Y)},yt.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<n;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(z.isNaN(u)&&z.isNaN(l)))return!1}return!0},yt.extend=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();if(yt.copy(e,0,i,0,o),o>0)for(var s=o;s<n;s++)yt.copy(e,o-1,i,s,1);return i},yt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)yt.swap(t,i,e-i)},yt.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,o)}},yt.copy=function(t,e,n,i,o){for(var s=0;s<o;s++)yt.copyCoord(t,e+s,n,i+s)},yt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new on;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<n;s++)s>0&&i.append(","),i.append(Ge.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},yt.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return yt.createClosedRing(t,e,4);var i=e.getOrdinate(0,Q.X)===e.getOrdinate(n-1,Q.X)&&e.getOrdinate(0,Q.Y)===e.getOrdinate(n-1,Q.Y);return i?e:yt.createClosedRing(t,e,n+1)},yt.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();yt.copy(e,0,i,0,o);for(var s=o;s<n;s++)yt.copy(e,0,i,s,1);return i};var gt=function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new T:this._points.expandEnvelope(new T)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&yt.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?J.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return O.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();yt.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],h=c;return f.compare(this._points,h._points)}},t.prototype.apply=function(){var i=this;if(k(arguments[0],wn))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(k(arguments[0],We)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],cn)){var l=arguments[0];l.filter(this)}else if(k(arguments[0],Xn)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Be(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new ct("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[io]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(G),oo=function(){};oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo};var pe=function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new T;var i=new T;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return J.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(k(arguments[0],wn)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(k(arguments[0],We)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],cn)){var s=arguments[0];s.filter(this)}else if(k(arguments[0],Xn)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),U.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[oo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(G),cr=function(){};cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var wt=function(r){function t(n,i,o){if(r.call(this,o),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new ct("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new ct("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(O.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(O.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var h=i.getX(f),g=i.getY(f),p=h!==l,y=g!==c;if(p===y)return!1;l=h,c=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);Or.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);Gt.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=H.minCoordinate(s.getCoordinates());H.scroll(u,l),Gt.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],O.isCCW(s.getCoordinates())===a&&H.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,h=c._shell,g=f.compareToSameClass(h,l);if(g!==0)return g;for(var p=this.getNumInteriorRing(),y=c.getNumInteriorRing(),d=0;d<p&&d<y;){var _=i.getInteriorRingN(d),I=c.getInteriorRingN(d),C=_.compareToSameClass(I,l);if(C!==0)return C;d++}return d<p?1:d<y?-1:0}},t.prototype.apply=function(i){var o=this;if(k(i,wn)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(k(i,We)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(k(i,cn))i.filter(this);else if(k(i,Xn)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[cr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(G),Pi=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return J.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[oo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}($t),Ln=function(r){function t(n,i){n instanceof v&&i instanceof W&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return J.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();yt.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new ct("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ct("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(gt),bn=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new b,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[cr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}($t),ke=function(t){this._factory=t||null,this._isUserDataCopied=!1},ko={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};ke.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},ke.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},ke.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof $t?this.editGeometryCollection(t,e):t instanceof wt?this.editPolygon(t,e):t instanceof pe?e.edit(t,this._factory):t instanceof gt?e.edit(t,this._factory):(U.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},ke.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),o=new b,s=0;s<i.getNumGeometries();s++){var a=n.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Pi?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Dr?this._factory.createMultiLineString(o.toArray([])):i.getClass()===bn?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},ke.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new b,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.GeometryEditorOperation=function(){},ko.NoOpGeometryOperation.get=function(){return so},ko.CoordinateOperation.get=function(){return ao},ko.CoordinateSequenceOperation.get=function(){return uo},Object.defineProperties(ke,ko);var so=function(){};so.prototype.edit=function(t,e){return t},so.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]},so.prototype.getClass=function(){return so};var ao=function(){};ao.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Ln?e.createLinearRing(n):t instanceof gt?e.createLineString(n):t instanceof pe?n.length>0?e.createPoint(n[0]):e.createPoint():t},ao.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]},ao.prototype.getClass=function(){return ao};var uo=function(){};uo.prototype.edit=function(t,e){return t instanceof Ln?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof gt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof pe?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},uo.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]},uo.prototype.getClass=function(){return uo};var mt=function(){var t=this;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 e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new v}else if(k(arguments[0],Q)){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 o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new v}}},Ha={serialVersionUID:{configurable:!0}};mt.prototype.setOrdinate=function(t,e,n){switch(e){case Q.X:this._coordinates[t].x=n;break;case Q.Y:this._coordinates[t].y=n;break;case Q.Z:this._coordinates[t].z=n;break;default:throw new ct("invalid ordinateIndex")}},mt.prototype.size=function(){return this._coordinates.length},mt.prototype.getOrdinate=function(t,e){switch(e){case Q.X:return this._coordinates[t].x;case Q.Y:return this._coordinates[t].y;case Q.Z:return this._coordinates[t].z}return z.NaN},mt.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},mt.prototype.getCoordinateCopy=function(t){return new v(this._coordinates[t])},mt.prototype.getDimension=function(){return this._dimension},mt.prototype.getX=function(t){return this._coordinates[t].x},mt.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new mt(e,this._dimension)},mt.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},mt.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new mt(e,this._dimension)},mt.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new on(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},mt.prototype.getY=function(t){return this._coordinates[t].y},mt.prototype.toCoordinateArray=function(){return this._coordinates},mt.prototype.interfaces_=function(){return[Q,Ae]},mt.prototype.getClass=function(){return mt},Ha.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(mt,Ha);var Pn=function(){},Ps={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Pn.prototype.readResolve=function(){return Pn.instance()},Pn.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new mt(t)}else if(k(arguments[0],Q)){var e=arguments[0];return new mt(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new mt(n):new mt(n,i)}},Pn.prototype.interfaces_=function(){return[_i,Ae]},Pn.prototype.getClass=function(){return Pn},Pn.instance=function(){return Pn.instanceObject},Ps.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ps.instanceObject.get=function(){return new Pn},Object.defineProperties(Pn,Ps);var Wa=function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new b,i=this.map_.values(),o=i.next();!o.done;)n.add(o.value),o=i.next();return n},t.prototype.entrySet=function(){var n=new ws;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}($r),Z=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof fn){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},Rs={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Z.prototype.equals=function(t){if(!(t instanceof Z))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Z.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new sn(n).compareTo(new sn(i))},Z.prototype.getScale=function(){return this._scale},Z.prototype.isFloating=function(){return this._modelType===Z.FLOATING||this._modelType===Z.FLOATING_SINGLE},Z.prototype.getType=function(){return this._modelType},Z.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Z.FLOATING?t="Floating":this._modelType===Z.FLOATING_SINGLE?t="Floating-Single":this._modelType===Z.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Z.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(z.isNaN(t))return t;if(this._modelType===Z.FLOATING_SINGLE){var e=t;return e}return this._modelType===Z.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof v){var n=arguments[0];if(this._modelType===Z.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Z.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Z.FLOATING?t=16:this._modelType===Z.FLOATING_SINGLE?t=6:this._modelType===Z.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Z.prototype.setScale=function(t){this._scale=Math.abs(t)},Z.prototype.interfaces_=function(){return[Ae,Me]},Z.prototype.getClass=function(){return Z},Z.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Rs.serialVersionUID.get=function(){return 7777263578777804e3},Rs.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Z,Rs);var fn=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},Os={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};fn.prototype.readResolve=function(){return fn.nameToTypeMap.get(this._name)},fn.prototype.toString=function(){return this._name},fn.prototype.interfaces_=function(){return[Ae]},fn.prototype.getClass=function(){return fn},Os.serialVersionUID.get=function(){return-552860263173159e4},Os.nameToTypeMap.get=function(){return new Wa},Object.defineProperties(fn,Os),Z.Type=fn,Z.FIXED=new fn("FIXED"),Z.FLOATING=new fn("FLOATING"),Z.FLOATING_SINGLE=new fn("FLOATING SINGLE");var W=function r(){this._precisionModel=new Z,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?k(arguments[0],_i)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Z&&(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]))},ja={serialVersionUID:{configurable:!0}};W.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new v(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new v(t.getMinX(),t.getMinY()),new v(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new v(t.getMinX(),t.getMinY()),new v(t.getMinX(),t.getMaxY()),new v(t.getMaxX(),t.getMaxY()),new v(t.getMaxX(),t.getMinY()),new v(t.getMinX(),t.getMinY())]),null)},W.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new gt(this.getCoordinateSequenceFactory().create(t),this);if(k(t,Q))return new gt(t,this)}else return new gt(this.getCoordinateSequenceFactory().create([]),this)},W.prototype.createMultiLineString=function(){if(arguments.length===0)return new Dr(null,this);if(arguments.length===1){var t=arguments[0];return new Dr(t,this)}},W.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(n=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(W.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof wt)return this.createMultiPolygon(W.toPolygonArray(t));if(u instanceof gt)return this.createMultiLineString(W.toLineStringArray(t));if(u instanceof pe)return this.createMultiPoint(W.toPointArray(t));U.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},W.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},W.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(k(arguments[0],Q)){var e=arguments[0];return new pe(e,this)}}},W.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},W.prototype.createPolygon=function(){if(arguments.length===0)return new wt(null,null,this);if(arguments.length===1){if(k(arguments[0],Q)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Ln){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new wt(i,o,this)}},W.prototype.getSRID=function(){return this._SRID},W.prototype.createGeometryCollection=function(){if(arguments.length===0)return new $t(null,this);if(arguments.length===1){var t=arguments[0];return new $t(t,this)}},W.prototype.createGeometry=function(t){var e=new ke(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},W.prototype.getPrecisionModel=function(){return this._precisionModel},W.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)}else if(k(arguments[0],Q)){var e=arguments[0];return new Ln(e,this)}}},W.prototype.createMultiPolygon=function(){if(arguments.length===0)return new bn(null,this);if(arguments.length===1){var t=arguments[0];return new bn(t,this)}},W.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Pi(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Pi(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(k(arguments[0],Q)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());yt.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},W.prototype.interfaces_=function(){return[Ae]},W.prototype.getClass=function(){return W},W.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},W.getDefaultCoordinateSequenceFactory=function(){return Pn.instance()},W.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ja.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(W,ja);var _c=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],zo=function(t){this.geometryFactory=t||new W};zo.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!hn[n])throw new Error("Unknown GeoJSON type: "+e.type);return _c.indexOf(n)!==-1?hn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?hn[n].apply(this,[e.geometries]):hn[n].apply(this,[e])},zo.prototype.write=function(t){var e=t.getGeometryType();if(!jn[e])throw new Error("Geometry is not supported");return jn[e].apply(this,[t])};var hn={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!hn[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=hn.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new v(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new v(r[0],r[1]),new v(r[2],r[1]),new v(r[2],r[3]),new v(r[0],r[3]),new v(r[0],r[1])])},Point:function(r){var t=new v(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(hn.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=hn.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(hn.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=hn.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],o=1;o<r.length;++o){var s=r[o],a=hn.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(hn.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},jn={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=jn.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=jn.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var o=n[i];e.push(jn.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=jn.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=jn.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var o=r._holes[i],s=jn.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=jn.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=i.getGeometryType();e.push(jn[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Ds=function(t){this.geometryFactory=t||new W,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new zo(this.geometryFactory)};Ds.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Z.FIXED&&this.reducePrecision(e),e},Ds.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var Ka=function(){this.parser=new zo(this.geometryFactory)};Ka.prototype.write=function(t){return this.parser.write(t)};var S=function(){},Vo={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.opposite=function(t){return t===S.LEFT?S.RIGHT:t===S.RIGHT?S.LEFT:t},Vo.ON.get=function(){return 0},Vo.LEFT.get=function(){return 1},Vo.RIGHT.get=function(){return 2},Object.defineProperties(S,Vo);function Uo(r){this.message=r||""}Uo.prototype=new Error,Uo.prototype.name="EmptyStackException";function gn(){this.array_=[]}gn.prototype=new Ye,gn.prototype.add=function(r){return this.array_.push(r),!0},gn.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},gn.prototype.push=function(r){return this.array_.push(r),r},gn.prototype.pop=function(r){if(this.array_.length===0)throw new Uo;return this.array_.pop()},gn.prototype.peek=function(){if(this.array_.length===0)throw new Uo;return this.array_[this.array_.length-1]},gn.prototype.empty=function(){return this.array_.length===0},gn.prototype.isEmpty=function(){return this.empty()},gn.prototype.search=function(r){return this.array_.indexOf(r)},gn.prototype.size=function(){return this.array_.length},gn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var pn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};pn.prototype.getCoordinate=function(){return this._minCoord},pn.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},pn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();U.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=O.computeOrientation(this._minCoord,n,e),o=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===O.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===O.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},pn.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=S.LEFT;return i[e].y<i[e+1].y&&(o=S.RIGHT),o},pn.prototype.getEdge=function(){return this._orientedDe},pn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},pn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},pn.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}U.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;var o=this.getRightmostSide(this._minDe,this._minIndex);o===S.LEFT&&(this._orientedDe=this._minDe.getSym())},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var Kn=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new v(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t}(qn),qo=function(){this.array_=[]};qo.prototype.addLast=function(t){this.array_.push(t)},qo.prototype.removeFirst=function(){return this.array_.shift()},qo.prototype.isEmpty=function(){return this.array_.length===0};var te=function(){this._finder=null,this._dirEdgeList=new b,this._nodes=new b,this._rightMostCoord=null,this._env=null,this._finder=new pn};te.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},te.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},te.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){n=o;break}}if(n===null)throw new Kn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}},te.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(S.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},te.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},te.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(S.RIGHT)>=1&&e.getDepth(S.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},te.prototype.computeDepths=function(t){var e=this,n=new ws,i=new qo,o=t.getNode();for(i.addLast(o),n.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();n.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},te.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},te.prototype.getEnvelope=function(){if(this._env===null){for(var t=new T,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},te.prototype.addReachable=function(t){var e=this,n=new gn;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},te.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(S.LEFT,t.getDepth(S.RIGHT)),e.setDepth(S.RIGHT,t.getDepth(S.LEFT))},te.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();n._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}},te.prototype.getNodes=function(){return this._nodes},te.prototype.getDirectedEdges=function(){return this._dirEdgeList},te.prototype.interfaces_=function(){return[Me]},te.prototype.getClass=function(){return te};var at=function r(){var t=this;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 n=arguments[0];this.init(1),this.location[S.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[S.ON]=s,this.location[S.LEFT]=a,this.location[S.RIGHT]=u}};at.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},at.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==m.NONE)return!1;return!0},at.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===m.NONE&&(e.location[n]=t)},at.prototype.isLine=function(){return this.location.length===1},at.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[S.ON]=this.location[S.ON],n[S.LEFT]=m.NONE,n[S.RIGHT]=m.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===m.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},at.prototype.getLocations=function(){return this.location},at.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[S.LEFT];this.location[S.LEFT]=this.location[S.RIGHT],this.location[S.RIGHT]=t},at.prototype.toString=function(){var t=new on;return this.location.length>1&&t.append(m.toLocationSymbol(this.location[S.LEFT])),t.append(m.toLocationSymbol(this.location[S.ON])),this.location.length>1&&t.append(m.toLocationSymbol(this.location[S.RIGHT])),t.toString()},at.prototype.setLocations=function(t,e,n){this.location[S.ON]=t,this.location[S.LEFT]=e,this.location[S.RIGHT]=n},at.prototype.get=function(t){return t<this.location.length?this.location[t]:m.NONE},at.prototype.isArea=function(){return this.location.length>1},at.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===m.NONE)return!0;return!1},at.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(S.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},at.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(m.NONE)},at.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},at.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at};var et=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new at(t),this.elt[1]=new at(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new at(e.elt[0]),this.elt[1]=new at(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new at(m.NONE),this.elt[1]=new at(m.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new at(o,s,a),this.elt[1]=new at(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new at(m.NONE,m.NONE,m.NONE),this.elt[1]=new at(m.NONE,m.NONE,m.NONE),this.elt[u].setLocations(l,c,f)}};et.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},et.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},et.prototype.isNull=function(t){return this.elt[t].isNull()},et.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],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},et.prototype.isLine=function(t){return this.elt[t].isLine()},et.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new at(t.elt[n]):e.elt[n].merge(t.elt[n])},et.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},et.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(S.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},et.prototype.toString=function(){var t=new on;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()},et.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()}},et.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},et.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(S.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this.elt[n].setLocation(i,o)}},et.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},et.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},et.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new at(this.elt[t].location[0]))},et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.toLineLabel=function(t){for(var e=new et(m.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ct=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new b,this._pts=new b,this._label=new et(m.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new b,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ct.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=O.isCCW(this._ring.getCoordinates())},Ct.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ct.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Kn("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Kn("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var o=n.getLabel();U.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},Ct.prototype.getLinearRing=function(){return this._ring},Ct.prototype.getCoordinate=function(t){return this._pts.get(t)},Ct.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Ct.prototype.addPoints=function(t,e,n){var i=this,o=t.getCoordinates();if(e){var s=1;n&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;n&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}},Ct.prototype.isHole=function(){return this._isHole},Ct.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ct.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!O.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},Ct.prototype.addHole=function(t){this._holes.add(t)},Ct.prototype.isShell=function(){return this._shell===null},Ct.prototype.getLabel=function(){return this._label},Ct.prototype.getEdges=function(){return this._edges},Ct.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ct.prototype.getShell=function(){return this._shell},Ct.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],n=arguments[1],i=e.getLocation(n,S.RIGHT);if(i===m.NONE)return null;if(this._label.getLocation(n)===m.NONE)return this._label.setLocation(n,i),null}},Ct.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Ct.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),n);return o},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct};var Ec=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ct),Ic=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new b,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new Ec(o,n._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ct),Se=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}}};Se.prototype.setVisited=function(t){this._isVisited=t},Se.prototype.setInResult=function(t){this._isInResult=t},Se.prototype.isCovered=function(){return this._isCovered},Se.prototype.isCoveredSet=function(){return this._isCoveredSet},Se.prototype.setLabel=function(t){this._label=t},Se.prototype.getLabel=function(){return this._label},Se.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Se.prototype.updateIM=function(t){U.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Se.prototype.isInResult=function(){return this._isInResult},Se.prototype.isVisited=function(){return this._isVisited},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se};var Xo=function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new et(0,m.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var o=m.NONE;if(o=this._label.getLocation(i),!n.isNull(i)){var s=n.getLocation(i);o!==m.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new et(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof et)for(var o=arguments[0],s=0;s<2;s++){var a=n.computeMergedLocation(o,s),u=n._label.getLocation(s);u===m.NONE&&n._label.setLocation(s,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=m.NONE;this._label!==null&&(i=this._label.getLocation(n));var o=null;switch(i){case m.BOUNDARY:o=m.INTERIOR;break;case m.INTERIOR:o=m.BOUNDARY;break;default:o=m.BOUNDARY;break}this._label.setLocation(n,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Se),dn=function(){this.nodeMap=new Wt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};dn.prototype.find=function(t){return this.nodeMap.get(t)},dn.prototype.addNode=function(){if(arguments[0]instanceof v){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Xo){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},dn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},dn.prototype.iterator=function(){return this.nodeMap.values().iterator()},dn.prototype.values=function(){return this.nodeMap.values()},dn.prototype.getBoundaryNodes=function(t){for(var e=new b,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===m.BOUNDARY&&e.add(i)}return e},dn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn};var rt=function(){},lo={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.isNorthern=function(t){return t===rt.NE||t===rt.NW},rt.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},rt.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},rt.isInHalfPlane=function(t,e){return e===rt.SE?t===rt.SE||t===rt.SW:t===e||t===e+1},rt.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 ct("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?rt.NE:rt.SE:e>=0?rt.NW:rt.SW}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new ct("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?rt.NE:rt.SE:i.y>=n.y?rt.NW:rt.SW}},lo.NE.get=function(){return 0},lo.NW.get=function(){return 1},lo.SW.get=function(){return 2},lo.SE.get=function(){return 3},Object.defineProperties(rt,lo);var jt=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],n=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(n,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};jt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:O.computeOrientation(t._p0,t._p1,this._p1)},jt.prototype.getDy=function(){return this._dy},jt.prototype.getCoordinate=function(){return this._p0},jt.prototype.setNode=function(t){this._node=t},jt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),o=n.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},jt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},jt.prototype.getDirectedCoordinate=function(){return this._p1},jt.prototype.getDx=function(){return this._dx},jt.prototype.getLabel=function(){return this._label},jt.prototype.getEdge=function(){return this._edge},jt.prototype.getQuadrant=function(){return this._quadrant},jt.prototype.getNode=function(){return this._node},jt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},jt.prototype.computeLabel=function(t){},jt.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=rt.quadrant(this._dx,this._dy),U.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},jt.prototype.interfaces_=function(){return[Me]},jt.prototype.getClass=function(){return jt};var Ts=function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),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(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new et(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Kn("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,o=0;o<2;o++)n._label.isArea(o)&&n._label.getLocation(o,S.LEFT)===m.INTERIOR&&n._label.getLocation(o,S.RIGHT)===m.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[S.LEFT]+"/"+this._depth[S.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,m.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,m.EXTERIOR);return n&&i&&o},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;n===S.LEFT&&(s=-1);var a=S.opposite(n),u=o*s,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===m.EXTERIOR&&i===m.INTERIOR?1:n===m.INTERIOR&&i===m.EXTERIOR?-1:0},t}(jt),Ri=function(){};Ri.prototype.createNode=function(t){return new Xo(t,null)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var ht=function(){if(this._edges=new b,this._nodes=null,this._edgeEndList=new b,arguments.length===0)this._nodes=new dn(new Ri);else if(arguments.length===1){var t=arguments[0];this._nodes=new dn(t)}};ht.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},ht.prototype.find=function(t){return this._nodes.find(t)},ht.prototype.addNode=function(){if(arguments[0]instanceof Xo){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this._nodes.addNode(e)}},ht.prototype.getNodeIterator=function(){return this._nodes.iterator()},ht.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},ht.prototype.debugPrintln=function(t){Gt.out.println(t)},ht.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===m.BOUNDARY},ht.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},ht.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?O.computeOrientation(t,e,i)===O.COLLINEAR&&rt.quadrant(t,e)===rt.quadrant(n,i):!1},ht.prototype.getEdgeEnds=function(){return this._edgeEndList},ht.prototype.debugPrint=function(t){Gt.out.print(t)},ht.prototype.getEdgeIterator=function(){return this._edges.iterator()},ht.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(n.matchInSameDirection(t,e,s[0],s[1])||n.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null},ht.prototype.insertEdge=function(t){this._edges.add(t)},ht.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},ht.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var o=new Ts(i,!0),s=new Ts(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}},ht.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},ht.prototype.getNodes=function(){return this._nodes.values()},ht.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},ht.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var de=function(){this._geometryFactory=null,this._shellList=new b;var t=arguments[0];this._geometryFactory=t};de.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?n.add(o):e.add(o)}},de.prototype.computePolygons=function(t){for(var e=this,n=new b,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);n.add(s)}return n},de.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=n.findEdgeRingContaining(o,t);if(s===null)throw new Kn("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},de.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,o=new b,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):n.addAll(u)}else o.add(a)}return o},de.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},de.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new b,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new Ic(o,e._geometryFactory);n.add(s),s.setInResult()}}return n},de.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},de.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},de.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),o=n.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var h=!1;f.contains(i)&&O.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},de.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(n=o,e++)}return U.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},de.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],n=arguments[1];ht.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),o=new b,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de};var Oi=function(){};Oi.prototype.getBounds=function(){},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var je=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};je.prototype.getItem=function(){return this._item},je.prototype.getBounds=function(){return this._bounds},je.prototype.interfaces_=function(){return[Oi,Ae]},je.prototype.getClass=function(){return je};var Qn=function(){this._size=null,this._items=null,this._size=0,this._items=new b,this._items.add(null)};Qn.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},Qn.prototype.size=function(){return this._size},Qn.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},Qn.prototype.clear=function(){this._size=0,this._items.clear()},Qn.prototype.isEmpty=function(){return this._size===0},Qn.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var fr=function(){};fr.prototype.visitItem=function(t){},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr};var ti=function(){};ti.prototype.insert=function(t,e){},ti.prototype.remove=function(t,e){},ti.prototype.query=function(){},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti};var Lt=function(){if(this._childBoundables=new b,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Qa={serialVersionUID:{configurable:!0}};Lt.prototype.getLevel=function(){return this._level},Lt.prototype.size=function(){return this._childBoundables.size()},Lt.prototype.getChildBoundables=function(){return this._childBoundables},Lt.prototype.addChildBoundable=function(t){U.isTrue(this._bounds===null),this._childBoundables.add(t)},Lt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Lt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Lt.prototype.interfaces_=function(){return[Oi,Ae]},Lt.prototype.getClass=function(){return Lt},Qa.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Lt,Qa);var Ke=function(){};Ke.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},Ke.min=function(t){return Ke.sort(t),t.get(0)},Ke.sort=function(t,e){var n=t.toArray();e?Or.sort(n,e):Or.sort(n);for(var i=t.iterator(),o=0,s=n.length;o<s;o++)i.next(),i.set(n[o])},Ke.singletonList=function(t){var e=new b;return e.add(t),e};var Nt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Nt.prototype.expandToQueue=function(t,e){var n=Nt.isComposite(this._boundable1),i=Nt.isComposite(this._boundable2);if(n&&i)return Nt.area(this._boundable1)>Nt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ct("neither boundable is composite")},Nt.prototype.isLeaves=function(){return!(Nt.isComposite(this._boundable1)||Nt.isComposite(this._boundable2))},Nt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Nt.prototype.expand=function(t,e,n,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new Nt(u,e,o._itemDistance);l.getDistance()<i&&n.add(l)}},Nt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},Nt.prototype.getDistance=function(){return this._distance},Nt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Nt.prototype.interfaces_=function(){return[Me]},Nt.prototype.getClass=function(){return Nt},Nt.area=function(t){return t.getBounds().getArea()},Nt.isComposite=function(t){return t instanceof Lt};var Mt=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new b,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];U.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Yo={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Mt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Mt.prototype.lastNode=function(t){return t.get(t.size()-1)},Mt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Lt?n+=t.size(o):o instanceof je&&(n+=1)}return n}},Mt.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof je&&o.getItem()===e&&(n=o)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Mt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new b:e}else if(arguments.length===1){for(var n=arguments[0],i=new b,o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof Lt){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof je?i.add(s.getItem()):U.shouldNeverReachHere()}return i.size()<=0?null:i}},Mt.prototype.insert=function(t,e){U.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new je(t,e))},Mt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new b;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(U.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof Lt?t.boundablesAtLevel(i,u,s):(U.isTrue(u instanceof je),i===-1&&s.add(u))}return null}},Mt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new b;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(k(arguments[2],fr)&&arguments[0]instanceof Object&&arguments[1]instanceof Lt)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof Lt?t.query(s,f,u):f instanceof je?u.visitItem(f.getItem()):U.shouldNeverReachHere())}else if(k(arguments[2],Ye)&&arguments[0]instanceof Object&&arguments[1]instanceof Lt)for(var h=arguments[0],g=arguments[1],p=arguments[2],y=g.getChildBoundables(),d=0;d<y.size();d++){var _=y.get(d);t.getIntersectsOp().intersects(_.getBounds(),h)&&(_ instanceof Lt?t.query(h,_,p):_ instanceof je?p.add(_.getItem()):U.shouldNeverReachHere())}}},Mt.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},Mt.prototype.getRoot=function(){return this.build(),this._root},Mt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof Lt&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},Mt.prototype.createHigherLevels=function(t,e){U.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},Mt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof Lt){var s=t.depth(o);s>n&&(n=s)}}return n+1}},Mt.prototype.createParentBoundables=function(t,e){var n=this;U.isTrue(!t.isEmpty());var i=new b;i.add(this.createNode(e));var o=new b(t);Ke.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(a)}return i},Mt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Mt.prototype.interfaces_=function(){return[Ae]},Mt.prototype.getClass=function(){return Mt},Mt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Yo.IntersectsOp.get=function(){return Cc},Yo.serialVersionUID.get=function(){return-3886435814360241e3},Yo.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Mt,Yo);var Cc=function(){},Di=function(){};Di.prototype.distance=function(t,e){},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var Ja=function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;U.isTrue(i.length>0);for(var a=new b,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new Za(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,o)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new b;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];r.prototype.query.call(this,o,s)}else if(arguments.length===3){if(k(arguments[2],fr)&&arguments[0]instanceof Object&&arguments[1]instanceof Lt){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(k(arguments[2],Ye)&&arguments[0]instanceof Object&&arguments[1]instanceof Lt){var c=arguments[0],f=arguments[1],h=arguments[2];r.prototype.query.call(this,c,f,h)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return r.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return r.prototype.remove.call(this,i,o)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){U.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new b(i);Ke.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(k(arguments[0],Di)){var i=arguments[0],o=new Nt(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof Nt){var s=arguments[0];return this.nearestNeighbour(s,z.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&k(arguments[1],Di)){var a=arguments[0],u=arguments[1],l=new Nt(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof Nt&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=f,g=null,p=new Qn;for(p.add(c);!p.isEmpty()&&h>0;){var y=p.poll(),d=y.getDistance();if(d>=h)break;y.isLeaves()?(h=d,g=y):y.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var _=arguments[0],I=arguments[1],C=arguments[2],L=new je(_,I),x=new Nt(this.getRoot(),L,C);return this.nearestNeighbour(x)[0]}},t.prototype.interfaces_=function(){return[ti,Ae]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return Za},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[mi]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[mi]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Mt),Za=function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();n===null?n=new T(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Lt),ce=function(){};ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},ce.relativeSign=function(t,e){return t<e?-1:t>e?1:0},ce.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=ce.relativeSign(e.x,n.x),o=ce.relativeSign(e.y,n.y);switch(t){case 0:return ce.compareValue(i,o);case 1:return ce.compareValue(o,i);case 2:return ce.compareValue(o,-i);case 3:return ce.compareValue(-i,o);case 4:return ce.compareValue(-i,-o);case 5:return ce.compareValue(-o,-i);case 6:return ce.compareValue(-o,i);case 7:return ce.compareValue(i,-o)}return U.shouldNeverReachHere("invalid octant value"),0},ce.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var hr=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new v(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};hr.prototype.getCoordinate=function(){return this.coord},hr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},hr.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:ce.compare(this._segmentOctant,this.coord,e.coord)},hr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},hr.prototype.isInterior=function(){return this._isInterior},hr.prototype.interfaces_=function(){return[Me]},hr.prototype.getClass=function(){return hr};var ee=function(){this._nodeMap=new Wt,this._edge=null;var t=arguments[0];this._edge=t};ee.prototype.getSplitCoordinates=function(){var t=this,e=new eo;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},ee.prototype.addCollapsedNodes=function(){var t=this,e=new b;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},ee.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},ee.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),o=e._edge.getCoordinate(n+2);i.equals2D(o)&&t.add(new sn(n+1))}},ee.prototype.addEdgeCoordinates=function(t,e,n){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);n.add(new v(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));s&&n.add(new v(e.coord))},ee.prototype.iterator=function(){return this._nodeMap.values().iterator()},ee.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},ee.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},ee.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,n);a&&t.add(new sn(n[0])),o=s}},ee.prototype.getEdge=function(){return this._edge},ee.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ee.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return s&&(a[u]=new v(e.coord)),new _t(a,this._edge.getData())},ee.prototype.add=function(t,e){var n=new hr(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(U.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},ee.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new qn("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new qn("bad split edge end point at "+a)},ee.prototype.interfaces_=function(){return[]},ee.prototype.getClass=function(){return ee};var ei=function(){};ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.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 ct("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new ct("Cannot compute the octant for two identical points "+o);return ei.octant(a,u)}};var Rn=function(){};Rn.prototype.getCoordinates=function(){},Rn.prototype.size=function(){},Rn.prototype.getCoordinate=function(t){},Rn.prototype.isClosed=function(){},Rn.prototype.setData=function(t){},Rn.prototype.getData=function(){},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn};var co=function(){};co.prototype.addIntersection=function(t,e){},co.prototype.interfaces_=function(){return[Rn]},co.prototype.getClass=function(){return co};var _t=function(){this._nodeList=new ee(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};_t.prototype.getCoordinates=function(){return this._pts},_t.prototype.size=function(){return this._pts.length},_t.prototype.getCoordinate=function(t){return this._pts[t]},_t.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},_t.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},_t.prototype.setData=function(t){this._data=t},_t.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ei.octant(t,e)},_t.prototype.getData=function(){return this._data},_t.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[3],s=new v(n.getIntersection(o));this.addIntersection(s,i)}},_t.prototype.toString=function(){return Xe.toLineString(new mt(this._pts))},_t.prototype.getNodeList=function(){return this._nodeList},_t.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(n=i)}var s=this._nodeList.add(t,n);return s},_t.prototype.addIntersections=function(t,e,n){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,n,o)},_t.prototype.interfaces_=function(){return[co]},_t.prototype.getClass=function(){return _t},_t.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new b;return _t.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],o=n.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var M=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new v,this.p1=new v;else if(arguments.length===1){var t=arguments[0];this.p0=new v(t.p0),this.p1=new v(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],o=arguments[3];this.p0=new v(e,n),this.p1=new v(i,o)}},$a={serialVersionUID:{configurable:!0}};M.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},M.prototype.orientationIndex=function(){if(arguments[0]instanceof M){var t=arguments[0],e=O.orientationIndex(this.p0,this.p1,t.p0),n=O.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof v){var i=arguments[0];return O.orientationIndex(this.p0,this.p1,i)}},M.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},M.prototype.isVertical=function(){return this.p0.x===this.p1.x},M.prototype.equals=function(t){if(!(t instanceof M))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},M.prototype.intersection=function(t){var e=new Pr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},M.prototype.project=function(){if(arguments[0]instanceof v){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new v(t);var e=this.projectionFactor(t),n=new v;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof M){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new M(a,u)}},M.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},M.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},M.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},M.prototype.distancePerpendicular=function(t){return O.distancePointLinePerpendicular(t,this.p0,this.p1)},M.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},M.prototype.midPoint=function(){return M.midPoint(this.p0,this.p1)},M.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,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return z.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return o},M.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=z.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,n[0]=this.p1,n[1]=l),n},M.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},M.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},M.prototype.getLength=function(){return this.p0.distance(this.p1)},M.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},M.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},M.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)},M.prototype.lineIntersection=function(t){try{var e=qe.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof Ei))throw n}finally{}return null},M.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},M.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=n-l,f=i+u,h=new v(c,f);return h},M.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],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},M.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||z.isNaN(e))&&(e=1),e},M.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},M.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},M.prototype.distance=function(){if(arguments[0]instanceof M){var t=arguments[0];return O.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof v){var e=arguments[0];return O.distancePointLine(e,this.p0,this.p1)}},M.prototype.pointAlong=function(t){var e=new v;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},M.prototype.hashCode=function(){var t=z.doubleToLongBits(this.p0.x);t^=z.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=z.doubleToLongBits(this.p1.x);n^=z.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},M.prototype.interfaces_=function(){return[Me,Ae]},M.prototype.getClass=function(){return M},M.midPoint=function(t,e){return new v((t.x+e.x)/2,(t.y+e.y)/2)},$a.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(M,$a);var fo=function(){this.tempEnv1=new T,this.tempEnv2=new T,this._overlapSeg1=new M,this._overlapSeg2=new M};fo.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo};var ve=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],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};ve.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},ve.prototype.computeSelect=function(t,e,n,i){var o=this._pts[e],s=this._pts[n];if(i.tempEnv1.init(o,s),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,i),a<n&&this.computeSelect(t,a,n,i)},ve.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},ve.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},ve.prototype.setId=function(t){this._id=t},ve.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},ve.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new T(t,e)}return this._env},ve.prototype.getEndIndex=function(){return this._end},ve.prototype.getStartIndex=function(){return this._start},ve.prototype.getContext=function(){return this._context},ve.prototype.getId=function(){return this._id},ve.prototype.computeOverlapsInternal=function(t,e,n,i,o,s){var a=this._pts[t],u=this._pts[e],l=n._pts[i],c=n._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,n,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),h=Math.trunc((i+o)/2);t<f&&(i<h&&this.computeOverlapsInternal(t,f,n,i,h,s),h<o&&this.computeOverlapsInternal(t,f,n,h,o,s)),f<e&&(i<h&&this.computeOverlapsInternal(f,e,n,i,h,s),h<o&&this.computeOverlapsInternal(f,e,n,h,o,s))},ve.prototype.interfaces_=function(){return[]},ve.prototype.getClass=function(){return ve};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new b;n.add(new sn(e));do{var i=vn.findChainEnd(t,e);n.add(new sn(i)),e=i}while(e<t.length-1);var o=vn.toIntArray(n);return o},vn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=rt.quadrant(t[n],t[n+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=rt.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1},vn.getChains=function(){if(arguments.length===1){var t=arguments[0];return vn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new b,o=vn.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new ve(e,o[s],o[s+1],n);i.add(a)}return i}},vn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Tr=function(){};Tr.prototype.computeNodes=function(t){},Tr.prototype.getNodedSubstrings=function(){},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var ho=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};ho.prototype.setSegmentIntersector=function(t){this._segInt=t},ho.prototype.interfaces_=function(){return[Tr]},ho.prototype.getClass=function(){return ho};var Ms=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new b,this._index=new Ja,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return _t.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=vn.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new tu(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return tu},Object.defineProperties(t,e),t}(ho),tu=function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=n.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fo),$=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},Jn={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}};$.prototype.getEndCapStyle=function(){return this._endCapStyle},$.prototype.isSingleSided=function(){return this._isSingleSided},$.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=$.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=$.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==$.JOIN_ROUND&&(this._quadrantSegments=$.DEFAULT_QUADRANT_SEGMENTS)},$.prototype.getJoinStyle=function(){return this._joinStyle},$.prototype.setJoinStyle=function(t){this._joinStyle=t},$.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},$.prototype.getSimplifyFactor=function(){return this._simplifyFactor},$.prototype.getQuadrantSegments=function(){return this._quadrantSegments},$.prototype.setEndCapStyle=function(t){this._endCapStyle=t},$.prototype.getMitreLimit=function(){return this._mitreLimit},$.prototype.setMitreLimit=function(t){this._mitreLimit=t},$.prototype.setSingleSided=function(t){this._isSingleSided=t},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Jn.CAP_ROUND.get=function(){return 1},Jn.CAP_FLAT.get=function(){return 2},Jn.CAP_SQUARE.get=function(){return 3},Jn.JOIN_ROUND.get=function(){return 1},Jn.JOIN_MITRE.get=function(){return 2},Jn.JOIN_BEVEL.get=function(){return 3},Jn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Jn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Jn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties($,Jn);var pt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=O.COUNTERCLOCKWISE,this._inputLine=t||null},go={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};pt.prototype.isDeletable=function(t,e,n,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,n,i)},pt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=pt.DELETE,s=!0,o=!0),s?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return o},pt.prototype.isShallowConcavity=function(t,e,n,i){var o=O.computeOrientation(t,e,n),s=o===this._angleOrientation;if(!s)return!1;var a=O.distancePointLine(e,t,n);return a<i},pt.prototype.isShallowSampled=function(t,e,n,i,o){var s=this,a=Math.trunc((i-n)/pt.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0},pt.prototype.isConcave=function(t,e,n){var i=O.computeOrientation(t,e,n),o=i===this._angleOrientation;return o},pt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=O.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},pt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===pt.DELETE;)e++;return e},pt.prototype.isShallow=function(t,e,n,i){var o=O.distancePointLine(e,t,n);return o<i},pt.prototype.collapseLine=function(){for(var t=this,e=new eo,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==pt.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},pt.simplify=function(t,e){var n=new pt(t);return n.simplify(e)},go.INIT.get=function(){return 0},go.DELETE.get=function(){return 1},go.KEEP.get=function(){return 1},go.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(pt,go);var we=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new b},eu={COORDINATE_ARRAY_TYPE:{configurable:!0}};we.prototype.getCoordinates=function(){var t=this._ptList.toArray(we.COORDINATE_ARRAY_TYPE);return t},we.prototype.setPrecisionModel=function(t){this._precisionModel=t},we.prototype.addPt=function(t){var e=new v(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},we.prototype.revere=function(){},we.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)n.addPt(t[o])},we.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},we.prototype.toString=function(){var t=new W,e=t.createLineString(this.getCoordinates());return e.toString()},we.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new v(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},we.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},eu.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(we,eu);var K=function(){},ni={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.toDegrees=function(t){return t*180/Math.PI},K.normalize=function(t){for(;t>Math.PI;)t-=K.PI_TIMES_2;for(;t<=-Math.PI;)t+=K.PI_TIMES_2;return t},K.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,o=n.y-e.y;return Math.atan2(o,i)}},K.isAcute=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u>0},K.isObtuse=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u<0},K.interiorAngle=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n);return Math.abs(o-i)},K.normalizePositive=function(t){if(t<0){for(;t<0;)t+=K.PI_TIMES_2;t>=K.PI_TIMES_2&&(t=0)}else{for(;t>=K.PI_TIMES_2;)t-=K.PI_TIMES_2;t<0&&(t=0)}return t},K.angleBetween=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n);return K.diff(i,o)},K.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},K.toRadians=function(t){return t*Math.PI/180},K.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?K.COUNTERCLOCKWISE:n<0?K.CLOCKWISE:K.NONE},K.angleBetweenOriented=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n),s=o-i;return s<=-Math.PI?s+K.PI_TIMES_2:s>Math.PI?s-K.PI_TIMES_2:s},ni.PI_TIMES_2.get=function(){return 2*Math.PI},ni.PI_OVER_2.get=function(){return Math.PI/2},ni.PI_OVER_4.get=function(){return Math.PI/4},ni.COUNTERCLOCKWISE.get=function(){return O.COUNTERCLOCKWISE},ni.CLOCKWISE.get=function(){return O.CLOCKWISE},ni.NONE.get=function(){return O.COLLINEAR},Object.defineProperties(K,ni);var lt=function r(){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 M,this._seg1=new M,this._offset0=new M,this._offset1=new M,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Pr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===$.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},po={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}};lt.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=O.computeOrientation(this._s0,this._s1,this._s2),i=n===O.CLOCKWISE&&this._side===S.LEFT||n===O.COUNTERCLOCKWISE&&this._side===S.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},lt.prototype.addLineEndCap=function(t,e){var n=new M(t,e),i=new M;this.computeOffsetSegment(n,S.LEFT,this._distance,i);var o=new M;this.computeOffsetSegment(n,S.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,O.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case $.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case $.CAP_SQUARE:var l=new v;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new v(i.p1.x+l.x,i.p1.y+l.y),f=new v(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},lt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},lt.prototype.addMitreJoin=function(t,e,n,i){var o=!0,s=null;try{s=qe.intersection(e.p0,e.p1,n.p0,n.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Ei)s=new v(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},lt.prototype.addFilletCorner=function(t,e,n,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=n.x-t.x,c=n.y-t.y,f=Math.atan2(c,l);i===O.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(n)},lt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*lt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===$.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===$.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))},lt.prototype.createSquare=function(t){this._segList.addPt(new v(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new v(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},lt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},lt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},lt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},lt.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},lt.prototype.addLimitedMitreJoin=function(t,e,n,i){var o=this._seg0.p1,s=K.angle(o,this._seg0.p0),a=K.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=K.normalize(s+u),c=K.normalize(l+Math.PI),f=i*n,h=f*Math.abs(Math.sin(u)),g=n-h,p=o.x+f*Math.cos(c),y=o.y+f*Math.sin(c),d=new v(p,y),_=new M(o,d),I=_.pointAlongOffset(1,g),C=_.pointAlongOffset(1,-g);this._side===S.LEFT?(this._segList.addPt(I),this._segList.addPt(C)):(this._segList.addPt(C),this._segList.addPt(I))},lt.prototype.computeOffsetSegment=function(t,e,n,i){var o=e===S.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*n*s/u,c=o*n*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l},lt.prototype.addFilletArc=function(t,e,n,i,o){var s=this,a=i===O.CLOCKWISE?-1:1,u=Math.abs(e-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,h=c,g=new v;h<u;){var p=e+a*h;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),s._segList.addPt(g),h+=f}},lt.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*lt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new v((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new v((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},lt.prototype.createCircle=function(t){var e=new v(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},lt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},lt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new we,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*lt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},lt.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===$.JOIN_BEVEL||this._bufParams.getJoinStyle()===$.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,O.CLOCKWISE,this._distance))},lt.prototype.closeRing=function(){this._segList.closeRing()},lt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},po.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},po.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},po.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},po.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(lt,po);var fe=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};fe.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,n,o);var s=o.getCoordinates();return n&&H.reverse(s),s},fe.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var o=pt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],S.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{n.addSegments(t,!1);var u=pt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],S.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},fe.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===S.RIGHT&&(i=-i);var o=pt.simplify(t,i),s=o.length-1;n.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;n.addNextSegment(o[a],u)}n.closeRing()},fe.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=pt.simplify(t,n),o=i.length-1;e.initSideSegments(i[0],i[1],S.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=pt.simplify(t,-n),u=a.length-1;e.initSideSegments(a[u],a[u-1],S.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},fe.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:e.createCircle(t);break;case $.CAP_SQUARE:e.createSquare(t);break}},fe.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s},fe.prototype.getBufferParameters=function(){return this._bufParams},fe.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},fe.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return fe.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},fe.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var o=pt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],S.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{var u=pt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],S.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},fe.prototype.getSegGen=function(t){return new lt(this._precisionModel,this._bufParams,t)},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new v(t[n]);return e};var ri=function(){this._subgraphs=null,this._seg=new M,this._cga=new O;var t=arguments[0];this._subgraphs=t},nu={DepthSegment:{configurable:!0}};ri.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new b,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(k(arguments[2],Ye)&&arguments[0]instanceof v&&arguments[1]instanceof Ts)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(h<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&O.computeOrientation(t._seg.p0,t._seg.p1,a)!==O.RIGHT){var g=u.getDepth(S.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(S.RIGHT));var p=new Mr(t._seg,g);l.add(p)}}else if(k(arguments[2],Ye)&&arguments[0]instanceof v&&k(arguments[1],Ye))for(var y=arguments[0],d=arguments[1],_=arguments[2],I=d.iterator();I.hasNext();){var C=I.next();C.isForward()&&t.findStabbedSegments(y,C,_)}}},ri.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=Ke.min(e);return n._leftDepth},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri},nu.DepthSegment.get=function(){return Mr},Object.defineProperties(ri,nu);var Mr=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new M(t),this._leftDepth=e};Mr.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Mr.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Mr.prototype.toString=function(){return this._upwardSeg.toString()},Mr.prototype.interfaces_=function(){return[Me]},Mr.prototype.getClass=function(){return Mr};var tt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};tt.prototype.area=function(){return tt.area(this.p0,this.p1,this.p2)},tt.prototype.signedArea=function(){return tt.signedArea(this.p0,this.p1,this.p2)},tt.prototype.interpolateZ=function(t){if(t===null)throw new ct("Supplied point is null.");return tt.interpolateZ(t,this.p0,this.p1,this.p2)},tt.prototype.longestSideLength=function(){return tt.longestSideLength(this.p0,this.p1,this.p2)},tt.prototype.isAcute=function(){return tt.isAcute(this.p0,this.p1,this.p2)},tt.prototype.circumcentre=function(){return tt.circumcentre(this.p0,this.p1,this.p2)},tt.prototype.area3D=function(){return tt.area3D(this.p0,this.p1,this.p2)},tt.prototype.centroid=function(){return tt.centroid(this.p0,this.p1,this.p2)},tt.prototype.inCentre=function(){return tt.inCentre(this.p0,this.p1,this.p2)},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},tt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},tt.det=function(t,e,n,i){return t*i-e*n},tt.interpolateZ=function(t,e,n,i){var o=e.x,s=e.y,a=n.x-o,u=i.x-o,l=n.y-s,c=i.y-s,f=a*c-u*l,h=t.x-o,g=t.y-s,p=(c*h-u*g)/f,y=(-l*h+a*g)/f,d=e.z+p*(n.z-e.z)+y*(i.z-e.z);return d},tt.longestSideLength=function(t,e,n){var i=t.distance(e),o=e.distance(n),s=n.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a},tt.isAcute=function(t,e,n){return!(!K.isAcute(t,e,n)||!K.isAcute(e,n,t)||!K.isAcute(n,t,e))},tt.circumcentre=function(t,e,n){var i=n.x,o=n.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*tt.det(s,a,u,l),f=tt.det(a,s*s+a*a,l,u*u+l*l),h=tt.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new v(g,p)},tt.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,o=new qe(t.x+n/2,t.y+i/2,1),s=new qe(t.x-i+n/2,t.y+n+i/2,1);return new qe(o,s)},tt.angleBisector=function(t,e,n){var i=e.distance(t),o=e.distance(n),s=i/(i+o),a=n.x-t.x,u=n.y-t.y,l=new v(t.x+s*a,t.y+s*u);return l},tt.area3D=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=n.x-t.x,u=n.y-t.y,l=n.z-t.z,c=o*l-s*u,f=s*a-i*l,h=i*u-o*a,g=c*c+f*f+h*h,p=Math.sqrt(g)/2;return p},tt.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,o=(t.y+e.y+n.y)/3;return new v(i,o)},tt.inCentre=function(t,e,n){var i=e.distance(n),o=t.distance(n),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*n.x)/a,l=(i*t.y+o*e.y+s*n.y)/a;return new v(u,l)};var ze=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new b;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};ze.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,m.EXTERIOR,m.INTERIOR)},ze.prototype.addPolygon=function(t){var e=this,n=this._distance,i=S.LEFT;this._distance<0&&(n=-this._distance,i=S.RIGHT);var o=t.getExteriorRing(),s=H.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,n,i,m.EXTERIOR,m.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=H.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,n,S.opposite(i),m.INTERIOR,m.EXTERIOR)}},ze.prototype.isTriangleErodedCompletely=function(t,e){var n=new tt(t[0],t[1],t[2]),i=n.inCentre(),o=O.distancePointLine(i,n.p0,n.p1);return o<Math.abs(e)},ze.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=H.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,m.EXTERIOR,m.INTERIOR)},ze.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new _t(t,new et(0,m.BOUNDARY,e,n));this._curveList.add(i)},ze.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},ze.prototype.addPolygonRing=function(t,e,n,i,o){if(e===0&&t.length<Ln.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Ln.MINIMUM_VALID_SIZE&&O.isCCW(t)&&(s=o,a=i,n=S.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,s,a)},ze.prototype.add=function(t){if(t.isEmpty())return null;t instanceof wt?this.addPolygon(t):t instanceof gt?this.addLineString(t):t instanceof pe?this.addPoint(t):t instanceof Pi?this.addCollection(t):t instanceof Dr?this.addCollection(t):t instanceof bn?this.addCollection(t):t instanceof $t&&this.addCollection(t)},ze.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},ze.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze};var Ti=function(){};Ti.prototype.locate=function(t){},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var On=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()};On.prototype.next=function(){if(this._atStart)return this._atStart=!1,On.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 Li;var t=this._parent.getGeometryN(this._index++);return t instanceof $t?(this._subcollectionIterator=new On(t),this._subcollectionIterator.next()):t},On.prototype.remove=function(){throw new Error(this.getClass().getName())},On.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)},On.prototype.interfaces_=function(){return[wi]},On.prototype.getClass=function(){return On},On.isAtomic=function(t){return!(t instanceof $t)};var Le=function(){this._geom=null;var t=arguments[0];this._geom=t};Le.prototype.locate=function(t){return Le.locate(t,this._geom)},Le.prototype.interfaces_=function(){return[Ti]},Le.prototype.getClass=function(){return Le},Le.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?O.isPointInRing(t,e.getCoordinates()):!1},Le.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Le.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Le.isPointInRing(t,o))return!1}return!0},Le.containsPoint=function(t,e){if(e instanceof wt)return Le.containsPointInPolygon(t,e);if(e instanceof $t)for(var n=new On(e);n.hasNext();){var i=n.next();if(i!==e&&Le.containsPoint(t,i))return!0}return!1},Le.locate=function(t,e){return e.isEmpty()?m.EXTERIOR:Le.containsPoint(t,e)?m.INTERIOR:m.EXTERIOR};var Kt=function(){this._edgeMap=new Wt,this._edgeList=null,this._ptInAreaLocation=[m.NONE,m.NONE]};Kt.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Kt.prototype.propagateSideLabels=function(t){for(var e=m.NONE,n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,S.LEFT)!==m.NONE&&(e=o.getLocation(t,S.LEFT))}if(e===m.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,S.ON)===m.NONE&&l.setLocation(t,S.ON,s),l.isArea(t)){var c=l.getLocation(t,S.LEFT),f=l.getLocation(t,S.RIGHT);if(f!==m.NONE){if(f!==s)throw new Kn("side location conflict",u.getCoordinate());c===m.NONE&&U.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else U.isTrue(l.getLocation(t,S.LEFT)===m.NONE,"found single null side"),l.setLocation(t,S.RIGHT,s),l.setLocation(t,S.LEFT,s)}}},Kt.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Kt.prototype.print=function(t){Gt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Kt.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Kt.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),o=i.getLocation(t,S.LEFT);U.isTrue(o!==m.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();U.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,S.LEFT),f=l.getLocation(t,S.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},Kt.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},Kt.prototype.iterator=function(){return this.getEdges().iterator()},Kt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new b(this._edgeMap.values())),this._edgeList},Kt.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===m.NONE&&(this._ptInAreaLocation[t]=Le.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Kt.prototype.toString=function(){var t=new on;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
|
|
24
24
|
`);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
|
|
25
|
-
`)}return t.toString()},Ht.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},Ht.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===m.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var h=m.NONE;if(n[f])h=m.EXTERIOR;else{var g=l.getCoordinate();h=e.getLocation(f,g,t)}c.setAllLocationsIfNull(f,h)}},Ht.prototype.getDegree=function(){return this._edgeMap.size()},Ht.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht};var yc=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=n._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Hn("no outgoing dirEdge found",this.getCoordinate());q.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var o=n.get(0);if(i===1)return o;var s=n.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return et.isNorthern(a)&&et.isNorthern(u)?o:!et.isNorthern(a)&&!et.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(q.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){At.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();n.print("out "),o.print(n),n.println(),n.print("in "),o.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new L;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&n._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,n.getLocation(0)),s.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=n._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(S.LEFT),a=i.getDepth(S.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Hn("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],h=arguments[2],g=h,p=c;p<f;p++){var _=n._edgeList.get(p);_.setEdgeDepths(S.RIGHT,g),g=_.getDepth(S.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===n&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(q.isTrue(o!==null,"found null for first outgoing dirEdge"),q.isTrue(o.getEdgeRing()===n,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&n++}return n}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=m.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){n=m.INTERIOR;break}if(s.isInResult()){n=m.EXTERIOR;break}}}if(n===m.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===m.INTERIOR):(l.isInResult()&&(a=m.EXTERIOR),c.isInResult()&&(a=m.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new tt(m.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===m.INTERIOR||c===m.BOUNDARY)&&i._label.setLocation(l,m.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ht),tu=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new Uo(n,new yc)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Li),lr=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};lr.prototype.compareTo=function(t){var e=t,n=lr.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},lr.prototype.interfaces_=function(){return[Re]},lr.prototype.getClass=function(){return lr},lr.orientation=function(t){return Y.increasingDirection(t)===1},lr.compareOriented=function(t,e,n,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?n.length:-1,l=e?0:t.length-1,c=i?0:n.length-1;;){var f=t[l].compareTo(n[c]);if(f!==0)return f;l+=o,c+=s;var h=l===a,g=c===u;if(h&&!g)return-1;if(!h&&g)return 1;if(h&&g)return 0}};var je=function(){this._edges=new L,this._ocaMap=new Xt};je.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")},je.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},je.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},je.prototype.iterator=function(){return this._edges.iterator()},je.prototype.getEdges=function(){return this._edges},je.prototype.get=function(t){return this._edges.get(t)},je.prototype.findEqualEdge=function(t){var e=new lr(t.getCoordinates()),n=this._ocaMap.get(e);return n},je.prototype.add=function(t){this._edges.add(t);var e=new lr(t.getCoordinates());this._ocaMap.put(e,t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var br=function(){};br.prototype.processIntersections=function(t,e,n,i){},br.prototype.isDone=function(){},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br};var Se=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};Se.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Se.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Se.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Se.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Se.prototype.getLineIntersector=function(){return this._li},Se.prototype.hasProperIntersection=function(){return this._hasProper},Se.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Se.prototype.hasIntersection=function(){return this._hasIntersection},Se.prototype.isDone=function(){return!1},Se.prototype.hasInteriorIntersection=function(){return this._hasInterior},Se.prototype.interfaces_=function(){return[br]},Se.prototype.getClass=function(){return Se},Se.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var vn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new v(t),this.segmentIndex=e,this.dist=n};vn.prototype.getSegmentIndex=function(){return this.segmentIndex},vn.prototype.getCoordinate=function(){return this.coord},vn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},vn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},vn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},vn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},vn.prototype.getDistance=function(){return this.dist},vn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},vn.prototype.interfaces_=function(){return[Re]},vn.prototype.getClass=function(){return vn};var Rn=function(){this._nodeMap=new Xt,this.edge=null;var t=arguments[0];this.edge=t};Rn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Rn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Rn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},Rn.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)},Rn.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n.edge.pts[l];return s&&(a[u]=e.coord),new Xo(a,new tt(this.edge._label))},Rn.prototype.add=function(t,e,n){var i=new vn(t,e,n),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},Rn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn};var Pr=function(){};Pr.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new L;i.add(new on(n));do{var o=e.findChainEnd(t,n);i.add(new on(o)),n=o}while(n<t.length-1);var s=Pr.toIntArray(i);return s},Pr.prototype.findChainEnd=function(t,e){for(var n=et.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=et.quadrant(t[i-1],t[i]);if(o!==n)break;i++}return i-1},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Kn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new T,this.env2=new T;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Pr;this.startIndex=e.getChainStartIndices(this.pts)};Kn.prototype.getCoordinates=function(){return this.pts},Kn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Kn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Kn.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],h=this.pts[s],g=a.pts[u],p=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,h),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var _=Math.trunc((o+s)/2),d=Math.trunc((u+l)/2);o<_&&(u<d&&this.computeIntersectsForChain(o,_,a,u,d,c),d<l&&this.computeIntersectsForChain(o,_,a,d,l,c)),_<s&&(u<d&&this.computeIntersectsForChain(_,s,a,u,d,c),d<l&&this.computeIntersectsForChain(_,s,a,d,l,c))}},Kn.prototype.getStartIndexes=function(){return this.startIndex},Kn.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)n.computeIntersectsForChain(i,t,o,e)},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Ft=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},eu={NULL_VALUE:{configurable:!0}};Ft.prototype.getDepth=function(t,e){return this._depth[t][e]},Ft.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},Ft.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==Ft.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Ft.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===Ft.NULL_VALUE}},Ft.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>n&&(o=1),t._depth[e][i]=o}}},Ft.prototype.getDelta=function(t){return this._depth[t][S.RIGHT]-this._depth[t][S.LEFT]},Ft.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?m.EXTERIOR:m.INTERIOR},Ft.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Ft.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var o=e.getLocation(n,i);(o===m.EXTERIOR||o===m.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=Ft.depthAtLocation(o):t._depth[n][i]+=Ft.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===m.INTERIOR&&this._depth[s][a]++}},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.depthAtLocation=function(t){return t===m.EXTERIOR?0:t===m.INTERIOR?1:Ft.NULL_VALUE},eu.NULL_VALUE.get=function(){return-1},Object.defineProperties(Ft,eu);var Xo=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new Rn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Ft,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,tt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var o=n;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&n.print(","),n.print(i.pts[o].x+" "+i.pts[o].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)n.print(i.pts[o]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Kn(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new T;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,o,s){var a=new v(n.getIntersection(s)),u=i,l=n.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var n=this,i=new rn;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(n.pts[o].x+" "+n.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(n.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,o){for(var s=this,a=0;a<n.getIntersectionNum();a++)s.addIntersection(n,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,S.ON),n.getLocation(1,S.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,S.LEFT),n.getLocation(1,S.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,S.RIGHT),n.getLocation(1,S.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(Ce),te=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new je,this._bufParams=t||null};te.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},te.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new tt(t.getLabel()),i.flip()),n.merge(i);var o=te.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(te.depthDelta(t.getLabel()))},te.prototype.buildSubgraphs=function(t,e){for(var n=new L,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new Jr(n),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),n.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},te.prototype.createSubgraphs=function(t){for(var e=new L,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var o=new Zt;o.create(i),e.add(o)}}return We.sort(e,We.reverseOrder()),e},te.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},te.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Ds,n=new Cr;return n.setPrecisionModel(t),e.setSegmentIntersector(new Se(n)),e},te.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new le(n,this._bufParams),o=new Fe(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,n),this._graph=new ht(new tu),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new ge(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},te.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Xo(a.getCoordinates(),new tt(l));n.insertUniqueEdge(c)}}},te.prototype.setNoder=function(t){this._workingNoder=t},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.depthDelta=function(t){var e=t.getLocation(0,S.LEFT),n=t.getLocation(0,S.RIGHT);return e===m.INTERIOR&&n===m.EXTERIOR?1:e===m.EXTERIOR&&n===m.INTERIOR?-1:0},te.convertSegStrings=function(t){for(var e=new H,n=new L;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());n.add(o)}return e.buildGeometry(n)};var cr=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 n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};cr.prototype.rescale=function(){var t=this;if(k(arguments[0],xt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&At.out.println(o)}},cr.prototype.scale=function(){var t=this;if(k(arguments[0],xt)){for(var e=arguments[0],n=new L,i=e.iterator();i.hasNext();){var o=i.next();n.add(new mt(t.scale(o.getCoordinates()),o.getData()))}return n}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new v(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=Y.removeRepeatedPoints(a);return l}},cr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},cr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},cr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},cr.prototype.interfaces_=function(){return[wr]},cr.prototype.getClass=function(){return cr};var yn=function(){this._li=new Cr,this._segStrings=null;var t=arguments[0];this._segStrings=t},nu={fact:{configurable:!0}};yn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new zn("found endpt/interior pt intersection at index "+c+" :pt "+o)}},yn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(n,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var h=arguments[0],g=arguments[1],p=arguments[2],_=arguments[3];if(h===p&&g===_)return null;var d=h.getCoordinates()[g],y=h.getCoordinates()[g+1],C=p.getCoordinates()[_],I=p.getCoordinates()[_+1];if(this._li.computeIntersection(d,y,C,I),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,y)||this.hasInteriorIntersection(this._li,C,I)))throw new zn("found non-noded intersection at "+d+"-"+y+" and "+C+"-"+I)}},yn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},yn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])},yn.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(n)))return!0}return!1},yn.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new zn("found non-noded collapse at "+yn.fact.createLineString([t,e,n]))},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn},nu.fact.get=function(){return new H},Object.defineProperties(yn,nu);var ce=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],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new lt("Scale factor must be non-zero");e!==1&&(this._pt=new v(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new v,this._p1Scaled=new v),this.initCorners(this._pt)},ru={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ce.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<n||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return q.isTrue(!(a&&u),"Found bad envelope test"),u},ce.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new v(this._maxx,this._maxy),this._corner[1]=new v(this._minx,this._maxy),this._corner[2]=new v(this._minx,this._miny),this._corner[3]=new v(this._maxx,this._miny)},ce.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))},ce.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ce.prototype.getCoordinate=function(){return this._originalPt},ce.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ce.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=ce.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new T(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ce.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()))},ce.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},ce.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},ru.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(ce,ru);var po=function(){this.tempEnv1=new T,this.selectedSegment=new M};po.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)}}},po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po};var Oi=function(){this._index=null;var t=arguments[0];this._index=t},iu={HotPixelSnapAction:{configurable:!0}};Oi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new ou(e,n,i);return this._index.query(o,{interfaces_:function(){return[ar]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},iu.HotPixelSnapAction.get=function(){return ou},Object.defineProperties(Oi,iu);var ou=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],o=n.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(po),Zr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new L};Zr.prototype.processIntersections=function(t,e,n,i){var o=this;if(t===n&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},Zr.prototype.isDone=function(){return!1},Zr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Zr.prototype.interfaces_=function(){return[br]},Zr.prototype.getClass=function(){return Zr};var On=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 Cr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};On.prototype.checkCorrectness=function(t){var e=mt.getNodedSubstrings(t),n=new yn(e);try{n.checkValid()}catch(i){if(i instanceof Ga)i.printStackTrace();else throw i}finally{}},On.prototype.getNodedSubstrings=function(){return mt.getNodedSubstrings(this._nodedSegStrings)},On.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},On.prototype.findInteriorIntersections=function(t,e){var n=new Zr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},On.prototype.computeVertexSnaps=function(){var t=this;if(k(arguments[0],xt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof mt)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new ce(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}},On.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Ds,this._pointSnapper=new Oi(this._noder.getIndex()),this.snapRound(t,this._li)},On.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=new ce(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},On.prototype.interfaces_=function(){return[wr]},On.prototype.getClass=function(){return On};var Bt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Z,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],n=arguments[1];this._argGeom=e,this._bufParams=n}},Di={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Bt.prototype.bufferFixedPrecision=function(t){var e=new cr(new On(new J(1)),t.getScale()),n=new te(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Bt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Bt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Hn)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=Bt.precisionScaleFactor(this._argGeom,this._distance,n),o=new J(i);this.bufferFixedPrecision(o)}},Bt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===J.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Bt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Bt.prototype.bufferOriginalPrecision=function(){try{var t=new te(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof zn)this._saveException=e;else throw e}finally{}},Bt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Bt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Bt(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Bt(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof Z&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=arguments[2],g=new Bt(c,h),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var _=arguments[0],d=arguments[1],y=arguments[2],C=arguments[3],I=new Bt(_);I.setQuadrantSegments(y),I.setEndCapStyle(C);var N=I.getResultGeometry(d);return N}},Bt.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),o=Ie.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Di.CAP_ROUND.get=function(){return Z.CAP_ROUND},Di.CAP_BUTT.get=function(){return Z.CAP_FLAT},Di.CAP_FLAT.get=function(){return Z.CAP_FLAT},Di.CAP_SQUARE.get=function(){return Z.CAP_SQUARE},Di.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Bt,Di);var ee=function(){this._pt=[new v,new v],this._distance=V.NaN,this._isNull=!0};ee.prototype.getCoordinates=function(){return this._pt},ee.prototype.getCoordinate=function(t){return this._pt[t]},ee.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},ee.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 n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},ee.prototype.getDistance=function(){return this._distance},ee.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},ee.prototype.interfaces_=function(){return[]},ee.prototype.getClass=function(){return ee};var Dn=function(){};Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.computeDistance=function(){if(arguments[2]instanceof ee&&arguments[0]instanceof gt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),o=new M,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof ee&&arguments[0]instanceof St&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];Dn.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)Dn.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof ee&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof gt)Dn.computeDistance(h,g,p);else if(h instanceof St)Dn.computeDistance(h,g,p);else if(h instanceof Jt)for(var _=h,d=0;d<_.getNumGeometries();d++){var y=_.getGeometryN(d);Dn.computeDistance(y,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof ee&&arguments[0]instanceof M&&arguments[1]instanceof v){var C=arguments[0],I=arguments[1],N=arguments[2],w=C.closestPoint(I);N.setMinimum(w,I)}};var Rr=function(t){this._maxPtDist=new ee,this._inputGeom=t||null},Ts={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Rr.prototype.computeMaxMidpointDistance=function(t){var e=new fr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Rr.prototype.computeMaxVertexDistance=function(t){var e=new $r(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Rr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Rr.prototype.getDistancePoints=function(){return this._maxPtDist},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Ts.MaxPointDistanceFilter.get=function(){return $r},Ts.MaxMidpointDistanceFilter.get=function(){return fr},Object.defineProperties(Rr,Ts);var $r=function(t){this._maxPtDist=new ee,this._minPtDist=new ee,this._geom=t||null};$r.prototype.filter=function(t){this._minPtDist.initialize(),Dn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},$r.prototype.getMaxPointDistance=function(){return this._maxPtDist},$r.prototype.interfaces_=function(){return[xn]},$r.prototype.getClass=function(){return $r};var fr=function(t){this._maxPtDist=new ee,this._minPtDist=new ee,this._geom=t||null};fr.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new v((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),Dn.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},fr.prototype.isDone=function(){return!1},fr.prototype.isGeometryChanged=function(){return!1},fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},fr.prototype.interfaces_=function(){return[Ye]},fr.prototype.getClass=function(){return fr};var Qn=function(t){this._comps=t||null};Qn.prototype.filter=function(t){t instanceof St&&this._comps.add(t)},Qn.prototype.interfaces_=function(){return[ln]},Qn.prototype.getClass=function(){return Qn},Qn.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Qn.getPolygons(t,new L)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof St?n.add(e):e instanceof Jt&&e.apply(new Qn(n)),n}};var Gt=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],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Gt.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Sn){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof gt&&this._lines.add(t)},Gt.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Gt.prototype.interfaces_=function(){return[Vn]},Gt.prototype.getClass=function(){return Gt},Gt.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Gt.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Gt.getLines(e,n))}},Gt.getLines=function(){if(arguments.length===1){var t=arguments[0];return Gt.getLines(t,!1)}else if(arguments.length===2){if(k(arguments[0],xt)&&k(arguments[1],xt)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();Gt.getLines(o,n)}return n}else if(arguments[0]instanceof G&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new L;return s.apply(new Gt(u,a)),u}else if(arguments[0]instanceof G&&k(arguments[1],xt)){var l=arguments[0],c=arguments[1];return l instanceof gt?c.add(l):l.apply(new Gt(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&k(arguments[0],xt)&&k(arguments[1],xt)){for(var f=arguments[0],h=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var _=p.next();Gt.getLines(_,h,g)}return h}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof G&&k(arguments[1],xt)){var d=arguments[0],y=arguments[1],C=arguments[2];return d.apply(new Gt(y,C)),y}}};var Ke=function(){if(this._boundaryRule=De.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 lt("Rule must be non-null");this._boundaryRule=t}}};Ke.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof v&&arguments[1]instanceof St){var e=arguments[0],n=arguments[1];if(n.isEmpty())return m.EXTERIOR;var i=n.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===m.EXTERIOR)return m.EXTERIOR;if(o===m.BOUNDARY)return m.BOUNDARY;for(var s=0;s<n.getNumInteriorRing();s++){var a=n.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===m.INTERIOR)return m.EXTERIOR;if(u===m.BOUNDARY)return m.BOUNDARY}return m.INTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof gt){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return m.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?m.BOUNDARY:P.isOnLine(l,f)?m.INTERIOR:m.EXTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof he){var h=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(h)?m.INTERIOR:m.EXTERIOR}},Ke.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?P.locatePointInRing(t,e.getCoordinates()):m.EXTERIOR},Ke.prototype.intersects=function(t,e){return this.locate(t,e)!==m.EXTERIOR},Ke.prototype.updateLocationInfo=function(t){t===m.INTERIOR&&(this._isIn=!0),t===m.BOUNDARY&&this._numBoundaries++},Ke.prototype.computeLocation=function(t,e){var n=this;if(e instanceof he&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof gt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof St)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Sr)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);n.updateLocationInfo(n.locateInternal(t,s))}else if(e instanceof wn)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,l))}else if(e instanceof Jt)for(var c=new Pn(e);c.hasNext();){var f=c.next();f!==e&&n.computeLocation(t,f)}},Ke.prototype.locate=function(t,e){return e.isEmpty()?m.EXTERIOR:e instanceof gt?this.locateInternal(t,e):e instanceof St?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?m.BOUNDARY:this._numBoundaries>0||this._isIn?m.INTERIOR:m.EXTERIOR)},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var ne=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._component=n,this._segIndex=i,this._pt=o}},su={INSIDE_AREA:{configurable:!0}};ne.prototype.isInsideArea=function(){return this._segIndex===ne.INSIDE_AREA},ne.prototype.getCoordinate=function(){return this._pt},ne.prototype.getGeometryComponent=function(){return this._component},ne.prototype.getSegmentIndex=function(){return this._segIndex},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne},su.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ne,su);var hr=function(t){this._pts=t||null};hr.prototype.filter=function(t){t instanceof he&&this._pts.add(t)},hr.prototype.interfaces_=function(){return[ln]},hr.prototype.getClass=function(){return hr},hr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof he?We.singletonList(t):hr.getPoints(t,new L)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof he?n.add(e):e instanceof Jt&&e.apply(new hr(n)),n}};var ti=function(){this._locations=null;var t=arguments[0];this._locations=t};ti.prototype.filter=function(t){(t instanceof he||t instanceof gt||t instanceof St)&&this._locations.add(new ne(t,0,t.getCoordinate()))},ti.prototype.interfaces_=function(){return[ln]},ti.prototype.getClass=function(){return ti},ti.getLocations=function(t){var e=new L;return t.apply(new ti(e)),e};var kt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ke,this._minDistanceLocation=null,this._minDistance=V.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 n=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=o}};kt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=1-n,s=Qn.getPolygons(this._geom[n]);if(s.size()>0){var a=ti.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&k(arguments[0],qe)&&k(arguments[1],qe)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var h=u.get(f),g=0;g<l.size();g++)if(t.computeContainmentDistance(h,l.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ne&&arguments[1]instanceof St){var p=arguments[0],_=arguments[1],d=arguments[2],y=p.getCoordinate();if(m.EXTERIOR!==this._ptLocator.locate(y,_))return this._minDistance=0,d[0]=p,d[1]=new ne(_,y),null}}},kt.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},kt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Gt.getLines(this._geom[0]),n=Gt.getLines(this._geom[1]),i=hr.getPoints(this._geom[0]),o=hr.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},kt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},kt.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])},kt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},kt.prototype.computeMinDistance=function(){var t=this;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 gt&&arguments[1]instanceof he){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=n.getCoordinate(),a=0;a<o.length-1;a++){var u=P.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new M(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new ne(e,a,c),i[1]=new ne(n,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof gt&&arguments[1]instanceof gt){var f=arguments[0],h=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(h.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),_=h.getCoordinates(),d=0;d<p.length-1;d++)for(var y=0;y<_.length-1;y++){var C=P.distanceLineLine(p[d],p[d+1],_[y],_[y+1]);if(C<t._minDistance){t._minDistance=C;var I=new M(p[d],p[d+1]),N=new M(_[y],_[y+1]),w=I.closestPoints(N);g[0]=new ne(f,d,w[0]),g[1]=new ne(h,y,w[1])}if(t._minDistance<=t._terminateDistance)return null}}}},kt.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new ne(s,0,s.getCoordinate()),n[1]=new ne(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},kt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new lt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},kt.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.distance=function(t,e){var n=new kt(t,e);return n.distance()},kt.isWithinDistance=function(t,e,n){var i=new kt(t,e,n);return i.distance()<=n},kt.nearestPoints=function(t,e){var n=new kt(t,e);return n.nearestPoints()};var Wt=function(){this._pt=[new v,new v],this._distance=V.NaN,this._isNull=!0};Wt.prototype.getCoordinates=function(){return this._pt},Wt.prototype.getCoordinate=function(t){return this._pt[t]},Wt.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Wt.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 n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},Wt.prototype.toString=function(){return Ue.toLineString(this._pt[0],this._pt[1])},Wt.prototype.getDistance=function(){return this._distance},Wt.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.computeDistance=function(){if(arguments[2]instanceof Wt&&arguments[0]instanceof gt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new M,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Wt&&arguments[0]instanceof St&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];mn.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)mn.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof Wt&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof gt)mn.computeDistance(h,g,p);else if(h instanceof St)mn.computeDistance(h,g,p);else if(h instanceof Jt)for(var _=h,d=0;d<_.getNumGeometries();d++){var y=_.getGeometryN(d);mn.computeDistance(y,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof Wt&&arguments[0]instanceof M&&arguments[1]instanceof v){var C=arguments[0],I=arguments[1],N=arguments[2],w=C.closestPoint(I);N.setMinimum(w,I)}};var Be=function(){this._g0=null,this._g1=null,this._ptDist=new Wt,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Ms={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Be.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Be.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new lt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Be.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Be.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Be.prototype.computeOrientedDistance=function(t,e,n){var i=new ei(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new gr(e,this._densifyFrac);t.apply(o),n.setMaximum(o.getMaxPointDistance())}},Be.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Be(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new Be(i,o);return a.setDensifyFraction(s),a.distance()}},Ms.MaxPointDistanceFilter.get=function(){return ei},Ms.MaxDensifiedByFractionDistanceFilter.get=function(){return gr},Object.defineProperties(Be,Ms);var ei=function(){this._maxPtDist=new Wt,this._minPtDist=new Wt,this._euclideanDist=new mn,this._geom=null;var t=arguments[0];this._geom=t};ei.prototype.filter=function(t){this._minPtDist.initialize(),mn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ei.prototype.getMaxPointDistance=function(){return this._maxPtDist},ei.prototype.interfaces_=function(){return[xn]},ei.prototype.getClass=function(){return ei};var gr=function(){this._maxPtDist=new Wt,this._minPtDist=new Wt,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};gr.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new v(l,c);n._minPtDist.initialize(),mn.computeDistance(n._geom,f,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},gr.prototype.isDone=function(){return!1},gr.prototype.isGeometryChanged=function(){return!1},gr.prototype.getMaxPointDistance=function(){return this._maxPtDist},gr.prototype.interfaces_=function(){return[Ye]},gr.prototype.getClass=function(){return gr};var de=function(t,e,n){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=n||null},As={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};de.prototype.checkMaximumDistance=function(t,e,n){var i=new Be(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ue.toLineString(o[0],o[1])+")"}},de.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=de.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),de.VERBOSE&&At.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},de.prototype.checkNegativeValid=function(){if(!(this._input instanceof St||this._input instanceof wn||this._input instanceof Jt))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)},de.prototype.getErrorIndicator=function(){return this._errorIndicator},de.prototype.checkMinimumDistance=function(t,e,n){var i=new kt(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Ue.toLineString(o[0],o[1])+" )"}},de.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)},de.prototype.getErrorLocation=function(){return this._errorLocation},de.prototype.getPolygonLines=function(t){for(var e=new L,n=new Gt(e),i=Qn.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(n)}return t.getFactory().buildGeometry(e)},de.prototype.getErrorMessage=function(){return this._errMsg},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de},As.VERBOSE.get=function(){return!1},As.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(de,As);var zt=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Fs={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};zt.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},zt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*zt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new T(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new T(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},zt.prototype.checkDistance=function(){var t=new de(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")},zt.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")},zt.prototype.checkPolygonal=function(){this._result instanceof St||this._result instanceof wn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},zt.prototype.getErrorIndicator=function(){return this._errorIndicator},zt.prototype.getErrorLocation=function(){return this._errorLocation},zt.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},zt.prototype.report=function(t){if(!zt.VERBOSE)return null;At.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},zt.prototype.getErrorMessage=function(){return this._errorMsg},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.isValidMsg=function(t,e,n){var i=new zt(t,e,n);return i.isValid()?null:i.getErrorMessage()},zt.isValid=function(t,e,n){var i=new zt(t,e,n);return!!i.isValid()},Fs.VERBOSE.get=function(){return!1},Fs.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(zt,Fs);var _n=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};_n.prototype.getCoordinates=function(){return this._pts},_n.prototype.size=function(){return this._pts.length},_n.prototype.getCoordinate=function(t){return this._pts[t]},_n.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},_n.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Kr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},_n.prototype.setData=function(t){this._data=t},_n.prototype.getData=function(){return this._data},_n.prototype.toString=function(){return Ue.toLineString(new yt(this._pts))},_n.prototype.interfaces_=function(){return[bn]},_n.prototype.getClass=function(){return _n};var Tt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new L,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Tt.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Tt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Tt.prototype.getIntersectionSegments=function(){return this._intSegments},Tt.prototype.count=function(){return this._intersectionCount},Tt.prototype.getIntersections=function(){return this._intersections},Tt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Tt.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Tt.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Tt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Tt.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Tt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Tt.prototype.interfaces_=function(){return[br]},Tt.prototype.getClass=function(){return Tt},Tt.createAllIntersectionsFinder=function(t){var e=new Tt(t);return e.setFindAllIntersections(!0),e},Tt.createAnyIntersectionFinder=function(t){return new Tt(t)},Tt.createIntersectionCounter=function(t){var e=new Tt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Qe=function(){this._li=new Cr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Qe.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Qe.prototype.getIntersections=function(){return this._segInt.getIntersections()},Qe.prototype.isValid=function(){return this.execute(),this._isValid},Qe.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Qe.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Tt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Ds;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Qe.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Hn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Qe.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ue.toLineString(t[0],t[1])+" and "+Ue.toLineString(t[2],t[3])},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe},Qe.computeIntersections=function(t){var e=new Qe(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Or=function r(){this._nv=null;var t=arguments[0];this._nv=new Qe(r.toSegmentStrings(t))};Or.prototype.checkValid=function(){this._nv.checkValid()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.toSegmentStrings=function(t){for(var e=new L,n=t.iterator();n.hasNext();){var i=n.next();e.add(new _n(i.getCoordinates(),i))}return e},Or.checkValid=function(t){var e=new Or(t);e.checkValid()};var ni=function(t){this._mapOp=t};ni.prototype.map=function(t){for(var e=this,n=new L,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||n.add(o)}return t.getFactory().createGeometryCollection(H.toGeometryArray(n))},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ni.map=function(t,e){var n=new ni(e);return n.map(t)};var En=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new L,this._resultLineList=new L;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};En.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},En.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},En.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},En.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&U.isResultOfOp(i,e)&&!o.isCovered()&&(n.add(o),t.setVisitedEdge(!0))},En.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}},En.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},En.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},En.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;q.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),U.isResultOfOp(i,e)&&e===U.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En};var ri=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new L;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};ri.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},ri.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===U.INTERSECTION)){var o=i.getLabel();U.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},ri.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri};var fe=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};fe.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},fe.prototype.transformPolygon=function(t,e){var n=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Sn)||o.isEmpty())&&(i=!1);for(var s=new L,a=0;a<t.getNumInteriorRing();a++){var u=n.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof Sn||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new L;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)},fe.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},fe.prototype.getInputGeometry=function(){return this._inputGeom},fe.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new L,o=0;o<t.getNumGeometries();o++){var s=n.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},fe.prototype.transformCoordinates=function(t,e){return this.copy(t)},fe.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},fe.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new L,o=0;o<t.getNumGeometries();o++){var s=n.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},fe.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new L,o=0;o<t.getNumGeometries();o++){var s=n.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},fe.prototype.copy=function(t){return t.copy()},fe.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new L,o=0;o<t.getNumGeometries();o++){var s=n.transform(t.getGeometryN(o));s!==null&&(n._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(H.toGeometryArray(i)):this._factory.buildGeometry(i)},fe.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof he)return this.transformPoint(t,null);if(t instanceof wi)return this.transformMultiPoint(t,null);if(t instanceof Sn)return this.transformLinearRing(t,null);if(t instanceof gt)return this.transformLineString(t,null);if(t instanceof Sr)return this.transformMultiLineString(t,null);if(t instanceof St)return this.transformPolygon(t,null);if(t instanceof wn)return this.transformMultiPolygon(t,null);if(t instanceof Jt)return this.transformGeometryCollection(t,null);throw new lt("Unknown Geometry subtype: "+t.getClass().getName())},fe.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe};var Tn=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new M,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof gt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};Tn.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=n.findSnapForVertex(s,e);a!==null&&(t.set(o,new v(a)),o===0&&n._isClosed&&t.set(t.size()-1,new v(a)))}},Tn.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},Tn.prototype.snapTo=function(t){var e=new to(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},Tn.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=n.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new v(s),!1)}},Tn.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=V.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(n._seg.p0=e.get(s),n._seg.p1=e.get(s+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<i&&(i=a,o=s)}return o},Tn.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var _t=function(t){this._srcGeom=t||null},au={SNAP_PRECISION_FACTOR:{configurable:!0}};_t.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new uu(e,n);return i.transform(this._srcGeom)},_t.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new uu(t,n,!0),o=i.transform(this._srcGeom),s=o;return e&&k(s,sr)&&(s=o.buffer(0)),s},_t.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},_t.prototype.extractTargetCoordinates=function(t){for(var e=new un,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},_t.prototype.computeMinimumSegmentLength=function(t){for(var e=V.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.snap=function(t,e,n){var i=new Array(2).fill(null),o=new _t(t);i[0]=o.snapTo(e,n);var s=new _t(e);return i[1]=s.snapTo(i[0],n),i},_t.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=_t.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===J.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(_t.computeOverlaySnapTolerance(o),_t.computeOverlaySnapTolerance(s))}},_t.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*_t.SNAP_PRECISION_FACTOR;return i},_t.snapToSelf=function(t,e,n){var i=new _t(t);return i.snapToSelf(e,n)},au.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(_t,au);var uu=function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var o=new Tn(n,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var o=n.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fe),re=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};re.prototype.getCommon=function(){return V.longBitsToDouble(this._commonBits)},re.prototype.add=function(t){var e=V.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=re.signExpBits(this._commonBits),this._isFirst=!1,null;var n=re.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=re.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=re.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},re.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=V.longBitsToDouble(t),n=V.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.getBit=function(t,e){var n=1<<e;return t&n?1:0},re.signExpBits=function(t){return t>>52},re.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,o=t&i;return o},re.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(re.getBit(t,i)!==re.getBit(e,i))return n;n++}return 52};var pr=function(){this._commonCoord=null,this._ccFilter=new ii},Bs={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};pr.prototype.addCommonBits=function(t){var e=new dr(this._commonCoord);t.apply(e),t.geometryChanged()},pr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new v(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new dr(e);return t.apply(n),t.geometryChanged(),t},pr.prototype.getCommonCoordinate=function(){return this._commonCoord},pr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},Bs.CommonCoordinateFilter.get=function(){return ii},Bs.Translater.get=function(){return dr},Object.defineProperties(pr,Bs);var ii=function(){this._commonBitsX=new re,this._commonBitsY=new re};ii.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ii.prototype.getCommonCoordinate=function(){return new v(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ii.prototype.interfaces_=function(){return[xn]},ii.prototype.getClass=function(){return ii};var dr=function(){this.trans=null;var t=arguments[0];this.trans=t};dr.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},dr.prototype.isDone=function(){return!1},dr.prototype.isGeometryChanged=function(){return!0},dr.prototype.interfaces_=function(){return[Ye]},dr.prototype.getClass=function(){return dr};var Mt=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()};Mt.prototype.selfSnap=function(t){var e=new _t(t),n=e.snapTo(t,this._snapTolerance);return n},Mt.prototype.removeCommonBits=function(t){this._cbr=new pr,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},Mt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Mt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=U.overlayOp(e[0],e[1],t);return this.prepareResult(n)},Mt.prototype.checkValid=function(t){t.isValid()||At.out.println("Snapped geometry is invalid")},Mt.prototype.computeSnapTolerance=function(){this._snapTolerance=_t.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Mt.prototype.snap=function(t){var e=this.removeCommonBits(t),n=_t.snap(e[0],e[1],this._snapTolerance);return n},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.overlayOp=function(t,e,n){var i=new Mt(t,e);return i.getResultGeometry(n)},Mt.union=function(t,e){return Mt.overlayOp(t,e,U.UNION)},Mt.intersection=function(t,e){return Mt.overlayOp(t,e,U.INTERSECTION)},Mt.symDifference=function(t,e){return Mt.overlayOp(t,e,U.SYMDIFFERENCE)},Mt.difference=function(t,e){return Mt.overlayOp(t,e,U.DIFFERENCE)};var ie=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ie.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=U.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(n=!0)}catch(s){if(s instanceof zn)i=s;else throw s}finally{}if(!n)try{e=Mt.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof zn?i:s}finally{}return e},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},ie.overlayOp=function(t,e,n){var i=new ie(t,e);return i.getResultGeometry(n)},ie.union=function(t,e){return ie.overlayOp(t,e,U.UNION)},ie.intersection=function(t,e){return ie.overlayOp(t,e,U.INTERSECTION)},ie.symDifference=function(t,e){return ie.overlayOp(t,e,U.SYMDIFFERENCE)},ie.difference=function(t,e){return ie.overlayOp(t,e,U.DIFFERENCE)};var vo=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};vo.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo};var ve=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=o}},Gs={INSERT:{configurable:!0},DELETE:{configurable:!0}};ve.prototype.isDelete=function(){return this._eventType===ve.DELETE},ve.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ve.prototype.getObject=function(){return this._obj},ve.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},ve.prototype.getInsertEvent=function(){return this._insertEvent},ve.prototype.isInsert=function(){return this._eventType===ve.INSERT},ve.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},ve.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ve.prototype.interfaces_=function(){return[Re]},ve.prototype.getClass=function(){return ve},Gs.INSERT.get=function(){return 1},Gs.DELETE.get=function(){return 2},Object.defineProperties(ve,Gs);var Yo=function(){};Yo.prototype.interfaces_=function(){return[]},Yo.prototype.getClass=function(){return Yo};var Vt=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],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Vt.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Vt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Vt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Vt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Vt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Vt.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},Vt.prototype.hasProperIntersection=function(){return this._hasProper},Vt.prototype.hasIntersection=function(){return this._hasIntersection},Vt.prototype.isDone=function(){return this._isDone},Vt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Vt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Vt.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var mc=function(r){function t(){r.call(this),this.events=new L,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;We.sort(this.events);for(var i=0;i<this.events.size();i++){var o=n.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=n.events.get(o);if(s.isInsert()&&n.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Vt&&k(arguments[0],qe)&&k(arguments[1],qe)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&k(arguments[0],qe)&&arguments[1]instanceof Vt){var c=arguments[0],f=arguments[1],h=arguments[2];h?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(n,i){for(var o=this,s=n.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new vo(s,u),c=new ve(i,s.getMinX(u),l);o.events.add(c),o.events.add(new ve(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(n,i,o,s){for(var a=this,u=o.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();n.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Yo),Mn=function(){this._min=V.POSITIVE_INFINITY,this._max=V.NEGATIVE_INFINITY},lu={NodeComparator:{configurable:!0}};Mn.prototype.getMin=function(){return this._min},Mn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Mn.prototype.getMax=function(){return this._max},Mn.prototype.toString=function(){return Ue.toLineString(new v(this._min,0),new v(this._max,0))},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},lu.NodeComparator.get=function(){return yo},Object.defineProperties(Mn,lu);var yo=function(){};yo.prototype.compare=function(t,e){var n=t,i=e,o=(n._min+n._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0},yo.prototype.interfaces_=function(){return[di]},yo.prototype.getClass=function(){return yo};var _c=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mn),Ec=function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,o),this._node2!==null&&this._node2.query(n,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mn),An=function(){this._leaves=new L,this._root=null,this._level=0};An.prototype.buildTree=function(){var t=this;We.sort(this._leaves,new Mn.NodeComparator);for(var e=this._leaves,n=null,i=new L;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},An.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new _c(t,e,n))},An.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},An.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},An.prototype.printNode=function(t){At.out.println(Ue.toLineString(new v(t._min,this._level),new v(t._max,this._level)))},An.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},An.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),o=n+1<t.size()?t.get(n):null;if(o===null)e.add(i);else{var s=new Ec(t.get(n),t.get(n+1));e.add(s)}}},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var Ti=function(){this._items=new L};Ti.prototype.visitItem=function(t){this._items.add(t)},Ti.prototype.getItems=function(){return this._items},Ti.prototype.interfaces_=function(){return[ar]},Ti.prototype.getClass=function(){return Ti};var Mi=function(){this._index=null;var t=arguments[0];if(!k(t,sr))throw new lt("Argument must be Polygonal");this._index=new Dr(t)},ks={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Mi.prototype.locate=function(t){var e=new an(t),n=new Ai(e);return this._index.query(t.y,t.y,n),e.getLocation()},Mi.prototype.interfaces_=function(){return[Ri]},Mi.prototype.getClass=function(){return Mi},ks.SegmentVisitor.get=function(){return Ai},ks.IntervalIndexedGeometry.get=function(){return Dr},Object.defineProperties(Mi,ks);var Ai=function(){this._counter=null;var t=arguments[0];this._counter=t};Ai.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ai.prototype.interfaces_=function(){return[ar]},Ai.prototype.getClass=function(){return Ai};var Dr=function(){this._index=new An;var t=arguments[0];this.init(t)};Dr.prototype.init=function(t){for(var e=this,n=Gt.getLines(t),i=n.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}},Dr.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new M(t[n-1],t[n]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}},Dr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Ti;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr};var mo=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Xa,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ke,arguments.length===2){var e=arguments[0],n=arguments[1],i=De.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=m.NONE;u=s.getLocation(n,S.ON),u===m.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(n,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Vt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Sn||this._parentGeom instanceof St||this._parentGeom instanceof wn,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,o){var s=new Vt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof he){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,m.INTERIOR)}else if(arguments[0]instanceof v){var o=arguments[0];this.insertPoint(this._argIndex,o,m.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),m.EXTERIOR,m.INTERIOR);for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o);i.addPolygonRing(s,m.INTERIOR,m.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],m.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],m.BOUNDARY)},t.prototype.addLineString=function(n){var i=Y.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Xo(i,new tt(this._argIndex,m.INTERIOR));this._lineEdgeMap.put(n,o),this.insertEdge(o),q.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),o=0,s=n.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,o){if(this.isBoundaryNode(n,i))return null;o===m.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,o)},t.prototype.addPolygonRing=function(n,i,o){if(n.isEmpty())return null;var s=Y.removeRepeatedPoints(n.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;P.isCCW(s)&&(a=o,u=i);var l=new Xo(s,new tt(this._argIndex,m.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],m.BOUNDARY)},t.prototype.insertPoint=function(n,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new tt(n,o):a.setLocation(n,o)},t.prototype.createEdgeSetIntersector=function(){return new mc},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(n),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof wn&&(this._useBoundaryDeterminationRule=!1),n instanceof St)this.addPolygon(n);else if(n instanceof gt)this.addLineString(n);else if(n instanceof he)this.addPoint(n);else if(n instanceof wi)this.addCollection(n);else if(n instanceof Sr)this.addCollection(n);else if(n instanceof wn)this.addCollection(n);else if(n instanceof Jt)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,o=0;o<n.getNumGeometries();o++){var s=n.getGeometryN(o);i.add(s)}},t.prototype.locate=function(n){return k(this._parentGeom,sr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Mi(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?m.BOUNDARY:m.INTERIOR},t}(ht),Fi=function(){if(this._li=new Cr,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 mo(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=De.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new mo(0,e,i),this._arg[1]=new mo(1,n,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new mo(0,o,a),this._arg[1]=new mo(1,s,a)}};Fi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Fi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi};var Tr=function(){};Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.map=function(){if(arguments[0]instanceof G&&k(arguments[1],Tr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new L,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&n.add(o)}return t.getFactory().buildGeometry(n)}else if(k(arguments[0],xt)&&k(arguments[1],Tr.MapOp)){for(var s=arguments[0],a=arguments[1],u=new L,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}},Tr.MapOp=function(){};var U=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new Ke,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new je,this._resultPolyList=new L,this._resultLineList=new L,this._resultPointList=new L,this._graph=new ht(new tu),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var o=i.getLabel(),s=n.getLabel();i.isPointwiseEqual(n)||(s=new tt(n.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,o,s){var a=new L;return a.addAll(n),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(n,a);if(u!==m.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new L,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),n.add(o.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,o=n.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(n){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 i=new L;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Or.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var o=new ge(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new En(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(n);var a=new ri(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var o=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(n){for(var i=this,o=this._arg[n].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(n,s.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,S.RIGHT),s.getLocation(1,S.RIGHT),n)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(q.isTrue(!s.isNull(a,S.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,S.LEFT,s.getLocation(a,S.LEFT)),q.isTrue(!s.isNull(a,S.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,S.RIGHT,s.getLocation(a,S.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?n.labelIncompleteNode(o,0):n.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fi);U.overlayOp=function(r,t,e){var n=new U(r,t),i=n.getResultGeometry(e);return i},U.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return U.createEmptyResult(U.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return ni.map(r,{interfaces_:function(){return[Tr.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ie.overlayOp(r,t,U.INTERSECTION)},U.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return U.createEmptyResult(U.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ie.overlayOp(r,t,U.SYMDIFFERENCE)},U.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),o=-1;switch(r){case U.INTERSECTION:o=Math.min(n,i);break;case U.UNION:o=Math.max(n,i);break;case U.DIFFERENCE:o=n;break;case U.SYMDIFFERENCE:o=Math.max(n,i);break}return o},U.createEmptyResult=function(r,t,e,n){var i=null;switch(U.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},U.difference=function(r,t){return r.isEmpty()?U.createEmptyResult(U.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ie.overlayOp(r,t,U.DIFFERENCE))},U.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return U.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===m.BOUNDARY&&(i=m.INTERIOR),o===m.BOUNDARY&&(o=m.INTERIOR),s){case U.INTERSECTION:return i===m.INTERIOR&&o===m.INTERIOR;case U.UNION:return i===m.INTERIOR||o===m.INTERIOR;case U.DIFFERENCE:return i===m.INTERIOR&&o!==m.INTERIOR;case U.SYMDIFFERENCE:return i===m.INTERIOR&&o!==m.INTERIOR||i!==m.INTERIOR&&o===m.INTERIOR}return!1}},U.INTERSECTION=1,U.UNION=2,U.DIFFERENCE=3,U.SYMDIFFERENCE=4;var vr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ke,this._seg=new M;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};vr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},vr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?m.BOUNDARY:this._ptLocator.locate(t,this._g)},vr.prototype.extractLinework=function(t){var e=new Bi;t.apply(e);var n=e.getLinework(),i=H.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr};var Bi=function(){this._linework=null,this._linework=new L};Bi.prototype.getLinework=function(){return this._linework},Bi.prototype.filter=function(t){var e=this;if(t instanceof St){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},Bi.prototype.interfaces_=function(){return[ln]},Bi.prototype.getClass=function(){return Bi};var Mr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Mr.prototype.extractPoints=function(t,e,n){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,n)},Mr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Mr.prototype.getPoints=function(t){for(var e=this,n=new L,i=Gt.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,n)}return n},Mr.prototype.computeOffsetPoints=function(t,e,n,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=n*o/a,l=n*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var h=new v(c-l,f+u);i.add(h)}if(this._doRight){var g=new v(c+l,f-u);i.add(g)}},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var we=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new L;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new vr(this._geom[0],this._boundaryDistanceTolerance),new vr(this._geom[1],this._boundaryDistanceTolerance),new vr(this._geom[2],this._boundaryDistanceTolerance)]},cu={TOLERANCE:{configurable:!0}};we.prototype.reportResult=function(t,e,n){At.out.println("Overlay result invalid - A:"+m.toLocationSymbol(e[0])+" B:"+m.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+m.toLocationSymbol(e[2]))},we.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},we.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),we.hasLocation(this._location,m.BOUNDARY)?!0:this.isValidResult(o,this._location)}},we.prototype.addTestPts=function(t){var e=new Mr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},we.prototype.isValidResult=function(t,e){var n=U.isResultOfOp(e[0],e[1],t),i=e[2]===m.INTERIOR,o=!(n^i);return o||this.reportResult(t,e,n),o},we.prototype.getInvalidLocation=function(){return this._invalidLocation},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},we.computeBoundaryDistanceTolerance=function(t,e){return Math.min(_t.computeSizeBasedSnapTolerance(t),_t.computeSizeBasedSnapTolerance(e))},we.isValid=function(t,e,n,i){var o=new we(t,e,i);return o.isValid(n)},cu.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(we,cu);var Le=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};Le.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);n._skipEmpty&&o.isEmpty()||e.add(o)}},Le.prototype.combine=function(){for(var t=this,e=new L,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Le(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Le(Le.createList(n,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new Le(Le.createList(s,a,u));return l.combine()}},Le.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Le.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new L;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new L;return a.add(i),a.add(o),a.add(s),a}};var Nt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new L)},fu={STRTREE_NODE_CAPACITY:{configurable:!0}};Nt.prototype.reduceToGeometries=function(t){for(var e=this,n=new L,i=t.iterator();i.hasNext();){var o=i.next(),s=null;k(o,qe)?s=e.unionTree(o):o instanceof G&&(s=o),n.add(s)}return n},Nt.prototype.extractByEnvelope=function(t,e,n){for(var i=new L,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):n.add(s)}return this._geomFactory.buildGeometry(i)},Nt.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var o=Le.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)},Nt.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 ja(Nt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},Nt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var o=Nt.getGeometry(e,n);return this.unionSafe(o,null)}else{if(i-n===2)return this.unionSafe(Nt.getGeometry(e,n),Nt.getGeometry(e,n+1));var s=Math.trunc((i+n)/2),a=this.binaryUnion(e,n,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}},Nt.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},Nt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Nt.prototype.unionActual=function(t,e){return Nt.restrictToPolygons(t.union(e))},Nt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},Nt.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new L,o=this.extractByEnvelope(n,t,i),s=this.extractByEnvelope(n,e,i),a=this.unionActual(o,s);i.add(a);var u=Le.combine(i);return u},Nt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.restrictToPolygons=function(t){if(k(t,sr))return t;var e=Qn.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(H.toPolygonArray(e))},Nt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Nt.union=function(t){var e=new Nt(t);return e.union()},fu.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Nt,fu);var Ho=function(){};Ho.prototype.interfaces_=function(){return[]},Ho.prototype.getClass=function(){return Ho},Ho.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return U.createEmptyResult(U.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ie.overlayOp(t,e,U.UNION)};function Ar(){return new Wo}function Wo(){this.reset()}Wo.prototype={constructor:Wo,reset:function(){this.s=this.t=0},add:function(r){hu(jo,r,this.t),hu(this,jo.s,this.s),this.s?this.t+=jo.t:this.s=jo.t},valueOf:function(){return this.s}};var jo=new Wo;function hu(r,t,e){var n=r.s=t+e,i=n-t,o=n-i;r.t=t-o+(e-i)}var dt=1e-6,rt=Math.PI,Jn=rt/2,gu=rt/4,Zn=rt*2,Fr=180/rt,In=rt/180,oe=Math.abs,Ic=Math.atan,Gi=Math.atan2,Lt=Math.cos,bt=Math.sin,_o=Math.sqrt;function pu(r){return r>1?0:r<-1?rt:Math.acos(r)}function ki(r){return r>1?Jn:r<-1?-Jn:Math.asin(r)}function Eo(){}function Ko(r,t){r&&vu.hasOwnProperty(r.type)&&vu[r.type](r,t)}var du={Feature:function(r,t){Ko(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)Ko(e[n].geometry,t)}},vu={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){zs(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)zs(e[n],t,0)},Polygon:function(r,t){yu(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)yu(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)Ko(e[n],t)}};function zs(r,t,e){var n=-1,i=r.length-e,o;for(t.lineStart();++n<i;)o=r[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function yu(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)zs(r[e],t,1);t.polygonEnd()}function Cc(r,t){r&&du.hasOwnProperty(r.type)?du[r.type](r,t):Ko(r,t)}Ar(),Ar();function Vs(r){return[Gi(r[1],r[0]),ki(r[2])]}function zi(r){var t=r[0],e=r[1],n=Lt(e);return[n*Lt(t),n*bt(t),bt(e)]}function Qo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function Jo(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function Us(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function Zo(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function qs(r){var t=_o(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}Ar();function mu(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function Xs(r,t){return[r>rt?r-Zn:r<-rt?r+Zn:r,t]}Xs.invert=Xs;function Nc(r,t,e){return(r%=Zn)?t||e?mu(Eu(r),Iu(t,e)):Eu(r):t||e?Iu(t,e):Xs}function _u(r){return function(t,e){return t+=r,[t>rt?t-Zn:t<-rt?t+Zn:t,e]}}function Eu(r){var t=_u(r);return t.invert=_u(-r),t}function Iu(r,t){var e=Lt(r),n=bt(r),i=Lt(t),o=bt(t);function s(a,u){var l=Lt(u),c=Lt(a)*l,f=bt(a)*l,h=bt(u),g=h*e+c*n;return[Gi(f*i-g*o,c*e-h*n),ki(g*i+f*o)]}return s.invert=function(a,u){var l=Lt(u),c=Lt(a)*l,f=bt(a)*l,h=bt(u),g=h*i-f*o;return[Gi(f*i+h*o,c*e+g*n),ki(g*e-c*n)]},s}function xc(r,t,e,n,i,o){if(e){var s=Lt(t),a=bt(t),u=n*e;i==null?(i=t+n*Zn,o=t-u/2):(i=Cu(s,i),o=Cu(s,o),(n>0?i<o:i>o)&&(i+=n*Zn));for(var l,c=i;n>0?c>o:c<o;c-=u)l=Vs([s,-a*Lt(c),-a*bt(c)]),r.point(l[0],l[1])}}function Cu(r,t){t=zi(t),t[0]-=r,qs(t);var e=pu(-t[1]);return((-t[2]<0?-e:e)+Zn-dt)%Zn}function Nu(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:Eo,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function Sc(r,t,e,n,i,o){var s=r[0],a=r[1],u=t[0],l=t[1],c=0,f=1,h=u-s,g=l-a,p;if(p=e-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}if(p=n-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<f&&(f=p)}return c>0&&(r[0]=s+c*h,r[1]=a+c*g),f<1&&(t[0]=s+f*h,t[1]=a+f*g),!0}}}}}function $o(r,t){return oe(r[0]-t[0])<dt&&oe(r[1]-t[1])<dt}function ts(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function xu(r,t,e,n,i){var o=[],s=[],a,u;if(r.forEach(function(p){if(!((_=p.length-1)<=0)){var _,d=p[0],y=p[_],C;if($o(d,y)){for(i.lineStart(),a=0;a<_;++a)i.point((d=p[a])[0],d[1]);i.lineEnd();return}o.push(C=new ts(d,p,null,!0)),s.push(C.o=new ts(d,null,C,!1)),o.push(C=new ts(y,p,null,!1)),s.push(C.o=new ts(y,null,C,!0))}}),!!o.length){for(s.sort(t),Su(o),Su(s),a=0,u=s.length;a<u;++a)s[a].e=e=!e;for(var l=o[0],c,f;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((f=c[a])[0],f[1]);else n(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((f=c[a])[0],f[1]);else n(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function Su(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function wu(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function wc(r){return r.length===1&&(r=Lc(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)<0?n=o+1:i=o}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)>0?i=o:n=o+1}return n}}}function Lc(r){return function(t,e){return wu(r(t),e)}}wc(wu);function Lu(r){for(var t=r.length,e,n=-1,i=0,o,s;++n<t;)i+=r[n].length;for(o=new Array(i);--t>=0;)for(s=r[t],e=s.length;--e>=0;)o[--i]=s[e];return o}var Io=1e9,es=-Io;function bc(r,t,e,n){function i(l,c){return r<=l&&l<=e&&t<=c&&c<=n}function o(l,c,f,h){var g=0,p=0;if(l==null||(g=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do h.point(g===0||g===3?r:e,g>1?n:t);while((g=(g+f+4)%4)!==p);else h.point(c[0],c[1])}function s(l,c){return oe(l[0]-r)<dt?c>0?0:3:oe(l[0]-e)<dt?c>0?2:1:oe(l[1]-t)<dt?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),h=s(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=Nu(),h,g,p,_,d,y,C,I,N,w,b,A={point:F,lineStart:X,lineEnd:it,polygonStart:R,polygonEnd:z};function F(W,at){i(W,at)&&c.point(W,at)}function D(){for(var W=0,at=0,Pt=g.length;at<Pt;++at)for(var jt=g[at],ye=1,si=jt.length,Bn=jt[0],$n,me,nt=Bn[0],Ot=Bn[1];ye<si;++ye)$n=nt,me=Ot,Bn=jt[ye],nt=Bn[0],Ot=Bn[1],me<=n?Ot>n&&(nt-$n)*(n-me)>(Ot-me)*(r-$n)&&++W:Ot<=n&&(nt-$n)*(n-me)<(Ot-me)*(r-$n)&&--W;return W}function R(){c=f,h=[],g=[],b=!0}function z(){var W=D(),at=b&&W,Pt=(h=Lu(h)).length;(at||Pt)&&(l.polygonStart(),at&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),Pt&&xu(h,a,W,o,l),l.polygonEnd()),c=l,h=g=p=null}function X(){A.point=O,g&&g.push(p=[]),w=!0,N=!1,C=I=NaN}function it(){h&&(O(_,d),y&&N&&f.rejoin(),h.push(f.result())),A.point=F,N&&c.lineEnd()}function O(W,at){var Pt=i(W,at);if(g&&p.push([W,at]),w)_=W,d=at,y=Pt,w=!1,Pt&&(c.lineStart(),c.point(W,at));else if(Pt&&N)c.point(W,at);else{var jt=[C=Math.max(es,Math.min(Io,C)),I=Math.max(es,Math.min(Io,I))],ye=[W=Math.max(es,Math.min(Io,W)),at=Math.max(es,Math.min(Io,at))];Sc(jt,ye,r,t,e,n)?(N||(c.lineStart(),c.point(jt[0],jt[1])),c.point(ye[0],ye[1]),Pt||c.lineEnd(),b=!1):Pt&&(c.lineStart(),c.point(W,at),b=!1)}C=W,I=at,N=Pt}return A}}var Ys=Ar();function Pc(r,t){var e=t[0],n=t[1],i=[bt(e),-Lt(e),0],o=0,s=0;Ys.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,f=l[c-1],h=f[0],g=f[1]/2+gu,p=bt(g),_=Lt(g),d=0;d<c;++d,h=C,p=N,_=w,f=y){var y=l[d],C=y[0],I=y[1]/2+gu,N=bt(I),w=Lt(I),b=C-h,A=b>=0?1:-1,F=A*b,D=F>rt,R=p*N;if(Ys.add(Gi(R*A*bt(F),_*w+R*Lt(F))),o+=D?b+A*Zn:b,D^h>=e^C>=e){var z=Jo(zi(f),zi(y));qs(z);var X=Jo(i,z);qs(X);var it=(D^b>=0?-1:1)*ki(X[2]);(n>it||n===it&&(z[0]||z[1]))&&(s+=D^b>=0?1:-1)}}return(o<-dt||o<dt&&Ys<-dt)^s&1}Ar();function bu(r){return r}Ar(),Ar();var Vi=1/0,ns=Vi,Co=-Vi,rs=Co,Pu={point:Rc,lineStart:Eo,lineEnd:Eo,polygonStart:Eo,polygonEnd:Eo,result:function(){var r=[[Vi,ns],[Co,rs]];return Co=rs=-(ns=Vi=1/0),r}};function Rc(r,t){r<Vi&&(Vi=r),r>Co&&(Co=r),t<ns&&(ns=t),t>rs&&(rs=t)}Ar();function Ru(r,t,e,n){return function(i,o){var s=t(o),a=i.invert(n[0],n[1]),u=Nu(),l=t(u),c=!1,f,h,g,p={point:_,lineStart:y,lineEnd:C,polygonStart:function(){p.point=I,p.lineStart=N,p.lineEnd=w,h=[],f=[]},polygonEnd:function(){p.point=_,p.lineStart=y,p.lineEnd=C,h=Lu(h);var b=Pc(f,a);h.length?(c||(o.polygonStart(),c=!0),xu(h,Dc,b,e,o)):b&&(c||(o.polygonStart(),c=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function _(b,A){var F=i(b,A);r(b=F[0],A=F[1])&&o.point(b,A)}function d(b,A){var F=i(b,A);s.point(F[0],F[1])}function y(){p.point=d,s.lineStart()}function C(){p.point=_,s.lineEnd()}function I(b,A){g.push([b,A]);var F=i(b,A);l.point(F[0],F[1])}function N(){l.lineStart(),g=[]}function w(){I(g[0][0],g[0][1]),l.lineEnd();var b=l.clean(),A=u.result(),F,D=A.length,R,z,X;if(g.pop(),f.push(g),g=null,!!D){if(b&1){if(z=A[0],(R=z.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),F=0;F<R;++F)o.point((X=z[F])[0],X[1]);o.lineEnd()}return}D>1&&b&2&&A.push(A.pop().concat(A.shift())),h.push(A.filter(Oc))}}return p}}function Oc(r){return r.length>1}function Dc(r,t){return((r=r.x)[0]<0?r[1]-Jn-dt:Jn-r[1])-((t=t.x)[0]<0?t[1]-Jn-dt:Jn-t[1])}const Ou=Ru(function(){return!0},Tc,Ac,[-rt,-Jn]);function Tc(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(o,s){var a=o>0?rt:-rt,u=oe(o-t);oe(u-rt)<dt?(r.point(t,e=(e+s)/2>0?Jn:-Jn),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),r.point(o,e),i=0):n!==a&&u>=rt&&(oe(t-n)<dt&&(t-=n*dt),oe(o-a)<dt&&(o-=a*dt),e=Mc(t,e,o,s),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),i=0),r.point(t=o,e=s),n=a},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function Mc(r,t,e,n){var i,o,s=bt(r-e);return oe(s)>dt?Ic((bt(t)*(o=Lt(n))*bt(e)-bt(n)*(i=Lt(t))*bt(r))/(i*o*s)):(t+n)/2}function Ac(r,t,e,n){var i;if(r==null)i=e*Jn,n.point(-rt,i),n.point(0,i),n.point(rt,i),n.point(rt,0),n.point(rt,-i),n.point(0,-i),n.point(-rt,-i),n.point(-rt,0),n.point(-rt,i);else if(oe(r[0]-t[0])>dt){var o=r[0]<t[0]?rt:-rt;i=e*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])}function Fc(r,t){var e=Lt(r),n=e>0,i=oe(e)>dt;function o(c,f,h,g){xc(g,r,t,h,c,f)}function s(c,f){return Lt(c)*Lt(f)>e}function a(c){var f,h,g,p,_;return{lineStart:function(){p=g=!1,_=1},point:function(d,y){var C=[d,y],I,N=s(d,y),w=n?N?0:l(d,y):N?l(d+(d<0?rt:-rt),y):0;if(!f&&(p=g=N)&&c.lineStart(),N!==g&&(I=u(f,C),(!I||$o(f,I)||$o(C,I))&&(C[0]+=dt,C[1]+=dt,N=s(C[0],C[1]))),N!==g)_=0,N?(c.lineStart(),I=u(C,f),c.point(I[0],I[1])):(I=u(f,C),c.point(I[0],I[1]),c.lineEnd()),f=I;else if(i&&f&&n^N){var b;!(w&h)&&(b=u(C,f,!0))&&(_=0,n?(c.lineStart(),c.point(b[0][0],b[0][1]),c.point(b[1][0],b[1][1]),c.lineEnd()):(c.point(b[1][0],b[1][1]),c.lineEnd(),c.lineStart(),c.point(b[0][0],b[0][1])))}N&&(!f||!$o(f,C))&&c.point(C[0],C[1]),f=C,g=N,h=w},lineEnd:function(){g&&c.lineEnd(),f=null},clean:function(){return _|(p&&g)<<1}}}function u(c,f,h){var g=zi(c),p=zi(f),_=[1,0,0],d=Jo(g,p),y=Qo(d,d),C=d[0],I=y-C*C;if(!I)return!h&&c;var N=e*y/I,w=-e*C/I,b=Jo(_,d),A=Zo(_,N),F=Zo(d,w);Us(A,F);var D=b,R=Qo(A,D),z=Qo(D,D),X=R*R-z*(Qo(A,A)-1);if(!(X<0)){var it=_o(X),O=Zo(D,(-R-it)/z);if(Us(O,A),O=Vs(O),!h)return O;var W=c[0],at=f[0],Pt=c[1],jt=f[1],ye;at<W&&(ye=W,W=at,at=ye);var si=at-W,Bn=oe(si-rt)<dt,$n=Bn||si<dt;if(!Bn&&jt<Pt&&(ye=Pt,Pt=jt,jt=ye),$n?Bn?Pt+jt>0^O[1]<(oe(O[0]-W)<dt?Pt:jt):Pt<=O[1]&&O[1]<=jt:si>rt^(W<=O[0]&&O[0]<=at)){var me=Zo(D,(-R+it)/z);return Us(me,A),[O,Vs(me)]}}}function l(c,f){var h=n?r:rt-r,g=0;return c<-h?g|=1:c>h&&(g|=2),f<-h?g|=4:f>h&&(g|=8),g}return Ru(s,a,o,n?[0,-r]:[-rt,r-rt])}function Du(r){return function(t){var e=new Hs;for(var n in r)e[n]=r[n];return e.stream=t,e}}function Hs(){}Hs.prototype={constructor:Hs,point:function(r,t){this.stream.point(r,t)},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()}};function Tu(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o!=null&&r.clipExtent(null),Cc(e,r.stream(Pu));var s=Pu.result(),a=Math.min(n/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+t[0][0]+(n-a*(s[1][0]+s[0][0]))/2,l=+t[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&r.clipExtent(o),r.scale(a*150).translate([u,l])}function Bc(r,t,e){return Tu(r,[[0,0],t],e)}var Mu=16,Gc=Lt(30*In);function Au(r,t){return+t?zc(r,t):kc(r)}function kc(r){return Du({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function zc(r,t){function e(n,i,o,s,a,u,l,c,f,h,g,p,_,d){var y=l-n,C=c-i,I=y*y+C*C;if(I>4*t&&_--){var N=s+h,w=a+g,b=u+p,A=_o(N*N+w*w+b*b),F=ki(b/=A),D=oe(oe(b)-1)<dt||oe(o-f)<dt?(o+f)/2:Gi(w,N),R=r(D,F),z=R[0],X=R[1],it=z-n,O=X-i,W=C*it-y*O;(W*W/I>t||oe((y*it+C*O)/I-.5)>.3||s*h+a*g+u*p<Gc)&&(e(n,i,o,s,a,u,z,X,D,N/=A,w/=A,b,_,d),d.point(z,X),e(z,X,D,N,w,b,l,c,f,h,g,p,_,d))}}return function(n){var i,o,s,a,u,l,c,f,h,g,p,_,d={point:y,lineStart:C,lineEnd:N,polygonStart:function(){n.polygonStart(),d.lineStart=w},polygonEnd:function(){n.polygonEnd(),d.lineStart=C}};function y(F,D){F=r(F,D),n.point(F[0],F[1])}function C(){f=NaN,d.point=I,n.lineStart()}function I(F,D){var R=zi([F,D]),z=r(F,D);e(f,h,c,g,p,_,f=z[0],h=z[1],c=F,g=R[0],p=R[1],_=R[2],Mu,n),n.point(f,h)}function N(){d.point=y,n.lineEnd()}function w(){C(),d.point=b,d.lineEnd=A}function b(F,D){I(i=F,D),o=f,s=h,a=g,u=p,l=_,d.point=I}function A(){e(f,h,c,g,p,_,o,s,i,a,u,l,Mu,n),d.lineEnd=N,N()}return d}}var Vc=Du({point:function(r,t){this.stream.point(r*In,t*In)}});function Uc(r){return qc(function(){return r})()}function qc(r){var t,e=150,n=480,i=250,o,s,a=0,u=0,l=0,c=0,f=0,h,g,p=null,_=Ou,d=null,y,C,I,N=bu,w=.5,b=Au(z,w),A,F;function D(O){return O=g(O[0]*In,O[1]*In),[O[0]*e+o,s-O[1]*e]}function R(O){return O=g.invert((O[0]-o)/e,(s-O[1])/e),O&&[O[0]*Fr,O[1]*Fr]}function z(O,W){return O=t(O,W),[O[0]*e+o,s-O[1]*e]}D.stream=function(O){return A&&F===O?A:A=Vc(_(h,b(N(F=O))))},D.clipAngle=function(O){return arguments.length?(_=+O?Fc(p=O*In,6*In):(p=null,Ou),it()):p*Fr},D.clipExtent=function(O){return arguments.length?(N=O==null?(d=y=C=I=null,bu):bc(d=+O[0][0],y=+O[0][1],C=+O[1][0],I=+O[1][1]),it()):d==null?null:[[d,y],[C,I]]},D.scale=function(O){return arguments.length?(e=+O,X()):e},D.translate=function(O){return arguments.length?(n=+O[0],i=+O[1],X()):[n,i]},D.center=function(O){return arguments.length?(a=O[0]%360*In,u=O[1]%360*In,X()):[a*Fr,u*Fr]},D.rotate=function(O){return arguments.length?(l=O[0]%360*In,c=O[1]%360*In,f=O.length>2?O[2]%360*In:0,X()):[l*Fr,c*Fr,f*Fr]},D.precision=function(O){return arguments.length?(b=Au(z,w=O*O),it()):_o(w)},D.fitExtent=function(O,W){return Tu(D,O,W)},D.fitSize=function(O,W){return Bc(D,O,W)};function X(){g=mu(h=Nc(l,c,f),t);var O=t(a,u);return o=n-O[0]*e,s=i+O[1]*e,it()}function it(){return A=F=null,D}return function(){return t=r.apply(this,arguments),D.invert=t.invert&&R,X()}}function Xc(r){return function(t,e){var n=Lt(t),i=Lt(e),o=r(n*i);return[o*i*bt(t),o*bt(e)]}}function Yc(r){return function(t,e){var n=_o(t*t+e*e),i=r(n),o=bt(i),s=Lt(i);return[Gi(t*o,n*s),ki(n&&e*o/n)]}}var Fu=Xc(function(r){return(r=pu(r))&&r/bt(r)});Fu.invert=Yc(function(r){return r});function Hc(){return Uc(Fu).scale(79.4188).clipAngle(180-.001)}function Bu(r,t){return[r,t]}Bu.invert=Bu;function Wc(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(r.type){case"GeometryCollection":return Ma(r,function(s){var a=is(s,t,n,i);a&&o.push(a)}),Es(o);case"FeatureCollection":return Ta(r,function(s){var a=is(s,t,n,i);a&&Ta(a,function(u){u&&o.push(u)})}),Es(o)}return is(r,t,n,i)}function is(r,t,e,n){var i=r.properties||{},o=r.type==="Feature"?r.geometry:r;if(o.type==="GeometryCollection"){var s=[];return Ma(r,function(_){var d=is(_,t,e,n);d&&s.push(d)}),Es(s)}var a=jc(o),u={type:o.type,coordinates:ku(o.coordinates,a)},l=new Rs,c=l.read(u),f=Jl(Zl(t,e),"meters"),h=Bt.bufferOp(c,f,n),g=new Ha;if(h=g.write(h),!Gu(h.coordinates)){var p={type:h.type,coordinates:zu(h.coordinates,a)};return bo(p,i)}}function Gu(r){return Array.isArray(r[0])?Gu(r[0]):isNaN(r[0])}function ku(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return ku(e,t)})}function zu(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return zu(e,t)})}function jc(r){var t=rc(r).geometry.coordinates,e=[-t[0],-t[1]];return Hc().rotate(e).scale(Ee)}function Kc(r,t){var e=Po(r),n=Po(t),i=r.properties||{},o=La.difference(e.coordinates,n.coordinates);return o.length===0?null:o.length===1?Pa(o[0],i):Ra(o,i)}function Vu(r){let t;for(const e of r)t&&e[0]-t[0]>=180?e[0]-=360:t&&e[0]-t[0]<-180&&(e[0]+=360),t=e}function Uu(r,t){const e=Kc({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},r);if(!e)return;e.properties={isMask:"y"};const n=Wc(r,0);if(n.geometry.type==="Polygon")for(const i of n.geometry.coordinates)Vu(i);else for(const i of n.geometry.coordinates)for(const o of i)Vu(o);t({type:"FeatureCollection",features:[n,e]})}function qu(r,t=!0,e=!0,n={},i={},o=s=>{var l,c,f;const a=(l=s==null?void 0:s.geometry)==null?void 0:l.type,u=(c=s==null?void 0:s.properties)!=null&&c.isMask?0:a==="LineString"||a==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(f=s==null?void 0:s.properties)!=null&&f.isMask?.1:0,weight:u,dashArray:[u,u],lineCap:"butt"}}){let s,a,u=[],l,c,f=$e.geoJSON(void 0,{style:o,interactive:!1}).addTo(r);const h=()=>{let d;const y=r.getZoom()>10?[(d=r.getCenter().wrap()).lng,d.lat]:void 0;a!==y&&(a=y,s==null||s({type:"proximityChange",proximity:y}))},g=d=>{s==null||s({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function p(d,y=!1){const C=document.createElement("div");return new nc({props:{displayIn:"leaflet"},target:C}),new $e.Marker(d,{interactive:y,icon:new $e.DivIcon({html:C,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(s=d,r.on("moveend",h),h(),r.on("click",g)):(r.off("moveend",h),s==null||s({type:"proximityChange",proximity:void 0}),s=void 0,r.off("click",g))},flyTo(d,y){r.flyTo([d[1],d[0]],y,{duration:2,...n})},fitBounds(d,y){r.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[y,y],duration:2,...i})},indicateReverse(d){r.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var C;if(!t)return;const y=d&&[d[1],d[0]];c?y?c.setLatLng(y):(c.remove(),c=void 0):y&&(c=(typeof t=="object"?new $e.Marker(y,t):p(y)).addTo(r),(C=c.getElement())==null||C.classList.add("marker-reverse"))},setMarkers(d,y){if(!t)return;function C(I){f.clearLayers(),I&&f.addData(I)}for(const I of u)I.remove();if(u.length=0,C(),y){let I=!1;if(y.geometry.type==="GeometryCollection"){const w=y.geometry.geometries.filter(b=>b.type==="Polygon"||b.type==="MultiPolygon");if(w.length>0){let b=w.pop();for(const A of w)b=$l(b,A);Uu({...y,geometry:b},C),I=!0}else{const b=y.geometry.geometries.filter(A=>A.type==="LineString"||A.type==="MultiLineString");b.length>0&&(C({...y,geometry:{type:"GeometryCollection",geometries:b}}),I=!0)}}if(!I){if(y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")Uu(y,C);else if(y.geometry.type==="LineString"||y.geometry.type==="MultiLineString"){C(y);return}}const N=[y.center[1],y.center[0]];u.push((typeof t=="object"?new $e.Marker(N,t):p(N)).addTo(r))}if(e)for(const I of d??[]){if(I===y)continue;const N=[I.center[1],I.center[0]],w=typeof e=="object"?new $e.Marker(N,e):p(N,!0);w.addTo(r).bindTooltip(I.place_name.replace(/,.*/,""),{direction:"top"});const b=w.getElement();b&&(b.addEventListener("click",A=>{A.stopPropagation(),s==null||s({type:"markerClick",id:I.id})}),b.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:I.id})}),b.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:I.id})}),b.classList.toggle("marker-fuzzy",!!I.matching_text)),u.push(w)}},setSelectedMarker(d){var y,C;l&&((y=l.getElement())==null||y.classList.toggle("marker-selected",!1)),l=d>-1?u[d]:void 0,(C=l==null?void 0:l.getElement())==null||C.classList.toggle("marker-selected",!0)}}}class Xu extends $e.Control{constructor(e){super();Zs(this,Fn,void 0);Zs(this,oi,void 0);as(this,oi,e)}onAdd(e){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",$e.DomEvent.disableClickPropagation(n),$e.DomEvent.disableScrollPropagation(n);const{marker:i,showResultMarkers:o,flyTo:s,fullGeometryStyle:a,...u}=nr(this,oi),l=typeof s=="boolean"?{}:s,c=qu(e,i,o,l,l,a);as(this,Fn,new Ll({target:n,props:{mapController:c,flyTo:s===void 0?!0:!!s,...u}}));for(const f of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])nr(this,Fn).$on(f,h=>e.fire(f.toLowerCase(),h.detail));return n}setOptions(e){var u;as(this,oi,e);const{marker:n,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=nr(this,oi);(u=nr(this,Fn))==null||u.$set(a)}setQuery(e,n=!0){var i;(i=nr(this,Fn))==null||i.setQuery(e,n)}setReverseMode(e){var n;(n=nr(this,Fn))==null||n.$set({reverseActive:e})}focus(){var e;(e=nr(this,Fn))==null||e.focus()}blur(){var e;(e=nr(this,Fn))==null||e.blur()}onRemove(){var e;(e=nr(this,Fn))==null||e.$destroy()}}Fn=new WeakMap,oi=new WeakMap;function Qc(...r){return new Xu(...r)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Qc),Rt.GeocodingControl=Xu,Rt.createLeafletMapController=qu,Object.defineProperty(Rt,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
`)}return t.toString()},Kt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},Kt.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===m.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var h=m.NONE;if(n[f])h=m.EXTERIOR;else{var g=l.getCoordinate();h=e.getLocation(f,g,t)}c.setAllLocationsIfNull(f,h)}},Kt.prototype.getDegree=function(){return this._edgeMap.size()},Kt.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt};var Nc=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=n._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Kn("no outgoing dirEdge found",this.getCoordinate());U.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var o=n.get(0);if(i===1)return o;var s=n.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return rt.isNorthern(a)&&rt.isNorthern(u)?o:!rt.isNorthern(a)&&!rt.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(U.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){Gt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();n.print("out "),o.print(n),n.println(),n.print("in "),o.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new b;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&n._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,n.getLocation(0)),s.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=n._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(S.LEFT),a=i.getDepth(S.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Kn("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],h=arguments[2],g=h,p=c;p<f;p++){var y=n._edgeList.get(p);y.setEdgeDepths(S.RIGHT,g),g=y.getDepth(S.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===n&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(U.isTrue(o!==null,"found null for first outgoing dirEdge"),U.isTrue(o.getEdgeRing()===n,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&n++}return n}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=m.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){n=m.INTERIOR;break}if(s.isInResult()){n=m.EXTERIOR;break}}}if(n===m.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===m.INTERIOR):(l.isInResult()&&(a=m.EXTERIOR),c.isInResult()&&(a=m.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new et(m.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===m.INTERIOR||c===m.BOUNDARY)&&i._label.setLocation(l,m.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Kt),ru=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new Xo(n,new Nc)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ri),gr=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};gr.prototype.compareTo=function(t){var e=t,n=gr.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},gr.prototype.interfaces_=function(){return[Me]},gr.prototype.getClass=function(){return gr},gr.orientation=function(t){return H.increasingDirection(t)===1},gr.compareOriented=function(t,e,n,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?n.length:-1,l=e?0:t.length-1,c=i?0:n.length-1;;){var f=t[l].compareTo(n[c]);if(f!==0)return f;l+=o,c+=s;var h=l===a,g=c===u;if(h&&!g)return-1;if(!h&&g)return 1;if(h&&g)return 0}};var Qe=function(){this._edges=new b,this._ocaMap=new Wt};Qe.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")},Qe.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Qe.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Qe.prototype.iterator=function(){return this._edges.iterator()},Qe.prototype.getEdges=function(){return this._edges},Qe.prototype.get=function(t){return this._edges.get(t)},Qe.prototype.findEqualEdge=function(t){var e=new gr(t.getCoordinates()),n=this._ocaMap.get(e);return n},Qe.prototype.add=function(t){this._edges.add(t);var e=new gr(t.getCoordinates());this._ocaMap.put(e,t)},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var Ar=function(){};Ar.prototype.processIntersections=function(t,e,n,i){},Ar.prototype.isDone=function(){},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar};var be=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};be.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(be.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},be.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},be.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},be.prototype.getLineIntersector=function(){return this._li},be.prototype.hasProperIntersection=function(){return this._hasProper},be.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},be.prototype.hasIntersection=function(){return this._hasIntersection},be.prototype.isDone=function(){return!1},be.prototype.hasInteriorIntersection=function(){return this._hasInterior},be.prototype.interfaces_=function(){return[Ar]},be.prototype.getClass=function(){return be},be.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var yn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new v(t),this.segmentIndex=e,this.dist=n};yn.prototype.getSegmentIndex=function(){return this.segmentIndex},yn.prototype.getCoordinate=function(){return this.coord},yn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},yn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},yn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},yn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},yn.prototype.getDistance=function(){return this.dist},yn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},yn.prototype.interfaces_=function(){return[Me]},yn.prototype.getClass=function(){return yn};var Dn=function(){this._nodeMap=new Wt,this.edge=null;var t=arguments[0];this.edge=t};Dn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Dn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Dn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},Dn.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)},Dn.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n.edge.pts[l];return s&&(a[u]=e.coord),new Ho(a,new et(this.edge._label))},Dn.prototype.add=function(t,e,n){var i=new yn(t,e,n),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},Dn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn};var Fr=function(){};Fr.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new b;i.add(new sn(n));do{var o=e.findChainEnd(t,n);i.add(new sn(o)),n=o}while(n<t.length-1);var s=Fr.toIntArray(i);return s},Fr.prototype.findChainEnd=function(t,e){for(var n=rt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=rt.quadrant(t[i-1],t[i]);if(o!==n)break;i++}return i-1},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},Fr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Zn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new T,this.env2=new T;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Fr;this.startIndex=e.getChainStartIndices(this.pts)};Zn.prototype.getCoordinates=function(){return this.pts},Zn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Zn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Zn.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],h=this.pts[s],g=a.pts[u],p=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,h),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var y=Math.trunc((o+s)/2),d=Math.trunc((u+l)/2);o<y&&(u<d&&this.computeIntersectsForChain(o,y,a,u,d,c),d<l&&this.computeIntersectsForChain(o,y,a,d,l,c)),y<s&&(u<d&&this.computeIntersectsForChain(y,s,a,u,d,c),d<l&&this.computeIntersectsForChain(y,s,a,d,l,c))}},Zn.prototype.getStartIndexes=function(){return this.startIndex},Zn.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)n.computeIntersectsForChain(i,t,o,e)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var kt=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},iu={NULL_VALUE:{configurable:!0}};kt.prototype.getDepth=function(t,e){return this._depth[t][e]},kt.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},kt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==kt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===kt.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===kt.NULL_VALUE}},kt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>n&&(o=1),t._depth[e][i]=o}}},kt.prototype.getDelta=function(t){return this._depth[t][S.RIGHT]-this._depth[t][S.LEFT]},kt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?m.EXTERIOR:m.INTERIOR},kt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},kt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var o=e.getLocation(n,i);(o===m.EXTERIOR||o===m.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=kt.depthAtLocation(o):t._depth[n][i]+=kt.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===m.INTERIOR&&this._depth[s][a]++}},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.depthAtLocation=function(t){return t===m.EXTERIOR?0:t===m.INTERIOR?1:kt.NULL_VALUE},iu.NULL_VALUE.get=function(){return-1},Object.defineProperties(kt,iu);var Ho=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new Dn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new kt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,et.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var o=n;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&n.print(","),n.print(i.pts[o].x+" "+i.pts[o].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)n.print(i.pts[o]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Zn(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new T;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,o,s){var a=new v(n.getIntersection(s)),u=i,l=n.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var n=this,i=new on;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(n.pts[o].x+" "+n.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(n.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,o){for(var s=this,a=0;a<n.getIntersectionNum();a++)s.addIntersection(n,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,S.ON),n.getLocation(1,S.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,S.LEFT),n.getLocation(1,S.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,S.RIGHT),n.getLocation(1,S.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(Se),ne=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Qe,this._bufParams=t||null};ne.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},ne.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new et(t.getLabel()),i.flip()),n.merge(i);var o=ne.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(ne.depthDelta(t.getLabel()))},ne.prototype.buildSubgraphs=function(t,e){for(var n=new b,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new ri(n),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),n.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},ne.prototype.createSubgraphs=function(t){for(var e=new b,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var o=new te;o.create(i),e.add(o)}}return Ke.sort(e,Ke.reverseOrder()),e},ne.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},ne.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Ms,n=new Pr;return n.setPrecisionModel(t),e.setSegmentIntersector(new be(n)),e},ne.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new fe(n,this._bufParams),o=new ze(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,n),this._graph=new ht(new ru),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new de(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},ne.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Ho(a.getCoordinates(),new et(l));n.insertUniqueEdge(c)}}},ne.prototype.setNoder=function(t){this._workingNoder=t},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne},ne.depthDelta=function(t){var e=t.getLocation(0,S.LEFT),n=t.getLocation(0,S.RIGHT);return e===m.INTERIOR&&n===m.EXTERIOR?1:e===m.EXTERIOR&&n===m.INTERIOR?-1:0},ne.convertSegStrings=function(t){for(var e=new W,n=new b;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());n.add(o)}return e.buildGeometry(n)};var pr=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 n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};pr.prototype.rescale=function(){var t=this;if(k(arguments[0],St))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&Gt.out.println(o)}},pr.prototype.scale=function(){var t=this;if(k(arguments[0],St)){for(var e=arguments[0],n=new b,i=e.iterator();i.hasNext();){var o=i.next();n.add(new _t(t.scale(o.getCoordinates()),o.getData()))}return n}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new v(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=H.removeRepeatedPoints(a);return l}},pr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},pr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},pr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},pr.prototype.interfaces_=function(){return[Tr]},pr.prototype.getClass=function(){return pr};var mn=function(){this._li=new Pr,this._segStrings=null;var t=arguments[0];this._segStrings=t},ou={fact:{configurable:!0}};mn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new qn("found endpt/interior pt intersection at index "+c+" :pt "+o)}},mn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(n,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var h=arguments[0],g=arguments[1],p=arguments[2],y=arguments[3];if(h===p&&g===y)return null;var d=h.getCoordinates()[g],_=h.getCoordinates()[g+1],I=p.getCoordinates()[y],C=p.getCoordinates()[y+1];if(this._li.computeIntersection(d,_,I,C),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,_)||this.hasInteriorIntersection(this._li,I,C)))throw new qn("found non-noded intersection at "+d+"-"+_+" and "+I+"-"+C)}},mn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},mn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])},mn.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(n)))return!0}return!1},mn.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new qn("found non-noded collapse at "+mn.fact.createLineString([t,e,n]))},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},ou.fact.get=function(){return new W},Object.defineProperties(mn,ou);var he=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],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new ct("Scale factor must be non-zero");e!==1&&(this._pt=new v(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new v,this._p1Scaled=new v),this.initCorners(this._pt)},su={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};he.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<n||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return U.isTrue(!(a&&u),"Found bad envelope test"),u},he.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new v(this._maxx,this._maxy),this._corner[1]=new v(this._minx,this._maxy),this._corner[2]=new v(this._minx,this._miny),this._corner[3]=new v(this._maxx,this._miny)},he.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))},he.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},he.prototype.getCoordinate=function(){return this._originalPt},he.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},he.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=he.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new T(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},he.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()))},he.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},he.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},su.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(he,su);var vo=function(){this.tempEnv1=new T,this.selectedSegment=new M};vo.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)}}},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo};var Mi=function(){this._index=null;var t=arguments[0];this._index=t},au={HotPixelSnapAction:{configurable:!0}};Mi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new uu(e,n,i);return this._index.query(o,{interfaces_:function(){return[fr]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},au.HotPixelSnapAction.get=function(){return uu},Object.defineProperties(Mi,au);var uu=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],o=n.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(vo),ii=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new b};ii.prototype.processIntersections=function(t,e,n,i){var o=this;if(t===n&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},ii.prototype.isDone=function(){return!1},ii.prototype.getInteriorIntersections=function(){return this._interiorIntersections},ii.prototype.interfaces_=function(){return[Ar]},ii.prototype.getClass=function(){return ii};var Tn=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 Pr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Tn.prototype.checkCorrectness=function(t){var e=_t.getNodedSubstrings(t),n=new mn(e);try{n.checkValid()}catch(i){if(i instanceof Va)i.printStackTrace();else throw i}finally{}},Tn.prototype.getNodedSubstrings=function(){return _t.getNodedSubstrings(this._nodedSegStrings)},Tn.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Tn.prototype.findInteriorIntersections=function(t,e){var n=new ii(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Tn.prototype.computeVertexSnaps=function(){var t=this;if(k(arguments[0],St))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof _t)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new he(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}},Tn.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Ms,this._pointSnapper=new Mi(this._noder.getIndex()),this.snapRound(t,this._li)},Tn.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=new he(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},Tn.prototype.interfaces_=function(){return[Tr]},Tn.prototype.getClass=function(){return Tn};var zt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new $,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],n=arguments[1];this._argGeom=e,this._bufParams=n}},Ai={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};zt.prototype.bufferFixedPrecision=function(t){var e=new pr(new Tn(new Z(1)),t.getScale()),n=new ne(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},zt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=zt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Kn)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=zt.precisionScaleFactor(this._argGeom,this._distance,n),o=new Z(i);this.bufferFixedPrecision(o)}},zt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Z.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},zt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},zt.prototype.bufferOriginalPrecision=function(){try{var t=new ne(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof qn)this._saveException=e;else throw e}finally{}},zt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},zt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new zt(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new zt(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof $&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=arguments[2],g=new zt(c,h),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var y=arguments[0],d=arguments[1],_=arguments[2],I=arguments[3],C=new zt(y);C.setQuadrantSegments(_),C.setEndCapStyle(I);var L=C.getResultGeometry(d);return L}},zt.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),o=xe.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Ai.CAP_ROUND.get=function(){return $.CAP_ROUND},Ai.CAP_BUTT.get=function(){return $.CAP_FLAT},Ai.CAP_FLAT.get=function(){return $.CAP_FLAT},Ai.CAP_SQUARE.get=function(){return $.CAP_SQUARE},Ai.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(zt,Ai);var re=function(){this._pt=[new v,new v],this._distance=z.NaN,this._isNull=!0};re.prototype.getCoordinates=function(){return this._pt},re.prototype.getCoordinate=function(t){return this._pt[t]},re.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},re.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 n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},re.prototype.getDistance=function(){return this._distance},re.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re};var Mn=function(){};Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.computeDistance=function(){if(arguments[2]instanceof re&&arguments[0]instanceof gt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),o=new M,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof re&&arguments[0]instanceof wt&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];Mn.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)Mn.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof re&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof gt)Mn.computeDistance(h,g,p);else if(h instanceof wt)Mn.computeDistance(h,g,p);else if(h instanceof $t)for(var y=h,d=0;d<y.getNumGeometries();d++){var _=y.getGeometryN(d);Mn.computeDistance(_,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof re&&arguments[0]instanceof M&&arguments[1]instanceof v){var I=arguments[0],C=arguments[1],L=arguments[2],x=I.closestPoint(C);L.setMinimum(x,C)}};var Br=function(t){this._maxPtDist=new re,this._inputGeom=t||null},As={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Br.prototype.computeMaxMidpointDistance=function(t){var e=new dr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Br.prototype.computeMaxVertexDistance=function(t){var e=new oi(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Br.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Br.prototype.getDistancePoints=function(){return this._maxPtDist},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},As.MaxPointDistanceFilter.get=function(){return oi},As.MaxMidpointDistanceFilter.get=function(){return dr},Object.defineProperties(Br,As);var oi=function(t){this._maxPtDist=new re,this._minPtDist=new re,this._geom=t||null};oi.prototype.filter=function(t){this._minPtDist.initialize(),Mn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},oi.prototype.getMaxPointDistance=function(){return this._maxPtDist},oi.prototype.interfaces_=function(){return[wn]},oi.prototype.getClass=function(){return oi};var dr=function(t){this._maxPtDist=new re,this._minPtDist=new re,this._geom=t||null};dr.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new v((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),Mn.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},dr.prototype.isDone=function(){return!1},dr.prototype.isGeometryChanged=function(){return!1},dr.prototype.getMaxPointDistance=function(){return this._maxPtDist},dr.prototype.interfaces_=function(){return[We]},dr.prototype.getClass=function(){return dr};var $n=function(t){this._comps=t||null};$n.prototype.filter=function(t){t instanceof wt&&this._comps.add(t)},$n.prototype.interfaces_=function(){return[cn]},$n.prototype.getClass=function(){return $n},$n.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return $n.getPolygons(t,new b)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof wt?n.add(e):e instanceof $t&&e.apply(new $n(n)),n}};var Vt=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],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Vt.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ln){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof gt&&this._lines.add(t)},Vt.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Vt.prototype.interfaces_=function(){return[Xn]},Vt.prototype.getClass=function(){return Vt},Vt.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Vt.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Vt.getLines(e,n))}},Vt.getLines=function(){if(arguments.length===1){var t=arguments[0];return Vt.getLines(t,!1)}else if(arguments.length===2){if(k(arguments[0],St)&&k(arguments[1],St)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();Vt.getLines(o,n)}return n}else if(arguments[0]instanceof G&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new b;return s.apply(new Vt(u,a)),u}else if(arguments[0]instanceof G&&k(arguments[1],St)){var l=arguments[0],c=arguments[1];return l instanceof gt?c.add(l):l.apply(new Vt(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&k(arguments[0],St)&&k(arguments[1],St)){for(var f=arguments[0],h=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var y=p.next();Vt.getLines(y,h,g)}return h}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof G&&k(arguments[1],St)){var d=arguments[0],_=arguments[1],I=arguments[2];return d.apply(new Vt(_,I)),_}}};var Je=function(){if(this._boundaryRule=Fe.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 ct("Rule must be non-null");this._boundaryRule=t}}};Je.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof v&&arguments[1]instanceof wt){var e=arguments[0],n=arguments[1];if(n.isEmpty())return m.EXTERIOR;var i=n.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===m.EXTERIOR)return m.EXTERIOR;if(o===m.BOUNDARY)return m.BOUNDARY;for(var s=0;s<n.getNumInteriorRing();s++){var a=n.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===m.INTERIOR)return m.EXTERIOR;if(u===m.BOUNDARY)return m.BOUNDARY}return m.INTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof gt){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return m.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?m.BOUNDARY:O.isOnLine(l,f)?m.INTERIOR:m.EXTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof pe){var h=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(h)?m.INTERIOR:m.EXTERIOR}},Je.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?O.locatePointInRing(t,e.getCoordinates()):m.EXTERIOR},Je.prototype.intersects=function(t,e){return this.locate(t,e)!==m.EXTERIOR},Je.prototype.updateLocationInfo=function(t){t===m.INTERIOR&&(this._isIn=!0),t===m.BOUNDARY&&this._numBoundaries++},Je.prototype.computeLocation=function(t,e){var n=this;if(e instanceof pe&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof gt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof wt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Dr)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);n.updateLocationInfo(n.locateInternal(t,s))}else if(e instanceof bn)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,l))}else if(e instanceof $t)for(var c=new On(e);c.hasNext();){var f=c.next();f!==e&&n.computeLocation(t,f)}},Je.prototype.locate=function(t,e){return e.isEmpty()?m.EXTERIOR:e instanceof gt?this.locateInternal(t,e):e instanceof wt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?m.BOUNDARY:this._numBoundaries>0||this._isIn?m.INTERIOR:m.EXTERIOR)},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var ie=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._component=n,this._segIndex=i,this._pt=o}},lu={INSIDE_AREA:{configurable:!0}};ie.prototype.isInsideArea=function(){return this._segIndex===ie.INSIDE_AREA},ie.prototype.getCoordinate=function(){return this._pt},ie.prototype.getGeometryComponent=function(){return this._component},ie.prototype.getSegmentIndex=function(){return this._segIndex},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},lu.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ie,lu);var vr=function(t){this._pts=t||null};vr.prototype.filter=function(t){t instanceof pe&&this._pts.add(t)},vr.prototype.interfaces_=function(){return[cn]},vr.prototype.getClass=function(){return vr},vr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof pe?Ke.singletonList(t):vr.getPoints(t,new b)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof pe?n.add(e):e instanceof $t&&e.apply(new vr(n)),n}};var si=function(){this._locations=null;var t=arguments[0];this._locations=t};si.prototype.filter=function(t){(t instanceof pe||t instanceof gt||t instanceof wt)&&this._locations.add(new ie(t,0,t.getCoordinate()))},si.prototype.interfaces_=function(){return[cn]},si.prototype.getClass=function(){return si},si.getLocations=function(t){var e=new b;return t.apply(new si(e)),e};var Ut=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Je,this._minDistanceLocation=null,this._minDistance=z.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 n=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=o}};Ut.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=1-n,s=$n.getPolygons(this._geom[n]);if(s.size()>0){var a=si.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&k(arguments[0],Ye)&&k(arguments[1],Ye)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var h=u.get(f),g=0;g<l.size();g++)if(t.computeContainmentDistance(h,l.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ie&&arguments[1]instanceof wt){var p=arguments[0],y=arguments[1],d=arguments[2],_=p.getCoordinate();if(m.EXTERIOR!==this._ptLocator.locate(_,y))return this._minDistance=0,d[0]=p,d[1]=new ie(y,_),null}}},Ut.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},Ut.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Vt.getLines(this._geom[0]),n=Vt.getLines(this._geom[1]),i=vr.getPoints(this._geom[0]),o=vr.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},Ut.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ut.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])},Ut.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Ut.prototype.computeMinDistance=function(){var t=this;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 gt&&arguments[1]instanceof pe){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=n.getCoordinate(),a=0;a<o.length-1;a++){var u=O.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new M(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new ie(e,a,c),i[1]=new ie(n,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof gt&&arguments[1]instanceof gt){var f=arguments[0],h=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(h.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),y=h.getCoordinates(),d=0;d<p.length-1;d++)for(var _=0;_<y.length-1;_++){var I=O.distanceLineLine(p[d],p[d+1],y[_],y[_+1]);if(I<t._minDistance){t._minDistance=I;var C=new M(p[d],p[d+1]),L=new M(y[_],y[_+1]),x=C.closestPoints(L);g[0]=new ie(f,d,x[0]),g[1]=new ie(h,_,x[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Ut.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new ie(s,0,s.getCoordinate()),n[1]=new ie(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Ut.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ct("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Ut.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},Ut.distance=function(t,e){var n=new Ut(t,e);return n.distance()},Ut.isWithinDistance=function(t,e,n){var i=new Ut(t,e,n);return i.distance()<=n},Ut.nearestPoints=function(t,e){var n=new Ut(t,e);return n.nearestPoints()};var Qt=function(){this._pt=[new v,new v],this._distance=z.NaN,this._isNull=!0};Qt.prototype.getCoordinates=function(){return this._pt},Qt.prototype.getCoordinate=function(t){return this._pt[t]},Qt.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Qt.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 n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},Qt.prototype.toString=function(){return Xe.toLineString(this._pt[0],this._pt[1])},Qt.prototype.getDistance=function(){return this._distance},Qt.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],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var _n=function(){};_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.computeDistance=function(){if(arguments[2]instanceof Qt&&arguments[0]instanceof gt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new M,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Qt&&arguments[0]instanceof wt&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];_n.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)_n.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof Qt&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof gt)_n.computeDistance(h,g,p);else if(h instanceof wt)_n.computeDistance(h,g,p);else if(h instanceof $t)for(var y=h,d=0;d<y.getNumGeometries();d++){var _=y.getGeometryN(d);_n.computeDistance(_,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof Qt&&arguments[0]instanceof M&&arguments[1]instanceof v){var I=arguments[0],C=arguments[1],L=arguments[2],x=I.closestPoint(C);L.setMinimum(x,C)}};var Ve=function(){this._g0=null,this._g1=null,this._ptDist=new Qt,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Fs={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ve.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ve.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ct("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ve.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ve.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ve.prototype.computeOrientedDistance=function(t,e,n){var i=new ai(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new yr(e,this._densifyFrac);t.apply(o),n.setMaximum(o.getMaxPointDistance())}},Ve.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Ve(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new Ve(i,o);return a.setDensifyFraction(s),a.distance()}},Fs.MaxPointDistanceFilter.get=function(){return ai},Fs.MaxDensifiedByFractionDistanceFilter.get=function(){return yr},Object.defineProperties(Ve,Fs);var ai=function(){this._maxPtDist=new Qt,this._minPtDist=new Qt,this._euclideanDist=new _n,this._geom=null;var t=arguments[0];this._geom=t};ai.prototype.filter=function(t){this._minPtDist.initialize(),_n.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ai.prototype.getMaxPointDistance=function(){return this._maxPtDist},ai.prototype.interfaces_=function(){return[wn]},ai.prototype.getClass=function(){return ai};var yr=function(){this._maxPtDist=new Qt,this._minPtDist=new Qt,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){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new v(l,c);n._minPtDist.initialize(),_n.computeDistance(n._geom,f,n._minPtDist),n._maxPtDist.setMaximum(n._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[We]},yr.prototype.getClass=function(){return yr};var ye=function(t,e,n){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=n||null},Bs={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};ye.prototype.checkMaximumDistance=function(t,e,n){var i=new Ve(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Xe.toLineString(o[0],o[1])+")"}},ye.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=ye.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),ye.VERBOSE&&Gt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},ye.prototype.checkNegativeValid=function(){if(!(this._input instanceof wt||this._input instanceof bn||this._input instanceof $t))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)},ye.prototype.getErrorIndicator=function(){return this._errorIndicator},ye.prototype.checkMinimumDistance=function(t,e,n){var i=new Ut(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Xe.toLineString(o[0],o[1])+" )"}},ye.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)},ye.prototype.getErrorLocation=function(){return this._errorLocation},ye.prototype.getPolygonLines=function(t){for(var e=new b,n=new Vt(e),i=$n.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(n)}return t.getFactory().buildGeometry(e)},ye.prototype.getErrorMessage=function(){return this._errMsg},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},Bs.VERBOSE.get=function(){return!1},Bs.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ye,Bs);var qt=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Gs={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};qt.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},qt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*qt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new T(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new T(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},qt.prototype.checkDistance=function(){var t=new ye(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")},qt.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")},qt.prototype.checkPolygonal=function(){this._result instanceof wt||this._result instanceof bn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},qt.prototype.getErrorIndicator=function(){return this._errorIndicator},qt.prototype.getErrorLocation=function(){return this._errorLocation},qt.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},qt.prototype.report=function(t){if(!qt.VERBOSE)return null;Gt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},qt.prototype.getErrorMessage=function(){return this._errorMsg},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.isValidMsg=function(t,e,n){var i=new qt(t,e,n);return i.isValid()?null:i.getErrorMessage()},qt.isValid=function(t,e,n){var i=new qt(t,e,n);return!!i.isValid()},Gs.VERBOSE.get=function(){return!1},Gs.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(qt,Gs);var En=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};En.prototype.getCoordinates=function(){return this._pts},En.prototype.size=function(){return this._pts.length},En.prototype.getCoordinate=function(t){return this._pts[t]},En.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},En.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ei.octant(this.getCoordinate(t),this.getCoordinate(t+1))},En.prototype.setData=function(t){this._data=t},En.prototype.getData=function(){return this._data},En.prototype.toString=function(){return Xe.toLineString(new mt(this._pts))},En.prototype.interfaces_=function(){return[Rn]},En.prototype.getClass=function(){return En};var At=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new b,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};At.prototype.getInteriorIntersection=function(){return this._interiorIntersection},At.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},At.prototype.getIntersectionSegments=function(){return this._intSegments},At.prototype.count=function(){return this._intersectionCount},At.prototype.getIntersections=function(){return this._intersections},At.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},At.prototype.setKeepIntersections=function(t){this._keepIntersections=t},At.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},At.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},At.prototype.hasIntersection=function(){return this._interiorIntersection!==null},At.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},At.prototype.interfaces_=function(){return[Ar]},At.prototype.getClass=function(){return At},At.createAllIntersectionsFinder=function(t){var e=new At(t);return e.setFindAllIntersections(!0),e},At.createAnyIntersectionFinder=function(t){return new At(t)},At.createIntersectionCounter=function(t){var e=new At(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ze=function(){this._li=new Pr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ze.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Ze.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ze.prototype.isValid=function(){return this.execute(),this._isValid},Ze.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ze.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new At(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Ms;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ze.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Kn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ze.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Xe.toLineString(t[0],t[1])+" and "+Xe.toLineString(t[2],t[3])},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},Ze.computeIntersections=function(t){var e=new Ze(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Gr=function r(){this._nv=null;var t=arguments[0];this._nv=new Ze(r.toSegmentStrings(t))};Gr.prototype.checkValid=function(){this._nv.checkValid()},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.toSegmentStrings=function(t){for(var e=new b,n=t.iterator();n.hasNext();){var i=n.next();e.add(new En(i.getCoordinates(),i))}return e},Gr.checkValid=function(t){var e=new Gr(t);e.checkValid()};var ui=function(t){this._mapOp=t};ui.prototype.map=function(t){for(var e=this,n=new b,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||n.add(o)}return t.getFactory().createGeometryCollection(W.toGeometryArray(n))},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.map=function(t,e){var n=new ui(e);return n.map(t)};var In=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new b,this._resultLineList=new b;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};In.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},In.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},In.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},In.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&V.isResultOfOp(i,e)&&!o.isCovered()&&(n.add(o),t.setVisitedEdge(!0))},In.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}},In.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},In.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},In.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;U.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),V.isResultOfOp(i,e)&&e===V.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In};var li=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new b;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};li.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},li.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===V.INTERSECTION)){var o=i.getLabel();V.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},li.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li};var ge=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};ge.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},ge.prototype.transformPolygon=function(t,e){var n=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Ln)||o.isEmpty())&&(i=!1);for(var s=new b,a=0;a<t.getNumInteriorRing();a++){var u=n.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof Ln||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new b;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)},ge.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},ge.prototype.getInputGeometry=function(){return this._inputGeom},ge.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new b,o=0;o<t.getNumGeometries();o++){var s=n.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ge.prototype.transformCoordinates=function(t,e){return this.copy(t)},ge.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},ge.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new b,o=0;o<t.getNumGeometries();o++){var s=n.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ge.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new b,o=0;o<t.getNumGeometries();o++){var s=n.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},ge.prototype.copy=function(t){return t.copy()},ge.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new b,o=0;o<t.getNumGeometries();o++){var s=n.transform(t.getGeometryN(o));s!==null&&(n._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(W.toGeometryArray(i)):this._factory.buildGeometry(i)},ge.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof pe)return this.transformPoint(t,null);if(t instanceof Pi)return this.transformMultiPoint(t,null);if(t instanceof Ln)return this.transformLinearRing(t,null);if(t instanceof gt)return this.transformLineString(t,null);if(t instanceof Dr)return this.transformMultiLineString(t,null);if(t instanceof wt)return this.transformPolygon(t,null);if(t instanceof bn)return this.transformMultiPolygon(t,null);if(t instanceof $t)return this.transformGeometryCollection(t,null);throw new ct("Unknown Geometry subtype: "+t.getClass().getName())},ge.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var An=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new M,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof gt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};An.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=n.findSnapForVertex(s,e);a!==null&&(t.set(o,new v(a)),o===0&&n._isClosed&&t.set(t.size()-1,new v(a)))}},An.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},An.prototype.snapTo=function(t){var e=new eo(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},An.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=n.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new v(s),!1)}},An.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=z.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(n._seg.p0=e.get(s),n._seg.p1=e.get(s+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<i&&(i=a,o=s)}return o},An.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Et=function(t){this._srcGeom=t||null},cu={SNAP_PRECISION_FACTOR:{configurable:!0}};Et.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new fu(e,n);return i.transform(this._srcGeom)},Et.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new fu(t,n,!0),o=i.transform(this._srcGeom),s=o;return e&&k(s,cr)&&(s=o.buffer(0)),s},Et.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},Et.prototype.extractTargetCoordinates=function(t){for(var e=new ln,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},Et.prototype.computeMinimumSegmentLength=function(t){for(var e=z.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.snap=function(t,e,n){var i=new Array(2).fill(null),o=new Et(t);i[0]=o.snapTo(e,n);var s=new Et(e);return i[1]=s.snapTo(i[0],n),i},Et.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Et.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Z.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(Et.computeOverlaySnapTolerance(o),Et.computeOverlaySnapTolerance(s))}},Et.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*Et.SNAP_PRECISION_FACTOR;return i},Et.snapToSelf=function(t,e,n){var i=new Et(t);return i.snapToSelf(e,n)},cu.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Et,cu);var fu=function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var o=new An(n,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var o=n.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ge),oe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};oe.prototype.getCommon=function(){return z.longBitsToDouble(this._commonBits)},oe.prototype.add=function(t){var e=z.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=oe.signExpBits(this._commonBits),this._isFirst=!1,null;var n=oe.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=oe.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=oe.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},oe.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=z.longBitsToDouble(t),n=z.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.getBit=function(t,e){var n=1<<e;return t&n?1:0},oe.signExpBits=function(t){return t>>52},oe.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,o=t&i;return o},oe.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(oe.getBit(t,i)!==oe.getBit(e,i))return n;n++}return 52};var mr=function(){this._commonCoord=null,this._ccFilter=new ci},ks={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};mr.prototype.addCommonBits=function(t){var e=new _r(this._commonCoord);t.apply(e),t.geometryChanged()},mr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new v(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new _r(e);return t.apply(n),t.geometryChanged(),t},mr.prototype.getCommonCoordinate=function(){return this._commonCoord},mr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},ks.CommonCoordinateFilter.get=function(){return ci},ks.Translater.get=function(){return _r},Object.defineProperties(mr,ks);var ci=function(){this._commonBitsX=new oe,this._commonBitsY=new oe};ci.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ci.prototype.getCommonCoordinate=function(){return new v(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ci.prototype.interfaces_=function(){return[wn]},ci.prototype.getClass=function(){return ci};var _r=function(){this.trans=null;var t=arguments[0];this.trans=t};_r.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},_r.prototype.isDone=function(){return!1},_r.prototype.isGeometryChanged=function(){return!0},_r.prototype.interfaces_=function(){return[We]},_r.prototype.getClass=function(){return _r};var Ft=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()};Ft.prototype.selfSnap=function(t){var e=new Et(t),n=e.snapTo(t,this._snapTolerance);return n},Ft.prototype.removeCommonBits=function(t){this._cbr=new mr,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},Ft.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Ft.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=V.overlayOp(e[0],e[1],t);return this.prepareResult(n)},Ft.prototype.checkValid=function(t){t.isValid()||Gt.out.println("Snapped geometry is invalid")},Ft.prototype.computeSnapTolerance=function(){this._snapTolerance=Et.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Ft.prototype.snap=function(t){var e=this.removeCommonBits(t),n=Et.snap(e[0],e[1],this._snapTolerance);return n},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.overlayOp=function(t,e,n){var i=new Ft(t,e);return i.getResultGeometry(n)},Ft.union=function(t,e){return Ft.overlayOp(t,e,V.UNION)},Ft.intersection=function(t,e){return Ft.overlayOp(t,e,V.INTERSECTION)},Ft.symDifference=function(t,e){return Ft.overlayOp(t,e,V.SYMDIFFERENCE)},Ft.difference=function(t,e){return Ft.overlayOp(t,e,V.DIFFERENCE)};var se=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};se.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=V.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(n=!0)}catch(s){if(s instanceof qn)i=s;else throw s}finally{}if(!n)try{e=Ft.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof qn?i:s}finally{}return e},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se},se.overlayOp=function(t,e,n){var i=new se(t,e);return i.getResultGeometry(n)},se.union=function(t,e){return se.overlayOp(t,e,V.UNION)},se.intersection=function(t,e){return se.overlayOp(t,e,V.INTERSECTION)},se.symDifference=function(t,e){return se.overlayOp(t,e,V.SYMDIFFERENCE)},se.difference=function(t,e){return se.overlayOp(t,e,V.DIFFERENCE)};var yo=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};yo.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var me=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=o}},zs={INSERT:{configurable:!0},DELETE:{configurable:!0}};me.prototype.isDelete=function(){return this._eventType===me.DELETE},me.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},me.prototype.getObject=function(){return this._obj},me.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},me.prototype.getInsertEvent=function(){return this._insertEvent},me.prototype.isInsert=function(){return this._eventType===me.INSERT},me.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},me.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},me.prototype.interfaces_=function(){return[Me]},me.prototype.getClass=function(){return me},zs.INSERT.get=function(){return 1},zs.DELETE.get=function(){return 2},Object.defineProperties(me,zs);var Wo=function(){};Wo.prototype.interfaces_=function(){return[]},Wo.prototype.getClass=function(){return Wo};var Xt=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],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Xt.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Xt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Xt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Xt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Xt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Xt.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},Xt.prototype.hasProperIntersection=function(){return this._hasProper},Xt.prototype.hasIntersection=function(){return this._hasIntersection},Xt.prototype.isDone=function(){return this._isDone},Xt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Xt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Xt.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var xc=function(r){function t(){r.call(this),this.events=new b,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;Ke.sort(this.events);for(var i=0;i<this.events.size();i++){var o=n.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=n.events.get(o);if(s.isInsert()&&n.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Xt&&k(arguments[0],Ye)&&k(arguments[1],Ye)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&k(arguments[0],Ye)&&arguments[1]instanceof Xt){var c=arguments[0],f=arguments[1],h=arguments[2];h?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(n,i){for(var o=this,s=n.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new yo(s,u),c=new me(i,s.getMinX(u),l);o.events.add(c),o.events.add(new me(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(n,i,o,s){for(var a=this,u=o.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();n.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Wo),Fn=function(){this._min=z.POSITIVE_INFINITY,this._max=z.NEGATIVE_INFINITY},hu={NodeComparator:{configurable:!0}};Fn.prototype.getMin=function(){return this._min},Fn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Fn.prototype.getMax=function(){return this._max},Fn.prototype.toString=function(){return Xe.toLineString(new v(this._min,0),new v(this._max,0))},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},hu.NodeComparator.get=function(){return mo},Object.defineProperties(Fn,hu);var mo=function(){};mo.prototype.compare=function(t,e){var n=t,i=e,o=(n._min+n._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0},mo.prototype.interfaces_=function(){return[mi]},mo.prototype.getClass=function(){return mo};var Sc=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fn),wc=function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,o),this._node2!==null&&this._node2.query(n,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fn),Bn=function(){this._leaves=new b,this._root=null,this._level=0};Bn.prototype.buildTree=function(){var t=this;Ke.sort(this._leaves,new Fn.NodeComparator);for(var e=this._leaves,n=null,i=new b;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},Bn.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Sc(t,e,n))},Bn.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Bn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Bn.prototype.printNode=function(t){Gt.out.println(Xe.toLineString(new v(t._min,this._level),new v(t._max,this._level)))},Bn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Bn.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),o=n+1<t.size()?t.get(n):null;if(o===null)e.add(i);else{var s=new wc(t.get(n),t.get(n+1));e.add(s)}}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var Fi=function(){this._items=new b};Fi.prototype.visitItem=function(t){this._items.add(t)},Fi.prototype.getItems=function(){return this._items},Fi.prototype.interfaces_=function(){return[fr]},Fi.prototype.getClass=function(){return Fi};var Bi=function(){this._index=null;var t=arguments[0];if(!k(t,cr))throw new ct("Argument must be Polygonal");this._index=new kr(t)},Vs={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Bi.prototype.locate=function(t){var e=new un(t),n=new Gi(e);return this._index.query(t.y,t.y,n),e.getLocation()},Bi.prototype.interfaces_=function(){return[Ti]},Bi.prototype.getClass=function(){return Bi},Vs.SegmentVisitor.get=function(){return Gi},Vs.IntervalIndexedGeometry.get=function(){return kr},Object.defineProperties(Bi,Vs);var Gi=function(){this._counter=null;var t=arguments[0];this._counter=t};Gi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Gi.prototype.interfaces_=function(){return[fr]},Gi.prototype.getClass=function(){return Gi};var kr=function(){this._index=new Bn;var t=arguments[0];this.init(t)};kr.prototype.init=function(t){for(var e=this,n=Vt.getLines(t),i=n.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}},kr.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new M(t[n-1],t[n]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}},kr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Fi;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr};var _o=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Wa,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Je,arguments.length===2){var e=arguments[0],n=arguments[1],i=Fe.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=m.NONE;u=s.getLocation(n,S.ON),u===m.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(n,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Xt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Ln||this._parentGeom instanceof wt||this._parentGeom instanceof bn,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,o){var s=new Xt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof pe){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,m.INTERIOR)}else if(arguments[0]instanceof v){var o=arguments[0];this.insertPoint(this._argIndex,o,m.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),m.EXTERIOR,m.INTERIOR);for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o);i.addPolygonRing(s,m.INTERIOR,m.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],m.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],m.BOUNDARY)},t.prototype.addLineString=function(n){var i=H.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Ho(i,new et(this._argIndex,m.INTERIOR));this._lineEdgeMap.put(n,o),this.insertEdge(o),U.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),o=0,s=n.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,o){if(this.isBoundaryNode(n,i))return null;o===m.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,o)},t.prototype.addPolygonRing=function(n,i,o){if(n.isEmpty())return null;var s=H.removeRepeatedPoints(n.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;O.isCCW(s)&&(a=o,u=i);var l=new Ho(s,new et(this._argIndex,m.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],m.BOUNDARY)},t.prototype.insertPoint=function(n,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new et(n,o):a.setLocation(n,o)},t.prototype.createEdgeSetIntersector=function(){return new xc},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(n),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof bn&&(this._useBoundaryDeterminationRule=!1),n instanceof wt)this.addPolygon(n);else if(n instanceof gt)this.addLineString(n);else if(n instanceof pe)this.addPoint(n);else if(n instanceof Pi)this.addCollection(n);else if(n instanceof Dr)this.addCollection(n);else if(n instanceof bn)this.addCollection(n);else if(n instanceof $t)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,o=0;o<n.getNumGeometries();o++){var s=n.getGeometryN(o);i.add(s)}},t.prototype.locate=function(n){return k(this._parentGeom,cr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Bi(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?m.BOUNDARY:m.INTERIOR},t}(ht),ki=function(){if(this._li=new Pr,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 _o(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=Fe.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new _o(0,e,i),this._arg[1]=new _o(1,n,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new _o(0,o,a),this._arg[1]=new _o(1,s,a)}};ki.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},ki.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var zr=function(){};zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.map=function(){if(arguments[0]instanceof G&&k(arguments[1],zr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new b,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&n.add(o)}return t.getFactory().buildGeometry(n)}else if(k(arguments[0],St)&&k(arguments[1],zr.MapOp)){for(var s=arguments[0],a=arguments[1],u=new b,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}},zr.MapOp=function(){};var V=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new Je,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Qe,this._resultPolyList=new b,this._resultLineList=new b,this._resultPointList=new b,this._graph=new ht(new ru),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var o=i.getLabel(),s=n.getLabel();i.isPointwiseEqual(n)||(s=new et(n.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,o,s){var a=new b;return a.addAll(n),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(n,a);if(u!==m.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new b,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),n.add(o.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,o=n.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(n){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 i=new b;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Gr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var o=new de(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new In(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(n);var a=new li(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var o=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(n){for(var i=this,o=this._arg[n].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(n,s.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,S.RIGHT),s.getLocation(1,S.RIGHT),n)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(U.isTrue(!s.isNull(a,S.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,S.LEFT,s.getLocation(a,S.LEFT)),U.isTrue(!s.isNull(a,S.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,S.RIGHT,s.getLocation(a,S.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?n.labelIncompleteNode(o,0):n.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ki);V.overlayOp=function(r,t,e){var n=new V(r,t),i=n.getResultGeometry(e);return i},V.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return V.createEmptyResult(V.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return ui.map(r,{interfaces_:function(){return[zr.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),se.overlayOp(r,t,V.INTERSECTION)},V.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return V.createEmptyResult(V.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),se.overlayOp(r,t,V.SYMDIFFERENCE)},V.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),o=-1;switch(r){case V.INTERSECTION:o=Math.min(n,i);break;case V.UNION:o=Math.max(n,i);break;case V.DIFFERENCE:o=n;break;case V.SYMDIFFERENCE:o=Math.max(n,i);break}return o},V.createEmptyResult=function(r,t,e,n){var i=null;switch(V.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},V.difference=function(r,t){return r.isEmpty()?V.createEmptyResult(V.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),se.overlayOp(r,t,V.DIFFERENCE))},V.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return V.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===m.BOUNDARY&&(i=m.INTERIOR),o===m.BOUNDARY&&(o=m.INTERIOR),s){case V.INTERSECTION:return i===m.INTERIOR&&o===m.INTERIOR;case V.UNION:return i===m.INTERIOR||o===m.INTERIOR;case V.DIFFERENCE:return i===m.INTERIOR&&o!==m.INTERIOR;case V.SYMDIFFERENCE:return i===m.INTERIOR&&o!==m.INTERIOR||i!==m.INTERIOR&&o===m.INTERIOR}return!1}},V.INTERSECTION=1,V.UNION=2,V.DIFFERENCE=3,V.SYMDIFFERENCE=4;var Er=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Je,this._seg=new M;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Er.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},Er.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?m.BOUNDARY:this._ptLocator.locate(t,this._g)},Er.prototype.extractLinework=function(t){var e=new zi;t.apply(e);var n=e.getLinework(),i=W.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er};var zi=function(){this._linework=null,this._linework=new b};zi.prototype.getLinework=function(){return this._linework},zi.prototype.filter=function(t){var e=this;if(t instanceof wt){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},zi.prototype.interfaces_=function(){return[cn]},zi.prototype.getClass=function(){return zi};var Vr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Vr.prototype.extractPoints=function(t,e,n){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,n)},Vr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Vr.prototype.getPoints=function(t){for(var e=this,n=new b,i=Vt.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,n)}return n},Vr.prototype.computeOffsetPoints=function(t,e,n,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=n*o/a,l=n*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var h=new v(c-l,f+u);i.add(h)}if(this._doRight){var g=new v(c+l,f-u);i.add(g)}},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr};var Pe=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new b;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new Er(this._geom[0],this._boundaryDistanceTolerance),new Er(this._geom[1],this._boundaryDistanceTolerance),new Er(this._geom[2],this._boundaryDistanceTolerance)]},gu={TOLERANCE:{configurable:!0}};Pe.prototype.reportResult=function(t,e,n){Gt.out.println("Overlay result invalid - A:"+m.toLocationSymbol(e[0])+" B:"+m.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+m.toLocationSymbol(e[2]))},Pe.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Pe.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),Pe.hasLocation(this._location,m.BOUNDARY)?!0:this.isValidResult(o,this._location)}},Pe.prototype.addTestPts=function(t){var e=new Vr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pe.prototype.isValidResult=function(t,e){var n=V.isResultOfOp(e[0],e[1],t),i=e[2]===m.INTERIOR,o=!(n^i);return o||this.reportResult(t,e,n),o},Pe.prototype.getInvalidLocation=function(){return this._invalidLocation},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pe.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Et.computeSizeBasedSnapTolerance(t),Et.computeSizeBasedSnapTolerance(e))},Pe.isValid=function(t,e,n,i){var o=new Pe(t,e,i);return o.isValid(n)},gu.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pe,gu);var Re=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};Re.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);n._skipEmpty&&o.isEmpty()||e.add(o)}},Re.prototype.combine=function(){for(var t=this,e=new b,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Re(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Re(Re.createList(n,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new Re(Re.createList(s,a,u));return l.combine()}},Re.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Re.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new b;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new b;return a.add(i),a.add(o),a.add(s),a}};var xt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new b)},pu={STRTREE_NODE_CAPACITY:{configurable:!0}};xt.prototype.reduceToGeometries=function(t){for(var e=this,n=new b,i=t.iterator();i.hasNext();){var o=i.next(),s=null;k(o,Ye)?s=e.unionTree(o):o instanceof G&&(s=o),n.add(s)}return n},xt.prototype.extractByEnvelope=function(t,e,n){for(var i=new b,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):n.add(s)}return this._geomFactory.buildGeometry(i)},xt.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var o=Re.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)},xt.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 Ja(xt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},xt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var o=xt.getGeometry(e,n);return this.unionSafe(o,null)}else{if(i-n===2)return this.unionSafe(xt.getGeometry(e,n),xt.getGeometry(e,n+1));var s=Math.trunc((i+n)/2),a=this.binaryUnion(e,n,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}},xt.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},xt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},xt.prototype.unionActual=function(t,e){return xt.restrictToPolygons(t.union(e))},xt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},xt.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new b,o=this.extractByEnvelope(n,t,i),s=this.extractByEnvelope(n,e,i),a=this.unionActual(o,s);i.add(a);var u=Re.combine(i);return u},xt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.restrictToPolygons=function(t){if(k(t,cr))return t;var e=$n.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(W.toPolygonArray(e))},xt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},xt.union=function(t){var e=new xt(t);return e.union()},pu.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(xt,pu);var jo=function(){};jo.prototype.interfaces_=function(){return[]},jo.prototype.getClass=function(){return jo},jo.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return V.createEmptyResult(V.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),se.overlayOp(t,e,V.UNION)};function Ur(){return new Ko}function Ko(){this.reset()}Ko.prototype={constructor:Ko,reset:function(){this.s=this.t=0},add:function(r){du(Qo,r,this.t),du(this,Qo.s,this.s),this.s?this.t+=Qo.t:this.s=Qo.t},valueOf:function(){return this.s}};var Qo=new Ko;function du(r,t,e){var n=r.s=t+e,i=n-t,o=n-i;r.t=t-o+(e-i)}var dt=1e-6,ot=Math.PI,tr=ot/2,vu=ot/4,er=ot*2,qr=180/ot,Cn=ot/180,ae=Math.abs,Lc=Math.atan,Vi=Math.atan2,bt=Math.cos,Pt=Math.sin,Eo=Math.sqrt;function yu(r){return r>1?0:r<-1?ot:Math.acos(r)}function Ui(r){return r>1?tr:r<-1?-tr:Math.asin(r)}function Io(){}function Jo(r,t){r&&_u.hasOwnProperty(r.type)&&_u[r.type](r,t)}var mu={Feature:function(r,t){Jo(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)Jo(e[n].geometry,t)}},_u={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){Us(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Us(e[n],t,0)},Polygon:function(r,t){Eu(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Eu(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)Jo(e[n],t)}};function Us(r,t,e){var n=-1,i=r.length-e,o;for(t.lineStart();++n<i;)o=r[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function Eu(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)Us(r[e],t,1);t.polygonEnd()}function bc(r,t){r&&mu.hasOwnProperty(r.type)?mu[r.type](r,t):Jo(r,t)}Ur(),Ur();function qs(r){return[Vi(r[1],r[0]),Ui(r[2])]}function qi(r){var t=r[0],e=r[1],n=bt(e);return[n*bt(t),n*Pt(t),Pt(e)]}function Zo(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function $o(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function Xs(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function ts(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function Ys(r){var t=Eo(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}Ur();function Iu(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function Hs(r,t){return[r>ot?r-er:r<-ot?r+er:r,t]}Hs.invert=Hs;function Pc(r,t,e){return(r%=er)?t||e?Iu(Nu(r),xu(t,e)):Nu(r):t||e?xu(t,e):Hs}function Cu(r){return function(t,e){return t+=r,[t>ot?t-er:t<-ot?t+er:t,e]}}function Nu(r){var t=Cu(r);return t.invert=Cu(-r),t}function xu(r,t){var e=bt(r),n=Pt(r),i=bt(t),o=Pt(t);function s(a,u){var l=bt(u),c=bt(a)*l,f=Pt(a)*l,h=Pt(u),g=h*e+c*n;return[Vi(f*i-g*o,c*e-h*n),Ui(g*i+f*o)]}return s.invert=function(a,u){var l=bt(u),c=bt(a)*l,f=Pt(a)*l,h=Pt(u),g=h*i-f*o;return[Vi(f*i+h*o,c*e+g*n),Ui(g*e-c*n)]},s}function Rc(r,t,e,n,i,o){if(e){var s=bt(t),a=Pt(t),u=n*e;i==null?(i=t+n*er,o=t-u/2):(i=Su(s,i),o=Su(s,o),(n>0?i<o:i>o)&&(i+=n*er));for(var l,c=i;n>0?c>o:c<o;c-=u)l=qs([s,-a*bt(c),-a*Pt(c)]),r.point(l[0],l[1])}}function Su(r,t){t=qi(t),t[0]-=r,Ys(t);var e=yu(-t[1]);return((-t[2]<0?-e:e)+er-dt)%er}function wu(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:Io,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function Oc(r,t,e,n,i,o){var s=r[0],a=r[1],u=t[0],l=t[1],c=0,f=1,h=u-s,g=l-a,p;if(p=e-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}if(p=n-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<f&&(f=p)}return c>0&&(r[0]=s+c*h,r[1]=a+c*g),f<1&&(t[0]=s+f*h,t[1]=a+f*g),!0}}}}}function es(r,t){return ae(r[0]-t[0])<dt&&ae(r[1]-t[1])<dt}function ns(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function Lu(r,t,e,n,i){var o=[],s=[],a,u;if(r.forEach(function(p){if(!((y=p.length-1)<=0)){var y,d=p[0],_=p[y],I;if(es(d,_)){for(i.lineStart(),a=0;a<y;++a)i.point((d=p[a])[0],d[1]);i.lineEnd();return}o.push(I=new ns(d,p,null,!0)),s.push(I.o=new ns(d,null,I,!1)),o.push(I=new ns(_,p,null,!1)),s.push(I.o=new ns(_,null,I,!0))}}),!!o.length){for(s.sort(t),bu(o),bu(s),a=0,u=s.length;a<u;++a)s[a].e=e=!e;for(var l=o[0],c,f;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((f=c[a])[0],f[1]);else n(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((f=c[a])[0],f[1]);else n(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function bu(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function Pu(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function Dc(r){return r.length===1&&(r=Tc(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)<0?n=o+1:i=o}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)>0?i=o:n=o+1}return n}}}function Tc(r){return function(t,e){return Pu(r(t),e)}}Dc(Pu);function Ru(r){for(var t=r.length,e,n=-1,i=0,o,s;++n<t;)i+=r[n].length;for(o=new Array(i);--t>=0;)for(s=r[t],e=s.length;--e>=0;)o[--i]=s[e];return o}var Co=1e9,rs=-Co;function Mc(r,t,e,n){function i(l,c){return r<=l&&l<=e&&t<=c&&c<=n}function o(l,c,f,h){var g=0,p=0;if(l==null||(g=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do h.point(g===0||g===3?r:e,g>1?n:t);while((g=(g+f+4)%4)!==p);else h.point(c[0],c[1])}function s(l,c){return ae(l[0]-r)<dt?c>0?0:3:ae(l[0]-e)<dt?c>0?2:1:ae(l[1]-t)<dt?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),h=s(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=wu(),h,g,p,y,d,_,I,C,L,x,w,A={point:B,lineStart:P,lineEnd:X,polygonStart:q,polygonEnd:j};function B(Y,ut){i(Y,ut)&&c.point(Y,ut)}function F(){for(var Y=0,ut=0,Rt=g.length;ut<Rt;++ut)for(var Jt=g[ut],_e=1,hi=Jt.length,kn=Jt[0],nr,Ee,it=kn[0],Dt=kn[1];_e<hi;++_e)nr=it,Ee=Dt,kn=Jt[_e],it=kn[0],Dt=kn[1],Ee<=n?Dt>n&&(it-nr)*(n-Ee)>(Dt-Ee)*(r-nr)&&++Y:Dt<=n&&(it-nr)*(n-Ee)<(Dt-Ee)*(r-nr)&&--Y;return Y}function q(){c=f,h=[],g=[],w=!0}function j(){var Y=F(),ut=w&&Y,Rt=(h=Ru(h)).length;(ut||Rt)&&(l.polygonStart(),ut&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),Rt&&Lu(h,a,Y,o,l),l.polygonEnd()),c=l,h=g=p=null}function P(){A.point=R,g&&g.push(p=[]),x=!0,L=!1,I=C=NaN}function X(){h&&(R(y,d),_&&L&&f.rejoin(),h.push(f.result())),A.point=B,L&&c.lineEnd()}function R(Y,ut){var Rt=i(Y,ut);if(g&&p.push([Y,ut]),x)y=Y,d=ut,_=Rt,x=!1,Rt&&(c.lineStart(),c.point(Y,ut));else if(Rt&&L)c.point(Y,ut);else{var Jt=[I=Math.max(rs,Math.min(Co,I)),C=Math.max(rs,Math.min(Co,C))],_e=[Y=Math.max(rs,Math.min(Co,Y)),ut=Math.max(rs,Math.min(Co,ut))];Oc(Jt,_e,r,t,e,n)?(L||(c.lineStart(),c.point(Jt[0],Jt[1])),c.point(_e[0],_e[1]),Rt||c.lineEnd(),w=!1):Rt&&(c.lineStart(),c.point(Y,ut),w=!1)}I=Y,C=ut,L=Rt}return A}}var Ws=Ur();function Ac(r,t){var e=t[0],n=t[1],i=[Pt(e),-bt(e),0],o=0,s=0;Ws.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,f=l[c-1],h=f[0],g=f[1]/2+vu,p=Pt(g),y=bt(g),d=0;d<c;++d,h=I,p=L,y=x,f=_){var _=l[d],I=_[0],C=_[1]/2+vu,L=Pt(C),x=bt(C),w=I-h,A=w>=0?1:-1,B=A*w,F=B>ot,q=p*L;if(Ws.add(Vi(q*A*Pt(B),y*x+q*bt(B))),o+=F?w+A*er:w,F^h>=e^I>=e){var j=$o(qi(f),qi(_));Ys(j);var P=$o(i,j);Ys(P);var X=(F^w>=0?-1:1)*Ui(P[2]);(n>X||n===X&&(j[0]||j[1]))&&(s+=F^w>=0?1:-1)}}return(o<-dt||o<dt&&Ws<-dt)^s&1}Ur();function Ou(r){return r}Ur(),Ur();var Xi=1/0,is=Xi,No=-Xi,os=No,Du={point:Fc,lineStart:Io,lineEnd:Io,polygonStart:Io,polygonEnd:Io,result:function(){var r=[[Xi,is],[No,os]];return No=os=-(is=Xi=1/0),r}};function Fc(r,t){r<Xi&&(Xi=r),r>No&&(No=r),t<is&&(is=t),t>os&&(os=t)}Ur();function Tu(r,t,e,n){return function(i,o){var s=t(o),a=i.invert(n[0],n[1]),u=wu(),l=t(u),c=!1,f,h,g,p={point:y,lineStart:_,lineEnd:I,polygonStart:function(){p.point=C,p.lineStart=L,p.lineEnd=x,h=[],f=[]},polygonEnd:function(){p.point=y,p.lineStart=_,p.lineEnd=I,h=Ru(h);var w=Ac(f,a);h.length?(c||(o.polygonStart(),c=!0),Lu(h,Gc,w,e,o)):w&&(c||(o.polygonStart(),c=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(w,A){var B=i(w,A);r(w=B[0],A=B[1])&&o.point(w,A)}function d(w,A){var B=i(w,A);s.point(B[0],B[1])}function _(){p.point=d,s.lineStart()}function I(){p.point=y,s.lineEnd()}function C(w,A){g.push([w,A]);var B=i(w,A);l.point(B[0],B[1])}function L(){l.lineStart(),g=[]}function x(){C(g[0][0],g[0][1]),l.lineEnd();var w=l.clean(),A=u.result(),B,F=A.length,q,j,P;if(g.pop(),f.push(g),g=null,!!F){if(w&1){if(j=A[0],(q=j.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),B=0;B<q;++B)o.point((P=j[B])[0],P[1]);o.lineEnd()}return}F>1&&w&2&&A.push(A.pop().concat(A.shift())),h.push(A.filter(Bc))}}return p}}function Bc(r){return r.length>1}function Gc(r,t){return((r=r.x)[0]<0?r[1]-tr-dt:tr-r[1])-((t=t.x)[0]<0?t[1]-tr-dt:tr-t[1])}const Mu=Tu(function(){return!0},kc,Vc,[-ot,-tr]);function kc(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(o,s){var a=o>0?ot:-ot,u=ae(o-t);ae(u-ot)<dt?(r.point(t,e=(e+s)/2>0?tr:-tr),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),r.point(o,e),i=0):n!==a&&u>=ot&&(ae(t-n)<dt&&(t-=n*dt),ae(o-a)<dt&&(o-=a*dt),e=zc(t,e,o,s),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),i=0),r.point(t=o,e=s),n=a},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function zc(r,t,e,n){var i,o,s=Pt(r-e);return ae(s)>dt?Lc((Pt(t)*(o=bt(n))*Pt(e)-Pt(n)*(i=bt(t))*Pt(r))/(i*o*s)):(t+n)/2}function Vc(r,t,e,n){var i;if(r==null)i=e*tr,n.point(-ot,i),n.point(0,i),n.point(ot,i),n.point(ot,0),n.point(ot,-i),n.point(0,-i),n.point(-ot,-i),n.point(-ot,0),n.point(-ot,i);else if(ae(r[0]-t[0])>dt){var o=r[0]<t[0]?ot:-ot;i=e*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])}function Uc(r,t){var e=bt(r),n=e>0,i=ae(e)>dt;function o(c,f,h,g){Rc(g,r,t,h,c,f)}function s(c,f){return bt(c)*bt(f)>e}function a(c){var f,h,g,p,y;return{lineStart:function(){p=g=!1,y=1},point:function(d,_){var I=[d,_],C,L=s(d,_),x=n?L?0:l(d,_):L?l(d+(d<0?ot:-ot),_):0;if(!f&&(p=g=L)&&c.lineStart(),L!==g&&(C=u(f,I),(!C||es(f,C)||es(I,C))&&(I[0]+=dt,I[1]+=dt,L=s(I[0],I[1]))),L!==g)y=0,L?(c.lineStart(),C=u(I,f),c.point(C[0],C[1])):(C=u(f,I),c.point(C[0],C[1]),c.lineEnd()),f=C;else if(i&&f&&n^L){var w;!(x&h)&&(w=u(I,f,!0))&&(y=0,n?(c.lineStart(),c.point(w[0][0],w[0][1]),c.point(w[1][0],w[1][1]),c.lineEnd()):(c.point(w[1][0],w[1][1]),c.lineEnd(),c.lineStart(),c.point(w[0][0],w[0][1])))}L&&(!f||!es(f,I))&&c.point(I[0],I[1]),f=I,g=L,h=x},lineEnd:function(){g&&c.lineEnd(),f=null},clean:function(){return y|(p&&g)<<1}}}function u(c,f,h){var g=qi(c),p=qi(f),y=[1,0,0],d=$o(g,p),_=Zo(d,d),I=d[0],C=_-I*I;if(!C)return!h&&c;var L=e*_/C,x=-e*I/C,w=$o(y,d),A=ts(y,L),B=ts(d,x);Xs(A,B);var F=w,q=Zo(A,F),j=Zo(F,F),P=q*q-j*(Zo(A,A)-1);if(!(P<0)){var X=Eo(P),R=ts(F,(-q-X)/j);if(Xs(R,A),R=qs(R),!h)return R;var Y=c[0],ut=f[0],Rt=c[1],Jt=f[1],_e;ut<Y&&(_e=Y,Y=ut,ut=_e);var hi=ut-Y,kn=ae(hi-ot)<dt,nr=kn||hi<dt;if(!kn&&Jt<Rt&&(_e=Rt,Rt=Jt,Jt=_e),nr?kn?Rt+Jt>0^R[1]<(ae(R[0]-Y)<dt?Rt:Jt):Rt<=R[1]&&R[1]<=Jt:hi>ot^(Y<=R[0]&&R[0]<=ut)){var Ee=ts(F,(-q+X)/j);return Xs(Ee,A),[R,qs(Ee)]}}}function l(c,f){var h=n?r:ot-r,g=0;return c<-h?g|=1:c>h&&(g|=2),f<-h?g|=4:f>h&&(g|=8),g}return Tu(s,a,o,n?[0,-r]:[-ot,r-ot])}function Au(r){return function(t){var e=new js;for(var n in r)e[n]=r[n];return e.stream=t,e}}function js(){}js.prototype={constructor:js,point:function(r,t){this.stream.point(r,t)},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()}};function Fu(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o!=null&&r.clipExtent(null),bc(e,r.stream(Du));var s=Du.result(),a=Math.min(n/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+t[0][0]+(n-a*(s[1][0]+s[0][0]))/2,l=+t[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&r.clipExtent(o),r.scale(a*150).translate([u,l])}function qc(r,t,e){return Fu(r,[[0,0],t],e)}var Bu=16,Xc=bt(30*Cn);function Gu(r,t){return+t?Hc(r,t):Yc(r)}function Yc(r){return Au({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function Hc(r,t){function e(n,i,o,s,a,u,l,c,f,h,g,p,y,d){var _=l-n,I=c-i,C=_*_+I*I;if(C>4*t&&y--){var L=s+h,x=a+g,w=u+p,A=Eo(L*L+x*x+w*w),B=Ui(w/=A),F=ae(ae(w)-1)<dt||ae(o-f)<dt?(o+f)/2:Vi(x,L),q=r(F,B),j=q[0],P=q[1],X=j-n,R=P-i,Y=I*X-_*R;(Y*Y/C>t||ae((_*X+I*R)/C-.5)>.3||s*h+a*g+u*p<Xc)&&(e(n,i,o,s,a,u,j,P,F,L/=A,x/=A,w,y,d),d.point(j,P),e(j,P,F,L,x,w,l,c,f,h,g,p,y,d))}}return function(n){var i,o,s,a,u,l,c,f,h,g,p,y,d={point:_,lineStart:I,lineEnd:L,polygonStart:function(){n.polygonStart(),d.lineStart=x},polygonEnd:function(){n.polygonEnd(),d.lineStart=I}};function _(B,F){B=r(B,F),n.point(B[0],B[1])}function I(){f=NaN,d.point=C,n.lineStart()}function C(B,F){var q=qi([B,F]),j=r(B,F);e(f,h,c,g,p,y,f=j[0],h=j[1],c=B,g=q[0],p=q[1],y=q[2],Bu,n),n.point(f,h)}function L(){d.point=_,n.lineEnd()}function x(){I(),d.point=w,d.lineEnd=A}function w(B,F){C(i=B,F),o=f,s=h,a=g,u=p,l=y,d.point=C}function A(){e(f,h,c,g,p,y,o,s,i,a,u,l,Bu,n),d.lineEnd=L,L()}return d}}var Wc=Au({point:function(r,t){this.stream.point(r*Cn,t*Cn)}});function jc(r){return Kc(function(){return r})()}function Kc(r){var t,e=150,n=480,i=250,o,s,a=0,u=0,l=0,c=0,f=0,h,g,p=null,y=Mu,d=null,_,I,C,L=Ou,x=.5,w=Gu(j,x),A,B;function F(R){return R=g(R[0]*Cn,R[1]*Cn),[R[0]*e+o,s-R[1]*e]}function q(R){return R=g.invert((R[0]-o)/e,(s-R[1])/e),R&&[R[0]*qr,R[1]*qr]}function j(R,Y){return R=t(R,Y),[R[0]*e+o,s-R[1]*e]}F.stream=function(R){return A&&B===R?A:A=Wc(y(h,w(L(B=R))))},F.clipAngle=function(R){return arguments.length?(y=+R?Uc(p=R*Cn,6*Cn):(p=null,Mu),X()):p*qr},F.clipExtent=function(R){return arguments.length?(L=R==null?(d=_=I=C=null,Ou):Mc(d=+R[0][0],_=+R[0][1],I=+R[1][0],C=+R[1][1]),X()):d==null?null:[[d,_],[I,C]]},F.scale=function(R){return arguments.length?(e=+R,P()):e},F.translate=function(R){return arguments.length?(n=+R[0],i=+R[1],P()):[n,i]},F.center=function(R){return arguments.length?(a=R[0]%360*Cn,u=R[1]%360*Cn,P()):[a*qr,u*qr]},F.rotate=function(R){return arguments.length?(l=R[0]%360*Cn,c=R[1]%360*Cn,f=R.length>2?R[2]%360*Cn:0,P()):[l*qr,c*qr,f*qr]},F.precision=function(R){return arguments.length?(w=Gu(j,x=R*R),X()):Eo(x)},F.fitExtent=function(R,Y){return Fu(F,R,Y)},F.fitSize=function(R,Y){return qc(F,R,Y)};function P(){g=Iu(h=Pc(l,c,f),t);var R=t(a,u);return o=n-R[0]*e,s=i+R[1]*e,X()}function X(){return A=B=null,F}return function(){return t=r.apply(this,arguments),F.invert=t.invert&&q,P()}}function Qc(r){return function(t,e){var n=bt(t),i=bt(e),o=r(n*i);return[o*i*Pt(t),o*Pt(e)]}}function Jc(r){return function(t,e){var n=Eo(t*t+e*e),i=r(n),o=Pt(i),s=bt(i);return[Vi(t*o,n*s),Ui(n&&e*o/n)]}}var ku=Qc(function(r){return(r=yu(r))&&r/Pt(r)});ku.invert=Jc(function(r){return r});function Zc(){return jc(ku).scale(79.4188).clipAngle(180-.001)}function zu(r,t){return[r,t]}zu.invert=zu;function $c(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(r.type){case"GeometryCollection":return Ba(r,function(s){var a=ss(s,t,n,i);a&&o.push(a)}),Cs(o);case"FeatureCollection":return Fa(r,function(s){var a=ss(s,t,n,i);a&&Fa(a,function(u){u&&o.push(u)})}),Cs(o)}return ss(r,t,n,i)}function ss(r,t,e,n){var i=r.properties||{},o=r.type==="Feature"?r.geometry:r;if(o.type==="GeometryCollection"){var s=[];return Ba(r,function(y){var d=ss(y,t,e,n);d&&s.push(d)}),Cs(s)}var a=tf(o),u={type:o.type,coordinates:Uu(o.coordinates,a)},l=new Ds,c=l.read(u),f=rc(ic(t,e),"meters"),h=zt.bufferOp(c,f,n),g=new Ka;if(h=g.write(h),!Vu(h.coordinates)){var p={type:h.type,coordinates:qu(h.coordinates,a)};return Ro(p,i)}}function Vu(r){return Array.isArray(r[0])?Vu(r[0]):isNaN(r[0])}function Uu(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return Uu(e,t)})}function qu(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return qu(e,t)})}function tf(r){var t=lc(r).geometry.coordinates,e=[-t[0],-t[1]];return Zc().rotate(e).scale(Ne)}function ef(r,t){var e=Oo(r),n=Oo(t),i=r.properties||{},o=Ra.difference(e.coordinates,n.coordinates);return o.length===0?null:o.length===1?Da(o[0],i):Ta(o,i)}function Xu(r){let t;for(const e of r)t&&e[0]-t[0]>=180?e[0]-=360:t&&e[0]-t[0]<-180&&(e[0]+=360),t=e}function Yu(r,t){const e=ef({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},r);if(!e)return;e.properties={isMask:"y"};const n=$c(r,0);if(n.geometry.type==="Polygon")for(const i of n.geometry.coordinates)Xu(i);else for(const i of n.geometry.coordinates)for(const o of i)Xu(o);t({type:"FeatureCollection",features:[n,e]})}function Hu(r,t=!0,e=!0,n={},i={},o=s=>{var l,c,f;const a=(l=s==null?void 0:s.geometry)==null?void 0:l.type,u=(c=s==null?void 0:s.properties)!=null&&c.isMask?0:a==="LineString"||a==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(f=s==null?void 0:s.properties)!=null&&f.isMask?.1:0,weight:u,dashArray:[u,u],lineCap:"butt"}}){let s,a,u=[],l,c,f=en.geoJSON(void 0,{style:o,interactive:!1}).addTo(r);const h=()=>{let d;const _=r.getZoom()>10?[(d=r.getCenter().wrap()).lng,d.lat]:void 0;a!==_&&(a=_,s==null||s({type:"proximityChange",proximity:_}))},g=d=>{s==null||s({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function p(d,_=!1){const I=document.createElement("div");return new uc({props:{displayIn:"leaflet"},target:I}),new en.Marker(d,{interactive:_,icon:new en.DivIcon({html:I,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(s=d,r.on("moveend",h),h(),r.on("click",g)):(r.off("moveend",h),s==null||s({type:"proximityChange",proximity:void 0}),s=void 0,r.off("click",g))},flyTo(d,_){r.flyTo([d[1],d[0]],_,{duration:2,...n})},fitBounds(d,_){r.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[_,_],duration:2,...i})},indicateReverse(d){r.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var I;if(!t)return;const _=d&&[d[1],d[0]];c?_?c.setLatLng(_):(c.remove(),c=void 0):_&&(c=(typeof t=="object"?new en.Marker(_,t):p(_)).addTo(r),(I=c.getElement())==null||I.classList.add("marker-reverse"))},setMarkers(d,_){if(!t)return;function I(C){f.clearLayers(),C&&f.addData(C)}for(const C of u)C.remove();if(u.length=0,I(),_){let C=!1;if(_.geometry.type==="GeometryCollection"){const x=_.geometry.geometries.filter(w=>w.type==="Polygon"||w.type==="MultiPolygon");if(x.length>0){let w=x.pop();for(const A of x)w=oc(w,A);Yu({..._,geometry:w},I),C=!0}else{const w=_.geometry.geometries.filter(A=>A.type==="LineString"||A.type==="MultiLineString");w.length>0&&(I({..._,geometry:{type:"GeometryCollection",geometries:w}}),C=!0)}}if(!C){if(_.geometry.type==="Polygon"||_.geometry.type==="MultiPolygon")Yu(_,I);else if(_.geometry.type==="LineString"||_.geometry.type==="MultiLineString"){I(_);return}}const L=[_.center[1],_.center[0]];u.push((typeof t=="object"?new en.Marker(L,t):p(L)).addTo(r))}if(e)for(const C of d??[]){if(C===_)continue;const L=[C.center[1],C.center[0]],x=typeof e=="object"?new en.Marker(L,e):p(L,!0);x.addTo(r).bindTooltip(C.place_name.replace(/,.*/,""),{direction:"top"});const w=x.getElement();w&&(w.addEventListener("click",A=>{A.stopPropagation(),s==null||s({type:"markerClick",id:C.id})}),w.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:C.id})}),w.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:C.id})}),w.classList.toggle("marker-fuzzy",!!C.matching_text)),u.push(x)}},setSelectedMarker(d){var _,I;l&&((_=l.getElement())==null||_.classList.toggle("marker-selected",!1)),l=d>-1?u[d]:void 0,(I=l==null?void 0:l.getElement())==null||I.classList.toggle("marker-selected",!0)}}}class Wu extends en.Control{constructor(e){super();ta(this,Gn,void 0);ta(this,fi,void 0);ls(this,fi,e)}onAdd(e){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",en.DomEvent.disableClickPropagation(n),en.DomEvent.disableScrollPropagation(n);const{marker:i,showResultMarkers:o,flyTo:s,fullGeometryStyle:a,...u}=sr(this,fi),l=typeof s=="boolean"?{}:s,c=Hu(e,i,o,l,l,a);ls(this,Gn,new Tl({target:n,props:{mapController:c,flyTo:s===void 0?!0:!!s,...u}}));for(const f of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])sr(this,Gn).$on(f,h=>e.fire(f.toLowerCase(),h.detail));return n}setOptions(e){var u;ls(this,fi,e);const{marker:n,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=sr(this,fi);(u=sr(this,Gn))==null||u.$set(a)}setQuery(e,n=!0){var i;(i=sr(this,Gn))==null||i.setQuery(e,n)}setReverseMode(e){var n;(n=sr(this,Gn))==null||n.$set({reverseActive:e})}focus(){var e;(e=sr(this,Gn))==null||e.focus()}blur(){var e;(e=sr(this,Gn))==null||e.blur()}onRemove(){var e;(e=sr(this,Gn))==null||e.$destroy()}}Gn=new WeakMap,fi=new WeakMap;function nf(...r){return new Wu(...r)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=nf),Ot.GeocodingControl=Wu,Ot.createLeafletMapController=Hu,Object.defineProperty(Ot,Symbol.toStringTag,{value:"Module"})});
|
|
26
26
|
//# sourceMappingURL=leaflet.umd.cjs.map
|