earthsdk3 3.4.0-beta.18 → 3.4.0-beta.19

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.
@@ -1,7 +1,7 @@
1
- var EarthSDK3=function(M,p){"use strict";var RM=Object.defineProperty;var FM=(M,p,Zo)=>p in M?RM(M,p,{enumerable:!0,configurable:!0,writable:!0,value:Zo}):M[p]=Zo;var g=(M,p,Zo)=>FM(M,typeof p!="symbol"?p+"":p,Zo);function Zo(){const n=navigator.userAgent;let t="Unknown";/Windows/.test(n)?t="Windows":/Macintosh/.test(n)?t="MacOS":/Linux/.test(n)?t="Linux":/Android/.test(n)?t="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?e="x64":/x86|i686|Win32/.test(n)?e="x86":/arm64|aarch64/.test(n)?e="arm64":/arm/.test(n)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const gy=Date.now();function Rg(n){const{os:t,arch:e}=Zo(),r={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-gy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(r));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}M.copyright=void 0;try{const n="earthsdk3",t="3.4.0-beta.18",e="2025-09-09T00:34:08.000Z",r="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="937e73065a56c6e2c7bb82ca7812858a91f3853f",a=((Date.now()-1757378048e3)/36e5).toFixed(1),u=`%c🌏 ${n}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
1
+ var EarthSDK3=function(M,p){"use strict";var RM=Object.defineProperty;var FM=(M,p,Zo)=>p in M?RM(M,p,{enumerable:!0,configurable:!0,writable:!0,value:Zo}):M[p]=Zo;var g=(M,p,Zo)=>FM(M,typeof p!="symbol"?p+"":p,Zo);function Zo(){const n=navigator.userAgent;let t="Unknown";/Windows/.test(n)?t="Windows":/Macintosh/.test(n)?t="MacOS":/Linux/.test(n)?t="Linux":/Android/.test(n)?t="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?e="x64":/x86|i686|Win32/.test(n)?e="x86":/arm64|aarch64/.test(n)?e="arm64":/arm/.test(n)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const gy=Date.now();function Rg(n){const{os:t,arch:e}=Zo(),r={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-gy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(r));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}M.copyright=void 0;try{const n="earthsdk3",t="3.4.0-beta.19",e="2025-09-09T07:38:04.000Z",r="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="f67aacb710aadc7ef8013d562825b5470d533599",a=((Date.now()-1757403484e3)/36e5).toFixed(1),u=`%c🌏 ${n}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
2
2
  %c${i?i+`
3
3
  `:""}当前网站正在使用${n},此软件版权归${r}所有
4
- `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","937e73065a56c6e2c7bb82ca7812858a91f3853f")},get info(){return u},get date(){return"2025-09-09T00:34:08.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.18"},get name(){return"earthsdk3"},get commitId(){return"937e73065a56c6e2c7bb82ca7812858a91f3853f"},print(){console.info(this.info,`
4
+ `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f67aacb710aadc7ef8013d562825b5470d533599")},get info(){return u},get date(){return"2025-09-09T07:38:04.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.19"},get name(){return"earthsdk3"},get commitId(){return"f67aacb710aadc7ef8013d562825b5470d533599"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -65,7 +65,7 @@ northing meters`+n;var f=h/2,d=0,v=0,_,E,P,y,w;return f>0&&(_=1e5/Math.pow(10,f)
65
65
  `);var s=t+(e?" ":"│ ");n.left&&yf(n.left,s,!1,r,i),n.right&&yf(n.right,s,!0,r,i)}}var _f=function(){function n(t){t===void 0&&(t=GP),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=mf(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var r=new xs(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,s=Ts(t,this._root,i),o=i(t,s.key);return o===0?this._root=s:(o<0?(r.left=s.left,r.right=s,s.left=null):o>0&&(r.right=s.right,r.left=s,s.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,r){var i;if(e===null)return null;e=Ts(t,e,r);var s=r(t,e.key);return s===0?(e.left===null?i=e.right:(i=Ts(t,e.left,r),i.right=e.right),this._size--,i):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Ts(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},n.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=Ts(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},n.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var r=this._root,i=[],s=!1;!s;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(e,r),r=r.right):s=!0;return this},n.prototype.range=function(t,e,r,i){for(var s=[],o=this._comparator,a=this._root,u;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),u=o(a.key,e),u>0)break;if(o(a.key,t)>=0&&r.call(i,a))return this;a=a.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.at=function(t){for(var e=this._root,r=!1,i=0,s=[];!r;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var i=this._comparator;e;){var s=i(t.key,e.key);if(s===0)break;s<0?(r=e,e=e.left):e=e.right}return r},n.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var i=this._comparator;e;){var s=i(t.key,e.key);if(s===0)break;s<0?e=e.left:(r=e,e=e.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return UP(this._root)},n.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var i=t.length,s=this._comparator;if(r&&Sf(t,e,0,i-1,s),this._root===null)this._root=wf(t,e,0,i),this._size=i;else{var o=zP(this.toList(),VP(t,e),s);i=this._size+i,this._root=Ef({head:o},0,i)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return yf(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},n.prototype.update=function(t,e,r){var i=this._comparator,s=W0(t,this._root,i),o=s.left,a=s.right;i(t,e)<0?a=mf(e,r,a,i):o=mf(e,r,o,i),this._root=kP(o,a,i)},n.prototype.split=function(t){return W0(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t,e,r;return FP(this,function(i){switch(i.label){case 0:t=this._root,e=[],r=!1,i.label=1;case 1:return r?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function wf(n,t,e,r){var i=r-e;if(i>0){var s=e+Math.floor(i/2),o=n[s],a=t[s],u=new xs(o,a);return u.left=wf(n,t,e,s),u.right=wf(n,t,s+1,r),u}return null}function VP(n,t){for(var e=new xs(null,null),r=e,i=0;i<n.length;i++)r=r.next=new xs(n[i],t[i]);return r.next=null,e.next}function UP(n){for(var t=n,e=[],r=!1,i=new xs(null,null),s=i;!r;)t?(e.push(t),t=t.left):e.length>0?(t=s=s.next=e.pop(),t=t.right):r=!0;return s.next=null,i.next}function Ef(n,t,e){var r=e-t;if(r>0){var i=t+Math.floor(r/2),s=Ef(n,t,i),o=n.head;return o.left=s,n.head=n.head.next,o.right=Ef(n,i+1,e),o}return null}function zP(n,t,e){for(var r=new xs(null,null),i=r,s=n,o=t;s!==null&&o!==null;)e(s.key,o.key)<0?(i.next=s,s=s.next):(i.next=o,o=o.next),i=i.next;return s!==null?i.next=s:o!==null&&(i.next=o),r.next}function Sf(n,t,e,r,i){if(!(e>=r)){for(var s=n[e+r>>1],o=e-1,a=r+1;;){do o++;while(i(n[o],s)<0);do a--;while(i(n[a],s)>0);if(o>=a)break;var u=n[o];n[o]=n[a],n[a]=u,u=t[o],t[o]=t[a],t[a]=u}Sf(n,t,e,a,i),Sf(n,t,a+1,r,i)}}const es=11102230246251565e-32,_r=134217729,qP=(3+8*es)*es;function Cf(n,t,e,r,i){let s,o,a,u,l=t[0],c=r[0],h=0,f=0;c>l==c>-l?(s=l,l=t[++h]):(s=c,c=r[++f]);let d=0;if(h<n&&f<e)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=t[++h]):(o=c+s,a=s-(o-c),c=r[++f]),s=o,a!==0&&(i[d++]=a);h<n&&f<e;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++h]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=r[++f]),s=o,a!==0&&(i[d++]=a);for(;h<n;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++h],s=o,a!==0&&(i[d++]=a);for(;f<e;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=r[++f],s=o,a!==0&&(i[d++]=a);return(s!==0||d===0)&&(i[d++]=s),d}function WP(n,t){let e=t[0];for(let r=1;r<n;r++)e+=t[r];return e}function el(n){return new Float64Array(n)}const HP=(3+16*es)*es,XP=(2+12*es)*es,BP=(9+64*es)*es*es,va=el(4),H0=el(8),X0=el(12),B0=el(16),Lr=el(4);function YP(n,t,e,r,i,s,o){let a,u,l,c,h,f,d,v,_,E,P,y,w,m,S,C,I,b;const x=n-i,A=e-i,N=t-s,T=r-s;m=x*T,f=_r*x,d=f-(f-x),v=x-d,f=_r*T,_=f-(f-T),E=T-_,S=v*E-(m-d*_-v*_-d*E),C=N*A,f=_r*N,d=f-(f-N),v=N-d,f=_r*A,_=f-(f-A),E=A-_,I=v*E-(C-d*_-v*_-d*E),P=S-I,h=S-P,va[0]=S-(P+h)+(h-I),y=m+P,h=y-m,w=m-(y-h)+(P-h),P=w-C,h=w-P,va[1]=w-(P+h)+(h-C),b=y+P,h=b-y,va[2]=y-(b-h)+(P-h),va[3]=b;let L=WP(4,va),U=XP*o;if(L>=U||-L>=U||(h=n-x,a=n-(x+h)+(h-i),h=e-A,l=e-(A+h)+(h-i),h=t-N,u=t-(N+h)+(h-s),h=r-T,c=r-(T+h)+(h-s),a===0&&u===0&&l===0&&c===0)||(U=BP*o+qP*Math.abs(L),L+=x*c+T*a-(N*l+A*u),L>=U||-L>=U))return L;m=a*T,f=_r*a,d=f-(f-a),v=a-d,f=_r*T,_=f-(f-T),E=T-_,S=v*E-(m-d*_-v*_-d*E),C=u*A,f=_r*u,d=f-(f-u),v=u-d,f=_r*A,_=f-(f-A),E=A-_,I=v*E-(C-d*_-v*_-d*E),P=S-I,h=S-P,Lr[0]=S-(P+h)+(h-I),y=m+P,h=y-m,w=m-(y-h)+(P-h),P=w-C,h=w-P,Lr[1]=w-(P+h)+(h-C),b=y+P,h=b-y,Lr[2]=y-(b-h)+(P-h),Lr[3]=b;const $=Cf(4,va,4,Lr,H0);m=x*c,f=_r*x,d=f-(f-x),v=x-d,f=_r*c,_=f-(f-c),E=c-_,S=v*E-(m-d*_-v*_-d*E),C=N*l,f=_r*N,d=f-(f-N),v=N-d,f=_r*l,_=f-(f-l),E=l-_,I=v*E-(C-d*_-v*_-d*E),P=S-I,h=S-P,Lr[0]=S-(P+h)+(h-I),y=m+P,h=y-m,w=m-(y-h)+(P-h),P=w-C,h=w-P,Lr[1]=w-(P+h)+(h-C),b=y+P,h=b-y,Lr[2]=y-(b-h)+(P-h),Lr[3]=b;const Y=Cf($,H0,4,Lr,X0);m=a*c,f=_r*a,d=f-(f-a),v=a-d,f=_r*c,_=f-(f-c),E=c-_,S=v*E-(m-d*_-v*_-d*E),C=u*l,f=_r*u,d=f-(f-u),v=u-d,f=_r*l,_=f-(f-l),E=l-_,I=v*E-(C-d*_-v*_-d*E),P=S-I,h=S-P,Lr[0]=S-(P+h)+(h-I),y=m+P,h=y-m,w=m-(y-h)+(P-h),P=w-C,h=w-P,Lr[1]=w-(P+h)+(h-C),b=y+P,h=b-y,Lr[2]=y-(b-h)+(P-h),Lr[3]=b;const Z=Cf(Y,X0,4,Lr,B0);return B0[Z-1]}function JP(n,t,e,r,i,s){const o=(t-s)*(e-i),a=(n-i)*(r-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=HP*l?u:-YP(n,t,e,r,i,s,l)}const rl=(n,t)=>n.ll.x<=t.x&&t.x<=n.ur.x&&n.ll.y<=t.y&&t.y<=n.ur.y,Pf=(n,t)=>{if(t.ur.x<n.ll.x||n.ur.x<t.ll.x||t.ur.y<n.ll.y||n.ur.y<t.ll.y)return null;const e=n.ll.x<t.ll.x?t.ll.x:n.ll.x,r=n.ur.x<t.ur.x?n.ur.x:t.ur.x,i=n.ll.y<t.ll.y?t.ll.y:n.ll.y,s=n.ur.y<t.ur.y?n.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:r,y:s}}};let As=Number.EPSILON;As===void 0&&(As=Math.pow(2,-52));const jP=As*As,Y0=(n,t)=>{if(-As<n&&n<As&&-As<t&&t<As)return 0;const e=n-t;return e*e<jP*n*t?0:n<t?-1:1};class QP{constructor(){this.reset()}reset(){this.xRounder=new J0,this.yRounder=new J0}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class J0{constructor(){this.tree=new _f,this.round(0)}round(t){const e=this.tree.add(t),r=this.tree.prev(e);if(r!==null&&Y0(e.key,r.key)===0)return this.tree.remove(t),r.key;const i=this.tree.next(e);return i!==null&&Y0(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const nl=new QP,mh=(n,t)=>n.x*t.y-n.y*t.x,j0=(n,t)=>n.x*t.x+n.y*t.y,Q0=(n,t,e)=>{const r=JP(n.x,n.y,t.x,t.y,e.x,e.y);return r>0?-1:r<0?1:0},yh=n=>Math.sqrt(j0(n,n)),$P=(n,t,e)=>{const r={x:t.x-n.x,y:t.y-n.y},i={x:e.x-n.x,y:e.y-n.y};return mh(i,r)/yh(i)/yh(r)},KP=(n,t,e)=>{const r={x:t.x-n.x,y:t.y-n.y},i={x:e.x-n.x,y:e.y-n.y};return j0(i,r)/yh(i)/yh(r)},$0=(n,t,e)=>t.y===0?null:{x:n.x+t.x/t.y*(e-n.y),y:e},K0=(n,t,e)=>t.x===0?null:{x:e,y:n.y+t.y/t.x*(e-n.x)},ZP=(n,t,e,r)=>{if(t.x===0)return K0(e,r,n.x);if(r.x===0)return K0(n,t,e.x);if(t.y===0)return $0(e,r,n.y);if(r.y===0)return $0(n,t,e.y);const i=mh(t,r);if(i==0)return null;const s={x:e.x-n.x,y:e.y-n.y},o=mh(s,t)/i,a=mh(s,r)/i,u=n.x+a*t.x,l=e.x+o*r.x,c=n.y+a*t.y,h=e.y+o*r.y,f=(u+l)/2,d=(c+h)/2;return{x:f,y:d}};class Pn{static compare(t,e){const r=Pn.comparePoints(t.point,e.point);return r!==0?r:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:Os.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let r=0,i=e.length;r<i;r++){const s=e[r];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const r=this.point.events[e];if(r.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const s=this.point.events[i];s.consumedBy===void 0&&r.otherSE.point.events===s.otherSE.point.events&&r.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,r=this.point.events.length;e<r;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,r=i=>{const s=i.otherSE;e.set(i,{sine:$P(this.point,t.point,s.point),cosine:KP(this.point,t.point,s.point)})};return(i,s)=>{e.has(i)||r(i),e.has(s)||r(s);const{sine:o,cosine:a}=e.get(i),{sine:u,cosine:l}=e.get(s);return o>=0&&u>=0?a<l?1:a>l?-1:0:o<0&&u<0?a<l?-1:a>l?1:0:u<o?-1:u>o?1:0}}}let tI=0;class Os{static compare(t,e){const r=t.leftSE.point.x,i=e.leftSE.point.x,s=t.rightSE.point.x,o=e.rightSE.point.x;if(o<r)return 1;if(s<i)return-1;const a=t.leftSE.point.y,u=e.leftSE.point.y,l=t.rightSE.point.y,c=e.rightSE.point.y;if(r<i){if(u<a&&u<l)return 1;if(u>a&&u>l)return-1;const h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(t.rightSE.point);return f!==0?f:-1}if(r>i){if(a<u&&a<c)return-1;if(a>u&&a>c)return 1;const h=e.comparePoint(t.leftSE.point);if(h!==0)return h;const f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(a<u)return-1;if(a>u)return 1;if(s<o){const h=e.comparePoint(t.rightSE.point);if(h!==0)return h}if(s>o){const h=t.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(s!==o){const h=l-a,f=s-r,d=c-u,v=o-i;if(h>f&&d<v)return 1;if(h<f&&d>v)return-1}return s>o?1:s<o||l<c?-1:l>c?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,r,i){this.id=++tI,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=i}static fromRing(t,e,r){let i,s,o;const a=Pn.comparePoints(t,e);if(a<0)i=t,s=e,o=1;else if(a>0)i=e,s=t,o=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const u=new Pn(i,!0),l=new Pn(s,!1);return new Os(u,l,[r],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(e.x===r.x)return t.x===e.x?0:t.x<e.x?1:-1;const s=(t.y-e.y)/i.y,o=e.x+s*i.x;if(t.x===o)return 0;const a=(t.x-e.x)/i.x,u=e.y+a*i.y;return t.y===u?0:t.y<u?-1:1}getIntersection(t){const e=this.bbox(),r=t.bbox(),i=Pf(e,r);if(i===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,u=t.rightSE.point,l=rl(e,a)&&this.comparePoint(a)===0,c=rl(r,s)&&t.comparePoint(s)===0,h=rl(e,u)&&this.comparePoint(u)===0,f=rl(r,o)&&t.comparePoint(o)===0;if(c&&l)return f&&!h?o:!f&&h?u:null;if(c)return h&&s.x===u.x&&s.y===u.y?null:s;if(l)return f&&o.x===a.x&&o.y===a.y?null:a;if(f&&h)return null;if(f)return o;if(h)return u;const d=ZP(s,this.vector(),a,t.vector());return d===null||!rl(i,d)?null:nl.round(d.x,d.y)}split(t){const e=[],r=t.events!==void 0,i=new Pn(t,!0),s=new Pn(t,!1),o=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(i);const a=new Os(i,o,this.rings.slice(),this.windings.slice());return Pn.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Pn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,r=this.windings.length;e<r;e++)this.windings[e]*=-1}consume(t){let e=this,r=t;for(;e.consumedBy;)e=e.consumedBy;for(;r.consumedBy;)r=r.consumedBy;const i=Os.compare(e,r);if(i!==0){if(i>0){const s=e;e=r,r=s}if(e.prev===r){const s=e;e=r,r=s}for(let s=0,o=r.rings.length;s<o;s++){const a=r.rings[s],u=r.windings[s],l=e.rings.indexOf(a);l===-1?(e.rings.push(a),e.windings.push(u)):e.windings[l]+=u}r.rings=null,r.windings=null,r.consumedBy=e,r.leftSE.consumedBy=e.leftSE,r.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,r=this._afterState.windings,i=this._afterState.multiPolys;for(let a=0,u=this.rings.length;a<u;a++){const l=this.rings[a],c=this.windings[a],h=e.indexOf(l);h===-1?(e.push(l),r.push(c)):r[h]+=c}const s=[],o=[];for(let a=0,u=e.length;a<u;a++){if(r[a]===0)continue;const l=e[a],c=l.poly;if(o.indexOf(c)===-1)if(l.isExterior)s.push(c);else{o.indexOf(c)===-1&&o.push(c);const h=s.indexOf(l.poly);h!==-1&&s.splice(h,1)}}for(let a=0,u=s.length;a<u;a++){const l=s[a].multiPoly;i.indexOf(l)===-1&&i.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(ri.type){case"union":{const r=t.length===0,i=e.length===0;this._isInResult=r!==i;break}case"intersection":{let r,i;t.length<e.length?(r=t.length,i=e.length):(r=e.length,i=t.length),this._isInResult=i===ri.numMultiPolys&&r<i;break}case"xor":{const r=Math.abs(t.length-e.length);this._isInResult=r%2===1;break}case"difference":{const r=i=>i.length===1&&i[0].isSubject;this._isInResult=r(t)!==r(e);break}default:throw new Error(`Unrecognized operation type found ${ri.type}`)}return this._isInResult}}class Z0{constructor(t,e,r){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=nl.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let o=1,a=t.length;o<a;o++){if(typeof t[o][0]!="number"||typeof t[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let u=nl.round(t[o][0],t[o][1]);u.x===s.x&&u.y===s.y||(this.segments.push(Os.fromRing(s,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),s=u)}(i.x!==s.x||i.y!==s.y)&&this.segments.push(Os.fromRing(s,i,this))}getSweepEvents(){const t=[];for(let e=0,r=this.segments.length;e<r;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class eI{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Z0(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(let r=1,i=t.length;r<i;r++){const s=new Z0(t[r],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,r=this.interiorRings.length;e<r;e++){const i=this.interiorRings[e].getSweepEvents();for(let s=0,o=i.length;s<o;s++)t.push(i[s])}return t}}class tv{constructor(t,e){if(!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(let r=0,i=t.length;r<i;r++){const s=new eI(t[r],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,r=this.polys.length;e<r;e++){const i=this.polys[e].getSweepEvents();for(let s=0,o=i.length;s<o;s++)t.push(i[s])}return t}}class _h{static factory(t){const e=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,u=s.rightSE;const l=[a],c=a.point,h=[];for(;o=a,a=u,l.push(a),a.point!==c;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const _=l[0].point,E=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${_.x}, ${_.y}]. Last matching segment found ends at [${E.x}, ${E.y}].`)}if(f.length===1){u=f[0].otherSE;break}let d=null;for(let _=0,E=h.length;_<E;_++)if(h[_].point===a.point){d=_;break}if(d!==null){const _=h.splice(d)[0],E=l.splice(_.index);E.unshift(E[0].otherSE),e.push(new _h(E.reverse()));continue}h.push({index:l.length,point:a.point});const v=a.getLeftmostComparator(o);u=f.sort(v)[0].otherSE;break}e.push(new _h(l))}return e}constructor(t){this.events=t;for(let e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let l=1,c=this.events.length-1;l<c;l++){const h=this.events[l].point,f=this.events[l+1].point;Q0(h,t,f)!==0&&(e.push(h),t=h)}if(e.length===1)return null;const r=e[0],i=e[1];Q0(r,t,i)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,u=[];for(let l=o;l!=a;l+=s)u.push([e[l].x,e[l].y]);return u}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,s=this.events.length;i<s;i++){const o=this.events[i];Pn.compare(t,o)>0&&(t=o)}let e=t.segment.prevInResult(),r=e?e.prevInResult():null;for(;;){if(!e)return null;if(!r)return e.ringOut;if(r.ringOut!==e.ringOut)return r.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=r.prevInResult(),r=e?e.prevInResult():null}}}class ev{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,r=this.interiorRings.length;e<r;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class rI{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,r=this.polys.length;e<r;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];if(!s.poly)if(s.isExteriorRing())e.push(new ev(s));else{const o=s.enclosingRing();o.poly||e.push(new ev(o)),o.poly.addInterior(s)}}return e}}class nI{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Os.compare;this.queue=t,this.tree=new _f(e),this.segments=[]}process(t){const e=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),r;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=i,o=i,a,u;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;u===void 0;)o=this.tree.next(o),o===null?u=null:o.key.consumedBy===void 0&&(u=o.key);if(t.isLeft){let l=null;if(a){const h=a.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(l=h),!a.isAnEndpoint(h))){const f=this._splitSafely(a,h);for(let d=0,v=f.length;d<v;d++)r.push(f[d])}}let c=null;if(u){const h=u.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(c=h),!u.isAnEndpoint(h))){const f=this._splitSafely(u,h);for(let d=0,v=f.length;d<v;d++)r.push(f[d])}}if(l!==null||c!==null){let h=null;l===null?h=c:c===null?h=l:h=Pn.comparePoints(l,c)<=0?l:c,this.queue.remove(e.rightSE),r.push(e.rightSE);const f=e.split(h);for(let d=0,v=f.length;d<v;d++)r.push(f[d])}r.length>0?(this.tree.remove(e),r.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&u){const l=a.getIntersection(u);if(l!==null){if(!a.isAnEndpoint(l)){const c=this._splitSafely(a,l);for(let h=0,f=c.length;h<f;h++)r.push(c[h])}if(!u.isAnEndpoint(l)){const c=this._splitSafely(u,l);for(let h=0,f=c.length;h<f;h++)r.push(c[h])}}}this.tree.remove(e)}return r}_splitSafely(t,e){this.tree.remove(t);const r=t.rightSE;this.queue.remove(r);const i=t.split(e);return i.push(r),t.consumedBy===void 0&&this.tree.add(t),i}}const rv=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,iI=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class sI{run(t,e,r){ri.type=t,nl.reset();const i=[new tv(e,!0)];for(let h=0,f=r.length;h<f;h++)i.push(new tv(r[h],!1));if(ri.numMultiPolys=i.length,ri.type==="difference"){const h=i[0];let f=1;for(;f<i.length;)Pf(i[f].bbox,h.bbox)!==null?f++:i.splice(f,1)}if(ri.type==="intersection")for(let h=0,f=i.length;h<f;h++){const d=i[h];for(let v=h+1,_=i.length;v<_;v++)if(Pf(d.bbox,i[v].bbox)===null)return[]}const s=new _f(Pn.compare);for(let h=0,f=i.length;h<f;h++){const d=i[h].getSweepEvents();for(let v=0,_=d.length;v<_;v++)if(s.insert(d[v]),s.size>rv)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new nI(s);let a=s.size,u=s.pop();for(;u;){const h=u.key;if(s.size===a){const d=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(s.size>rv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>iI)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(h);for(let d=0,v=f.length;d<v;d++){const _=f[d];_.consumedBy===void 0&&s.insert(_)}a=s.size,u=s.pop()}nl.reset();const l=_h.factory(o.segments);return new rI(l).getGeom()}}const ri=new sI;var If={union:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return ri.run("union",n,e)},intersection:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return ri.run("intersection",n,e)},xor:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return ri.run("xor",n,e)},difference:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return ri.run("difference",n,e)}};function oI(n,t){var e=yr(n),r=yr(t),i=n.properties||{},s=If.difference(e.coordinates,r.coordinates);return s.length===0?null:s.length===1?ie(s[0],i):rf(s,i)}"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),r=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(s=s<0?Math.max(r+arguments[2],0):Math.min(s,r);i<s;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!==n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var go=function(){};go.prototype.interfaces_=function(){return[]},go.prototype.getClass=function(){return go},go.prototype.equalsWithTolerance=function(t,e,r){return Math.abs(t-e)<=r};var ae=function(n){function t(e){n.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),yt=function(){},nv={MAX_VALUE:{configurable:!0}};yt.isNaN=function(t){return Number.isNaN(t)},yt.doubleToLongBits=function(t){return t},yt.longBitsToDouble=function(t){return t},yt.isInfinite=function(t){return!Number.isFinite(t)},nv.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(yt,nv);var Jr=function(){},wh=function(){},ma=function(){};function jr(){}var D=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.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=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},po={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(t,e){switch(t){case D.X:this.x=e;break;case D.Y:this.y=e;break;case D.Z:this.z=e;break;default:throw new ae("Invalid ordinate index: "+t)}},D.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],r=arguments[1];return!(!go.equalsWithTolerance(this.x,e.x,r)||!go.equalsWithTolerance(this.y,e.y,r))}},D.prototype.getOrdinate=function(t){switch(t){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new ae("Invalid ordinate index: "+t)},D.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||yt.isNaN(this.z))&&yt.isNaN(t.z)},D.prototype.equals=function(t){return t instanceof D?this.equals2D(t):!1},D.prototype.equalInZ=function(t,e){return go.equalsWithTolerance(this.z,t.z,e)},D.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},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+r*r+i*i)},D.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},D.prototype.hashCode=function(){var t=17;return t=37*t+D.hashCode(this.x),t=37*t+D.hashCode(this.y),t},D.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},D.prototype.interfaces_=function(){return[Jr,wh,jr]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=yt.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},po.DimensionalComparator.get=function(){return rs},po.serialVersionUID.get=function(){return 6683108902428367e3},po.NULL_ORDINATE.get=function(){return yt.NaN},po.X.get=function(){return 0},po.Y.get=function(){return 1},po.Z.get=function(){return 2},Object.defineProperties(D,po);var rs=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ae("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};rs.prototype.compare=function(t,e){var r=t,i=e,s=rs.compare(r.x,i.x);if(s!==0)return s;var o=rs.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=rs.compare(r.z,i.z);return a},rs.prototype.interfaces_=function(){return[ma]},rs.prototype.getClass=function(){return rs},rs.compare=function(t,e){return t<e?-1:t>e?1:yt.isNaN(t)?yt.isNaN(e)?0:-1:yt.isNaN(e)?1:0};var ya=function(){};ya.prototype.create=function(){},ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya};var F=function(){},il={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.toLocationSymbol=function(t){switch(t){case F.EXTERIOR:return"e";case F.BOUNDARY:return"b";case F.INTERIOR:return"i";case F.NONE:return"-"}throw new ae("Unknown location value: "+t)},il.INTERIOR.get=function(){return 0},il.BOUNDARY.get=function(){return 1},il.EXTERIOR.get=function(){return 2},il.NONE.get=function(){return-1},Object.defineProperties(F,il);var pt=function(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1},Rr=function(){},iv={LOG_10:{configurable:!0}};Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.log10=function(t){var e=Math.log(t);return yt.isInfinite(e)||yt.isNaN(e)?e:e/Rr.LOG_10},Rr.min=function(t,e,r,i){var s=t;return e<s&&(s=e),r<s&&(s=r),i<s&&(s=i),s},Rr.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],r=arguments[2];return t<e?e:t>r?r:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],o=arguments[2];return i<s?s:i>o?o:i}},Rr.wrap=function(t,e){return t<0?e- -t%e:t%e},Rr.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2],i=t;return e>i&&(i=e),r>i&&(i=r),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},Rr.average=function(t,e){return(t+e)/2},iv.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Rr,iv);var In=function(t){this.str=t};In.prototype.append=function(t){this.str+=t},In.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},In.prototype.toString=function(t){return this.str};var Mn=function(t){this.value=t};Mn.prototype.intValue=function(){return this.value},Mn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Mn.isNaN=function(t){return Number.isNaN(t)};var sl=function(){};sl.isWhitespace=function(t){return t<=32&&t>=0||t===127},sl.toUpperCase=function(t){return t.toUpperCase()};var z=function n(){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 n){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},an={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}};z.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},z.prototype.extractSignificantDigits=function(t,e){var r=this.abs(),i=z.magnitude(r._hi),s=z.TEN.pow(i);r=r.divide(s),r.gt(z.TEN)?(r=r.divide(z.TEN),i+=1):r.lt(z.ONE)&&(r=r.multiply(z.TEN),i-=1);for(var o=i+1,a=new In,u=z.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===o&&a.append(".");var c=Math.trunc(r._hi);if(c<0)break;var h=!1,f=0;c>9?(h=!0,f="9"):f="0"+c,a.append(f),r=r.subtract(z.valueOf(c)).multiply(z.TEN),h&&r.selfAdd(z.TEN);var d=!0,v=z.magnitude(r._hi);if(v<0&&Math.abs(v)>=u-l&&(d=!1),!d)break}return e[0]=i,a.toString()},z.prototype.sqr=function(){return this.multiply(this)},z.prototype.doubleValue=function(){return this._hi+this._lo},z.prototype.subtract=function(){if(arguments[0]instanceof z){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},z.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},z.prototype.isZero=function(){return this._hi===0&&this._lo===0},z.prototype.selfSubtract=function(){if(arguments[0]instanceof z){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)}},z.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},z.prototype.min=function(t){return this.le(t)?this:t},z.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof z){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 r=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/r,c=z.SPLIT*l,s=c-l,f=z.SPLIT*r,s=c-s,o=l-s,a=f-r,h=l*r,a=f-a,u=r-a,f=s*a-h+s*u+o*a+o*u,c=(this._hi-h-f+this._lo-l*i)/r,f=l+c,this._hi=f,this._lo=l-f+c,this}},z.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},z.prototype.divide=function(){if(arguments[0]instanceof z){var t=arguments[0],e=null,r=null,i=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/t._hi,a=z.SPLIT*o,e=a-o,l=z.SPLIT*t._hi,e=a-e,r=o-e,i=l-t._hi,u=o*t._hi,i=l-i,s=t._hi-i,l=e*i-u+e*s+r*i+r*s,a=(this._hi-u-l+this._lo-o*t._lo)/t._hi,l=o+a;var c=l,h=o-l+a;return new z(c,h)}else if(typeof arguments[0]=="number"){var f=arguments[0];return yt.isNaN(f)?z.createNaN():z.copy(this).selfDivide(f,0)}},z.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},z.prototype.pow=function(t){if(t===0)return z.valueOf(1);var e=new z(this),r=z.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},z.prototype.ceil=function(){if(this.isNaN())return z.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new z(t,e)},z.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},z.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},z.prototype.setValue=function(){if(arguments[0]instanceof z){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},z.prototype.max=function(t){return this.ge(t)?this:t},z.prototype.sqrt=function(){if(this.isZero())return z.valueOf(0);if(this.isNegative())return z.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=z.valueOf(e),i=this.subtract(r.sqr()),s=i._hi*(t*.5);return r.add(s)},z.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof z){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],r=null,i=null,s=null,o=null,a=null,u=null;return s=this._hi+e,a=s-this._hi,o=s-a,o=e-a+(this._hi-o),u=o+this._lo,r=s+u,i=u+(s-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],h=null,f=null,d=null,v=null,_=null,E=null,P=null,y=null;_=this._hi+l,d=this._lo+c,P=_-this._hi,y=d-this._lo,E=_-P,v=d-y,E=l-P+(this._hi-E),v=c-y+(this._lo-v),P=E+d,h=_+P,f=P+(_-h),P=v+f;var w=h+P,m=P+(h-w);return this._hi=w,this._lo=m,this}},z.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof z){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 r=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null;l=z.SPLIT*this._hi,s=l-this._hi,c=z.SPLIT*r,s=l-s,o=this._hi-s,a=c-r,l=this._hi*r,a=c-a,u=r-a,c=s*a-l+s*u+o*a+o*u+(this._hi*i+this._lo*r);var h=l+c;s=l-h;var f=c+s;return this._hi=h,this._lo=f,this}},z.prototype.selfSqr=function(){return this.selfMultiply(this)},z.prototype.floor=function(){if(this.isNaN())return z.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new z(t,e)},z.prototype.negate=function(){return this.isNaN()?this:new z(-this._hi,-this._lo)},z.prototype.clone=function(){},z.prototype.multiply=function(){if(arguments[0]instanceof z){var t=arguments[0];return t.isNaN()?z.createNaN():z.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return yt.isNaN(e)?z.createNaN():z.copy(this).selfMultiply(e,0)}},z.prototype.isNaN=function(){return yt.isNaN(this._hi)},z.prototype.intValue=function(){return Math.trunc(this._hi)},z.prototype.toString=function(){var t=z.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},z.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),i=e[0]+1,s=r;if(r.charAt(0)===".")s="0"+r;else if(i<0)s="0."+z.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var o=i-r.length,a=z.stringOfChar("0",o);s=r+a+".0"}return this.isNegative()?"-"+s:s},z.prototype.reciprocal=function(){var t=null,e=null,r=null,i=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=z.SPLIT*s,t=o-s,u=z.SPLIT*this._hi,t=o-t,e=s-t,r=u-this._hi,a=s*this._hi,r=u-r,i=this._hi-r,u=t*r-a+t*i+e*r+e*i,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,c=s-l+o;return new z(l,c)},z.prototype.toSciNotation=function(){if(this.isZero())return z.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),i=z.SCI_NOT_EXPONENT_CHAR+e[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var s="";r.length>1&&(s=r.substring(1));var o=r.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},z.prototype.abs=function(){return this.isNaN()?z.NaN:this.isNegative()?this.negate():new z(this)},z.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},z.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},z.prototype.add=function(){if(arguments[0]instanceof z){var t=arguments[0];return z.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return z.copy(this).selfAdd(e)}},z.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 z){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}},z.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},z.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},z.prototype.trunc=function(){return this.isNaN()?z.NaN:this.isPositive()?this.floor():this.ceil()},z.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},z.prototype.interfaces_=function(){return[jr,Jr,wh]},z.prototype.getClass=function(){return z},z.sqr=function(t){return z.valueOf(t).selfMultiply(t)},z.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return z.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new z(e)}},z.sqrt=function(t){return z.valueOf(t).sqrt()},z.parse=function(t){for(var e=0,r=t.length;sl.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<r){var s=t.charAt(e);(s==="-"||s==="+")&&(e++,s==="-"&&(i=!0))}for(var o=new z,a=0,u=0,l=0;!(e>=r);){var c=t.charAt(e);if(e++,sl.isDigit(c)){var h=c-"0";o.selfMultiply(z.TEN),o.selfAdd(h),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var f=t.substring(e);try{l=Mn.parseInt(f)}catch(P){throw P instanceof Error?new Error("Invalid exponent "+f+" in string "+t):P}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var d=o,v=a-u-l;if(v===0)d=o;else if(v>0){var _=z.TEN.pow(v);d=o.divide(_)}else if(v<0){var E=z.TEN.pow(-v);d=o.multiply(E)}return i?d.negate():d},z.createNaN=function(){return new z(yt.NaN,yt.NaN)},z.copy=function(t){return new z(t)},z.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(r)),s=Math.pow(10,i);return s*10<=e&&(i+=1),i},z.stringOfChar=function(t,e){for(var r=new In,i=0;i<e;i++)r.append(t);return r.toString()},an.PI.get=function(){return new z(3.141592653589793,12246467991473532e-32)},an.TWO_PI.get=function(){return new z(6.283185307179586,24492935982947064e-32)},an.PI_2.get=function(){return new z(1.5707963267948966,6123233995736766e-32)},an.E.get=function(){return new z(2.718281828459045,14456468917292502e-32)},an.NaN.get=function(){return new z(yt.NaN,yt.NaN)},an.EPS.get=function(){return 123259516440783e-46},an.SPLIT.get=function(){return 134217729},an.MAX_PRINT_DIGITS.get=function(){return 32},an.TEN.get=function(){return z.valueOf(10)},an.ONE.get=function(){return z.valueOf(1)},an.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},an.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(z,an);var ur=function(){},sv={DP_SAFE_EPSILON:{configurable:!0}};ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur},ur.orientationIndex=function(t,e,r){var i=ur.orientationIndexFilter(t,e,r);if(i<=1)return i;var s=z.valueOf(e.x).selfAdd(-t.x),o=z.valueOf(e.y).selfAdd(-t.y),a=z.valueOf(r.x).selfAdd(-e.x),u=z.valueOf(r.y).selfAdd(-e.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},ur.signOfDet2x2=function(t,e,r,i){var s=t.multiply(i).selfSubtract(e.multiply(r));return s.signum()},ur.intersection=function(t,e,r,i){var s=z.valueOf(i.y).selfSubtract(r.y).selfMultiply(z.valueOf(e.x).selfSubtract(t.x)),o=z.valueOf(i.x).selfSubtract(r.x).selfMultiply(z.valueOf(e.y).selfSubtract(t.y)),a=s.subtract(o),u=z.valueOf(i.x).selfSubtract(r.x).selfMultiply(z.valueOf(t.y).selfSubtract(r.y)),l=z.valueOf(i.y).selfSubtract(r.y).selfMultiply(z.valueOf(t.x).selfSubtract(r.x)),c=u.subtract(l),h=c.selfDivide(a).doubleValue(),f=z.valueOf(t.x).selfAdd(z.valueOf(e.x).selfSubtract(t.x).selfMultiply(h)).doubleValue(),d=z.valueOf(e.x).selfSubtract(t.x).selfMultiply(z.valueOf(t.y).selfSubtract(r.y)),v=z.valueOf(e.y).selfSubtract(t.y).selfMultiply(z.valueOf(t.x).selfSubtract(r.x)),_=d.subtract(v),E=_.selfDivide(a).doubleValue(),P=z.valueOf(r.y).selfAdd(z.valueOf(i.y).selfSubtract(r.y).selfMultiply(E)).doubleValue();return new D(f,P)},ur.orientationIndexFilter=function(t,e,r){var i=null,s=(t.x-r.x)*(e.y-r.y),o=(t.y-r.y)*(e.x-r.x),a=s-o;if(s>0){if(o<=0)return ur.signum(a);i=s+o}else if(s<0){if(o>=0)return ur.signum(a);i=-s-o}else return ur.signum(a);var u=ur.DP_SAFE_EPSILON*i;return a>=u||-a>=u?ur.signum(a):2},ur.signum=function(t){return t>0?1:t<0?-1:0},sv.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(ur,sv);var Dt=function(){},ol={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ol.X.get=function(){return 0},ol.Y.get=function(){return 1},ol.Z.get=function(){return 2},ol.M.get=function(){return 3},Dt.prototype.setOrdinate=function(t,e,r){},Dt.prototype.size=function(){},Dt.prototype.getOrdinate=function(t,e){},Dt.prototype.getCoordinate=function(){},Dt.prototype.getCoordinateCopy=function(t){},Dt.prototype.getDimension=function(){},Dt.prototype.getX=function(t){},Dt.prototype.clone=function(){},Dt.prototype.expandEnvelope=function(t){},Dt.prototype.copy=function(){},Dt.prototype.getY=function(t){},Dt.prototype.toCoordinateArray=function(){},Dt.prototype.interfaces_=function(){return[wh]},Dt.prototype.getClass=function(){return Dt},Object.defineProperties(Dt,ol);var ov=function(){},_a=function(n){function t(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ov),Re=function(){};Re.arraycopy=function(t,e,r,i,s){for(var o=0,a=e;a<e+s;a++)r[i+o]=t[a],o++},Re.getProperty=function(t){return{"line.separator":`
66
66
  `}[t]};var un=function n(){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],r=arguments[1];this.x=e,this.y=r,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.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 h=arguments[0],f=arguments[1],d=arguments[2],v=arguments[3],_=h.y-f.y,E=f.x-h.x,P=h.x*f.y-f.x*h.y,y=d.y-v.y,w=v.x-d.x,m=d.x*v.y-v.x*d.y;this.x=E*m-w*P,this.y=y*P-_*m,this.w=_*w-y*E}};un.prototype.getY=function(){var t=this.y/this.w;if(yt.isNaN(t)||yt.isInfinite(t))throw new _a;return t},un.prototype.getX=function(){var t=this.x/this.w;if(yt.isNaN(t)||yt.isInfinite(t))throw new _a;return t},un.prototype.getCoordinate=function(){var t=new D;return t.x=this.getX(),t.y=this.getY(),t},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.intersection=function(t,e,r,i){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,u=r.y-i.y,l=i.x-r.x,c=r.x*i.y-i.x*r.y,h=o*c-l*a,f=u*a-s*c,d=s*l-u*o,v=h/d,_=f/d;if(yt.isNaN(v)||yt.isInfinite(v)||yt.isNaN(_)||yt.isInfinite(_))throw new _a;return new D(v,_)};var at=function n(){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 D){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof n){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},av={serialVersionUID:{configurable:!0}};at.prototype.getArea=function(){return this.getWidth()*this.getHeight()},at.prototype.equals=function(t){if(!(t instanceof at))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()},at.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new at;var e=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new at(e,i,r,s)},at.prototype.isNull=function(){return this._maxx<this._minx},at.prototype.getMaxX=function(){return this._maxx},at.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof at){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 r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}},at.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof at){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 D){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}},at.prototype.getMinY=function(){return this._miny},at.prototype.getMinX=function(){return this._minx},at.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof at){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 r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},at.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},at.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},at.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},at.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},at.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},at.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},at.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},at.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},at.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},at.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof at){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof D){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}},at.prototype.centre=function(){return this.isNull()?null:new D((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},at.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof at){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 r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},at.prototype.getMaxY=function(){return this._maxy},at.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 r=0;return this._maxy<t._miny?r=t._miny-this._maxy:this._miny>t._maxy&&(r=this._miny-t._maxy),e===0?r:r===0?e:Math.sqrt(e*e+r*r)},at.prototype.hashCode=function(){var t=17;return t=37*t+D.hashCode(this._minx),t=37*t+D.hashCode(this._maxx),t=37*t+D.hashCode(this._miny),t=37*t+D.hashCode(this._maxy),t},at.prototype.interfaces_=function(){return[Jr,jr]},at.prototype.getClass=function(){return at},at.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.x<e.x?t.x:e.x)&&r.x<=(t.x>e.x?t.x:e.x)&&r.y>=(t.y<e.y?t.y:e.y)&&r.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),c=Math.min(i.x,s.x),h=Math.max(i.x,s.x);return!(c>l||h<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),c=Math.min(i.y,s.y),h=Math.max(i.y,s.y),c>l)||h<u)}},av.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(at,av);var bn={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*$/},Eh=function(t){this.geometryFactory=t||new xt};Eh.prototype.read=function(t){var e,r,i;t=t.replace(/[\n\r]/g," ");var s=bn.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=bn.emptyTypeStr.exec(t),s[2]=void 0),s&&(r=s[1].toLowerCase(),i=s[2],wa[r]&&(e=wa[r].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Eh.prototype.write=function(t){return this.extractGeometry(t)},Eh.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Ni[e])return null;var r=e.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+Ni[e].apply(this,[t])+")",i};var Ni={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Ni.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push("("+Ni.point.apply(e,[t._geometries[i]])+")");return r.join(",")},linestring:function(t){for(var e=this,r=[],i=0,s=t._points._coordinates.length;i<s;++i)r.push(Ni.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},linearring:function(t){for(var e=this,r=[],i=0,s=t._points._coordinates.length;i<s;++i)r.push(Ni.coordinate.apply(e,[t._points._coordinates[i]]));return r.join(",")},multilinestring:function(t){for(var e=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push("("+Ni.linestring.apply(e,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var e=this,r=[];r.push("("+Ni.linestring.apply(this,[t._shell])+")");for(var i=0,s=t._holes.length;i<s;++i)r.push("("+Ni.linestring.apply(e,[t._holes[i]])+")");return r.join(",")},multipolygon:function(t){for(var e=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push("("+Ni.polygon.apply(e,[t._geometries[i]])+")");return r.join(",")},geometrycollection:function(t){for(var e=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push(e.extractGeometry(t._geometries[i]));return r.join(",")}},wa={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(bn.spaces);return this.geometryFactory.createPoint(new D(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=t.trim().split(","),s=[],o=0,a=i.length;o<a;++o)r=i[o].replace(bn.trimParens,"$1"),s.push(wa.point.apply(e,[r]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),r=[],i,s=0,o=e.length;s<o;++s)i=e[s].trim().split(bn.spaces),r.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),r=[],i,s=0,o=e.length;s<o;++s)i=e[s].trim().split(bn.spaces),r.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=t.trim().split(bn.parenComma),s=[],o=0,a=i.length;o<a;++o)r=i[o].replace(bn.trimParens,"$1"),s.push(wa.linestring.apply(e,[r]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var r,i,s,o=t.trim().split(bn.parenComma),a,u=[],l=0,c=o.length;l<c;++l)r=o[l].replace(bn.trimParens,"$1"),i=wa.linestring.apply(e,[r]),s=e.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=t.trim().split(bn.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)r=i[o].replace(bn.trimParens,"$1"),s.push(wa.polygon.apply(e,[r]));return this.geometryFactory.createMultiPolygon(s)},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 r=t.trim().split("|"),i=[],s=0,o=r.length;s<o;++s)i.push(e.read(r[s]));return this.geometryFactory.createGeometryCollection(i)}},ln=function(t){this.parser=new Eh(t)};ln.prototype.write=function(t){return this.parser.write(t)},ln.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var xi=function(n){function t(e){n.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new n().stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),Sh=function(n){function t(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var e=arguments[0];n.call(this,e)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xi),Pt=function(){};Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.shouldNeverReachHere=function(){if(arguments.length===0)Pt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Sh("Should never reach here"+(t!==null?": "+t:""))}},Pt.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],Pt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Sh:new Sh(e)},Pt.equals=function(){var t,e,r;if(arguments.length===2)t=arguments[0],e=arguments[1],Pt.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],r=arguments[2],!e.equals(t)))throw new Sh("Expected "+t+" but encountered "+e+(r!==null?": "+r:""))};var le=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 D,this._intPt[1]=new D,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},vo={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};le.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},le.prototype.getTopologySummary=function(){var t=new In;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},le.prototype.computeIntersection=function(t,e,r,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,r,i)},le.prototype.getIntersectionNum=function(){return this._result},le.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),r=this.getEdgeDistance(t,1);e>r?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},le.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},le.prototype.setPrecisionModel=function(t){this._precisionModel=t},le.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],r=0;r<this._result;r++)if(!(t._intPt[r].equals2D(t._inputLines[e][0])||t._intPt[r].equals2D(t._inputLines[e][1])))return!0;return!1}},le.prototype.getIntersection=function(t){return this._intPt[t]},le.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},le.prototype.hasIntersection=function(){return this._result!==le.NO_INTERSECTION},le.prototype.getEdgeDistance=function(t,e){var r=le.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return r},le.prototype.isCollinear=function(){return this._result===le.COLLINEAR_INTERSECTION},le.prototype.toString=function(){return ln.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+ln.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},le.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},le.prototype.isIntersection=function(t){for(var e=this,r=0;r<this._result;r++)if(e._intPt[r].equals2D(t))return!0;return!1},le.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.computeEdgeDistance=function(t,e,r){var i=Math.abs(r.x-e.x),s=Math.abs(r.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(r))i>s?o=i:o=s;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>s?o=a:o=u,o===0&&!t.equals(e)&&(o=Math.max(a,u))}return Pt.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},le.nonRobustComputeEdgeDistance=function(t,e,r){var i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s);return Pt.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},vo.DONT_INTERSECT.get=function(){return 0},vo.DO_INTERSECT.get=function(){return 1},vo.COLLINEAR.get=function(){return 2},vo.NO_INTERSECTION.get=function(){return 0},vo.POINT_INTERSECTION.get=function(){return 1},vo.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(le,vo);var Ds=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(r){var i=new at(this._inputLines[0][0],this._inputLines[0][1]),s=new at(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&s.contains(r)},t.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,at.intersects(i,s,r)&&K.orientationIndex(i,s,r)===0&&K.orientationIndex(s,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(s))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(r,i,s,o,a){a.x=this.smallestInAbsValue(r.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(r.y,i.y,s.y,o.y),r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(r,i,s,o){var a=null;try{a=un.intersection(r,i,s,o)}catch(u){if(u instanceof _a)a=t.nearestEndpoint(r,i,s,o);else throw u}finally{}return a},t.prototype.intersection=function(r,i,s,o){var a=this.intersectionWithNormalization(r,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new D(t.nearestEndpoint(r,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(r,i,s,o){var a=r,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},t.prototype.checkDD=function(r,i,s,o,a){var u=ur.intersection(r,i,s,o),l=this.isInSegmentEnvelopes(u);Re.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Re.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(r,i,s,o){var a=new D(r),u=new D(i),l=new D(s),c=new D(o),h=new D;this.normalizeToEnvCentre(a,u,l,c,h);var f=this.safeHCoordinateIntersection(a,u,l,c);return f.x+=h.x,f.y+=h.y,f},t.prototype.computeCollinearIntersection=function(r,i,s,o){var a=at.intersects(r,i,s),u=at.intersects(r,i,o),l=at.intersects(s,o,r),c=at.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,n.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!u&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!a&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(r,i,s,o,a){var u=r.x<i.x?r.x:i.x,l=r.y<i.y?r.y:i.y,c=r.x>i.x?r.x:i.x,h=r.y>i.y?r.y:i.y,f=s.x<o.x?s.x:o.x,d=s.y<o.y?s.y:o.y,v=s.x>o.x?s.x:o.x,_=s.y>o.y?s.y:o.y,E=u>f?u:f,P=c<v?c:v,y=l>d?l:d,w=h<_?h:_,m=(E+P)/2,S=(y+w)/2;a.x=m,a.y=S,r.x-=a.x,r.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(r,i,s,o){if(this._isProper=!1,!at.intersects(r,i,s,o))return n.NO_INTERSECTION;var a=K.orientationIndex(r,i,s),u=K.orientationIndex(r,i,o);if(a>0&&u>0||a<0&&u<0)return n.NO_INTERSECTION;var l=K.orientationIndex(s,o,r),c=K.orientationIndex(s,o,i);if(l>0&&c>0||l<0&&c<0)return n.NO_INTERSECTION;var h=a===0&&u===0&&l===0&&c===0;return h?this.computeCollinearIntersection(r,i,s,o):(a===0||u===0||l===0||c===0?(this._isProper=!1,r.equals2D(s)||r.equals2D(o)?this._intPt[0]=r:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new D(s):u===0?this._intPt[0]=new D(o):l===0?this._intPt[0]=new D(r):c===0&&(this._intPt[0]=new D(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,s,o)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(r,i,s,o){var a=r,u=K.distancePointLine(r,s,o),l=K.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=K.distancePointLine(s,r,i),l<u&&(u=l,a=s),l=K.distancePointLine(o,r,i),l<u&&(u=l,a=o),a},t}(le),mo=function(){};mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},mo.orientationIndex=function(t,e,r){var i=e.x-t.x,s=e.y-t.y,o=r.x-e.x,a=r.y-e.y;return mo.signOfDet2x2(i,s,o,a)},mo.signOfDet2x2=function(t,e,r,i){var s=null,o=null,a=null;if(s=1,t===0||i===0)return e===0||r===0?0:e>0?r>0?-s:s:r>0?s:-s;if(e===0||r===0)return i>0?t>0?s:-s:t>0?-s:s;if(e>0?i>0?e<=i||(s=-s,o=t,t=r,r=o,o=e,e=i,i=o):e<=-i?(s=-s,r=-r,i=-i):(o=t,t=-r,r=o,o=e,e=-i,i=o):i>0?-e<=i?(s=-s,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,r=-r,i=-i):(s=-s,o=-t,t=-r,r=o,o=-e,e=-i,i=o),t>0)if(r>0){if(!(t<=r))return s}else return s;else{if(r>0)return-s;if(t>=r)s=-s,t=-t,r=-r;else return-s}for(;;){if(a=Math.floor(r/t),r=r-a*t,i=i-a*e,i<0)return-s;if(i>e)return s;if(t>r+r){if(e<i+i)return s}else{if(e>i+i)return-s;r=t-r,i=e-i,s=-s}if(i===0)return r===0?0:-s;if(r===0||(a=Math.floor(t/r),t=t-a*r,e=e-a*i,e<0))return s;if(e>i)return-s;if(r>t+t){if(i<e+e)return-s}else{if(i>e+e)return s;t=r-t,e=i-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var Nn=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Nn.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 r=t.x,i=e.x;return r>i&&(r=e.x,i=t.x),this._p.x>=r&&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 s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=mo.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},Nn.prototype.isPointInPolygon=function(){return this.getLocation()!==F.EXTERIOR},Nn.prototype.getLocation=function(){return this._isPointOnSegment?F.BOUNDARY:this._crossingCount%2===1?F.INTERIOR:F.EXTERIOR},Nn.prototype.isOnSegment=function(){return this._isPointOnSegment},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.locatePointInRing=function(){if(arguments[0]instanceof D&&pt(arguments[1],Dt)){for(var t=arguments[0],e=arguments[1],r=new Nn(t),i=new D,s=new D,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,s),r.countSegment(i,s),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof D&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new Nn(a),c=1;c<u.length;c++){var h=u[c],f=u[c-1];if(l.countSegment(h,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var K=function(){},yo={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.orientationIndex=function(t,e,r){return ur.orientationIndex(t,e,r)},K.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,r=t[0].x,i=1;i<t.length-1;i++){var s=t[i].x-r,o=t[i+1].y,a=t[i-1].y;e+=s*(a-o)}return e/2}else if(pt(arguments[0],Dt)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new D,h=new D,f=new D;u.getCoordinate(0,h),u.getCoordinate(1,f);var d=h.x;f.x-=d;for(var v=0,_=1;_<l-1;_++)c.y=h.y,h.x=f.x,h.y=f.y,u.getCoordinate(_+1,f),f.x-=d,v+=h.x*(c.y-f.y);return v/2}},K.distanceLineLine=function(t,e,r,i){if(t.equals(e))return K.distancePointLine(t,r,i);if(r.equals(i))return K.distancePointLine(i,t,e);var s=!1;if(!at.intersects(t,e,r,i))s=!0;else{var o=(e.x-t.x)*(i.y-r.y)-(e.y-t.y)*(i.x-r.x);if(o===0)s=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y),l=u/o,c=a/o;(c<0||c>1||l<0||l>1)&&(s=!0)}}return s?Rr.min(K.distancePointLine(t,r,i),K.distancePointLine(e,r,i),K.distancePointLine(r,t,e),K.distancePointLine(i,t,e)):0},K.isPointInRing=function(t,e){return K.locatePointInRing(t,e)!==F.EXTERIOR},K.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,i=new D;t.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-s,h=l-o;r+=Math.sqrt(c*c+h*h),s=u,o=l}return r},K.isCCW=function(t){var e=t.length-1;if(e<3)throw new ae("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,s=1;s<=e;s++){var o=t[s];o.y>r.y&&(r=o,i=s)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(r)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(r)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(r)||c.equals2D(r)||l.equals2D(c))return!1;var h=K.computeOrientation(l,r,c),f=!1;return h===0?f=l.x>c.x:f=h>0,f},K.locatePointInRing=function(t,e){return Nn.locatePointInRing(t,e)},K.distancePointLinePerpendicular=function(t,e,r){var i=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),s=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/i;return Math.abs(s)*Math.sqrt(i)},K.computeOrientation=function(t,e,r){return K.orientationIndex(t,e,r)},K.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ae("Line array must contain at least one vertex");for(var r=t.distance(e[0]),i=0;i<e.length-1;i++){var s=K.distancePointLine(t,e[i],e[i+1]);s<r&&(r=s)}return r}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(c<=0)return o.distance(a);if(c>=1)return o.distance(u);var h=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},K.isOnLine=function(t,e){for(var r=new Ds,i=1;i<e.length;i++){var s=e[i-1],o=e[i];if(r.computeIntersection(t,s,o),r.hasIntersection())return!0}return!1},yo.CLOCKWISE.get=function(){return-1},yo.RIGHT.get=function(){return K.CLOCKWISE},yo.COUNTERCLOCKWISE.get=function(){return 1},yo.LEFT.get=function(){return K.COUNTERCLOCKWISE},yo.COLLINEAR.get=function(){return 0},yo.STRAIGHT.get=function(){return K.COLLINEAR},Object.defineProperties(K,yo);var Ti=function(){};Ti.prototype.filter=function(t){},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var gt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},ni={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}};gt.prototype.isGeometryCollection=function(){return this.getSortIndex()===gt.SORTINDEX_GEOMETRYCOLLECTION},gt.prototype.getFactory=function(){return this._factory},gt.prototype.getGeometryN=function(t){return this},gt.prototype.getArea=function(){return 0},gt.prototype.isRectangle=function(){return!1},gt.prototype.equals=function(){if(arguments[0]instanceof gt){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof gt))return!1;var r=e;return this.equalsExact(r)}},gt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},gt.prototype.geometryChanged=function(){this.apply(gt.geometryChangedFilter)},gt.prototype.geometryChangedAction=function(){this._envelope=null},gt.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},gt.prototype.getLength=function(){return 0},gt.prototype.getNumGeometries=function(){return 1},gt.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 r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}},gt.prototype.getUserData=function(){return this._userData},gt.prototype.getSRID=function(){return this._SRID},gt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},gt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===gt.SORTINDEX_GEOMETRYCOLLECTION)throw new ae("This method does not support GeometryCollection arguments")},gt.prototype.equal=function(t,e,r){return r===0?t.equals(e):t.distance(e)<=r},gt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},gt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},gt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new at(this._envelope)},gt.prototype.setSRID=function(t){this._SRID=t},gt.prototype.setUserData=function(t){this._userData=t},gt.prototype.compare=function(t,e){for(var r=t.iterator(),i=e.iterator();r.hasNext()&&i.hasNext();){var s=r.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return r.hasNext()?1:i.hasNext()?-1:0},gt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},gt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===gt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===gt.SORTINDEX_MULTIPOINT||this.getSortIndex()===gt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===gt.SORTINDEX_MULTIPOLYGON},gt.prototype.interfaces_=function(){return[wh,Jr,jr]},gt.prototype.getClass=function(){return gt},gt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},gt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},ni.serialVersionUID.get=function(){return 8763622679187377e3},ni.SORTINDEX_POINT.get=function(){return 0},ni.SORTINDEX_MULTIPOINT.get=function(){return 1},ni.SORTINDEX_LINESTRING.get=function(){return 2},ni.SORTINDEX_LINEARRING.get=function(){return 3},ni.SORTINDEX_MULTILINESTRING.get=function(){return 4},ni.SORTINDEX_POLYGON.get=function(){return 5},ni.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ni.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ni.geometryChangedFilter.get=function(){return Mf},Object.defineProperties(gt,ni);var Mf=function(){};Mf.interfaces_=function(){return[Ti]},Mf.filter=function(t){t.geometryChangedAction()};var ii=function(){};ii.prototype.filter=function(t){},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii};var Qr=function(){},Ai={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}};Qr.prototype.isInBoundary=function(t){},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Ai.Mod2BoundaryNodeRule.get=function(){return Ea},Ai.EndPointBoundaryNodeRule.get=function(){return Sa},Ai.MultiValentEndPointBoundaryNodeRule.get=function(){return Ca},Ai.MonoValentEndPointBoundaryNodeRule.get=function(){return Pa},Ai.MOD2_BOUNDARY_RULE.get=function(){return new Ea},Ai.ENDPOINT_BOUNDARY_RULE.get=function(){return new Sa},Ai.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ca},Ai.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Pa},Ai.OGC_SFS_BOUNDARY_RULE.get=function(){return Qr.MOD2_BOUNDARY_RULE},Object.defineProperties(Qr,Ai);var Ea=function(){};Ea.prototype.isInBoundary=function(t){return t%2===1},Ea.prototype.interfaces_=function(){return[Qr]},Ea.prototype.getClass=function(){return Ea};var Sa=function(){};Sa.prototype.isInBoundary=function(t){return t>0},Sa.prototype.interfaces_=function(){return[Qr]},Sa.prototype.getClass=function(){return Sa};var Ca=function(){};Ca.prototype.isInBoundary=function(t){return t>1},Ca.prototype.interfaces_=function(){return[Qr]},Ca.prototype.getClass=function(){return Ca};var Pa=function(){};Pa.prototype.isInBoundary=function(t){return t===1},Pa.prototype.interfaces_=function(){return[Qr]},Pa.prototype.getClass=function(){return Pa};var Pe=function(){};Pe.prototype.add=function(){},Pe.prototype.addAll=function(){},Pe.prototype.isEmpty=function(){},Pe.prototype.iterator=function(){},Pe.prototype.size=function(){},Pe.prototype.toArray=function(){},Pe.prototype.remove=function(){};function bf(n){this.message=n||""}bf.prototype=new Error,bf.prototype.name="IndexOutOfBoundsException";var Ia=function(){};Ia.prototype.hasNext=function(){},Ia.prototype.next=function(){},Ia.prototype.remove=function(){};var hn=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Pe);function Ma(n){this.message=n||""}Ma.prototype=new Error,Ma.prototype.name="NoSuchElementException";var j=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Pe&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[n,Pe]},t.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(r){for(var i=this,s=r.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.set=function(r,i){var s=this.array_[r];return this.array_[r]=i,s},t.prototype.iterator=function(){return new aI(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new bf;return this.array_[r]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var r=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(r.array_[s]);return i},t.prototype.remove=function(r){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===r){i.array_.splice(o,1),s=!0;break}return s},t}(hn),aI=function(n){function t(e){n.call(this),this.arrayList_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Ma;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(Ia),al=function(n){function t(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.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 s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,s=n.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];n.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof D&&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}n.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var h=arguments[0],f=arguments[1];return this.add(h,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],v=arguments[1],_=arguments[2];if(_)for(var E=0;E<d.length;E++)i.add(d[E],v);else for(var P=d.length-1;P>=0;P--)i.add(d[P],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof D){var y=arguments[0],w=arguments[1],m=arguments[2];if(!m){var S=this.size();if(S>0){if(y>0){var C=this.get(y-1);if(C.equals2D(w))return null}if(y<S){var I=this.get(y);if(I.equals2D(w))return null}}}n.prototype.add.call(this,y,w)}}else if(arguments.length===4){var b=arguments[0],x=arguments[1],A=arguments[2],N=arguments[3],T=1;A>N&&(T=-1);for(var L=A;L!==N;L+=T)i.add(b[L],x);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new D(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(j),Nt=function(){},Ch={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ch.ForwardComparator.get=function(){return ul},Ch.BidirectionalComparator.get=function(){return ba},Ch.coordArrayType.get=function(){return new Array(0).fill(null)},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Nt.ptNotInList=function(t,e){for(var r=0;r<t.length;r++){var i=t[r];if(Nt.indexOf(i,e)<0)return i}return null},Nt.scroll=function(t,e){var r=Nt.indexOf(e,t);if(r<0)return null;var i=new Array(t.length).fill(null);Re.arraycopy(t,r,i,0,t.length-r),Re.arraycopy(t,0,i,t.length-r,r),Re.arraycopy(i,0,t,0,t.length)},Nt.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 r=0;r<t.length;r++)if(!t[r].equals(e[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},Nt.intersection=function(t,e){for(var r=new al,i=0;i<t.length;i++)e.intersects(t[i])&&r.add(t[i],!0);return r.toCoordinateArray()},Nt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Nt.removeRepeatedPoints=function(t){if(!Nt.hasRepeatedPoints(t))return t;var e=new al(t,!1);return e.toCoordinateArray()},Nt.reverse=function(t){for(var e=t.length-1,r=Math.trunc(e/2),i=0;i<=r;i++){var s=t[i];t[i]=t[e-i],t[e-i]=s}},Nt.removeNull=function(t){for(var e=0,r=0;r<t.length;r++)t[r]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(i[s++]=t[o]);return i},Nt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),r=0;r<t.length;r++)e[r]=new D(t[r]);return e}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new D(i[s+l])},Nt.isEqualReversed=function(t,e){for(var r=0;r<t.length;r++){var i=t[r],s=e[t.length-r-1];if(i.compareTo(s)!==0)return!1}return!0},Nt.envelope=function(t){for(var e=new at,r=0;r<t.length;r++)e.expandToInclude(t[r]);return e},Nt.toCoordinateArray=function(t){return t.toArray(Nt.coordArrayType)},Nt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Nt.indexOf=function(t,e){for(var r=0;r<e.length;r++)if(t.equals(e[r]))return r;return-1},Nt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var r=t.length-1-e,i=t[e].compareTo(t[r]);if(i!==0)return i}return 1},Nt.compare=function(t,e){for(var r=0;r<t.length&&r<e.length;){var i=t[r].compareTo(e[r]);if(i!==0)return i;r++}return r<e.length?-1:r<t.length?1:0},Nt.minCoordinate=function(t){for(var e=null,r=0;r<t.length;r++)(e===null||e.compareTo(t[r])>0)&&(e=t[r]);return e},Nt.extract=function(t,e,r){e=Rr.clamp(e,0,t.length),r=Rr.clamp(r,-1,t.length);var i=r-e+1;r<0&&(i=0),e>=t.length&&(i=0),r<e&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=e;a<=r;a++)s[o++]=t[a];return s},Object.defineProperties(Nt,Ch);var ul=function(){};ul.prototype.compare=function(t,e){var r=t,i=e;return Nt.compare(r,i)},ul.prototype.interfaces_=function(){return[ma]},ul.prototype.getClass=function(){return ul};var ba=function(){};ba.prototype.compare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var s=Nt.compare(r,i),o=Nt.isEqualReversed(r,i);return o?0:s},ba.prototype.OLDcompare=function(t,e){var r=t,i=e;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var s=Nt.increasingDirection(r),o=Nt.increasingDirection(i),a=s>0?0:r.length-1,u=o>0?0:r.length-1,l=0;l<r.length;l++){var c=r[a].compareTo(i[u]);if(c!==0)return c;a+=s,u+=o}return 0},ba.prototype.interfaces_=function(){return[ma]},ba.prototype.getClass=function(){return ba};var _o=function(){};_o.prototype.get=function(){},_o.prototype.put=function(){},_o.prototype.size=function(){},_o.prototype.values=function(){},_o.prototype.entrySet=function(){};var uI=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(_o);function ll(n){this.message=n||""}ll.prototype=new Error,ll.prototype.name="OperationNotSupported";function Ph(){}Ph.prototype=new Pe,Ph.prototype.contains=function(){};var Nf=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Pe&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(r){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===r)return!0}return!1},t.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},t.prototype.addAll=function(r){for(var i=this,s=r.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.remove=function(r){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 r=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(r.array_[s]);return i},t.prototype.iterator=function(){return new lI(this)},t}(Ph),lI=function(n){function t(e){n.call(this),this.hashSet_=e,this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Ma;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new ll},t}(Ia),Oi=0,Ls=1;function uv(n){return n===null?Oi:n.color}function Zt(n){return n===null?null:n.parent}function Di(n,t){n!==null&&(n.color=t)}function xf(n){return n===null?null:n.left}function lv(n){return n===null?null:n.right}function Xe(){this.root_=null,this.size_=0}Xe.prototype=new uI,Xe.prototype.get=function(n){for(var t=this.root_;t!==null;){var e=n.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},Xe.prototype.put=function(n,t){if(this.root_===null)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:Oi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,r,i;do if(r=e,i=n.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var s=e.value;return e.value=t,s}while(e!==null);var o={key:n,left:null,right:null,value:t,parent:r,color:Oi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=o:r.right=o,this.fixAfterInsertion(o),this.size_++,null},Xe.prototype.fixAfterInsertion=function(n){var t=this;for(n.color=Ls;n!=null&&n!==this.root_&&n.parent.color===Ls;)if(Zt(n)===xf(Zt(Zt(n)))){var e=lv(Zt(Zt(n)));uv(e)===Ls?(Di(Zt(n),Oi),Di(e,Oi),Di(Zt(Zt(n)),Ls),n=Zt(Zt(n))):(n===lv(Zt(n))&&(n=Zt(n),t.rotateLeft(n)),Di(Zt(n),Oi),Di(Zt(Zt(n)),Ls),t.rotateRight(Zt(Zt(n))))}else{var r=xf(Zt(Zt(n)));uv(r)===Ls?(Di(Zt(n),Oi),Di(r,Oi),Di(Zt(Zt(n)),Ls),n=Zt(Zt(n))):(n===xf(Zt(n))&&(n=Zt(n),t.rotateRight(n)),Di(Zt(n),Oi),Di(Zt(Zt(n)),Ls),t.rotateLeft(Zt(Zt(n))))}this.root_.color=Oi},Xe.prototype.values=function(){var n=new j,t=this.getFirstEntry();if(t!==null)for(n.add(t.value);(t=Xe.successor(t))!==null;)n.add(t.value);return n},Xe.prototype.entrySet=function(){var n=new Nf,t=this.getFirstEntry();if(t!==null)for(n.add(t);(t=Xe.successor(t))!==null;)n.add(t);return n},Xe.prototype.rotateLeft=function(n){if(n!=null){var t=n.right;n.right=t.left,t.left!=null&&(t.left.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.left===n?n.parent.left=t:n.parent.right=t,t.left=n,n.parent=t}},Xe.prototype.rotateRight=function(n){if(n!=null){var t=n.left;n.left=t.right,t.right!=null&&(t.right.parent=n),t.parent=n.parent,n.parent===null?this.root_=t:n.parent.right===n?n.parent.right=t:n.parent.left=t,t.right=n,n.parent=t}},Xe.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},Xe.successor=function(n){if(n===null)return null;if(n.right!==null){for(var t=n.right;t.left!==null;)t=t.left;return t}else{for(var e=n.parent,r=n;e!==null&&r===e.right;)r=e,e=e.parent;return e}},Xe.prototype.size=function(){return this.size_};var hl=function(){};hl.prototype.interfaces_=function(){return[]},hl.prototype.getClass=function(){return hl};function hv(){}hv.prototype=new Ph;function xn(){this.array_=[],arguments[0]instanceof Pe&&this.addAll(arguments[0])}xn.prototype=new hv,xn.prototype.contains=function(n){for(var t=this,e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===0)return!0}return!1},xn.prototype.add=function(n){var t=this;if(this.contains(n))return!1;for(var e=0,r=this.array_.length;e<r;e++){var i=t.array_[e];if(i.compareTo(n)===1)return t.array_.splice(e,0,n),!0}return this.array_.push(n),!0},xn.prototype.addAll=function(n){for(var t=this,e=n.iterator();e.hasNext();)t.add(e.next());return!0},xn.prototype.remove=function(n){throw new ll},xn.prototype.size=function(){return this.array_.length},xn.prototype.isEmpty=function(){return this.array_.length===0},xn.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t},xn.prototype.iterator=function(){return new Ih(this)};var Ih=function(n){this.treeSet_=n,this.position_=0};Ih.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Ma;return this.treeSet_.array_[this.position_++]},Ih.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ih.prototype.remove=function(){throw new ll};var Rs=function(){};Rs.sort=function(){var t=arguments[0],e,r,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},t.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},t.sort(s);else if(arguments.length===3){r=t.slice(arguments[1],arguments[2]),r.sort();var o=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(r=t.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},r.sort(s),o=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},Rs.asList=function(t){for(var e=new j,r=0,i=t.length;r<i;r++)e.add(t[r]);return e};var Vt=function(){},cn={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}};cn.P.get=function(){return 0},cn.L.get=function(){return 1},cn.A.get=function(){return 2},cn.FALSE.get=function(){return-1},cn.TRUE.get=function(){return-2},cn.DONTCARE.get=function(){return-3},cn.SYM_FALSE.get=function(){return"F"},cn.SYM_TRUE.get=function(){return"T"},cn.SYM_DONTCARE.get=function(){return"*"},cn.SYM_P.get=function(){return"0"},cn.SYM_L.get=function(){return"1"},cn.SYM_A.get=function(){return"2"},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.toDimensionSymbol=function(t){switch(t){case Vt.FALSE:return Vt.SYM_FALSE;case Vt.TRUE:return Vt.SYM_TRUE;case Vt.DONTCARE:return Vt.SYM_DONTCARE;case Vt.P:return Vt.SYM_P;case Vt.L:return Vt.SYM_L;case Vt.A:return Vt.SYM_A}throw new ae("Unknown dimension value: "+t)},Vt.toDimensionValue=function(t){switch(sl.toUpperCase(t)){case Vt.SYM_FALSE:return Vt.FALSE;case Vt.SYM_TRUE:return Vt.TRUE;case Vt.SYM_DONTCARE:return Vt.DONTCARE;case Vt.SYM_P:return Vt.P;case Vt.SYM_L:return Vt.L;case Vt.SYM_A:return Vt.A}throw new ae("Unknown dimension symbol: "+t)},Object.defineProperties(Vt,cn);var Tn=function(){};Tn.prototype.filter=function(t){},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var fn=function(){};fn.prototype.filter=function(t,e){},fn.prototype.isDone=function(){},fn.prototype.isGeometryChanged=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var $e=function(n){function t(r,i){if(n.call(this,i),this._geometries=r||[],n.hasNullElements(this._geometries))throw new ae("geometries must not contain null elements")}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new at,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},t.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;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],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();Rs.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,s=Vt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var i=this,s=Vt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new xn(Rs.asList(this._geometries)),a=new xn(Rs.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,h=this.getNumGeometries(),f=c.getNumGeometries(),d=0;d<h&&d<f;){var v=i.getGeometryN(d),_=c.getGeometryN(d),E=v.compareToSameClass(_,l);if(E!==0)return E;d++}return d<h?1:d<f?-1:0}},t.prototype.apply=function(){var i=this;if(pt(arguments[0],ii))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(pt(arguments[0],fn)){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(pt(arguments[0],Tn)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(pt(arguments[0],Ti)){var h=arguments[0];h.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(h)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Pt.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,s=n.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].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}(gt),Fs=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return gt.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Vt.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new $r(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[hl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}($e),$r=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Qr.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};$r.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)},$r.prototype.getBoundary=function(){return this._geom instanceof ce?this.boundaryLineString(this._geom):this._geom instanceof Fs?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},$r.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()])},$r.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},$r.prototype.computeBoundaryCoordinates=function(t){var e=this,r=new j;this._endpointMap=new Xe;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);s.getNumPoints()!==0&&(e.addEndpoint(s.getCoordinateN(0)),e.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&r.add(a.getKey())}return Nt.toCoordinateArray(r)},$r.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Mh,this._endpointMap.put(t,e)),e.count++},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new $r(t);return e.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new $r(r,i);return s.getBoundary()}};var Mh=function(){this.count=null};Mh.prototype.interfaces_=function(){return[]},Mh.prototype.getClass=function(){return Mh};function hI(){}function cI(){}var fI=function(){};function dI(){}function gI(){}function pI(){}var Kr=function(){},Tf={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.chars=function(t,e){for(var r=new Array(e).fill(null),i=0;i<e;i++)r[i]=t;return String(r)},Kr.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new dI,r=new hI;return t.printStackTrace(r),e.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new cI(Kr.getStackTrace(i));for(var a=new pI,u=0;u<s;u++)try{o+=a.readLine()+Kr.NEWLINE}catch(l){if(l instanceof gI)Pt.shouldNeverReachHere();else throw l}finally{}return o}},Kr.split=function(t,e){for(var r=e.length,i=new j,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+r),o=s.indexOf(e)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Kr.toString=function(){if(arguments.length===1){var t=arguments[0];return Kr.SIMPLE_ORDINATE_FORMAT.format(t)}},Kr.spaces=function(t){return Kr.chars(" ",t)},Tf.NEWLINE.get=function(){return Re.getProperty("line.separator")},Tf.SIMPLE_ORDINATE_FORMAT.get=function(){return new fI},Object.defineProperties(Kr,Tf);var ge=function(){};ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.copyCoord=function(t,e,r,i){for(var s=Math.min(t.getDimension(),r.getDimension()),o=0;o<s;o++)r.setOrdinate(i,o,t.getOrdinate(e,o))},ge.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Dt.X)===t.getOrdinate(e-1,Dt.X)&&t.getOrdinate(0,Dt.Y)===t.getOrdinate(e-1,Dt.Y)},ge.isEqual=function(t,e){var r=t.size(),i=e.size();if(r!==i)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<r;o++)for(var a=0;a<s;a++){var u=t.getOrdinate(o,a),l=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(yt.isNaN(u)&&yt.isNaN(l)))return!1}return!0},ge.extend=function(t,e,r){var i=t.create(r,e.getDimension()),s=e.size();if(ge.copy(e,0,i,0,s),s>0)for(var o=s;o<r;o++)ge.copy(e,s-1,i,o,1);return i},ge.reverse=function(t){for(var e=t.size()-1,r=Math.trunc(e/2),i=0;i<=r;i++)ge.swap(t,i,e-i)},ge.swap=function(t,e,r){if(e===r)return null;for(var i=0;i<t.getDimension();i++){var s=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(r,i)),t.setOrdinate(r,i,s)}},ge.copy=function(t,e,r,i,s){for(var o=0;o<s;o++)ge.copyCoord(t,e+o,r,i+o)},ge.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var r=t.getDimension(),i=new In;i.append("(");for(var s=0;s<e;s++){s>0&&i.append(" ");for(var o=0;o<r;o++)o>0&&i.append(","),i.append(Kr.toString(t.getOrdinate(s,o)))}return i.append(")"),i.toString()}},ge.ensureValidRing=function(t,e){var r=e.size();if(r===0)return e;if(r<=3)return ge.createClosedRing(t,e,4);var i=e.getOrdinate(0,Dt.X)===e.getOrdinate(r-1,Dt.X)&&e.getOrdinate(0,Dt.Y)===e.getOrdinate(r-1,Dt.Y);return i?e:ge.createClosedRing(t,e,r+1)},ge.createClosedRing=function(t,e,r){var i=t.create(r,e.getDimension()),s=e.size();ge.copy(e,0,i,0,s);for(var o=s;o<r;o++)ge.copy(e,0,i,o,1);return i};var ce=function(n){function t(r,i){n.call(this,i),this._points=null,this.init(r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new at:this._points.expandEnvelope(new at)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;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),o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&ge.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Vt.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 K.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();ge.reverse(i);var s=this.getFactory().createLineString(i);return s},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],h=arguments[1],f=c;return h.compare(this._points,f._points)}},t.prototype.apply=function(){var i=this;if(pt(arguments[0],ii))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(pt(arguments[0],fn)){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(pt(arguments[0],Tn)){var l=arguments[0];l.filter(this)}else if(pt(arguments[0],Ti)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new $r(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=n.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 ae("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).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[hl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(gt),cl=function(){};cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl};var wr=function(n){function t(r,i){n.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new at;var i=new at;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return n.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 Vt.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],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(pt(arguments[0],ii)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(pt(arguments[0],fn)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(pt(arguments[0],Tn)){var o=arguments[0];o.filter(this)}else if(pt(arguments[0],Ti)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=n.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([])),Pt.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[cl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(gt),ns=function(){};ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns};var Ie=function(n){function t(r,i,s){if(n.call(this,s),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),n.hasNullElements(i))throw new ae("holes must not contain null elements");if(r.isEmpty()&&n.hasNonEmptyElements(i))throw new ae("shell is empty but holes are not");this._shell=r,this._holes=i}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),h=0;h<c.length;h++)o++,s[o]=c[h];return s},t.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(K.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(K.signedArea(i._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),h=1;h<=4;h++){var f=i.getX(h),d=i.getY(h),v=f!==l,_=d!==c;if(v===_)return!1;l=f,c=d}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||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],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);Rs.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);Re.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=Nt.minCoordinate(o.getCoordinates());Nt.scroll(u,l),Re.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],K.isCCW(o.getCoordinates())===a&&Nt.reverse(o.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,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,h=this._shell,f=c._shell,d=h.compareToSameClass(f,l);if(d!==0)return d;for(var v=this.getNumInteriorRing(),_=c.getNumInteriorRing(),E=0;E<v&&E<_;){var P=i.getInteriorRingN(E),y=c.getInteriorRingN(E),w=P.compareToSameClass(y,l);if(w!==0)return w;E++}return E<v?1:E<_?-1:0}},t.prototype.apply=function(i){var s=this;if(pt(i,ii)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(pt(i,fn)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(pt(i,Tn))i.filter(this);else if(pt(i,Ti)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var i=this,s=n.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new t(s,o,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[ns]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(gt),Na=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return gt.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Vt.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,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[cl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}($e),si=function(n){function t(r,i){r instanceof D&&i instanceof xt&&(r=i.getCoordinateSequenceFactory().create(r)),n.call(this,r,i),this.validateConstruction()}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return gt.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Vt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();ge.reverse(i);var s=this.getFactory().createLinearRing(i);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new ae("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ae("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}(ce),oi=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return gt.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,s):!1}else return n.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,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new j,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var c=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[ns]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}($e),Zr=function(t){this._factory=t||null,this._isUserDataCopied=!1},bh={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Zr.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Zr.prototype.edit=function(t,e){if(t===null)return null;var r=this.editInternal(t,e);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r},Zr.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof $e?this.editGeometryCollection(t,e):t instanceof Ie?this.editPolygon(t,e):t instanceof wr?e.edit(t,this._factory):t instanceof ce?e.edit(t,this._factory):(Pt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Zr.prototype.editGeometryCollection=function(t,e){for(var r=this,i=e.edit(t,this._factory),s=new j,o=0;o<i.getNumGeometries();o++){var a=r.edit(i.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return i.getClass()===Na?this._factory.createMultiPoint(s.toArray([])):i.getClass()===Fs?this._factory.createMultiLineString(s.toArray([])):i.getClass()===oi?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Zr.prototype.editPolygon=function(t,e){var r=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new j,a=0;a<i.getNumInteriorRing();a++){var u=r.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.GeometryEditorOperation=function(){},bh.NoOpGeometryOperation.get=function(){return fl},bh.CoordinateOperation.get=function(){return dl},bh.CoordinateSequenceOperation.get=function(){return gl},Object.defineProperties(Zr,bh);var fl=function(){};fl.prototype.edit=function(t,e){return t},fl.prototype.interfaces_=function(){return[Zr.GeometryEditorOperation]},fl.prototype.getClass=function(){return fl};var dl=function(){};dl.prototype.edit=function(t,e){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof si?e.createLinearRing(r):t instanceof ce?e.createLineString(r):t instanceof wr?r.length>0?e.createPoint(r[0]):e.createPoint():t},dl.prototype.interfaces_=function(){return[Zr.GeometryEditorOperation]},dl.prototype.getClass=function(){return dl};var gl=function(){};gl.prototype.edit=function(t,e){return t instanceof si?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ce?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof wr?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},gl.prototype.interfaces_=function(){return[Zr.GeometryEditorOperation]},gl.prototype.getClass=function(){return gl};var pe=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 r=0;r<e;r++)t._coordinates[r]=new D}else if(pt(arguments[0],Dt)){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 s=0;s<this._coordinates.length;s++)t._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===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 D}}},cv={serialVersionUID:{configurable:!0}};pe.prototype.setOrdinate=function(t,e,r){switch(e){case Dt.X:this._coordinates[t].x=r;break;case Dt.Y:this._coordinates[t].y=r;break;case Dt.Z:this._coordinates[t].z=r;break;default:throw new ae("invalid ordinateIndex")}},pe.prototype.size=function(){return this._coordinates.length},pe.prototype.getOrdinate=function(t,e){switch(e){case Dt.X:return this._coordinates[t].x;case Dt.Y:return this._coordinates[t].y;case Dt.Z:return this._coordinates[t].z}return yt.NaN},pe.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],r=arguments[1];r.x=this._coordinates[e].x,r.y=this._coordinates[e].y,r.z=this._coordinates[e].z}},pe.prototype.getCoordinateCopy=function(t){return new D(this._coordinates[t])},pe.prototype.getDimension=function(){return this._dimension},pe.prototype.getX=function(t){return this._coordinates[t].x},pe.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].clone();return new pe(e,this._dimension)},pe.prototype.expandEnvelope=function(t){for(var e=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(e._coordinates[r]);return t},pe.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)e[r]=t._coordinates[r].copy();return new pe(e,this._dimension)},pe.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new In(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)e.append(", "),e.append(t._coordinates[r]);return e.append(")"),e.toString()}else return"()"},pe.prototype.getY=function(t){return this._coordinates[t].y},pe.prototype.toCoordinateArray=function(){return this._coordinates},pe.prototype.interfaces_=function(){return[Dt,jr]},pe.prototype.getClass=function(){return pe},cv.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(pe,cv);var ai=function(){},Af={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ai.prototype.readResolve=function(){return ai.instance()},ai.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new pe(t)}else if(pt(arguments[0],Dt)){var e=arguments[0];return new pe(e)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new pe(r):new pe(r,i)}},ai.prototype.interfaces_=function(){return[ya,jr]},ai.prototype.getClass=function(){return ai},ai.instance=function(){return ai.instanceObject},Af.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Af.instanceObject.get=function(){return new ai},Object.defineProperties(ai,Af);var fv=function(n){function t(){n.call(this),this.map_=new Map}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(r){return this.map_.get(r)||null},t.prototype.put=function(r,i){return this.map_.set(r,i),i},t.prototype.values=function(){for(var r=new j,i=this.map_.values(),s=i.next();!s.done;)r.add(s.value),s=i.next();return r},t.prototype.entrySet=function(){var r=new Nf;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(_o),Ut=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof An){var t=arguments[0];this._modelType=t,t===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=n.FIXED,this.setScale(e)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Of={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ut.prototype.equals=function(t){if(!(t instanceof Ut))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Ut.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new Mn(r).compareTo(new Mn(i))},Ut.prototype.getScale=function(){return this._scale},Ut.prototype.isFloating=function(){return this._modelType===Ut.FLOATING||this._modelType===Ut.FLOATING_SINGLE},Ut.prototype.getType=function(){return this._modelType},Ut.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Ut.FLOATING?t="Floating":this._modelType===Ut.FLOATING_SINGLE?t="Floating-Single":this._modelType===Ut.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Ut.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(yt.isNaN(t))return t;if(this._modelType===Ut.FLOATING_SINGLE){var e=t;return e}return this._modelType===Ut.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof D){var r=arguments[0];if(this._modelType===Ut.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},Ut.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Ut.FLOATING?t=16:this._modelType===Ut.FLOATING_SINGLE?t=6:this._modelType===Ut.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Ut.prototype.setScale=function(t){this._scale=Math.abs(t)},Ut.prototype.interfaces_=function(){return[jr,Jr]},Ut.prototype.getClass=function(){return Ut},Ut.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Of.serialVersionUID.get=function(){return 7777263578777804e3},Of.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ut,Of);var An=function n(t){this._name=t||null,n.nameToTypeMap.put(t,this)},Df={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};An.prototype.readResolve=function(){return An.nameToTypeMap.get(this._name)},An.prototype.toString=function(){return this._name},An.prototype.interfaces_=function(){return[jr]},An.prototype.getClass=function(){return An},Df.serialVersionUID.get=function(){return-552860263173159e4},Df.nameToTypeMap.get=function(){return new fv},Object.defineProperties(An,Df),Ut.Type=An,Ut.FIXED=new An("FIXED"),Ut.FLOATING=new An("FLOATING"),Ut.FLOATING_SINGLE=new An("FLOATING SINGLE");var xt=function n(){this._precisionModel=new Ut,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?pt(arguments[0],ya)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ut&&(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]))},dv={serialVersionUID:{configurable:!0}};xt.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new D(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new D(t.getMinX(),t.getMinY()),new D(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new D(t.getMinX(),t.getMinY()),new D(t.getMinX(),t.getMaxY()),new D(t.getMaxX(),t.getMaxY()),new D(t.getMaxX(),t.getMinY()),new D(t.getMinX(),t.getMinY())]),null)},xt.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ce(this.getCoordinateSequenceFactory().create(t),this);if(pt(t,Dt))return new ce(t,this)}else return new ce(this.getCoordinateSequenceFactory().create([]),this)},xt.prototype.createMultiLineString=function(){if(arguments.length===0)return new Fs(null,this);if(arguments.length===1){var t=arguments[0];return new Fs(t,this)}},xt.prototype.buildGeometry=function(t){for(var e=null,r=!1,i=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(xt.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Ie)return this.createMultiPolygon(xt.toPolygonArray(t));if(u instanceof ce)return this.createMultiLineString(xt.toLineStringArray(t));if(u instanceof wr)return this.createMultiPoint(xt.toPointArray(t));Pt.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},xt.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},xt.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof D){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(pt(arguments[0],Dt)){var e=arguments[0];return new wr(e,this)}}},xt.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},xt.prototype.createPolygon=function(){if(arguments.length===0)return new Ie(null,null,this);if(arguments.length===1){if(pt(arguments[0],Dt)){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 si){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new Ie(i,s,this)}},xt.prototype.getSRID=function(){return this._SRID},xt.prototype.createGeometryCollection=function(){if(arguments.length===0)return new $e(null,this);if(arguments.length===1){var t=arguments[0];return new $e(t,this)}},xt.prototype.createGeometry=function(t){var e=new Zr(this);return e.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})},xt.prototype.getPrecisionModel=function(){return this._precisionModel},xt.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(pt(arguments[0],Dt)){var e=arguments[0];return new si(e,this)}}},xt.prototype.createMultiPolygon=function(){if(arguments.length===0)return new oi(null,this);if(arguments.length===1){var t=arguments[0];return new oi(t,this)}},xt.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Na(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Na(e,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(pt(arguments[0],Dt)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());ge.copy(i,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},xt.prototype.interfaces_=function(){return[jr]},xt.prototype.getClass=function(){return xt},xt.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.getDefaultCoordinateSequenceFactory=function(){return ai.instance()},xt.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},xt.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},dv.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(xt,dv);var vI=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Nh=function(t){this.geometryFactory=t||new xt};Nh.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var r=e.type;if(!On[r])throw new Error("Unknown GeoJSON type: "+e.type);return vI.indexOf(r)!==-1?On[r].apply(this,[e.coordinates]):r==="GeometryCollection"?On[r].apply(this,[e.geometries]):On[r].apply(this,[e])},Nh.prototype.write=function(t){var e=t.getGeometryType();if(!Li[e])throw new Error("Geometry is not supported");return Li[e].apply(this,[t])};var On={Feature:function(n){var t={};for(var e in n)t[e]=n[e];if(n.geometry){var r=n.geometry.type;if(!On[r])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=On.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t=this,e={};if(n.features){e.features=[];for(var r=0;r<n.features.length;++r)e.features.push(t.read(n.features[r]))}return n.bbox&&(e.bbox=this.parse.bbox.apply(this,[n.bbox])),e},coordinates:function(n){for(var t=[],e=0;e<n.length;++e){var r=n[e];t.push(new D(r[0],r[1]))}return t},bbox:function(n){return this.geometryFactory.createLinearRing([new D(n[0],n[1]),new D(n[2],n[1]),new D(n[2],n[3]),new D(n[0],n[3]),new D(n[0],n[1])])},Point:function(n){var t=new D(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(On.Point.apply(t,[n[r]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(n){var t=On.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n.length;++r)e.push(On.LineString.apply(t,[n[r]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(n){for(var t=this,e=On.coordinates.apply(this,[n[0]]),r=this.geometryFactory.createLinearRing(e),i=[],s=1;s<n.length;++s){var o=n[s],a=On.coordinates.apply(t,[o]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(On.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n.length;++r){var i=n[r];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Li={coordinate:function(n){return[n.x,n.y]},Point:function(n){var t=Li.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=Li.Point.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(n){for(var t=this,e=[],r=n.getCoordinates(),i=0;i<r.length;++i){var s=r[i];e.push(Li.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=Li.LineString.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(n){var t=this,e=[],r=Li.LineString.apply(this,[n._shell]);e.push(r.coordinates);for(var i=0;i<n._holes.length;++i){var s=n._holes[i],o=Li.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=Li.Polygon.apply(t,[i]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(n){for(var t=this,e=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=i.getGeometryType();e.push(Li[s].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Lf=function(t){this.geometryFactory=t||new xt,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Nh(this.geometryFactory)};Lf.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Ut.FIXED&&this.reducePrecision(e),e},Lf.prototype.reducePrecision=function(t){var e=this,r,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(r=0,i=t.points.length;r<i;r++)e.precisionModel.makePrecise(t.points[r]);else if(t.geometries)for(r=0,i=t.geometries.length;r<i;r++)e.reducePrecision(t.geometries[r])};var gv=function(){this.parser=new Nh(this.geometryFactory)};gv.prototype.write=function(t){return this.parser.write(t)};var B=function(){},xh={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};B.prototype.interfaces_=function(){return[]},B.prototype.getClass=function(){return B},B.opposite=function(t){return t===B.LEFT?B.RIGHT:t===B.RIGHT?B.LEFT:t},xh.ON.get=function(){return 0},xh.LEFT.get=function(){return 1},xh.RIGHT.get=function(){return 2},Object.defineProperties(B,xh);function Th(n){this.message=n||""}Th.prototype=new Error,Th.prototype.name="EmptyStackException";function Dn(){this.array_=[]}Dn.prototype=new hn,Dn.prototype.add=function(n){return this.array_.push(n),!0},Dn.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},Dn.prototype.push=function(n){return this.array_.push(n),n},Dn.prototype.pop=function(n){if(this.array_.length===0)throw new Th;return this.array_.pop()},Dn.prototype.peek=function(){if(this.array_.length===0)throw new Th;return this.array_[this.array_.length-1]},Dn.prototype.empty=function(){return this.array_.length===0},Dn.prototype.isEmpty=function(){return this.empty()},Dn.prototype.search=function(n){return this.array_.indexOf(n)},Dn.prototype.size=function(){return this.array_.length},Dn.prototype.toArray=function(){for(var n=this,t=[],e=0,r=this.array_.length;e<r;e++)t.push(n.array_[e]);return t};var Ln=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ln.prototype.getCoordinate=function(){return this._minCoord},Ln.prototype.getRightmostSide=function(t,e){var r=this.getRightmostSideOfSegment(t,e);return r<0&&(r=this.getRightmostSideOfSegment(t,e-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),r},Ln.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Pt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],r=t[this._minIndex+1],i=K.computeOrientation(this._minCoord,r,e),s=!1;(e.y<this._minCoord.y&&r.y<this._minCoord.y&&i===K.COUNTERCLOCKWISE||e.y>this._minCoord.y&&r.y>this._minCoord.y&&i===K.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},Ln.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge(),i=r.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var s=B.LEFT;return i[e].y<i[e+1].y&&(s=B.RIGHT),s},Ln.prototype.getEdge=function(){return this._orientedDe},Ln.prototype.checkForRightmostCoordinate=function(t){for(var e=this,r=t.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(e._minCoord===null||r[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=r[i])},Ln.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)},Ln.prototype.findEdge=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();i.isForward()&&e.checkForRightmostCoordinate(i)}Pt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===B.LEFT&&(this._orientedDe=this._minDe.getSym())},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln};var Ri=function(n){function t(e,r){n.call(this,t.msgWithCoord(e,r)),this.pt=r?new D(r):null,this.name="TopologyException"}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.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(r,i){return i?r:r+" [ "+i+" ]"},t}(xi),Ah=function(){this.array_=[]};Ah.prototype.addLast=function(t){this.array_.push(t)},Ah.prototype.removeFirst=function(){return this.array_.shift()},Ah.prototype.isEmpty=function(){return this.array_.length===0};var Ke=function(){this._finder=null,this._dirEdgeList=new j,this._nodes=new j,this._rightMostCoord=null,this._env=null,this._finder=new Ln};Ke.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},Ke.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ke.prototype.computeNodeDepth=function(t){for(var e=this,r=null,i=t.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){r=s;break}}if(r===null)throw new Ri("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(r);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},Ke.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(B.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ke.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ke.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(B.RIGHT)>=1&&e.getDepth(B.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ke.prototype.computeDepths=function(t){var e=this,r=new Nf,i=new Ah,s=t.getNode();for(i.addLast(s),r.add(s),t.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();r.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();r.contains(c)||(i.addLast(c),r.add(c))}}}},Ke.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ke.prototype.getEnvelope=function(){if(this._env===null){for(var t=new at,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next(),i=r.getEdge().getCoordinates(),s=0;s<i.length-1;s++)t.expandToInclude(i[s]);this._env=t}return this._env},Ke.prototype.addReachable=function(t){var e=this,r=new Dn;for(r.add(t);!r.empty();){var i=r.pop();e.add(i,r)}},Ke.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(B.LEFT,t.getDepth(B.RIGHT)),e.setDepth(B.RIGHT,t.getDepth(B.LEFT))},Ke.prototype.add=function(t,e){var r=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var s=i.next();r._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},Ke.prototype.getNodes=function(){return this._nodes},Ke.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ke.prototype.interfaces_=function(){return[Jr]},Ke.prototype.getClass=function(){return Ke};var te=function n(){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 r=arguments[0];this.init(1),this.location[B.ON]=r}else if(arguments[0]instanceof n){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)t.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[B.ON]=o,this.location[B.LEFT]=a,this.location[B.RIGHT]=u}};te.prototype.setAllLocations=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]=t},te.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==F.NONE)return!1;return!0},te.prototype.setAllLocationsIfNull=function(t){for(var e=this,r=0;r<this.location.length;r++)e.location[r]===F.NONE&&(e.location[r]=t)},te.prototype.isLine=function(){return this.location.length===1},te.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var r=new Array(3).fill(null);r[B.ON]=this.location[B.ON],r[B.LEFT]=F.NONE,r[B.RIGHT]=F.NONE,this.location=r}for(var i=0;i<this.location.length;i++)e.location[i]===F.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},te.prototype.getLocations=function(){return this.location},te.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[B.LEFT];this.location[B.LEFT]=this.location[B.RIGHT],this.location[B.RIGHT]=t},te.prototype.toString=function(){var t=new In;return this.location.length>1&&t.append(F.toLocationSymbol(this.location[B.LEFT])),t.append(F.toLocationSymbol(this.location[B.ON])),this.location.length>1&&t.append(F.toLocationSymbol(this.location[B.RIGHT])),t.toString()},te.prototype.setLocations=function(t,e,r){this.location[B.ON]=t,this.location[B.LEFT]=e,this.location[B.RIGHT]=r},te.prototype.get=function(t){return t<this.location.length?this.location[t]:F.NONE},te.prototype.isArea=function(){return this.location.length>1},te.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===F.NONE)return!0;return!1},te.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(B.ON,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this.location[e]=r}},te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(F.NONE)},te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},te.prototype.allPositionsEqual=function(t){for(var e=this,r=0;r<this.location.length;r++)if(e.location[r]!==t)return!1;return!0},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te};var Yt=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new te(t),this.elt[1]=new te(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.elt[0]=new te(e.elt[0]),this.elt[1]=new te(e.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new te(F.NONE),this.elt[1]=new te(F.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new te(s,o,a),this.elt[1]=new te(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new te(F.NONE,F.NONE,F.NONE),this.elt[1]=new te(F.NONE,F.NONE,F.NONE),this.elt[u].setLocations(l,c,h)}};Yt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Yt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Yt.prototype.isNull=function(t){return this.elt[t].isNull()},Yt.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],r=arguments[1];this.elt[e].setAllLocationsIfNull(r)}},Yt.prototype.isLine=function(t){return this.elt[t].isLine()},Yt.prototype.merge=function(t){for(var e=this,r=0;r<2;r++)e.elt[r]===null&&t.elt[r]!==null?e.elt[r]=new te(t.elt[r]):e.elt[r].merge(t.elt[r])},Yt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Yt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(B.ON)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.elt[e].get(r)}},Yt.prototype.toString=function(){var t=new In;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()},Yt.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()}},Yt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Yt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(B.ON,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this.elt[r].setLocation(i,s)}},Yt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Yt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Yt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new te(this.elt[t].location[0]))},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.toLineLabel=function(t){for(var e=new Yt(F.NONE),r=0;r<2;r++)e.setLocation(r,t.getLocation(r));return e};var _e=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new j,this._pts=new j,this._label=new Yt(F.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new j,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};_e.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)e[r]=t._pts.get(r);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=K.isCCW(this._ring.getCoordinates())},_e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},_e.prototype.computePoints=function(t){var e=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Ri("Found null DirectedEdge");if(r.getEdgeRing()===e)throw new Ri("Directed Edge visited twice during ring-building at "+r.getCoordinate());e._edges.add(r);var s=r.getLabel();Pt.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(r.getEdge(),r.isForward(),i),i=!1,e.setEdgeRing(r,e),r=e.getNext(r)}while(r!==this._startDe)},_e.prototype.getLinearRing=function(){return this._ring},_e.prototype.getCoordinate=function(t){return this._pts.get(t)},_e.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var r=e.getNode(),i=r.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},_e.prototype.addPoints=function(t,e,r){var i=this,s=t.getCoordinates();if(e){var o=1;r&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;r&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},_e.prototype.isHole=function(){return this._isHole},_e.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},_e.prototype.containsPoint=function(t){var e=this.getLinearRing(),r=e.getEnvelopeInternal();if(!r.contains(t)||!K.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(t))return!1}return!0},_e.prototype.addHole=function(t){this._holes.add(t)},_e.prototype.isShell=function(){return this._shell===null},_e.prototype.getLabel=function(){return this._label},_e.prototype.getEdges=function(){return this._edges},_e.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},_e.prototype.getShell=function(){return this._shell},_e.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],r=arguments[1],i=e.getLocation(r,B.RIGHT);if(i===F.NONE)return null;if(this._label.getLocation(r)===F.NONE)return this._label.setLocation(r,i),null}},_e.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},_e.prototype.toPolygon=function(t){for(var e=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=e._holes.get(i).getLinearRing();var s=t.createPolygon(this.getLinearRing(),r);return s},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e};var mI=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},t.prototype.getNext=function(r){return r.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(_e),yI=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var r=this,i=new j,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new mI(s,r._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},t.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(r){return r.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(_e),Fr=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}}};Fr.prototype.setVisited=function(t){this._isVisited=t},Fr.prototype.setInResult=function(t){this._isInResult=t},Fr.prototype.isCovered=function(){return this._isCovered},Fr.prototype.isCoveredSet=function(){return this._isCoveredSet},Fr.prototype.setLabel=function(t){this._label=t},Fr.prototype.getLabel=function(){return this._label},Fr.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fr.prototype.updateIM=function(t){Pt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fr.prototype.isInResult=function(){return this._isInResult},Fr.prototype.isVisited=function(){return this._isVisited},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr};var Oh=function(n){function t(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new Yt(0,F.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.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(r){r.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(r){},t.prototype.computeMergedLocation=function(r,i){var s=F.NONE;if(s=this._label.getLocation(i),!r.isNull(i)){var o=r.getLocation(i);s!==F.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new Yt(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof Yt)for(var s=arguments[0],o=0;o<2;o++){var a=r.computeMergedLocation(s,o),u=r._label.getLocation(o);u===F.NONE&&r._label.setLocation(o,a)}},t.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},t.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=F.NONE;this._label!==null&&(i=this._label.getLocation(r));var s=null;switch(i){case F.BOUNDARY:s=F.INTERIOR;break;case F.INTERIOR:s=F.BOUNDARY;break;default:s=F.BOUNDARY;break}this._label.setLocation(r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fr),Rn=function(){this.nodeMap=new Xe,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Rn.prototype.find=function(t){return this.nodeMap.get(t)},Rn.prototype.addNode=function(){if(arguments[0]instanceof D){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 Oh){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}},Rn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Rn.prototype.iterator=function(){return this.nodeMap.values().iterator()},Rn.prototype.values=function(){return this.nodeMap.values()},Rn.prototype.getBoundaryNodes=function(t){for(var e=new j,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(t)===F.BOUNDARY&&e.add(i)}return e},Rn.prototype.add=function(t){var e=t.getCoordinate(),r=this.addNode(e);r.add(t)},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn};var Jt=function(){},pl={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt},Jt.isNorthern=function(t){return t===Jt.NE||t===Jt.NW},Jt.isOpposite=function(t,e){if(t===e)return!1;var r=(t-e+4)%4;return r===2},Jt.commonHalfPlane=function(t,e){if(t===e)return t;var r=(t-e+4)%4;if(r===2)return-1;var i=t<e?t:e,s=t>e?t:e;return i===0&&s===3?3:i},Jt.isInHalfPlane=function(t,e){return e===Jt.SE?t===Jt.SE||t===Jt.SW:t===e||t===e+1},Jt.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 ae("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Jt.NE:Jt.SE:e>=0?Jt.NW:Jt.SW}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new ae("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?Jt.NE:Jt.SE:i.y>=r.y?Jt.NW:Jt.SW}},pl.NE.get=function(){return 0},pl.NW.get=function(){return 1},pl.SW.get=function(){return 2},pl.SE.get=function(){return 3},Object.defineProperties(Jt,pl);var Be=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],r=arguments[1],i=arguments[2],s=null;this._edge=e,this.init(r,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};Be.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:K.computeOrientation(t._p0,t._p1,this._p1)},Be.prototype.getDy=function(){return this._dy},Be.prototype.getCoordinate=function(){return this._p0},Be.prototype.setNode=function(t){this._node=t},Be.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),s=r.substring(i+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Be.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Be.prototype.getDirectedCoordinate=function(){return this._p1},Be.prototype.getDx=function(){return this._dx},Be.prototype.getLabel=function(){return this._label},Be.prototype.getEdge=function(){return this._edge},Be.prototype.getQuadrant=function(){return this._quadrant},Be.prototype.getNode=function(){return this._node},Be.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),r=e.lastIndexOf("."),i=e.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Be.prototype.computeLabel=function(t){},Be.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=Jt.quadrant(this._dx,this._dy),Pt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Be.prototype.interfaces_=function(){return[Jr]},Be.prototype.getClass=function(){return Be};var Rf=function(n){function t(){var e=arguments[0],r=arguments[1];if(n.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=r,r)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 n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(r){return this._depth[r]},t.prototype.setVisited=function(r){this._isVisited=r},t.prototype.computeDirectedLabel=function(){this._label=new Yt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new Ri("assigned depths do not match",this.getCoordinate());this._depth[r]=i},t.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,s=0;s<2;s++)r._label.isArea(s)&&r._label.getLocation(s,B.LEFT)===F.INTERIOR&&r._label.getLocation(s,B.RIGHT)===F.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(r){this._nextMin=r},t.prototype.print=function(r){n.prototype.print.call(this,r),r.print(" "+this._depth[B.LEFT]+"/"+this._depth[B.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},t.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},t.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,F.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,F.EXTERIOR);return r&&i&&s},t.prototype.setEdgeRing=function(r){this._edgeRing=r},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},t.prototype.setInResult=function(r){this._isInResult=r},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(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},t.prototype.setSym=function(r){this._sym=r},t.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},t.prototype.setEdgeDepths=function(r,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;r===B.LEFT&&(o=-1);var a=B.opposite(r),u=s*o,l=i+u;this.setDepth(r,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(r){this._next=r},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(r,i){return r===F.EXTERIOR&&i===F.INTERIOR?1:r===F.INTERIOR&&i===F.EXTERIOR?-1:0},t}(Be),xa=function(){};xa.prototype.createNode=function(t){return new Oh(t,null)},xa.prototype.interfaces_=function(){return[]},xa.prototype.getClass=function(){return xa};var he=function(){if(this._edges=new j,this._nodes=null,this._edgeEndList=new j,arguments.length===0)this._nodes=new Rn(new xa);else if(arguments.length===1){var t=arguments[0];this._nodes=new Rn(t)}};he.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var r=0;r<this._edges.size();r++){t.println("edge "+r+":");var i=e._edges.get(r);i.print(t),i.eiList.print(t)}},he.prototype.find=function(t){return this._nodes.find(t)},he.prototype.addNode=function(){if(arguments[0]instanceof Oh){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof D){var e=arguments[0];return this._nodes.addNode(e)}},he.prototype.getNodeIterator=function(){return this._nodes.iterator()},he.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},he.prototype.debugPrintln=function(t){Re.out.println(t)},he.prototype.isBoundaryNode=function(t,e){var r=this._nodes.find(e);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===F.BOUNDARY},he.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},he.prototype.matchInSameDirection=function(t,e,r,i){return t.equals(r)?K.computeOrientation(t,e,i)===K.COLLINEAR&&Jt.quadrant(t,e)===Jt.quadrant(r,i):!1},he.prototype.getEdgeEnds=function(){return this._edgeEndList},he.prototype.debugPrint=function(t){Re.out.print(t)},he.prototype.getEdgeIterator=function(){return this._edges.iterator()},he.prototype.findEdgeInSameDirection=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var s=r._edges.get(i),o=s.getCoordinates();if(r.matchInSameDirection(t,e,o[0],o[1])||r.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},he.prototype.insertEdge=function(t){this._edges.add(t)},he.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var r=e.next();if(r.getEdge()===t)return r}return null},he.prototype.addEdges=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next();e._edges.add(i);var s=new Rf(i,!0),o=new Rf(i,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},he.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},he.prototype.getNodes=function(){return this._nodes.values()},he.prototype.findEdge=function(t,e){for(var r=this,i=0;i<this._edges.size();i++){var s=r._edges.get(i),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.getEdges().linkResultDirectedEdges()}};var Er=function(){this._geometryFactory=null,this._shellList=new j;var t=arguments[0];this._geometryFactory=t};Er.prototype.sortShellsAndHoles=function(t,e,r){for(var i=t.iterator();i.hasNext();){var s=i.next();s.isHole()?r.add(s):e.add(s)}},Er.prototype.computePolygons=function(t){for(var e=this,r=new j,i=t.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(e._geometryFactory);r.add(o)}return r},Er.prototype.placeFreeHoles=function(t,e){for(var r=this,i=e.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=r.findEdgeRingContaining(s,t);if(o===null)throw new Ri("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},Er.prototype.buildMinimalEdgeRings=function(t,e,r){for(var i=this,s=new j,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):r.addAll(u)}else s.add(a)}return s},Er.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var r=e.next();if(r.containsPoint(t))return!0}return!1},Er.prototype.buildMaximalEdgeRings=function(t){for(var e=this,r=new j,i=t.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new yI(s,e._geometryFactory);r.add(o),o.setInResult()}}return r},Er.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}},Er.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Er.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),i=r.getEnvelopeInternal(),s=r.getCoordinateN(0),o=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),h=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;h.contains(i)&&K.isPointInRing(s,c.getCoordinates())&&(f=!0),f&&(o===null||a.contains(h))&&(o=l)}return o},Er.prototype.findShell=function(t){for(var e=0,r=null,i=t.iterator();i.hasNext();){var s=i.next();s.isHole()||(r=s,e++)}return Pt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Er.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],r=arguments[1];he.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(e),s=new j,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er};var Ta=function(){};Ta.prototype.getBounds=function(){},Ta.prototype.interfaces_=function(){return[]},Ta.prototype.getClass=function(){return Ta};var dn=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};dn.prototype.getItem=function(){return this._item},dn.prototype.getBounds=function(){return this._bounds},dn.prototype.interfaces_=function(){return[Ta,jr]},dn.prototype.getClass=function(){return dn};var Fi=function(){this._size=null,this._items=null,this._size=0,this._items=new j,this._items.add(null)};Fi.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},Fi.prototype.size=function(){return this._size},Fi.prototype.reorder=function(t){for(var e=this,r=null,i=this._items.get(t);t*2<=this._size&&(r=t*2,r!==e._size&&e._items.get(r+1).compareTo(e._items.get(r))<0&&r++,e._items.get(r).compareTo(i)<0);t=r)e._items.set(t,e._items.get(r));this._items.set(t,i)},Fi.prototype.clear=function(){this._size=0,this._items.clear()},Fi.prototype.isEmpty=function(){return this._size===0},Fi.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)e._items.set(r,e._items.get(Math.trunc(r/2)));this._items.set(r,t)},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi};var is=function(){};is.prototype.visitItem=function(t){},is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is};var wo=function(){};wo.prototype.insert=function(t,e){},wo.prototype.remove=function(t,e){},wo.prototype.query=function(){},wo.prototype.interfaces_=function(){return[]},wo.prototype.getClass=function(){return wo};var Me=function(){if(this._childBoundables=new j,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},pv={serialVersionUID:{configurable:!0}};Me.prototype.getLevel=function(){return this._level},Me.prototype.size=function(){return this._childBoundables.size()},Me.prototype.getChildBoundables=function(){return this._childBoundables},Me.prototype.addChildBoundable=function(t){Pt.isTrue(this._bounds===null),this._childBoundables.add(t)},Me.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Me.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Me.prototype.interfaces_=function(){return[Ta,jr]},Me.prototype.getClass=function(){return Me},pv.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Me,pv);var gn=function(){};gn.reverseOrder=function(){return{compare:function(e,r){return r.compareTo(e)}}},gn.min=function(t){return gn.sort(t),t.get(0)},gn.sort=function(t,e){var r=t.toArray();e?Rs.sort(r,e):Rs.sort(r);for(var i=t.iterator(),s=0,o=r.length;s<o;s++)i.next(),i.set(r[s])},gn.singletonList=function(t){var e=new j;return e.add(t),e};var we=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=r,this._distance=this.distance()};we.prototype.expandToQueue=function(t,e){var r=we.isComposite(this._boundable1),i=we.isComposite(this._boundable2);if(r&&i)return we.area(this._boundable1)>we.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ae("neither boundable is composite")},we.prototype.isLeaves=function(){return!(we.isComposite(this._boundable1)||we.isComposite(this._boundable2))},we.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},we.prototype.expand=function(t,e,r,i){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new we(u,e,s._itemDistance);l.getDistance()<i&&r.add(l)}},we.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},we.prototype.getDistance=function(){return this._distance},we.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},we.prototype.interfaces_=function(){return[Jr]},we.prototype.getClass=function(){return we},we.area=function(t){return t.getBounds().getArea()},we.isComposite=function(t){return t instanceof Me};var Te=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new j,this._nodeCapacity=null,arguments.length===0){var t=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];Pt.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Dh={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Te.prototype.getNodeCapacity=function(){return this._nodeCapacity},Te.prototype.lastNode=function(t){return t.get(t.size()-1)},Te.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],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Me?r+=t.size(s):s instanceof dn&&(r+=1)}return r}},Te.prototype.removeItem=function(t,e){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof dn&&s.getItem()===e&&(r=s)}return r!==null?(t.getChildBoundables().remove(r),!0):!1},Te.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new j:e}else if(arguments.length===1){for(var r=arguments[0],i=new j,s=r.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof Me){var a=t.itemsTree(o);a!==null&&i.add(a)}else o instanceof dn?i.add(o.getItem()):Pt.shouldNeverReachHere()}return i.size()<=0?null:i}},Te.prototype.insert=function(t,e){Pt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new dn(t,e))},Te.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],r=new j;return this.boundablesAtLevel(e,this._root,r),r}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(Pt.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof Me?t.boundablesAtLevel(i,u,o):(Pt.isTrue(u instanceof dn),i===-1&&o.add(u))}return null}},Te.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var r=new j;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,r),r}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(pt(arguments[2],is)&&arguments[0]instanceof Object&&arguments[1]instanceof Me)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var h=l.get(c);t.getIntersectsOp().intersects(h.getBounds(),o)&&(h instanceof Me?t.query(o,h,u):h instanceof dn?u.visitItem(h.getItem()):Pt.shouldNeverReachHere())}else if(pt(arguments[2],hn)&&arguments[0]instanceof Object&&arguments[1]instanceof Me)for(var f=arguments[0],d=arguments[1],v=arguments[2],_=d.getChildBoundables(),E=0;E<_.size();E++){var P=_.get(E);t.getIntersectsOp().intersects(P.getBounds(),f)&&(P instanceof Me?t.query(f,P,v):P instanceof dn?v.add(P.getItem()):Pt.shouldNeverReachHere())}}},Te.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},Te.prototype.getRoot=function(){return this.build(),this._root},Te.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof Me&&(a=t.remove(i,c,o),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},Te.prototype.createHigherLevels=function(t,e){Pt.isTrue(!t.isEmpty());var r=this.createParentBoundables(t,e+1);return r.size()===1?r.get(0):this.createHigherLevels(r,e+1)},Te.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],r=0,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Me){var o=t.depth(s);o>r&&(r=o)}}return r+1}},Te.prototype.createParentBoundables=function(t,e){var r=this;Pt.isTrue(!t.isEmpty());var i=new j;i.add(this.createNode(e));var s=new j(t);gn.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(e)),r.lastNode(i).addChildBoundable(a)}return i},Te.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Te.prototype.interfaces_=function(){return[jr]},Te.prototype.getClass=function(){return Te},Te.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Dh.IntersectsOp.get=function(){return _I},Dh.serialVersionUID.get=function(){return-3886435814360241e3},Dh.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Te,Dh);var _I=function(){},Aa=function(){};Aa.prototype.distance=function(t,e){},Aa.prototype.interfaces_=function(){return[]},Aa.prototype.getClass=function(){return Aa};var vv=function(n){function t(r){r=r||t.DEFAULT_NODE_CAPACITY,n.call(this,r)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.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,s){var o=this;Pt.isTrue(i.length>0);for(var a=new j,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},t.prototype.createNode=function(i){return new mv(i)},t.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;n.prototype.insert.call(this,i,s)}else return n.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new j;for(var c=0;u.hasNext()&&c<o;){var h=u.next();a[l].add(h),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return n.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];n.prototype.query.call(this,s,o)}else if(arguments.length===3){if(pt(arguments[2],is)&&arguments[0]instanceof Object&&arguments[1]instanceof Me){var a=arguments[0],u=arguments[1],l=arguments[2];n.prototype.query.call(this,a,u,l)}else if(pt(arguments[2],hn)&&arguments[0]instanceof Object&&arguments[1]instanceof Me){var c=arguments[0],h=arguments[1],f=arguments[2];n.prototype.query.call(this,c,h,f)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return n.prototype.createParentBoundables.call(this,i,s)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return n.prototype.remove.call(this,i,s)}else return n.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,s){Pt.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new j(i);gn.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(pt(arguments[0],Aa)){var i=arguments[0],s=new we(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof we){var o=arguments[0];return this.nearestNeighbour(o,yt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&pt(arguments[1],Aa)){var a=arguments[0],u=arguments[1],l=new we(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof we&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=h,d=null,v=new Fi;for(v.add(c);!v.isEmpty()&&f>0;){var _=v.poll(),E=_.getDistance();if(E>=f)break;_.isLeaves()?(f=E,d=_):_.expandToQueue(v,f)}return[d.getBoundable(0).getItem(),d.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],y=arguments[1],w=arguments[2],m=new dn(P,y),S=new we(this.getRoot(),m,w);return this.nearestNeighbour(S)[0]}},t.prototype.interfaces_=function(){return[wo,jr]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,s){return(i+s)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return mv},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[ma]},compare:function(r,i){return n.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[ma]},compare:function(r,i){return n.compareDoubles(t.centreY(r.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Te),mv=function(n){function t(){var e=arguments[0];n.call(this,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();r===null?r=new at(s.getBounds()):r.expandToInclude(s.getBounds())}return r},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Me),lr=function(){};lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},lr.relativeSign=function(t,e){return t<e?-1:t>e?1:0},lr.compare=function(t,e,r){if(e.equals2D(r))return 0;var i=lr.relativeSign(e.x,r.x),s=lr.relativeSign(e.y,r.y);switch(t){case 0:return lr.compareValue(i,s);case 1:return lr.compareValue(s,i);case 2:return lr.compareValue(s,-i);case 3:return lr.compareValue(-i,s);case 4:return lr.compareValue(-i,-s);case 5:return lr.compareValue(-s,-i);case 6:return lr.compareValue(-s,i);case 7:return lr.compareValue(i,-s)}return Pt.shouldNeverReachHere("invalid octant value"),0},lr.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ss=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this._segString=t,this.coord=new D(e),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(r))};ss.prototype.getCoordinate=function(){return this.coord},ss.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ss.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:lr.compare(this._segmentOctant,this.coord,e.coord)},ss.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},ss.prototype.isInterior=function(){return this._isInterior},ss.prototype.interfaces_=function(){return[Jr]},ss.prototype.getClass=function(){return ss};var Ze=function(){this._nodeMap=new Xe,this._edge=null;var t=arguments[0];this._edge=t};Ze.prototype.getSplitCoordinates=function(){var t=this,e=new al;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next();t.addEdgeCoordinates(i,s,e),i=s}return e.toCoordinateArray()},Ze.prototype.addCollapsedNodes=function(){var t=this,e=new j;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var r=e.iterator();r.hasNext();){var i=r.next().intValue();t.add(t._edge.getCoordinate(i),i)}},Ze.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Ze.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,r=0;r<this._edge.size()-2;r++){var i=e._edge.getCoordinate(r),s=e._edge.getCoordinate(r+2);i.equals2D(s)&&t.add(new Mn(r+1))}},Ze.prototype.addEdgeCoordinates=function(t,e,r){var i=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);r.add(new D(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)r.add(i._edge.getCoordinate(a));o&&r.add(new D(e.coord))},Ze.prototype.iterator=function(){return this._nodeMap.values().iterator()},Ze.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},Ze.prototype.findCollapseIndex=function(t,e,r){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(r[0]=t.segmentIndex+1,!0):!1},Ze.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,r=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=e.findCollapseIndex(s,o,r);a&&t.add(new Mn(r[0])),s=o}},Ze.prototype.getEdge=function(){return this._edge},Ze.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Ze.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new D(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r._edge.getCoordinate(l);return o&&(a[u]=new D(e.coord)),new ve(a,this._edge.getData())},Ze.prototype.add=function(t,e){var r=new ss(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(r);return i!==null?(Pt.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)},Ze.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(e[0]))throw new xi("bad split edge start point at "+i);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new xi("bad split edge end point at "+a)},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Eo=function(){};Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo},Eo.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 ae("Cannot compute the octant for point ( "+t+", "+e+" )");var r=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?r>=i?0:1:r>=i?7:6:e>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new ae("Cannot compute the octant for two identical points "+s);return Eo.octant(a,u)}};var ui=function(){};ui.prototype.getCoordinates=function(){},ui.prototype.size=function(){},ui.prototype.getCoordinate=function(t){},ui.prototype.isClosed=function(){},ui.prototype.setData=function(t){},ui.prototype.getData=function(){},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var vl=function(){};vl.prototype.addIntersection=function(t,e){},vl.prototype.interfaces_=function(){return[ui]},vl.prototype.getClass=function(){return vl};var ve=function(){this._nodeList=new Ze(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};ve.prototype.getCoordinates=function(){return this._pts},ve.prototype.size=function(){return this._pts.length},ve.prototype.getCoordinate=function(t){return this._pts[t]},ve.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},ve.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},ve.prototype.setData=function(t){this._data=t},ve.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Eo.octant(t,e)},ve.prototype.getData=function(){return this._data},ve.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[3],o=new D(r.getIntersection(s));this.addIntersection(o,i)}},ve.prototype.toString=function(){return ln.toLineString(new pe(this._pts))},ve.prototype.getNodeList=function(){return this._nodeList},ve.prototype.addIntersectionNode=function(t,e){var r=e,i=r+1;if(i<this._pts.length){var s=this._pts[i];t.equals2D(s)&&(r=i)}var o=this._nodeList.add(t,r);return o},ve.prototype.addIntersections=function(t,e,r){for(var i=this,s=0;s<t.getIntersectionNum();s++)i.addIntersection(t,e,r,s)},ve.prototype.interfaces_=function(){return[vl]},ve.prototype.getClass=function(){return ve},ve.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new j;return ve.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],s=r.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var ut=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new D,this.p1=new D;else if(arguments.length===1){var t=arguments[0];this.p0=new D(t.p0),this.p1=new D(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],r=arguments[1],i=arguments[2],s=arguments[3];this.p0=new D(e,r),this.p1=new D(i,s)}},yv={serialVersionUID:{configurable:!0}};ut.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ut.prototype.orientationIndex=function(){if(arguments[0]instanceof ut){var t=arguments[0],e=K.orientationIndex(this.p0,this.p1,t.p0),r=K.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}else if(arguments[0]instanceof D){var i=arguments[0];return K.orientationIndex(this.p0,this.p1,i)}},ut.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},ut.prototype.isVertical=function(){return this.p0.x===this.p1.x},ut.prototype.equals=function(t){if(!(t instanceof ut))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},ut.prototype.intersection=function(t){var e=new Ds;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},ut.prototype.project=function(){if(arguments[0]instanceof D){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new D(t);var e=this.projectionFactor(t),r=new D;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof ut){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new ut(a,u)}},ut.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ut.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ut.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},ut.prototype.distancePerpendicular=function(t){return K.distancePointLinePerpendicular(t,this.p0,this.p1)},ut.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ut.prototype.midPoint=function(){return ut.midPoint(this.p0,this.p1)},ut.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,r=this.p1.y-this.p0.y,i=e*e+r*r;if(i<=0)return yt.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/i;return s},ut.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var r=new Array(2).fill(null),i=yt.MAX_VALUE,s=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),r[0]=o,r[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<i&&(i=s,r[0]=a,r[1]=t.p1);var u=t.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,r[0]=this.p0,r[1]=u);var l=t.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,r[0]=this.p1,r[1]=l),r},ut.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var r=this.p0.distance(t),i=this.p1.distance(t);return r<i?this.p0:this.p1},ut.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ut.prototype.getLength=function(){return this.p0.distance(this.p1)},ut.prototype.compareTo=function(t){var e=t,r=this.p0.compareTo(e.p0);return r!==0?r:this.p1.compareTo(e.p1)},ut.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},ut.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)},ut.prototype.lineIntersection=function(t){try{var e=un.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(r){if(!(r instanceof _a))throw r}finally{}return null},ut.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ut.prototype.pointAlongOffset=function(t,e){var r=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*s/a,l=e*o/a}var c=r-l,h=i+u,f=new D(c,h);return f},ut.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],r=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=r.x,this.p1.y=r.y}},ut.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||yt.isNaN(e))&&(e=1),e},ut.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ut.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ut.prototype.distance=function(){if(arguments[0]instanceof ut){var t=arguments[0];return K.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof D){var e=arguments[0];return K.distancePointLine(e,this.p0,this.p1)}},ut.prototype.pointAlong=function(t){var e=new D;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},ut.prototype.hashCode=function(){var t=yt.doubleToLongBits(this.p0.x);t^=yt.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),r=yt.doubleToLongBits(this.p1.x);r^=yt.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return e^i},ut.prototype.interfaces_=function(){return[Jr,jr]},ut.prototype.getClass=function(){return ut},ut.midPoint=function(t,e){return new D((t.x+e.x)/2,(t.y+e.y)/2)},yv.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ut,yv);var ml=function(){this.tempEnv1=new at,this.tempEnv2=new at,this._overlapSeg1=new ut,this._overlapSeg2=new ut};ml.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml};var Sr=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],r=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=i};Sr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Sr.prototype.computeSelect=function(t,e,r,i){var s=this._pts[e],o=this._pts[r];if(i.tempEnv1.init(s,o),r-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+r)/2);e<a&&this.computeSelect(t,e,a,i),a<r&&this.computeSelect(t,a,r,i)},Sr.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)e[r++]=t._pts[i];return e},Sr.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Sr.prototype.setId=function(t){this._id=t},Sr.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Sr.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new at(t,e)}return this._env},Sr.prototype.getEndIndex=function(){return this._end},Sr.prototype.getStartIndex=function(){return this._start},Sr.prototype.getContext=function(){return this._context},Sr.prototype.getId=function(){return this._id},Sr.prototype.computeOverlapsInternal=function(t,e,r,i,s,o){var a=this._pts[t],u=this._pts[e],l=r._pts[i],c=r._pts[s];if(e-t===1&&s-i===1)return o.overlap(this,t,r,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((t+e)/2),f=Math.trunc((i+s)/2);t<h&&(i<f&&this.computeOverlapsInternal(t,h,r,i,f,o),f<s&&this.computeOverlapsInternal(t,h,r,f,s,o)),h<e&&(i<f&&this.computeOverlapsInternal(h,e,r,i,f,o),f<s&&this.computeOverlapsInternal(h,e,r,f,s,o))},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var Fn=function(){};Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.getChainStartIndices=function(t){var e=0,r=new j;r.add(new Mn(e));do{var i=Fn.findChainEnd(t,e);r.add(new Mn(i)),e=i}while(e<t.length-1);var s=Fn.toIntArray(r);return s},Fn.findChainEnd=function(t,e){for(var r=e;r<t.length-1&&t[r].equals2D(t[r+1]);)r++;if(r>=t.length-1)return t.length-1;for(var i=Jt.quadrant(t[r],t[r+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=Jt.quadrant(t[s-1],t[s]);if(o!==i)break}s++}return s-1},Fn.getChains=function(){if(arguments.length===1){var t=arguments[0];return Fn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],r=arguments[1],i=new j,s=Fn.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new Sr(e,s[o],s[o+1],r);i.add(a)}return i}},Fn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var Gs=function(){};Gs.prototype.computeNodes=function(t){},Gs.prototype.getNodedSubstrings=function(){},Gs.prototype.interfaces_=function(){return[]},Gs.prototype.getClass=function(){return Gs};var yl=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};yl.prototype.setSegmentIntersector=function(t){this._segInt=t},yl.prototype.interfaces_=function(){return[Gs]},yl.prototype.getClass=function(){return yl};var Ff=function(n){function t(r){r?n.call(this,r):n.call(this),this._monoChains=new j,this._index=new vv,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return ve.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var s=this,o=Fn.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},t.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,s=new _v(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return _v},Object.defineProperties(t,e),t}(yl),_v=function(n){function t(){n.call(this),this._si=null;var e=arguments[0];this._si=e}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=r.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return n.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ml),zt=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.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],r=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Gi={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}};zt.prototype.getEndCapStyle=function(){return this._endCapStyle},zt.prototype.isSingleSided=function(){return this._isSingleSided},zt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=zt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=zt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==zt.JOIN_ROUND&&(this._quadrantSegments=zt.DEFAULT_QUADRANT_SEGMENTS)},zt.prototype.getJoinStyle=function(){return this._joinStyle},zt.prototype.setJoinStyle=function(t){this._joinStyle=t},zt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},zt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},zt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},zt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},zt.prototype.getMitreLimit=function(){return this._mitreLimit},zt.prototype.setMitreLimit=function(t){this._mitreLimit=t},zt.prototype.setSingleSided=function(t){this._isSingleSided=t},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Gi.CAP_ROUND.get=function(){return 1},Gi.CAP_FLAT.get=function(){return 2},Gi.CAP_SQUARE.get=function(){return 3},Gi.JOIN_ROUND.get=function(){return 1},Gi.JOIN_MITRE.get=function(){return 2},Gi.JOIN_BEVEL.get=function(){return 3},Gi.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Gi.DEFAULT_MITRE_LIMIT.get=function(){return 5},Gi.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(zt,Gi);var fe=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=K.COUNTERCLOCKWISE,this._inputLine=t||null},_l={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};fe.prototype.isDeletable=function(t,e,r,i){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[r];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,t,r,i)},fe.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,r=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(r),s=!1;i<this._inputLine.length;){var o=!1;t.isDeletable(e,r,i,t._distanceTol)&&(t._isDeleted[r]=fe.DELETE,o=!0,s=!0),o?e=i:e=r,r=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(r)}return s},fe.prototype.isShallowConcavity=function(t,e,r,i){var s=K.computeOrientation(t,e,r),o=s===this._angleOrientation;if(!o)return!1;var a=K.distancePointLine(e,t,r);return a<i},fe.prototype.isShallowSampled=function(t,e,r,i,s){var o=this,a=Math.trunc((i-r)/fe.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=r;u<i;u+=a)if(!o.isShallow(t,e,o._inputLine[u],s))return!1;return!0},fe.prototype.isConcave=function(t,e,r){var i=K.computeOrientation(t,e,r),s=i===this._angleOrientation;return s},fe.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=K.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=e.deleteShallowConcavities();while(r);return this.collapseLine()},fe.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===fe.DELETE;)e++;return e},fe.prototype.isShallow=function(t,e,r,i){var s=K.distancePointLine(e,t,r);return s<i},fe.prototype.collapseLine=function(){for(var t=this,e=new al,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==fe.DELETE&&e.add(t._inputLine[r]);return e.toCoordinateArray()},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.simplify=function(t,e){var r=new fe(t);return r.simplify(e)},_l.INIT.get=function(){return 0},_l.DELETE.get=function(){return 1},_l.KEEP.get=function(){return 1},_l.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(fe,_l);var Gr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new j},wv={COORDINATE_ARRAY_TYPE:{configurable:!0}};Gr.prototype.getCoordinates=function(){var t=this._ptList.toArray(Gr.COORDINATE_ARRAY_TYPE);return t},Gr.prototype.setPrecisionModel=function(t){this._precisionModel=t},Gr.prototype.addPt=function(t){var e=new D(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Gr.prototype.revere=function(){},Gr.prototype.addPts=function(t,e){var r=this;if(e)for(var i=0;i<t.length;i++)r.addPt(t[i]);else for(var s=t.length-1;s>=0;s--)r.addPt(t[s])},Gr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),r=t.distance(e);return r<this._minimimVertexDistance},Gr.prototype.toString=function(){var t=new xt,e=t.createLineString(this.getCoordinates());return e.toString()},Gr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new D(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Gr.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},wv.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Gr,wv);var At=function(){},So={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.toDegrees=function(t){return t*180/Math.PI},At.normalize=function(t){for(;t>Math.PI;)t-=At.PI_TIMES_2;for(;t<=-Math.PI;)t+=At.PI_TIMES_2;return t},At.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],r=arguments[1],i=r.x-e.x,s=r.y-e.y;return Math.atan2(s,i)}},At.isAcute=function(t,e,r){var i=t.x-e.x,s=t.y-e.y,o=r.x-e.x,a=r.y-e.y,u=i*o+s*a;return u>0},At.isObtuse=function(t,e,r){var i=t.x-e.x,s=t.y-e.y,o=r.x-e.x,a=r.y-e.y,u=i*o+s*a;return u<0},At.interiorAngle=function(t,e,r){var i=At.angle(e,t),s=At.angle(e,r);return Math.abs(s-i)},At.normalizePositive=function(t){if(t<0){for(;t<0;)t+=At.PI_TIMES_2;t>=At.PI_TIMES_2&&(t=0)}else{for(;t>=At.PI_TIMES_2;)t-=At.PI_TIMES_2;t<0&&(t=0)}return t},At.angleBetween=function(t,e,r){var i=At.angle(e,t),s=At.angle(e,r);return At.diff(i,s)},At.diff=function(t,e){var r=null;return t<e?r=e-t:r=t-e,r>Math.PI&&(r=2*Math.PI-r),r},At.toRadians=function(t){return t*Math.PI/180},At.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?At.COUNTERCLOCKWISE:r<0?At.CLOCKWISE:At.NONE},At.angleBetweenOriented=function(t,e,r){var i=At.angle(e,t),s=At.angle(e,r),o=s-i;return o<=-Math.PI?o+At.PI_TIMES_2:o>Math.PI?o-At.PI_TIMES_2:o},So.PI_TIMES_2.get=function(){return 2*Math.PI},So.PI_OVER_2.get=function(){return Math.PI/2},So.PI_OVER_4.get=function(){return Math.PI/4},So.COUNTERCLOCKWISE.get=function(){return K.COUNTERCLOCKWISE},So.CLOCKWISE.get=function(){return K.CLOCKWISE},So.NONE.get=function(){return K.COLLINEAR},Object.defineProperties(At,So);var se=function n(){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 ut,this._seg1=new ut,this._offset0=new ut,this._offset1=new ut,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Ds,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===zt.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},wl={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}};se.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 r=K.computeOrientation(this._s0,this._s1,this._s2),i=r===K.CLOCKWISE&&this._side===B.LEFT||r===K.COUNTERCLOCKWISE&&this._side===B.RIGHT;r===0?this.addCollinear(e):i?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},se.prototype.addLineEndCap=function(t,e){var r=new ut(t,e),i=new ut;this.computeOffsetSegment(r,B.LEFT,this._distance,i);var s=new ut;this.computeOffsetSegment(r,B.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case zt.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,K.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case zt.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case zt.CAP_SQUARE:var l=new D;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new D(i.p1.x+l.x,i.p1.y+l.y),h=new D(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(h);break}},se.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},se.prototype.addMitreJoin=function(t,e,r,i){var s=!0,o=null;try{o=un.intersection(e.p0,e.p1,r.p0,r.p1);var a=i<=0?1:o.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof _a)o=new D(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,i,this._bufParams.getMitreLimit())},se.prototype.addFilletCorner=function(t,e,r,i,s){var o=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,o),l=r.x-t.x,c=r.y-t.y,h=Math.atan2(c,l);i===K.CLOCKWISE?u<=h&&(u+=2*Math.PI):u>=h&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,h,i,s),this._segList.addPt(r)},se.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*se.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===zt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===zt.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))},se.prototype.createSquare=function(t){this._segList.addPt(new D(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new D(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new D(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new D(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},se.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},se.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},se.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},se.prototype.initSideSegments=function(t,e,r){this._s1=t,this._s2=e,this._side=r,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)},se.prototype.addLimitedMitreJoin=function(t,e,r,i){var s=this._seg0.p1,o=At.angle(s,this._seg0.p0),a=At.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=At.normalize(o+u),c=At.normalize(l+Math.PI),h=i*r,f=h*Math.abs(Math.sin(u)),d=r-f,v=s.x+h*Math.cos(c),_=s.y+h*Math.sin(c),E=new D(v,_),P=new ut(s,E),y=P.pointAlongOffset(1,d),w=P.pointAlongOffset(1,-d);this._side===B.LEFT?(this._segList.addPt(y),this._segList.addPt(w)):(this._segList.addPt(w),this._segList.addPt(y))},se.prototype.computeOffsetSegment=function(t,e,r,i){var s=e===B.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(o*o+a*a),l=s*r*o/u,c=s*r*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},se.prototype.addFilletArc=function(t,e,r,i,s){var o=this,a=i===K.CLOCKWISE?-1:1,u=Math.abs(e-r),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,h=u/l,f=c,d=new D;f<u;){var v=e+a*f;d.x=t.x+s*Math.cos(v),d.y=t.y+s*Math.sin(v),o._segList.addPt(d),f+=h}},se.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*se.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new D((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(r);var i=new D((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)}},se.prototype.createCircle=function(t){var e=new D(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},se.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},se.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Gr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*se.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},se.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()===zt.JOIN_BEVEL||this._bufParams.getJoinStyle()===zt.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,K.CLOCKWISE,this._distance))},se.prototype.closeRing=function(){this._segList.closeRing()},se.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se},wl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},wl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},wl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},wl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(se,wl);var hr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};hr.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var r=e<0,i=Math.abs(e),s=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,r,s);var o=s.getCoordinates();return r&&Nt.reverse(o),o},hr.prototype.computeSingleSidedBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var s=fe.simplify(t,-i),o=s.length-1;r.initSideSegments(s[o],s[o-1],B.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(s[a],!0)}else{r.addSegments(t,!1);var u=fe.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],B.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment(),r.closeRing()},hr.prototype.computeRingBufferCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);e===B.RIGHT&&(i=-i);var s=fe.simplify(t,i),o=s.length-1;r.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var u=a!==1;r.addNextSegment(s[a],u)}r.closeRing()},hr.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),i=fe.simplify(t,r),s=i.length-1;e.initSideSegments(i[0],i[1],B.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[s-1],i[s]);var a=fe.simplify(t,-r),u=a.length-1;e.initSideSegments(a[u],a[u-1],B.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},hr.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case zt.CAP_ROUND:e.createCircle(t);break;case zt.CAP_SQUARE:e.createSquare(t);break}},hr.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var r=Math.abs(e),i=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,i)}else this.computeLineBufferCurve(t,i);var o=i.getCoordinates();return o},hr.prototype.getBufferParameters=function(){return this._bufParams},hr.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},hr.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return hr.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},hr.prototype.computeOffsetCurve=function(t,e,r){var i=this.simplifyTolerance(this._distance);if(e){var s=fe.simplify(t,-i),o=s.length-1;r.initSideSegments(s[o],s[o-1],B.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(s[a],!0)}else{var u=fe.simplify(t,i),l=u.length-1;r.initSideSegments(u[0],u[1],B.LEFT),r.addFirstSegment();for(var c=2;c<=l;c++)r.addNextSegment(u[c],!0)}r.addLastSegment()},hr.prototype.getSegGen=function(t){return new se(this._precisionModel,this._bufParams,t)},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr},hr.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;r<e.length;r++)e[r]=new D(t[r]);return e};var Co=function(){this._subgraphs=null,this._seg=new ut,this._cga=new K;var t=arguments[0];this._subgraphs=t},Ev={DepthSegment:{configurable:!0}};Co.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=new j,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(pt(arguments[2],hn)&&arguments[0]instanceof D&&arguments[1]instanceof Rf)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),h=0;h<c.length-1;h++){t._seg.p0=c[h],t._seg.p1=c[h+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var f=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(f<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&K.computeOrientation(t._seg.p0,t._seg.p1,a)!==K.RIGHT){var d=u.getDepth(B.LEFT);t._seg.p0.equals(c[h])||(d=u.getDepth(B.RIGHT));var v=new ks(t._seg,d);l.add(v)}}else if(pt(arguments[2],hn)&&arguments[0]instanceof D&&pt(arguments[1],hn))for(var _=arguments[0],E=arguments[1],P=arguments[2],y=E.iterator();y.hasNext();){var w=y.next();w.isForward()&&t.findStabbedSegments(_,w,P)}}},Co.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var r=gn.min(e);return r._leftDepth},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co},Ev.DepthSegment.get=function(){return ks},Object.defineProperties(Co,Ev);var ks=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new ut(t),this._leftDepth=e};ks.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 r=this._upwardSeg.orientationIndex(e._upwardSeg);return r!==0||(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(e._upwardSeg)},ks.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return r!==0?r:t.p1.compareTo(e.p1)},ks.prototype.toString=function(){return this._upwardSeg.toString()},ks.prototype.interfaces_=function(){return[Jr]},ks.prototype.getClass=function(){return ks};var qt=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};qt.prototype.area=function(){return qt.area(this.p0,this.p1,this.p2)},qt.prototype.signedArea=function(){return qt.signedArea(this.p0,this.p1,this.p2)},qt.prototype.interpolateZ=function(t){if(t===null)throw new ae("Supplied point is null.");return qt.interpolateZ(t,this.p0,this.p1,this.p2)},qt.prototype.longestSideLength=function(){return qt.longestSideLength(this.p0,this.p1,this.p2)},qt.prototype.isAcute=function(){return qt.isAcute(this.p0,this.p1,this.p2)},qt.prototype.circumcentre=function(){return qt.circumcentre(this.p0,this.p1,this.p2)},qt.prototype.area3D=function(){return qt.area3D(this.p0,this.p1,this.p2)},qt.prototype.centroid=function(){return qt.centroid(this.p0,this.p1,this.p2)},qt.prototype.inCentre=function(){return qt.inCentre(this.p0,this.p1,this.p2)},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},qt.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},qt.det=function(t,e,r,i){return t*i-e*r},qt.interpolateZ=function(t,e,r,i){var s=e.x,o=e.y,a=r.x-s,u=i.x-s,l=r.y-o,c=i.y-o,h=a*c-u*l,f=t.x-s,d=t.y-o,v=(c*f-u*d)/h,_=(-l*f+a*d)/h,E=e.z+v*(r.z-e.z)+_*(i.z-e.z);return E},qt.longestSideLength=function(t,e,r){var i=t.distance(e),s=e.distance(r),o=r.distance(t),a=i;return s>a&&(a=s),o>a&&(a=o),a},qt.isAcute=function(t,e,r){return!(!At.isAcute(t,e,r)||!At.isAcute(e,r,t)||!At.isAcute(r,t,e))},qt.circumcentre=function(t,e,r){var i=r.x,s=r.y,o=t.x-i,a=t.y-s,u=e.x-i,l=e.y-s,c=2*qt.det(o,a,u,l),h=qt.det(a,o*o+a*a,l,u*u+l*l),f=qt.det(o,o*o+a*a,u,u*u+l*l),d=i-h/c,v=s+f/c;return new D(d,v)},qt.perpendicularBisector=function(t,e){var r=e.x-t.x,i=e.y-t.y,s=new un(t.x+r/2,t.y+i/2,1),o=new un(t.x-i+r/2,t.y+r+i/2,1);return new un(s,o)},qt.angleBisector=function(t,e,r){var i=e.distance(t),s=e.distance(r),o=i/(i+s),a=r.x-t.x,u=r.y-t.y,l=new D(t.x+o*a,t.y+o*u);return l},qt.area3D=function(t,e,r){var i=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=r.x-t.x,u=r.y-t.y,l=r.z-t.z,c=s*l-o*u,h=o*a-i*l,f=i*u-s*a,d=c*c+h*h+f*f,v=Math.sqrt(d)/2;return v},qt.centroid=function(t,e,r){var i=(t.x+e.x+r.x)/3,s=(t.y+e.y+r.y)/3;return new D(i,s)},qt.inCentre=function(t,e,r){var i=e.distance(r),s=t.distance(r),o=t.distance(e),a=i+s+o,u=(i*t.x+s*e.x+o*r.x)/a,l=(i*t.y+s*e.y+o*r.y)/a;return new D(u,l)};var tn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new j;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};tn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,F.EXTERIOR,F.INTERIOR)},tn.prototype.addPolygon=function(t){var e=this,r=this._distance,i=B.LEFT;this._distance<0&&(r=-this._distance,i=B.RIGHT);var s=t.getExteriorRing(),o=Nt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,r,i,F.EXTERIOR,F.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=Nt.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,r,B.opposite(i),F.INTERIOR,F.EXTERIOR)}},tn.prototype.isTriangleErodedCompletely=function(t,e){var r=new qt(t[0],t[1],t[2]),i=r.inCentre(),s=K.distancePointLine(i,r.p0,r.p1);return s<Math.abs(e)},tn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Nt.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,F.EXTERIOR,F.INTERIOR)},tn.prototype.addCurve=function(t,e,r){if(t===null||t.length<2)return null;var i=new ve(t,new Yt(0,F.BOUNDARY,e,r));this._curveList.add(i)},tn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},tn.prototype.addPolygonRing=function(t,e,r,i,s){if(e===0&&t.length<si.MINIMUM_VALID_SIZE)return null;var o=i,a=s;t.length>=si.MINIMUM_VALID_SIZE&&K.isCCW(t)&&(o=s,a=i,r=B.opposite(r));var u=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(u,o,a)},tn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ie?this.addPolygon(t):t instanceof ce?this.addLineString(t):t instanceof wr?this.addPoint(t):t instanceof Na?this.addCollection(t):t instanceof Fs?this.addCollection(t):t instanceof oi?this.addCollection(t):t instanceof $e&&this.addCollection(t)},tn.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(r.length===4)return this.isTriangleErodedCompletely(r,e);var i=t.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>s},tn.prototype.addCollection=function(t){for(var e=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);e.add(i)}},tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn};var Oa=function(){};Oa.prototype.locate=function(t){},Oa.prototype.interfaces_=function(){return[]},Oa.prototype.getClass=function(){return Oa};var li=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()};li.prototype.next=function(){if(this._atStart)return this._atStart=!1,li.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 Ma;var t=this._parent.getGeometryN(this._index++);return t instanceof $e?(this._subcollectionIterator=new li(t),this._subcollectionIterator.next()):t},li.prototype.remove=function(){throw new Error(this.getClass().getName())},li.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)},li.prototype.interfaces_=function(){return[Ia]},li.prototype.getClass=function(){return li},li.isAtomic=function(t){return!(t instanceof $e)};var kr=function(){this._geom=null;var t=arguments[0];this._geom=t};kr.prototype.locate=function(t){return kr.locate(t,this._geom)},kr.prototype.interfaces_=function(){return[Oa]},kr.prototype.getClass=function(){return kr},kr.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?K.isPointInRing(t,e.getCoordinates()):!1},kr.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!kr.isPointInRing(t,r))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var s=e.getInteriorRingN(i);if(kr.isPointInRing(t,s))return!1}return!0},kr.containsPoint=function(t,e){if(e instanceof Ie)return kr.containsPointInPolygon(t,e);if(e instanceof $e)for(var r=new li(e);r.hasNext();){var i=r.next();if(i!==e&&kr.containsPoint(t,i))return!0}return!1},kr.locate=function(t,e){return e.isEmpty()?F.EXTERIOR:kr.containsPoint(t,e)?F.INTERIOR:F.EXTERIOR};var Ye=function(){this._edgeMap=new Xe,this._edgeList=null,this._ptInAreaLocation=[F.NONE,F.NONE]};Ye.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),r=e-1;return e===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)},Ye.prototype.propagateSideLabels=function(t){for(var e=F.NONE,r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.isArea(t)&&s.getLocation(t,B.LEFT)!==F.NONE&&(e=s.getLocation(t,B.LEFT))}if(e===F.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,B.ON)===F.NONE&&l.setLocation(t,B.ON,o),l.isArea(t)){var c=l.getLocation(t,B.LEFT),h=l.getLocation(t,B.RIGHT);if(h!==F.NONE){if(h!==o)throw new Ri("side location conflict",u.getCoordinate());c===F.NONE&&Pt.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=c}else Pt.isTrue(l.getLocation(t,B.LEFT)===F.NONE,"found single null side"),l.setLocation(t,B.RIGHT,o),l.setLocation(t,B.LEFT,o)}}},Ye.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Ye.prototype.print=function(t){Re.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Ye.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ye.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var r=e.size()-1,i=e.get(r).getLabel(),s=i.getLocation(t,B.LEFT);Pt.isTrue(s!==F.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();Pt.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,B.LEFT),h=l.getLocation(t,B.RIGHT);if(c===h||h!==o)return!1;o=c}return!0},Ye.prototype.findIndex=function(t){var e=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=e._edgeList.get(r);if(i===t)return r}return-1},Ye.prototype.iterator=function(){return this.getEdges().iterator()},Ye.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new j(this._edgeMap.values())),this._edgeList},Ye.prototype.getLocation=function(t,e,r){return this._ptInAreaLocation[t]===F.NONE&&(this._ptInAreaLocation[t]=kr.locate(e,r[t].getGeometry())),this._ptInAreaLocation[t]},Ye.prototype.toString=function(){var t=new In;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
67
67
  `);for(var e=this.iterator();e.hasNext();){var r=e.next();t.append(r),t.append(`
68
- `)}return t.toString()},Ye.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},Ye.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===F.BOUNDARY&&(r[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),h=0;h<2;h++)if(c.isAnyNull(h)){var f=F.NONE;if(r[h])f=F.EXTERIOR;else{var d=l.getCoordinate();f=e.getLocation(h,d,t)}c.setAllLocationsIfNull(h,f)}},Ye.prototype.getDegree=function(){return this._edgeMap.size()},Ye.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var wI=function(n){function t(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=r._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Ri("no outgoing dirEdge found",this.getCoordinate());Pt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var s=r.get(0);if(i===1)return s;var o=r.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Jt.isNorthern(a)&&Jt.isNorthern(u)?s:!Jt.isNorthern(a)&&!Jt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(Pt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){Re.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();r.print("out "),s.print(r),r.println(),r.print("in "),s.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new j;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&r._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=r._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(B.LEFT),a=i.getDepth(B.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new Ri("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],h=arguments[1],f=arguments[2],d=f,v=c;v<h;v++){var _=r._edgeList.get(v);_.setEdgeDepths(B.RIGHT,d),d=_.getDepth(B.LEFT)}return d}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(s===null&&l.getEdgeRing()===r&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==r)continue;o=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(Pt.isTrue(s!==null,"found null for first outgoing dirEdge"),Pt.isTrue(s.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=F.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){r=F.INTERIOR;break}if(o.isInResult()){r=F.EXTERIOR;break}}}if(r===F.NONE)return null;for(var a=r,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===F.INTERIOR):(l.isInResult()&&(a=F.EXTERIOR),c.isInResult()&&(a=F.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new Yt(F.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===F.INTERIOR||c===F.BOUNDARY)&&i._label.setLocation(l,F.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ye),Sv=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Oh(r,new wI)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xa),os=function n(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=n.orientation(t)};os.prototype.compareTo=function(t){var e=t,r=os.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},os.prototype.interfaces_=function(){return[Jr]},os.prototype.getClass=function(){return os},os.orientation=function(t){return Nt.increasingDirection(t)===1},os.compareOriented=function(t,e,r,i){for(var s=e?1:-1,o=i?1:-1,a=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,c=i?0:r.length-1;;){var h=t[l].compareTo(r[c]);if(h!==0)return h;l+=s,c+=o;var f=l===a,d=c===u;if(f&&!d)return-1;if(!f&&d)return 1;if(f&&d)return 0}};var pn=function(){this._edges=new j,this._ocaMap=new Xe};pn.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},pn.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())},pn.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1},pn.prototype.iterator=function(){return this._edges.iterator()},pn.prototype.getEdges=function(){return this._edges},pn.prototype.get=function(t){return this._edges.get(t)},pn.prototype.findEqualEdge=function(t){var e=new os(t.getCoordinates()),r=this._ocaMap.get(e);return r},pn.prototype.add=function(t){this._edges.add(t);var e=new os(t.getCoordinates());this._ocaMap.put(e,t)},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var Vs=function(){};Vs.prototype.processIntersections=function(t,e,r,i){},Vs.prototype.isDone=function(){},Vs.prototype.interfaces_=function(){return[]},Vs.prototype.getClass=function(){return Vs};var Vr=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};Vr.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Vr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},Vr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Vr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Vr.prototype.getLineIntersector=function(){return this._li},Vr.prototype.hasProperIntersection=function(){return this._hasProper},Vr.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Vr.prototype.hasIntersection=function(){return this._hasIntersection},Vr.prototype.isDone=function(){return!1},Vr.prototype.hasInteriorIntersection=function(){return this._hasInterior},Vr.prototype.interfaces_=function(){return[Vs]},Vr.prototype.getClass=function(){return Vr},Vr.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Gn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new D(t),this.segmentIndex=e,this.dist=r};Gn.prototype.getSegmentIndex=function(){return this.segmentIndex},Gn.prototype.getCoordinate=function(){return this.coord},Gn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Gn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Gn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Gn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Gn.prototype.getDistance=function(){return this.dist},Gn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Gn.prototype.interfaces_=function(){return[Jr]},Gn.prototype.getClass=function(){return Gn};var hi=function(){this._nodeMap=new Xe,this.edge=null;var t=arguments[0];this.edge=t};hi.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},hi.prototype.iterator=function(){return this._nodeMap.values().iterator()},hi.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},hi.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)},hi.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new D(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r.edge.pts[l];return o&&(a[u]=e.coord),new Lh(a,new Yt(this.edge._label))},hi.prototype.add=function(t,e,r){var i=new Gn(t,e,r),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},hi.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var Us=function(){};Us.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new j;i.add(new Mn(r));do{var s=e.findChainEnd(t,r);i.add(new Mn(s)),r=s}while(r<t.length-1);var o=Us.toIntArray(i);return o},Us.prototype.findChainEnd=function(t,e){for(var r=Jt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var s=Jt.quadrant(t[i-1],t[i]);if(s!==r)break;i++}return i-1},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us},Us.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var ki=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new at,this.env2=new at;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Us;this.startIndex=e.getChainStartIndices(this.pts)};ki.prototype.getCoordinates=function(){return this.pts},ki.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r},ki.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r},ki.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],h=this.pts[s],f=this.pts[o],d=a.pts[u],v=a.pts[l];if(o-s===1&&l-u===1)return c.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(h,f),this.env2.init(d,v),!this.env1.intersects(this.env2))return null;var _=Math.trunc((s+o)/2),E=Math.trunc((u+l)/2);s<_&&(u<E&&this.computeIntersectsForChain(s,_,a,u,E,c),E<l&&this.computeIntersectsForChain(s,_,a,E,l,c)),_<o&&(u<E&&this.computeIntersectsForChain(_,o,a,u,E,c),E<l&&this.computeIntersectsForChain(_,o,a,E,l,c))}},ki.prototype.getStartIndexes=function(){return this.startIndex},ki.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<t.startIndex.length-1;s++)r.computeIntersectsForChain(i,t,s,e)},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var Fe=function n(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=n.NULL_VALUE},Cv={NULL_VALUE:{configurable:!0}};Fe.prototype.getDepth=function(t,e){return this._depth[t][e]},Fe.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},Fe.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==Fe.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Fe.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===Fe.NULL_VALUE}},Fe.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var s=0;t._depth[e][i]>r&&(s=1),t._depth[e][i]=s}}},Fe.prototype.getDelta=function(t){return this._depth[t][B.RIGHT]-this._depth[t][B.LEFT]},Fe.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?F.EXTERIOR:F.INTERIOR},Fe.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Fe.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var s=e.getLocation(r,i);(s===F.EXTERIOR||s===F.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=Fe.depthAtLocation(s):t._depth[r][i]+=Fe.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===F.INTERIOR&&this._depth[o][a]++}},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.depthAtLocation=function(t){return t===F.EXTERIOR?0:t===F.INTERIOR?1:Fe.NULL_VALUE},Cv.NULL_VALUE.get=function(){return-1},Object.defineProperties(Fe,Cv);var Lh=function(n){function t(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new hi(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Fe,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,Yt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var s=r;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!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 r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.print(","),r.print(i.pts[s].x+" "+i.pts[s].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},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(r){var i=this;r.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)r.print(i.pts[s]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new ki(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new at;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,s,o){var a=new D(r.getIntersection(o)),u=i,l=r.getEdgeDistance(s,o),c=u+1;if(c<this.pts.length){var h=this.pts[c];a.equals2D(h)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var r=this,i=new In;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(r.pts[s].x+" "+r.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(r.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,s){for(var o=this,a=0;a<r.getIntersectionNum();a++)o.addIntersection(r,i,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,B.ON),r.getLocation(1,B.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,B.LEFT),r.getLocation(1,B.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,B.RIGHT),r.getLocation(1,B.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},t}(Fr),tr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new pn,this._bufParams=t||null};tr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},tr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Yt(t.getLabel()),i.flip()),r.merge(i);var s=tr.depthDelta(i),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(tr.depthDelta(t.getLabel()))},tr.prototype.buildSubgraphs=function(t,e){for(var r=new j,i=t.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new Co(r),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),r.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},tr.prototype.createSubgraphs=function(t){for(var e=new j,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var s=new Ke;s.create(i),e.add(s)}}return gn.sort(e,gn.reverseOrder()),e},tr.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},tr.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Ff,r=new Ds;return r.setPrecisionModel(t),e.setSegmentIntersector(new Vr(r)),e},tr.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new hr(r,this._bufParams),s=new tn(t,e,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new he(new Sv),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new Er(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},tr.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Lh(a.getCoordinates(),new Yt(l));r.insertUniqueEdge(c)}}},tr.prototype.setNoder=function(t){this._workingNoder=t},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthDelta=function(t){var e=t.getLocation(0,B.LEFT),r=t.getLocation(0,B.RIGHT);return e===F.INTERIOR&&r===F.EXTERIOR?1:e===F.EXTERIOR&&r===F.INTERIOR?-1:0},tr.convertSegStrings=function(t){for(var e=new xt,r=new j;t.hasNext();){var i=t.next(),s=e.createLineString(i.getCoordinates());r.add(s)}return e.buildGeometry(r)};var as=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 r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};as.prototype.rescale=function(){var t=this;if(pt(arguments[0],Pe))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/t._scaleFactor+t._offsetX,s[o].y=s[o].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&Re.out.println(s)}},as.prototype.scale=function(){var t=this;if(pt(arguments[0],Pe)){for(var e=arguments[0],r=new j,i=e.iterator();i.hasNext();){var s=i.next();r.add(new ve(t.scale(s.getCoordinates()),s.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new D(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=Nt.removeRepeatedPoints(a);return l}},as.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},as.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},as.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},as.prototype.interfaces_=function(){return[Gs]},as.prototype.getClass=function(){return as};var kn=function(){this._li=new Ds,this._segStrings=null;var t=arguments[0];this._segStrings=t},Pv={fact:{configurable:!0}};kn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(s))throw new xi("found endpt/interior pt intersection at index "+c+" :pt "+s)}},kn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();t.checkInteriorIntersections(r,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var h=0;h<l.length-1;h++)t.checkInteriorIntersections(o,c,a,h);else if(arguments.length===4){var f=arguments[0],d=arguments[1],v=arguments[2],_=arguments[3];if(f===v&&d===_)return null;var E=f.getCoordinates()[d],P=f.getCoordinates()[d+1],y=v.getCoordinates()[_],w=v.getCoordinates()[_+1];if(this._li.computeIntersection(E,P,y,w),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,E,P)||this.hasInteriorIntersection(this._li,y,w)))throw new xi("found non-noded intersection at "+E+"-"+P+" and "+y+"-"+w)}},kn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},kn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},kn.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var s=t.getIntersection(i);if(!(s.equals(e)||s.equals(r)))return!0}return!1},kn.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new xi("found non-noded collapse at "+kn.fact.createLineString([t,e,r]))},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Pv.fact.get=function(){return new xt},Object.defineProperties(kn,Pv);var cr=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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new ae("Scale factor must be non-zero");e!==1&&(this._pt=new D(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new D,this._p1Scaled=new D),this.initCorners(this._pt)},Iv={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};cr.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<r||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return Pt.isTrue(!(a&&u),"Found bad envelope test"),u},cr.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 D(this._maxx,this._maxy),this._corner[1]=new D(this._minx,this._maxy),this._corner[2]=new D(this._minx,this._miny),this._corner[3]=new D(this._maxx,this._miny)},cr.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))},cr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},cr.prototype.getCoordinate=function(){return this._originalPt},cr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},cr.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=cr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new at(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},cr.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()))},cr.prototype.intersectsToleranceSquare=function(t,e){var r=!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()&&(r=!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())||r&&i||t.equals(this._pt)||e.equals(this._pt))},cr.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},Iv.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(cr,Iv);var El=function(){this.tempEnv1=new at,this.selectedSegment=new ut};El.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)}}},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var Da=function(){this._index=null;var t=arguments[0];this._index=t},Mv={HotPixelSnapAction:{configurable:!0}};Da.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],r=arguments[1],i=arguments[2],s=e.getSafeEnvelope(),o=new bv(e,r,i);return this._index.query(s,{interfaces_:function(){return[is]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},Da.prototype.interfaces_=function(){return[]},Da.prototype.getClass=function(){return Da},Mv.HotPixelSnapAction.get=function(){return bv},Object.defineProperties(Da,Mv);var bv=function(n){function t(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],s=r.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return n.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(El),Po=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new j};Po.prototype.processIntersections=function(t,e,r,i){var s=this;if(t===r&&e===i)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)s._interiorIntersections.add(s._li.getIntersection(c));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}},Po.prototype.isDone=function(){return!1},Po.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Po.prototype.interfaces_=function(){return[Vs]},Po.prototype.getClass=function(){return Po};var ci=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 Ds,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};ci.prototype.checkCorrectness=function(t){var e=ve.getNodedSubstrings(t),r=new kn(e);try{r.checkValid()}catch(i){if(i instanceof ov)i.printStackTrace();else throw i}finally{}},ci.prototype.getNodedSubstrings=function(){return ve.getNodedSubstrings(this._nodedSegStrings)},ci.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},ci.prototype.findInteriorIntersections=function(t,e){var r=new Po(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},ci.prototype.computeVertexSnaps=function(){var t=this;if(pt(arguments[0],Pe))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof ve)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new cr(o[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},ci.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Ff,this._pointSnapper=new Da(this._noder.getIndex()),this.snapRound(t,this._li)},ci.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),s=new cr(i,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},ci.prototype.interfaces_=function(){return[Gs]},ci.prototype.getClass=function(){return ci};var Ge=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new zt,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],r=arguments[1];this._argGeom=e,this._bufParams=r}},La={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ge.prototype.bufferFixedPrecision=function(t){var e=new as(new ci(new Ut(1)),t.getScale()),r=new tr(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)},Ge.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Ge.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Ri)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Ge.precisionScaleFactor(this._argGeom,this._distance,r),s=new Ut(i);this.bufferFixedPrecision(s)}},Ge.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ut.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Ge.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Ge.prototype.bufferOriginalPrecision=function(){try{var t=new tr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof xi)this._saveException=e;else throw e}finally{}},Ge.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Ge.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ge(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Ge(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof zt&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=arguments[2],d=new Ge(c,f),v=d.getResultGeometry(h);return v}}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],y=arguments[3],w=new Ge(_);w.setQuadrantSegments(P),w.setEndCapStyle(y);var m=w.getResultGeometry(E);return m}},Ge.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),s=Rr.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=r-u,c=Math.pow(10,l);return c},La.CAP_ROUND.get=function(){return zt.CAP_ROUND},La.CAP_BUTT.get=function(){return zt.CAP_FLAT},La.CAP_FLAT.get=function(){return zt.CAP_FLAT},La.CAP_SQUARE.get=function(){return zt.CAP_SQUARE},La.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ge,La);var er=function(){this._pt=[new D,new D],this._distance=yt.NaN,this._isNull=!0};er.prototype.getCoordinates=function(){return this._pt},er.prototype.getCoordinate=function(t){return this._pt[t]},er.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},er.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},er.prototype.getDistance=function(){return this._distance},er.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var fi=function(){};fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},fi.computeDistance=function(){if(arguments[2]instanceof er&&arguments[0]instanceof ce&&arguments[1]instanceof D)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),s=new ut,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof er&&arguments[0]instanceof Ie&&arguments[1]instanceof D){var u=arguments[0],l=arguments[1],c=arguments[2];fi.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)fi.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof er&&arguments[0]instanceof gt&&arguments[1]instanceof D){var f=arguments[0],d=arguments[1],v=arguments[2];if(f instanceof ce)fi.computeDistance(f,d,v);else if(f instanceof Ie)fi.computeDistance(f,d,v);else if(f instanceof $e)for(var _=f,E=0;E<_.getNumGeometries();E++){var P=_.getGeometryN(E);fi.computeDistance(P,d,v)}else v.setMinimum(f.getCoordinate(),d)}else if(arguments[2]instanceof er&&arguments[0]instanceof ut&&arguments[1]instanceof D){var y=arguments[0],w=arguments[1],m=arguments[2],S=y.closestPoint(w);m.setMinimum(S,w)}};var zs=function(t){this._maxPtDist=new er,this._inputGeom=t||null},Gf={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};zs.prototype.computeMaxMidpointDistance=function(t){var e=new us(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},zs.prototype.computeMaxVertexDistance=function(t){var e=new Io(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},zs.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},zs.prototype.getDistancePoints=function(){return this._maxPtDist},zs.prototype.interfaces_=function(){return[]},zs.prototype.getClass=function(){return zs},Gf.MaxPointDistanceFilter.get=function(){return Io},Gf.MaxMidpointDistanceFilter.get=function(){return us},Object.defineProperties(zs,Gf);var Io=function(t){this._maxPtDist=new er,this._minPtDist=new er,this._geom=t||null};Io.prototype.filter=function(t){this._minPtDist.initialize(),fi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Io.prototype.getMaxPointDistance=function(){return this._maxPtDist},Io.prototype.interfaces_=function(){return[ii]},Io.prototype.getClass=function(){return Io};var us=function(t){this._maxPtDist=new er,this._minPtDist=new er,this._geom=t||null};us.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),s=new D((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),fi.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},us.prototype.isDone=function(){return!1},us.prototype.isGeometryChanged=function(){return!1},us.prototype.getMaxPointDistance=function(){return this._maxPtDist},us.prototype.interfaces_=function(){return[fn]},us.prototype.getClass=function(){return us};var Vi=function(t){this._comps=t||null};Vi.prototype.filter=function(t){t instanceof Ie&&this._comps.add(t)},Vi.prototype.interfaces_=function(){return[Tn]},Vi.prototype.getClass=function(){return Vi},Vi.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Vi.getPolygons(t,new j)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Ie?r.add(e):e instanceof $e&&e.apply(new Vi(r)),r}};var ke=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],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};ke.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof si){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ce&&this._lines.add(t)},ke.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},ke.prototype.interfaces_=function(){return[Ti]},ke.prototype.getClass=function(){return ke},ke.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(ke.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(ke.getLines(e,r))}},ke.getLines=function(){if(arguments.length===1){var t=arguments[0];return ke.getLines(t,!1)}else if(arguments.length===2){if(pt(arguments[0],Pe)&&pt(arguments[1],Pe)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var s=i.next();ke.getLines(s,r)}return r}else if(arguments[0]instanceof gt&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new j;return o.apply(new ke(u,a)),u}else if(arguments[0]instanceof gt&&pt(arguments[1],Pe)){var l=arguments[0],c=arguments[1];return l instanceof ce?c.add(l):l.apply(new ke(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&pt(arguments[0],Pe)&&pt(arguments[1],Pe)){for(var h=arguments[0],f=arguments[1],d=arguments[2],v=h.iterator();v.hasNext();){var _=v.next();ke.getLines(_,f,d)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof gt&&pt(arguments[1],Pe)){var E=arguments[0],P=arguments[1],y=arguments[2];return E.apply(new ke(P,y)),P}}};var vn=function(){if(this._boundaryRule=Qr.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 ae("Rule must be non-null");this._boundaryRule=t}}};vn.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof D&&arguments[1]instanceof Ie){var e=arguments[0],r=arguments[1];if(r.isEmpty())return F.EXTERIOR;var i=r.getExteriorRing(),s=this.locateInPolygonRing(e,i);if(s===F.EXTERIOR)return F.EXTERIOR;if(s===F.BOUNDARY)return F.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var a=r.getInteriorRingN(o),u=t.locateInPolygonRing(e,a);if(u===F.INTERIOR)return F.EXTERIOR;if(u===F.BOUNDARY)return F.BOUNDARY}return F.INTERIOR}else if(arguments[0]instanceof D&&arguments[1]instanceof ce){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return F.EXTERIOR;var h=c.getCoordinates();return!c.isClosed()&&(l.equals(h[0])||l.equals(h[h.length-1]))?F.BOUNDARY:K.isOnLine(l,h)?F.INTERIOR:F.EXTERIOR}else if(arguments[0]instanceof D&&arguments[1]instanceof wr){var f=arguments[0],d=arguments[1],v=d.getCoordinate();return v.equals2D(f)?F.INTERIOR:F.EXTERIOR}},vn.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?K.locatePointInRing(t,e.getCoordinates()):F.EXTERIOR},vn.prototype.intersects=function(t,e){return this.locate(t,e)!==F.EXTERIOR},vn.prototype.updateLocationInfo=function(t){t===F.INTERIOR&&(this._isIn=!0),t===F.BOUNDARY&&this._numBoundaries++},vn.prototype.computeLocation=function(t,e){var r=this;if(e instanceof wr&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ce)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ie)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fs)for(var i=e,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);r.updateLocationInfo(r.locateInternal(t,o))}else if(e instanceof oi)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof $e)for(var c=new li(e);c.hasNext();){var h=c.next();h!==e&&r.computeLocation(t,h)}},vn.prototype.locate=function(t,e){return e.isEmpty()?F.EXTERIOR:e instanceof ce?this.locateInternal(t,e):e instanceof Ie?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?F.BOUNDARY:this._numBoundaries>0||this._isIn?F.INTERIOR:F.EXTERIOR)},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var rr=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];n.call(this,t,n.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._component=r,this._segIndex=i,this._pt=s}},Nv={INSIDE_AREA:{configurable:!0}};rr.prototype.isInsideArea=function(){return this._segIndex===rr.INSIDE_AREA},rr.prototype.getCoordinate=function(){return this._pt},rr.prototype.getGeometryComponent=function(){return this._component},rr.prototype.getSegmentIndex=function(){return this._segIndex},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},Nv.INSIDE_AREA.get=function(){return-1},Object.defineProperties(rr,Nv);var ls=function(t){this._pts=t||null};ls.prototype.filter=function(t){t instanceof wr&&this._pts.add(t)},ls.prototype.interfaces_=function(){return[Tn]},ls.prototype.getClass=function(){return ls},ls.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof wr?gn.singletonList(t):ls.getPoints(t,new j)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof wr?r.add(e):e instanceof $e&&e.apply(new ls(r)),r}};var Mo=function(){this._locations=null;var t=arguments[0];this._locations=t};Mo.prototype.filter=function(t){(t instanceof wr||t instanceof ce||t instanceof Ie)&&this._locations.add(new rr(t,0,t.getCoordinate()))},Mo.prototype.interfaces_=function(){return[Tn]},Mo.prototype.getClass=function(){return Mo},Mo.getLocations=function(t){var e=new j;return t.apply(new Mo(e)),e};var Ve=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new vn,this._minDistanceLocation=null,this._minDistance=yt.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 r=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=s}};Ve.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 r=arguments[0],i=arguments[1],s=1-r,o=Vi.getPolygons(this._geom[r]);if(o.size()>0){var a=Mo.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&pt(arguments[0],hn)&&pt(arguments[1],hn)){for(var u=arguments[0],l=arguments[1],c=arguments[2],h=0;h<u.size();h++)for(var f=u.get(h),d=0;d<l.size();d++)if(t.computeContainmentDistance(f,l.get(d),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof rr&&arguments[1]instanceof Ie){var v=arguments[0],_=arguments[1],E=arguments[2],P=v.getCoordinate();if(F.EXTERIOR!==this._ptLocator.locate(P,_))return this._minDistance=0,E[0]=v,E[1]=new rr(_,P),null}}},Ve.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},Ve.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=ke.getLines(this._geom[0]),r=ke.getLines(this._geom[1]),i=ls.getPoints(this._geom[0]),s=ls.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,s,t),this.updateMinDistance(t,!1)},Ve.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ve.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])},Ve.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Ve.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 ce&&arguments[1]instanceof wr){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=r.getCoordinate(),a=0;a<s.length-1;a++){var u=K.distancePointLine(o,s[a],s[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new ut(s[a],s[a+1]),c=l.closestPoint(o);i[0]=new rr(e,a,c),i[1]=new rr(r,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ce&&arguments[1]instanceof ce){var h=arguments[0],f=arguments[1],d=arguments[2];if(h.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=h.getCoordinates(),_=f.getCoordinates(),E=0;E<v.length-1;E++)for(var P=0;P<_.length-1;P++){var y=K.distanceLineLine(v[E],v[E+1],_[P],_[P+1]);if(y<t._minDistance){t._minDistance=y;var w=new ut(v[E],v[E+1]),m=new ut(_[P],_[P+1]),S=w.closestPoints(m);d[0]=new rr(h,E,S[0]),d[1]=new rr(f,P,S[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Ve.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new rr(o,0,o.getCoordinate()),r[1]=new rr(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Ve.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ae("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Ve.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.distance=function(t,e){var r=new Ve(t,e);return r.distance()},Ve.isWithinDistance=function(t,e,r){var i=new Ve(t,e,r);return i.distance()<=r},Ve.nearestPoints=function(t,e){var r=new Ve(t,e);return r.nearestPoints()};var Je=function(){this._pt=[new D,new D],this._distance=yt.NaN,this._isNull=!0};Je.prototype.getCoordinates=function(){return this._pt},Je.prototype.getCoordinate=function(t){return this._pt[t]},Je.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},Je.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Je.prototype.toString=function(){return ln.toLineString(this._pt[0],this._pt[1])},Je.prototype.getDistance=function(){return this._distance},Je.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Vn=function(){};Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Vn.computeDistance=function(){if(arguments[2]instanceof Je&&arguments[0]instanceof ce&&arguments[1]instanceof D)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new ut,s=t.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof Je&&arguments[0]instanceof Ie&&arguments[1]instanceof D){var u=arguments[0],l=arguments[1],c=arguments[2];Vn.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Vn.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Je&&arguments[0]instanceof gt&&arguments[1]instanceof D){var f=arguments[0],d=arguments[1],v=arguments[2];if(f instanceof ce)Vn.computeDistance(f,d,v);else if(f instanceof Ie)Vn.computeDistance(f,d,v);else if(f instanceof $e)for(var _=f,E=0;E<_.getNumGeometries();E++){var P=_.getGeometryN(E);Vn.computeDistance(P,d,v)}else v.setMinimum(f.getCoordinate(),d)}else if(arguments[2]instanceof Je&&arguments[0]instanceof ut&&arguments[1]instanceof D){var y=arguments[0],w=arguments[1],m=arguments[2],S=y.closestPoint(w);m.setMinimum(S,w)}};var en=function(){this._g0=null,this._g1=null,this._ptDist=new Je,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},kf={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};en.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},en.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ae("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},en.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},en.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},en.prototype.computeOrientedDistance=function(t,e,r){var i=new bo(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new hs(e,this._densifyFrac);t.apply(s),r.setMaximum(s.getMaxPointDistance())}},en.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new en(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new en(i,s);return a.setDensifyFraction(o),a.distance()}},kf.MaxPointDistanceFilter.get=function(){return bo},kf.MaxDensifiedByFractionDistanceFilter.get=function(){return hs},Object.defineProperties(en,kf);var bo=function(){this._maxPtDist=new Je,this._minPtDist=new Je,this._euclideanDist=new Vn,this._geom=null;var t=arguments[0];this._geom=t};bo.prototype.filter=function(t){this._minPtDist.initialize(),Vn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},bo.prototype.getMaxPointDistance=function(){return this._maxPtDist},bo.prototype.interfaces_=function(){return[ii]},bo.prototype.getClass=function(){return bo};var hs=function(){this._maxPtDist=new Je,this._minPtDist=new Je,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};hs.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,c=i.y+u*a,h=new D(l,c);r._minPtDist.initialize(),Vn.computeDistance(r._geom,h,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},hs.prototype.isDone=function(){return!1},hs.prototype.isGeometryChanged=function(){return!1},hs.prototype.getMaxPointDistance=function(){return this._maxPtDist},hs.prototype.interfaces_=function(){return[fn]},hs.prototype.getClass=function(){return hs};var Cr=function(t,e,r){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=r||null},Vf={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Cr.prototype.checkMaximumDistance=function(t,e,r){var i=new en(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ln.toLineString(s[0],s[1])+")"}},Cr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Cr.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(),Cr.VERBOSE&&Re.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Cr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ie||this._input instanceof oi||this._input instanceof $e))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)},Cr.prototype.getErrorIndicator=function(){return this._errorIndicator},Cr.prototype.checkMinimumDistance=function(t,e,r){var i=new Ve(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+ln.toLineString(s[0],s[1])+" )"}},Cr.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)},Cr.prototype.getErrorLocation=function(){return this._errorLocation},Cr.prototype.getPolygonLines=function(t){for(var e=new j,r=new ke(e),i=Vi.getPolygons(t),s=i.iterator();s.hasNext();){var o=s.next();o.apply(r)}return t.getFactory().buildGeometry(e)},Cr.prototype.getErrorMessage=function(){return this._errMsg},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Vf.VERBOSE.get=function(){return!1},Vf.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Cr,Vf);var Ue=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},Uf={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ue.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},Ue.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ue.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new at(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new at(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},Ue.prototype.checkDistance=function(){var t=new Cr(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")},Ue.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")},Ue.prototype.checkPolygonal=function(){this._result instanceof Ie||this._result instanceof oi||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ue.prototype.getErrorIndicator=function(){return this._errorIndicator},Ue.prototype.getErrorLocation=function(){return this._errorLocation},Ue.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")},Ue.prototype.report=function(t){if(!Ue.VERBOSE)return null;Re.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ue.prototype.getErrorMessage=function(){return this._errorMsg},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue},Ue.isValidMsg=function(t,e,r){var i=new Ue(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ue.isValid=function(t,e,r){var i=new Ue(t,e,r);return!!i.isValid()},Uf.VERBOSE.get=function(){return!1},Uf.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ue,Uf);var Un=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Un.prototype.getCoordinates=function(){return this._pts},Un.prototype.size=function(){return this._pts.length},Un.prototype.getCoordinate=function(t){return this._pts[t]},Un.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Un.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Eo.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Un.prototype.setData=function(t){this._data=t},Un.prototype.getData=function(){return this._data},Un.prototype.toString=function(){return ln.toLineString(new pe(this._pts))},Un.prototype.interfaces_=function(){return[ui]},Un.prototype.getClass=function(){return Un};var Ae=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new j,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ae.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ae.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ae.prototype.getIntersectionSegments=function(){return this._intSegments},Ae.prototype.count=function(){return this._intersectionCount},Ae.prototype.getIntersections=function(){return this._intersections},Ae.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ae.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ae.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,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++)},Ae.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ae.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ae.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ae.prototype.interfaces_=function(){return[Vs]},Ae.prototype.getClass=function(){return Ae},Ae.createAllIntersectionsFinder=function(t){var e=new Ae(t);return e.setFindAllIntersections(!0),e},Ae.createAnyIntersectionFinder=function(t){return new Ae(t)},Ae.createIntersectionCounter=function(t){var e=new Ae(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var mn=function(){this._li=new Ds,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};mn.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},mn.prototype.getIntersections=function(){return this._segInt.getIntersections()},mn.prototype.isValid=function(){return this.execute(),this._isValid},mn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},mn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ae(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Ff;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},mn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ri(this.getErrorMessage(),this._segInt.getInteriorIntersection())},mn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ln.toLineString(t[0],t[1])+" and "+ln.toLineString(t[2],t[3])},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.computeIntersections=function(t){var e=new mn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var qs=function n(){this._nv=null;var t=arguments[0];this._nv=new mn(n.toSegmentStrings(t))};qs.prototype.checkValid=function(){this._nv.checkValid()},qs.prototype.interfaces_=function(){return[]},qs.prototype.getClass=function(){return qs},qs.toSegmentStrings=function(t){for(var e=new j,r=t.iterator();r.hasNext();){var i=r.next();e.add(new Un(i.getCoordinates(),i))}return e},qs.checkValid=function(t){var e=new qs(t);e.checkValid()};var No=function(t){this._mapOp=t};No.prototype.map=function(t){for(var e=this,r=new j,i=0;i<t.getNumGeometries();i++){var s=e._mapOp.map(t.getGeometryN(i));s.isEmpty()||r.add(s)}return t.getFactory().createGeometryCollection(xt.toGeometryArray(r))},No.prototype.interfaces_=function(){return[]},No.prototype.getClass=function(){return No},No.map=function(t,e){var r=new No(e);return r.map(t)};var zn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new j,this._resultLineList=new j;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};zn.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},zn.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},zn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},zn.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&St.isResultOfOp(i,e)&&!s.isCovered()&&(r.add(s),t.setVisitedEdge(!0))},zn.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},zn.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},zn.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),s=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(s),i.setInResult(!0)}},zn.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Pt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),St.isResultOfOp(i,e)&&e===St.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn};var xo=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new j;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};xo.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},xo.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===St.INTERSECTION)){var s=i.getLabel();St.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(i)}}},xo.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo};var fr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};fr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},fr.prototype.transformPolygon=function(t,e){var r=this,i=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof si)||s.isEmpty())&&(i=!1);for(var o=new j,a=0;a<t.getNumInteriorRing();a++){var u=r.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof si||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new j;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},fr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},fr.prototype.getInputGeometry=function(){return this._inputGeom},fr.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},fr.prototype.transformCoordinates=function(t,e){return this.copy(t)},fr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},fr.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},fr.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},fr.prototype.copy=function(t){return t.copy()},fr.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transform(t.getGeometryN(s));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(xt.toGeometryArray(i)):this._factory.buildGeometry(i)},fr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof wr)return this.transformPoint(t,null);if(t instanceof Na)return this.transformMultiPoint(t,null);if(t instanceof si)return this.transformLinearRing(t,null);if(t instanceof ce)return this.transformLineString(t,null);if(t instanceof Fs)return this.transformMultiLineString(t,null);if(t instanceof Ie)return this.transformPolygon(t,null);if(t instanceof oi)return this.transformMultiPolygon(t,null);if(t instanceof $e)return this.transformGeometryCollection(t,null);throw new ae("Unknown Geometry subtype: "+t.getClass().getName())},fr.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr};var di=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ut,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ce&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];n.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};di.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),s=0;s<i;s++){var o=t.get(s),a=r.findSnapForVertex(o,e);a!==null&&(t.set(s,new D(a)),s===0&&r._isClosed&&t.set(t.size()-1,new D(a)))}},di.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null},di.prototype.snapTo=function(t){var e=new al(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},di.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var s=0;s<i;s++){var o=e[s],a=r.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new D(o),!1)}},di.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=yt.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(r._seg.p0=e.get(o),r._seg.p1=e.get(o+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(t);a<r._snapTolerance&&a<i&&(i=a,s=o)}return s},di.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var me=function(t){this._srcGeom=t||null},xv={SNAP_PRECISION_FACTOR:{configurable:!0}};me.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Tv(e,r);return i.transform(this._srcGeom)},me.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Tv(t,r,!0),s=i.transform(this._srcGeom),o=s;return e&&pt(o,ns)&&(o=s.buffer(0)),o},me.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},me.prototype.extractTargetCoordinates=function(t){for(var e=new xn,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},me.prototype.computeMinimumSegmentLength=function(t){for(var e=yt.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.snap=function(t,e,r){var i=new Array(2).fill(null),s=new me(t);i[0]=s.snapTo(e,r);var o=new me(e);return i[1]=o.snapTo(i[0],r),i},me.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=me.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===Ut.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(me.computeOverlaySnapTolerance(s),me.computeOverlaySnapTolerance(o))}},me.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*me.SNAP_PRECISION_FACTOR;return i},me.snapToSelf=function(t,e,r){var i=new me(t);return i.snapToSelf(e,r)},xv.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(me,xv);var Tv=function(n){function t(e,r,i){n.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var s=new di(r,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var s=r.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fr),nr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};nr.prototype.getCommon=function(){return yt.longBitsToDouble(this._commonBits)},nr.prototype.add=function(t){var e=yt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=nr.signExpBits(this._commonBits),this._isFirst=!1,null;var r=nr.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=nr.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=nr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},nr.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=yt.longBitsToDouble(t),r=yt.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},nr.getBit=function(t,e){var r=1<<e;return(t&r)!==0?1:0},nr.signExpBits=function(t){return t>>52},nr.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,s=t&i;return s},nr.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(nr.getBit(t,i)!==nr.getBit(e,i))return r;r++}return 52};var cs=function(){this._commonCoord=null,this._ccFilter=new To},zf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};cs.prototype.addCommonBits=function(t){var e=new fs(this._commonCoord);t.apply(e),t.geometryChanged()},cs.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new D(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new fs(e);return t.apply(r),t.geometryChanged(),t},cs.prototype.getCommonCoordinate=function(){return this._commonCoord},cs.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},cs.prototype.interfaces_=function(){return[]},cs.prototype.getClass=function(){return cs},zf.CommonCoordinateFilter.get=function(){return To},zf.Translater.get=function(){return fs},Object.defineProperties(cs,zf);var To=function(){this._commonBitsX=new nr,this._commonBitsY=new nr};To.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},To.prototype.getCommonCoordinate=function(){return new D(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},To.prototype.interfaces_=function(){return[ii]},To.prototype.getClass=function(){return To};var fs=function(){this.trans=null;var t=arguments[0];this.trans=t};fs.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)},fs.prototype.isDone=function(){return!1},fs.prototype.isGeometryChanged=function(){return!0},fs.prototype.interfaces_=function(){return[fn]},fs.prototype.getClass=function(){return fs};var Oe=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()};Oe.prototype.selfSnap=function(t){var e=new me(t),r=e.snapTo(t,this._snapTolerance);return r},Oe.prototype.removeCommonBits=function(t){this._cbr=new cs,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},Oe.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Oe.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=St.overlayOp(e[0],e[1],t);return this.prepareResult(r)},Oe.prototype.checkValid=function(t){t.isValid()||Re.out.println("Snapped geometry is invalid")},Oe.prototype.computeSnapTolerance=function(){this._snapTolerance=me.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Oe.prototype.snap=function(t){var e=this.removeCommonBits(t),r=me.snap(e[0],e[1],this._snapTolerance);return r},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.overlayOp=function(t,e,r){var i=new Oe(t,e);return i.getResultGeometry(r)},Oe.union=function(t,e){return Oe.overlayOp(t,e,St.UNION)},Oe.intersection=function(t,e){return Oe.overlayOp(t,e,St.INTERSECTION)},Oe.symDifference=function(t,e){return Oe.overlayOp(t,e,St.SYMDIFFERENCE)},Oe.difference=function(t,e){return Oe.overlayOp(t,e,St.DIFFERENCE)};var ir=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ir.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=St.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(r=!0)}catch(o){if(o instanceof xi)i=o;else throw o}finally{}if(!r)try{e=Oe.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof xi?i:o}finally{}return e},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},ir.overlayOp=function(t,e,r){var i=new ir(t,e);return i.getResultGeometry(r)},ir.union=function(t,e){return ir.overlayOp(t,e,St.UNION)},ir.intersection=function(t,e){return ir.overlayOp(t,e,St.INTERSECTION)},ir.symDifference=function(t,e){return ir.overlayOp(t,e,St.SYMDIFFERENCE)},ir.difference=function(t,e){return ir.overlayOp(t,e,St.DIFFERENCE)};var Sl=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Sl.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl};var Pr=function n(){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=n.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=s}},qf={INSERT:{configurable:!0},DELETE:{configurable:!0}};Pr.prototype.isDelete=function(){return this._eventType===Pr.DELETE},Pr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Pr.prototype.getObject=function(){return this._obj},Pr.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},Pr.prototype.getInsertEvent=function(){return this._insertEvent},Pr.prototype.isInsert=function(){return this._eventType===Pr.INSERT},Pr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Pr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Pr.prototype.interfaces_=function(){return[Jr]},Pr.prototype.getClass=function(){return Pr},qf.INSERT.get=function(){return 1},qf.DELETE.get=function(){return 2},Object.defineProperties(Pr,qf);var Rh=function(){};Rh.prototype.interfaces_=function(){return[]},Rh.prototype.getClass=function(){return Rh};var ze=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],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};ze.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(ze.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},ze.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ze.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ze.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ze.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),s=i.getCoordinate();if(t.isIntersection(s))return!0}return!1},ze.prototype.hasProperIntersection=function(){return this._hasProper},ze.prototype.hasIntersection=function(){return this._hasIntersection},ze.prototype.isDone=function(){return this._isDone},ze.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},ze.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ze.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.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))))},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var EI=function(n){function t(){n.call(this),this.events=new j,this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;gn.sort(this.events);for(var i=0;i<this.events.size();i++){var s=r.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=r.events.get(s);if(o.isInsert()&&r.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof ze&&pt(arguments[0],hn)&&pt(arguments[1],hn)){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"&&pt(arguments[0],hn)&&arguments[1]instanceof ze){var c=arguments[0],h=arguments[1],f=arguments[2];f?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(h)}}},t.prototype.addEdge=function(r,i){for(var s=this,o=r.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Sl(o,u),c=new Pr(i,o.getMinX(u),l);s.events.add(c),s.events.add(new Pr(o.getMaxX(u),c))}},t.prototype.processOverlaps=function(r,i,s,o){for(var a=this,u=s.getObject(),l=r;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var h=c.getObject();s.isSameLabel(c)||(u.computeIntersections(h,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();r.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();r.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Rh),gi=function(){this._min=yt.POSITIVE_INFINITY,this._max=yt.NEGATIVE_INFINITY},Av={NodeComparator:{configurable:!0}};gi.prototype.getMin=function(){return this._min},gi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},gi.prototype.getMax=function(){return this._max},gi.prototype.toString=function(){return ln.toLineString(new D(this._min,0),new D(this._max,0))},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},Av.NodeComparator.get=function(){return Cl},Object.defineProperties(gi,Av);var Cl=function(){};Cl.prototype.compare=function(t,e){var r=t,i=e,s=(r._min+r._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},Cl.prototype.interfaces_=function(){return[ma]},Cl.prototype.getClass=function(){return Cl};var SI=function(n){function t(){n.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(gi),CI=function(n){function t(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,s),this._node2!==null&&this._node2.query(r,i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(gi),pi=function(){this._leaves=new j,this._root=null,this._level=0};pi.prototype.buildTree=function(){var t=this;gn.sort(this._leaves,new gi.NodeComparator);for(var e=this._leaves,r=null,i=new j;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}},pi.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new SI(t,e,r))},pi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},pi.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},pi.prototype.printNode=function(t){Re.out.println(ln.toLineString(new D(t._min,this._level),new D(t._max,this._level)))},pi.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},pi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),s=r+1<t.size()?t.get(r):null;if(s===null)e.add(i);else{var o=new CI(t.get(r),t.get(r+1));e.add(o)}}},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var Ra=function(){this._items=new j};Ra.prototype.visitItem=function(t){this._items.add(t)},Ra.prototype.getItems=function(){return this._items},Ra.prototype.interfaces_=function(){return[is]},Ra.prototype.getClass=function(){return Ra};var Fa=function(){this._index=null;var t=arguments[0];if(!pt(t,ns))throw new ae("Argument must be Polygonal");this._index=new Ws(t)},Wf={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Fa.prototype.locate=function(t){var e=new Nn(t),r=new Ga(e);return this._index.query(t.y,t.y,r),e.getLocation()},Fa.prototype.interfaces_=function(){return[Oa]},Fa.prototype.getClass=function(){return Fa},Wf.SegmentVisitor.get=function(){return Ga},Wf.IntervalIndexedGeometry.get=function(){return Ws},Object.defineProperties(Fa,Wf);var Ga=function(){this._counter=null;var t=arguments[0];this._counter=t};Ga.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ga.prototype.interfaces_=function(){return[is]},Ga.prototype.getClass=function(){return Ga};var Ws=function(){this._index=new pi;var t=arguments[0];this.init(t)};Ws.prototype.init=function(t){for(var e=this,r=ke.getLines(t),i=r.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();e.addLine(o)}},Ws.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new ut(t[r-1],t[r]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);e._index.insert(s,o,i)}},Ws.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ra;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Ws.prototype.interfaces_=function(){return[]},Ws.prototype.getClass=function(){return Ws};var Pl=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new fv,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new vn,arguments.length===2){var e=arguments[0],r=arguments[1],i=Qr.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=F.NONE;u=o.getLocation(r,B.ON),u===F.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new ze(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof si||this._parentGeom instanceof Ie||this._parentGeom instanceof oi,h=o||!c;return l.computeIntersections(this._edges,u,h),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,s){var o=new ze(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._edges,o),o},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 wr){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,F.INTERIOR)}else if(arguments[0]instanceof D){var s=arguments[0];this.insertPoint(this._argIndex,s,F.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),F.EXTERIOR,F.INTERIOR);for(var s=0;s<r.getNumInteriorRing();s++){var o=r.getInteriorRingN(s);i.addPolygonRing(o,F.INTERIOR,F.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],F.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],F.BOUNDARY)},t.prototype.addLineString=function(r){var i=Nt.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new Lh(i,new Yt(this._argIndex,F.INTERIOR));this._lineEdgeMap.put(r,s),this.insertEdge(s),Pt.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 r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),s=0,o=r.iterator();o.hasNext();){var a=o.next();i[s++]=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(r,i,s){if(this.isBoundaryNode(r,i))return null;s===F.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,s)},t.prototype.addPolygonRing=function(r,i,s){if(r.isEmpty())return null;var o=Nt.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;K.isCCW(o)&&(a=s,u=i);var l=new Lh(o,new Yt(this._argIndex,F.BOUNDARY,a,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],F.BOUNDARY)},t.prototype.insertPoint=function(r,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new Yt(r,s):a.setLocation(r,s)},t.prototype.createEdgeSetIntersector=function(){return new EI},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(r),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof oi&&(this._useBoundaryDeterminationRule=!1),r instanceof Ie)this.addPolygon(r);else if(r instanceof ce)this.addLineString(r);else if(r instanceof wr)this.addPoint(r);else if(r instanceof Na)this.addCollection(r);else if(r instanceof Fs)this.addCollection(r);else if(r instanceof oi)this.addCollection(r);else if(r instanceof $e)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);i.add(o)}},t.prototype.locate=function(r){return pt(this._parentGeom,ns)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Fa(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?F.BOUNDARY:F.INTERIOR},t}(he),ka=function(){if(this._li=new Ds,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 Pl(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Qr.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Pl(0,e,i),this._arg[1]=new Pl(1,r,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Pl(0,s,a),this._arg[1]=new Pl(1,o,a)}};ka.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},ka.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},ka.prototype.interfaces_=function(){return[]},ka.prototype.getClass=function(){return ka};var Hs=function(){};Hs.prototype.interfaces_=function(){return[]},Hs.prototype.getClass=function(){return Hs},Hs.map=function(){if(arguments[0]instanceof gt&&pt(arguments[1],Hs.MapOp)){for(var t=arguments[0],e=arguments[1],r=new j,i=0;i<t.getNumGeometries();i++){var s=e.map(t.getGeometryN(i));s!==null&&r.add(s)}return t.getFactory().buildGeometry(r)}else if(pt(arguments[0],Pe)&&pt(arguments[1],Hs.MapOp)){for(var o=arguments[0],a=arguments[1],u=new j,l=o.iterator();l.hasNext();){var c=l.next(),h=a.map(c);h!==null&&u.add(h)}return u}},Hs.MapOp=function(){};var St=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r),this._ptLocator=new vn,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new pn,this._resultPolyList=new j,this._resultLineList=new j,this._resultPointList=new j,this._graph=new he(new Sv),this._geomFact=e.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var s=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new Yt(r.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,s,o){var a=new j;return a.addAll(r),a.addAll(i),a.addAll(s),a.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(r,a);if(u!==F.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new j,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),r.add(s.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,s=r.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(r){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 j;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),qs.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var s=new Er(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new zn(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var a=new xo(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var s=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,s)},t.prototype.copyPoints=function(r){for(var i=this,s=this._arg[r].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(r,o.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,B.RIGHT),o.getLocation(1,B.RIGHT),r)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(Pt.isTrue(!o.isNull(a,B.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,B.LEFT,o.getLocation(a,B.LEFT)),Pt.isTrue(!o.isNull(a,B.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,B.RIGHT,o.getLocation(a,B.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(s,0):r.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ka);St.overlayOp=function(n,t,e){var r=new St(n,t),i=r.getResultGeometry(e);return i},St.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return St.createEmptyResult(St.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var e=t;return No.map(n,{interfaces_:function(){return[Hs.MapOp]},map:function(r){return r.intersection(e)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ir.overlayOp(n,t,St.INTERSECTION)},St.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return St.createEmptyResult(St.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ir.overlayOp(n,t,St.SYMDIFFERENCE)},St.resultDimension=function(n,t,e){var r=t.getDimension(),i=e.getDimension(),s=-1;switch(n){case St.INTERSECTION:s=Math.min(r,i);break;case St.UNION:s=Math.max(r,i);break;case St.DIFFERENCE:s=r;break;case St.SYMDIFFERENCE:s=Math.max(r,i);break}return s},St.createEmptyResult=function(n,t,e,r){var i=null;switch(St.resultDimension(n,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},St.difference=function(n,t){return n.isEmpty()?St.createEmptyResult(St.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ir.overlayOp(n,t,St.DIFFERENCE))},St.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],t=arguments[1],e=n.getLocation(0),r=n.getLocation(1);return St.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===F.BOUNDARY&&(i=F.INTERIOR),s===F.BOUNDARY&&(s=F.INTERIOR),o){case St.INTERSECTION:return i===F.INTERIOR&&s===F.INTERIOR;case St.UNION:return i===F.INTERIOR||s===F.INTERIOR;case St.DIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR;case St.SYMDIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR||i!==F.INTERIOR&&s===F.INTERIOR}return!1}},St.INTERSECTION=1,St.UNION=2,St.DIFFERENCE=3,St.SYMDIFFERENCE=4;var ds=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new vn,this._seg=new ut;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};ds.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,e._seg.p0),s.getCoordinate(o+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},ds.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?F.BOUNDARY:this._ptLocator.locate(t,this._g)},ds.prototype.extractLinework=function(t){var e=new Va;t.apply(e);var r=e.getLinework(),i=xt.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},ds.prototype.interfaces_=function(){return[]},ds.prototype.getClass=function(){return ds};var Va=function(){this._linework=null,this._linework=new j};Va.prototype.getLinework=function(){return this._linework},Va.prototype.filter=function(t){var e=this;if(t instanceof Ie){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},Va.prototype.interfaces_=function(){return[Tn]},Va.prototype.getClass=function(){return Va};var Xs=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Xs.prototype.extractPoints=function(t,e,r){for(var i=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],e,r)},Xs.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Xs.prototype.getPoints=function(t){for(var e=this,r=new j,i=ke.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,r)}return r},Xs.prototype.computeOffsetPoints=function(t,e,r,i){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),u=r*s/a,l=r*o/a,c=(e.x+t.x)/2,h=(e.y+t.y)/2;if(this._doLeft){var f=new D(c-l,h+u);i.add(f)}if(this._doRight){var d=new D(c+l,h-u);i.add(d)}},Xs.prototype.interfaces_=function(){return[]},Xs.prototype.getClass=function(){return Xs};var Ur=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new j;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new ds(this._geom[0],this._boundaryDistanceTolerance),new ds(this._geom[1],this._boundaryDistanceTolerance),new ds(this._geom[2],this._boundaryDistanceTolerance)]},Ov={TOLERANCE:{configurable:!0}};Ur.prototype.reportResult=function(t,e,r){Re.out.println("Overlay result invalid - A:"+F.toLocationSymbol(e[0])+" B:"+F.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+F.toLocationSymbol(e[2]))},Ur.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ur.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Ur.hasLocation(this._location,F.BOUNDARY)?!0:this.isValidResult(s,this._location)}},Ur.prototype.addTestPts=function(t){var e=new Xs(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ur.prototype.isValidResult=function(t,e){var r=St.isResultOfOp(e[0],e[1],t),i=e[2]===F.INTERIOR,s=!(r^i);return s||this.reportResult(t,e,r),s},Ur.prototype.getInvalidLocation=function(){return this._invalidLocation},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},Ur.computeBoundaryDistanceTolerance=function(t,e){return Math.min(me.computeSizeBasedSnapTolerance(t),me.computeSizeBasedSnapTolerance(e))},Ur.isValid=function(t,e,r,i){var s=new Ur(t,e,i);return s.isValid(r)},Ov.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ur,Ov);var zr=function n(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(t),this._inputGeoms=t};zr.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);r._skipEmpty&&s.isEmpty()||e.add(s)}},zr.prototype.combine=function(){for(var t=this,e=new j,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.combine=function(){if(arguments.length===1){var t=arguments[0],e=new zr(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new zr(zr.createList(r,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new zr(zr.createList(o,a,u));return l.combine()}},zr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},zr.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new j;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new j;return a.add(i),a.add(s),a.add(o),a}};var Ee=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new j)},Dv={STRTREE_NODE_CAPACITY:{configurable:!0}};Ee.prototype.reduceToGeometries=function(t){for(var e=this,r=new j,i=t.iterator();i.hasNext();){var s=i.next(),o=null;pt(s,hn)?o=e.unionTree(s):s instanceof gt&&(o=s),r.add(o)}return r},Ee.prototype.extractByEnvelope=function(t,e,r){for(var i=new j,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)},Ee.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var s=zr.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},Ee.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 vv(Ee.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),s=this.unionTree(i);return s},Ee.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],r=arguments[1],i=arguments[2];if(i-r<=1){var s=Ee.getGeometry(e,r);return this.unionSafe(s,null)}else{if(i-r===2)return this.unionSafe(Ee.getGeometry(e,r),Ee.getGeometry(e,r+1));var o=Math.trunc((i+r)/2),a=this.binaryUnion(e,r,o),u=this.binaryUnion(e,o,i);return this.unionSafe(a,u)}}},Ee.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e},Ee.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Ee.prototype.unionActual=function(t,e){return Ee.restrictToPolygons(t.union(e))},Ee.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r},Ee.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new j,s=this.extractByEnvelope(r,t,i),o=this.extractByEnvelope(r,e,i),a=this.unionActual(s,o);i.add(a);var u=zr.combine(i);return u},Ee.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee},Ee.restrictToPolygons=function(t){if(pt(t,ns))return t;var e=Vi.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(xt.toPolygonArray(e))},Ee.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ee.union=function(t){var e=new Ee(t);return e.union()},Dv.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ee,Dv);var Fh=function(){};Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh},Fh.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return St.createEmptyResult(St.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ir.overlayOp(t,e,St.UNION)};function Bs(){return new Gh}function Gh(){this.reset()}Gh.prototype={constructor:Gh,reset:function(){this.s=this.t=0},add:function(n){Lv(kh,n,this.t),Lv(this,kh.s,this.s),this.s?this.t+=kh.t:this.s=kh.t},valueOf:function(){return this.s}};var kh=new Gh;function Lv(n,t,e){var r=n.s=t+e,i=r-t,s=r-i;n.t=t-s+(e-i)}var Se=1e-6,jt=Math.PI,Ui=jt/2,Rv=jt/4,zi=jt*2,Ys=180/jt,qn=jt/180,sr=Math.abs,PI=Math.atan,Ua=Math.atan2,be=Math.cos,Ne=Math.sin,za=Math.sqrt;function Fv(n){return n>1?0:n<-1?jt:Math.acos(n)}function Ao(n){return n>1?Ui:n<-1?-Ui:Math.asin(n)}function Il(){}function Vh(n,t){n&&kv.hasOwnProperty(n.type)&&kv[n.type](n,t)}var Gv={Feature:function(n,t){Vh(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)Vh(e[r].geometry,t)}},kv={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){Hf(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Hf(e[r],t,0)},Polygon:function(n,t){Vv(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Vv(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)Vh(e[r],t)}};function Hf(n,t,e){var r=-1,i=n.length-e,s;for(t.lineStart();++r<i;)s=n[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Vv(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)Hf(n[e],t,1);t.polygonEnd()}function II(n,t){n&&Gv.hasOwnProperty(n.type)?Gv[n.type](n,t):Vh(n,t)}Bs(),Bs();function Xf(n){return[Ua(n[1],n[0]),Ao(n[2])]}function qa(n){var t=n[0],e=n[1],r=be(e);return[r*be(t),r*Ne(t),Ne(e)]}function Uh(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function zh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Bf(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function qh(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Yf(n){var t=za(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}Bs();function Uv(n,t){function e(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(e.invert=function(r,i){return r=t.invert(r,i),r&&n.invert(r[0],r[1])}),e}function Jf(n,t){return[n>jt?n-zi:n<-jt?n+zi:n,t]}Jf.invert=Jf;function MI(n,t,e){return(n%=zi)?t||e?Uv(qv(n),Wv(t,e)):qv(n):t||e?Wv(t,e):Jf}function zv(n){return function(t,e){return t+=n,[t>jt?t-zi:t<-jt?t+zi:t,e]}}function qv(n){var t=zv(n);return t.invert=zv(-n),t}function Wv(n,t){var e=be(n),r=Ne(n),i=be(t),s=Ne(t);function o(a,u){var l=be(u),c=be(a)*l,h=Ne(a)*l,f=Ne(u),d=f*e+c*r;return[Ua(h*i-d*s,c*e-f*r),Ao(d*i+h*s)]}return o.invert=function(a,u){var l=be(u),c=be(a)*l,h=Ne(a)*l,f=Ne(u),d=f*i-h*s;return[Ua(h*i+f*s,c*e+d*r),Ao(d*e-c*r)]},o}function bI(n,t,e,r,i,s){if(e){var o=be(t),a=Ne(t),u=r*e;i==null?(i=t+r*zi,s=t-u/2):(i=Hv(o,i),s=Hv(o,s),(r>0?i<s:i>s)&&(i+=r*zi));for(var l,c=i;r>0?c>s:c<s;c-=u)l=Xf([o,-a*be(c),-a*Ne(c)]),n.point(l[0],l[1])}}function Hv(n,t){t=qa(t),t[0]-=n,Yf(t);var e=Fv(-t[1]);return((-t[2]<0?-e:e)+zi-Se)%zi}function Xv(){var n=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){n.push(t=[])},lineEnd:Il,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function NI(n,t,e,r,i,s){var o=n[0],a=n[1],u=t[0],l=t[1],c=0,h=1,f=u-o,d=l-a,v;if(v=e-o,!(!f&&v>0)){if(v/=f,f<0){if(v<c)return;v<h&&(h=v)}else if(f>0){if(v>h)return;v>c&&(c=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>h)return;v>c&&(c=v)}else if(f>0){if(v<c)return;v<h&&(h=v)}if(v=r-a,!(!d&&v>0)){if(v/=d,d<0){if(v<c)return;v<h&&(h=v)}else if(d>0){if(v>h)return;v>c&&(c=v)}if(v=s-a,!(!d&&v<0)){if(v/=d,d<0){if(v>h)return;v>c&&(c=v)}else if(d>0){if(v<c)return;v<h&&(h=v)}return c>0&&(n[0]=o+c*f,n[1]=a+c*d),h<1&&(t[0]=o+h*f,t[1]=a+h*d),!0}}}}}function Wh(n,t){return sr(n[0]-t[0])<Se&&sr(n[1]-t[1])<Se}function Hh(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Bv(n,t,e,r,i){var s=[],o=[],a,u;if(n.forEach(function(v){if(!((_=v.length-1)<=0)){var _,E=v[0],P=v[_],y;if(Wh(E,P)){for(i.lineStart(),a=0;a<_;++a)i.point((E=v[a])[0],E[1]);i.lineEnd();return}s.push(y=new Hh(E,v,null,!0)),o.push(y.o=new Hh(E,null,y,!1)),s.push(y=new Hh(P,v,null,!1)),o.push(y.o=new Hh(P,null,y,!0))}}),!!s.length){for(o.sort(t),Yv(s),Yv(o),a=0,u=o.length;a<u;++a)o[a].e=e=!e;for(var l=s[0],c,h;;){for(var f=l,d=!0;f.v;)if((f=f.n)===l)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(a=0,u=c.length;a<u;++a)i.point((h=c[a])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(d)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((h=c[a])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,d=!d}while(!f.v);i.lineEnd()}}}function Yv(n){if(t=n.length){for(var t,e=0,r=n[0],i;++e<t;)r.n=i=n[e],i.p=r,r=i;r.n=i=n[0],i.p=r}}function Jv(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function xI(n){return n.length===1&&(n=TI(n)),{left:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var s=r+i>>>1;n(t[s],e)<0?r=s+1:i=s}return r},right:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var s=r+i>>>1;n(t[s],e)>0?i=s:r=s+1}return r}}}function TI(n){return function(t,e){return Jv(n(t),e)}}xI(Jv);function jv(n){for(var t=n.length,e,r=-1,i=0,s,o;++r<t;)i+=n[r].length;for(s=new Array(i);--t>=0;)for(o=n[t],e=o.length;--e>=0;)s[--i]=o[e];return s}var Xh=1e9,Bh=-1e9;function AI(n,t,e,r){function i(l,c){return n<=l&&l<=e&&t<=c&&c<=r}function s(l,c,h,f){var d=0,v=0;if(l==null||(d=o(l,h))!==(v=o(c,h))||u(l,c)<0^h>0)do f.point(d===0||d===3?n:e,d>1?r:t);while((d=(d+h+4)%4)!==v);else f.point(c[0],c[1])}function o(l,c){return sr(l[0]-n)<Se?c>0?0:3:sr(l[0]-e)<Se?c>0?2:1:sr(l[1]-t)<Se?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var h=o(l,1),f=o(c,1);return h!==f?h-f:h===0?c[1]-l[1]:h===1?l[0]-c[0]:h===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,h=Xv(),f,d,v,_,E,P,y,w,m,S,C,I={point:b,lineStart:T,lineEnd:L,polygonStart:A,polygonEnd:N};function b($,Y){i($,Y)&&c.point($,Y)}function x(){for(var $=0,Y=0,Z=d.length;Y<Z;++Y)for(var G=d[Y],W=1,k=G.length,V=G[0],O,q,X=V[0],rt=V[1];W<k;++W)O=X,q=rt,V=G[W],X=V[0],rt=V[1],q<=r?rt>r&&(X-O)*(r-q)>(rt-q)*(n-O)&&++$:rt<=r&&(X-O)*(r-q)<(rt-q)*(n-O)&&--$;return $}function A(){c=h,f=[],d=[],C=!0}function N(){var $=x(),Y=C&&$,Z=(f=jv(f)).length;(Y||Z)&&(l.polygonStart(),Y&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),Z&&Bv(f,a,$,s,l),l.polygonEnd()),c=l,f=d=v=null}function T(){I.point=U,d&&d.push(v=[]),S=!0,m=!1,y=w=NaN}function L(){f&&(U(_,E),P&&m&&h.rejoin(),f.push(h.result())),I.point=b,m&&c.lineEnd()}function U($,Y){var Z=i($,Y);if(d&&v.push([$,Y]),S)_=$,E=Y,P=Z,S=!1,Z&&(c.lineStart(),c.point($,Y));else if(Z&&m)c.point($,Y);else{var G=[y=Math.max(Bh,Math.min(Xh,y)),w=Math.max(Bh,Math.min(Xh,w))],W=[$=Math.max(Bh,Math.min(Xh,$)),Y=Math.max(Bh,Math.min(Xh,Y))];NI(G,W,n,t,e,r)?(m||(c.lineStart(),c.point(G[0],G[1])),c.point(W[0],W[1]),Z||c.lineEnd(),C=!1):Z&&(c.lineStart(),c.point($,Y),C=!1)}y=$,w=Y,m=Z}return I}}var jf=Bs();function OI(n,t){var e=t[0],r=t[1],i=[Ne(e),-be(e),0],s=0,o=0;jf.reset();for(var a=0,u=n.length;a<u;++a)if(c=(l=n[a]).length)for(var l,c,h=l[c-1],f=h[0],d=h[1]/2+Rv,v=Ne(d),_=be(d),E=0;E<c;++E,f=y,v=m,_=S,h=P){var P=l[E],y=P[0],w=P[1]/2+Rv,m=Ne(w),S=be(w),C=y-f,I=C>=0?1:-1,b=I*C,x=b>jt,A=v*m;if(jf.add(Ua(A*I*Ne(b),_*S+A*be(b))),s+=x?C+I*zi:C,x^f>=e^y>=e){var N=zh(qa(h),qa(P));Yf(N);var T=zh(i,N);Yf(T);var L=(x^C>=0?-1:1)*Ao(T[2]);(r>L||r===L&&(N[0]||N[1]))&&(o+=x^C>=0?1:-1)}}return(s<-1e-6||s<Se&&jf<-1e-6)^o&1}Bs();function Qv(n){return n}Bs(),Bs();var Wa=1/0,Yh=Wa,Ml=-Wa,Jh=Ml,$v={point:DI,lineStart:Il,lineEnd:Il,polygonStart:Il,polygonEnd:Il,result:function(){var n=[[Wa,Yh],[Ml,Jh]];return Ml=Jh=-(Yh=Wa=1/0),n}};function DI(n,t){n<Wa&&(Wa=n),n>Ml&&(Ml=n),t<Yh&&(Yh=t),t>Jh&&(Jh=t)}Bs();function Kv(n,t,e,r){return function(i,s){var o=t(s),a=i.invert(r[0],r[1]),u=Xv(),l=t(u),c=!1,h,f,d,v={point:_,lineStart:P,lineEnd:y,polygonStart:function(){v.point=w,v.lineStart=m,v.lineEnd=S,f=[],h=[]},polygonEnd:function(){v.point=_,v.lineStart=P,v.lineEnd=y,f=jv(f);var C=OI(h,a);f.length?(c||(s.polygonStart(),c=!0),Bv(f,RI,C,e,s)):C&&(c||(s.polygonStart(),c=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),f=h=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function _(C,I){var b=i(C,I);n(C=b[0],I=b[1])&&s.point(C,I)}function E(C,I){var b=i(C,I);o.point(b[0],b[1])}function P(){v.point=E,o.lineStart()}function y(){v.point=_,o.lineEnd()}function w(C,I){d.push([C,I]);var b=i(C,I);l.point(b[0],b[1])}function m(){l.lineStart(),d=[]}function S(){w(d[0][0],d[0][1]),l.lineEnd();var C=l.clean(),I=u.result(),b,x=I.length,A,N,T;if(d.pop(),h.push(d),d=null,!!x){if(C&1){if(N=I[0],(A=N.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),b=0;b<A;++b)s.point((T=N[b])[0],T[1]);s.lineEnd()}return}x>1&&C&2&&I.push(I.pop().concat(I.shift())),f.push(I.filter(LI))}}return v}}function LI(n){return n.length>1}function RI(n,t){return((n=n.x)[0]<0?n[1]-Ui-Se:Ui-n[1])-((t=t.x)[0]<0?t[1]-Ui-Se:Ui-t[1])}const Zv=Kv(function(){return!0},FI,kI,[-jt,-Ui]);function FI(n){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(s,o){var a=s>0?jt:-jt,u=sr(s-t);sr(u-jt)<Se?(n.point(t,e=(e+o)/2>0?Ui:-Ui),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(s,e),i=0):r!==a&&u>=jt&&(sr(t-r)<Se&&(t-=r*Se),sr(s-a)<Se&&(s-=a*Se),e=GI(t,e,s,o),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),i=0),n.point(t=s,e=o),r=a},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function GI(n,t,e,r){var i,s,o=Ne(n-e);return sr(o)>Se?PI((Ne(t)*(s=be(r))*Ne(e)-Ne(r)*(i=be(t))*Ne(n))/(i*s*o)):(t+r)/2}function kI(n,t,e,r){var i;if(n==null)i=e*Ui,r.point(-jt,i),r.point(0,i),r.point(jt,i),r.point(jt,0),r.point(jt,-i),r.point(0,-i),r.point(-jt,-i),r.point(-jt,0),r.point(-jt,i);else if(sr(n[0]-t[0])>Se){var s=n[0]<t[0]?jt:-jt;i=e*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function VI(n,t){var e=be(n),r=e>0,i=sr(e)>Se;function s(c,h,f,d){bI(d,n,t,f,c,h)}function o(c,h){return be(c)*be(h)>e}function a(c){var h,f,d,v,_;return{lineStart:function(){v=d=!1,_=1},point:function(E,P){var y=[E,P],w,m=o(E,P),S=r?m?0:l(E,P):m?l(E+(E<0?jt:-jt),P):0;if(!h&&(v=d=m)&&c.lineStart(),m!==d&&(w=u(h,y),(!w||Wh(h,w)||Wh(y,w))&&(y[0]+=Se,y[1]+=Se,m=o(y[0],y[1]))),m!==d)_=0,m?(c.lineStart(),w=u(y,h),c.point(w[0],w[1])):(w=u(h,y),c.point(w[0],w[1]),c.lineEnd()),h=w;else if(i&&h&&r^m){var C;!(S&f)&&(C=u(y,h,!0))&&(_=0,r?(c.lineStart(),c.point(C[0][0],C[0][1]),c.point(C[1][0],C[1][1]),c.lineEnd()):(c.point(C[1][0],C[1][1]),c.lineEnd(),c.lineStart(),c.point(C[0][0],C[0][1])))}m&&(!h||!Wh(h,y))&&c.point(y[0],y[1]),h=y,d=m,f=S},lineEnd:function(){d&&c.lineEnd(),h=null},clean:function(){return _|(v&&d)<<1}}}function u(c,h,f){var d=qa(c),v=qa(h),_=[1,0,0],E=zh(d,v),P=Uh(E,E),y=E[0],w=P-y*y;if(!w)return!f&&c;var m=e*P/w,S=-e*y/w,C=zh(_,E),I=qh(_,m),b=qh(E,S);Bf(I,b);var x=C,A=Uh(I,x),N=Uh(x,x),T=A*A-N*(Uh(I,I)-1);if(!(T<0)){var L=za(T),U=qh(x,(-A-L)/N);if(Bf(U,I),U=Xf(U),!f)return U;var $=c[0],Y=h[0],Z=c[1],G=h[1],W;Y<$&&(W=$,$=Y,Y=W);var k=Y-$,V=sr(k-jt)<Se,O=V||k<Se;if(!V&&G<Z&&(W=Z,Z=G,G=W),O?V?Z+G>0^U[1]<(sr(U[0]-$)<Se?Z:G):Z<=U[1]&&U[1]<=G:k>jt^($<=U[0]&&U[0]<=Y)){var q=qh(x,(-A+L)/N);return Bf(q,I),[U,Xf(q)]}}}function l(c,h){var f=r?n:jt-n,d=0;return c<-f?d|=1:c>f&&(d|=2),h<-f?d|=4:h>f&&(d|=8),d}return Kv(o,a,s,r?[0,-n]:[-jt,n-jt])}function tm(n){return function(t){var e=new Qf;for(var r in n)e[r]=n[r];return e.stream=t,e}}function Qf(){}Qf.prototype={constructor:Qf,point:function(n,t){this.stream.point(n,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 em(n,t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),s!=null&&n.clipExtent(null),II(e,n.stream($v));var o=$v.result(),a=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+t[0][0]+(r-a*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&n.clipExtent(s),n.scale(a*150).translate([u,l])}function UI(n,t,e){return em(n,[[0,0],t],e)}var rm=16,zI=be(30*qn);function nm(n,t){return+t?WI(n,t):qI(n)}function qI(n){return tm({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}function WI(n,t){function e(r,i,s,o,a,u,l,c,h,f,d,v,_,E){var P=l-r,y=c-i,w=P*P+y*y;if(w>4*t&&_--){var m=o+f,S=a+d,C=u+v,I=za(m*m+S*S+C*C),b=Ao(C/=I),x=sr(sr(C)-1)<Se||sr(s-h)<Se?(s+h)/2:Ua(S,m),A=n(x,b),N=A[0],T=A[1],L=N-r,U=T-i,$=y*L-P*U;($*$/w>t||sr((P*L+y*U)/w-.5)>.3||o*f+a*d+u*v<zI)&&(e(r,i,s,o,a,u,N,T,x,m/=I,S/=I,C,_,E),E.point(N,T),e(N,T,x,m,S,C,l,c,h,f,d,v,_,E))}}return function(r){var i,s,o,a,u,l,c,h,f,d,v,_,E={point:P,lineStart:y,lineEnd:m,polygonStart:function(){r.polygonStart(),E.lineStart=S},polygonEnd:function(){r.polygonEnd(),E.lineStart=y}};function P(b,x){b=n(b,x),r.point(b[0],b[1])}function y(){h=NaN,E.point=w,r.lineStart()}function w(b,x){var A=qa([b,x]),N=n(b,x);e(h,f,c,d,v,_,h=N[0],f=N[1],c=b,d=A[0],v=A[1],_=A[2],rm,r),r.point(h,f)}function m(){E.point=P,r.lineEnd()}function S(){y(),E.point=C,E.lineEnd=I}function C(b,x){w(i=b,x),s=h,o=f,a=d,u=v,l=_,E.point=w}function I(){e(h,f,c,d,v,_,s,o,i,a,u,l,rm,r),E.lineEnd=m,m()}return E}}var HI=tm({point:function(n,t){this.stream.point(n*qn,t*qn)}});function XI(n){return BI(function(){return n})()}function BI(n){var t,e=150,r=480,i=250,s,o,a=0,u=0,l=0,c=0,h=0,f,d,v=null,_=Zv,E=null,P,y,w,m=Qv,S=.5,C=nm(N,S),I,b;function x(U){return U=d(U[0]*qn,U[1]*qn),[U[0]*e+s,o-U[1]*e]}function A(U){return U=d.invert((U[0]-s)/e,(o-U[1])/e),U&&[U[0]*Ys,U[1]*Ys]}function N(U,$){return U=t(U,$),[U[0]*e+s,o-U[1]*e]}x.stream=function(U){return I&&b===U?I:I=HI(_(f,C(m(b=U))))},x.clipAngle=function(U){return arguments.length?(_=+U?VI(v=U*qn,6*qn):(v=null,Zv),L()):v*Ys},x.clipExtent=function(U){return arguments.length?(m=U==null?(E=P=y=w=null,Qv):AI(E=+U[0][0],P=+U[0][1],y=+U[1][0],w=+U[1][1]),L()):E==null?null:[[E,P],[y,w]]},x.scale=function(U){return arguments.length?(e=+U,T()):e},x.translate=function(U){return arguments.length?(r=+U[0],i=+U[1],T()):[r,i]},x.center=function(U){return arguments.length?(a=U[0]%360*qn,u=U[1]%360*qn,T()):[a*Ys,u*Ys]},x.rotate=function(U){return arguments.length?(l=U[0]%360*qn,c=U[1]%360*qn,h=U.length>2?U[2]%360*qn:0,T()):[l*Ys,c*Ys,h*Ys]},x.precision=function(U){return arguments.length?(C=nm(N,S=U*U),L()):za(S)},x.fitExtent=function(U,$){return em(x,U,$)},x.fitSize=function(U,$){return UI(x,U,$)};function T(){d=Uv(f=MI(l,c,h),t);var U=t(a,u);return s=r-U[0]*e,o=i+U[1]*e,L()}function L(){return I=b=null,x}return function(){return t=n.apply(this,arguments),x.invert=t.invert&&A,T()}}function im(n){return function(t,e){var r=be(t),i=be(e),s=n(r*i);return[s*i*Ne(t),s*Ne(e)]}}function sm(n){return function(t,e){var r=za(t*t+e*e),i=n(r),s=Ne(i),o=be(i);return[Ua(t*s,r*o),Ao(r&&e*s/r)]}}var YI=im(function(n){return za(2/(1+n))});YI.invert=sm(function(n){return 2*Ao(n/2)});var om=im(function(n){return(n=Fv(n))&&n/Ne(n)});om.invert=sm(function(n){return n});function JI(){return XI(om).scale(79.4188).clipAngle(179.999)}function am(n,t){return[n,t]}am.invert=am;function jI(n,t,e){e=e||{};var r=e.units||"kilometers",i=e.steps||8;if(!n)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 s=[];switch(n.type){case"GeometryCollection":return fh(n,function(o){var a=jh(o,t,r,i);a&&s.push(a)}),on(s);case"FeatureCollection":return ga(n,function(o){var a=jh(o,t,r,i);a&&ga(a,function(u){u&&s.push(u)})}),on(s)}return jh(n,t,r,i)}function jh(n,t,e,r){var i=n.properties||{},s=n.type==="Feature"?n.geometry:n;if(s.type==="GeometryCollection"){var o=[];return fh(n,function(_){var E=jh(_,t,e,r);E&&o.push(E)}),on(o)}var a=QI(s),u={type:s.type,coordinates:lm(s.coordinates,a)},l=new Lf,c=l.read(u),h=nf(sf(t,e),"meters"),f=Ge.bufferOp(c,h,r),d=new gv;if(f=d.write(f),!um(f.coordinates)){var v={type:f.type,coordinates:hm(f.coordinates,a)};return Sn(v,i)}}function um(n){return Array.isArray(n[0])?um(n[0]):isNaN(n[0])}function lm(n,t){return typeof n[0]!="object"?t(n):n.map(function(e){return lm(e,t)})}function hm(n,t){return typeof n[0]!="object"?t.invert(n):n.map(function(e){return hm(e,t)})}function QI(n){var t=_0(n).geometry.coordinates,e=[-t[0],-t[1]];return JI().rotate(e).scale(ar)}function $I(n,t,e){e===void 0&&(e={});var r=yr(n),i=yr(t),s=If.union(r.coordinates,i.coordinates);return s.length===0?null:s.length===1?ie(s[0],e.properties):rf(s,e.properties)}function bl(n,t,e){e===void 0&&(e={});var r=yr(n),i=yr(t),s=If.intersection(r.coordinates,i.coordinates);return s.length===0?null:s.length===1?ie(s[0],e.properties):rf(s,e.properties)}function KI(n,t,e){e===void 0&&(e={});var r=JSON.stringify(e.properties||{}),i=n[0],s=n[1],o=n[2],a=n[3],u=(s+a)/2,l=(i+o)/2,c=t*2/He([i,u],[o,u],e),h=c*(o-i),f=t*2/He([l,s],[l,a],e),d=f*(a-s),v=h/2,_=v*2,E=Math.sqrt(3)/2*d,P=o-i,y=a-s,w=3/4*_,m=E,S=(P-_)/(_-v/2),C=Math.floor(S),I=(C*w-v/2-P)/2-v/2+w/2,b=Math.floor((y-E)/E),x=(y-b*E)/2,A=b*E-y>E/2;A&&(x-=E/4);for(var N=[],T=[],L=0;L<6;L++){var U=2*Math.PI/6*L;N.push(Math.cos(U)),T.push(Math.sin(U))}for(var $=[],Y=0;Y<=C;Y++)for(var Z=0;Z<=b;Z++){var G=Y%2===1;if(!(Z===0&&G)&&!(Z===0&&A)){var W=Y*w+i-I,k=Z*m+s+x;if(G&&(k-=E/2),e.triangles===!0)t2([W,k],h/2,d/2,JSON.parse(r),N,T).forEach(function(O){e.mask?bl(e.mask,O)&&$.push(O):$.push(O)});else{var V=ZI([W,k],h/2,d/2,JSON.parse(r),N,T);e.mask?bl(e.mask,V)&&$.push(V):$.push(V)}}}return on($)}function ZI(n,t,e,r,i,s){for(var o=[],a=0;a<6;a++){var u=n[0]+t*i[a],l=n[1]+e*s[a];o.push([u,l])}return o.push(o[0].slice()),ie([o],r)}function t2(n,t,e,r,i,s){for(var o=[],a=0;a<6;a++){var u=[];u.push(n),u.push([n[0]+t*i[a],n[1]+e*s[a]]),u.push([n[0]+t*i[(a+1)%6],n[1]+e*s[(a+1)%6]]),u.push(n),o.push(ie([u],r))}return o}function e2(n,t,e,r){r===void 0&&(r={});for(var i=[],s=n[0],o=n[1],a=n[2],u=n[3],l=t/He([s,o],[a,o],r),c=l*(a-s),h=e/He([s,o],[s,u],r),f=h*(u-o),d=a-s,v=u-o,_=Math.floor(d/c),E=Math.floor(v/f),P=(d-_*c)/2,y=(v-E*f)/2,w=s+P,m=0;m<_;m++){for(var S=o+y,C=0;C<E;C++){var I=ie([[[w,S],[w,S+f],[w+c,S+f],[w+c,S],[w,S]]],r.properties);r.mask?RP(r.mask,I)&&i.push(I):i.push(I),S+=f}w+=c}return on(i)}function r2(n,t,e){return e===void 0&&(e={}),e2(n,t,t,e)}function n2(n,t,e){e===void 0&&(e={});for(var r=[],i=t/He([n[0],n[1]],[n[2],n[1]],e),s=i*(n[2]-n[0]),o=t/He([n[0],n[1]],[n[0],n[3]],e),a=o*(n[3]-n[1]),u=0,l=n[0];l<=n[2];){for(var c=0,h=n[1];h<=n[3];){var f=null,d=null;u%2===0&&c%2===0?(f=ie([[[l,h],[l,h+a],[l+s,h],[l,h]]],e.properties),d=ie([[[l,h+a],[l+s,h+a],[l+s,h],[l,h+a]]],e.properties)):u%2===0&&c%2===1?(f=ie([[[l,h],[l+s,h+a],[l+s,h],[l,h]]],e.properties),d=ie([[[l,h],[l,h+a],[l+s,h+a],[l,h]]],e.properties)):c%2===0&&u%2===1?(f=ie([[[l,h],[l,h+a],[l+s,h+a],[l,h]]],e.properties),d=ie([[[l,h],[l+s,h+a],[l+s,h],[l,h]]],e.properties)):c%2===1&&u%2===1&&(f=ie([[[l,h],[l,h+a],[l+s,h],[l,h]]],e.properties),d=ie([[[l,h+a],[l+s,h+a],[l+s,h],[l,h+a]]],e.properties)),e.mask?(bl(e.mask,f)&&r.push(f),bl(e.mask,d)&&r.push(d)):(r.push(f),r.push(d)),h+=a,c++}u++,l+=s}return on(r)}function i2(n,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var r=e.gridType,i=e.property,s=e.weight;if(!n)throw new Error("points is required");if(IC(n,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");i=i||"elevation",r=r||"square",s=s||1;var o=Cn(n),a;switch(r){case"point":case"points":a=gP(o,t,e);break;case"square":case"squares":a=r2(o,t,e);break;case"hex":case"hexes":a=KI(o,t,e);break;case"triangle":case"triangles":a=n2(o,t,e);break;default:throw new Error("invalid gridType")}var u=[];return ga(a,function(l){var c=0,h=0;ga(n,function(d){var v=r==="point"?l:hf(l),_=He(v,d,e),E;if(i!==void 0&&(E=d.properties[i]),E===void 0&&(E=d.geometry.coordinates[2]),E===void 0)throw new Error("zValue is missing");_===0&&(c=E);var P=1/Math.pow(_,s);h+=P,c+=P*E});var f=zC(l);f.properties[i]=c/h,u.push(f)}),on(u)}function s2(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1])&&n.push(n[0]);const e=Kt(t),r=ie([n]);return Qe(e,r)}function o2(n,t){const e=Yr(n);return gf(e,t,{units:"meters"}).geometry.coordinates}function $f(n){if((n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),n.length<=3)return 0;const t=ie([n]);return nP(t)}function a2(n){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]);const t=ie([n]),r=w0(t).geometry.coordinates;return[r[0],r[1],r[2]??n[0][2]??0]}function cm(n,t,e,r){const[i,s,o]=n,a=pa(Kt([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function Qh(n,t){return He(Kt(n),Kt(t),{units:"meters"})}function Nl(n,t){return Zu(Kt(n),Kt(t))}function u2(n,t){return tl(Yr(n),Yr(t))}function l2(n,t){const e=Kt(n),r=Kt(t),i=XC(e,r),s=(n[2]+t[2])/2;return[...i.geometry.coordinates,s]}function h2(n,t){const e=Kt(t),r=Yr(n);return ZC(r,e,{units:"meters"})}function c2(n,t){const e=Kt(n),r=Yr(t);return eP(e,r,{units:"meters"})}function f2(n,t,e,r){const[i,s,o]=n,a=yP(Kt([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function fm(n,t){return x0(Kt(n),Kt(t),{units:"meters"})}function d2(n,t){return mP(Kt(n),Kt(t))}function dm(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=bl(ie([n]),ie([t]));if(e)return e.geometry.coordinates}function gm(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=$I(ie([n]),ie([t]));if(e)return e.geometry.coordinates}function pm(n,t=500,e="meters"){const r=jI(Yr(n),t,{units:e});if(r)return r.geometry.coordinates}function vm(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=oI(ie([n]),ie([t]));if(e)return e.geometry.coordinates}function mm(n,t,e=10,r="meters"){return WC(n,t,{steps:e,units:r}).geometry.coordinates}function Kf(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=ie([n]),r=ie([t]);return MP(e,r)?"oneBig":R0(e,r)?"twoBig":!1}function ym(n){const t=p.min(p.objsIterator(n,["0"])),e=p.min(p.objsIterator(n,["1"])),r=p.min(p.objsIterator(n,["2"])),i=p.max(p.objsIterator(n,["0"])),s=p.max(p.objsIterator(n,["1"])),o=p.max(p.objsIterator(n,["2"]));return{minPos:[t,e,r],maxPos:[i,s,o],center:[(t+i)*.5,(e+s)*.5,(r+o)*.5]}}function _m(n){const{minPos:t,maxPos:e,center:r}=ym(n);if(t.some(a=>!Number.isFinite(a)||e.some(u=>!Number.isFinite(u))||r.some(u=>!Number.isFinite(u)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=Qh(t,e);let s=i*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(i*i+o*o)*.5),{center:r,radius:s}}function wm(n,t){const e=bi(n),r=bi(t);return p.Vector.distance(e,r)}function xl(n,t){const e=[],r=n.length;let i=0;for(let s=0;s<r-1;++s){if(t===void 0||t==="GEODESIC"){const o=Qh(n[s],n[s+1]),a=Math.abs(n[s][2]-n[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="RHUMB"){const o=fm(n[s],n[s+1]),a=Math.abs(n[s][2]-n[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="NONE"){const o=wm(n[s],n[s+1]);i+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(i)}return e}function Zf(n){const t="__getXyzFromPostion";let e=p.getExtProp(n,t);return(!e||!p.Vector.equals(e[0],n))&&(e=[[...n],bi(n)],p.setExtProp(n,t,e)),e[1]}class Em extends p.Tree{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class td extends p.TreeItem{constructor(t,e,r){super(t,e),this._property=r}get property(){return this._property}}class ed extends td{constructor(t,e){super(t,!1,e)}}class rd extends td{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function Sm(n,t){const e=new Em(t),r=n.getProperties("chinese"),i=[];for(let s of r)if(s instanceof vt){const o=new rd(e,s);o.d(()=>s.destroy()),e.children.push(o),i.push(o)}else{const o=new ed(e,s);e.children.push(o),o.d(()=>s.destroy())}for(;i.length>0;){const s=i.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof vt))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof vt){const u=new rd(e,a);u.d(()=>a.destroy()),o.groupChildren.push(u),i.push(u)}else{const u=new ed(e,a);o.groupChildren.push(u),u.d(()=>a.destroy())}}return e.d(()=>{e.itemChildrenChanged.reset(),e.itemChildrenToChange.reset();const s=[...e.getDescendants()];s.forEach(o=>{o.children&&(o.children.length=0),o.destroy()}),s.length=0}),e}class Ha extends st{constructor(e){super();g(this,"_propTreeReact",this.dv(p.react(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new p.ObjResettingWithEvent(this.sceneObjectChanged,r=>{if(!r)return;const i=new st;return i.d(r.toDestroyEvent.don(()=>{this.sceneObject=void 0})),i})),this.d(this.sceneObjectChanged.don(r=>{this._propTreeReact.value=void 0,!(!r||!(r instanceof ft))&&(this._propTreeReact.value=Sm(r,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(n=>{n.createDefaultProps=()=>({sceneObject:void 0})})(Ha||(Ha={})),p.extendClassProps(Ha.prototype,Ha.createDefaultProps);function nd(n){return p.reactDeepArrayWithUndefined(n,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function Cm(n,t){const e=new Array;for(let r of n)e.push(t(r));return e}function id(n,t){return n===void 0&&t===void 0?!0:!n||!t?!1:n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]}function g2(n,t,e){var i;((i=t.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(t))?e.call(n):(n.dispose(t.viewerAttached.don(()=>{e.call(n)})),n.dispose(t.createdEvent.don(()=>e.call(n))))}function p2(n,t,e,r=!0){r&&e(),n.dispose(t.disposableOn(e))}function v2(n,t){const{type:e,id:r}=n;if(e){const i=ft.create(e,r);if(i)return i.json=n,i;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function Pm(n){const t=n.children&&p.every(n.children,r=>{if(!(r instanceof Ir))throw new Error("!(treeItem instanceof SceneTreeItem)");return!r.show})||!1,e=n.sceneTree.getSceneObjectShowFunc(n.sceneObject);return!t||e}class Ir extends p.TreeItem{constructor(e,r=!1,i,s,o=!0){super(e,r,i);g(this,"_dragDrop");g(this,"_showChangedNotAffectChildren",!1);g(this,"_showChangedNotAffectParent",!1);g(this,"_type",this.dv(p.react("Unknown")));g(this,"_isExport",this.dv(p.react(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let u;const l=()=>{u&&(u(),u=void 0)};this.dispose(l),this.dispose(this.sceneObjectChanged.disposableOn(c=>{l(),c&&(u=p.bind([this,"name"],[c,"name"]))})),this.dispose(this.showChanged.disposableOn(c=>{if(e.setSceneObjectShowFunc(this.sceneObject,c),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let h of this.children)h instanceof Ir&&(h._showChangedNotAffectParent=!0,h.show=c,h._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Ir&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=Pm(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new p.ObjResettingWithEvent(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new st;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof H){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.showChanged.disposableOn(h))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof H){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.enabledChanged.disposableOn(h))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=Pm(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let h="Unknown";this.sceneObject?h=this.sceneObject.typeName:this.children&&(h="Folder"),this._type.value=h};this.dispose(this.sceneObjectChanged.disposableOn(c)),this.dispose(this.childrenResetedEvent.disposableOn(c)),c()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(r){console.error(`sceneTreeItem.jsonStr error ${r}`,r)}}get json(){const e=this.children&&[...this.children].filter(r=>r.isExport).map(r=>r.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let r of e.children){const i=new Ir(this.tree,!0);i.json=r,this.children.push(i)}}}clone(){try{const e=new Ir(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,r){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(r&&r.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return r&&this.children.push(r),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",r);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",r);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,r)}}(n=>{n.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:p.reactJsonWithUndefined(void 0)})})(Ir||(Ir={})),p.extendClassProps(Ir.prototype,Ir.createDefaultProps);function Im(n,t,e){let{offsetY:r}=t;if(!t.target||!("clientTop"in t.target))return"none";r+=2,r+=t.target.clientTop;let i="none";return n.children?r<=e*.3?i="before":r>=e*.7?!n.uiTreeObject.collapsed&&n.children.length>0?i="inner":i="after":i="inner":r<=e*.5?i="before":i="after",i}class Mm extends np{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let r="none";const i=this.disposeVar(p.createTimeoutWithStartValues(()=>{this._treeItem.uiTreeObject.moveToPositionMode=r,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${r});`)},200));function s(o){r!==o&&(r=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=e;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const u=a.data.value,l=this._treeItem,{tree:c}=l;if(c){const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=Im(l,o,c.itemDivHeight);if(f!=="none"&&p.Tree.canMoveToTreeItems(h,l,f)){o.dataTransfer.dropEffect="move",s(f);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=e;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const u=a.data.value,l=this._treeItem,{tree:c}=l;if(!c)return;const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=Im(l,o,c.itemDivHeight);f!=="none"&&p.Tree.canMoveToTreeItems(h,l,f)&&(p.Tree.moveToTreeItems(h,l,f),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{r="none",i.restart()}))}}function m2(n){if(!(n instanceof Ir))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new Mm(n)}function y2(n){let t=!1;return n&&("show"in n?t=n.show??!0:"enabled"in n&&(t=n.enabled??!0)),t}function _2(n,t){n&&("show"in n?n.show=t:"enabled"in n&&(n.enabled=t))}const w2=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function E2(n){const t=[],{root:e={}}=n,r=[e];for(;r.length>0;){const i=r.pop();if(!i)throw new Error("!todo");if(i.children){for(let s of i.children)if(s.children&&r.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&w2.includes(o)&&t.push(s.sceneObj)}}}return t}async function S2(n,t){const e=E2(n);let r=0;const i=e.length;for(let s of e)if(++r,t){const o=r/i;t(o,r,i)}}class bm extends st{constructor(e,r){super();g(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=r}get sceneTree(){return this._sceneTree}}class C2 extends st{constructor(e){super();g(this,"_jsonLoadingEvent",this.disposeVar(new H));g(this,"_setJsonProcessing",this.disposeVar(p.createProcessingFromAsyncFunc(async(e,r)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),r&&await e.promise(this._sceneTree.preloadFunc(r)),this._setJson(r),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=r=>{this._jsonLoadingEvent.emit({type:"error",error:r})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(r){console.error(`json数据装配时发生错误!error: ${r}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new p.CancelError("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function P2(n){return n.name+"_clone"}function sd(n,t,e){if(n instanceof Ir)return n.insertNewTreeItem(t,e);{const r={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return n.insertNewTreeItem(r[t],e)}}function I2(n){[n,...n.getDescendants()].forEach(t=>t.destroy())}const rn=class rn extends p.Tree{constructor(e,r,i,s){super(i);g(this,"_jsonLoading",this.disposeVar(new C2(this)));g(this,"createSceneObjectFunc",rn.defaultCreateSceneObjectFunc);g(this,"createTreeItemDragDropFunc",rn.defaultCreateTreeItemDragDropFunc);g(this,"preloadFunc",rn.defaultPreload);g(this,"getSceneObjectShowFunc",rn.defaultGetSceneObjectShow);g(this,"setSceneObjectShowFunc",rn.defaultSetSceneObjectShow);g(this,"getSceneTreeItemCloneNameFunc",rn.defaultGetSceneTreeItemCloneNameFunc);g(this,"debug",!1);g(this,"_contextMenu",this.disposeVar(new bm(this,this.projectManager)));g(this,"_showPropUiOnSelecting",this.disposeVar(p.react(!0)));this._name=e,this._dragStartDataManager=r,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,u;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((u=this.lastSelectedItem)==null?void 0:u.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let u of a){const l=u,{sceneObject:c}=l;c&&o.deleteSceneObject(c)&&c.destroy()&&$l(c,void 0);for(let h of l.getDescendants()){const{sceneObject:f}=h;f&&o.deleteSceneObject(f)&&f.destroy()&&$l(f,void 0)}I2(u)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let u of a){const l=u;l.sceneObject&&o.addSceneObject(l.sceneObject)&&$l(l.sceneObject,l)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:a}=this;a&&(this._projectManager.propUiTreeManager.sceneObject=a.sceneObject)}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const r=this.getDescendants();let i;for(let s of r)if(s.sceneObject&&s.sceneObject.id===e){i=s;break}return i}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var i;e.root=e.root||{};const r=e.root.children??[];this.root.resetChildren(!0);for(let s of r){const o=new Ir(this,!0);o.json=s,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(e,r){const i=e||this.lastSelectedItem||this.root;return i?sd(i,r):!1}addNewTreeItem(e,r,i,s){const o=e||this.lastSelectedItem||this.root;if(o&&sd(o,r)){const a=new Ir(this,i);if(a.sceneObject=s,!sd(o,r,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,r,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=ft.create(e,r);return a?this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,r,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,r,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const a=ft.createFromClass(e,r);return a?this.addNewTreeItem(i,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,r,i){const s=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,s))return;const o=ft.createFromJson(e);return console.log(o),o?this.addNewTreeItem(r,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let r of e)this.destroySceneObjectTreeItem(r)}};g(rn,"defaultCreateSceneObjectFunc",v2),g(rn,"defaultCreateTreeItemDragDropFunc",m2),g(rn,"defaultPreload",S2),g(rn,"defaultGetSceneObjectShow",y2),g(rn,"defaultSetSceneObjectShow",_2),g(rn,"defaultGetSceneTreeItemCloneNameFunc",P2);let Tl=rn;const od={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class M2 extends st{constructor(e){super();g(this,"_currentPosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));g(this,"_currentRotation",this.disposeVar(p.reactArrayWithUndefined(void 0)));g(this,"_currentHeading",this.disposeVar(p.react(void 0)));g(this,"_isRotating",this.disposeVar(p.react(!1)));g(this,"_isGround",this.disposeVar(p.react(!1)));g(this,"_startPosition",[0,0,0]);g(this,"_startRotation",[0,0,0]);g(this,"_processing",this.disposeVar(p.createProcessingFromAsyncFunc(async(e,r,i,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=r,this._currentRotation.value=i;return}const u=this._startPosition;u.splice(0,3,...o);const l=this._startRotation;l.splice(0,3,...a);let c=Date.now();const h=Nl(u,r);this._currentHeading.value=h;const d=Qh(u,r)/s,v=[i[0]-l[0],i[1]-l[1],i[2]-l[2]],_=r[2]-u[2];await e.promise(new Promise(E=>{e.disposer.dispose(p.animateFrame(async()=>{let P=Date.now()-c;P=P<0?0:P,P=P>s?s:P;const y=P*d,w=cm(u,y,h);if(this.isGround&&w){const m=await this._esviewer.getTerrainHeight([w[0],w[1]]);this._currentPosition.value=[w[0],w[1],m??0]}else w&&(w[2]+=_*(P/s)),this._currentPosition.value=w;if(this.isRotating){const[m,S,C]=v,I=P/s;this._currentRotation.value=[l[0]+m*I,l[1]+S*I,l[2]+C*I]}P===s&&(this._currentPosition.value=r,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,E())}))}))})));this._esviewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,r,i){this._processing.restart(void 0,e,r,i)}cancel(){this._processing.cancel()}}function Nm(n){let t=0;function e(r,i){i++,t=Math.max(i,t),r.forEach(s=>{Array.isArray(s)&&e(s,i)})}return e(n,0),t}const qi=class qi extends ee{constructor(e){super(e);g(this,"editingBindMode","lineString");g(this,"_area",this.dv(p.react(0)));g(this,"_perimeter",this.dv(p.react(0)));const r=()=>{this._updateArea(),this._updatePerimeter()};r(),this.d(this.pointsChanged.don(r))}updateEditing(){var r;const e=[];this.editingBindMode=="doublePoints"?e.push(ct.DoublePointsAppend,ct.DoublePointsModify):this.editingBindMode=="lineString"?e.push(ct.LineStringAppend,ct.LineStringInsert,ct.Translation):this.editingBindMode=="circular"?(e.push(ct.CircularAppend,ct.CircularInsert,ct.Translation),this.supportEditingModes().includes(ct.HeightModify)&&e.push(ct.HeightModify)):this.editingBindMode=="visibility"?e.push(ct.VisibilityAppend,ct.VisibilityModify):this.editingBindMode=="scatter"&&e.push(ct.ScatterAppend,ct.ScatterModify),(r=this.activeViewer)==null||r.startEditing(this,e,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return $f([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=xl(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],r=xl(e,"GEODESIC");return r[r.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const r=dm(this.points,e);if(!r)return;const i=r[0][0][0];if(Array.isArray(i)){const s=[...r],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...r][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const r=gm(this.points,e);if(!r)return;const i=r[0][0][0];if(Array.isArray(i)){const s=[...r],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...r][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let r=[...e];const i=e[0],s=e[e.length-1];i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||r.push(i);const o=vm([...this.points,this.points[0]],[...r]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(Nm(a)===3){const u=a.map(f=>f.map(d=>[...d,0]));if(u.length<=1)return{status:"notIncluded",positions:u};const l=u[0],c=u[1];return Kf([...l],[...c])==="oneBig"?{status:"included",positions:u}:{status:"notIncluded",positions:u}}else if(Nm(a)===4){const l=[...a.map(h=>h.map(f=>f.map(d=>[...d,0])))],c=[];return l.forEach(h=>{c.push(h[0])}),{status:"notIncluded",positions:c}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,r){if(this.points&&this.points.length>=2){const i=pm(this.points,e,r);return i?[i[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const r=Kf(this.points,e);return r==="oneBig"?!0:r==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new tt([this,"editing"],"编辑",!1),new ht([this,"points"],"位置数组",qi.defaults.points,void 0,!0)],style:[...e.style,new vt([],"点样式"),new tt([this,"pointed"],"开启",!1),new R([this,"pointSize"],"点大小",1),new Tt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Gt([this,"pointColor"],"点颜色",[1,1,1,1]),new Gt([this,"pointOutlineColor"],"轮廓颜色",qi.defaults.pointStyle.outlineColor),new R([this,"pointOutlineWidth"],"轮廓宽度",qi.defaults.pointStyle.outlineWidth),new vt([],"线样式"),new tt([this,"stroked"],"开启线样式",!0),new tt([this,"strokeGround"],"贴地",!1),new R([this,"strokeWidth"],"线宽",1),new Tt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Gt([this,"strokeColor"],"线颜色",[1,1,1,1]),new vt([],"面样式"),new tt([this,"filled"],"开启",!1),new tt([this,"fillGround"],"贴地",!1),new Gt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new vt([],"点样式集合"),new Et([this,"pointMaterial"],"点材质"),new ht([this,"pointMaterialParams"],"点材质参数"),new vt([],"线样式集合"),new Et([this,"strokeMaterial"],"线材质"),new ht([this,"strokeMaterialParams"],"线材质参数"),new vt([],"面样式集合"),new Et([this,"fillMaterial"],"面材质"),new ht([this,"fillMaterialParams"],"面材质参数")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};g(qi,"createDefaultProps",()=>({...ee.createDefaultProps(),pointed:!1,pointStyle:p.reactJson({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:p.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:p.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:p.reactPositions([])})),g(qi,"type",qi.register("ESGeoVector",qi,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),g(qi,"supportEditingModes",[...ee.supportEditingModes,ct.Translation]);let Rt=qi;const Lo=class Lo extends ee{constructor(){super(...arguments);g(this,"_statusDis",this.dv(p.react(!0)));g(this,"_smoothMoveEvent",this.dv(new H));g(this,"_smoothMoveWithRotationEvent",this.dv(new H));g(this,"_smoothMoveOnGroundEvent",this.dv(new H));g(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new H));g(this,"_automaticLandingEvent",this.dv(new H));g(this,"_smoothMoveKeepPitchEvent",this.dv(new H));g(this,"_smoothMoveRelativelyEvent",this.dv(new H));g(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new H));g(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var r;const e=[];this.editingBindMode=="singlePoint"?(e.push(ct.Place,ct.Translation),["ESLocationMeasurement"].includes(this.typeName)||e.push(ct.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(ct.Scale)):this.editingBindMode=="doublePoints"&&e.push(ct.DoublePointsAppend,ct.DoublePointsModify),(r=this.activeViewer)==null||r.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,r){this._smoothMoveEvent.emit(e,r)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,r,i){this._smoothMoveWithRotationEvent.emit(e,r,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,r,i,s){this._smoothMoveOnGroundEvent.emit(e,r,i,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,r,i,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,r,i,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,r){this._smoothMoveKeepPitchEvent.emit(e,r)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,r){this._smoothMoveRelativelyEvent.emit(e,r)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,r,i){this._smoothMoveRelativelyWithRotationEvent.emit(e,r,i)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",location:[...e.location,new tt([this,"editing"],"是否编辑"),new mt([],()=>this.automaticLanding(),[],"自动落地"),new ra([this,"position"],"位置数组",[0,0,0]),new Lc([this,"rotation"],"姿态数组",[0,0,0]),new pr([this,"scale"],"缩放",[1,1,1]),new R([this,"minVisibleDistance"],"最小可见距离",0),new R([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...e.more,new mt(["numbers","number"],(r,i)=>this.smoothMove(r,i),[[0,0,0],0],"平滑移动","smoothMove"),new mt(["numbers","number"],(r,i)=>this.smoothMoveKeepPitch(r,i),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new mt(["numbers","numbers","number"],(r,i,s)=>this.smoothMoveWithRotation(r,i,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new mt(["number","number","number","string"],(r,i,s,o)=>this.smoothMoveOnGround(r,i,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new mt(["numbers","number","number","number","string"],(r,i,s,o,a)=>this.smoothMoveWithRotationOnGround(r,i,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new mt(["numbers","number"],(r,i)=>this.smoothMoveRelatively(r,i),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new mt(["numbers","numbers","number"],(r,i,s)=>this.smoothMoveRelativelyWithRotation(r,i,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new tt([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};g(Lo,"createDefaultProps",()=>({...ee.createDefaultProps(),pointed:!1,pointStyle:p.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:p.reactArray([0,0,0]),rotation:p.reactArray([0,0,0]),scale:p.reactArray([1,1,1]),minVisibleDistance:p.react(0),maxVisibleDistance:p.react(0)})),g(Lo,"type",Lo.register("ESObjectWithLocation",Lo,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),g(Lo,"supportEditingModes",[...ee.supportEditingModes,ct.Place,ct.Translation,ct.Rotation,ct.Scale,ct.DoublePointsAppend,ct.DoublePointsModify]);let dt=Lo;const $a=class $a extends dt{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new vt([],"点样式集合"),new tt([this,"pointed"],"开启点样式",!1),new R([this,"pointSize"],"点大小",1),new Tt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Gt([this,"pointColor"],"点颜色",[1,1,1,1]),new vt([],"线样式集合"),new tt([this,"stroked"],"开启线样式",!1),new tt([this,"strokeGround"],"是否贴地(线)",!1),new R([this,"strokeWidth"],"线宽",1),new Tt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Gt([this,"strokeColor"],"线颜色",[1,1,1,1]),new vt([],"面样式集合"),new tt([this,"filled"],"开启填充样式",!1),new tt([this,"fillGround"],"是否贴地",!1),new Gt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new vt([],"点样式"),new Et([this,"pointMaterial"],"点材质",""),new ht([this,"pointMaterialParams"],"点材质参数",{}),new vt([],"线样式"),new Et([this,"strokeMaterial"],"线材质",""),new ht([this,"strokeMaterialParams"],"线材质参数",{}),new vt([],"填充样式"),new Et([this,"fillMaterial"],"面材质",""),new ht([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};g($a,"createDefaultProps",()=>({...dt.createDefaultProps(),pointed:!1,pointStyle:p.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:p.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:p.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g($a,"type",$a.register("ESLocalVector",$a,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Xa=$a;const kl=class kl extends Xa{};g(kl,"type",kl.register("ESLocalVector2D",kl,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let gs=kl;const b2=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],N2=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ka=class Ka extends dt{constructor(){super(...arguments);g(this,"_widgetEvent",this.dv(new H))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new tt([this,"screenRender"],"屏幕渲染",!0),new tt([this,"sizeByContent"],"尺寸自适应",!0),new We([this,"size"],"尺寸大小",[100,100]),new We([this,"anchor"],"偏移比例",[.5,1]),new We([this,"offset"],"像素偏移",[0,0]),new Tt([this,"renderMode"],N2,"渲染模式",0),new Tt([this,"rotationType"],b2,"漫游旋转类型",1),new Et([this,"actorTag"],"绑定对象"),new Et([this,"socketName"],"插槽名称"),new pr([this,"positionOffset"],"位置偏移"),new pr([this,"rotationOffset"],"相对姿态")],more:[...e.more,new R([this,"zOrder"],"排序",0)]}}};g(Ka,"createDefaultProps",()=>({...dt.createDefaultProps(),screenRender:!0,size:p.reactArray([100,100]),anchor:p.reactArray([.5,1]),offset:p.reactArray([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:p.reactArray([0,0,0]),rotationOffset:p.reactArray([0,0,0])})),g(Ka,"type",Ka.register("ESLabel",Ka,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let yn=Ka;const Za=class Za extends ft{constructor(t){super(t)}};g(Za,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,fillStyle:p.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(Za,"type",Za.register("ESTestObject",Za,{chsName:"测试",tags:["ESObjects"],description:""}));let ad=Za;const Wi=class Wi extends ee{constructor(e){super(e);g(this,"_refreshTilesetEvent",this.dv(new H));g(this,"_tilesetReadyEvent",this.dv(new H));g(this,"_supportEdit",this.dv(p.react(!0)));g(this,"_highlightFeatureEvent",this.dv(new H));g(this,"_highlightFeatureAndFlyToEvent",this.dv(new H));g(this,"_strokeFeatureEvent",this.disposeVar(new H));g(this,"_getFeatureTableEvent",this.dv(new H));g(this,"_featureTableResultEvent",this.dv(new H));g(this,"_getMaterialNameListEvent",this.disposeVar(new H));g(this,"_setFeatureStyleEvent",this.dv(new H));g(this,"_setFeatureColorEvent",this.dv(new H));g(this,"_setFeatureVisableEvent",this.dv(new H));g(this,"_resetFeatureStyleEvent",this.dv(new H));g(this,"setMaterialInfoEvent",this.ad(new H));g(this,"_setMaterialEvent",this.disposeVar(new H));g(this,"_clippingPlanesId",this.dv(p.react("")));g(this,"_clippingPlaneIds",this.dv(p.react([])));g(this,"_flattenedPlaneId",this.dv(p.react("")));g(this,"_flattenedPlaneEnabled",this.dv(p.react(!1)));g(this,"_clippingPlaneId",this.dv(p.react("")));g(this,"_excavateId",this.dv(p.reactArray([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[ct.Translation,ct.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,r){this._highlightFeatureEvent.emit(e,r)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,r,i,s){this._highlightFeatureAndFlyToEvent.emit(e,r,i,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,r=[1,0,0,1]){this._strokeFeatureEvent.emit(e,r)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const r=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{r(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const r=new st;r.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(r.destroy(),e(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e){this._setFeatureStyleEvent.emit(e)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,r){this._setFeatureColorEvent.emit(e,typeof r=="string"?JSON.parse(r):r)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,r){this._setFeatureVisableEvent.emit(e,typeof r=="string"?JSON.parse(r):r)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(r=>{const i=new st;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),r(s)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...od}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new je([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new Tt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new Tt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new ht([this,"materialOverrideMap"],"材质替换",Wi.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new ht([this,"url"],"服务地址",Wi.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new tt([this,"editing"],"编辑",!1,!0),new pr([this,"offset"],"偏移量",[0,0,0],!0),new Lc([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new ht([this,"materialParams"],"materialParams",Wi.defaults.materialParams),new mt(["string","string"],(r,i)=>this.highlightFeature(r,i),["","rgba(255,0,0,1)"],"highlightFeature"),new mt(["string","string"],(r,i)=>this.setFeatureColor(r,i),["",""],"setFeatureColor"),new mt(["string","string"],(r,i)=>this.setFeatureVisable(r,i),["",""],"setFeatureVisable"),new mt([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new vt([],"ue"),new mt([],()=>this.refreshTileset(),[],"refreshTileset"),new Et([this,"actorTag"]),new tt([this,"highlight"],"是否高亮"),new Gt([this,"highlightColor"]),new R([this,"highlightID"]),new vt([],"czm"),new vt([],"可视化"),new We([this,"czmImageBasedLightingFactor"],"反射强度"),new R([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new ht([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new R([this,"czmMaximumMemoryUsage"],"最大内存"),new vt([],"常用"),new Tt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new ht([this,"czmStyleJson"],"czmStyle"),new tt([this,"czmBackFaceCulling"]),new tt([this,"czmSkipLevelOfDetail"]),new R([this,"cacheBytes"],"最大缓存",536870912),new vt([],"调试信息"),new tt([this,"czmDebugShowBoundingVolume"]),new tt([this,"czmDebugShowContentBoundingVolume"]),new vt([],"clippingPlanes"),new tt([this,"clippingPlaneEnabled"]),new tt([this,"unionClippingRegions"]),new Gt([this,"clippingPlaneEdgeColor"]),new R([this,"clippingPlaneEdgeWidth"])]}}};g(Wi,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:p.reactArray([1,0,0,1]),offset:p.reactArrayWithUndefined([0,0,0]),rotation:p.reactArray([0,0,0]),czmImageBasedLightingFactor:p.reactArray([1,1]),czmEnvironmentMapManager:p.reactJsonWithUndefined(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:p.reactJson({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:p.reactArray([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:p.reactJsonWithUndefined({}),featureIdLabel:0,splitDirection:"NONE"})),g(Wi,"type",Wi.register("ES3DTileset",Wi,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),g(Wi,"supportEditingModes",[...ee.supportEditingModes,ct.Translation,ct.Rotation]);let Wn=Wi;const tu=class tu extends dt{constructor(e){super(e);g(this,"_isFlyInCreated",this.dv(p.react(!1)));g(this,"_readyEvent",this.dv(new H));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(ea([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(e){this._isFlyInCreated.value=e}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}get readyEvent(){return this._readyEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Tt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new R([this,"radius"],"半径",10)]}}};g(tu,"createDefaultProps",()=>({...dt.createDefaultProps(),mode:"cylinder",radius:10})),g(tu,"type",tu.register("ESAlarm",tu,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let ud=tu;const Ro=class Ro extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new R([this,"radius"],"半径",1),new Tt([this,"mode"],[["扫描","scan"],["扩散","diffuse"]],"模式",Ro.defaults.mode)]}}};g(Ro,"createDefaultProps",()=>({...dt.createDefaultProps(),radius:1,mode:"scan",collision:!1})),g(Ro,"type",Ro.register("ESApertureEffect",Ro,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let ld=Ro;const Fo=class Fo extends Rt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)]}}};g(Fo,"createDefaultProps",()=>({...Rt.createDefaultProps(),fillStyle:p.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:p.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),g(Fo,"type",Fo.register("ESGeoPolygon",Fo,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),g(Fo,"supportEditingModes",[...Rt.supportEditingModes,ct.CircularAppend,ct.CircularInsert]);let oe=Fo;const vs=class vs extends oe{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:vs.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??vs.defaults.fillStyle,materialParams:t??vs.defaults.fillStyle.materialParams}}constructor(t){super(t)}};g(vs,"createDefaultProps",()=>({...oe.createDefaultProps(),stroked:!0,filled:!0,units:p.reactArray(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:p.reactJson({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:p.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(vs,"type",vs.register("ESAreaMeasurement",vs,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let hd=vs;const eu=class eu extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new vt([],"czm"),new Au([this,"image"],"图片"),new pr([this,"translation"],"偏移")]}}};g(eu,"createDefaultProps",()=>({...dt.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:p.reactArray([0,0,0])})),g(eu,"type",eu.register("ESBlastParticleSystem",eu,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let cd=eu;const mi=class mi extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new tt([this,"reverse"],"反转",mi.defaults.reverse),new pr([this,"size"],"尺寸",mi.defaults.size),new Gt([this,"edgeColor"],"边框颜色",mi.defaults.edgeColor),new R([this,"edgeWidth"],"边框宽度",mi.defaults.edgeWidth),new Et([this,"targetID"],"瓦片图层",mi.defaults.targetID)]}}};g(mi,"createDefaultProps",()=>({...dt.createDefaultProps(),reverse:!1,edgeColor:p.reactArray([1,1,1,1]),edgeWidth:2,size:p.reactArray([10,10,10]),targetID:""})),g(mi,"type",mi.register("ESBoxClipping",mi,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let fd=mi;const Vl=class Vl extends dt{constructor(){super(...arguments);g(this,"_thumbnail",this.dv(p.react("")));g(this,"_duration",this.dv(p.react(1)));g(this,"_resetWithCurrentCameraEvent",this.dv(new H));g(this,"_captureEvent",this.dv(new H))}get thumbnail(){return this._thumbnail.value}set thumbnail(e){this._thumbnail.value=e}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(e){this._duration.value=e}get durationChanged(){return this._duration.changed}flyIn(e=1,r="default"){this.flyInEvent.emit(e,-1,r)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,r){this._captureEvent.emit(e,r)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new vt([],"ESCameraView"),new mt([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new mt(["number","number"],(r,i)=>this.capture(r,i),[64,64],"获取缩略图"),new Et([this,"thumbnail"],"缩略图","",!0),new R([this,"duration"],"飞行时间",1,!0)]}}};g(Vl,"type",Vl.register("ESCameraView",Vl,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let $h=Vl;class Kh extends st{constructor(e,r,i){super();g(this,"_view",this.dv(new $h));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(i==null?void 0:i.name)??`视角${e.views.length+1}`,r){const a=this._view,u=r;a.duration=u.duration??1,a.position=u.position,a.rotation=u.rotation??[0,0,0],a.thumbnail=u.thumbnail??"",a.name=u.name}else{const a=(i==null?void 0:i.size)??[64,64];this.d(p.nextAnimateFrame(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(p.createNextAnimateFrameEvent(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>e.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const e=this._view;return{duration:e.duration,position:e.position,rotation:e.rotation,thumbnail:e.thumbnail,name:e.name}}}const Xn=class Xn extends ft{constructor(e){super(e);g(this,"_currentViewIndex",this.dv(p.react(-1)));g(this,"_viewWrappers",this.dv(new p.ObservableArray));g(this,"_currentViewWrapper",this.dv(p.react(void 0)));g(this,"_container",this.dv(p.react(void 0)));this.initProcessing();{const r=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};r(),this.d(this._viewWrappers.changedEvent.don(r))}{const r=()=>{const i=this._currentViewWrapper.value;this._currentViewIndex.value=i?this._getIndex(i):-1};r(),this.d(this._viewWrappers.changedEvent.don(r)),this.d(this._currentViewWrapper.changed.don(r))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(e){this._innerSetJson(e),this.views=e.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}get views(){return Cm(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const r=this._viewWrappers;if(e.every((i,s)=>{const o=r.get(s).view;return i.duration===o.duration&&id(i.position,o.position)&&id(i.rotation,o.rotation)&&i.thumbnail===o.thumbnail&&i.name===o.name}))return}this.clearAllViews();for(let r of e)this._viewWrappers.push(new Kh(this,r))}_getIndex(e){return this._viewWrappers.indexOf(e)}clearAllViews(){for(let e of this._viewWrappers)e.destroy();this._viewWrappers.length=0}add(e=`视角${this.views.length+1}`,r=[64,64]){this._viewWrappers.push(new Kh(this,void 0,{name:e,size:r}))}update(e,r,i=[64,64]){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(e);return r&&(s.view.name=r),s.view.resetWithCurrentCamera(),s.view.capture(i[0],i[1]),!0}addView(){this._viewWrappers.push(new Kh(this))}insertView(e){if(this._viewWrappers.length+1<=e||e<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(e,0,new Kh(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const r=this._viewWrappers.get(e);return this._currentViewWrapper.value=r,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const r=this._viewWrappers.get(e);r.view.resetWithCurrentCamera(),r.view.capture()}resetViewName(e,r){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(e);i.view.name=r}updateView(e,r){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(e);return i.view.position=r.position,i.view.rotation=r.rotation??[0,0,0],i.view.duration=r.duration??1,i.view.thumbnail=r.thumbnail??"",i.view.name=r.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const r=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(r,this.flyMode??Xn.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const r=this._getIndex(e);return this.loop??Xn.defaults.loop?(this.flyToView((this._viewWrappers.length+r-1)%this._viewWrappers.length),!0):r-1<0?!1:(this.flyToView(r-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const r=this._getIndex(e);if(r===0)return;const i=this._viewWrappers.splice(r-1,1,e)[0];this._viewWrappers.set(r,i)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const r=this._getIndex(e);if(r===this._viewWrappers.length-1)return;const i=this._viewWrappers.splice(r+1,1,e)[0];this._viewWrappers.set(r,i)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const r=this._getIndex(e);return this.loop??Xn.defaults.loop?(this.flyToView((r+1)%this._viewWrappers.length),!0):r+1>this._viewWrappers.length-1?!1:(this.flyToView(r+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(e){if(e<0||e>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(e).destroy(),this._viewWrappers.splice(e,1)}deleteCurrentView(){const e=this._currentViewWrapper.value;if(!e){console.warn("!this._currentViewWrapper.value");return}const r=this._getIndex(e);if(r===-1){console.warn("index === -1");return}this.deleteView(r)}transitionImageUrl(e){return ft.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const r=this.intervalTime??Xn.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+r)*1e3;return e.promise(p.sleep(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(p.createProcessingFromAsyncFunc(async i=>this._flyStep(i))),r=()=>{this.playing?e.restart():e.cancel()};r(),this.d(this.playingChanged.don(r))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Tt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",Xn.defaults.flyMode),new mt([],()=>this.addView(),[],"添加视角"),new mt(["number"],r=>this.insertView(r),[0],"插入视角"),new mt([],()=>this.clearAllViews(),[],"清空所有视角"),new mt([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new mt([],()=>this.flyToPrevView(),[],"上一个视角"),new mt([],()=>this.flyToNextView(),[],"下一个视角"),new mt([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new mt([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new mt(["number"],r=>this.flyToView(r),[0],"飞入指定视角"),new mt(["number"],r=>this.setCurrentView(r),[0],"设置当前视角"),new mt([],()=>this.deleteCurrentView(),[],"删除当前视角"),new mt(["number"],r=>this.deleteView(r),[0],"删除指定视角"),new mt(["number"],r=>this.resetView(r),[0],"重置视角"),new R([this,"currentViewIndex"],"当前序号",-1,!1,!0),new $g([this,"playing"],()=>this.stop(),[this,"loop"],"播放",Xn.defaults),new tt([this,"playing"],"是否播放"),new mt([],()=>this.stop(),[],"停止"),new tt([this,"loop"],"是否循环"),new R([this,"intervalTime"],"间隔时间"),new ht([this,"views"],"视角集合",[],void 0,!0)]}}};g(Xn,"createDefaultProps",()=>({...ft.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),g(Xn,"type",Xn.register("ESCameraViewCollection",Xn,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let Zh=Xn;const ru=class ru extends dt{constructor(e){super(e);g(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"aspectRatio"],"宽高比",1.77778),new R([this,"fov"],"横向夹角",90),new R([this,"far"],"视野长度",100),new R([this,"near"],"近面距离",5)]}}};g(ru,"createDefaultProps",()=>({...dt.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),g(ru,"type",ru.register("ESCameraVisibleRange",ru,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let dd=ru;const nu=class nu extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Tt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};g(nu,"createDefaultProps",()=>({...dt.createDefaultProps(),mode:"policeCar",allowPicking:!0})),g(nu,"type",nu.register("ESCar",nu,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let tc=nu;const Go=class Go extends Rt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"height"],"高度",10)],coordinate:[...e.coordinate,new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)]}}};g(Go,"createDefaultProps",()=>({...Rt.createDefaultProps(),height:10,filled:!0,fillStyle:p.reactJson({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),g(Go,"type",Go.register("ESClassification",Go,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),g(Go,"supportEditingModes",[...Rt.supportEditingModes,ct.CircularAppend,ct.CircularInsert,ct.HeightModify]);let ec=Go;const iu=class iu extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new tt([this,"showArrow"],"显示箭头",!0),new Gt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new R([this,"edgetWidth"],"线框宽度",2),new R([this,"width"],"裁剪宽度",200),new R([this,"height"],"裁剪高度",200),new Et([this,"targetID"],"瓦片图层","")]}}};g(iu,"createDefaultProps",()=>({...dt.createDefaultProps(),showArrow:!0,edgeColor:p.reactArray([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),g(iu,"type",iu.register("ESClippingPlane",iu,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let gd=iu;class x2 extends st{constructor(t,e,r){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${r.id}) container`);{const u=()=>{const c=` ${e.cssText}
68
+ `)}return t.toString()},Ye.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},Ye.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===F.BOUNDARY&&(r[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),h=0;h<2;h++)if(c.isAnyNull(h)){var f=F.NONE;if(r[h])f=F.EXTERIOR;else{var d=l.getCoordinate();f=e.getLocation(h,d,t)}c.setAllLocationsIfNull(h,f)}},Ye.prototype.getDegree=function(){return this._edgeMap.size()},Ye.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var wI=function(n){function t(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=r._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Ri("no outgoing dirEdge found",this.getCoordinate());Pt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var s=r.get(0);if(i===1)return s;var o=r.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Jt.isNorthern(a)&&Jt.isNorthern(u)?s:!Jt.isNorthern(a)&&!Jt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(Pt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){Re.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();r.print("out "),s.print(r),r.println(),r.print("in "),s.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new j;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&r._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=r._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(B.LEFT),a=i.getDepth(B.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new Ri("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],h=arguments[1],f=arguments[2],d=f,v=c;v<h;v++){var _=r._edgeList.get(v);_.setEdgeDepths(B.RIGHT,d),d=_.getDepth(B.LEFT)}return d}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(s===null&&l.getEdgeRing()===r&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==r)continue;o=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(Pt.isTrue(s!==null,"found null for first outgoing dirEdge"),Pt.isTrue(s.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=F.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){r=F.INTERIOR;break}if(o.isInResult()){r=F.EXTERIOR;break}}}if(r===F.NONE)return null;for(var a=r,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===F.INTERIOR):(l.isInResult()&&(a=F.EXTERIOR),c.isInResult()&&(a=F.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new Yt(F.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===F.INTERIOR||c===F.BOUNDARY)&&i._label.setLocation(l,F.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ye),Sv=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Oh(r,new wI)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xa),os=function n(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=n.orientation(t)};os.prototype.compareTo=function(t){var e=t,r=os.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},os.prototype.interfaces_=function(){return[Jr]},os.prototype.getClass=function(){return os},os.orientation=function(t){return Nt.increasingDirection(t)===1},os.compareOriented=function(t,e,r,i){for(var s=e?1:-1,o=i?1:-1,a=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,c=i?0:r.length-1;;){var h=t[l].compareTo(r[c]);if(h!==0)return h;l+=s,c+=o;var f=l===a,d=c===u;if(f&&!d)return-1;if(!f&&d)return 1;if(f&&d)return 0}};var pn=function(){this._edges=new j,this._ocaMap=new Xe};pn.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},pn.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())},pn.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1},pn.prototype.iterator=function(){return this._edges.iterator()},pn.prototype.getEdges=function(){return this._edges},pn.prototype.get=function(t){return this._edges.get(t)},pn.prototype.findEqualEdge=function(t){var e=new os(t.getCoordinates()),r=this._ocaMap.get(e);return r},pn.prototype.add=function(t){this._edges.add(t);var e=new os(t.getCoordinates());this._ocaMap.put(e,t)},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var Vs=function(){};Vs.prototype.processIntersections=function(t,e,r,i){},Vs.prototype.isDone=function(){},Vs.prototype.interfaces_=function(){return[]},Vs.prototype.getClass=function(){return Vs};var Vr=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};Vr.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Vr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},Vr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Vr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Vr.prototype.getLineIntersector=function(){return this._li},Vr.prototype.hasProperIntersection=function(){return this._hasProper},Vr.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Vr.prototype.hasIntersection=function(){return this._hasIntersection},Vr.prototype.isDone=function(){return!1},Vr.prototype.hasInteriorIntersection=function(){return this._hasInterior},Vr.prototype.interfaces_=function(){return[Vs]},Vr.prototype.getClass=function(){return Vr},Vr.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Gn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new D(t),this.segmentIndex=e,this.dist=r};Gn.prototype.getSegmentIndex=function(){return this.segmentIndex},Gn.prototype.getCoordinate=function(){return this.coord},Gn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Gn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Gn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Gn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Gn.prototype.getDistance=function(){return this.dist},Gn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Gn.prototype.interfaces_=function(){return[Jr]},Gn.prototype.getClass=function(){return Gn};var hi=function(){this._nodeMap=new Xe,this.edge=null;var t=arguments[0];this.edge=t};hi.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},hi.prototype.iterator=function(){return this._nodeMap.values().iterator()},hi.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),o=e.createSplitEdge(i,s);t.add(o),i=s}},hi.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)},hi.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new D(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=r.edge.pts[l];return o&&(a[u]=e.coord),new Lh(a,new Yt(this.edge._label))},hi.prototype.add=function(t,e,r){var i=new Gn(t,e,r),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},hi.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var Us=function(){};Us.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new j;i.add(new Mn(r));do{var s=e.findChainEnd(t,r);i.add(new Mn(s)),r=s}while(r<t.length-1);var o=Us.toIntArray(i);return o},Us.prototype.findChainEnd=function(t,e){for(var r=Jt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var s=Jt.quadrant(t[i-1],t[i]);if(s!==r)break;i++}return i-1},Us.prototype.interfaces_=function(){return[]},Us.prototype.getClass=function(){return Us},Us.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var ki=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new at,this.env2=new at;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Us;this.startIndex=e.getChainStartIndices(this.pts)};ki.prototype.getCoordinates=function(){return this.pts},ki.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r},ki.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r},ki.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],h=this.pts[s],f=this.pts[o],d=a.pts[u],v=a.pts[l];if(o-s===1&&l-u===1)return c.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(h,f),this.env2.init(d,v),!this.env1.intersects(this.env2))return null;var _=Math.trunc((s+o)/2),E=Math.trunc((u+l)/2);s<_&&(u<E&&this.computeIntersectsForChain(s,_,a,u,E,c),E<l&&this.computeIntersectsForChain(s,_,a,E,l,c)),_<o&&(u<E&&this.computeIntersectsForChain(_,o,a,u,E,c),E<l&&this.computeIntersectsForChain(_,o,a,E,l,c))}},ki.prototype.getStartIndexes=function(){return this.startIndex},ki.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<t.startIndex.length-1;s++)r.computeIntersectsForChain(i,t,s,e)},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var Fe=function n(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=n.NULL_VALUE},Cv={NULL_VALUE:{configurable:!0}};Fe.prototype.getDepth=function(t,e){return this._depth[t][e]},Fe.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},Fe.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==Fe.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Fe.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===Fe.NULL_VALUE}},Fe.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var s=0;t._depth[e][i]>r&&(s=1),t._depth[e][i]=s}}},Fe.prototype.getDelta=function(t){return this._depth[t][B.RIGHT]-this._depth[t][B.LEFT]},Fe.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?F.EXTERIOR:F.INTERIOR},Fe.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Fe.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var s=e.getLocation(r,i);(s===F.EXTERIOR||s===F.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=Fe.depthAtLocation(s):t._depth[r][i]+=Fe.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===F.INTERIOR&&this._depth[o][a]++}},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.depthAtLocation=function(t){return t===F.EXTERIOR?0:t===F.INTERIOR?1:Fe.NULL_VALUE},Cv.NULL_VALUE.get=function(){return-1},Object.defineProperties(Fe,Cv);var Lh=function(n){function t(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new hi(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Fe,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,Yt.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var s=r;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!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 r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.print(","),r.print(i.pts[s].x+" "+i.pts[s].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},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(r){var i=this;r.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)r.print(i.pts[s]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new ki(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new at;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,s,o){var a=new D(r.getIntersection(o)),u=i,l=r.getEdgeDistance(s,o),c=u+1;if(c<this.pts.length){var h=this.pts[c];a.equals2D(h)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var r=this,i=new In;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(r.pts[s].x+" "+r.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(r.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,s){for(var o=this,a=0;a<r.getIntersectionNum();a++)o.addIntersection(r,i,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,B.ON),r.getLocation(1,B.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,B.LEFT),r.getLocation(1,B.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,B.RIGHT),r.getLocation(1,B.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},t}(Fr),tr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new pn,this._bufParams=t||null};tr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},tr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Yt(t.getLabel()),i.flip()),r.merge(i);var s=tr.depthDelta(i),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(tr.depthDelta(t.getLabel()))},tr.prototype.buildSubgraphs=function(t,e){for(var r=new j,i=t.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new Co(r),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),r.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},tr.prototype.createSubgraphs=function(t){for(var e=new j,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var s=new Ke;s.create(i),e.add(s)}}return gn.sort(e,gn.reverseOrder()),e},tr.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},tr.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Ff,r=new Ds;return r.setPrecisionModel(t),e.setSegmentIntersector(new Vr(r)),e},tr.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new hr(r,this._bufParams),s=new tn(t,e,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new he(new Sv),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new Er(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},tr.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Lh(a.getCoordinates(),new Yt(l));r.insertUniqueEdge(c)}}},tr.prototype.setNoder=function(t){this._workingNoder=t},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthDelta=function(t){var e=t.getLocation(0,B.LEFT),r=t.getLocation(0,B.RIGHT);return e===F.INTERIOR&&r===F.EXTERIOR?1:e===F.EXTERIOR&&r===F.INTERIOR?-1:0},tr.convertSegStrings=function(t){for(var e=new xt,r=new j;t.hasNext();){var i=t.next(),s=e.createLineString(i.getCoordinates());r.add(s)}return e.buildGeometry(r)};var as=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 r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};as.prototype.rescale=function(){var t=this;if(pt(arguments[0],Pe))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/t._scaleFactor+t._offsetX,s[o].y=s[o].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&Re.out.println(s)}},as.prototype.scale=function(){var t=this;if(pt(arguments[0],Pe)){for(var e=arguments[0],r=new j,i=e.iterator();i.hasNext();){var s=i.next();r.add(new ve(t.scale(s.getCoordinates()),s.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new D(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=Nt.removeRepeatedPoints(a);return l}},as.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},as.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},as.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},as.prototype.interfaces_=function(){return[Gs]},as.prototype.getClass=function(){return as};var kn=function(){this._li=new Ds,this._segStrings=null;var t=arguments[0];this._segStrings=t},Pv={fact:{configurable:!0}};kn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(s))throw new xi("found endpt/interior pt intersection at index "+c+" :pt "+s)}},kn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();t.checkInteriorIntersections(r,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var h=0;h<l.length-1;h++)t.checkInteriorIntersections(o,c,a,h);else if(arguments.length===4){var f=arguments[0],d=arguments[1],v=arguments[2],_=arguments[3];if(f===v&&d===_)return null;var E=f.getCoordinates()[d],P=f.getCoordinates()[d+1],y=v.getCoordinates()[_],w=v.getCoordinates()[_+1];if(this._li.computeIntersection(E,P,y,w),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,E,P)||this.hasInteriorIntersection(this._li,y,w)))throw new xi("found non-noded intersection at "+E+"-"+P+" and "+y+"-"+w)}},kn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},kn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},kn.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var s=t.getIntersection(i);if(!(s.equals(e)||s.equals(r)))return!0}return!1},kn.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new xi("found non-noded collapse at "+kn.fact.createLineString([t,e,r]))},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Pv.fact.get=function(){return new xt},Object.defineProperties(kn,Pv);var cr=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],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new ae("Scale factor must be non-zero");e!==1&&(this._pt=new D(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new D,this._p1Scaled=new D),this.initCorners(this._pt)},Iv={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};cr.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<r||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return Pt.isTrue(!(a&&u),"Found bad envelope test"),u},cr.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 D(this._maxx,this._maxy),this._corner[1]=new D(this._minx,this._maxy),this._corner[2]=new D(this._minx,this._miny),this._corner[3]=new D(this._maxx,this._miny)},cr.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))},cr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},cr.prototype.getCoordinate=function(){return this._originalPt},cr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},cr.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=cr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new at(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},cr.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()))},cr.prototype.intersectsToleranceSquare=function(t,e){var r=!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()&&(r=!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())||r&&i||t.equals(this._pt)||e.equals(this._pt))},cr.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},Iv.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(cr,Iv);var El=function(){this.tempEnv1=new at,this.selectedSegment=new ut};El.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)}}},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var Da=function(){this._index=null;var t=arguments[0];this._index=t},Mv={HotPixelSnapAction:{configurable:!0}};Da.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],r=arguments[1],i=arguments[2],s=e.getSafeEnvelope(),o=new bv(e,r,i);return this._index.query(s,{interfaces_:function(){return[is]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},Da.prototype.interfaces_=function(){return[]},Da.prototype.getClass=function(){return Da},Mv.HotPixelSnapAction.get=function(){return bv},Object.defineProperties(Da,Mv);var bv=function(n){function t(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],s=r.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return n.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(El),Po=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new j};Po.prototype.processIntersections=function(t,e,r,i){var s=this;if(t===r&&e===i)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)s._interiorIntersections.add(s._li.getIntersection(c));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}},Po.prototype.isDone=function(){return!1},Po.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Po.prototype.interfaces_=function(){return[Vs]},Po.prototype.getClass=function(){return Po};var ci=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 Ds,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};ci.prototype.checkCorrectness=function(t){var e=ve.getNodedSubstrings(t),r=new kn(e);try{r.checkValid()}catch(i){if(i instanceof ov)i.printStackTrace();else throw i}finally{}},ci.prototype.getNodedSubstrings=function(){return ve.getNodedSubstrings(this._nodedSegStrings)},ci.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},ci.prototype.findInteriorIntersections=function(t,e){var r=new Po(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},ci.prototype.computeVertexSnaps=function(){var t=this;if(pt(arguments[0],Pe))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof ve)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new cr(o[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},ci.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Ff,this._pointSnapper=new Da(this._noder.getIndex()),this.snapRound(t,this._li)},ci.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),s=new cr(i,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},ci.prototype.interfaces_=function(){return[Gs]},ci.prototype.getClass=function(){return ci};var Ge=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new zt,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],r=arguments[1];this._argGeom=e,this._bufParams=r}},La={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ge.prototype.bufferFixedPrecision=function(t){var e=new as(new ci(new Ut(1)),t.getScale()),r=new tr(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)},Ge.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Ge.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Ri)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Ge.precisionScaleFactor(this._argGeom,this._distance,r),s=new Ut(i);this.bufferFixedPrecision(s)}},Ge.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ut.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Ge.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Ge.prototype.bufferOriginalPrecision=function(){try{var t=new tr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof xi)this._saveException=e;else throw e}finally{}},Ge.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Ge.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ge(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Ge(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof zt&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=arguments[2],d=new Ge(c,f),v=d.getResultGeometry(h);return v}}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],y=arguments[3],w=new Ge(_);w.setQuadrantSegments(P),w.setEndCapStyle(y);var m=w.getResultGeometry(E);return m}},Ge.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),s=Rr.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=r-u,c=Math.pow(10,l);return c},La.CAP_ROUND.get=function(){return zt.CAP_ROUND},La.CAP_BUTT.get=function(){return zt.CAP_FLAT},La.CAP_FLAT.get=function(){return zt.CAP_FLAT},La.CAP_SQUARE.get=function(){return zt.CAP_SQUARE},La.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ge,La);var er=function(){this._pt=[new D,new D],this._distance=yt.NaN,this._isNull=!0};er.prototype.getCoordinates=function(){return this._pt},er.prototype.getCoordinate=function(t){return this._pt[t]},er.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},er.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},er.prototype.getDistance=function(){return this._distance},er.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var fi=function(){};fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},fi.computeDistance=function(){if(arguments[2]instanceof er&&arguments[0]instanceof ce&&arguments[1]instanceof D)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),s=new ut,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof er&&arguments[0]instanceof Ie&&arguments[1]instanceof D){var u=arguments[0],l=arguments[1],c=arguments[2];fi.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)fi.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof er&&arguments[0]instanceof gt&&arguments[1]instanceof D){var f=arguments[0],d=arguments[1],v=arguments[2];if(f instanceof ce)fi.computeDistance(f,d,v);else if(f instanceof Ie)fi.computeDistance(f,d,v);else if(f instanceof $e)for(var _=f,E=0;E<_.getNumGeometries();E++){var P=_.getGeometryN(E);fi.computeDistance(P,d,v)}else v.setMinimum(f.getCoordinate(),d)}else if(arguments[2]instanceof er&&arguments[0]instanceof ut&&arguments[1]instanceof D){var y=arguments[0],w=arguments[1],m=arguments[2],S=y.closestPoint(w);m.setMinimum(S,w)}};var zs=function(t){this._maxPtDist=new er,this._inputGeom=t||null},Gf={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};zs.prototype.computeMaxMidpointDistance=function(t){var e=new us(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},zs.prototype.computeMaxVertexDistance=function(t){var e=new Io(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},zs.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},zs.prototype.getDistancePoints=function(){return this._maxPtDist},zs.prototype.interfaces_=function(){return[]},zs.prototype.getClass=function(){return zs},Gf.MaxPointDistanceFilter.get=function(){return Io},Gf.MaxMidpointDistanceFilter.get=function(){return us},Object.defineProperties(zs,Gf);var Io=function(t){this._maxPtDist=new er,this._minPtDist=new er,this._geom=t||null};Io.prototype.filter=function(t){this._minPtDist.initialize(),fi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Io.prototype.getMaxPointDistance=function(){return this._maxPtDist},Io.prototype.interfaces_=function(){return[ii]},Io.prototype.getClass=function(){return Io};var us=function(t){this._maxPtDist=new er,this._minPtDist=new er,this._geom=t||null};us.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),s=new D((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),fi.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},us.prototype.isDone=function(){return!1},us.prototype.isGeometryChanged=function(){return!1},us.prototype.getMaxPointDistance=function(){return this._maxPtDist},us.prototype.interfaces_=function(){return[fn]},us.prototype.getClass=function(){return us};var Vi=function(t){this._comps=t||null};Vi.prototype.filter=function(t){t instanceof Ie&&this._comps.add(t)},Vi.prototype.interfaces_=function(){return[Tn]},Vi.prototype.getClass=function(){return Vi},Vi.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Vi.getPolygons(t,new j)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof Ie?r.add(e):e instanceof $e&&e.apply(new Vi(r)),r}};var ke=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],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};ke.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof si){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ce&&this._lines.add(t)},ke.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},ke.prototype.interfaces_=function(){return[Ti]},ke.prototype.getClass=function(){return ke},ke.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(ke.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(ke.getLines(e,r))}},ke.getLines=function(){if(arguments.length===1){var t=arguments[0];return ke.getLines(t,!1)}else if(arguments.length===2){if(pt(arguments[0],Pe)&&pt(arguments[1],Pe)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var s=i.next();ke.getLines(s,r)}return r}else if(arguments[0]instanceof gt&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new j;return o.apply(new ke(u,a)),u}else if(arguments[0]instanceof gt&&pt(arguments[1],Pe)){var l=arguments[0],c=arguments[1];return l instanceof ce?c.add(l):l.apply(new ke(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&pt(arguments[0],Pe)&&pt(arguments[1],Pe)){for(var h=arguments[0],f=arguments[1],d=arguments[2],v=h.iterator();v.hasNext();){var _=v.next();ke.getLines(_,f,d)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof gt&&pt(arguments[1],Pe)){var E=arguments[0],P=arguments[1],y=arguments[2];return E.apply(new ke(P,y)),P}}};var vn=function(){if(this._boundaryRule=Qr.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 ae("Rule must be non-null");this._boundaryRule=t}}};vn.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof D&&arguments[1]instanceof Ie){var e=arguments[0],r=arguments[1];if(r.isEmpty())return F.EXTERIOR;var i=r.getExteriorRing(),s=this.locateInPolygonRing(e,i);if(s===F.EXTERIOR)return F.EXTERIOR;if(s===F.BOUNDARY)return F.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var a=r.getInteriorRingN(o),u=t.locateInPolygonRing(e,a);if(u===F.INTERIOR)return F.EXTERIOR;if(u===F.BOUNDARY)return F.BOUNDARY}return F.INTERIOR}else if(arguments[0]instanceof D&&arguments[1]instanceof ce){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return F.EXTERIOR;var h=c.getCoordinates();return!c.isClosed()&&(l.equals(h[0])||l.equals(h[h.length-1]))?F.BOUNDARY:K.isOnLine(l,h)?F.INTERIOR:F.EXTERIOR}else if(arguments[0]instanceof D&&arguments[1]instanceof wr){var f=arguments[0],d=arguments[1],v=d.getCoordinate();return v.equals2D(f)?F.INTERIOR:F.EXTERIOR}},vn.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?K.locatePointInRing(t,e.getCoordinates()):F.EXTERIOR},vn.prototype.intersects=function(t,e){return this.locate(t,e)!==F.EXTERIOR},vn.prototype.updateLocationInfo=function(t){t===F.INTERIOR&&(this._isIn=!0),t===F.BOUNDARY&&this._numBoundaries++},vn.prototype.computeLocation=function(t,e){var r=this;if(e instanceof wr&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ce)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ie)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fs)for(var i=e,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);r.updateLocationInfo(r.locateInternal(t,o))}else if(e instanceof oi)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof $e)for(var c=new li(e);c.hasNext();){var h=c.next();h!==e&&r.computeLocation(t,h)}},vn.prototype.locate=function(t,e){return e.isEmpty()?F.EXTERIOR:e instanceof ce?this.locateInternal(t,e):e instanceof Ie?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?F.BOUNDARY:this._numBoundaries>0||this._isIn?F.INTERIOR:F.EXTERIOR)},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var rr=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];n.call(this,t,n.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._component=r,this._segIndex=i,this._pt=s}},Nv={INSIDE_AREA:{configurable:!0}};rr.prototype.isInsideArea=function(){return this._segIndex===rr.INSIDE_AREA},rr.prototype.getCoordinate=function(){return this._pt},rr.prototype.getGeometryComponent=function(){return this._component},rr.prototype.getSegmentIndex=function(){return this._segIndex},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},Nv.INSIDE_AREA.get=function(){return-1},Object.defineProperties(rr,Nv);var ls=function(t){this._pts=t||null};ls.prototype.filter=function(t){t instanceof wr&&this._pts.add(t)},ls.prototype.interfaces_=function(){return[Tn]},ls.prototype.getClass=function(){return ls},ls.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof wr?gn.singletonList(t):ls.getPoints(t,new j)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof wr?r.add(e):e instanceof $e&&e.apply(new ls(r)),r}};var Mo=function(){this._locations=null;var t=arguments[0];this._locations=t};Mo.prototype.filter=function(t){(t instanceof wr||t instanceof ce||t instanceof Ie)&&this._locations.add(new rr(t,0,t.getCoordinate()))},Mo.prototype.interfaces_=function(){return[Tn]},Mo.prototype.getClass=function(){return Mo},Mo.getLocations=function(t){var e=new j;return t.apply(new Mo(e)),e};var Ve=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new vn,this._minDistanceLocation=null,this._minDistance=yt.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 r=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=s}};Ve.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 r=arguments[0],i=arguments[1],s=1-r,o=Vi.getPolygons(this._geom[r]);if(o.size()>0){var a=Mo.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&pt(arguments[0],hn)&&pt(arguments[1],hn)){for(var u=arguments[0],l=arguments[1],c=arguments[2],h=0;h<u.size();h++)for(var f=u.get(h),d=0;d<l.size();d++)if(t.computeContainmentDistance(f,l.get(d),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof rr&&arguments[1]instanceof Ie){var v=arguments[0],_=arguments[1],E=arguments[2],P=v.getCoordinate();if(F.EXTERIOR!==this._ptLocator.locate(P,_))return this._minDistance=0,E[0]=v,E[1]=new rr(_,P),null}}},Ve.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},Ve.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=ke.getLines(this._geom[0]),r=ke.getLines(this._geom[1]),i=ls.getPoints(this._geom[0]),s=ls.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,s,t),this.updateMinDistance(t,!1)},Ve.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ve.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])},Ve.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Ve.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 ce&&arguments[1]instanceof wr){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=r.getCoordinate(),a=0;a<s.length-1;a++){var u=K.distancePointLine(o,s[a],s[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new ut(s[a],s[a+1]),c=l.closestPoint(o);i[0]=new rr(e,a,c),i[1]=new rr(r,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ce&&arguments[1]instanceof ce){var h=arguments[0],f=arguments[1],d=arguments[2];if(h.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=h.getCoordinates(),_=f.getCoordinates(),E=0;E<v.length-1;E++)for(var P=0;P<_.length-1;P++){var y=K.distanceLineLine(v[E],v[E+1],_[P],_[P+1]);if(y<t._minDistance){t._minDistance=y;var w=new ut(v[E],v[E+1]),m=new ut(_[P],_[P+1]),S=w.closestPoints(m);d[0]=new rr(h,E,S[0]),d[1]=new rr(f,P,S[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Ve.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new rr(o,0,o.getCoordinate()),r[1]=new rr(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Ve.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ae("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Ve.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.distance=function(t,e){var r=new Ve(t,e);return r.distance()},Ve.isWithinDistance=function(t,e,r){var i=new Ve(t,e,r);return i.distance()<=r},Ve.nearestPoints=function(t,e){var r=new Ve(t,e);return r.nearestPoints()};var Je=function(){this._pt=[new D,new D],this._distance=yt.NaN,this._isNull=!0};Je.prototype.getCoordinates=function(){return this._pt},Je.prototype.getCoordinate=function(t){return this._pt[t]},Je.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},Je.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Je.prototype.toString=function(){return ln.toLineString(this._pt[0],this._pt[1])},Je.prototype.getDistance=function(){return this._distance},Je.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],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Vn=function(){};Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Vn.computeDistance=function(){if(arguments[2]instanceof Je&&arguments[0]instanceof ce&&arguments[1]instanceof D)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new ut,s=t.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(e);r.setMinimum(a,e)}else if(arguments[2]instanceof Je&&arguments[0]instanceof Ie&&arguments[1]instanceof D){var u=arguments[0],l=arguments[1],c=arguments[2];Vn.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Vn.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Je&&arguments[0]instanceof gt&&arguments[1]instanceof D){var f=arguments[0],d=arguments[1],v=arguments[2];if(f instanceof ce)Vn.computeDistance(f,d,v);else if(f instanceof Ie)Vn.computeDistance(f,d,v);else if(f instanceof $e)for(var _=f,E=0;E<_.getNumGeometries();E++){var P=_.getGeometryN(E);Vn.computeDistance(P,d,v)}else v.setMinimum(f.getCoordinate(),d)}else if(arguments[2]instanceof Je&&arguments[0]instanceof ut&&arguments[1]instanceof D){var y=arguments[0],w=arguments[1],m=arguments[2],S=y.closestPoint(w);m.setMinimum(S,w)}};var en=function(){this._g0=null,this._g1=null,this._ptDist=new Je,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},kf={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};en.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},en.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ae("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},en.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},en.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},en.prototype.computeOrientedDistance=function(t,e,r){var i=new bo(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new hs(e,this._densifyFrac);t.apply(s),r.setMaximum(s.getMaxPointDistance())}},en.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new en(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new en(i,s);return a.setDensifyFraction(o),a.distance()}},kf.MaxPointDistanceFilter.get=function(){return bo},kf.MaxDensifiedByFractionDistanceFilter.get=function(){return hs},Object.defineProperties(en,kf);var bo=function(){this._maxPtDist=new Je,this._minPtDist=new Je,this._euclideanDist=new Vn,this._geom=null;var t=arguments[0];this._geom=t};bo.prototype.filter=function(t){this._minPtDist.initialize(),Vn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},bo.prototype.getMaxPointDistance=function(){return this._maxPtDist},bo.prototype.interfaces_=function(){return[ii]},bo.prototype.getClass=function(){return bo};var hs=function(){this._maxPtDist=new Je,this._minPtDist=new Je,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};hs.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,c=i.y+u*a,h=new D(l,c);r._minPtDist.initialize(),Vn.computeDistance(r._geom,h,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},hs.prototype.isDone=function(){return!1},hs.prototype.isGeometryChanged=function(){return!1},hs.prototype.getMaxPointDistance=function(){return this._maxPtDist},hs.prototype.interfaces_=function(){return[fn]},hs.prototype.getClass=function(){return hs};var Cr=function(t,e,r){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=r||null},Vf={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Cr.prototype.checkMaximumDistance=function(t,e,r){var i=new en(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ln.toLineString(s[0],s[1])+")"}},Cr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Cr.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(),Cr.VERBOSE&&Re.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Cr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ie||this._input instanceof oi||this._input instanceof $e))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)},Cr.prototype.getErrorIndicator=function(){return this._errorIndicator},Cr.prototype.checkMinimumDistance=function(t,e,r){var i=new Ve(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+ln.toLineString(s[0],s[1])+" )"}},Cr.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)},Cr.prototype.getErrorLocation=function(){return this._errorLocation},Cr.prototype.getPolygonLines=function(t){for(var e=new j,r=new ke(e),i=Vi.getPolygons(t),s=i.iterator();s.hasNext();){var o=s.next();o.apply(r)}return t.getFactory().buildGeometry(e)},Cr.prototype.getErrorMessage=function(){return this._errMsg},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Vf.VERBOSE.get=function(){return!1},Vf.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Cr,Vf);var Ue=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},Uf={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ue.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},Ue.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ue.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new at(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new at(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},Ue.prototype.checkDistance=function(){var t=new Cr(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")},Ue.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")},Ue.prototype.checkPolygonal=function(){this._result instanceof Ie||this._result instanceof oi||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ue.prototype.getErrorIndicator=function(){return this._errorIndicator},Ue.prototype.getErrorLocation=function(){return this._errorLocation},Ue.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")},Ue.prototype.report=function(t){if(!Ue.VERBOSE)return null;Re.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ue.prototype.getErrorMessage=function(){return this._errorMsg},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue},Ue.isValidMsg=function(t,e,r){var i=new Ue(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ue.isValid=function(t,e,r){var i=new Ue(t,e,r);return!!i.isValid()},Uf.VERBOSE.get=function(){return!1},Uf.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ue,Uf);var Un=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Un.prototype.getCoordinates=function(){return this._pts},Un.prototype.size=function(){return this._pts.length},Un.prototype.getCoordinate=function(t){return this._pts[t]},Un.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Un.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Eo.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Un.prototype.setData=function(t){this._data=t},Un.prototype.getData=function(){return this._data},Un.prototype.toString=function(){return ln.toLineString(new pe(this._pts))},Un.prototype.interfaces_=function(){return[ui]},Un.prototype.getClass=function(){return Un};var Ae=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new j,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ae.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ae.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ae.prototype.getIntersectionSegments=function(){return this._intSegments},Ae.prototype.count=function(){return this._intersectionCount},Ae.prototype.getIntersections=function(){return this._intersections},Ae.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ae.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ae.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,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++)},Ae.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ae.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ae.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ae.prototype.interfaces_=function(){return[Vs]},Ae.prototype.getClass=function(){return Ae},Ae.createAllIntersectionsFinder=function(t){var e=new Ae(t);return e.setFindAllIntersections(!0),e},Ae.createAnyIntersectionFinder=function(t){return new Ae(t)},Ae.createIntersectionCounter=function(t){var e=new Ae(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var mn=function(){this._li=new Ds,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};mn.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},mn.prototype.getIntersections=function(){return this._segInt.getIntersections()},mn.prototype.isValid=function(){return this.execute(),this._isValid},mn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},mn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ae(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Ff;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},mn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ri(this.getErrorMessage(),this._segInt.getInteriorIntersection())},mn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ln.toLineString(t[0],t[1])+" and "+ln.toLineString(t[2],t[3])},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.computeIntersections=function(t){var e=new mn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var qs=function n(){this._nv=null;var t=arguments[0];this._nv=new mn(n.toSegmentStrings(t))};qs.prototype.checkValid=function(){this._nv.checkValid()},qs.prototype.interfaces_=function(){return[]},qs.prototype.getClass=function(){return qs},qs.toSegmentStrings=function(t){for(var e=new j,r=t.iterator();r.hasNext();){var i=r.next();e.add(new Un(i.getCoordinates(),i))}return e},qs.checkValid=function(t){var e=new qs(t);e.checkValid()};var No=function(t){this._mapOp=t};No.prototype.map=function(t){for(var e=this,r=new j,i=0;i<t.getNumGeometries();i++){var s=e._mapOp.map(t.getGeometryN(i));s.isEmpty()||r.add(s)}return t.getFactory().createGeometryCollection(xt.toGeometryArray(r))},No.prototype.interfaces_=function(){return[]},No.prototype.getClass=function(){return No},No.map=function(t,e){var r=new No(e);return r.map(t)};var zn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new j,this._resultLineList=new j;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};zn.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},zn.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},zn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},zn.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&St.isResultOfOp(i,e)&&!s.isCovered()&&(r.add(s),t.setVisitedEdge(!0))},zn.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},zn.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},zn.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),s=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(s),i.setInResult(!0)}},zn.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Pt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),St.isResultOfOp(i,e)&&e===St.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn};var xo=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new j;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};xo.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},xo.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===St.INTERSECTION)){var s=i.getLabel();St.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(i)}}},xo.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo};var fr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};fr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},fr.prototype.transformPolygon=function(t,e){var r=this,i=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof si)||s.isEmpty())&&(i=!1);for(var o=new j,a=0;a<t.getNumInteriorRing();a++){var u=r.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof si||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new j;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},fr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},fr.prototype.getInputGeometry=function(){return this._inputGeom},fr.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},fr.prototype.transformCoordinates=function(t,e){return this.copy(t)},fr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},fr.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},fr.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},fr.prototype.copy=function(t){return t.copy()},fr.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new j,s=0;s<t.getNumGeometries();s++){var o=r.transform(t.getGeometryN(s));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(xt.toGeometryArray(i)):this._factory.buildGeometry(i)},fr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof wr)return this.transformPoint(t,null);if(t instanceof Na)return this.transformMultiPoint(t,null);if(t instanceof si)return this.transformLinearRing(t,null);if(t instanceof ce)return this.transformLineString(t,null);if(t instanceof Fs)return this.transformMultiLineString(t,null);if(t instanceof Ie)return this.transformPolygon(t,null);if(t instanceof oi)return this.transformMultiPolygon(t,null);if(t instanceof $e)return this.transformGeometryCollection(t,null);throw new ae("Unknown Geometry subtype: "+t.getClass().getName())},fr.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr};var di=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ut,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ce&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];n.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};di.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),s=0;s<i;s++){var o=t.get(s),a=r.findSnapForVertex(o,e);a!==null&&(t.set(s,new D(a)),s===0&&r._isClosed&&t.set(t.size()-1,new D(a)))}},di.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null},di.prototype.snapTo=function(t){var e=new al(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},di.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var s=0;s<i;s++){var o=e[s],a=r.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new D(o),!1)}},di.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=yt.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(r._seg.p0=e.get(o),r._seg.p1=e.get(o+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(t);a<r._snapTolerance&&a<i&&(i=a,s=o)}return s},di.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var me=function(t){this._srcGeom=t||null},xv={SNAP_PRECISION_FACTOR:{configurable:!0}};me.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Tv(e,r);return i.transform(this._srcGeom)},me.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Tv(t,r,!0),s=i.transform(this._srcGeom),o=s;return e&&pt(o,ns)&&(o=s.buffer(0)),o},me.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},me.prototype.extractTargetCoordinates=function(t){for(var e=new xn,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},me.prototype.computeMinimumSegmentLength=function(t){for(var e=yt.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.snap=function(t,e,r){var i=new Array(2).fill(null),s=new me(t);i[0]=s.snapTo(e,r);var o=new me(e);return i[1]=o.snapTo(i[0],r),i},me.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=me.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===Ut.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(me.computeOverlaySnapTolerance(s),me.computeOverlaySnapTolerance(o))}},me.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*me.SNAP_PRECISION_FACTOR;return i},me.snapToSelf=function(t,e,r){var i=new me(t);return i.snapToSelf(e,r)},xv.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(me,xv);var Tv=function(n){function t(e,r,i){n.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var s=new di(r,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var s=r.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fr),nr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};nr.prototype.getCommon=function(){return yt.longBitsToDouble(this._commonBits)},nr.prototype.add=function(t){var e=yt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=nr.signExpBits(this._commonBits),this._isFirst=!1,null;var r=nr.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=nr.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=nr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},nr.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=yt.longBitsToDouble(t),r=yt.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr},nr.getBit=function(t,e){var r=1<<e;return(t&r)!==0?1:0},nr.signExpBits=function(t){return t>>52},nr.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,s=t&i;return s},nr.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(nr.getBit(t,i)!==nr.getBit(e,i))return r;r++}return 52};var cs=function(){this._commonCoord=null,this._ccFilter=new To},zf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};cs.prototype.addCommonBits=function(t){var e=new fs(this._commonCoord);t.apply(e),t.geometryChanged()},cs.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new D(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new fs(e);return t.apply(r),t.geometryChanged(),t},cs.prototype.getCommonCoordinate=function(){return this._commonCoord},cs.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},cs.prototype.interfaces_=function(){return[]},cs.prototype.getClass=function(){return cs},zf.CommonCoordinateFilter.get=function(){return To},zf.Translater.get=function(){return fs},Object.defineProperties(cs,zf);var To=function(){this._commonBitsX=new nr,this._commonBitsY=new nr};To.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},To.prototype.getCommonCoordinate=function(){return new D(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},To.prototype.interfaces_=function(){return[ii]},To.prototype.getClass=function(){return To};var fs=function(){this.trans=null;var t=arguments[0];this.trans=t};fs.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)},fs.prototype.isDone=function(){return!1},fs.prototype.isGeometryChanged=function(){return!0},fs.prototype.interfaces_=function(){return[fn]},fs.prototype.getClass=function(){return fs};var Oe=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()};Oe.prototype.selfSnap=function(t){var e=new me(t),r=e.snapTo(t,this._snapTolerance);return r},Oe.prototype.removeCommonBits=function(t){this._cbr=new cs,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},Oe.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Oe.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=St.overlayOp(e[0],e[1],t);return this.prepareResult(r)},Oe.prototype.checkValid=function(t){t.isValid()||Re.out.println("Snapped geometry is invalid")},Oe.prototype.computeSnapTolerance=function(){this._snapTolerance=me.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Oe.prototype.snap=function(t){var e=this.removeCommonBits(t),r=me.snap(e[0],e[1],this._snapTolerance);return r},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.overlayOp=function(t,e,r){var i=new Oe(t,e);return i.getResultGeometry(r)},Oe.union=function(t,e){return Oe.overlayOp(t,e,St.UNION)},Oe.intersection=function(t,e){return Oe.overlayOp(t,e,St.INTERSECTION)},Oe.symDifference=function(t,e){return Oe.overlayOp(t,e,St.SYMDIFFERENCE)},Oe.difference=function(t,e){return Oe.overlayOp(t,e,St.DIFFERENCE)};var ir=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ir.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=St.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(r=!0)}catch(o){if(o instanceof xi)i=o;else throw o}finally{}if(!r)try{e=Oe.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof xi?i:o}finally{}return e},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},ir.overlayOp=function(t,e,r){var i=new ir(t,e);return i.getResultGeometry(r)},ir.union=function(t,e){return ir.overlayOp(t,e,St.UNION)},ir.intersection=function(t,e){return ir.overlayOp(t,e,St.INTERSECTION)},ir.symDifference=function(t,e){return ir.overlayOp(t,e,St.SYMDIFFERENCE)},ir.difference=function(t,e){return ir.overlayOp(t,e,St.DIFFERENCE)};var Sl=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Sl.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl};var Pr=function n(){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=n.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=s}},qf={INSERT:{configurable:!0},DELETE:{configurable:!0}};Pr.prototype.isDelete=function(){return this._eventType===Pr.DELETE},Pr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Pr.prototype.getObject=function(){return this._obj},Pr.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},Pr.prototype.getInsertEvent=function(){return this._insertEvent},Pr.prototype.isInsert=function(){return this._eventType===Pr.INSERT},Pr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Pr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Pr.prototype.interfaces_=function(){return[Jr]},Pr.prototype.getClass=function(){return Pr},qf.INSERT.get=function(){return 1},qf.DELETE.get=function(){return 2},Object.defineProperties(Pr,qf);var Rh=function(){};Rh.prototype.interfaces_=function(){return[]},Rh.prototype.getClass=function(){return Rh};var ze=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],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};ze.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(ze.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&i===s||i===0&&e===s)return!0}}return!1},ze.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ze.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ze.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ze.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),s=i.getCoordinate();if(t.isIntersection(s))return!0}return!1},ze.prototype.hasProperIntersection=function(){return this._hasProper},ze.prototype.hasIntersection=function(){return this._hasIntersection},ze.prototype.isDone=function(){return this._isDone},ze.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},ze.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ze.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.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))))},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var EI=function(n){function t(){n.call(this),this.events=new j,this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;gn.sort(this.events);for(var i=0;i<this.events.size();i++){var s=r.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=r.events.get(s);if(o.isInsert()&&r.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof ze&&pt(arguments[0],hn)&&pt(arguments[1],hn)){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"&&pt(arguments[0],hn)&&arguments[1]instanceof ze){var c=arguments[0],h=arguments[1],f=arguments[2];f?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(h)}}},t.prototype.addEdge=function(r,i){for(var s=this,o=r.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Sl(o,u),c=new Pr(i,o.getMinX(u),l);s.events.add(c),s.events.add(new Pr(o.getMaxX(u),c))}},t.prototype.processOverlaps=function(r,i,s,o){for(var a=this,u=s.getObject(),l=r;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var h=c.getObject();s.isSameLabel(c)||(u.computeIntersections(h,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();r.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();r.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Rh),gi=function(){this._min=yt.POSITIVE_INFINITY,this._max=yt.NEGATIVE_INFINITY},Av={NodeComparator:{configurable:!0}};gi.prototype.getMin=function(){return this._min},gi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},gi.prototype.getMax=function(){return this._max},gi.prototype.toString=function(){return ln.toLineString(new D(this._min,0),new D(this._max,0))},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},Av.NodeComparator.get=function(){return Cl},Object.defineProperties(gi,Av);var Cl=function(){};Cl.prototype.compare=function(t,e){var r=t,i=e,s=(r._min+r._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},Cl.prototype.interfaces_=function(){return[ma]},Cl.prototype.getClass=function(){return Cl};var SI=function(n){function t(){n.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(gi),CI=function(n){function t(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,s),this._node2!==null&&this._node2.query(r,i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(gi),pi=function(){this._leaves=new j,this._root=null,this._level=0};pi.prototype.buildTree=function(){var t=this;gn.sort(this._leaves,new gi.NodeComparator);for(var e=this._leaves,r=null,i=new j;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}},pi.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new SI(t,e,r))},pi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},pi.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},pi.prototype.printNode=function(t){Re.out.println(ln.toLineString(new D(t._min,this._level),new D(t._max,this._level)))},pi.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},pi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),s=r+1<t.size()?t.get(r):null;if(s===null)e.add(i);else{var o=new CI(t.get(r),t.get(r+1));e.add(o)}}},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi};var Ra=function(){this._items=new j};Ra.prototype.visitItem=function(t){this._items.add(t)},Ra.prototype.getItems=function(){return this._items},Ra.prototype.interfaces_=function(){return[is]},Ra.prototype.getClass=function(){return Ra};var Fa=function(){this._index=null;var t=arguments[0];if(!pt(t,ns))throw new ae("Argument must be Polygonal");this._index=new Ws(t)},Wf={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Fa.prototype.locate=function(t){var e=new Nn(t),r=new Ga(e);return this._index.query(t.y,t.y,r),e.getLocation()},Fa.prototype.interfaces_=function(){return[Oa]},Fa.prototype.getClass=function(){return Fa},Wf.SegmentVisitor.get=function(){return Ga},Wf.IntervalIndexedGeometry.get=function(){return Ws},Object.defineProperties(Fa,Wf);var Ga=function(){this._counter=null;var t=arguments[0];this._counter=t};Ga.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ga.prototype.interfaces_=function(){return[is]},Ga.prototype.getClass=function(){return Ga};var Ws=function(){this._index=new pi;var t=arguments[0];this.init(t)};Ws.prototype.init=function(t){for(var e=this,r=ke.getLines(t),i=r.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();e.addLine(o)}},Ws.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new ut(t[r-1],t[r]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);e._index.insert(s,o,i)}},Ws.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ra;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Ws.prototype.interfaces_=function(){return[]},Ws.prototype.getClass=function(){return Ws};var Pl=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new fv,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new vn,arguments.length===2){var e=arguments[0],r=arguments[1],i=Qr.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=F.NONE;u=o.getLocation(r,B.ON),u===F.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new ze(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof si||this._parentGeom instanceof Ie||this._parentGeom instanceof oi,h=o||!c;return l.computeIntersections(this._edges,u,h),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,s){var o=new ze(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._edges,o),o},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 wr){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,F.INTERIOR)}else if(arguments[0]instanceof D){var s=arguments[0];this.insertPoint(this._argIndex,s,F.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),F.EXTERIOR,F.INTERIOR);for(var s=0;s<r.getNumInteriorRing();s++){var o=r.getInteriorRingN(s);i.addPolygonRing(o,F.INTERIOR,F.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],F.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],F.BOUNDARY)},t.prototype.addLineString=function(r){var i=Nt.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new Lh(i,new Yt(this._argIndex,F.INTERIOR));this._lineEdgeMap.put(r,s),this.insertEdge(s),Pt.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 r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),s=0,o=r.iterator();o.hasNext();){var a=o.next();i[s++]=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(r,i,s){if(this.isBoundaryNode(r,i))return null;s===F.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,s)},t.prototype.addPolygonRing=function(r,i,s){if(r.isEmpty())return null;var o=Nt.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;K.isCCW(o)&&(a=s,u=i);var l=new Lh(o,new Yt(this._argIndex,F.BOUNDARY,a,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],F.BOUNDARY)},t.prototype.insertPoint=function(r,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new Yt(r,s):a.setLocation(r,s)},t.prototype.createEdgeSetIntersector=function(){return new EI},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(r),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof oi&&(this._useBoundaryDeterminationRule=!1),r instanceof Ie)this.addPolygon(r);else if(r instanceof ce)this.addLineString(r);else if(r instanceof wr)this.addPoint(r);else if(r instanceof Na)this.addCollection(r);else if(r instanceof Fs)this.addCollection(r);else if(r instanceof oi)this.addCollection(r);else if(r instanceof $e)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);i.add(o)}},t.prototype.locate=function(r){return pt(this._parentGeom,ns)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Fa(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?F.BOUNDARY:F.INTERIOR},t}(he),ka=function(){if(this._li=new Ds,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 Pl(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Qr.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Pl(0,e,i),this._arg[1]=new Pl(1,r,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Pl(0,s,a),this._arg[1]=new Pl(1,o,a)}};ka.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},ka.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},ka.prototype.interfaces_=function(){return[]},ka.prototype.getClass=function(){return ka};var Hs=function(){};Hs.prototype.interfaces_=function(){return[]},Hs.prototype.getClass=function(){return Hs},Hs.map=function(){if(arguments[0]instanceof gt&&pt(arguments[1],Hs.MapOp)){for(var t=arguments[0],e=arguments[1],r=new j,i=0;i<t.getNumGeometries();i++){var s=e.map(t.getGeometryN(i));s!==null&&r.add(s)}return t.getFactory().buildGeometry(r)}else if(pt(arguments[0],Pe)&&pt(arguments[1],Hs.MapOp)){for(var o=arguments[0],a=arguments[1],u=new j,l=o.iterator();l.hasNext();){var c=l.next(),h=a.map(c);h!==null&&u.add(h)}return u}},Hs.MapOp=function(){};var St=function(n){function t(){var e=arguments[0],r=arguments[1];n.call(this,e,r),this._ptLocator=new vn,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new pn,this._resultPolyList=new j,this._resultLineList=new j,this._resultPointList=new j,this._graph=new he(new Sv),this._geomFact=e.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var s=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new Yt(r.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,s,o){var a=new j;return a.addAll(r),a.addAll(i),a.addAll(s),a.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(r,a);if(u!==F.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new j,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),r.add(s.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,s=r.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(r){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 j;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),qs.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var s=new Er(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new zn(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var a=new xo(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var s=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,s)},t.prototype.copyPoints=function(r){for(var i=this,s=this._arg[r].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(r,o.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,B.RIGHT),o.getLocation(1,B.RIGHT),r)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(Pt.isTrue(!o.isNull(a,B.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,B.LEFT,o.getLocation(a,B.LEFT)),Pt.isTrue(!o.isNull(a,B.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,B.RIGHT,o.getLocation(a,B.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(s,0):r.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ka);St.overlayOp=function(n,t,e){var r=new St(n,t),i=r.getResultGeometry(e);return i},St.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return St.createEmptyResult(St.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var e=t;return No.map(n,{interfaces_:function(){return[Hs.MapOp]},map:function(r){return r.intersection(e)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ir.overlayOp(n,t,St.INTERSECTION)},St.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return St.createEmptyResult(St.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ir.overlayOp(n,t,St.SYMDIFFERENCE)},St.resultDimension=function(n,t,e){var r=t.getDimension(),i=e.getDimension(),s=-1;switch(n){case St.INTERSECTION:s=Math.min(r,i);break;case St.UNION:s=Math.max(r,i);break;case St.DIFFERENCE:s=r;break;case St.SYMDIFFERENCE:s=Math.max(r,i);break}return s},St.createEmptyResult=function(n,t,e,r){var i=null;switch(St.resultDimension(n,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},St.difference=function(n,t){return n.isEmpty()?St.createEmptyResult(St.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ir.overlayOp(n,t,St.DIFFERENCE))},St.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],t=arguments[1],e=n.getLocation(0),r=n.getLocation(1);return St.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===F.BOUNDARY&&(i=F.INTERIOR),s===F.BOUNDARY&&(s=F.INTERIOR),o){case St.INTERSECTION:return i===F.INTERIOR&&s===F.INTERIOR;case St.UNION:return i===F.INTERIOR||s===F.INTERIOR;case St.DIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR;case St.SYMDIFFERENCE:return i===F.INTERIOR&&s!==F.INTERIOR||i!==F.INTERIOR&&s===F.INTERIOR}return!1}},St.INTERSECTION=1,St.UNION=2,St.DIFFERENCE=3,St.SYMDIFFERENCE=4;var ds=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new vn,this._seg=new ut;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};ds.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,e._seg.p0),s.getCoordinate(o+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},ds.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?F.BOUNDARY:this._ptLocator.locate(t,this._g)},ds.prototype.extractLinework=function(t){var e=new Va;t.apply(e);var r=e.getLinework(),i=xt.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},ds.prototype.interfaces_=function(){return[]},ds.prototype.getClass=function(){return ds};var Va=function(){this._linework=null,this._linework=new j};Va.prototype.getLinework=function(){return this._linework},Va.prototype.filter=function(t){var e=this;if(t instanceof Ie){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},Va.prototype.interfaces_=function(){return[Tn]},Va.prototype.getClass=function(){return Va};var Xs=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Xs.prototype.extractPoints=function(t,e,r){for(var i=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],e,r)},Xs.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Xs.prototype.getPoints=function(t){for(var e=this,r=new j,i=ke.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,r)}return r},Xs.prototype.computeOffsetPoints=function(t,e,r,i){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),u=r*s/a,l=r*o/a,c=(e.x+t.x)/2,h=(e.y+t.y)/2;if(this._doLeft){var f=new D(c-l,h+u);i.add(f)}if(this._doRight){var d=new D(c+l,h-u);i.add(d)}},Xs.prototype.interfaces_=function(){return[]},Xs.prototype.getClass=function(){return Xs};var Ur=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new j;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new ds(this._geom[0],this._boundaryDistanceTolerance),new ds(this._geom[1],this._boundaryDistanceTolerance),new ds(this._geom[2],this._boundaryDistanceTolerance)]},Ov={TOLERANCE:{configurable:!0}};Ur.prototype.reportResult=function(t,e,r){Re.out.println("Overlay result invalid - A:"+F.toLocationSymbol(e[0])+" B:"+F.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+F.toLocationSymbol(e[2]))},Ur.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ur.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Ur.hasLocation(this._location,F.BOUNDARY)?!0:this.isValidResult(s,this._location)}},Ur.prototype.addTestPts=function(t){var e=new Xs(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ur.prototype.isValidResult=function(t,e){var r=St.isResultOfOp(e[0],e[1],t),i=e[2]===F.INTERIOR,s=!(r^i);return s||this.reportResult(t,e,r),s},Ur.prototype.getInvalidLocation=function(){return this._invalidLocation},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},Ur.computeBoundaryDistanceTolerance=function(t,e){return Math.min(me.computeSizeBasedSnapTolerance(t),me.computeSizeBasedSnapTolerance(e))},Ur.isValid=function(t,e,r,i){var s=new Ur(t,e,i);return s.isValid(r)},Ov.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ur,Ov);var zr=function n(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(t),this._inputGeoms=t};zr.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);r._skipEmpty&&s.isEmpty()||e.add(s)}},zr.prototype.combine=function(){for(var t=this,e=new j,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.combine=function(){if(arguments.length===1){var t=arguments[0],e=new zr(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new zr(zr.createList(r,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new zr(zr.createList(o,a,u));return l.combine()}},zr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},zr.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new j;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new j;return a.add(i),a.add(s),a.add(o),a}};var Ee=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new j)},Dv={STRTREE_NODE_CAPACITY:{configurable:!0}};Ee.prototype.reduceToGeometries=function(t){for(var e=this,r=new j,i=t.iterator();i.hasNext();){var s=i.next(),o=null;pt(s,hn)?o=e.unionTree(s):s instanceof gt&&(o=s),r.add(o)}return r},Ee.prototype.extractByEnvelope=function(t,e,r){for(var i=new j,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)},Ee.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var s=zr.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},Ee.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 vv(Ee.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),s=this.unionTree(i);return s},Ee.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],r=arguments[1],i=arguments[2];if(i-r<=1){var s=Ee.getGeometry(e,r);return this.unionSafe(s,null)}else{if(i-r===2)return this.unionSafe(Ee.getGeometry(e,r),Ee.getGeometry(e,r+1));var o=Math.trunc((i+r)/2),a=this.binaryUnion(e,r,o),u=this.binaryUnion(e,o,i);return this.unionSafe(a,u)}}},Ee.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e},Ee.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Ee.prototype.unionActual=function(t,e){return Ee.restrictToPolygons(t.union(e))},Ee.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r},Ee.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new j,s=this.extractByEnvelope(r,t,i),o=this.extractByEnvelope(r,e,i),a=this.unionActual(s,o);i.add(a);var u=zr.combine(i);return u},Ee.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee},Ee.restrictToPolygons=function(t){if(pt(t,ns))return t;var e=Vi.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(xt.toPolygonArray(e))},Ee.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ee.union=function(t){var e=new Ee(t);return e.union()},Dv.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ee,Dv);var Fh=function(){};Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh},Fh.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return St.createEmptyResult(St.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ir.overlayOp(t,e,St.UNION)};function Bs(){return new Gh}function Gh(){this.reset()}Gh.prototype={constructor:Gh,reset:function(){this.s=this.t=0},add:function(n){Lv(kh,n,this.t),Lv(this,kh.s,this.s),this.s?this.t+=kh.t:this.s=kh.t},valueOf:function(){return this.s}};var kh=new Gh;function Lv(n,t,e){var r=n.s=t+e,i=r-t,s=r-i;n.t=t-s+(e-i)}var Se=1e-6,jt=Math.PI,Ui=jt/2,Rv=jt/4,zi=jt*2,Ys=180/jt,qn=jt/180,sr=Math.abs,PI=Math.atan,Ua=Math.atan2,be=Math.cos,Ne=Math.sin,za=Math.sqrt;function Fv(n){return n>1?0:n<-1?jt:Math.acos(n)}function Ao(n){return n>1?Ui:n<-1?-Ui:Math.asin(n)}function Il(){}function Vh(n,t){n&&kv.hasOwnProperty(n.type)&&kv[n.type](n,t)}var Gv={Feature:function(n,t){Vh(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)Vh(e[r].geometry,t)}},kv={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){Hf(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Hf(e[r],t,0)},Polygon:function(n,t){Vv(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)Vv(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)Vh(e[r],t)}};function Hf(n,t,e){var r=-1,i=n.length-e,s;for(t.lineStart();++r<i;)s=n[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Vv(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)Hf(n[e],t,1);t.polygonEnd()}function II(n,t){n&&Gv.hasOwnProperty(n.type)?Gv[n.type](n,t):Vh(n,t)}Bs(),Bs();function Xf(n){return[Ua(n[1],n[0]),Ao(n[2])]}function qa(n){var t=n[0],e=n[1],r=be(e);return[r*be(t),r*Ne(t),Ne(e)]}function Uh(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function zh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Bf(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function qh(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Yf(n){var t=za(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}Bs();function Uv(n,t){function e(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(e.invert=function(r,i){return r=t.invert(r,i),r&&n.invert(r[0],r[1])}),e}function Jf(n,t){return[n>jt?n-zi:n<-jt?n+zi:n,t]}Jf.invert=Jf;function MI(n,t,e){return(n%=zi)?t||e?Uv(qv(n),Wv(t,e)):qv(n):t||e?Wv(t,e):Jf}function zv(n){return function(t,e){return t+=n,[t>jt?t-zi:t<-jt?t+zi:t,e]}}function qv(n){var t=zv(n);return t.invert=zv(-n),t}function Wv(n,t){var e=be(n),r=Ne(n),i=be(t),s=Ne(t);function o(a,u){var l=be(u),c=be(a)*l,h=Ne(a)*l,f=Ne(u),d=f*e+c*r;return[Ua(h*i-d*s,c*e-f*r),Ao(d*i+h*s)]}return o.invert=function(a,u){var l=be(u),c=be(a)*l,h=Ne(a)*l,f=Ne(u),d=f*i-h*s;return[Ua(h*i+f*s,c*e+d*r),Ao(d*e-c*r)]},o}function bI(n,t,e,r,i,s){if(e){var o=be(t),a=Ne(t),u=r*e;i==null?(i=t+r*zi,s=t-u/2):(i=Hv(o,i),s=Hv(o,s),(r>0?i<s:i>s)&&(i+=r*zi));for(var l,c=i;r>0?c>s:c<s;c-=u)l=Xf([o,-a*be(c),-a*Ne(c)]),n.point(l[0],l[1])}}function Hv(n,t){t=qa(t),t[0]-=n,Yf(t);var e=Fv(-t[1]);return((-t[2]<0?-e:e)+zi-Se)%zi}function Xv(){var n=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){n.push(t=[])},lineEnd:Il,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function NI(n,t,e,r,i,s){var o=n[0],a=n[1],u=t[0],l=t[1],c=0,h=1,f=u-o,d=l-a,v;if(v=e-o,!(!f&&v>0)){if(v/=f,f<0){if(v<c)return;v<h&&(h=v)}else if(f>0){if(v>h)return;v>c&&(c=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>h)return;v>c&&(c=v)}else if(f>0){if(v<c)return;v<h&&(h=v)}if(v=r-a,!(!d&&v>0)){if(v/=d,d<0){if(v<c)return;v<h&&(h=v)}else if(d>0){if(v>h)return;v>c&&(c=v)}if(v=s-a,!(!d&&v<0)){if(v/=d,d<0){if(v>h)return;v>c&&(c=v)}else if(d>0){if(v<c)return;v<h&&(h=v)}return c>0&&(n[0]=o+c*f,n[1]=a+c*d),h<1&&(t[0]=o+h*f,t[1]=a+h*d),!0}}}}}function Wh(n,t){return sr(n[0]-t[0])<Se&&sr(n[1]-t[1])<Se}function Hh(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Bv(n,t,e,r,i){var s=[],o=[],a,u;if(n.forEach(function(v){if(!((_=v.length-1)<=0)){var _,E=v[0],P=v[_],y;if(Wh(E,P)){for(i.lineStart(),a=0;a<_;++a)i.point((E=v[a])[0],E[1]);i.lineEnd();return}s.push(y=new Hh(E,v,null,!0)),o.push(y.o=new Hh(E,null,y,!1)),s.push(y=new Hh(P,v,null,!1)),o.push(y.o=new Hh(P,null,y,!0))}}),!!s.length){for(o.sort(t),Yv(s),Yv(o),a=0,u=o.length;a<u;++a)o[a].e=e=!e;for(var l=s[0],c,h;;){for(var f=l,d=!0;f.v;)if((f=f.n)===l)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(a=0,u=c.length;a<u;++a)i.point((h=c[a])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(d)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((h=c[a])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,d=!d}while(!f.v);i.lineEnd()}}}function Yv(n){if(t=n.length){for(var t,e=0,r=n[0],i;++e<t;)r.n=i=n[e],i.p=r,r=i;r.n=i=n[0],i.p=r}}function Jv(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function xI(n){return n.length===1&&(n=TI(n)),{left:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var s=r+i>>>1;n(t[s],e)<0?r=s+1:i=s}return r},right:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var s=r+i>>>1;n(t[s],e)>0?i=s:r=s+1}return r}}}function TI(n){return function(t,e){return Jv(n(t),e)}}xI(Jv);function jv(n){for(var t=n.length,e,r=-1,i=0,s,o;++r<t;)i+=n[r].length;for(s=new Array(i);--t>=0;)for(o=n[t],e=o.length;--e>=0;)s[--i]=o[e];return s}var Xh=1e9,Bh=-1e9;function AI(n,t,e,r){function i(l,c){return n<=l&&l<=e&&t<=c&&c<=r}function s(l,c,h,f){var d=0,v=0;if(l==null||(d=o(l,h))!==(v=o(c,h))||u(l,c)<0^h>0)do f.point(d===0||d===3?n:e,d>1?r:t);while((d=(d+h+4)%4)!==v);else f.point(c[0],c[1])}function o(l,c){return sr(l[0]-n)<Se?c>0?0:3:sr(l[0]-e)<Se?c>0?2:1:sr(l[1]-t)<Se?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var h=o(l,1),f=o(c,1);return h!==f?h-f:h===0?c[1]-l[1]:h===1?l[0]-c[0]:h===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,h=Xv(),f,d,v,_,E,P,y,w,m,S,C,I={point:b,lineStart:T,lineEnd:L,polygonStart:A,polygonEnd:N};function b($,Y){i($,Y)&&c.point($,Y)}function x(){for(var $=0,Y=0,Z=d.length;Y<Z;++Y)for(var G=d[Y],W=1,k=G.length,V=G[0],O,q,X=V[0],rt=V[1];W<k;++W)O=X,q=rt,V=G[W],X=V[0],rt=V[1],q<=r?rt>r&&(X-O)*(r-q)>(rt-q)*(n-O)&&++$:rt<=r&&(X-O)*(r-q)<(rt-q)*(n-O)&&--$;return $}function A(){c=h,f=[],d=[],C=!0}function N(){var $=x(),Y=C&&$,Z=(f=jv(f)).length;(Y||Z)&&(l.polygonStart(),Y&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),Z&&Bv(f,a,$,s,l),l.polygonEnd()),c=l,f=d=v=null}function T(){I.point=U,d&&d.push(v=[]),S=!0,m=!1,y=w=NaN}function L(){f&&(U(_,E),P&&m&&h.rejoin(),f.push(h.result())),I.point=b,m&&c.lineEnd()}function U($,Y){var Z=i($,Y);if(d&&v.push([$,Y]),S)_=$,E=Y,P=Z,S=!1,Z&&(c.lineStart(),c.point($,Y));else if(Z&&m)c.point($,Y);else{var G=[y=Math.max(Bh,Math.min(Xh,y)),w=Math.max(Bh,Math.min(Xh,w))],W=[$=Math.max(Bh,Math.min(Xh,$)),Y=Math.max(Bh,Math.min(Xh,Y))];NI(G,W,n,t,e,r)?(m||(c.lineStart(),c.point(G[0],G[1])),c.point(W[0],W[1]),Z||c.lineEnd(),C=!1):Z&&(c.lineStart(),c.point($,Y),C=!1)}y=$,w=Y,m=Z}return I}}var jf=Bs();function OI(n,t){var e=t[0],r=t[1],i=[Ne(e),-be(e),0],s=0,o=0;jf.reset();for(var a=0,u=n.length;a<u;++a)if(c=(l=n[a]).length)for(var l,c,h=l[c-1],f=h[0],d=h[1]/2+Rv,v=Ne(d),_=be(d),E=0;E<c;++E,f=y,v=m,_=S,h=P){var P=l[E],y=P[0],w=P[1]/2+Rv,m=Ne(w),S=be(w),C=y-f,I=C>=0?1:-1,b=I*C,x=b>jt,A=v*m;if(jf.add(Ua(A*I*Ne(b),_*S+A*be(b))),s+=x?C+I*zi:C,x^f>=e^y>=e){var N=zh(qa(h),qa(P));Yf(N);var T=zh(i,N);Yf(T);var L=(x^C>=0?-1:1)*Ao(T[2]);(r>L||r===L&&(N[0]||N[1]))&&(o+=x^C>=0?1:-1)}}return(s<-1e-6||s<Se&&jf<-1e-6)^o&1}Bs();function Qv(n){return n}Bs(),Bs();var Wa=1/0,Yh=Wa,Ml=-Wa,Jh=Ml,$v={point:DI,lineStart:Il,lineEnd:Il,polygonStart:Il,polygonEnd:Il,result:function(){var n=[[Wa,Yh],[Ml,Jh]];return Ml=Jh=-(Yh=Wa=1/0),n}};function DI(n,t){n<Wa&&(Wa=n),n>Ml&&(Ml=n),t<Yh&&(Yh=t),t>Jh&&(Jh=t)}Bs();function Kv(n,t,e,r){return function(i,s){var o=t(s),a=i.invert(r[0],r[1]),u=Xv(),l=t(u),c=!1,h,f,d,v={point:_,lineStart:P,lineEnd:y,polygonStart:function(){v.point=w,v.lineStart=m,v.lineEnd=S,f=[],h=[]},polygonEnd:function(){v.point=_,v.lineStart=P,v.lineEnd=y,f=jv(f);var C=OI(h,a);f.length?(c||(s.polygonStart(),c=!0),Bv(f,RI,C,e,s)):C&&(c||(s.polygonStart(),c=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),f=h=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function _(C,I){var b=i(C,I);n(C=b[0],I=b[1])&&s.point(C,I)}function E(C,I){var b=i(C,I);o.point(b[0],b[1])}function P(){v.point=E,o.lineStart()}function y(){v.point=_,o.lineEnd()}function w(C,I){d.push([C,I]);var b=i(C,I);l.point(b[0],b[1])}function m(){l.lineStart(),d=[]}function S(){w(d[0][0],d[0][1]),l.lineEnd();var C=l.clean(),I=u.result(),b,x=I.length,A,N,T;if(d.pop(),h.push(d),d=null,!!x){if(C&1){if(N=I[0],(A=N.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),b=0;b<A;++b)s.point((T=N[b])[0],T[1]);s.lineEnd()}return}x>1&&C&2&&I.push(I.pop().concat(I.shift())),f.push(I.filter(LI))}}return v}}function LI(n){return n.length>1}function RI(n,t){return((n=n.x)[0]<0?n[1]-Ui-Se:Ui-n[1])-((t=t.x)[0]<0?t[1]-Ui-Se:Ui-t[1])}const Zv=Kv(function(){return!0},FI,kI,[-jt,-Ui]);function FI(n){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(s,o){var a=s>0?jt:-jt,u=sr(s-t);sr(u-jt)<Se?(n.point(t,e=(e+o)/2>0?Ui:-Ui),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(s,e),i=0):r!==a&&u>=jt&&(sr(t-r)<Se&&(t-=r*Se),sr(s-a)<Se&&(s-=a*Se),e=GI(t,e,s,o),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(a,e),i=0),n.point(t=s,e=o),r=a},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function GI(n,t,e,r){var i,s,o=Ne(n-e);return sr(o)>Se?PI((Ne(t)*(s=be(r))*Ne(e)-Ne(r)*(i=be(t))*Ne(n))/(i*s*o)):(t+r)/2}function kI(n,t,e,r){var i;if(n==null)i=e*Ui,r.point(-jt,i),r.point(0,i),r.point(jt,i),r.point(jt,0),r.point(jt,-i),r.point(0,-i),r.point(-jt,-i),r.point(-jt,0),r.point(-jt,i);else if(sr(n[0]-t[0])>Se){var s=n[0]<t[0]?jt:-jt;i=e*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function VI(n,t){var e=be(n),r=e>0,i=sr(e)>Se;function s(c,h,f,d){bI(d,n,t,f,c,h)}function o(c,h){return be(c)*be(h)>e}function a(c){var h,f,d,v,_;return{lineStart:function(){v=d=!1,_=1},point:function(E,P){var y=[E,P],w,m=o(E,P),S=r?m?0:l(E,P):m?l(E+(E<0?jt:-jt),P):0;if(!h&&(v=d=m)&&c.lineStart(),m!==d&&(w=u(h,y),(!w||Wh(h,w)||Wh(y,w))&&(y[0]+=Se,y[1]+=Se,m=o(y[0],y[1]))),m!==d)_=0,m?(c.lineStart(),w=u(y,h),c.point(w[0],w[1])):(w=u(h,y),c.point(w[0],w[1]),c.lineEnd()),h=w;else if(i&&h&&r^m){var C;!(S&f)&&(C=u(y,h,!0))&&(_=0,r?(c.lineStart(),c.point(C[0][0],C[0][1]),c.point(C[1][0],C[1][1]),c.lineEnd()):(c.point(C[1][0],C[1][1]),c.lineEnd(),c.lineStart(),c.point(C[0][0],C[0][1])))}m&&(!h||!Wh(h,y))&&c.point(y[0],y[1]),h=y,d=m,f=S},lineEnd:function(){d&&c.lineEnd(),h=null},clean:function(){return _|(v&&d)<<1}}}function u(c,h,f){var d=qa(c),v=qa(h),_=[1,0,0],E=zh(d,v),P=Uh(E,E),y=E[0],w=P-y*y;if(!w)return!f&&c;var m=e*P/w,S=-e*y/w,C=zh(_,E),I=qh(_,m),b=qh(E,S);Bf(I,b);var x=C,A=Uh(I,x),N=Uh(x,x),T=A*A-N*(Uh(I,I)-1);if(!(T<0)){var L=za(T),U=qh(x,(-A-L)/N);if(Bf(U,I),U=Xf(U),!f)return U;var $=c[0],Y=h[0],Z=c[1],G=h[1],W;Y<$&&(W=$,$=Y,Y=W);var k=Y-$,V=sr(k-jt)<Se,O=V||k<Se;if(!V&&G<Z&&(W=Z,Z=G,G=W),O?V?Z+G>0^U[1]<(sr(U[0]-$)<Se?Z:G):Z<=U[1]&&U[1]<=G:k>jt^($<=U[0]&&U[0]<=Y)){var q=qh(x,(-A+L)/N);return Bf(q,I),[U,Xf(q)]}}}function l(c,h){var f=r?n:jt-n,d=0;return c<-f?d|=1:c>f&&(d|=2),h<-f?d|=4:h>f&&(d|=8),d}return Kv(o,a,s,r?[0,-n]:[-jt,n-jt])}function tm(n){return function(t){var e=new Qf;for(var r in n)e[r]=n[r];return e.stream=t,e}}function Qf(){}Qf.prototype={constructor:Qf,point:function(n,t){this.stream.point(n,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 em(n,t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),s!=null&&n.clipExtent(null),II(e,n.stream($v));var o=$v.result(),a=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+t[0][0]+(r-a*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&n.clipExtent(s),n.scale(a*150).translate([u,l])}function UI(n,t,e){return em(n,[[0,0],t],e)}var rm=16,zI=be(30*qn);function nm(n,t){return+t?WI(n,t):qI(n)}function qI(n){return tm({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}function WI(n,t){function e(r,i,s,o,a,u,l,c,h,f,d,v,_,E){var P=l-r,y=c-i,w=P*P+y*y;if(w>4*t&&_--){var m=o+f,S=a+d,C=u+v,I=za(m*m+S*S+C*C),b=Ao(C/=I),x=sr(sr(C)-1)<Se||sr(s-h)<Se?(s+h)/2:Ua(S,m),A=n(x,b),N=A[0],T=A[1],L=N-r,U=T-i,$=y*L-P*U;($*$/w>t||sr((P*L+y*U)/w-.5)>.3||o*f+a*d+u*v<zI)&&(e(r,i,s,o,a,u,N,T,x,m/=I,S/=I,C,_,E),E.point(N,T),e(N,T,x,m,S,C,l,c,h,f,d,v,_,E))}}return function(r){var i,s,o,a,u,l,c,h,f,d,v,_,E={point:P,lineStart:y,lineEnd:m,polygonStart:function(){r.polygonStart(),E.lineStart=S},polygonEnd:function(){r.polygonEnd(),E.lineStart=y}};function P(b,x){b=n(b,x),r.point(b[0],b[1])}function y(){h=NaN,E.point=w,r.lineStart()}function w(b,x){var A=qa([b,x]),N=n(b,x);e(h,f,c,d,v,_,h=N[0],f=N[1],c=b,d=A[0],v=A[1],_=A[2],rm,r),r.point(h,f)}function m(){E.point=P,r.lineEnd()}function S(){y(),E.point=C,E.lineEnd=I}function C(b,x){w(i=b,x),s=h,o=f,a=d,u=v,l=_,E.point=w}function I(){e(h,f,c,d,v,_,s,o,i,a,u,l,rm,r),E.lineEnd=m,m()}return E}}var HI=tm({point:function(n,t){this.stream.point(n*qn,t*qn)}});function XI(n){return BI(function(){return n})()}function BI(n){var t,e=150,r=480,i=250,s,o,a=0,u=0,l=0,c=0,h=0,f,d,v=null,_=Zv,E=null,P,y,w,m=Qv,S=.5,C=nm(N,S),I,b;function x(U){return U=d(U[0]*qn,U[1]*qn),[U[0]*e+s,o-U[1]*e]}function A(U){return U=d.invert((U[0]-s)/e,(o-U[1])/e),U&&[U[0]*Ys,U[1]*Ys]}function N(U,$){return U=t(U,$),[U[0]*e+s,o-U[1]*e]}x.stream=function(U){return I&&b===U?I:I=HI(_(f,C(m(b=U))))},x.clipAngle=function(U){return arguments.length?(_=+U?VI(v=U*qn,6*qn):(v=null,Zv),L()):v*Ys},x.clipExtent=function(U){return arguments.length?(m=U==null?(E=P=y=w=null,Qv):AI(E=+U[0][0],P=+U[0][1],y=+U[1][0],w=+U[1][1]),L()):E==null?null:[[E,P],[y,w]]},x.scale=function(U){return arguments.length?(e=+U,T()):e},x.translate=function(U){return arguments.length?(r=+U[0],i=+U[1],T()):[r,i]},x.center=function(U){return arguments.length?(a=U[0]%360*qn,u=U[1]%360*qn,T()):[a*Ys,u*Ys]},x.rotate=function(U){return arguments.length?(l=U[0]%360*qn,c=U[1]%360*qn,h=U.length>2?U[2]%360*qn:0,T()):[l*Ys,c*Ys,h*Ys]},x.precision=function(U){return arguments.length?(C=nm(N,S=U*U),L()):za(S)},x.fitExtent=function(U,$){return em(x,U,$)},x.fitSize=function(U,$){return UI(x,U,$)};function T(){d=Uv(f=MI(l,c,h),t);var U=t(a,u);return s=r-U[0]*e,o=i+U[1]*e,L()}function L(){return I=b=null,x}return function(){return t=n.apply(this,arguments),x.invert=t.invert&&A,T()}}function im(n){return function(t,e){var r=be(t),i=be(e),s=n(r*i);return[s*i*Ne(t),s*Ne(e)]}}function sm(n){return function(t,e){var r=za(t*t+e*e),i=n(r),s=Ne(i),o=be(i);return[Ua(t*s,r*o),Ao(r&&e*s/r)]}}var YI=im(function(n){return za(2/(1+n))});YI.invert=sm(function(n){return 2*Ao(n/2)});var om=im(function(n){return(n=Fv(n))&&n/Ne(n)});om.invert=sm(function(n){return n});function JI(){return XI(om).scale(79.4188).clipAngle(179.999)}function am(n,t){return[n,t]}am.invert=am;function jI(n,t,e){e=e||{};var r=e.units||"kilometers",i=e.steps||8;if(!n)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 s=[];switch(n.type){case"GeometryCollection":return fh(n,function(o){var a=jh(o,t,r,i);a&&s.push(a)}),on(s);case"FeatureCollection":return ga(n,function(o){var a=jh(o,t,r,i);a&&ga(a,function(u){u&&s.push(u)})}),on(s)}return jh(n,t,r,i)}function jh(n,t,e,r){var i=n.properties||{},s=n.type==="Feature"?n.geometry:n;if(s.type==="GeometryCollection"){var o=[];return fh(n,function(_){var E=jh(_,t,e,r);E&&o.push(E)}),on(o)}var a=QI(s),u={type:s.type,coordinates:lm(s.coordinates,a)},l=new Lf,c=l.read(u),h=nf(sf(t,e),"meters"),f=Ge.bufferOp(c,h,r),d=new gv;if(f=d.write(f),!um(f.coordinates)){var v={type:f.type,coordinates:hm(f.coordinates,a)};return Sn(v,i)}}function um(n){return Array.isArray(n[0])?um(n[0]):isNaN(n[0])}function lm(n,t){return typeof n[0]!="object"?t(n):n.map(function(e){return lm(e,t)})}function hm(n,t){return typeof n[0]!="object"?t.invert(n):n.map(function(e){return hm(e,t)})}function QI(n){var t=_0(n).geometry.coordinates,e=[-t[0],-t[1]];return JI().rotate(e).scale(ar)}function $I(n,t,e){e===void 0&&(e={});var r=yr(n),i=yr(t),s=If.union(r.coordinates,i.coordinates);return s.length===0?null:s.length===1?ie(s[0],e.properties):rf(s,e.properties)}function bl(n,t,e){e===void 0&&(e={});var r=yr(n),i=yr(t),s=If.intersection(r.coordinates,i.coordinates);return s.length===0?null:s.length===1?ie(s[0],e.properties):rf(s,e.properties)}function KI(n,t,e){e===void 0&&(e={});var r=JSON.stringify(e.properties||{}),i=n[0],s=n[1],o=n[2],a=n[3],u=(s+a)/2,l=(i+o)/2,c=t*2/He([i,u],[o,u],e),h=c*(o-i),f=t*2/He([l,s],[l,a],e),d=f*(a-s),v=h/2,_=v*2,E=Math.sqrt(3)/2*d,P=o-i,y=a-s,w=3/4*_,m=E,S=(P-_)/(_-v/2),C=Math.floor(S),I=(C*w-v/2-P)/2-v/2+w/2,b=Math.floor((y-E)/E),x=(y-b*E)/2,A=b*E-y>E/2;A&&(x-=E/4);for(var N=[],T=[],L=0;L<6;L++){var U=2*Math.PI/6*L;N.push(Math.cos(U)),T.push(Math.sin(U))}for(var $=[],Y=0;Y<=C;Y++)for(var Z=0;Z<=b;Z++){var G=Y%2===1;if(!(Z===0&&G)&&!(Z===0&&A)){var W=Y*w+i-I,k=Z*m+s+x;if(G&&(k-=E/2),e.triangles===!0)t2([W,k],h/2,d/2,JSON.parse(r),N,T).forEach(function(O){e.mask?bl(e.mask,O)&&$.push(O):$.push(O)});else{var V=ZI([W,k],h/2,d/2,JSON.parse(r),N,T);e.mask?bl(e.mask,V)&&$.push(V):$.push(V)}}}return on($)}function ZI(n,t,e,r,i,s){for(var o=[],a=0;a<6;a++){var u=n[0]+t*i[a],l=n[1]+e*s[a];o.push([u,l])}return o.push(o[0].slice()),ie([o],r)}function t2(n,t,e,r,i,s){for(var o=[],a=0;a<6;a++){var u=[];u.push(n),u.push([n[0]+t*i[a],n[1]+e*s[a]]),u.push([n[0]+t*i[(a+1)%6],n[1]+e*s[(a+1)%6]]),u.push(n),o.push(ie([u],r))}return o}function e2(n,t,e,r){r===void 0&&(r={});for(var i=[],s=n[0],o=n[1],a=n[2],u=n[3],l=t/He([s,o],[a,o],r),c=l*(a-s),h=e/He([s,o],[s,u],r),f=h*(u-o),d=a-s,v=u-o,_=Math.floor(d/c),E=Math.floor(v/f),P=(d-_*c)/2,y=(v-E*f)/2,w=s+P,m=0;m<_;m++){for(var S=o+y,C=0;C<E;C++){var I=ie([[[w,S],[w,S+f],[w+c,S+f],[w+c,S],[w,S]]],r.properties);r.mask?RP(r.mask,I)&&i.push(I):i.push(I),S+=f}w+=c}return on(i)}function r2(n,t,e){return e===void 0&&(e={}),e2(n,t,t,e)}function n2(n,t,e){e===void 0&&(e={});for(var r=[],i=t/He([n[0],n[1]],[n[2],n[1]],e),s=i*(n[2]-n[0]),o=t/He([n[0],n[1]],[n[0],n[3]],e),a=o*(n[3]-n[1]),u=0,l=n[0];l<=n[2];){for(var c=0,h=n[1];h<=n[3];){var f=null,d=null;u%2===0&&c%2===0?(f=ie([[[l,h],[l,h+a],[l+s,h],[l,h]]],e.properties),d=ie([[[l,h+a],[l+s,h+a],[l+s,h],[l,h+a]]],e.properties)):u%2===0&&c%2===1?(f=ie([[[l,h],[l+s,h+a],[l+s,h],[l,h]]],e.properties),d=ie([[[l,h],[l,h+a],[l+s,h+a],[l,h]]],e.properties)):c%2===0&&u%2===1?(f=ie([[[l,h],[l,h+a],[l+s,h+a],[l,h]]],e.properties),d=ie([[[l,h],[l+s,h+a],[l+s,h],[l,h]]],e.properties)):c%2===1&&u%2===1&&(f=ie([[[l,h],[l,h+a],[l+s,h],[l,h]]],e.properties),d=ie([[[l,h+a],[l+s,h+a],[l+s,h],[l,h+a]]],e.properties)),e.mask?(bl(e.mask,f)&&r.push(f),bl(e.mask,d)&&r.push(d)):(r.push(f),r.push(d)),h+=a,c++}u++,l+=s}return on(r)}function i2(n,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var r=e.gridType,i=e.property,s=e.weight;if(!n)throw new Error("points is required");if(IC(n,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");i=i||"elevation",r=r||"square",s=s||1;var o=Cn(n),a;switch(r){case"point":case"points":a=gP(o,t,e);break;case"square":case"squares":a=r2(o,t,e);break;case"hex":case"hexes":a=KI(o,t,e);break;case"triangle":case"triangles":a=n2(o,t,e);break;default:throw new Error("invalid gridType")}var u=[];return ga(a,function(l){var c=0,h=0;ga(n,function(d){var v=r==="point"?l:hf(l),_=He(v,d,e),E;if(i!==void 0&&(E=d.properties[i]),E===void 0&&(E=d.geometry.coordinates[2]),E===void 0)throw new Error("zValue is missing");_===0&&(c=E);var P=1/Math.pow(_,s);h+=P,c+=P*E});var f=zC(l);f.properties[i]=c/h,u.push(f)}),on(u)}function s2(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1])&&n.push(n[0]);const e=Kt(t),r=ie([n]);return Qe(e,r)}function o2(n,t){const e=Yr(n);return gf(e,t,{units:"meters"}).geometry.coordinates}function $f(n){if((n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),n.length<=3)return 0;const t=ie([n]);return nP(t)}function a2(n){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]);const t=ie([n]),r=w0(t).geometry.coordinates;return[r[0],r[1],r[2]??n[0][2]??0]}function cm(n,t,e,r){const[i,s,o]=n,a=pa(Kt([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function Qh(n,t){return He(Kt(n),Kt(t),{units:"meters"})}function Nl(n,t){return Zu(Kt(n),Kt(t))}function u2(n,t){return tl(Yr(n),Yr(t))}function l2(n,t){const e=Kt(n),r=Kt(t),i=XC(e,r),s=(n[2]+t[2])/2;return[...i.geometry.coordinates,s]}function h2(n,t){const e=Kt(t),r=Yr(n);return ZC(r,e,{units:"meters"})}function c2(n,t){const e=Kt(n),r=Yr(t);return eP(e,r,{units:"meters"})}function f2(n,t,e,r){const[i,s,o]=n,a=yP(Kt([i,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function fm(n,t){return x0(Kt(n),Kt(t),{units:"meters"})}function d2(n,t){return mP(Kt(n),Kt(t))}function dm(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=bl(ie([n]),ie([t]));if(e)return e.geometry.coordinates}function gm(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=$I(ie([n]),ie([t]));if(e)return e.geometry.coordinates}function pm(n,t=500,e="meters"){const r=jI(Yr(n),t,{units:e});if(r)return r.geometry.coordinates}function vm(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=oI(ie([n]),ie([t]));if(e)return e.geometry.coordinates}function mm(n,t,e=10,r="meters"){return WC(n,t,{steps:e,units:r}).geometry.coordinates}function Kf(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||t[0][2]!==t[t.length-1][2])&&t.push(t[0]);const e=ie([n]),r=ie([t]);return MP(e,r)?"oneBig":R0(e,r)?"twoBig":!1}function ym(n){const t=p.min(p.objsIterator(n,["0"])),e=p.min(p.objsIterator(n,["1"])),r=p.min(p.objsIterator(n,["2"])),i=p.max(p.objsIterator(n,["0"])),s=p.max(p.objsIterator(n,["1"])),o=p.max(p.objsIterator(n,["2"]));return{minPos:[t,e,r],maxPos:[i,s,o],center:[(t+i)*.5,(e+s)*.5,(r+o)*.5]}}function _m(n){const{minPos:t,maxPos:e,center:r}=ym(n);if(t.some(a=>!Number.isFinite(a)||e.some(u=>!Number.isFinite(u))||r.some(u=>!Number.isFinite(u)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=Qh(t,e);let s=i*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(i*i+o*o)*.5),{center:r,radius:s}}function wm(n,t){const e=bi(n),r=bi(t);return p.Vector.distance(e,r)}function xl(n,t){const e=[],r=n.length;let i=0;for(let s=0;s<r-1;++s){if(t===void 0||t==="GEODESIC"){const o=Qh(n[s],n[s+1]),a=Math.abs(n[s][2]-n[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="RHUMB"){const o=fm(n[s],n[s+1]),a=Math.abs(n[s][2]-n[s+1][2]);if(a===0)i+=o;else{const u=Math.sqrt(o*o+a*a);i+=u}}else if(t==="NONE"){const o=wm(n[s],n[s+1]);i+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(i)}return e}function Zf(n){const t="__getXyzFromPostion";let e=p.getExtProp(n,t);return(!e||!p.Vector.equals(e[0],n))&&(e=[[...n],bi(n)],p.setExtProp(n,t,e)),e[1]}class Em extends p.Tree{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class td extends p.TreeItem{constructor(t,e,r){super(t,e),this._property=r}get property(){return this._property}}class ed extends td{constructor(t,e){super(t,!1,e)}}class rd extends td{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function Sm(n,t){const e=new Em(t),r=n.getProperties("chinese"),i=[];for(let s of r)if(s instanceof vt){const o=new rd(e,s);o.d(()=>s.destroy()),e.children.push(o),i.push(o)}else{const o=new ed(e,s);e.children.push(o),o.d(()=>s.destroy())}for(;i.length>0;){const s=i.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof vt))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof vt){const u=new rd(e,a);u.d(()=>a.destroy()),o.groupChildren.push(u),i.push(u)}else{const u=new ed(e,a);o.groupChildren.push(u),u.d(()=>a.destroy())}}return e.d(()=>{e.itemChildrenChanged.reset(),e.itemChildrenToChange.reset();const s=[...e.getDescendants()];s.forEach(o=>{o.children&&(o.children.length=0),o.destroy()}),s.length=0}),e}class Ha extends st{constructor(e){super();g(this,"_propTreeReact",this.dv(p.react(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new p.ObjResettingWithEvent(this.sceneObjectChanged,r=>{if(!r)return;const i=new st;return i.d(r.toDestroyEvent.don(()=>{this.sceneObject=void 0})),i})),this.d(this.sceneObjectChanged.don(r=>{this._propTreeReact.value=void 0,!(!r||!(r instanceof ft))&&(this._propTreeReact.value=Sm(r,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(n=>{n.createDefaultProps=()=>({sceneObject:void 0})})(Ha||(Ha={})),p.extendClassProps(Ha.prototype,Ha.createDefaultProps);function nd(n){return p.reactDeepArrayWithUndefined(n,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function Cm(n,t){const e=new Array;for(let r of n)e.push(t(r));return e}function id(n,t){return n===void 0&&t===void 0?!0:!n||!t?!1:n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]}function g2(n,t,e){var i;((i=t.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(t))?e.call(n):(n.dispose(t.viewerAttached.don(()=>{e.call(n)})),n.dispose(t.createdEvent.don(()=>e.call(n))))}function p2(n,t,e,r=!0){r&&e(),n.dispose(t.disposableOn(e))}function v2(n,t){const{type:e,id:r}=n;if(e){const i=ft.create(e,r);if(i)return i.json=n,i;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function Pm(n){const t=n.children&&p.every(n.children,r=>{if(!(r instanceof Ir))throw new Error("!(treeItem instanceof SceneTreeItem)");return!r.show})||!1,e=n.sceneTree.getSceneObjectShowFunc(n.sceneObject);return!t||e}class Ir extends p.TreeItem{constructor(e,r=!1,i,s,o=!0){super(e,r,i);g(this,"_dragDrop");g(this,"_showChangedNotAffectChildren",!1);g(this,"_showChangedNotAffectParent",!1);g(this,"_type",this.dv(p.react("Unknown")));g(this,"_isExport",this.dv(p.react(!0)));const a=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(a)),this.name=`未命名条目(${this.id})`,this.extras=s,this._isExport.value=o;let u;const l=()=>{u&&(u(),u=void 0)};this.dispose(l),this.dispose(this.sceneObjectChanged.disposableOn(c=>{l(),c&&(u=p.bind([this,"name"],[c,"name"]))})),this.dispose(this.showChanged.disposableOn(c=>{if(e.setSceneObjectShowFunc(this.sceneObject,c),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let h of this.children)h instanceof Ir&&(h._showChangedNotAffectParent=!0,h.show=c,h._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Ir&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=Pm(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new p.ObjResettingWithEvent(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new st;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof H){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.showChanged.disposableOn(h))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof H){const h=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};h(),c.dispose(this.sceneObject.enabledChanged.disposableOn(h))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=Pm(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let h="Unknown";this.sceneObject?h=this.sceneObject.typeName:this.children&&(h="Folder"),this._type.value=h};this.dispose(this.sceneObjectChanged.disposableOn(c)),this.dispose(this.childrenResetedEvent.disposableOn(c)),c()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(r){console.error(`sceneTreeItem.jsonStr error ${r}`,r)}}get json(){const e=this.children&&[...this.children].filter(r=>r.isExport).map(r=>r.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let r of e.children){const i=new Ir(this.tree,!0);i.json=r,this.children.push(i)}}}clone(){try{const e=new Ir(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,r){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(r&&r.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return r&&this.children.push(r),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",r);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",r);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,r)}}(n=>{n.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:p.reactJsonWithUndefined(void 0)})})(Ir||(Ir={})),p.extendClassProps(Ir.prototype,Ir.createDefaultProps);function Im(n,t,e){let{offsetY:r}=t;if(!t.target||!("clientTop"in t.target))return"none";r+=2,r+=t.target.clientTop;let i="none";return n.children?r<=e*.3?i="before":r>=e*.7?!n.uiTreeObject.collapsed&&n.children.length>0?i="inner":i="after":i="inner":r<=e*.5?i="before":i="after",i}class Mm extends np{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let r="none";const i=this.disposeVar(p.createTimeoutWithStartValues(()=>{this._treeItem.uiTreeObject.moveToPositionMode=r,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${r});`)},200));function s(o){r!==o&&(r=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const a=e;if(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0){const u=a.data.value,l=this._treeItem,{tree:c}=l;if(c){const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=Im(l,o,c.itemDivHeight);if(f!=="none"&&p.Tree.canMoveToTreeItems(h,l,f)){o.dataTransfer.dropEffect="move",s(f);return}}}o.dataTransfer.dropEffect="none",s("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const a=e;if(!(a.data&&a.data.type==="UITreeA"&&a.data.value!==void 0))return;const u=a.data.value,l=this._treeItem,{tree:c}=l;if(!c)return;const h=[...c.selectedItems];~h.indexOf(u)||h.push(u);const f=Im(l,o,c.itemDivHeight);f!=="none"&&p.Tree.canMoveToTreeItems(h,l,f)&&(p.Tree.moveToTreeItems(h,l,f),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{r="none",i.restart()}))}}function m2(n){if(!(n instanceof Ir))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new Mm(n)}function y2(n){let t=!1;return n&&("show"in n?t=n.show??!0:"enabled"in n&&(t=n.enabled??!0)),t}function _2(n,t){n&&("show"in n?n.show=t:"enabled"in n&&(n.enabled=t))}const w2=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function E2(n){const t=[],{root:e={}}=n,r=[e];for(;r.length>0;){const i=r.pop();if(!i)throw new Error("!todo");if(i.children){for(let s of i.children)if(s.children&&r.unshift(s),s.sceneObj){const{type:o=void 0}=s.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(s.sceneObj)),o&&w2.includes(o)&&t.push(s.sceneObj)}}}return t}async function S2(n,t){const e=E2(n);let r=0;const i=e.length;for(let s of e)if(++r,t){const o=r/i;t(o,r,i)}}class bm extends st{constructor(e,r){super();g(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=r}get sceneTree(){return this._sceneTree}}class C2 extends st{constructor(e){super();g(this,"_jsonLoadingEvent",this.disposeVar(new H));g(this,"_setJsonProcessing",this.disposeVar(p.createProcessingFromAsyncFunc(async(e,r)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),r&&await e.promise(this._sceneTree.preloadFunc(r)),this._setJson(r),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=r=>{this._jsonLoadingEvent.emit({type:"error",error:r})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(r){console.error(`json数据装配时发生错误!error: ${r}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new p.CancelError("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function P2(n){return n.name+"_clone"}function sd(n,t,e){if(n instanceof Ir)return n.insertNewTreeItem(t,e);{const r={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return n.insertNewTreeItem(r[t],e)}}function I2(n){[n,...n.getDescendants()].forEach(t=>t.destroy())}const rn=class rn extends p.Tree{constructor(e,r,i,s){super(i);g(this,"_jsonLoading",this.disposeVar(new C2(this)));g(this,"createSceneObjectFunc",rn.defaultCreateSceneObjectFunc);g(this,"createTreeItemDragDropFunc",rn.defaultCreateTreeItemDragDropFunc);g(this,"preloadFunc",rn.defaultPreload);g(this,"getSceneObjectShowFunc",rn.defaultGetSceneObjectShow);g(this,"setSceneObjectShowFunc",rn.defaultSetSceneObjectShow);g(this,"getSceneTreeItemCloneNameFunc",rn.defaultGetSceneTreeItemCloneNameFunc);g(this,"debug",!1);g(this,"_contextMenu",this.disposeVar(new bm(this,this.projectManager)));g(this,"_showPropUiOnSelecting",this.disposeVar(p.react(!0)));this._name=e,this._dragStartDataManager=r,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,u;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((u=this.lastSelectedItem)==null?void 0:u.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let u of a){const l=u,{sceneObject:c}=l;c&&o.deleteSceneObject(c)&&c.destroy()&&$l(c,void 0);for(let h of l.getDescendants()){const{sceneObject:f}=h;f&&o.deleteSceneObject(f)&&f.destroy()&&$l(f,void 0)}I2(u)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let u of a){const l=u;l.sceneObject&&o.addSceneObject(l.sceneObject)&&$l(l.sceneObject,l)}})),this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{if(!this.showPropUiOnSelecting)return;this._projectManager.propUiTreeManager.sceneObject=void 0;const{lastSelectedItem:a}=this;a&&(this._projectManager.propUiTreeManager.sceneObject=a.sceneObject)}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const r=this.getDescendants();let i;for(let s of r)if(s.sceneObject&&s.sceneObject.id===e){i=s;break}return i}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var i;e.root=e.root||{};const r=e.root.children??[];this.root.resetChildren(!0);for(let s of r){const o=new Ir(this,!0);o.json=s,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(e,r){const i=e||this.lastSelectedItem||this.root;return i?sd(i,r):!1}addNewTreeItem(e,r,i,s){const o=e||this.lastSelectedItem||this.root;if(o&&sd(o,r)){const a=new Ir(this,i);if(a.sceneObject=s,!sd(o,r,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,r,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=ft.create(e,r);return a?this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,r,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const a=this.addNewTreeItem(i,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,r,i,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const a=ft.createFromClass(e,r);return a?this.addNewTreeItem(i,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,r,i){const s=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,s))return;const o=ft.createFromJson(e);return console.log(o),o?this.addNewTreeItem(r,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let r of e)this.destroySceneObjectTreeItem(r)}};g(rn,"defaultCreateSceneObjectFunc",v2),g(rn,"defaultCreateTreeItemDragDropFunc",m2),g(rn,"defaultPreload",S2),g(rn,"defaultGetSceneObjectShow",y2),g(rn,"defaultSetSceneObjectShow",_2),g(rn,"defaultGetSceneTreeItemCloneNameFunc",P2);let Tl=rn;const od={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class M2 extends st{constructor(e){super();g(this,"_currentPosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));g(this,"_currentRotation",this.disposeVar(p.reactArrayWithUndefined(void 0)));g(this,"_currentHeading",this.disposeVar(p.react(void 0)));g(this,"_isRotating",this.disposeVar(p.react(!1)));g(this,"_isGround",this.disposeVar(p.react(!1)));g(this,"_startPosition",[0,0,0]);g(this,"_startRotation",[0,0,0]);g(this,"_processing",this.disposeVar(p.createProcessingFromAsyncFunc(async(e,r,i,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=r,this._currentRotation.value=i;return}const u=this._startPosition;u.splice(0,3,...o);const l=this._startRotation;l.splice(0,3,...a);let c=Date.now();const h=Nl(u,r);this._currentHeading.value=h;const d=Qh(u,r)/s,v=[i[0]-l[0],i[1]-l[1],i[2]-l[2]],_=r[2]-u[2];await e.promise(new Promise(E=>{e.disposer.dispose(p.animateFrame(async()=>{let P=Date.now()-c;P=P<0?0:P,P=P>s?s:P;const y=P*d,w=cm(u,y,h);if(this.isGround&&w){const m=await this._esviewer.getTerrainHeight([w[0],w[1]]);this._currentPosition.value=[w[0],w[1],m??0]}else w&&(w[2]+=_*(P/s)),this._currentPosition.value=w;if(this.isRotating){const[m,S,C]=v,I=P/s;this._currentRotation.value=[l[0]+m*I,l[1]+S*I,l[2]+C*I]}P===s&&(this._currentPosition.value=r,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,E())}))}))})));this._esviewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,r,i){this._processing.restart(void 0,e,r,i)}cancel(){this._processing.cancel()}}function Nm(n){let t=0;function e(r,i){i++,t=Math.max(i,t),r.forEach(s=>{Array.isArray(s)&&e(s,i)})}return e(n,0),t}const qi=class qi extends ee{constructor(e){super(e);g(this,"editingBindMode","lineString");g(this,"_area",this.dv(p.react(0)));g(this,"_perimeter",this.dv(p.react(0)));const r=()=>{this._updateArea(),this._updatePerimeter()};r(),this.d(this.pointsChanged.don(r))}updateEditing(){var r;const e=[];this.editingBindMode=="doublePoints"?e.push(ct.DoublePointsAppend,ct.DoublePointsModify):this.editingBindMode=="lineString"?e.push(ct.LineStringAppend,ct.LineStringInsert,ct.Translation):this.editingBindMode=="circular"?(e.push(ct.CircularAppend,ct.CircularInsert,ct.Translation),this.supportEditingModes().includes(ct.HeightModify)&&e.push(ct.HeightModify)):this.editingBindMode=="visibility"?e.push(ct.VisibilityAppend,ct.VisibilityModify):this.editingBindMode=="scatter"&&e.push(ct.ScatterAppend,ct.ScatterModify),(r=this.activeViewer)==null||r.startEditing(this,e,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return $f([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=xl(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],r=xl(e,"GEODESIC");return r[r.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const r=dm(this.points,e);if(!r)return;const i=r[0][0][0];if(Array.isArray(i)){const s=[...r],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...r][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const r=gm(this.points,e);if(!r)return;const i=r[0][0][0];if(Array.isArray(i)){const s=[...r],o=[];return s.forEach(a=>{const u=a[0].map(l=>[...l,0]);o.push(u)}),o}else return[[...r][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let r=[...e];const i=e[0],s=e[e.length-1];i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||r.push(i);const o=vm([...this.points,this.points[0]],[...r]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(Nm(a)===3){const u=a.map(f=>f.map(d=>[...d,0]));if(u.length<=1)return{status:"notIncluded",positions:u};const l=u[0],c=u[1];return Kf([...l],[...c])==="oneBig"?{status:"included",positions:u}:{status:"notIncluded",positions:u}}else if(Nm(a)===4){const l=[...a.map(h=>h.map(f=>f.map(d=>[...d,0])))],c=[];return l.forEach(h=>{c.push(h[0])}),{status:"notIncluded",positions:c}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,r){if(this.points&&this.points.length>=2){const i=pm(this.points,e,r);return i?[i[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const r=Kf(this.points,e);return r==="oneBig"?!0:r==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new tt([this,"editing"],"编辑",!1),new ht([this,"points"],"位置数组",qi.defaults.points,void 0,!0)],style:[...e.style,new vt([],"点样式"),new tt([this,"pointed"],"开启",!1),new R([this,"pointSize"],"点大小",1),new Tt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Gt([this,"pointColor"],"点颜色",[1,1,1,1]),new Gt([this,"pointOutlineColor"],"轮廓颜色",qi.defaults.pointStyle.outlineColor),new R([this,"pointOutlineWidth"],"轮廓宽度",qi.defaults.pointStyle.outlineWidth),new vt([],"线样式"),new tt([this,"stroked"],"开启线样式",!0),new tt([this,"strokeGround"],"贴地",!1),new R([this,"strokeWidth"],"线宽",1),new Tt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Gt([this,"strokeColor"],"线颜色",[1,1,1,1]),new vt([],"面样式"),new tt([this,"filled"],"开启",!1),new tt([this,"fillGround"],"贴地",!1),new Gt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new vt([],"点样式集合"),new Et([this,"pointMaterial"],"点材质"),new ht([this,"pointMaterialParams"],"点材质参数"),new vt([],"线样式集合"),new Et([this,"strokeMaterial"],"线材质"),new ht([this,"strokeMaterialParams"],"线材质参数"),new vt([],"面样式集合"),new Et([this,"fillMaterial"],"面材质"),new ht([this,"fillMaterialParams"],"面材质参数")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};g(qi,"createDefaultProps",()=>({...ee.createDefaultProps(),pointed:!1,pointStyle:p.reactJson({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:p.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:p.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:p.reactPositions([])})),g(qi,"type",qi.register("ESGeoVector",qi,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),g(qi,"supportEditingModes",[...ee.supportEditingModes,ct.Translation]);let Rt=qi;const Lo=class Lo extends ee{constructor(){super(...arguments);g(this,"_statusDis",this.dv(p.react(!0)));g(this,"_smoothMoveEvent",this.dv(new H));g(this,"_smoothMoveWithRotationEvent",this.dv(new H));g(this,"_smoothMoveOnGroundEvent",this.dv(new H));g(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new H));g(this,"_automaticLandingEvent",this.dv(new H));g(this,"_smoothMoveKeepPitchEvent",this.dv(new H));g(this,"_smoothMoveRelativelyEvent",this.dv(new H));g(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new H));g(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var r;const e=[];this.editingBindMode=="singlePoint"?(e.push(ct.Place,ct.Translation),["ESLocationMeasurement"].includes(this.typeName)||e.push(ct.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(ct.Scale)):this.editingBindMode=="doublePoints"&&e.push(ct.DoublePointsAppend,ct.DoublePointsModify),(r=this.activeViewer)==null||r.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,r){this._smoothMoveEvent.emit(e,r)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,r,i){this._smoothMoveWithRotationEvent.emit(e,r,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,r,i,s){this._smoothMoveOnGroundEvent.emit(e,r,i,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,r,i,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,r,i,s,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,r){this._smoothMoveKeepPitchEvent.emit(e,r)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,r){this._smoothMoveRelativelyEvent.emit(e,r)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,r,i){this._smoothMoveRelativelyWithRotationEvent.emit(e,r,i)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",location:[...e.location,new tt([this,"editing"],"是否编辑"),new mt([],()=>this.automaticLanding(),[],"自动落地"),new ra([this,"position"],"位置数组",[0,0,0]),new Lc([this,"rotation"],"姿态数组",[0,0,0]),new pr([this,"scale"],"缩放",[1,1,1]),new R([this,"minVisibleDistance"],"最小可见距离",0),new R([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...e.more,new mt(["numbers","number"],(r,i)=>this.smoothMove(r,i),[[0,0,0],0],"平滑移动","smoothMove"),new mt(["numbers","number"],(r,i)=>this.smoothMoveKeepPitch(r,i),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new mt(["numbers","numbers","number"],(r,i,s)=>this.smoothMoveWithRotation(r,i,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new mt(["number","number","number","string"],(r,i,s,o)=>this.smoothMoveOnGround(r,i,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new mt(["numbers","number","number","number","string"],(r,i,s,o,a)=>this.smoothMoveWithRotationOnGround(r,i,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new mt(["numbers","number"],(r,i)=>this.smoothMoveRelatively(r,i),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new mt(["numbers","numbers","number"],(r,i,s)=>this.smoothMoveRelativelyWithRotation(r,i,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new tt([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};g(Lo,"createDefaultProps",()=>({...ee.createDefaultProps(),pointed:!1,pointStyle:p.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:p.reactArray([0,0,0]),rotation:p.reactArray([0,0,0]),scale:p.reactArray([1,1,1]),minVisibleDistance:p.react(0),maxVisibleDistance:p.react(0)})),g(Lo,"type",Lo.register("ESObjectWithLocation",Lo,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),g(Lo,"supportEditingModes",[...ee.supportEditingModes,ct.Place,ct.Translation,ct.Rotation,ct.Scale,ct.DoublePointsAppend,ct.DoublePointsModify]);let dt=Lo;const $a=class $a extends dt{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new vt([],"点样式集合"),new tt([this,"pointed"],"开启点样式",!1),new R([this,"pointSize"],"点大小",1),new Tt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new Gt([this,"pointColor"],"点颜色",[1,1,1,1]),new vt([],"线样式集合"),new tt([this,"stroked"],"开启线样式",!1),new tt([this,"strokeGround"],"是否贴地(线)",!1),new R([this,"strokeWidth"],"线宽",1),new Tt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new Gt([this,"strokeColor"],"线颜色",[1,1,1,1]),new vt([],"面样式集合"),new tt([this,"filled"],"开启填充样式",!1),new tt([this,"fillGround"],"是否贴地",!1),new Gt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new vt([],"点样式"),new Et([this,"pointMaterial"],"点材质",""),new ht([this,"pointMaterialParams"],"点材质参数",{}),new vt([],"线样式"),new Et([this,"strokeMaterial"],"线材质",""),new ht([this,"strokeMaterialParams"],"线材质参数",{}),new vt([],"填充样式"),new Et([this,"fillMaterial"],"面材质",""),new ht([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};g($a,"createDefaultProps",()=>({...dt.createDefaultProps(),pointed:!1,pointStyle:p.reactJson({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:p.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:p.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g($a,"type",$a.register("ESLocalVector",$a,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Xa=$a;const kl=class kl extends Xa{};g(kl,"type",kl.register("ESLocalVector2D",kl,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let gs=kl;const b2=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],N2=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ka=class Ka extends dt{constructor(){super(...arguments);g(this,"_widgetEvent",this.dv(new H))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new tt([this,"screenRender"],"屏幕渲染",!0),new tt([this,"sizeByContent"],"尺寸自适应",!0),new We([this,"size"],"尺寸大小",[100,100]),new We([this,"anchor"],"偏移比例",[.5,1]),new We([this,"offset"],"像素偏移",[0,0]),new Tt([this,"renderMode"],N2,"渲染模式",0),new Tt([this,"rotationType"],b2,"漫游旋转类型",1),new Et([this,"actorTag"],"绑定对象"),new Et([this,"socketName"],"插槽名称"),new pr([this,"positionOffset"],"位置偏移"),new pr([this,"rotationOffset"],"相对姿态")],more:[...e.more,new R([this,"zOrder"],"排序",0)]}}};g(Ka,"createDefaultProps",()=>({...dt.createDefaultProps(),screenRender:!0,size:p.reactArray([100,100]),anchor:p.reactArray([.5,1]),offset:p.reactArray([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:p.reactArray([0,0,0]),rotationOffset:p.reactArray([0,0,0])})),g(Ka,"type",Ka.register("ESLabel",Ka,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let yn=Ka;const Za=class Za extends ft{constructor(t){super(t)}};g(Za,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,fillStyle:p.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(Za,"type",Za.register("ESTestObject",Za,{chsName:"测试",tags:["ESObjects"],description:""}));let ad=Za;const Wi=class Wi extends ee{constructor(e){super(e);g(this,"_refreshTilesetEvent",this.dv(new H));g(this,"_tilesetReadyEvent",this.dv(new H));g(this,"_supportEdit",this.dv(p.react(!0)));g(this,"_highlightFeatureEvent",this.dv(new H));g(this,"_highlightFeatureAndFlyToEvent",this.dv(new H));g(this,"_strokeFeatureEvent",this.disposeVar(new H));g(this,"_getFeatureTableEvent",this.dv(new H));g(this,"_featureTableResultEvent",this.dv(new H));g(this,"_getMaterialNameListEvent",this.disposeVar(new H));g(this,"_setFeatureStyleEvent",this.dv(new H));g(this,"_setFeatureColorEvent",this.dv(new H));g(this,"_setFeatureVisableEvent",this.dv(new H));g(this,"_resetFeatureStyleEvent",this.dv(new H));g(this,"setMaterialInfoEvent",this.ad(new H));g(this,"_setMaterialEvent",this.disposeVar(new H));g(this,"_clippingPlanesId",this.dv(p.react("")));g(this,"_clippingPlaneIds",this.dv(p.react([])));g(this,"_flattenedPlaneId",this.dv(p.react("")));g(this,"_flattenedPlaneEnabled",this.dv(p.react(!1)));g(this,"_clippingPlaneId",this.dv(p.react("")));g(this,"_excavateId",this.dv(p.reactArray([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[ct.Translation,ct.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,r){this._highlightFeatureEvent.emit(e,r)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,r,i,s){this._highlightFeatureAndFlyToEvent.emit(e,r,i,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,r=[1,0,0,1]){this._strokeFeatureEvent.emit(e,r)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const r=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{r(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const r=new st;r.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(r.destroy(),e(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{r.isDestroyed()||(r.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e){this._setFeatureStyleEvent.emit(e)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,r){this._setFeatureColorEvent.emit(e,typeof r=="string"?JSON.parse(r):r)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,r){this._setFeatureVisableEvent.emit(e,typeof r=="string"?JSON.parse(r):r)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(r=>{const i=new st;i.ad(this.setMaterialInfoEvent.donce(s=>{i.destroy(),r(s)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...od}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new je([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new Tt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new Tt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new ht([this,"materialOverrideMap"],"材质替换",Wi.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new ht([this,"url"],"服务地址",Wi.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new tt([this,"editing"],"编辑",!1,!0),new pr([this,"offset"],"偏移",[0,0,0],!0),new Lc([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new ht([this,"materialParams"],"materialParams",Wi.defaults.materialParams),new mt(["string","string"],(r,i)=>this.highlightFeature(r,i),["","rgba(255,0,0,1)"],"highlightFeature"),new mt(["string","string"],(r,i)=>this.setFeatureColor(r,i),["",""],"setFeatureColor"),new mt(["string","string"],(r,i)=>this.setFeatureVisable(r,i),["",""],"setFeatureVisable"),new mt([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new vt([],"ue"),new mt([],()=>this.refreshTileset(),[],"refreshTileset"),new Et([this,"actorTag"]),new tt([this,"highlight"],"是否高亮"),new Gt([this,"highlightColor"]),new R([this,"highlightID"]),new vt([],"czm"),new vt([],"可视化"),new We([this,"czmImageBasedLightingFactor"],"反射强度"),new R([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new ht([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new R([this,"czmMaximumMemoryUsage"],"最大内存"),new vt([],"常用"),new Tt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new ht([this,"czmStyleJson"],"czmStyle"),new tt([this,"czmBackFaceCulling"]),new tt([this,"czmSkipLevelOfDetail"]),new R([this,"cacheBytes"],"最大缓存",536870912),new vt([],"调试信息"),new tt([this,"czmDebugShowBoundingVolume"]),new tt([this,"czmDebugShowContentBoundingVolume"]),new vt([],"clippingPlanes"),new tt([this,"clippingPlaneEnabled"]),new tt([this,"unionClippingRegions"]),new Gt([this,"clippingPlaneEdgeColor"]),new R([this,"clippingPlaneEdgeWidth"])]}}};g(Wi,"createDefaultProps",()=>({...ee.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:p.reactArray([1,0,0,1]),offset:p.reactArrayWithUndefined([0,0,0]),rotation:p.reactArray([0,0,0]),czmImageBasedLightingFactor:p.reactArray([1,1]),czmEnvironmentMapManager:p.reactJsonWithUndefined(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:p.reactJson({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:p.reactArray([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:p.reactJsonWithUndefined({}),featureIdLabel:0,splitDirection:"NONE"})),g(Wi,"type",Wi.register("ES3DTileset",Wi,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),g(Wi,"supportEditingModes",[...ee.supportEditingModes,ct.Translation,ct.Rotation]);let Wn=Wi;const tu=class tu extends dt{constructor(e){super(e);g(this,"_isFlyInCreated",this.dv(p.react(!1)));g(this,"_readyEvent",this.dv(new H));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(ea([this.positionChanged,this.editingChanged],()=>{this.editing||!this.position||this.isFlyInCreated&&this.flyTo()},{time:"donce"}));else{if(!this.isFlyInCreated)return;this.flyTo()}},1e3)}))}get isFlyInCreated(){return this._isFlyInCreated.value}set isFlyInCreated(e){this._isFlyInCreated.value=e}get isFlyInCreatedChanged(){return this._isFlyInCreated.changed}get readyEvent(){return this._readyEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Tt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new R([this,"radius"],"半径",10)]}}};g(tu,"createDefaultProps",()=>({...dt.createDefaultProps(),mode:"cylinder",radius:10})),g(tu,"type",tu.register("ESAlarm",tu,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let ud=tu;const Ro=class Ro extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new R([this,"radius"],"半径",1),new Tt([this,"mode"],[["扫描","scan"],["扩散","diffuse"]],"模式",Ro.defaults.mode)]}}};g(Ro,"createDefaultProps",()=>({...dt.createDefaultProps(),radius:1,mode:"scan",collision:!1})),g(Ro,"type",Ro.register("ESApertureEffect",Ro,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let ld=Ro;const Fo=class Fo extends Rt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)]}}};g(Fo,"createDefaultProps",()=>({...Rt.createDefaultProps(),fillStyle:p.reactJson({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:p.reactJson({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),g(Fo,"type",Fo.register("ESGeoPolygon",Fo,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),g(Fo,"supportEditingModes",[...Rt.supportEditingModes,ct.CircularAppend,ct.CircularInsert]);let oe=Fo;const vs=class vs extends oe{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:vs.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??vs.defaults.fillStyle,materialParams:t??vs.defaults.fillStyle.materialParams}}constructor(t){super(t)}};g(vs,"createDefaultProps",()=>({...oe.createDefaultProps(),stroked:!0,filled:!0,units:p.reactArray(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:p.reactJson({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:p.reactJson({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),g(vs,"type",vs.register("ESAreaMeasurement",vs,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let hd=vs;const eu=class eu extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new vt([],"czm"),new Au([this,"image"],"图片"),new pr([this,"translation"],"偏移")]}}};g(eu,"createDefaultProps",()=>({...dt.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:p.reactArray([0,0,0])})),g(eu,"type",eu.register("ESBlastParticleSystem",eu,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let cd=eu;const mi=class mi extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new tt([this,"reverse"],"反转",mi.defaults.reverse),new pr([this,"size"],"尺寸",mi.defaults.size),new Gt([this,"edgeColor"],"边框颜色",mi.defaults.edgeColor),new R([this,"edgeWidth"],"边框宽度",mi.defaults.edgeWidth),new Et([this,"targetID"],"瓦片图层",mi.defaults.targetID)]}}};g(mi,"createDefaultProps",()=>({...dt.createDefaultProps(),reverse:!1,edgeColor:p.reactArray([1,1,1,1]),edgeWidth:2,size:p.reactArray([10,10,10]),targetID:""})),g(mi,"type",mi.register("ESBoxClipping",mi,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let fd=mi;const Vl=class Vl extends dt{constructor(){super(...arguments);g(this,"_thumbnail",this.dv(p.react("")));g(this,"_duration",this.dv(p.react(1)));g(this,"_resetWithCurrentCameraEvent",this.dv(new H));g(this,"_captureEvent",this.dv(new H))}get thumbnail(){return this._thumbnail.value}set thumbnail(e){this._thumbnail.value=e}get thumbnailChanged(){return this._thumbnail.changed}get duration(){return this._duration.value}set duration(e){this._duration.value=e}get durationChanged(){return this._duration.changed}flyIn(e=1,r="default"){this.flyInEvent.emit(e,-1,r)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,r){this._captureEvent.emit(e,r)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new vt([],"ESCameraView"),new mt([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new mt(["number","number"],(r,i)=>this.capture(r,i),[64,64],"获取缩略图"),new Et([this,"thumbnail"],"缩略图","",!0),new R([this,"duration"],"飞行时间",1,!0)]}}};g(Vl,"type",Vl.register("ESCameraView",Vl,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let $h=Vl;class Kh extends st{constructor(e,r,i){super();g(this,"_view",this.dv(new $h));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(i==null?void 0:i.name)??`视角${e.views.length+1}`,r){const a=this._view,u=r;a.duration=u.duration??1,a.position=u.position,a.rotation=u.rotation??[0,0,0],a.thumbnail=u.thumbnail??"",a.name=u.name}else{const a=(i==null?void 0:i.size)??[64,64];this.d(p.nextAnimateFrame(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(p.createNextAnimateFrameEvent(s.durationChanged,s.positionChanged,s.rotationChanged,s.thumbnailChanged,s.nameChanged));this.d(o.don(()=>e.emitViewsWarpper()))}get view(){return this._view}get viewInfo(){const e=this._view;return{duration:e.duration,position:e.position,rotation:e.rotation,thumbnail:e.thumbnail,name:e.name}}}const Xn=class Xn extends ft{constructor(e){super(e);g(this,"_currentViewIndex",this.dv(p.react(-1)));g(this,"_viewWrappers",this.dv(new p.ObservableArray));g(this,"_currentViewWrapper",this.dv(p.react(void 0)));g(this,"_container",this.dv(p.react(void 0)));this.initProcessing();{const r=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};r(),this.d(this._viewWrappers.changedEvent.don(r))}{const r=()=>{const i=this._currentViewWrapper.value;this._currentViewIndex.value=i?this._getIndex(i):-1};r(),this.d(this._viewWrappers.changedEvent.don(r)),this.d(this._currentViewWrapper.changed.don(r))}this.d(()=>{this.clearAllViews()})}get json(){return{...this._innerGetJson(),views:this.views}}set json(e){this._innerSetJson(e),this.views=e.views}get currentViewIndex(){return this._currentViewIndex.value}get currentViewIndexChanged(){return this._currentViewIndex.changed}emitViewsWarpper(){this._viewWrappers.changedEvent.emit(this._viewWrappers)}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}get views(){return Cm(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const r=this._viewWrappers;if(e.every((i,s)=>{const o=r.get(s).view;return i.duration===o.duration&&id(i.position,o.position)&&id(i.rotation,o.rotation)&&i.thumbnail===o.thumbnail&&i.name===o.name}))return}this.clearAllViews();for(let r of e)this._viewWrappers.push(new Kh(this,r))}_getIndex(e){return this._viewWrappers.indexOf(e)}clearAllViews(){for(let e of this._viewWrappers)e.destroy();this._viewWrappers.length=0}add(e=`视角${this.views.length+1}`,r=[64,64]){this._viewWrappers.push(new Kh(this,void 0,{name:e,size:r}))}update(e,r,i=[64,64]){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const s=this._viewWrappers.get(e);return r&&(s.view.name=r),s.view.resetWithCurrentCamera(),s.view.capture(i[0],i[1]),!0}addView(){this._viewWrappers.push(new Kh(this))}insertView(e){if(this._viewWrappers.length+1<=e||e<0){console.error("this._views.length <= index || index < 0");return}this._viewWrappers.splice(e,0,new Kh(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const r=this._viewWrappers.get(e);return this._currentViewWrapper.value=r,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const r=this._viewWrappers.get(e);r.view.resetWithCurrentCamera(),r.view.capture()}resetViewName(e,r){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(e);i.view.name=r}updateView(e,r){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(e);return i.view.position=r.position,i.view.rotation=r.rotation??[0,0,0],i.view.duration=r.duration??1,i.view.thumbnail=r.thumbnail??"",i.view.name=r.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const r=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(r,this.flyMode??Xn.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const r=this._getIndex(e);return this.loop??Xn.defaults.loop?(this.flyToView((this._viewWrappers.length+r-1)%this._viewWrappers.length),!0):r-1<0?!1:(this.flyToView(r-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const r=this._getIndex(e);if(r===0)return;const i=this._viewWrappers.splice(r-1,1,e)[0];this._viewWrappers.set(r,i)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const r=this._getIndex(e);if(r===this._viewWrappers.length-1)return;const i=this._viewWrappers.splice(r+1,1,e)[0];this._viewWrappers.set(r,i)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const r=this._getIndex(e);return this.loop??Xn.defaults.loop?(this.flyToView((r+1)%this._viewWrappers.length),!0):r+1>this._viewWrappers.length-1?!1:(this.flyToView(r+1),!0)}stop(){this._currentViewWrapper.value=void 0,this.playing=!1}deleteView(e){if(e<0||e>=this._viewWrappers.length){console.warn("index < 0 || index >= this._viewWrappers.length");return}this._viewWrappers.get(e).destroy(),this._viewWrappers.splice(e,1)}deleteCurrentView(){const e=this._currentViewWrapper.value;if(!e){console.warn("!this._currentViewWrapper.value");return}const r=this._getIndex(e);if(r===-1){console.warn("index === -1");return}this.deleteView(r)}transitionImageUrl(e){return ft.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const r=this.intervalTime??Xn.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+r)*1e3;return e.promise(p.sleep(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(p.createProcessingFromAsyncFunc(async i=>this._flyStep(i))),r=()=>{this.playing?e.restart():e.cancel()};r(),this.d(this.playingChanged.don(r))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Tt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",Xn.defaults.flyMode),new mt([],()=>this.addView(),[],"添加视角"),new mt(["number"],r=>this.insertView(r),[0],"插入视角"),new mt([],()=>this.clearAllViews(),[],"清空所有视角"),new mt([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new mt([],()=>this.flyToPrevView(),[],"上一个视角"),new mt([],()=>this.flyToNextView(),[],"下一个视角"),new mt([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new mt([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new mt(["number"],r=>this.flyToView(r),[0],"飞入指定视角"),new mt(["number"],r=>this.setCurrentView(r),[0],"设置当前视角"),new mt([],()=>this.deleteCurrentView(),[],"删除当前视角"),new mt(["number"],r=>this.deleteView(r),[0],"删除指定视角"),new mt(["number"],r=>this.resetView(r),[0],"重置视角"),new R([this,"currentViewIndex"],"当前序号",-1,!1,!0),new $g([this,"playing"],()=>this.stop(),[this,"loop"],"播放",Xn.defaults),new tt([this,"playing"],"是否播放"),new mt([],()=>this.stop(),[],"停止"),new tt([this,"loop"],"是否循环"),new R([this,"intervalTime"],"间隔时间"),new ht([this,"views"],"视角集合",[],void 0,!0)]}}};g(Xn,"createDefaultProps",()=>({...ft.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),g(Xn,"type",Xn.register("ESCameraViewCollection",Xn,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let Zh=Xn;const ru=class ru extends dt{constructor(e){super(e);g(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"aspectRatio"],"宽高比",1.77778),new R([this,"fov"],"横向夹角",90),new R([this,"far"],"视野长度",100),new R([this,"near"],"近面距离",5)]}}};g(ru,"createDefaultProps",()=>({...dt.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),g(ru,"type",ru.register("ESCameraVisibleRange",ru,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let dd=ru;const nu=class nu extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Tt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};g(nu,"createDefaultProps",()=>({...dt.createDefaultProps(),mode:"policeCar",allowPicking:!0})),g(nu,"type",nu.register("ESCar",nu,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let tc=nu;const Go=class Go extends Rt{constructor(e){super(e);g(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"height"],"高度",10)],coordinate:[...e.coordinate,new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)]}}};g(Go,"createDefaultProps",()=>({...Rt.createDefaultProps(),height:10,filled:!0,fillStyle:p.reactJson({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),g(Go,"type",Go.register("ESClassification",Go,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),g(Go,"supportEditingModes",[...Rt.supportEditingModes,ct.CircularAppend,ct.CircularInsert,ct.HeightModify]);let ec=Go;const iu=class iu extends dt{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new tt([this,"showArrow"],"显示箭头",!0),new Gt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new R([this,"edgetWidth"],"线框宽度",2),new R([this,"width"],"裁剪宽度",200),new R([this,"height"],"裁剪高度",200),new Et([this,"targetID"],"瓦片图层","")]}}};g(iu,"createDefaultProps",()=>({...dt.createDefaultProps(),showArrow:!0,edgeColor:p.reactArray([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),g(iu,"type",iu.register("ESClippingPlane",iu,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let gd=iu;class x2 extends st{constructor(t,e,r){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${r.id}) container`);{const u=()=>{const c=` ${e.cssText}
69
69
  ${e.cssAllInitial?"all: initial;":""}
70
70
  ${e.show?"":"display: none"}
71
71
  `;i.style.cssText=c};u();const l=this.dv(p.createNextAnimateFrameEvent(e.cssAllInitialChanged,e.cssTextChanged,e.showChanged));this.d(l.don(u))}t.appendChild(i),this.d(()=>t.removeChild(i));const s=this.dv(p.createNextAnimateFrameEvent(e.instanceClassChanged,e.containerChanged,e.shadowDomChanged)),o=this.dv(new p.ObjResettingWithEvent(s,()=>{const{instanceClass:u,container:l}=e;if(!u||l)return;let c=i;if(i.firstElementChild&&i.removeChild(i.firstElementChild),e.shadowDom){const h=i.appendChild(document.createElement("div"));h.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${r.id}) container shadowDiv`),c=h.attachShadow({mode:"open"}).appendChild(document.createElement("div")),c.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${r.id}) container shadowDiv div`)}return new u(c,e,r)})),{_updateEvent:a}=e;this.d(a.don(u=>{if(o.obj)try{u(o.obj,e,r)}catch(l){console.error(`ESCustomDiv update error! ${l}`)}}))}}const xm=`class MyDiv {