earthsdk3 3.5.0-beta.13 → 3.5.0-beta.14

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(y){"use strict";var dO=Object.defineProperty;var fO=(y,ys,La)=>ys in y?dO(y,ys,{enumerable:!0,configurable:!0,writable:!0,value:La}):y[ys]=La;var f=(y,ys,La)=>fO(y,typeof ys!="symbol"?ys+"":ys,La);var Ar;function ys(){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 La=Date.now();function Gv(n){const{os:t,arch:e}=ys(),i={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-La)/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(i));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))}y.copyright=void 0;try{const n="earthsdk3",t="3.5.0-beta.13",e="2025-10-15T08:26:43.000Z",i="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="d85e1020200203ea0aca1c05ac3f93f1f4e4574e",a=((Date.now()-1760516803e3)/36e5).toFixed(1),h=`%c🌏 ${n}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
1
+ var EarthSDK3=function(y){"use strict";var dO=Object.defineProperty;var fO=(y,ys,La)=>ys in y?dO(y,ys,{enumerable:!0,configurable:!0,writable:!0,value:La}):y[ys]=La;var f=(y,ys,La)=>fO(y,typeof ys!="symbol"?ys+"":ys,La);var Ar;function ys(){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 La=Date.now();function Gv(n){const{os:t,arch:e}=ys(),i={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-La)/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(i));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))}y.copyright=void 0;try{const n="earthsdk3",t="3.5.0-beta.14",e="2025-10-16T01:53:04.000Z",i="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cbb61ed7b700d1e5bd8462a564ea9ca208503e89",a=((Date.now()-1760579584e3)/36e5).toFixed(1),h=`%c🌏 ${n}%c ${t}.${s.slice(0,8)}.${e} (距今${a}个小时)
2
2
  %c${r?r+`
3
3
  `:""}当前网站正在使用${n},此软件版权归${i}所有
4
- `;y.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d85e1020200203ea0aca1c05ac3f93f1f4e4574e")},get info(){return h},get date(){return"2025-10-15T08:26:43.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.13"},get name(){return"earthsdk3"},get commitId(){return"d85e1020200203ea0aca1c05ac3f93f1f4e4574e"},print(){console.info(this.info,`
4
+ `;y.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cbb61ed7b700d1e5bd8462a564ea9ca208503e89")},get info(){return h},get date(){return"2025-10-16T01:53:04.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.14"},get name(){return"earthsdk3"},get commitId(){return"cbb61ed7b700d1e5bd8462a564ea9ca208503e89"},print(){console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -63,7 +63,7 @@ northing meters`+n;var d=l/2,g=0,p=0,_,w,P,v,E;return d>0&&(_=1e5/Math.pow(10,d)
63
63
  and limitations under the License.
64
64
  ***************************************************************************** */function nM(n,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return h([u,c])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,r&&(s=u[0]&2?r.return:u[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;switch(r=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,r=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(n,e)}catch(c){u=[6,c],r=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var oo=function(){function n(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return n}();function rM(n,t){return n>t?1:n<t?-1:0}function ao(n,t,e){for(var i=new oo(null,null),r=i,s=i;;){var o=e(n,t.key);if(o<0){if(t.left===null)break;if(e(n,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}s.left=t,s=t,t=t.left}else if(o>0){if(t.right===null)break;if(e(n,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}r.right=t,r=t,t=t.right}else break}return r.right=t.left,s.left=t.right,t.left=i.right,t.right=i.left,t}function wg(n,t,e,i){var r=new oo(n,t);if(e===null)return r.left=r.right=null,r;e=ao(n,e,i);var s=i(n,e.key);return s<0?(r.left=e.left,r.right=e,e.left=null):s>=0&&(r.right=e.right,r.left=e,e.right=null),r}function W_(n,t,e){var i=null,r=null;if(t){t=ao(n,t,e);var s=e(t.key,n);s===0?(i=t.left,r=t.right):s<0?(r=t.right,t.right=null,i=t):(i=t.left,t.left=null,r=t)}return{left:i,right:r}}function sM(n,t,e){return t===null?n:(n===null||(t=ao(n.key,t,e),t.left=n),t)}function Eg(n,t,e,i,r){if(n){i(""+t+(e?"└── ":"├── ")+r(n)+`
65
65
  `);var s=t+(e?" ":"│ ");n.left&&Eg(n.left,s,!1,i,r),n.right&&Eg(n.right,s,!0,i,r)}}var Sg=function(){function n(t){t===void 0&&(t=rM),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=wg(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var i=new oo(t,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,s=ao(t,this._root,r),o=r(t,s.key);return o===0?this._root=s:(o<0?(i.left=s.left,i.right=s,s.left=null):o>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,i){var r;if(e===null)return null;e=ao(t,e,i);var s=i(t,e.key);return s===0?(e.left===null?r=e.right:(r=ao(t,e.left,i),r.right=e.right),this._size--,r):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=ao(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,i=this._comparator;e;){var r=i(t,e.key);if(r===0)return e;r<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=ao(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,i=this._comparator;e;){var r=i(t,e.key);if(r===0)return!0;r<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var i=this._root,r=[],s=!1;!s;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),t.call(e,i),i=i.right):s=!0;return this},n.prototype.range=function(t,e,i,r){for(var s=[],o=this._comparator,a=this._root,h;s.length!==0||a;)if(a)s.push(a),a=a.left;else{if(a=s.pop(),h=o(a.key,e),h>0)break;if(o(a.key,t)>=0&&i.call(r,a))return this;a=a.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var i=e.key;return t.push(i)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var i=e.data;return t.push(i)}),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,i=!1,r=0,s=[];!i;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),r===t)return e;r++,e=e.right}else i=!0;return null},n.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var r=this._comparator;e;){var s=r(t.key,e.key);if(s===0)break;s<0?(i=e,e=e.left):e=e.right}return i},n.prototype.prev=function(t){var e=this._root,i=null;if(t.left!==null){for(i=t.left;i.right;)i=i.right;return i}for(var r=this._comparator;e;){var s=r(t.key,e.key);if(s===0)break;s<0?e=e.left:(i=e,e=e.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return aM(this._root)},n.prototype.load=function(t,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var r=t.length,s=this._comparator;if(i&&bg(t,e,0,r-1,s),this._root===null)this._root=Cg(t,e,0,r),this._size=r;else{var o=hM(this.toList(),oM(t,e),s);r=this._size+r,this._root=Pg({head:o},0,r)}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(i){return String(i.key)});var e=[];return Eg(this._root,"",!0,function(i){return e.push(i)},t),e.join("")},n.prototype.update=function(t,e,i){var r=this._comparator,s=W_(t,this._root,r),o=s.left,a=s.right;r(t,e)<0?a=wg(e,i,a,r):o=wg(e,i,o,r),this._root=sM(o,a,r)},n.prototype.split=function(t){return W_(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t,e,i;return nM(this,function(r){switch(r.label){case 0:t=this._root,e=[],i=!1,r.label=1;case 1:return i?[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 r.sent(),t=t.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Cg(n,t,e,i){var r=i-e;if(r>0){var s=e+Math.floor(r/2),o=n[s],a=t[s],h=new oo(o,a);return h.left=Cg(n,t,e,s),h.right=Cg(n,t,s+1,i),h}return null}function oM(n,t){for(var e=new oo(null,null),i=e,r=0;r<n.length;r++)i=i.next=new oo(n[r],t[r]);return i.next=null,e.next}function aM(n){for(var t=n,e=[],i=!1,r=new oo(null,null),s=r;!i;)t?(e.push(t),t=t.left):e.length>0?(t=s=s.next=e.pop(),t=t.right):i=!0;return s.next=null,r.next}function Pg(n,t,e){var i=e-t;if(i>0){var r=t+Math.floor(i/2),s=Pg(n,t,r),o=n.head;return o.left=s,n.head=n.head.next,o.right=Pg(n,r+1,e),o}return null}function hM(n,t,e){for(var i=new oo(null,null),r=i,s=n,o=t;s!==null&&o!==null;)e(s.key,o.key)<0?(r.next=s,s=s.next):(r.next=o,o=o.next),r=r.next;return s!==null?r.next=s:o!==null&&(r.next=o),i.next}function bg(n,t,e,i,r){if(!(e>=i)){for(var s=n[e+i>>1],o=e-1,a=i+1;;){do o++;while(r(n[o],s)<0);do a--;while(r(n[a],s)>0);if(o>=a)break;var h=n[o];n[o]=n[a],n[a]=h,h=t[o],t[o]=t[a],t[a]=h}bg(n,t,e,a,r),bg(n,t,a+1,i,r)}}const xs=11102230246251565e-32,Di=134217729,uM=(3+8*xs)*xs;function Ig(n,t,e,i,r){let s,o,a,h,u=t[0],c=i[0],l=0,d=0;c>u==c>-u?(s=u,u=t[++l]):(s=c,c=i[++d]);let g=0;if(l<n&&d<e)for(c>u==c>-u?(o=u+s,a=s-(o-u),u=t[++l]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[g++]=a);l<n&&d<e;)c>u==c>-u?(o=s+u,h=o-s,a=s-(o-h)+(u-h),u=t[++l]):(o=s+c,h=o-s,a=s-(o-h)+(c-h),c=i[++d]),s=o,a!==0&&(r[g++]=a);for(;l<n;)o=s+u,h=o-s,a=s-(o-h)+(u-h),u=t[++l],s=o,a!==0&&(r[g++]=a);for(;d<e;)o=s+c,h=o-s,a=s-(o-h)+(c-h),c=i[++d],s=o,a!==0&&(r[g++]=a);return(s!==0||g===0)&&(r[g++]=s),g}function lM(n,t){let e=t[0];for(let i=1;i<n;i++)e+=t[i];return e}function sl(n){return new Float64Array(n)}const cM=(3+16*xs)*xs,dM=(2+12*xs)*xs,fM=(9+64*xs)*xs*xs,ah=sl(4),H_=sl(8),X_=sl(12),Y_=sl(16),Xi=sl(4);function gM(n,t,e,i,r,s,o){let a,h,u,c,l,d,g,p,_,w,P,v,E,m,S,C,b,I;const M=n-r,O=e-r,x=t-s,T=i-s;m=M*T,d=Di*M,g=d-(d-M),p=M-g,d=Di*T,_=d-(d-T),w=T-_,S=p*w-(m-g*_-p*_-g*w),C=x*O,d=Di*x,g=d-(d-x),p=x-g,d=Di*O,_=d-(d-O),w=O-_,b=p*w-(C-g*_-p*_-g*w),P=S-b,l=S-P,ah[0]=S-(P+l)+(l-b),v=m+P,l=v-m,E=m-(v-l)+(P-l),P=E-C,l=E-P,ah[1]=E-(P+l)+(l-C),I=v+P,l=I-v,ah[2]=v-(I-l)+(P-l),ah[3]=I;let A=lM(4,ah),G=dM*o;if(A>=G||-A>=G||(l=n-M,a=n-(M+l)+(l-r),l=e-O,u=e-(O+l)+(l-r),l=t-x,h=t-(x+l)+(l-s),l=i-T,c=i-(T+l)+(l-s),a===0&&h===0&&u===0&&c===0)||(G=fM*o+uM*Math.abs(A),A+=M*c+T*a-(x*u+O*h),A>=G||-A>=G))return A;m=a*T,d=Di*a,g=d-(d-a),p=a-g,d=Di*T,_=d-(d-T),w=T-_,S=p*w-(m-g*_-p*_-g*w),C=h*O,d=Di*h,g=d-(d-h),p=h-g,d=Di*O,_=d-(d-O),w=O-_,b=p*w-(C-g*_-p*_-g*w),P=S-b,l=S-P,Xi[0]=S-(P+l)+(l-b),v=m+P,l=v-m,E=m-(v-l)+(P-l),P=E-C,l=E-P,Xi[1]=E-(P+l)+(l-C),I=v+P,l=I-v,Xi[2]=v-(I-l)+(P-l),Xi[3]=I;const tt=Ig(4,ah,4,Xi,H_);m=M*c,d=Di*M,g=d-(d-M),p=M-g,d=Di*c,_=d-(d-c),w=c-_,S=p*w-(m-g*_-p*_-g*w),C=x*u,d=Di*x,g=d-(d-x),p=x-g,d=Di*u,_=d-(d-u),w=u-_,b=p*w-(C-g*_-p*_-g*w),P=S-b,l=S-P,Xi[0]=S-(P+l)+(l-b),v=m+P,l=v-m,E=m-(v-l)+(P-l),P=E-C,l=E-P,Xi[1]=E-(P+l)+(l-C),I=v+P,l=I-v,Xi[2]=v-(I-l)+(P-l),Xi[3]=I;const $=Ig(tt,H_,4,Xi,X_);m=a*c,d=Di*a,g=d-(d-a),p=a-g,d=Di*c,_=d-(d-c),w=c-_,S=p*w-(m-g*_-p*_-g*w),C=h*u,d=Di*h,g=d-(d-h),p=h-g,d=Di*u,_=d-(d-u),w=u-_,b=p*w-(C-g*_-p*_-g*w),P=S-b,l=S-P,Xi[0]=S-(P+l)+(l-b),v=m+P,l=v-m,E=m-(v-l)+(P-l),P=E-C,l=E-P,Xi[1]=E-(P+l)+(l-C),I=v+P,l=I-v,Xi[2]=v-(I-l)+(P-l),Xi[3]=I;const nt=Ig($,X_,4,Xi,Y_);return Y_[nt-1]}function pM(n,t,e,i,r,s){const o=(t-s)*(e-r),a=(n-r)*(i-s),h=o-a,u=Math.abs(o+a);return Math.abs(h)>=cM*u?h:-gM(n,t,e,i,r,s,u)}const ol=(n,t)=>n.ll.x<=t.x&&t.x<=n.ur.x&&n.ll.y<=t.y&&t.y<=n.ur.y,xg=(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,i=n.ur.x<t.ur.x?n.ur.x:t.ur.x,r=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:r},ur:{x:i,y:s}}};let ho=Number.EPSILON;ho===void 0&&(ho=Math.pow(2,-52));const vM=ho*ho,J_=(n,t)=>{if(-ho<n&&n<ho&&-ho<t&&t<ho)return 0;const e=n-t;return e*e<vM*n*t?0:n<t?-1:1};class mM{constructor(){this.reset()}reset(){this.xRounder=new $_,this.yRounder=new $_}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class $_{constructor(){this.tree=new Sg,this.round(0)}round(t){const e=this.tree.add(t),i=this.tree.prev(e);if(i!==null&&J_(e.key,i.key)===0)return this.tree.remove(t),i.key;const r=this.tree.next(e);return r!==null&&J_(e.key,r.key)===0?(this.tree.remove(t),r.key):t}}const al=new mM,Gc=(n,t)=>n.x*t.y-n.y*t.x,K_=(n,t)=>n.x*t.x+n.y*t.y,Q_=(n,t,e)=>{const i=pM(n.x,n.y,t.x,t.y,e.x,e.y);return i>0?-1:i<0?1:0},Bc=n=>Math.sqrt(K_(n,n)),_M=(n,t,e)=>{const i={x:t.x-n.x,y:t.y-n.y},r={x:e.x-n.x,y:e.y-n.y};return Gc(r,i)/Bc(r)/Bc(i)},yM=(n,t,e)=>{const i={x:t.x-n.x,y:t.y-n.y},r={x:e.x-n.x,y:e.y-n.y};return K_(r,i)/Bc(r)/Bc(i)},Z_=(n,t,e)=>t.y===0?null:{x:n.x+t.x/t.y*(e-n.y),y:e},ty=(n,t,e)=>t.x===0?null:{x:e,y:n.y+t.y/t.x*(e-n.x)},wM=(n,t,e,i)=>{if(t.x===0)return ty(e,i,n.x);if(i.x===0)return ty(n,t,e.x);if(t.y===0)return Z_(e,i,n.y);if(i.y===0)return Z_(n,t,e.y);const r=Gc(t,i);if(r==0)return null;const s={x:e.x-n.x,y:e.y-n.y},o=Gc(s,t)/r,a=Gc(s,i)/r,h=n.x+a*t.x,u=e.x+o*i.x,c=n.y+a*t.y,l=e.y+o*i.y,d=(h+u)/2,g=(c+l)/2;return{x:d,y:g}};class Bn{static compare(t,e){const i=Bn.comparePoints(t.point,e.point);return i!==0?i:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:uo.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 i=0,r=e.length;i<r;i++){const s=e[i];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 i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let r=e+1;r<t;r++){const s=this.point.events[r];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,i=this.point.events.length;e<i;e++){const r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}getLeftmostComparator(t){const e=new Map,i=r=>{const s=r.otherSE;e.set(r,{sine:_M(this.point,t.point,s.point),cosine:yM(this.point,t.point,s.point)})};return(r,s)=>{e.has(r)||i(r),e.has(s)||i(s);const{sine:o,cosine:a}=e.get(r),{sine:h,cosine:u}=e.get(s);return o>=0&&h>=0?a<u?1:a>u?-1:0:o<0&&h<0?a<u?-1:a>u?1:0:h<o?-1:h>o?1:0}}}let EM=0;class uo{static compare(t,e){const i=t.leftSE.point.x,r=e.leftSE.point.x,s=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(s<r)return-1;const a=t.leftSE.point.y,h=e.leftSE.point.y,u=t.rightSE.point.y,c=e.rightSE.point.y;if(i<r){if(h<a&&h<u)return 1;if(h>a&&h>u)return-1;const l=t.comparePoint(e.leftSE.point);if(l<0)return 1;if(l>0)return-1;const d=e.comparePoint(t.rightSE.point);return d!==0?d:-1}if(i>r){if(a<h&&a<c)return-1;if(a>h&&a>c)return 1;const l=e.comparePoint(t.leftSE.point);if(l!==0)return l;const d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(a<h)return-1;if(a>h)return 1;if(s<o){const l=e.comparePoint(t.rightSE.point);if(l!==0)return l}if(s>o){const l=t.comparePoint(e.rightSE.point);if(l<0)return 1;if(l>0)return-1}if(s!==o){const l=u-a,d=s-i,g=c-h,p=o-r;if(l>d&&g<p)return 1;if(l<d&&g>p)return-1}return s>o?1:s<o||u<c?-1:u>c?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,i,r){this.id=++EM,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=i,this.windings=r}static fromRing(t,e,i){let r,s,o;const a=Bn.comparePoints(t,e);if(a<0)r=t,s=e,o=1;else if(a>0)r=e,s=t,o=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const h=new Bn(r,!0),u=new Bn(s,!1);return new uo(h,u,[i],[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,i=this.rightSE.point,r=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;const s=(t.y-e.y)/r.y,o=e.x+s*r.x;if(t.x===o)return 0;const a=(t.x-e.x)/r.x,h=e.y+a*r.y;return t.y===h?0:t.y<h?-1:1}getIntersection(t){const e=this.bbox(),i=t.bbox(),r=xg(e,i);if(r===null)return null;const s=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,h=t.rightSE.point,u=ol(e,a)&&this.comparePoint(a)===0,c=ol(i,s)&&t.comparePoint(s)===0,l=ol(e,h)&&this.comparePoint(h)===0,d=ol(i,o)&&t.comparePoint(o)===0;if(c&&u)return d&&!l?o:!d&&l?h:null;if(c)return l&&s.x===h.x&&s.y===h.y?null:s;if(u)return d&&o.x===a.x&&o.y===a.y?null:a;if(d&&l)return null;if(d)return o;if(l)return h;const g=wM(s,this.vector(),a,t.vector());return g===null||!ol(r,g)?null:al.round(g.x,g.y)}split(t){const e=[],i=t.events!==void 0,r=new Bn(t,!0),s=new Bn(t,!1),o=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(r);const a=new uo(r,o,this.rings.slice(),this.windings.slice());return Bn.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Bn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.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,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(t){let e=this,i=t;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=uo.compare(e,i);if(r!==0){if(r>0){const s=e;e=i,i=s}if(e.prev===i){const s=e;e=i,i=s}for(let s=0,o=i.rings.length;s<o;s++){const a=i.rings[s],h=i.windings[s],u=e.rings.indexOf(a);u===-1?(e.rings.push(a),e.windings.push(h)):e.windings[u]+=h}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.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,i=this._afterState.windings,r=this._afterState.multiPolys;for(let a=0,h=this.rings.length;a<h;a++){const u=this.rings[a],c=this.windings[a],l=e.indexOf(u);l===-1?(e.push(u),i.push(c)):i[l]+=c}const s=[],o=[];for(let a=0,h=e.length;a<h;a++){if(i[a]===0)continue;const u=e[a],c=u.poly;if(o.indexOf(c)===-1)if(u.isExterior)s.push(c);else{o.indexOf(c)===-1&&o.push(c);const l=s.indexOf(u.poly);l!==-1&&s.splice(l,1)}}for(let a=0,h=s.length;a<h;a++){const u=s[a].multiPoly;r.indexOf(u)===-1&&r.push(u)}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(mr.type){case"union":{const i=t.length===0,r=e.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;t.length<e.length?(i=t.length,r=e.length):(i=e.length,r=t.length),this._isInResult=r===mr.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(t.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(t)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${mr.type}`)}return this._isInResult}}class ey{constructor(t,e,i){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=i,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 r=al.round(t[0][0],t[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let s=r;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 h=al.round(t[o][0],t[o][1]);h.x===s.x&&h.y===s.y||(this.segments.push(uo.fromRing(s,h,this)),h.x<this.bbox.ll.x&&(this.bbox.ll.x=h.x),h.y<this.bbox.ll.y&&(this.bbox.ll.y=h.y),h.x>this.bbox.ur.x&&(this.bbox.ur.x=h.x),h.y>this.bbox.ur.y&&(this.bbox.ur.y=h.y),s=h)}(r.x!==s.x||r.y!==s.y)&&this.segments.push(uo.fromRing(s,r,this))}getSweepEvents(){const t=[];for(let e=0,i=this.segments.length;e<i;e++){const r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}}class SM{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ey(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 i=1,r=t.length;i<r;i++){const s=new ey(t[i],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,i=this.interiorRings.length;e<i;e++){const r=this.interiorRings[e].getSweepEvents();for(let s=0,o=r.length;s<o;s++)t.push(r[s])}return t}}class iy{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 i=0,r=t.length;i<r;i++){const s=new SM(t[i],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,i=this.polys.length;e<i;e++){const r=this.polys[e].getSweepEvents();for(let s=0,o=r.length;s<o;s++)t.push(r[s])}return t}}class Vc{static factory(t){const e=[];for(let i=0,r=t.length;i<r;i++){const s=t[i];if(!s.isInResult()||s.ringOut)continue;let o=null,a=s.leftSE,h=s.rightSE;const u=[a],c=a.point,l=[];for(;o=a,a=h,u.push(a),a.point!==c;)for(;;){const d=a.getAvailableLinkedEvents();if(d.length===0){const _=u[0].point,w=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${_.x}, ${_.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`)}if(d.length===1){h=d[0].otherSE;break}let g=null;for(let _=0,w=l.length;_<w;_++)if(l[_].point===a.point){g=_;break}if(g!==null){const _=l.splice(g)[0],w=u.splice(_.index);w.unshift(w[0].otherSE),e.push(new Vc(w.reverse()));continue}l.push({index:u.length,point:a.point});const p=a.getLeftmostComparator(o);h=d.sort(p)[0].otherSE;break}e.push(new Vc(u))}return e}constructor(t){this.events=t;for(let e=0,i=t.length;e<i;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let u=1,c=this.events.length-1;u<c;u++){const l=this.events[u].point,d=this.events[u+1].point;Q_(l,t,d)!==0&&(e.push(l),t=l)}if(e.length===1)return null;const i=e[0],r=e[1];Q_(i,t,r)===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,h=[];for(let u=o;u!=a;u+=s)h.push([e[u].x,e[u].y]);return h}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 r=1,s=this.events.length;r<s;r++){const o=this.events[r];Bn.compare(t,o)>0&&(t=o)}let e=t.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class ny{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,i=this.interiorRings.length;e<i;e++){const r=this.interiorRings[e].getGeom();r!==null&&t.push(r)}return t}}class CM{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,i=this.polys.length;e<i;e++){const r=this.polys[e].getGeom();r!==null&&t.push(r)}return t}_composePolys(t){const e=[];for(let i=0,r=t.length;i<r;i++){const s=t[i];if(!s.poly)if(s.isExteriorRing())e.push(new ny(s));else{const o=s.enclosingRing();o.poly||e.push(new ny(o)),o.poly.addInterior(s)}}return e}}class PM{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uo.compare;this.queue=t,this.tree=new Sg(e),this.segments=[]}process(t){const e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;const r=t.isLeft?this.tree.add(e):this.tree.find(e);if(!r)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=r,o=r,a,h;for(;a===void 0;)s=this.tree.prev(s),s===null?a=null:s.key.consumedBy===void 0&&(a=s.key);for(;h===void 0;)o=this.tree.next(o),o===null?h=null:o.key.consumedBy===void 0&&(h=o.key);if(t.isLeft){let u=null;if(a){const l=a.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(u=l),!a.isAnEndpoint(l))){const d=this._splitSafely(a,l);for(let g=0,p=d.length;g<p;g++)i.push(d[g])}}let c=null;if(h){const l=h.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(c=l),!h.isAnEndpoint(l))){const d=this._splitSafely(h,l);for(let g=0,p=d.length;g<p;g++)i.push(d[g])}}if(u!==null||c!==null){let l=null;u===null?l=c:c===null?l=u:l=Bn.comparePoints(u,c)<=0?u:c,this.queue.remove(e.rightSE),i.push(e.rightSE);const d=e.split(l);for(let g=0,p=d.length;g<p;g++)i.push(d[g])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&h){const u=a.getIntersection(h);if(u!==null){if(!a.isAnEndpoint(u)){const c=this._splitSafely(a,u);for(let l=0,d=c.length;l<d;l++)i.push(c[l])}if(!h.isAnEndpoint(u)){const c=this._splitSafely(h,u);for(let l=0,d=c.length;l<d;l++)i.push(c[l])}}}this.tree.remove(e)}return i}_splitSafely(t,e){this.tree.remove(t);const i=t.rightSE;this.queue.remove(i);const r=t.split(e);return r.push(i),t.consumedBy===void 0&&this.tree.add(t),r}}const ry=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,bM=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class IM{run(t,e,i){mr.type=t,al.reset();const r=[new iy(e,!0)];for(let l=0,d=i.length;l<d;l++)r.push(new iy(i[l],!1));if(mr.numMultiPolys=r.length,mr.type==="difference"){const l=r[0];let d=1;for(;d<r.length;)xg(r[d].bbox,l.bbox)!==null?d++:r.splice(d,1)}if(mr.type==="intersection")for(let l=0,d=r.length;l<d;l++){const g=r[l];for(let p=l+1,_=r.length;p<_;p++)if(xg(g.bbox,r[p].bbox)===null)return[]}const s=new Sg(Bn.compare);for(let l=0,d=r.length;l<d;l++){const g=r[l].getSweepEvents();for(let p=0,_=g.length;p<_;p++)if(s.insert(g[p]),s.size>ry)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new PM(s);let a=s.size,h=s.pop();for(;h;){const l=h.key;if(s.size===a){const g=l.segment;throw new Error(`Unable to pop() ${l.isLeft?"left":"right"} SweepEvent [${l.point.x}, ${l.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>ry)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>bM)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const d=o.process(l);for(let g=0,p=d.length;g<p;g++){const _=d[g];_.consumedBy===void 0&&s.insert(_)}a=s.size,h=s.pop()}al.reset();const u=Vc.factory(o.segments);return new CM(u).getGeom()}}const mr=new IM;var Mg={union:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];return mr.run("union",n,e)},intersection:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];return mr.run("intersection",n,e)},xor:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];return mr.run("xor",n,e)},difference:function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];return mr.run("difference",n,e)}};function xM(n,t){var e=Oi(n),i=Oi(t),r=n.properties||{},s=Mg.difference(e.coordinates,i.coordinates);return s.length===0?null:s.length===1?he(s[0],r):og(s,r)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),i=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(i+r,0):Math.min(r,i);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:i;for(s=s<0?Math.max(i+arguments[2],0):Math.min(s,i);r<s;)e[r]=t,++r;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 Jo=function(){};Jo.prototype.interfaces_=function(){return[]},Jo.prototype.getClass=function(){return Jo},Jo.prototype.equalsWithTolerance=function(t,e,i){return Math.abs(t-e)<=i};var ce=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),Pt=function(){},sy={MAX_VALUE:{configurable:!0}};Pt.isNaN=function(t){return Number.isNaN(t)},Pt.doubleToLongBits=function(t){return t},Pt.longBitsToDouble=function(t){return t},Pt.isInfinite=function(t){return!Number.isFinite(t)},sy.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Pt,sy);var hn=function(){},zc=function(){},hh=function(){};function un(){}var L=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])},$o={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};L.prototype.setOrdinate=function(t,e){switch(t){case L.X:this.x=e;break;case L.Y:this.y=e;break;case L.Z:this.z=e;break;default:throw new ce("Invalid ordinate index: "+t)}},L.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],i=arguments[1];return!(!Jo.equalsWithTolerance(this.x,e.x,i)||!Jo.equalsWithTolerance(this.y,e.y,i))}},L.prototype.getOrdinate=function(t){switch(t){case L.X:return this.x;case L.Y:return this.y;case L.Z:return this.z}throw new ce("Invalid ordinate index: "+t)},L.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Pt.isNaN(this.z))&&Pt.isNaN(t.z)},L.prototype.equals=function(t){return t instanceof L?this.equals2D(t):!1},L.prototype.equalInZ=function(t,e){return Jo.equalsWithTolerance(this.z,t.z,e)},L.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},L.prototype.clone=function(){},L.prototype.copy=function(){return new L(this)},L.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},L.prototype.distance3D=function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+i*i+r*r)},L.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},L.prototype.hashCode=function(){var t=17;return t=37*t+L.hashCode(this.x),t=37*t+L.hashCode(this.y),t},L.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},L.prototype.interfaces_=function(){return[hn,zc,un]},L.prototype.getClass=function(){return L},L.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=Pt.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},$o.DimensionalComparator.get=function(){return Ms},$o.serialVersionUID.get=function(){return 6683108902428367e3},$o.NULL_ORDINATE.get=function(){return Pt.NaN},$o.X.get=function(){return 0},$o.Y.get=function(){return 1},$o.Z.get=function(){return 2},Object.defineProperties(L,$o);var Ms=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ce("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};Ms.prototype.compare=function(t,e){var i=t,r=e,s=Ms.compare(i.x,r.x);if(s!==0)return s;var o=Ms.compare(i.y,r.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Ms.compare(i.z,r.z);return a},Ms.prototype.interfaces_=function(){return[hh]},Ms.prototype.getClass=function(){return Ms},Ms.compare=function(t,e){return t<e?-1:t>e?1:Pt.isNaN(t)?Pt.isNaN(e)?0:-1:Pt.isNaN(e)?1:0};var uh=function(){};uh.prototype.create=function(){},uh.prototype.interfaces_=function(){return[]},uh.prototype.getClass=function(){return uh};var V=function(){},hl={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(t){switch(t){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new ce("Unknown location value: "+t)},hl.INTERIOR.get=function(){return 0},hl.BOUNDARY.get=function(){return 1},hl.EXTERIOR.get=function(){return 2},hl.NONE.get=function(){return-1},Object.defineProperties(V,hl);var wt=function(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1},Yi=function(){},oy={LOG_10:{configurable:!0}};Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi},Yi.log10=function(t){var e=Math.log(t);return Pt.isInfinite(e)||Pt.isNaN(e)?e:e/Yi.LOG_10},Yi.min=function(t,e,i,r){var s=t;return e<s&&(s=e),i<s&&(s=i),r<s&&(s=r),s},Yi.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],i=arguments[2];return t<e?e:t>i?i:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],s=arguments[1],o=arguments[2];return r<s?s:r>o?o:r}},Yi.wrap=function(t,e){return t<0?e- -t%e:t%e},Yi.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2],r=t;return e>r&&(r=e),i>r&&(r=i),r}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],h=arguments[3],u=s;return o>u&&(u=o),a>u&&(u=a),h>u&&(u=h),u}},Yi.average=function(t,e){return(t+e)/2},oy.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Yi,oy);var Vn=function(t){this.str=t};Vn.prototype.append=function(t){this.str+=t},Vn.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Vn.prototype.toString=function(t){return this.str};var zn=function(t){this.value=t};zn.prototype.intValue=function(){return this.value},zn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},zn.isNaN=function(t){return Number.isNaN(t)};var ul=function(){};ul.isWhitespace=function(t){return t<=32&&t>=0||t===127},ul.toUpperCase=function(t){return t.toUpperCase()};var j=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 i=arguments[0];n.call(this,n.parse(i))}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.init(r,s)}},Sn={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}};j.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},j.prototype.extractSignificantDigits=function(t,e){var i=this.abs(),r=j.magnitude(i._hi),s=j.TEN.pow(r);i=i.divide(s),i.gt(j.TEN)?(i=i.divide(j.TEN),r+=1):i.lt(j.ONE)&&(i=i.multiply(j.TEN),r-=1);for(var o=r+1,a=new Vn,h=j.MAX_PRINT_DIGITS-1,u=0;u<=h;u++){t&&u===o&&a.append(".");var c=Math.trunc(i._hi);if(c<0)break;var l=!1,d=0;c>9?(l=!0,d="9"):d="0"+c,a.append(d),i=i.subtract(j.valueOf(c)).multiply(j.TEN),l&&i.selfAdd(j.TEN);var g=!0,p=j.magnitude(i._hi);if(p<0&&Math.abs(p)>=h-u&&(g=!1),!g)break}return e[0]=r,a.toString()},j.prototype.sqr=function(){return this.multiply(this)},j.prototype.doubleValue=function(){return this._hi+this._lo},j.prototype.subtract=function(){if(arguments[0]instanceof j){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},j.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},j.prototype.isZero=function(){return this._hi===0&&this._lo===0},j.prototype.selfSubtract=function(){if(arguments[0]instanceof j){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)}},j.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},j.prototype.min=function(t){return this.le(t)?this:t},j.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof j){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 i=arguments[0],r=arguments[1],s=null,o=null,a=null,h=null,u=null,c=null,l=null,d=null;return u=this._hi/i,c=j.SPLIT*u,s=c-u,d=j.SPLIT*i,s=c-s,o=u-s,a=d-i,l=u*i,a=d-a,h=i-a,d=s*a-l+s*h+o*a+o*h,c=(this._hi-l-d+this._lo-u*r)/i,d=u+c,this._hi=d,this._lo=u-d+c,this}},j.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},j.prototype.divide=function(){if(arguments[0]instanceof j){var t=arguments[0],e=null,i=null,r=null,s=null,o=null,a=null,h=null,u=null;o=this._hi/t._hi,a=j.SPLIT*o,e=a-o,u=j.SPLIT*t._hi,e=a-e,i=o-e,r=u-t._hi,h=o*t._hi,r=u-r,s=t._hi-r,u=e*r-h+e*s+i*r+i*s,a=(this._hi-h-u+this._lo-o*t._lo)/t._hi,u=o+a;var c=u,l=o-u+a;return new j(c,l)}else if(typeof arguments[0]=="number"){var d=arguments[0];return Pt.isNaN(d)?j.createNaN():j.copy(this).selfDivide(d,0)}},j.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},j.prototype.pow=function(t){if(t===0)return j.valueOf(1);var e=new j(this),i=j.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2===1&&i.selfMultiply(e),r/=2,r>0&&(e=e.sqr());else i=e;return t<0?i.reciprocal():i},j.prototype.ceil=function(){if(this.isNaN())return j.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new j(t,e)},j.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},j.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},j.prototype.setValue=function(){if(arguments[0]instanceof j){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},j.prototype.max=function(t){return this.ge(t)?this:t},j.prototype.sqrt=function(){if(this.isZero())return j.valueOf(0);if(this.isNegative())return j.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,i=j.valueOf(e),r=this.subtract(i.sqr()),s=r._hi*(t*.5);return i.add(s)},j.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof j){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],i=null,r=null,s=null,o=null,a=null,h=null;return s=this._hi+e,a=s-this._hi,o=s-a,o=e-a+(this._hi-o),h=o+this._lo,i=s+h,r=h+(s-i),this._hi=i+r,this._lo=r+(i-this._hi),this}}else if(arguments.length===2){var u=arguments[0],c=arguments[1],l=null,d=null,g=null,p=null,_=null,w=null,P=null,v=null;_=this._hi+u,g=this._lo+c,P=_-this._hi,v=g-this._lo,w=_-P,p=g-v,w=u-P+(this._hi-w),p=c-v+(this._lo-p),P=w+g,l=_+P,d=P+(_-l),P=p+d;var E=l+P,m=P+(l-E);return this._hi=E,this._lo=m,this}},j.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof j){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 i=arguments[0],r=arguments[1],s=null,o=null,a=null,h=null,u=null,c=null;u=j.SPLIT*this._hi,s=u-this._hi,c=j.SPLIT*i,s=u-s,o=this._hi-s,a=c-i,u=this._hi*i,a=c-a,h=i-a,c=s*a-u+s*h+o*a+o*h+(this._hi*r+this._lo*i);var l=u+c;s=u-l;var d=c+s;return this._hi=l,this._lo=d,this}},j.prototype.selfSqr=function(){return this.selfMultiply(this)},j.prototype.floor=function(){if(this.isNaN())return j.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new j(t,e)},j.prototype.negate=function(){return this.isNaN()?this:new j(-this._hi,-this._lo)},j.prototype.clone=function(){},j.prototype.multiply=function(){if(arguments[0]instanceof j){var t=arguments[0];return t.isNaN()?j.createNaN():j.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return Pt.isNaN(e)?j.createNaN():j.copy(this).selfMultiply(e,0)}},j.prototype.isNaN=function(){return Pt.isNaN(this._hi)},j.prototype.intValue=function(){return Math.trunc(this._hi)},j.prototype.toString=function(){var t=j.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},j.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!0,e),r=e[0]+1,s=i;if(i.charAt(0)===".")s="0"+i;else if(r<0)s="0."+j.stringOfChar("0",-r)+i;else if(i.indexOf(".")===-1){var o=r-i.length,a=j.stringOfChar("0",o);s=i+a+".0"}return this.isNegative()?"-"+s:s},j.prototype.reciprocal=function(){var t=null,e=null,i=null,r=null,s=null,o=null,a=null,h=null;s=1/this._hi,o=j.SPLIT*s,t=o-s,h=j.SPLIT*this._hi,t=o-t,e=s-t,i=h-this._hi,a=s*this._hi,i=h-i,r=this._hi-i,h=t*i-a+t*r+e*i+e*r,o=(1-a-h-s*this._lo)/this._hi;var u=s+o,c=s-u+o;return new j(u,c)},j.prototype.toSciNotation=function(){if(this.isZero())return j.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!1,e),r=j.SCI_NOT_EXPONENT_CHAR+e[0];if(i.charAt(0)==="0")throw new Error("Found leading zero: "+i);var s="";i.length>1&&(s=i.substring(1));var o=i.charAt(0)+"."+s;return this.isNegative()?"-"+o+r:o+r},j.prototype.abs=function(){return this.isNaN()?j.NaN:this.isNegative()?this.negate():new j(this)},j.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},j.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},j.prototype.add=function(){if(arguments[0]instanceof j){var t=arguments[0];return j.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return j.copy(this).selfAdd(e)}},j.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 j){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this._hi=i,this._lo=r}},j.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},j.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},j.prototype.trunc=function(){return this.isNaN()?j.NaN:this.isPositive()?this.floor():this.ceil()},j.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},j.prototype.interfaces_=function(){return[un,hn,zc]},j.prototype.getClass=function(){return j},j.sqr=function(t){return j.valueOf(t).selfMultiply(t)},j.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return j.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new j(e)}},j.sqrt=function(t){return j.valueOf(t).sqrt()},j.parse=function(t){for(var e=0,i=t.length;ul.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<i){var s=t.charAt(e);(s==="-"||s==="+")&&(e++,s==="-"&&(r=!0))}for(var o=new j,a=0,h=0,u=0;!(e>=i);){var c=t.charAt(e);if(e++,ul.isDigit(c)){var l=c-"0";o.selfMultiply(j.TEN),o.selfAdd(l),a++;continue}if(c==="."){h=a;continue}if(c==="e"||c==="E"){var d=t.substring(e);try{u=zn.parseInt(d)}catch(P){throw P instanceof Error?new Error("Invalid exponent "+d+" in string "+t):P}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=o,p=a-h-u;if(p===0)g=o;else if(p>0){var _=j.TEN.pow(p);g=o.divide(_)}else if(p<0){var w=j.TEN.pow(-p);g=o.multiply(w)}return r?g.negate():g},j.createNaN=function(){return new j(Pt.NaN,Pt.NaN)},j.copy=function(t){return new j(t)},j.magnitude=function(t){var e=Math.abs(t),i=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(i)),s=Math.pow(10,r);return s*10<=e&&(r+=1),r},j.stringOfChar=function(t,e){for(var i=new Vn,r=0;r<e;r++)i.append(t);return i.toString()},Sn.PI.get=function(){return new j(3.141592653589793,12246467991473532e-32)},Sn.TWO_PI.get=function(){return new j(6.283185307179586,24492935982947064e-32)},Sn.PI_2.get=function(){return new j(1.5707963267948966,6123233995736766e-32)},Sn.E.get=function(){return new j(2.718281828459045,14456468917292502e-32)},Sn.NaN.get=function(){return new j(Pt.NaN,Pt.NaN)},Sn.EPS.get=function(){return 123259516440783e-46},Sn.SPLIT.get=function(){return 134217729},Sn.MAX_PRINT_DIGITS.get=function(){return 32},Sn.TEN.get=function(){return j.valueOf(10)},Sn.ONE.get=function(){return j.valueOf(1)},Sn.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Sn.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(j,Sn);var wi=function(){},ay={DP_SAFE_EPSILON:{configurable:!0}};wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi},wi.orientationIndex=function(t,e,i){var r=wi.orientationIndexFilter(t,e,i);if(r<=1)return r;var s=j.valueOf(e.x).selfAdd(-t.x),o=j.valueOf(e.y).selfAdd(-t.y),a=j.valueOf(i.x).selfAdd(-e.x),h=j.valueOf(i.y).selfAdd(-e.y);return s.selfMultiply(h).selfSubtract(o.selfMultiply(a)).signum()},wi.signOfDet2x2=function(t,e,i,r){var s=t.multiply(r).selfSubtract(e.multiply(i));return s.signum()},wi.intersection=function(t,e,i,r){var s=j.valueOf(r.y).selfSubtract(i.y).selfMultiply(j.valueOf(e.x).selfSubtract(t.x)),o=j.valueOf(r.x).selfSubtract(i.x).selfMultiply(j.valueOf(e.y).selfSubtract(t.y)),a=s.subtract(o),h=j.valueOf(r.x).selfSubtract(i.x).selfMultiply(j.valueOf(t.y).selfSubtract(i.y)),u=j.valueOf(r.y).selfSubtract(i.y).selfMultiply(j.valueOf(t.x).selfSubtract(i.x)),c=h.subtract(u),l=c.selfDivide(a).doubleValue(),d=j.valueOf(t.x).selfAdd(j.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),g=j.valueOf(e.x).selfSubtract(t.x).selfMultiply(j.valueOf(t.y).selfSubtract(i.y)),p=j.valueOf(e.y).selfSubtract(t.y).selfMultiply(j.valueOf(t.x).selfSubtract(i.x)),_=g.subtract(p),w=_.selfDivide(a).doubleValue(),P=j.valueOf(i.y).selfAdd(j.valueOf(r.y).selfSubtract(i.y).selfMultiply(w)).doubleValue();return new L(d,P)},wi.orientationIndexFilter=function(t,e,i){var r=null,s=(t.x-i.x)*(e.y-i.y),o=(t.y-i.y)*(e.x-i.x),a=s-o;if(s>0){if(o<=0)return wi.signum(a);r=s+o}else if(s<0){if(o>=0)return wi.signum(a);r=-s-o}else return wi.signum(a);var h=wi.DP_SAFE_EPSILON*r;return a>=h||-a>=h?wi.signum(a):2},wi.signum=function(t){return t>0?1:t<0?-1:0},ay.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(wi,ay);var zt=function(){},ll={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ll.X.get=function(){return 0},ll.Y.get=function(){return 1},ll.Z.get=function(){return 2},ll.M.get=function(){return 3},zt.prototype.setOrdinate=function(t,e,i){},zt.prototype.size=function(){},zt.prototype.getOrdinate=function(t,e){},zt.prototype.getCoordinate=function(){},zt.prototype.getCoordinateCopy=function(t){},zt.prototype.getDimension=function(){},zt.prototype.getX=function(t){},zt.prototype.clone=function(){},zt.prototype.expandEnvelope=function(t){},zt.prototype.copy=function(){},zt.prototype.getY=function(t){},zt.prototype.toCoordinateArray=function(){},zt.prototype.interfaces_=function(){return[zc]},zt.prototype.getClass=function(){return zt},Object.defineProperties(zt,ll);var hy=function(){},lh=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}(hy),We=function(){};We.arraycopy=function(t,e,i,r,s){for(var o=0,a=e;a<e+s;a++)i[r+o]=t[a],o++},We.getProperty=function(t){return{"line.separator":`
66
- `}[t]};var Cn=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],i=arguments[1];this.x=e,this.y=i,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var r=arguments[0],s=arguments[1];this.x=r.y*s.w-s.y*r.w,this.y=s.x*r.w-r.x*s.w,this.w=r.x*s.y-s.x*r.y}else if(arguments[0]instanceof L&&arguments[1]instanceof L){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 h=arguments[0],u=arguments[1],c=arguments[2];this.x=h,this.y=u,this.w=c}else if(arguments.length===4){var l=arguments[0],d=arguments[1],g=arguments[2],p=arguments[3],_=l.y-d.y,w=d.x-l.x,P=l.x*d.y-d.x*l.y,v=g.y-p.y,E=p.x-g.x,m=g.x*p.y-p.x*g.y;this.x=w*m-E*P,this.y=v*P-_*m,this.w=_*E-v*w}};Cn.prototype.getY=function(){var t=this.y/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new lh;return t},Cn.prototype.getX=function(){var t=this.x/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new lh;return t},Cn.prototype.getCoordinate=function(){var t=new L;return t.x=this.getX(),t.y=this.getY(),t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.intersection=function(t,e,i,r){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,h=i.y-r.y,u=r.x-i.x,c=i.x*r.y-r.x*i.y,l=o*c-u*a,d=h*a-s*c,g=s*u-h*o,p=l/g,_=d/g;if(Pt.isNaN(p)||Pt.isInfinite(p)||Pt.isNaN(_)||Pt.isInfinite(_))throw new lh;return new L(p,_)};var ct=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 L){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 i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],h=arguments[3];this.init(s,o,a,h)}},uy={serialVersionUID:{configurable:!0}};ct.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ct.prototype.equals=function(t){if(!(t instanceof ct))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},ct.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ct;var e=this._minx>t._minx?this._minx:t._minx,i=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new ct(e,r,i,s)},ct.prototype.isNull=function(){return this._maxx<this._minx},ct.prototype.getMaxX=function(){return this._maxx},ct.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof ct){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 i=arguments[0],r=arguments[1];return this.isNull()?!1:i>=this._minx&&i<=this._maxx&&r>=this._miny&&r<=this._maxy}},ct.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ct){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 L){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.isNull()?!1:!(i>this._maxx||i<this._minx||r>this._maxy||r<this._miny)}},ct.prototype.getMinY=function(){return this._miny},ct.prototype.getMinX=function(){return this._minx},ct.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ct){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=r,this._maxy=r):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},ct.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ct.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ct.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},ct.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ct.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ct.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ct.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ct.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ct.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ct.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ct){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.covers(i,r)}},ct.prototype.centre=function(){return this.isNull()?null:new L((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ct.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ct){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],h=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<h?(this._miny=a,this._maxy=h):(this._miny=h,this._maxy=a)}},ct.prototype.getMaxY=function(){return this._maxy},ct.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var i=0;return this._maxy<t._miny?i=t._miny-this._maxy:this._miny>t._maxy&&(i=this._miny-t._maxy),e===0?i:i===0?e:Math.sqrt(e*e+i*i)},ct.prototype.hashCode=function(){var t=17;return t=37*t+L.hashCode(this._minx),t=37*t+L.hashCode(this._maxx),t=37*t+L.hashCode(this._miny),t=37*t+L.hashCode(this._maxy),t},ct.prototype.interfaces_=function(){return[hn,un]},ct.prototype.getClass=function(){return ct},ct.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2];return i.x>=(t.x<e.x?t.x:e.x)&&i.x<=(t.x>e.x?t.x:e.x)&&i.y>=(t.y<e.y?t.y:e.y)&&i.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],h=Math.min(o.x,a.x),u=Math.max(o.x,a.x),c=Math.min(r.x,s.x),l=Math.max(r.x,s.x);return!(c>u||l<h||(h=Math.min(o.y,a.y),u=Math.max(o.y,a.y),c=Math.min(r.y,s.y),l=Math.max(r.y,s.y),c>u)||l<h)}},uy.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ct,uy);var Un={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*$/},Uc=function(t){this.geometryFactory=t||new Ft};Uc.prototype.read=function(t){var e,i,r;t=t.replace(/[\n\r]/g," ");var s=Un.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=Un.emptyTypeStr.exec(t),s[2]=void 0),s&&(i=s[1].toLowerCase(),r=s[2],ch[i]&&(e=ch[i].apply(this,[r]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Uc.prototype.write=function(t){return this.extractGeometry(t)},Uc.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Jr[e])return null;var i=e.toUpperCase(),r;return t.isEmpty()?r=i+" EMPTY":r=i+"("+Jr[e].apply(this,[t])+")",r};var Jr={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Jr.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push("("+Jr.point.apply(e,[t._geometries[r]])+")");return i.join(",")},linestring:function(t){for(var e=this,i=[],r=0,s=t._points._coordinates.length;r<s;++r)i.push(Jr.coordinate.apply(e,[t._points._coordinates[r]]));return i.join(",")},linearring:function(t){for(var e=this,i=[],r=0,s=t._points._coordinates.length;r<s;++r)i.push(Jr.coordinate.apply(e,[t._points._coordinates[r]]));return i.join(",")},multilinestring:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push("("+Jr.linestring.apply(e,[t._geometries[r]])+")");return i.join(",")},polygon:function(t){var e=this,i=[];i.push("("+Jr.linestring.apply(this,[t._shell])+")");for(var r=0,s=t._holes.length;r<s;++r)i.push("("+Jr.linestring.apply(e,[t._holes[r]])+")");return i.join(",")},multipolygon:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push("("+Jr.polygon.apply(e,[t._geometries[r]])+")");return i.join(",")},geometrycollection:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push(e.extractGeometry(t._geometries[r]));return i.join(",")}},ch={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(Un.spaces);return this.geometryFactory.createPoint(new L(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var i,r=t.trim().split(","),s=[],o=0,a=r.length;o<a;++o)i=r[o].replace(Un.trimParens,"$1"),s.push(ch.point.apply(e,[i]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),i=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(Un.spaces),i.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),i=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(Un.spaces),i.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var i,r=t.trim().split(Un.parenComma),s=[],o=0,a=r.length;o<a;++o)i=r[o].replace(Un.trimParens,"$1"),s.push(ch.linestring.apply(e,[i]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var i,r,s,o=t.trim().split(Un.parenComma),a,h=[],u=0,c=o.length;u<c;++u)i=o[u].replace(Un.trimParens,"$1"),r=ch.linestring.apply(e,[i]),s=e.geometryFactory.createLinearRing(r._points),u===0?a=s:h.push(s);return this.geometryFactory.createPolygon(a,h)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var i,r=t.trim().split(Un.doubleParenComma),s=[],o=0,a=r.length;o<a;++o)i=r[o].replace(Un.trimParens,"$1"),s.push(ch.polygon.apply(e,[i]));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 i=t.trim().split("|"),r=[],s=0,o=i.length;s<o;++s)r.push(e.read(i[s]));return this.geometryFactory.createGeometryCollection(r)}},Pn=function(t){this.parser=new Uc(t)};Pn.prototype.write=function(t){return this.parser.write(t)},Pn.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var $r=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),jc=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}($r),Nt=function(){};Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.shouldNeverReachHere=function(){if(arguments.length===0)Nt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new jc("Should never reach here"+(t!==null?": "+t:""))}},Nt.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],Nt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new jc:new jc(e)},Nt.equals=function(){var t,e,i;if(arguments.length===2)t=arguments[0],e=arguments[1],Nt.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],i=arguments[2],!e.equals(t)))throw new jc("Expected "+t+" but encountered "+e+(i!==null?": "+i:""))};var ge=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 L,this._intPt[1]=new L,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Ko={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ge.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ge.prototype.getTopologySummary=function(){var t=new Vn;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ge.prototype.computeIntersection=function(t,e,i,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=i,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,i,r)},ge.prototype.getIntersectionNum=function(){return this._result},ge.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),i=this.getEdgeDistance(t,1);e>i?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ge.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ge.prototype.setPrecisionModel=function(t){this._precisionModel=t},ge.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],i=0;i<this._result;i++)if(!(t._intPt[i].equals2D(t._inputLines[e][0])||t._intPt[i].equals2D(t._inputLines[e][1])))return!0;return!1}},ge.prototype.getIntersection=function(t){return this._intPt[t]},ge.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ge.prototype.hasIntersection=function(){return this._result!==ge.NO_INTERSECTION},ge.prototype.getEdgeDistance=function(t,e){var i=ge.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return i},ge.prototype.isCollinear=function(){return this._result===ge.COLLINEAR_INTERSECTION},ge.prototype.toString=function(){return Pn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Pn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ge.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ge.prototype.isIntersection=function(t){for(var e=this,i=0;i<this._result;i++)if(e._intPt[i].equals2D(t))return!0;return!1},ge.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.computeEdgeDistance=function(t,e,i){var r=Math.abs(i.x-e.x),s=Math.abs(i.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(i))r>s?o=r:o=s;else{var a=Math.abs(t.x-e.x),h=Math.abs(t.y-e.y);r>s?o=a:o=h,o===0&&!t.equals(e)&&(o=Math.max(a,h))}return Nt.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},ge.nonRobustComputeEdgeDistance=function(t,e,i){var r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s);return Nt.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},Ko.DONT_INTERSECT.get=function(){return 0},Ko.DO_INTERSECT.get=function(){return 1},Ko.COLLINEAR.get=function(){return 2},Ko.NO_INTERSECTION.get=function(){return 0},Ko.POINT_INTERSECTION.get=function(){return 1},Ko.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ge,Ko);var lo=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(i){var r=new ct(this._inputLines[0][0],this._inputLines[0][1]),s=new ct(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(i)&&s.contains(i)},t.prototype.computeIntersection=function(){if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,ct.intersects(r,s,i)&&et.orientationIndex(r,s,i)===0&&et.orientationIndex(s,r,i)===0)return this._isProper=!0,(i.equals(r)||i.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(i,r,s,o,a){a.x=this.smallestInAbsValue(i.x,r.x,s.x,o.x),a.y=this.smallestInAbsValue(i.y,r.y,s.y,o.y),i.x-=a.x,i.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(i,r,s,o){var a=null;try{a=Cn.intersection(i,r,s,o)}catch(h){if(h instanceof lh)a=t.nearestEndpoint(i,r,s,o);else throw h}finally{}return a},t.prototype.intersection=function(i,r,s,o){var a=this.intersectionWithNormalization(i,r,s,o);return this.isInSegmentEnvelopes(a)||(a=new L(t.nearestEndpoint(i,r,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(i,r,s,o){var a=i,h=Math.abs(a);return Math.abs(r)<h&&(a=r,h=Math.abs(r)),Math.abs(s)<h&&(a=s,h=Math.abs(s)),Math.abs(o)<h&&(a=o),a},t.prototype.checkDD=function(i,r,s,o,a){var h=wi.intersection(i,r,s,o),u=this.isInSegmentEnvelopes(h);We.out.println("DD in env = "+u+" --------------------- "+h),a.distance(h)>1e-4&&We.out.println("Distance = "+a.distance(h))},t.prototype.intersectionWithNormalization=function(i,r,s,o){var a=new L(i),h=new L(r),u=new L(s),c=new L(o),l=new L;this.normalizeToEnvCentre(a,h,u,c,l);var d=this.safeHCoordinateIntersection(a,h,u,c);return d.x+=l.x,d.y+=l.y,d},t.prototype.computeCollinearIntersection=function(i,r,s,o){var a=ct.intersects(i,r,s),h=ct.intersects(i,r,o),u=ct.intersects(s,o,i),c=ct.intersects(s,o,r);return a&&h?(this._intPt[0]=s,this._intPt[1]=o,n.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=i,this._intPt[1]=r,n.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!h&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!h&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):h&&u?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):h&&c?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!a&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(i,r,s,o,a){var h=i.x<r.x?i.x:r.x,u=i.y<r.y?i.y:r.y,c=i.x>r.x?i.x:r.x,l=i.y>r.y?i.y:r.y,d=s.x<o.x?s.x:o.x,g=s.y<o.y?s.y:o.y,p=s.x>o.x?s.x:o.x,_=s.y>o.y?s.y:o.y,w=h>d?h:d,P=c<p?c:p,v=u>g?u:g,E=l<_?l:_,m=(w+P)/2,S=(v+E)/2;a.x=m,a.y=S,i.x-=a.x,i.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(i,r,s,o){if(this._isProper=!1,!ct.intersects(i,r,s,o))return n.NO_INTERSECTION;var a=et.orientationIndex(i,r,s),h=et.orientationIndex(i,r,o);if(a>0&&h>0||a<0&&h<0)return n.NO_INTERSECTION;var u=et.orientationIndex(s,o,i),c=et.orientationIndex(s,o,r);if(u>0&&c>0||u<0&&c<0)return n.NO_INTERSECTION;var l=a===0&&h===0&&u===0&&c===0;return l?this.computeCollinearIntersection(i,r,s,o):(a===0||h===0||u===0||c===0?(this._isProper=!1,i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:r.equals2D(s)||r.equals2D(o)?this._intPt[0]=r:a===0?this._intPt[0]=new L(s):h===0?this._intPt[0]=new L(o):u===0?this._intPt[0]=new L(i):c===0&&(this._intPt[0]=new L(r))):(this._isProper=!0,this._intPt[0]=this.intersection(i,r,s,o)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(i,r,s,o){var a=i,h=et.distancePointLine(i,s,o),u=et.distancePointLine(r,s,o);return u<h&&(h=u,a=r),u=et.distancePointLine(s,i,r),u<h&&(h=u,a=s),u=et.distancePointLine(o,i,r),u<h&&(h=u,a=o),a},t}(ge),Qo=function(){};Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo},Qo.orientationIndex=function(t,e,i){var r=e.x-t.x,s=e.y-t.y,o=i.x-e.x,a=i.y-e.y;return Qo.signOfDet2x2(r,s,o,a)},Qo.signOfDet2x2=function(t,e,i,r){var s=null,o=null,a=null;if(s=1,t===0||r===0)return e===0||i===0?0:e>0?i>0?-s:s:i>0?s:-s;if(e===0||i===0)return r>0?t>0?s:-s:t>0?-s:s;if(e>0?r>0?e<=r||(s=-s,o=t,t=i,i=o,o=e,e=r,r=o):e<=-r?(s=-s,i=-i,r=-r):(o=t,t=-i,i=o,o=e,e=-r,r=o):r>0?-e<=r?(s=-s,t=-t,e=-e):(o=-t,t=i,i=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,i=-i,r=-r):(s=-s,o=-t,t=-i,i=o,o=-e,e=-r,r=o),t>0)if(i>0){if(!(t<=i))return s}else return s;else{if(i>0)return-s;if(t>=i)s=-s,t=-t,i=-i;else return-s}for(;;){if(a=Math.floor(i/t),i=i-a*t,r=r-a*e,r<0)return-s;if(r>e)return s;if(t>i+i){if(e<r+r)return s}else{if(e>r+r)return-s;i=t-i,r=e-r,s=-s}if(r===0)return i===0?0:-s;if(i===0||(a=Math.floor(t/i),t=t-a*i,e=e-a*r,e<0))return s;if(e>r)return-s;if(i>t+t){if(r<e+e)return-s}else{if(r>e+e)return s;t=i-t,e=r-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var jn=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};jn.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var i=t.x,r=e.x;return i>r&&(i=e.x,r=t.x),this._p.x>=i&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,h=e.y-this._p.y,u=Qo.signOfDet2x2(s,o,a,h);if(u===0)return this._isPointOnSegment=!0,null;h<o&&(u=-u),u>0&&this._crossingCount++}},jn.prototype.isPointInPolygon=function(){return this.getLocation()!==V.EXTERIOR},jn.prototype.getLocation=function(){return this._isPointOnSegment?V.BOUNDARY:this._crossingCount%2===1?V.INTERIOR:V.EXTERIOR},jn.prototype.isOnSegment=function(){return this._isPointOnSegment},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.locatePointInRing=function(){if(arguments[0]instanceof L&&wt(arguments[1],zt)){for(var t=arguments[0],e=arguments[1],i=new jn(t),r=new L,s=new L,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,s),i.countSegment(r,s),i.isOnSegment())return i.getLocation();return i.getLocation()}else if(arguments[0]instanceof L&&arguments[1]instanceof Array){for(var a=arguments[0],h=arguments[1],u=new jn(a),c=1;c<h.length;c++){var l=h[c],d=h[c-1];if(u.countSegment(l,d),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var et=function(){},Zo={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.orientationIndex=function(t,e,i){return wi.orientationIndex(t,e,i)},et.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,i=t[0].x,r=1;r<t.length-1;r++){var s=t[r].x-i,o=t[r+1].y,a=t[r-1].y;e+=s*(a-o)}return e/2}else if(wt(arguments[0],zt)){var h=arguments[0],u=h.size();if(u<3)return 0;var c=new L,l=new L,d=new L;h.getCoordinate(0,l),h.getCoordinate(1,d);var g=l.x;d.x-=g;for(var p=0,_=1;_<u-1;_++)c.y=l.y,l.x=d.x,l.y=d.y,h.getCoordinate(_+1,d),d.x-=g,p+=l.x*(c.y-d.y);return p/2}},et.distanceLineLine=function(t,e,i,r){if(t.equals(e))return et.distancePointLine(t,i,r);if(i.equals(r))return et.distancePointLine(r,t,e);var s=!1;if(!ct.intersects(t,e,i,r))s=!0;else{var o=(e.x-t.x)*(r.y-i.y)-(e.y-t.y)*(r.x-i.x);if(o===0)s=!0;else{var a=(t.y-i.y)*(r.x-i.x)-(t.x-i.x)*(r.y-i.y),h=(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y),u=h/o,c=a/o;(c<0||c>1||u<0||u>1)&&(s=!0)}}return s?Yi.min(et.distancePointLine(t,i,r),et.distancePointLine(e,i,r),et.distancePointLine(i,t,e),et.distancePointLine(r,t,e)):0},et.isPointInRing=function(t,e){return et.locatePointInRing(t,e)!==V.EXTERIOR},et.computeLength=function(t){var e=t.size();if(e<=1)return 0;var i=0,r=new L;t.getCoordinate(0,r);for(var s=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var h=r.x,u=r.y,c=h-s,l=u-o;i+=Math.sqrt(c*c+l*l),s=h,o=u}return i},et.isCCW=function(t){var e=t.length-1;if(e<3)throw new ce("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=t[0],r=0,s=1;s<=e;s++){var o=t[s];o.y>i.y&&(i=o,r=s)}var a=r;do a=a-1,a<0&&(a=e);while(t[a].equals2D(i)&&a!==r);var h=r;do h=(h+1)%e;while(t[h].equals2D(i)&&h!==r);var u=t[a],c=t[h];if(u.equals2D(i)||c.equals2D(i)||u.equals2D(c))return!1;var l=et.computeOrientation(u,i,c),d=!1;return l===0?d=u.x>c.x:d=l>0,d},et.locatePointInRing=function(t,e){return jn.locatePointInRing(t,e)},et.distancePointLinePerpendicular=function(t,e,i){var r=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),s=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/r;return Math.abs(s)*Math.sqrt(r)},et.computeOrientation=function(t,e,i){return et.orientationIndex(t,e,i)},et.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ce("Line array must contain at least one vertex");for(var i=t.distance(e[0]),r=0;r<e.length-1;r++){var s=et.distancePointLine(t,e[r],e[r+1]);s<i&&(i=s)}return i}else if(arguments.length===3){var o=arguments[0],a=arguments[1],h=arguments[2];if(a.x===h.x&&a.y===h.y)return o.distance(a);var u=(h.x-a.x)*(h.x-a.x)+(h.y-a.y)*(h.y-a.y),c=((o.x-a.x)*(h.x-a.x)+(o.y-a.y)*(h.y-a.y))/u;if(c<=0)return o.distance(a);if(c>=1)return o.distance(h);var l=((a.y-o.y)*(h.x-a.x)-(a.x-o.x)*(h.y-a.y))/u;return Math.abs(l)*Math.sqrt(u)}},et.isOnLine=function(t,e){for(var i=new lo,r=1;r<e.length;r++){var s=e[r-1],o=e[r];if(i.computeIntersection(t,s,o),i.hasIntersection())return!0}return!1},Zo.CLOCKWISE.get=function(){return-1},Zo.RIGHT.get=function(){return et.CLOCKWISE},Zo.COUNTERCLOCKWISE.get=function(){return 1},Zo.LEFT.get=function(){return et.COUNTERCLOCKWISE},Zo.COLLINEAR.get=function(){return 0},Zo.STRAIGHT.get=function(){return et.COLLINEAR},Object.defineProperties(et,Zo);var Kr=function(){};Kr.prototype.filter=function(t){},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr};var yt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},_r={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}};yt.prototype.isGeometryCollection=function(){return this.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION},yt.prototype.getFactory=function(){return this._factory},yt.prototype.getGeometryN=function(t){return this},yt.prototype.getArea=function(){return 0},yt.prototype.isRectangle=function(){return!1},yt.prototype.equals=function(){if(arguments[0]instanceof yt){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof yt))return!1;var i=e;return this.equalsExact(i)}},yt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},yt.prototype.geometryChanged=function(){this.apply(yt.geometryChangedFilter)},yt.prototype.geometryChangedAction=function(){this._envelope=null},yt.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},yt.prototype.getLength=function(){return 0},yt.prototype.getNumGeometries=function(){return 1},yt.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 i=arguments[0],r=arguments[1];return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(i,r)}},yt.prototype.getUserData=function(){return this._userData},yt.prototype.getSRID=function(){return this._SRID},yt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},yt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION)throw new ce("This method does not support GeometryCollection arguments")},yt.prototype.equal=function(t,e,i){return i===0?t.equals(e):t.distance(e)<=i},yt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},yt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},yt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ct(this._envelope)},yt.prototype.setSRID=function(t){this._SRID=t},yt.prototype.setUserData=function(t){this._userData=t},yt.prototype.compare=function(t,e){for(var i=t.iterator(),r=e.iterator();i.hasNext()&&r.hasNext();){var s=i.next(),o=r.next(),a=s.compareTo(o);if(a!==0)return a}return i.hasNext()?1:r.hasNext()?-1:0},yt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},yt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===yt.SORTINDEX_MULTIPOINT||this.getSortIndex()===yt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===yt.SORTINDEX_MULTIPOLYGON},yt.prototype.interfaces_=function(){return[zc,hn,un]},yt.prototype.getClass=function(){return yt},yt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},yt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},_r.serialVersionUID.get=function(){return 8763622679187377e3},_r.SORTINDEX_POINT.get=function(){return 0},_r.SORTINDEX_MULTIPOINT.get=function(){return 1},_r.SORTINDEX_LINESTRING.get=function(){return 2},_r.SORTINDEX_LINEARRING.get=function(){return 3},_r.SORTINDEX_MULTILINESTRING.get=function(){return 4},_r.SORTINDEX_POLYGON.get=function(){return 5},_r.SORTINDEX_MULTIPOLYGON.get=function(){return 6},_r.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},_r.geometryChangedFilter.get=function(){return Tg},Object.defineProperties(yt,_r);var Tg=function(){};Tg.interfaces_=function(){return[Kr]},Tg.filter=function(t){t.geometryChangedAction()};var yr=function(){};yr.prototype.filter=function(t){},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var ln=function(){},Qr={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}};ln.prototype.isInBoundary=function(t){},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},Qr.Mod2BoundaryNodeRule.get=function(){return dh},Qr.EndPointBoundaryNodeRule.get=function(){return fh},Qr.MultiValentEndPointBoundaryNodeRule.get=function(){return gh},Qr.MonoValentEndPointBoundaryNodeRule.get=function(){return ph},Qr.MOD2_BOUNDARY_RULE.get=function(){return new dh},Qr.ENDPOINT_BOUNDARY_RULE.get=function(){return new fh},Qr.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new gh},Qr.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ph},Qr.OGC_SFS_BOUNDARY_RULE.get=function(){return ln.MOD2_BOUNDARY_RULE},Object.defineProperties(ln,Qr);var dh=function(){};dh.prototype.isInBoundary=function(t){return t%2===1},dh.prototype.interfaces_=function(){return[ln]},dh.prototype.getClass=function(){return dh};var fh=function(){};fh.prototype.isInBoundary=function(t){return t>0},fh.prototype.interfaces_=function(){return[ln]},fh.prototype.getClass=function(){return fh};var gh=function(){};gh.prototype.isInBoundary=function(t){return t>1},gh.prototype.interfaces_=function(){return[ln]},gh.prototype.getClass=function(){return gh};var ph=function(){};ph.prototype.isInBoundary=function(t){return t===1},ph.prototype.interfaces_=function(){return[ln]},ph.prototype.getClass=function(){return ph};var Oe=function(){};Oe.prototype.add=function(){},Oe.prototype.addAll=function(){},Oe.prototype.isEmpty=function(){},Oe.prototype.iterator=function(){},Oe.prototype.size=function(){},Oe.prototype.toArray=function(){},Oe.prototype.remove=function(){};function Ng(n){this.message=n||""}Ng.prototype=new Error,Ng.prototype.name="IndexOutOfBoundsException";var vh=function(){};vh.prototype.hasNext=function(){},vh.prototype.next=function(){},vh.prototype.remove=function(){};var bn=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}(Oe);function mh(n){this.message=n||""}mh.prototype=new Error,mh.prototype.name="NoSuchElementException";var Z=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Oe&&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,Oe]},t.prototype.add=function(i){return arguments.length===1?this.array_.push(i):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(i){for(var r=this,s=i.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.set=function(i,r){var s=this.array_[i];return this.array_[i]=r,s},t.prototype.iterator=function(){return new MM(this)},t.prototype.get=function(i){if(i<0||i>=this.size())throw new Ng;return this.array_[i]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var i=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(i.array_[s]);return r},t.prototype.remove=function(i){for(var r=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(r.array_[o]===i){r.array_.splice(o,1),s=!0;break}return s},t}(bn),MM=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 mh;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(i){return this.arrayList_.set(this.position_-1,i)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(vh),cl=function(n){function t(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.ensureCapacity(i.length),this.add(i,!0)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.ensureCapacity(r.length),this.add(r,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(r){return this.get(r)},t.prototype.addAll=function(){var r=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,h=s.iterator();h.hasNext();)r.add(h.next(),o),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var r=this,s=n.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,r.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var r=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 L&&typeof arguments[1]=="boolean"){var h=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(h))return null}n.prototype.add.call(this,h)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var l=arguments[0],d=arguments[1];return this.add(l,d),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],_=arguments[2];if(_)for(var w=0;w<g.length;w++)r.add(g[w],p);else for(var P=g.length-1;P>=0;P--)r.add(g[P],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof L){var v=arguments[0],E=arguments[1],m=arguments[2];if(!m){var S=this.size();if(S>0){if(v>0){var C=this.get(v-1);if(C.equals2D(E))return null}if(v<S){var b=this.get(v);if(b.equals2D(E))return null}}}n.prototype.add.call(this,v,E)}}else if(arguments.length===4){var I=arguments[0],M=arguments[1],O=arguments[2],x=arguments[3],T=1;O>x&&(T=-1);for(var A=O;A!==x;A+=T)r.add(I[A],M);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new L(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(Z),Lt=function(){},qc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};qc.ForwardComparator.get=function(){return dl},qc.BidirectionalComparator.get=function(){return _h},qc.coordArrayType.get=function(){return new Array(0).fill(null)},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Lt.ptNotInList=function(t,e){for(var i=0;i<t.length;i++){var r=t[i];if(Lt.indexOf(r,e)<0)return r}return null},Lt.scroll=function(t,e){var i=Lt.indexOf(e,t);if(i<0)return null;var r=new Array(t.length).fill(null);We.arraycopy(t,i,r,0,t.length-i),We.arraycopy(t,0,r,t.length-i,i),We.arraycopy(r,0,t,0,t.length)},Lt.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 i=0;i<t.length;i++)if(!t[i].equals(e[i]))return!1;return!0}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(r===s)return!0;if(r===null||s===null||r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(o.compare(r[a],s[a])!==0)return!1;return!0}},Lt.intersection=function(t,e){for(var i=new cl,r=0;r<t.length;r++)e.intersects(t[r])&&i.add(t[r],!0);return i.toCoordinateArray()},Lt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Lt.removeRepeatedPoints=function(t){if(!Lt.hasRepeatedPoints(t))return t;var e=new cl(t,!1);return e.toCoordinateArray()},Lt.reverse=function(t){for(var e=t.length-1,i=Math.trunc(e/2),r=0;r<=i;r++){var s=t[r];t[r]=t[e-r],t[e-r]=s}},Lt.removeNull=function(t){for(var e=0,i=0;i<t.length;i++)t[i]!==null&&e++;var r=new Array(e).fill(null);if(e===0)return r;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(r[s++]=t[o]);return r},Lt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),i=0;i<t.length;i++)e[i]=new L(t[i]);return e}else if(arguments.length===5)for(var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],h=arguments[4],u=0;u<h;u++)o[a+u]=new L(r[s+u])},Lt.isEqualReversed=function(t,e){for(var i=0;i<t.length;i++){var r=t[i],s=e[t.length-i-1];if(r.compareTo(s)!==0)return!1}return!0},Lt.envelope=function(t){for(var e=new ct,i=0;i<t.length;i++)e.expandToInclude(t[i]);return e},Lt.toCoordinateArray=function(t){return t.toArray(Lt.coordArrayType)},Lt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Lt.indexOf=function(t,e){for(var i=0;i<e.length;i++)if(t.equals(e[i]))return i;return-1},Lt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var i=t.length-1-e,r=t[e].compareTo(t[i]);if(r!==0)return r}return 1},Lt.compare=function(t,e){for(var i=0;i<t.length&&i<e.length;){var r=t[i].compareTo(e[i]);if(r!==0)return r;i++}return i<e.length?-1:i<t.length?1:0},Lt.minCoordinate=function(t){for(var e=null,i=0;i<t.length;i++)(e===null||e.compareTo(t[i])>0)&&(e=t[i]);return e},Lt.extract=function(t,e,i){e=Yi.clamp(e,0,t.length),i=Yi.clamp(i,-1,t.length);var r=i-e+1;i<0&&(r=0),e>=t.length&&(r=0),i<e&&(r=0);var s=new Array(r).fill(null);if(r===0)return s;for(var o=0,a=e;a<=i;a++)s[o++]=t[a];return s},Object.defineProperties(Lt,qc);var dl=function(){};dl.prototype.compare=function(t,e){var i=t,r=e;return Lt.compare(i,r)},dl.prototype.interfaces_=function(){return[hh]},dl.prototype.getClass=function(){return dl};var _h=function(){};_h.prototype.compare=function(t,e){var i=t,r=e;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(i.length===0)return 0;var s=Lt.compare(i,r),o=Lt.isEqualReversed(i,r);return o?0:s},_h.prototype.OLDcompare=function(t,e){var i=t,r=e;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(i.length===0)return 0;for(var s=Lt.increasingDirection(i),o=Lt.increasingDirection(r),a=s>0?0:i.length-1,h=o>0?0:i.length-1,u=0;u<i.length;u++){var c=i[a].compareTo(r[h]);if(c!==0)return c;a+=s,h+=o}return 0},_h.prototype.interfaces_=function(){return[hh]},_h.prototype.getClass=function(){return _h};var ta=function(){};ta.prototype.get=function(){},ta.prototype.put=function(){},ta.prototype.size=function(){},ta.prototype.values=function(){},ta.prototype.entrySet=function(){};var TM=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}(ta);function fl(n){this.message=n||""}fl.prototype=new Error,fl.prototype.name="OperationNotSupported";function Wc(){}Wc.prototype=new Oe,Wc.prototype.contains=function(){};var Og=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Oe&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(i){for(var r=this,s=0,o=this.array_.length;s<o;s++){var a=r.array_[s];if(a===i)return!0}return!1},t.prototype.add=function(i){return this.contains(i)?!1:(this.array_.push(i),!0)},t.prototype.addAll=function(i){for(var r=this,s=i.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.remove=function(i){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 i=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(i.array_[s]);return r},t.prototype.iterator=function(){return new NM(this)},t}(Wc),NM=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 mh;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new fl},t}(vh),Zr=0,co=1;function ly(n){return n===null?Zr:n.color}function ne(n){return n===null?null:n.parent}function ts(n,t){n!==null&&(n.color=t)}function Dg(n){return n===null?null:n.left}function cy(n){return n===null?null:n.right}function ii(){this.root_=null,this.size_=0}ii.prototype=new TM,ii.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},ii.prototype.put=function(n,t){if(this.root_===null)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:Zr,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,i,r;do if(i=e,r=n.compareTo(e.key),r<0)e=e.left;else if(r>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:i,color:Zr,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?i.left=o:i.right=o,this.fixAfterInsertion(o),this.size_++,null},ii.prototype.fixAfterInsertion=function(n){var t=this;for(n.color=co;n!=null&&n!==this.root_&&n.parent.color===co;)if(ne(n)===Dg(ne(ne(n)))){var e=cy(ne(ne(n)));ly(e)===co?(ts(ne(n),Zr),ts(e,Zr),ts(ne(ne(n)),co),n=ne(ne(n))):(n===cy(ne(n))&&(n=ne(n),t.rotateLeft(n)),ts(ne(n),Zr),ts(ne(ne(n)),co),t.rotateRight(ne(ne(n))))}else{var i=Dg(ne(ne(n)));ly(i)===co?(ts(ne(n),Zr),ts(i,Zr),ts(ne(ne(n)),co),n=ne(ne(n))):(n===Dg(ne(n))&&(n=ne(n),t.rotateRight(n)),ts(ne(n),Zr),ts(ne(ne(n)),co),t.rotateLeft(ne(ne(n))))}this.root_.color=Zr},ii.prototype.values=function(){var n=new Z,t=this.getFirstEntry();if(t!==null)for(n.add(t.value);(t=ii.successor(t))!==null;)n.add(t.value);return n},ii.prototype.entrySet=function(){var n=new Og,t=this.getFirstEntry();if(t!==null)for(n.add(t);(t=ii.successor(t))!==null;)n.add(t);return n},ii.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}},ii.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}},ii.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},ii.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,i=n;e!==null&&i===e.right;)i=e,e=e.parent;return e}},ii.prototype.size=function(){return this.size_};var gl=function(){};gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl};function dy(){}dy.prototype=new Wc;function qn(){this.array_=[],arguments[0]instanceof Oe&&this.addAll(arguments[0])}qn.prototype=new dy,qn.prototype.contains=function(n){for(var t=this,e=0,i=this.array_.length;e<i;e++){var r=t.array_[e];if(r.compareTo(n)===0)return!0}return!1},qn.prototype.add=function(n){var t=this;if(this.contains(n))return!1;for(var e=0,i=this.array_.length;e<i;e++){var r=t.array_[e];if(r.compareTo(n)===1)return t.array_.splice(e,0,n),!0}return this.array_.push(n),!0},qn.prototype.addAll=function(n){for(var t=this,e=n.iterator();e.hasNext();)t.add(e.next());return!0},qn.prototype.remove=function(n){throw new fl},qn.prototype.size=function(){return this.array_.length},qn.prototype.isEmpty=function(){return this.array_.length===0},qn.prototype.toArray=function(){for(var n=this,t=[],e=0,i=this.array_.length;e<i;e++)t.push(n.array_[e]);return t},qn.prototype.iterator=function(){return new Hc(this)};var Hc=function(n){this.treeSet_=n,this.position_=0};Hc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new mh;return this.treeSet_.array_[this.position_++]},Hc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Hc.prototype.remove=function(){throw new fl};var fo=function(){};fo.sort=function(){var t=arguments[0],e,i,r,s;if(arguments.length===1)s=function(a,h){return a.compareTo(h)},t.sort(s);else if(arguments.length===2)r=arguments[1],s=function(a,h){return r.compare(a,h)},t.sort(s);else if(arguments.length===3){i=t.slice(arguments[1],arguments[2]),i.sort();var o=t.slice(0,arguments[1]).concat(i,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(i=t.slice(arguments[1],arguments[2]),r=arguments[3],s=function(a,h){return r.compare(a,h)},i.sort(s),o=t.slice(0,arguments[1]).concat(i,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},fo.asList=function(t){for(var e=new Z,i=0,r=t.length;i<r;i++)e.add(t[i]);return e};var Ht=function(){},In={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}};In.P.get=function(){return 0},In.L.get=function(){return 1},In.A.get=function(){return 2},In.FALSE.get=function(){return-1},In.TRUE.get=function(){return-2},In.DONTCARE.get=function(){return-3},In.SYM_FALSE.get=function(){return"F"},In.SYM_TRUE.get=function(){return"T"},In.SYM_DONTCARE.get=function(){return"*"},In.SYM_P.get=function(){return"0"},In.SYM_L.get=function(){return"1"},In.SYM_A.get=function(){return"2"},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.toDimensionSymbol=function(t){switch(t){case Ht.FALSE:return Ht.SYM_FALSE;case Ht.TRUE:return Ht.SYM_TRUE;case Ht.DONTCARE:return Ht.SYM_DONTCARE;case Ht.P:return Ht.SYM_P;case Ht.L:return Ht.SYM_L;case Ht.A:return Ht.SYM_A}throw new ce("Unknown dimension value: "+t)},Ht.toDimensionValue=function(t){switch(ul.toUpperCase(t)){case Ht.SYM_FALSE:return Ht.FALSE;case Ht.SYM_TRUE:return Ht.TRUE;case Ht.SYM_DONTCARE:return Ht.DONTCARE;case Ht.SYM_P:return Ht.P;case Ht.SYM_L:return Ht.L;case Ht.SYM_A:return Ht.A}throw new ce("Unknown dimension symbol: "+t)},Object.defineProperties(Ht,In);var Wn=function(){};Wn.prototype.filter=function(t){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var xn=function(){};xn.prototype.filter=function(t,e){},xn.prototype.isDone=function(){},xn.prototype.isGeometryChanged=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var ui=function(n){function t(i,r){if(n.call(this,r),this._geometries=i||[],n.hasNullElements(this._geometries))throw new ce("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 r=this,s=new ct,o=0;o<this._geometries.length;o++)s.expandToInclude(r._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(r){return this._geometries[r]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var r=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var h=r._geometries[a].getCoordinates(),u=0;u<h.length;u++)o++,s[o]=h[u];return s},t.prototype.getArea=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var r=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 h=0;h<this._geometries.length;h++)if(!r._geometries[h].equalsExact(a._geometries[h],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<this._geometries.length;s++)r._geometries[s].normalize();fo.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var r=this,s=Ht.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var r=this,s=Ht.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var s=arguments[0],o=new qn(fo.asList(this._geometries)),a=new qn(fo.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var h=arguments[0],u=arguments[1],c=h,l=this.getNumGeometries(),d=c.getNumGeometries(),g=0;g<l&&g<d;){var p=r.getGeometryN(g),_=c.getGeometryN(g),w=p.compareToSameClass(_,u);if(w!==0)return w;g++}return g<l?1:g<d?-1:0}},t.prototype.apply=function(){var r=this;if(wt(arguments[0],yr))for(var s=arguments[0],o=0;o<this._geometries.length;o++)r._geometries[o].apply(s);else if(wt(arguments[0],xn)){var a=arguments[0];if(this._geometries.length===0)return null;for(var h=0;h<this._geometries.length&&(r._geometries[h].apply(a),!a.isDone());h++);a.isGeometryChanged()&&this.geometryChanged()}else if(wt(arguments[0],Wn)){var u=arguments[0];u.filter(this);for(var c=0;c<this._geometries.length;c++)r._geometries[c].apply(u)}else if(wt(arguments[0],Kr)){var l=arguments[0];l.filter(this);for(var d=0;d<this._geometries.length;d++)r._geometries[d].apply(l)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Nt.shouldNeverReachHere(),null},t.prototype.clone=function(){var r=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]=r._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var r=this,s=0;s<this._geometries.length;s++)if(!r._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}(yt),go=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 yt.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?n.prototype.equalsExact.call(this,r,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Ht.FALSE:0},t.prototype.isClosed=function(){var r=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!r._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=r._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new cn(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[gl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(ui),cn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=ln.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=r}};cn.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)},cn.prototype.getBoundary=function(){return this._geom instanceof ve?this.boundaryLineString(this._geom):this._geom instanceof go?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},cn.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()])},cn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},cn.prototype.computeBoundaryCoordinates=function(t){var e=this,i=new Z;this._endpointMap=new ii;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);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(),h=a.getValue(),u=h.count;e._bnRule.isInBoundary(u)&&i.add(a.getKey())}return Lt.toCoordinateArray(i)},cn.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Xc,this._endpointMap.put(t,e)),e.count++},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},cn.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new cn(t);return e.getBoundary()}else if(arguments.length===2){var i=arguments[0],r=arguments[1],s=new cn(i,r);return s.getBoundary()}};var Xc=function(){this.count=null};Xc.prototype.interfaces_=function(){return[]},Xc.prototype.getClass=function(){return Xc};function OM(){}function DM(){}var AM=function(){};function RM(){}function LM(){}function FM(){}var dn=function(){},Ag={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.chars=function(t,e){for(var i=new Array(e).fill(null),r=0;r<e;r++)i[r]=t;return String(i)},dn.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new RM,i=new OM;return t.printStackTrace(i),e.toString()}else if(arguments.length===2){var r=arguments[0],s=arguments[1],o="";new DM(dn.getStackTrace(r));for(var a=new FM,h=0;h<s;h++)try{o+=a.readLine()+dn.NEWLINE}catch(u){if(u instanceof LM)Nt.shouldNeverReachHere();else throw u}finally{}return o}},dn.split=function(t,e){for(var i=e.length,r=new Z,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);r.add(a),s=s.substring(o+i),o=s.indexOf(e)}s.length>0&&r.add(s);for(var h=new Array(r.size()).fill(null),u=0;u<h.length;u++)h[u]=r.get(u);return h},dn.toString=function(){if(arguments.length===1){var t=arguments[0];return dn.SIMPLE_ORDINATE_FORMAT.format(t)}},dn.spaces=function(t){return dn.chars(" ",t)},Ag.NEWLINE.get=function(){return We.getProperty("line.separator")},Ag.SIMPLE_ORDINATE_FORMAT.get=function(){return new AM},Object.defineProperties(dn,Ag);var we=function(){};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.copyCoord=function(t,e,i,r){for(var s=Math.min(t.getDimension(),i.getDimension()),o=0;o<s;o++)i.setOrdinate(r,o,t.getOrdinate(e,o))},we.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,zt.X)===t.getOrdinate(e-1,zt.X)&&t.getOrdinate(0,zt.Y)===t.getOrdinate(e-1,zt.Y)},we.isEqual=function(t,e){var i=t.size(),r=e.size();if(i!==r)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<i;o++)for(var a=0;a<s;a++){var h=t.getOrdinate(o,a),u=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(Pt.isNaN(h)&&Pt.isNaN(u)))return!1}return!0},we.extend=function(t,e,i){var r=t.create(i,e.getDimension()),s=e.size();if(we.copy(e,0,r,0,s),s>0)for(var o=s;o<i;o++)we.copy(e,s-1,r,o,1);return r},we.reverse=function(t){for(var e=t.size()-1,i=Math.trunc(e/2),r=0;r<=i;r++)we.swap(t,r,e-r)},we.swap=function(t,e,i){if(e===i)return null;for(var r=0;r<t.getDimension();r++){var s=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(i,r)),t.setOrdinate(i,r,s)}},we.copy=function(t,e,i,r,s){for(var o=0;o<s;o++)we.copyCoord(t,e+o,i,r+o)},we.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var i=t.getDimension(),r=new Vn;r.append("(");for(var s=0;s<e;s++){s>0&&r.append(" ");for(var o=0;o<i;o++)o>0&&r.append(","),r.append(dn.toString(t.getOrdinate(s,o)))}return r.append(")"),r.toString()}},we.ensureValidRing=function(t,e){var i=e.size();if(i===0)return e;if(i<=3)return we.createClosedRing(t,e,4);var r=e.getOrdinate(0,zt.X)===e.getOrdinate(i-1,zt.X)&&e.getOrdinate(0,zt.Y)===e.getOrdinate(i-1,zt.Y);return r?e:we.createClosedRing(t,e,i+1)},we.createClosedRing=function(t,e,i){var r=t.create(i,e.getDimension()),s=e.size();we.copy(e,0,r,0,s);for(var o=s;o<i;o++)we.copy(e,0,r,o,1);return r};var ve=function(n){function t(i,r){n.call(this,r),this._points=null,this.init(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.isEmpty()?new ct:this._points.expandEnvelope(new ct)},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 r=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 h=0;h<this._points.size();h++)if(!r.equal(r._points.getCoordinate(h),a._points.getCoordinate(h),o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=r._points.size()-1-s;if(!r._points.getCoordinate(s).equals(r._points.getCoordinate(o)))return r._points.getCoordinate(s).compareTo(r._points.getCoordinate(o))>0&&we.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Ht.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 et.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();we.reverse(r);var s=this.getFactory().createLineString(r);return s},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,h=0;a<this._points.size()&&h<o._points.size();){var u=r._points.getCoordinate(a).compareTo(o._points.getCoordinate(h));if(u!==0)return u;a++,h++}return a<this._points.size()?1:h<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],l=arguments[1],d=c;return l.compare(this._points,d._points)}},t.prototype.apply=function(){var r=this;if(wt(arguments[0],yr))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(r._points.getCoordinate(o));else if(wt(arguments[0],xn)){var a=arguments[0];if(this._points.size()===0)return null;for(var h=0;h<this._points.size()&&(a.filter(r._points,h),!a.isDone());h++);a.isGeometryChanged()&&this.geometryChanged()}else if(wt(arguments[0],Wn)){var u=arguments[0];u.filter(this)}else if(wt(arguments[0],Kr)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new cn(this).getBoundary()},t.prototype.isEquivalentClass=function(r){return r instanceof t},t.prototype.clone=function(){var r=n.prototype.clone.call(this);return r._points=this._points.clone(),r},t.prototype.getCoordinateN=function(r){return this._points.getCoordinate(r)},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(r){if(r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),r.size()===1)throw new ce("Invalid number of points in LineString (found "+r.size()+" - must be 0 or >= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(r))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(r){return this.getFactory().createPoint(this._points.getCoordinate(r))},t.prototype.interfaces_=function(){return[gl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(yt),pl=function(){};pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl};var Ai=function(n){function t(i,r){n.call(this,r),this._coordinates=i||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 ct;var r=new ct;return r.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),r},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 r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?this.isEmpty()&&r.isEmpty()?!0:this.isEmpty()!==r.isEmpty()?!1:this.equal(r.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 Ht.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 r=arguments[0],s=r;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],h=o;return a.compare(this._coordinates,h._coordinates)}},t.prototype.apply=function(){if(wt(arguments[0],yr)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this.getCoordinate())}else if(wt(arguments[0],xn)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(wt(arguments[0],Wn)){var o=arguments[0];o.filter(this)}else if(wt(arguments[0],Kr)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var r=n.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},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(r){r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),Nt.isTrue(r.size()<=1),this._coordinates=r},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[pl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(yt),Ts=function(){};Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var De=function(n){function t(i,r,s){if(n.call(this,s),this._shell=null,this._holes=null,i===null&&(i=this.getFactory().createLinearRing()),r===null&&(r=[]),n.hasNullElements(r))throw new ce("holes must not contain null elements");if(i.isEmpty()&&n.hasNonEmptyElements(r))throw new ce("shell is empty but holes are not");this._shell=i,this._holes=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._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var r=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),h=0;h<a.length;h++)o++,s[o]=a[h];for(var u=0;u<this._holes.length;u++)for(var c=r._holes[u].getCoordinates(),l=0;l<c.length;l++)o++,s[o]=c[l];return s},t.prototype.getArea=function(){var r=this,s=0;s+=Math.abs(et.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(et.signedArea(r._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var r=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=r.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var h=r.getY(o);if(!(h===s.getMinY()||h===s.getMaxY()))return!1}for(var u=r.getX(0),c=r.getY(0),l=1;l<=4;l++){var d=r.getX(l),g=r.getY(l),p=d!==u,_=g!==c;if(p===_)return!1;u=d,c=g}return!0},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,h=this._shell,u=a._shell;if(!h.equalsExact(u,o)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!r._holes[c].equalsExact(a._holes[c],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var r=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)r.normalize(r._holes[s],!1);fo.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var h=new Array(o.getCoordinates().length-1).fill(null);We.arraycopy(o.getCoordinates(),0,h,0,h.length);var u=Lt.minCoordinate(o.getCoordinates());Lt.scroll(h,u),We.arraycopy(h,0,o.getCoordinates(),0,h.length),o.getCoordinates()[h.length]=h[0],et.isCCW(o.getCoordinates())===a&&Lt.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 r=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=r._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=r._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var r=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]=r._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var r=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 h=arguments[0],u=arguments[1],c=h,l=this._shell,d=c._shell,g=l.compareToSameClass(d,u);if(g!==0)return g;for(var p=this.getNumInteriorRing(),_=c.getNumInteriorRing(),w=0;w<p&&w<_;){var P=r.getInteriorRingN(w),v=c.getInteriorRingN(w),E=P.compareToSameClass(v,u);if(E!==0)return E;w++}return w<p?1:w<_?-1:0}},t.prototype.apply=function(r){var s=this;if(wt(r,yr)){this._shell.apply(r);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(r)}else if(wt(r,xn)){if(this._shell.apply(r),!r.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(r),!r.isDone());a++);r.isGeometryChanged()&&this.geometryChanged()}else if(wt(r,Wn))r.filter(this);else if(wt(r,Kr)){r.filter(this),this._shell.apply(r);for(var h=0;h<this._holes.length;h++)s._holes[h].apply(r)}},t.prototype.getBoundary=function(){var r=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]=r._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var r=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]=r._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var r=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=r._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(r){return this._holes[r]},t.prototype.interfaces_=function(){return[Ts]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(yt),yh=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 yt.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?n.prototype.equalsExact.call(this,r,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._geometries[r].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Ht.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 r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[pl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(ui),wr=function(n){function t(i,r){i instanceof L&&r instanceof Ft&&(i=r.getCoordinateSequenceFactory().create(i)),n.call(this,i,r),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 yt.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Ht.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var r=this._points.copy();we.reverse(r);var s=this.getFactory().createLinearRing(r);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new ce("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ce("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}(ve),Er=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 yt.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?n.prototype.equalsExact.call(this,r,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 r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new Z,o=0;o<this._geometries.length;o++)for(var a=r._geometries[o],h=a.getBoundary(),u=0;u<h.getNumGeometries();u++)s.add(h.getGeometryN(u));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 r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[Ts]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(ui),fn=function(t){this._factory=t||null,this._isUserDataCopied=!1},Yc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};fn.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},fn.prototype.edit=function(t,e){if(t===null)return null;var i=this.editInternal(t,e);return this._isUserDataCopied&&i.setUserData(t.getUserData()),i},fn.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof ui?this.editGeometryCollection(t,e):t instanceof De?this.editPolygon(t,e):t instanceof Ai?e.edit(t,this._factory):t instanceof ve?e.edit(t,this._factory):(Nt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},fn.prototype.editGeometryCollection=function(t,e){for(var i=this,r=e.edit(t,this._factory),s=new Z,o=0;o<r.getNumGeometries();o++){var a=i.edit(r.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return r.getClass()===yh?this._factory.createMultiPoint(s.toArray([])):r.getClass()===go?this._factory.createMultiLineString(s.toArray([])):r.getClass()===Er?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},fn.prototype.editPolygon=function(t,e){var i=this,r=e.edit(t,this._factory);if(r===null&&(r=this._factory.createPolygon(null)),r.isEmpty())return r;var s=this.edit(r.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new Z,a=0;a<r.getNumInteriorRing();a++){var h=i.edit(r.getInteriorRingN(a),e);h===null||h.isEmpty()||o.add(h)}return this._factory.createPolygon(s,o.toArray([]))},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},fn.GeometryEditorOperation=function(){},Yc.NoOpGeometryOperation.get=function(){return vl},Yc.CoordinateOperation.get=function(){return ml},Yc.CoordinateSequenceOperation.get=function(){return _l},Object.defineProperties(fn,Yc);var vl=function(){};vl.prototype.edit=function(t,e){return t},vl.prototype.interfaces_=function(){return[fn.GeometryEditorOperation]},vl.prototype.getClass=function(){return vl};var ml=function(){};ml.prototype.edit=function(t,e){var i=this.editCoordinates(t.getCoordinates(),t);return i===null?t:t instanceof wr?e.createLinearRing(i):t instanceof ve?e.createLineString(i):t instanceof Ai?i.length>0?e.createPoint(i[0]):e.createPoint():t},ml.prototype.interfaces_=function(){return[fn.GeometryEditorOperation]},ml.prototype.getClass=function(){return ml};var _l=function(){};_l.prototype.edit=function(t,e){return t instanceof wr?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ai?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},_l.prototype.interfaces_=function(){return[fn.GeometryEditorOperation]},_l.prototype.getClass=function(){return _l};var Ee=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 i=0;i<e;i++)t._coordinates[i]=new L}else if(wt(arguments[0],zt)){var r=arguments[0];if(r===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=r.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 h=arguments[0],u=arguments[1];this._coordinates=new Array(h).fill(null),this._dimension=u;for(var c=0;c<h;c++)t._coordinates[c]=new L}}},fy={serialVersionUID:{configurable:!0}};Ee.prototype.setOrdinate=function(t,e,i){switch(e){case zt.X:this._coordinates[t].x=i;break;case zt.Y:this._coordinates[t].y=i;break;case zt.Z:this._coordinates[t].z=i;break;default:throw new ce("invalid ordinateIndex")}},Ee.prototype.size=function(){return this._coordinates.length},Ee.prototype.getOrdinate=function(t,e){switch(e){case zt.X:return this._coordinates[t].x;case zt.Y:return this._coordinates[t].y;case zt.Z:return this._coordinates[t].z}return Pt.NaN},Ee.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],i=arguments[1];i.x=this._coordinates[e].x,i.y=this._coordinates[e].y,i.z=this._coordinates[e].z}},Ee.prototype.getCoordinateCopy=function(t){return new L(this._coordinates[t])},Ee.prototype.getDimension=function(){return this._dimension},Ee.prototype.getX=function(t){return this._coordinates[t].x},Ee.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)e[i]=t._coordinates[i].clone();return new Ee(e,this._dimension)},Ee.prototype.expandEnvelope=function(t){for(var e=this,i=0;i<this._coordinates.length;i++)t.expandToInclude(e._coordinates[i]);return t},Ee.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)e[i]=t._coordinates[i].copy();return new Ee(e,this._dimension)},Ee.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new Vn(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)e.append(", "),e.append(t._coordinates[i]);return e.append(")"),e.toString()}else return"()"},Ee.prototype.getY=function(t){return this._coordinates[t].y},Ee.prototype.toCoordinateArray=function(){return this._coordinates},Ee.prototype.interfaces_=function(){return[zt,un]},Ee.prototype.getClass=function(){return Ee},fy.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Ee,fy);var Sr=function(){},Rg={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Sr.prototype.readResolve=function(){return Sr.instance()},Sr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Ee(t)}else if(wt(arguments[0],zt)){var e=arguments[0];return new Ee(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new Ee(i):new Ee(i,r)}},Sr.prototype.interfaces_=function(){return[uh,un]},Sr.prototype.getClass=function(){return Sr},Sr.instance=function(){return Sr.instanceObject},Rg.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Rg.instanceObject.get=function(){return new Sr},Object.defineProperties(Sr,Rg);var gy=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(i){return this.map_.get(i)||null},t.prototype.put=function(i,r){return this.map_.set(i,r),r},t.prototype.values=function(){for(var i=new Z,r=this.map_.values(),s=r.next();!s.done;)i.add(s.value),s=r.next();return i},t.prototype.entrySet=function(){var i=new Og;return this.map_.entries().forEach(function(r){return i.add(r)}),i},t.prototype.size=function(){return this.map_.size()},t}(ta),Xt=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 Hn){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 i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}}},Lg={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Xt.prototype.equals=function(t){if(!(t instanceof Xt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Xt.prototype.compareTo=function(t){var e=t,i=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new zn(i).compareTo(new zn(r))},Xt.prototype.getScale=function(){return this._scale},Xt.prototype.isFloating=function(){return this._modelType===Xt.FLOATING||this._modelType===Xt.FLOATING_SINGLE},Xt.prototype.getType=function(){return this._modelType},Xt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Xt.FLOATING?t="Floating":this._modelType===Xt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Xt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Xt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Pt.isNaN(t))return t;if(this._modelType===Xt.FLOATING_SINGLE){var e=t;return e}return this._modelType===Xt.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof L){var i=arguments[0];if(this._modelType===Xt.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Xt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Xt.FLOATING?t=16:this._modelType===Xt.FLOATING_SINGLE?t=6:this._modelType===Xt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Xt.prototype.setScale=function(t){this._scale=Math.abs(t)},Xt.prototype.interfaces_=function(){return[un,hn]},Xt.prototype.getClass=function(){return Xt},Xt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Lg.serialVersionUID.get=function(){return 7777263578777804e3},Lg.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Xt,Lg);var Hn=function n(t){this._name=t||null,n.nameToTypeMap.put(t,this)},Fg={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Hn.prototype.readResolve=function(){return Hn.nameToTypeMap.get(this._name)},Hn.prototype.toString=function(){return this._name},Hn.prototype.interfaces_=function(){return[un]},Hn.prototype.getClass=function(){return Hn},Fg.serialVersionUID.get=function(){return-552860263173159e4},Fg.nameToTypeMap.get=function(){return new gy},Object.defineProperties(Hn,Fg),Xt.Type=Hn,Xt.FIXED=new Hn("FIXED"),Xt.FLOATING=new Hn("FLOATING"),Xt.FLOATING_SINGLE=new Hn("FLOATING SINGLE");var Ft=function n(){this._precisionModel=new Xt,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?wt(arguments[0],uh)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Xt&&(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]))},py={serialVersionUID:{configurable:!0}};Ft.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new L(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new L(t.getMinX(),t.getMinY()),new L(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new L(t.getMinX(),t.getMinY()),new L(t.getMinX(),t.getMaxY()),new L(t.getMaxX(),t.getMaxY()),new L(t.getMaxX(),t.getMinY()),new L(t.getMinX(),t.getMinY())]),null)},Ft.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ve(this.getCoordinateSequenceFactory().create(t),this);if(wt(t,zt))return new ve(t,this)}else return new ve(this.getCoordinateSequenceFactory().create([]),this)},Ft.prototype.createMultiLineString=function(){if(arguments.length===0)return new go(null,this);if(arguments.length===1){var t=arguments[0];return new go(t,this)}},Ft.prototype.buildGeometry=function(t){for(var e=null,i=!1,r=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(i=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(i||r)return this.createGeometryCollection(Ft.toGeometryArray(t));var h=t.iterator().next(),u=t.size()>1;if(u){if(h instanceof De)return this.createMultiPolygon(Ft.toPolygonArray(t));if(h instanceof ve)return this.createMultiLineString(Ft.toLineStringArray(t));if(h instanceof Ai)return this.createMultiPoint(Ft.toPointArray(t));Nt.shouldNeverReachHere("Unhandled class: "+h.getClass().getName())}return h},Ft.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},Ft.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(wt(arguments[0],zt)){var e=arguments[0];return new Ai(e,this)}}},Ft.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ft.prototype.createPolygon=function(){if(arguments.length===0)return new De(null,null,this);if(arguments.length===1){if(wt(arguments[0],zt)){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 wr){var i=arguments[0];return this.createPolygon(i,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new De(r,s,this)}},Ft.prototype.getSRID=function(){return this._SRID},Ft.prototype.createGeometryCollection=function(){if(arguments.length===0)return new ui(null,this);if(arguments.length===1){var t=arguments[0];return new ui(t,this)}},Ft.prototype.createGeometry=function(t){var e=new fn(this);return e.edit(t,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Ft.prototype.getPrecisionModel=function(){return this._precisionModel},Ft.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(wt(arguments[0],zt)){var e=arguments[0];return new wr(e,this)}}},Ft.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Er(null,this);if(arguments.length===1){var t=arguments[0];return new Er(t,this)}},Ft.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new yh(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new yh(e,this)}else if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}else if(wt(arguments[0],zt)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),o=0;o<r.size();o++){var a=t.getCoordinateSequenceFactory().create(1,r.getDimension());we.copy(r,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},Ft.prototype.interfaces_=function(){return[un]},Ft.prototype.getClass=function(){return Ft},Ft.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.getDefaultCoordinateSequenceFactory=function(){return Sr.instance()},Ft.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},py.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ft,py);var kM=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Jc=function(t){this.geometryFactory=t||new Ft};Jc.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var i=e.type;if(!Xn[i])throw new Error("Unknown GeoJSON type: "+e.type);return kM.indexOf(i)!==-1?Xn[i].apply(this,[e.coordinates]):i==="GeometryCollection"?Xn[i].apply(this,[e.geometries]):Xn[i].apply(this,[e])},Jc.prototype.write=function(t){var e=t.getGeometryType();if(!es[e])throw new Error("Geometry is not supported");return es[e].apply(this,[t])};var Xn={Feature:function(n){var t={};for(var e in n)t[e]=n[e];if(n.geometry){var i=n.geometry.type;if(!Xn[i])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=Xn.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t=this,e={};if(n.features){e.features=[];for(var i=0;i<n.features.length;++i)e.features.push(t.read(n.features[i]))}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 i=n[e];t.push(new L(i[0],i[1]))}return t},bbox:function(n){return this.geometryFactory.createLinearRing([new L(n[0],n[1]),new L(n[2],n[1]),new L(n[2],n[3]),new L(n[0],n[3]),new L(n[0],n[1])])},Point:function(n){var t=new L(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var t=this,e=[],i=0;i<n.length;++i)e.push(Xn.Point.apply(t,[n[i]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(n){var t=Xn.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var t=this,e=[],i=0;i<n.length;++i)e.push(Xn.LineString.apply(t,[n[i]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(n){for(var t=this,e=Xn.coordinates.apply(this,[n[0]]),i=this.geometryFactory.createLinearRing(e),r=[],s=1;s<n.length;++s){var o=n[s],a=Xn.coordinates.apply(t,[o]),h=t.geometryFactory.createLinearRing(a);r.push(h)}return this.geometryFactory.createPolygon(i,r)},MultiPolygon:function(n){for(var t=this,e=[],i=0;i<n.length;++i){var r=n[i];e.push(Xn.Polygon.apply(t,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(n){for(var t=this,e=[],i=0;i<n.length;++i){var r=n[i];e.push(t.read(r))}return this.geometryFactory.createGeometryCollection(e)}},es={coordinate:function(n){return[n.x,n.y]},Point:function(n){var t=es.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=es.Point.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(n){for(var t=this,e=[],i=n.getCoordinates(),r=0;r<i.length;++r){var s=i[r];e.push(es.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=es.LineString.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(n){var t=this,e=[],i=es.LineString.apply(this,[n._shell]);e.push(i.coordinates);for(var r=0;r<n._holes.length;++r){var s=n._holes[r],o=es.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=es.Polygon.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=r.getGeometryType();e.push(es[s].apply(t,[r]))}return{type:"GeometryCollection",geometries:e}}},kg=function(t){this.geometryFactory=t||new Ft,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Jc(this.geometryFactory)};kg.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Xt.FIXED&&this.reducePrecision(e),e},kg.prototype.reducePrecision=function(t){var e=this,i,r;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(i=0,r=t.points.length;i<r;i++)e.precisionModel.makePrecise(t.points[i]);else if(t.geometries)for(i=0,r=t.geometries.length;i<r;i++)e.reducePrecision(t.geometries[i])};var vy=function(){this.parser=new Jc(this.geometryFactory)};vy.prototype.write=function(t){return this.parser.write(t)};var K=function(){},$c={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.opposite=function(t){return t===K.LEFT?K.RIGHT:t===K.RIGHT?K.LEFT:t},$c.ON.get=function(){return 0},$c.LEFT.get=function(){return 1},$c.RIGHT.get=function(){return 2},Object.defineProperties(K,$c);function Kc(n){this.message=n||""}Kc.prototype=new Error,Kc.prototype.name="EmptyStackException";function Yn(){this.array_=[]}Yn.prototype=new bn,Yn.prototype.add=function(n){return this.array_.push(n),!0},Yn.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},Yn.prototype.push=function(n){return this.array_.push(n),n},Yn.prototype.pop=function(n){if(this.array_.length===0)throw new Kc;return this.array_.pop()},Yn.prototype.peek=function(){if(this.array_.length===0)throw new Kc;return this.array_[this.array_.length-1]},Yn.prototype.empty=function(){return this.array_.length===0},Yn.prototype.isEmpty=function(){return this.empty()},Yn.prototype.search=function(n){return this.array_.indexOf(n)},Yn.prototype.size=function(){return this.array_.length},Yn.prototype.toArray=function(){for(var n=this,t=[],e=0,i=this.array_.length;e<i;e++)t.push(n.array_[e]);return t};var Jn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Jn.prototype.getCoordinate=function(){return this._minCoord},Jn.prototype.getRightmostSide=function(t,e){var i=this.getRightmostSideOfSegment(t,e);return i<0&&(i=this.getRightmostSideOfSegment(t,e-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),i},Jn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Nt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],i=t[this._minIndex+1],r=et.computeOrientation(this._minCoord,i,e),s=!1;(e.y<this._minCoord.y&&i.y<this._minCoord.y&&r===et.COUNTERCLOCKWISE||e.y>this._minCoord.y&&i.y>this._minCoord.y&&r===et.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},Jn.prototype.getRightmostSideOfSegment=function(t,e){var i=t.getEdge(),r=i.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var s=K.LEFT;return r[e].y<r[e+1].y&&(s=K.RIGHT),s},Jn.prototype.getEdge=function(){return this._orientedDe},Jn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,i=t.getEdge().getCoordinates(),r=0;r<i.length-1;r++)(e._minCoord===null||i[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=i[r])},Jn.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)},Jn.prototype.findEdge=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next();r.isForward()&&e.checkForRightmostCoordinate(r)}Nt.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===K.LEFT&&(this._orientedDe=this._minDe.getSym())},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var is=function(n){function t(e,i){n.call(this,t.msgWithCoord(e,i)),this.pt=i?new L(i):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(i,r){return r?i:i+" [ "+r+" ]"},t}($r),Qc=function(){this.array_=[]};Qc.prototype.addLast=function(t){this.array_.push(t)},Qc.prototype.removeFirst=function(){return this.array_.shift()},Qc.prototype.isEmpty=function(){return this.array_.length===0};var li=function(){this._finder=null,this._dirEdgeList=new Z,this._nodes=new Z,this._rightMostCoord=null,this._env=null,this._finder=new Jn};li.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},li.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},li.prototype.computeNodeDepth=function(t){for(var e=this,i=null,r=t.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){i=s;break}}if(i===null)throw new is("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(i);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},li.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(K.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},li.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},li.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(K.RIGHT)>=1&&e.getDepth(K.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},li.prototype.computeDepths=function(t){var e=this,i=new Og,r=new Qc,s=t.getNode();for(r.addLast(s),i.add(s),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();i.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var h=a.next(),u=h.getSym();if(!u.isVisited()){var c=u.getNode();i.contains(c)||(r.addLast(c),i.add(c))}}}},li.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},li.prototype.getEnvelope=function(){if(this._env===null){for(var t=new ct,e=this._dirEdgeList.iterator();e.hasNext();)for(var i=e.next(),r=i.getEdge().getCoordinates(),s=0;s<r.length-1;s++)t.expandToInclude(r[s]);this._env=t}return this._env},li.prototype.addReachable=function(t){var e=this,i=new Yn;for(i.add(t);!i.empty();){var r=i.pop();e.add(r,i)}},li.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(K.LEFT,t.getDepth(K.RIGHT)),e.setDepth(K.RIGHT,t.getDepth(K.LEFT))},li.prototype.add=function(t,e){var i=this;t.setVisited(!0),this._nodes.add(t);for(var r=t.getEdges().iterator();r.hasNext();){var s=r.next();i._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},li.prototype.getNodes=function(){return this._nodes},li.prototype.getDirectedEdges=function(){return this._dirEdgeList},li.prototype.interfaces_=function(){return[hn]},li.prototype.getClass=function(){return li};var re=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 i=arguments[0];this.init(1),this.location[K.ON]=i}else if(arguments[0]instanceof n){var r=arguments[0];if(this.init(r.location.length),r!==null)for(var s=0;s<this.location.length;s++)t.location[s]=r.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],h=arguments[2];this.init(3),this.location[K.ON]=o,this.location[K.LEFT]=a,this.location[K.RIGHT]=h}};re.prototype.setAllLocations=function(t){for(var e=this,i=0;i<this.location.length;i++)e.location[i]=t},re.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==V.NONE)return!1;return!0},re.prototype.setAllLocationsIfNull=function(t){for(var e=this,i=0;i<this.location.length;i++)e.location[i]===V.NONE&&(e.location[i]=t)},re.prototype.isLine=function(){return this.location.length===1},re.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var i=new Array(3).fill(null);i[K.ON]=this.location[K.ON],i[K.LEFT]=V.NONE,i[K.RIGHT]=V.NONE,this.location=i}for(var r=0;r<this.location.length;r++)e.location[r]===V.NONE&&r<t.location.length&&(e.location[r]=t.location[r])},re.prototype.getLocations=function(){return this.location},re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[K.LEFT];this.location[K.LEFT]=this.location[K.RIGHT],this.location[K.RIGHT]=t},re.prototype.toString=function(){var t=new Vn;return this.location.length>1&&t.append(V.toLocationSymbol(this.location[K.LEFT])),t.append(V.toLocationSymbol(this.location[K.ON])),this.location.length>1&&t.append(V.toLocationSymbol(this.location[K.RIGHT])),t.toString()},re.prototype.setLocations=function(t,e,i){this.location[K.ON]=t,this.location[K.LEFT]=e,this.location[K.RIGHT]=i},re.prototype.get=function(t){return t<this.location.length?this.location[t]:V.NONE},re.prototype.isArea=function(){return this.location.length>1},re.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===V.NONE)return!0;return!1},re.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(K.ON,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.location[e]=i}},re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(V.NONE)},re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},re.prototype.allPositionsEqual=function(t){for(var e=this,i=0;i<this.location.length;i++)if(e.location[i]!==t)return!1;return!0},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re};var Kt=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 re(t),this.elt[1]=new re(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.elt[0]=new re(e.elt[0]),this.elt[1]=new re(e.elt[1])}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.elt[0]=new re(V.NONE),this.elt[1]=new re(V.NONE),this.elt[i].setLocation(r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new re(s,o,a),this.elt[1]=new re(s,o,a)}else if(arguments.length===4){var h=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new re(V.NONE,V.NONE,V.NONE),this.elt[1]=new re(V.NONE,V.NONE,V.NONE),this.elt[h].setLocations(u,c,l)}};Kt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Kt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Kt.prototype.isNull=function(t){return this.elt[t].isNull()},Kt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.elt[e].setAllLocationsIfNull(i)}},Kt.prototype.isLine=function(t){return this.elt[t].isLine()},Kt.prototype.merge=function(t){for(var e=this,i=0;i<2;i++)e.elt[i]===null&&t.elt[i]!==null?e.elt[i]=new re(t.elt[i]):e.elt[i].merge(t.elt[i])},Kt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Kt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(K.ON)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.elt[e].get(i)}},Kt.prototype.toString=function(){var t=new Vn;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()},Kt.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()}},Kt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Kt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(K.ON,e)}else if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];this.elt[i].setLocation(r,s)}},Kt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Kt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Kt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new re(this.elt[t].location[0]))},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.toLineLabel=function(t){for(var e=new Kt(V.NONE),i=0;i<2;i++)e.setLocation(i,t.getLocation(i));return e};var Ie=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Z,this._pts=new Z,this._label=new Kt(V.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Z,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ie.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)e[i]=t._pts.get(i);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=et.isCCW(this._ring.getCoordinates())},Ie.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ie.prototype.computePoints=function(t){var e=this;this._startDe=t;var i=t,r=!0;do{if(i===null)throw new is("Found null DirectedEdge");if(i.getEdgeRing()===e)throw new is("Directed Edge visited twice during ring-building at "+i.getCoordinate());e._edges.add(i);var s=i.getLabel();Nt.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(i.getEdge(),i.isForward(),r),r=!1,e.setEdgeRing(i,e),i=e.getNext(i)}while(i!==this._startDe)},Ie.prototype.getLinearRing=function(){return this._ring},Ie.prototype.getCoordinate=function(t){return this._pts.get(t)},Ie.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var i=e.getNode(),r=i.getEdges().getOutgoingDegree(t);r>t._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Ie.prototype.addPoints=function(t,e,i){var r=this,s=t.getCoordinates();if(e){var o=1;i&&(o=0);for(var a=o;a<s.length;a++)r._pts.add(s[a])}else{var h=s.length-2;i&&(h=s.length-1);for(var u=h;u>=0;u--)r._pts.add(s[u])}},Ie.prototype.isHole=function(){return this._isHole},Ie.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ie.prototype.containsPoint=function(t){var e=this.getLinearRing(),i=e.getEnvelopeInternal();if(!i.contains(t)||!et.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(t))return!1}return!0},Ie.prototype.addHole=function(t){this._holes.add(t)},Ie.prototype.isShell=function(){return this._shell===null},Ie.prototype.getLabel=function(){return this._label},Ie.prototype.getEdges=function(){return this._edges},Ie.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ie.prototype.getShell=function(){return this._shell},Ie.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],r=e.getLocation(i,K.RIGHT);if(r===V.NONE)return null;if(this._label.getLocation(i)===V.NONE)return this._label.setLocation(i,r),null}},Ie.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Ie.prototype.toPolygon=function(t){for(var e=this,i=new Array(this._holes.size()).fill(null),r=0;r<this._holes.size();r++)i[r]=e._holes.get(r).getLinearRing();var s=t.createPolygon(this.getLinearRing(),i);return s},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var GM=function(n){function t(){var e=arguments[0],i=arguments[1];n.call(this,e,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(i,r){i.setMinEdgeRing(r)},t.prototype.getNext=function(i){return i.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ie),BM=function(n){function t(){var e=arguments[0],i=arguments[1];n.call(this,e,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var i=this,r=new Z,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new GM(s,i._geometryFactory);r.add(o)}s=s.getNext()}while(s!==this._startDe);return r},t.prototype.setEdgeRing=function(i,r){i.setEdgeRing(r)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var i=this,r=this._startDe;do{var s=r.getNode();s.getEdges().linkMinimalDirectedEdges(i),r=r.getNext()}while(r!==this._startDe)},t.prototype.getNext=function(i){return i.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ie),Ji=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}}};Ji.prototype.setVisited=function(t){this._isVisited=t},Ji.prototype.setInResult=function(t){this._isInResult=t},Ji.prototype.isCovered=function(){return this._isCovered},Ji.prototype.isCoveredSet=function(){return this._isCoveredSet},Ji.prototype.setLabel=function(t){this._label=t},Ji.prototype.getLabel=function(){return this._label},Ji.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ji.prototype.updateIM=function(t){Nt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ji.prototype.isInResult=function(){return this._isInResult},Ji.prototype.isVisited=function(){return this._isVisited},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji};var Zc=function(n){function t(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],i=arguments[1];this._coord=e,this._edges=i,this._label=new Kt(0,V.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var i=this.getEdges().getEdges().iterator();i.hasNext();){var r=i.next();if(r.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(i){i.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(i){},t.prototype.computeMergedLocation=function(i,r){var s=V.NONE;if(s=this._label.getLocation(r),!i.isNull(r)){var o=i.getLocation(r);s!==V.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];this._label===null?this._label=new Kt(i,r):this._label.setLocation(i,r)}else return n.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var i=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Kt)for(var s=arguments[0],o=0;o<2;o++){var a=i.computeMergedLocation(s,o),h=i._label.getLocation(o);h===V.NONE&&i._label.setLocation(o,a)}},t.prototype.add=function(i){this._edges.insert(i),i.setNode(this)},t.prototype.setLabelBoundary=function(i){if(this._label===null)return null;var r=V.NONE;this._label!==null&&(r=this._label.getLocation(i));var s=null;switch(r){case V.BOUNDARY:s=V.INTERIOR;break;case V.INTERIOR:s=V.BOUNDARY;break;default:s=V.BOUNDARY;break}this._label.setLocation(i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ji),$n=function(){this.nodeMap=new ii,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};$n.prototype.find=function(t){return this.nodeMap.get(t)},$n.prototype.addNode=function(){if(arguments[0]instanceof L){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 Zc){var i=arguments[0],r=this.nodeMap.get(i.getCoordinate());return r===null?(this.nodeMap.put(i.getCoordinate(),i),i):(r.mergeLabel(i),r)}},$n.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},$n.prototype.iterator=function(){return this.nodeMap.values().iterator()},$n.prototype.values=function(){return this.nodeMap.values()},$n.prototype.getBoundaryNodes=function(t){for(var e=new Z,i=this.iterator();i.hasNext();){var r=i.next();r.getLabel().getLocation(t)===V.BOUNDARY&&e.add(r)}return e},$n.prototype.add=function(t){var e=t.getCoordinate(),i=this.addNode(e);i.add(t)},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Qt=function(){},yl={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt},Qt.isNorthern=function(t){return t===Qt.NE||t===Qt.NW},Qt.isOpposite=function(t,e){if(t===e)return!1;var i=(t-e+4)%4;return i===2},Qt.commonHalfPlane=function(t,e){if(t===e)return t;var i=(t-e+4)%4;if(i===2)return-1;var r=t<e?t:e,s=t>e?t:e;return r===0&&s===3?3:r},Qt.isInHalfPlane=function(t,e){return e===Qt.SE?t===Qt.SE||t===Qt.SW:t===e||t===e+1},Qt.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 ce("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Qt.NE:Qt.SE:e>=0?Qt.NW:Qt.SW}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new ce("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?Qt.NE:Qt.SE:r.y>=i.y?Qt.NW:Qt.SW}},yl.NE.get=function(){return 0},yl.NW.get=function(){return 1},yl.SW.get=function(){return 2},yl.SE.get=function(){return 3},Object.defineProperties(Qt,yl);var ni=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],i=arguments[1],r=arguments[2],s=null;this._edge=e,this.init(i,r),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],h=arguments[2],u=arguments[3];this._edge=o,this.init(a,h),this._label=u}};ni.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:et.computeOrientation(t._p0,t._p1,this._p1)},ni.prototype.getDy=function(){return this._dy},ni.prototype.getCoordinate=function(){return this._p0},ni.prototype.setNode=function(t){this._node=t},ni.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),r=i.lastIndexOf("."),s=i.substring(r+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},ni.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},ni.prototype.getDirectedCoordinate=function(){return this._p1},ni.prototype.getDx=function(){return this._dx},ni.prototype.getLabel=function(){return this._label},ni.prototype.getEdge=function(){return this._edge},ni.prototype.getQuadrant=function(){return this._quadrant},ni.prototype.getNode=function(){return this._node},ni.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),i=e.lastIndexOf("."),r=e.substring(i+1);return" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},ni.prototype.computeLabel=function(t){},ni.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=Qt.quadrant(this._dx,this._dy),Nt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},ni.prototype.interfaces_=function(){return[hn]},ni.prototype.getClass=function(){return ni};var Gg=function(n){function t(){var e=arguments[0],i=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=i,i)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-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(i){return this._depth[i]},t.prototype.setVisited=function(i){this._isVisited=i},t.prototype.computeDirectedLabel=function(){this._label=new Kt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(i,r){if(this._depth[i]!==-999&&this._depth[i]!==r)throw new is("assigned depths do not match",this.getCoordinate());this._depth[i]=r},t.prototype.isInteriorAreaEdge=function(){for(var i=this,r=!0,s=0;s<2;s++)i._label.isArea(s)&&i._label.getLocation(s,K.LEFT)===V.INTERIOR&&i._label.getLocation(s,K.RIGHT)===V.INTERIOR||(r=!1);return r},t.prototype.setNextMin=function(i){this._nextMin=i},t.prototype.print=function(i){n.prototype.print.call(this,i),i.print(" "+this._depth[K.LEFT]+"/"+this._depth[K.RIGHT]),i.print(" ("+this.getDepthDelta()+")"),this._isInResult&&i.print(" inResult")},t.prototype.setMinEdgeRing=function(i){this._minEdgeRing=i},t.prototype.isLineEdge=function(){var i=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,V.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,V.EXTERIOR);return i&&r&&s},t.prototype.setEdgeRing=function(i){this._edgeRing=i},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var i=this._edge.getDepthDelta();return this._isForward||(i=-i),i},t.prototype.setInResult=function(i){this._isInResult=i},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(i){this.print(i),i.print(" "),this._isForward?this._edge.print(i):this._edge.printReverse(i)},t.prototype.setSym=function(i){this._sym=i},t.prototype.setVisitedEdge=function(i){this.setVisited(i),this._sym.setVisited(i)},t.prototype.setEdgeDepths=function(i,r){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;i===K.LEFT&&(o=-1);var a=K.opposite(i),h=s*o,u=r+h;this.setDepth(i,r),this.setDepth(a,u)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(i){this._next=i},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(i,r){return i===V.EXTERIOR&&r===V.INTERIOR?1:i===V.INTERIOR&&r===V.EXTERIOR?-1:0},t}(ni),wh=function(){};wh.prototype.createNode=function(t){return new Zc(t,null)},wh.prototype.interfaces_=function(){return[]},wh.prototype.getClass=function(){return wh};var pe=function(){if(this._edges=new Z,this._nodes=null,this._edgeEndList=new Z,arguments.length===0)this._nodes=new $n(new wh);else if(arguments.length===1){var t=arguments[0];this._nodes=new $n(t)}};pe.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var i=0;i<this._edges.size();i++){t.println("edge "+i+":");var r=e._edges.get(i);r.print(t),r.eiList.print(t)}},pe.prototype.find=function(t){return this._nodes.find(t)},pe.prototype.addNode=function(){if(arguments[0]instanceof Zc){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this._nodes.addNode(e)}},pe.prototype.getNodeIterator=function(){return this._nodes.iterator()},pe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},pe.prototype.debugPrintln=function(t){We.out.println(t)},pe.prototype.isBoundaryNode=function(t,e){var i=this._nodes.find(e);if(i===null)return!1;var r=i.getLabel();return r!==null&&r.getLocation(t)===V.BOUNDARY},pe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},pe.prototype.matchInSameDirection=function(t,e,i,r){return t.equals(i)?et.computeOrientation(t,e,r)===et.COLLINEAR&&Qt.quadrant(t,e)===Qt.quadrant(i,r):!1},pe.prototype.getEdgeEnds=function(){return this._edgeEndList},pe.prototype.debugPrint=function(t){We.out.print(t)},pe.prototype.getEdgeIterator=function(){return this._edges.iterator()},pe.prototype.findEdgeInSameDirection=function(t,e){for(var i=this,r=0;r<this._edges.size();r++){var s=i._edges.get(r),o=s.getCoordinates();if(i.matchInSameDirection(t,e,o[0],o[1])||i.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},pe.prototype.insertEdge=function(t){this._edges.add(t)},pe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var i=e.next();if(i.getEdge()===t)return i}return null},pe.prototype.addEdges=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next();e._edges.add(r);var s=new Gg(r,!0),o=new Gg(r,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},pe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},pe.prototype.getNodes=function(){return this._nodes.values()},pe.prototype.findEdge=function(t,e){for(var i=this,r=0;r<this._edges.size();r++){var s=i._edges.get(r),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();i.getEdges().linkResultDirectedEdges()}};var Ri=function(){this._geometryFactory=null,this._shellList=new Z;var t=arguments[0];this._geometryFactory=t};Ri.prototype.sortShellsAndHoles=function(t,e,i){for(var r=t.iterator();r.hasNext();){var s=r.next();s.isHole()?i.add(s):e.add(s)}},Ri.prototype.computePolygons=function(t){for(var e=this,i=new Z,r=t.iterator();r.hasNext();){var s=r.next(),o=s.toPolygon(e._geometryFactory);i.add(o)}return i},Ri.prototype.placeFreeHoles=function(t,e){for(var i=this,r=e.iterator();r.hasNext();){var s=r.next();if(s.getShell()===null){var o=i.findEdgeRingContaining(s,t);if(o===null)throw new is("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},Ri.prototype.buildMinimalEdgeRings=function(t,e,i){for(var r=this,s=new Z,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var h=a.buildMinimalRings(),u=r.findShell(h);u!==null?(r.placePolygonHoles(u,h),e.add(u)):i.addAll(h)}else s.add(a)}return s},Ri.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var i=e.next();if(i.containsPoint(t))return!0}return!1},Ri.prototype.buildMaximalEdgeRings=function(t){for(var e=this,i=new Z,r=t.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new BM(s,e._geometryFactory);i.add(o),o.setInResult()}}return i},Ri.prototype.placePolygonHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var r=i.next();r.isHole()&&r.setShell(t)}},Ri.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Ri.prototype.findEdgeRingContaining=function(t,e){for(var i=t.getLinearRing(),r=i.getEnvelopeInternal(),s=i.getCoordinateN(0),o=null,a=null,h=e.iterator();h.hasNext();){var u=h.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var d=!1;l.contains(r)&&et.isPointInRing(s,c.getCoordinates())&&(d=!0),d&&(o===null||a.contains(l))&&(o=u)}return o},Ri.prototype.findShell=function(t){for(var e=0,i=null,r=t.iterator();r.hasNext();){var s=r.next();s.isHole()||(i=s,e++)}return Nt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),i},Ri.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],i=arguments[1];pe.linkResultDirectedEdges(i);var r=this.buildMaximalEdgeRings(e),s=new Z,o=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var Eh=function(){};Eh.prototype.getBounds=function(){},Eh.prototype.interfaces_=function(){return[]},Eh.prototype.getClass=function(){return Eh};var Mn=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Mn.prototype.getItem=function(){return this._item},Mn.prototype.getBounds=function(){return this._bounds},Mn.prototype.interfaces_=function(){return[Eh,un]},Mn.prototype.getClass=function(){return Mn};var ns=function(){this._size=null,this._items=null,this._size=0,this._items=new Z,this._items.add(null)};ns.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},ns.prototype.size=function(){return this._size},ns.prototype.reorder=function(t){for(var e=this,i=null,r=this._items.get(t);t*2<=this._size&&(i=t*2,i!==e._size&&e._items.get(i+1).compareTo(e._items.get(i))<0&&i++,e._items.get(i).compareTo(r)<0);t=i)e._items.set(t,e._items.get(i));this._items.set(t,r)},ns.prototype.clear=function(){this._size=0,this._items.clear()},ns.prototype.isEmpty=function(){return this._size===0},ns.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)e._items.set(i,e._items.get(Math.trunc(i/2)));this._items.set(i,t)},ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns};var Ns=function(){};Ns.prototype.visitItem=function(t){},Ns.prototype.interfaces_=function(){return[]},Ns.prototype.getClass=function(){return Ns};var ea=function(){};ea.prototype.insert=function(t,e){},ea.prototype.remove=function(t,e){},ea.prototype.query=function(){},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea};var Ae=function(){if(this._childBoundables=new Z,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},my={serialVersionUID:{configurable:!0}};Ae.prototype.getLevel=function(){return this._level},Ae.prototype.size=function(){return this._childBoundables.size()},Ae.prototype.getChildBoundables=function(){return this._childBoundables},Ae.prototype.addChildBoundable=function(t){Nt.isTrue(this._bounds===null),this._childBoundables.add(t)},Ae.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ae.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ae.prototype.interfaces_=function(){return[Eh,un]},Ae.prototype.getClass=function(){return Ae},my.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ae,my);var Tn=function(){};Tn.reverseOrder=function(){return{compare:function(e,i){return i.compareTo(e)}}},Tn.min=function(t){return Tn.sort(t),t.get(0)},Tn.sort=function(t,e){var i=t.toArray();e?fo.sort(i,e):fo.sort(i);for(var r=t.iterator(),s=0,o=i.length;s<o;s++)r.next(),r.set(i[s])},Tn.singletonList=function(t){var e=new Z;return e.add(t),e};var xe=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=i,this._distance=this.distance()};xe.prototype.expandToQueue=function(t,e){var i=xe.isComposite(this._boundable1),r=xe.isComposite(this._boundable2);if(i&&r)return xe.area(this._boundable1)>xe.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(i)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ce("neither boundable is composite")},xe.prototype.isLeaves=function(){return!(xe.isComposite(this._boundable1)||xe.isComposite(this._boundable2))},xe.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},xe.prototype.expand=function(t,e,i,r){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var h=a.next(),u=new xe(h,e,s._itemDistance);u.getDistance()<r&&i.add(u)}},xe.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},xe.prototype.getDistance=function(){return this._distance},xe.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},xe.prototype.interfaces_=function(){return[hn]},xe.prototype.getClass=function(){return xe},xe.area=function(t){return t.getBounds().getArea()},xe.isComposite=function(t){return t instanceof Ae};var Be=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new Z,this._nodeCapacity=null,arguments.length===0){var t=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];Nt.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},td={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Be.prototype.getNodeCapacity=function(){return this._nodeCapacity},Be.prototype.lastNode=function(t){return t.get(t.size()-1)},Be.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],i=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Ae?i+=t.size(s):s instanceof Mn&&(i+=1)}return i}},Be.prototype.removeItem=function(t,e){for(var i=null,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Mn&&s.getItem()===e&&(i=s)}return i!==null?(t.getChildBoundables().remove(i),!0):!1},Be.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new Z:e}else if(arguments.length===1){for(var i=arguments[0],r=new Z,s=i.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof Ae){var a=t.itemsTree(o);a!==null&&r.add(a)}else o instanceof Mn?r.add(o.getItem()):Nt.shouldNeverReachHere()}return r.size()<=0?null:r}},Be.prototype.insert=function(t,e){Nt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Mn(t,e))},Be.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],i=new Z;return this.boundablesAtLevel(e,this._root,i),i}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(Nt.isTrue(r>-2),s.getLevel()===r)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var h=a.next();h instanceof Ae?t.boundablesAtLevel(r,h,o):(Nt.isTrue(h instanceof Mn),r===-1&&o.add(h))}return null}},Be.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var i=new Z;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,i),i}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(wt(arguments[2],Ns)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var o=arguments[0],a=arguments[1],h=arguments[2],u=a.getChildBoundables(),c=0;c<u.size();c++){var l=u.get(c);t.getIntersectsOp().intersects(l.getBounds(),o)&&(l instanceof Ae?t.query(o,l,h):l instanceof Mn?h.visitItem(l.getItem()):Nt.shouldNeverReachHere())}else if(wt(arguments[2],bn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var d=arguments[0],g=arguments[1],p=arguments[2],_=g.getChildBoundables(),w=0;w<_.size();w++){var P=_.get(w);t.getIntersectsOp().intersects(P.getBounds(),d)&&(P instanceof Ae?t.query(d,P,p):P instanceof Mn?p.add(P.getItem()):Nt.shouldNeverReachHere())}}},Be.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},Be.prototype.getRoot=function(){return this.build(),this._root},Be.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,i):!1}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var h=null,u=s.getChildBoundables().iterator();u.hasNext();){var c=u.next();if(t.getIntersectsOp().intersects(c.getBounds(),r)&&c instanceof Ae&&(a=t.remove(r,c,o),a)){h=c;break}}return h!==null&&h.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(h),a}},Be.prototype.createHigherLevels=function(t,e){Nt.isTrue(!t.isEmpty());var i=this.createParentBoundables(t,e+1);return i.size()===1?i.get(0):this.createHigherLevels(i,e+1)},Be.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],i=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();if(s instanceof Ae){var o=t.depth(s);o>i&&(i=o)}}return i+1}},Be.prototype.createParentBoundables=function(t,e){var i=this;Nt.isTrue(!t.isEmpty());var r=new Z;r.add(this.createNode(e));var s=new Z(t);Tn.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();i.lastNode(r).getChildBoundables().size()===i.getNodeCapacity()&&r.add(i.createNode(e)),i.lastNode(r).addChildBoundable(a)}return r},Be.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Be.prototype.interfaces_=function(){return[un]},Be.prototype.getClass=function(){return Be},Be.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},td.IntersectsOp.get=function(){return VM},td.serialVersionUID.get=function(){return-3886435814360241e3},td.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Be,td);var VM=function(){},Sh=function(){};Sh.prototype.distance=function(t,e){},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var _y=function(n){function t(i){i=i||t.DEFAULT_NODE_CAPACITY,n.call(this,i)}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(r,s){var o=this;Nt.isTrue(r.length>0);for(var a=new Z,h=0;h<r.length;h++)a.addAll(o.createParentBoundablesFromVerticalSlice(r[h],s));return a},t.prototype.createNode=function(r){return new yy(r)},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 r=arguments[0],s=arguments[1];if(r.isNull())return null;n.prototype.insert.call(this,r,s)}else return n.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(r,s){for(var o=Math.trunc(Math.ceil(r.size()/s)),a=new Array(s).fill(null),h=r.iterator(),u=0;u<s;u++){a[u]=new Z;for(var c=0;h.hasNext()&&c<o;){var l=h.next();a[u].add(l),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var r=arguments[0];return n.prototype.query.call(this,r)}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(wt(arguments[2],Ns)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var a=arguments[0],h=arguments[1],u=arguments[2];n.prototype.query.call(this,a,h,u)}else if(wt(arguments[2],bn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var c=arguments[0],l=arguments[1],d=arguments[2];n.prototype.query.call(this,c,l,d)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(r,s){return n.prototype.createParentBoundables.call(this,r,s)},t.prototype.remove=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return n.prototype.remove.call(this,r,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(r,s){Nt.isTrue(!r.isEmpty());var o=Math.trunc(Math.ceil(r.size()/this.getNodeCapacity())),a=new Z(r);Tn.sort(a,t.xComparator);var h=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(h,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(wt(arguments[0],Sh)){var r=arguments[0],s=new xe(this.getRoot(),this.getRoot(),r);return this.nearestNeighbour(s)}else if(arguments[0]instanceof xe){var o=arguments[0];return this.nearestNeighbour(o,Pt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&wt(arguments[1],Sh)){var a=arguments[0],h=arguments[1],u=new xe(this.getRoot(),a.getRoot(),h);return this.nearestNeighbour(u)}else if(arguments[0]instanceof xe&&typeof arguments[1]=="number"){var c=arguments[0],l=arguments[1],d=l,g=null,p=new ns;for(p.add(c);!p.isEmpty()&&d>0;){var _=p.poll(),w=_.getDistance();if(w>=d)break;_.isLeaves()?(d=w,g=_):_.expandToQueue(p,d)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],v=arguments[1],E=arguments[2],m=new Mn(P,v),S=new xe(this.getRoot(),m,E);return this.nearestNeighbour(S)[0]}},t.prototype.interfaces_=function(){return[ea,un]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,s){return(r+s)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},e.STRtreeNode.get=function(){return yy},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[hh]},compare:function(i,r){return n.compareDoubles(t.centreX(i.getBounds()),t.centreX(r.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[hh]},compare:function(i,r){return n.compareDoubles(t.centreY(i.getBounds()),t.centreY(r.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(i,r){return i.intersects(r)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Be),yy=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 i=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();i===null?i=new ct(s.getBounds()):i.expandToInclude(s.getBounds())}return i},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ae),Ei=function(){};Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei},Ei.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Ei.compare=function(t,e,i){if(e.equals2D(i))return 0;var r=Ei.relativeSign(e.x,i.x),s=Ei.relativeSign(e.y,i.y);switch(t){case 0:return Ei.compareValue(r,s);case 1:return Ei.compareValue(s,r);case 2:return Ei.compareValue(s,-r);case 3:return Ei.compareValue(-r,s);case 4:return Ei.compareValue(-r,-s);case 5:return Ei.compareValue(-s,-r);case 6:return Ei.compareValue(-s,r);case 7:return Ei.compareValue(r,-s)}return Nt.shouldNeverReachHere("invalid octant value"),0},Ei.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Os=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this._segString=t,this.coord=new L(e),this.segmentIndex=i,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(i))};Os.prototype.getCoordinate=function(){return this.coord},Os.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Os.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Ei.compare(this._segmentOctant,this.coord,e.coord)},Os.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},Os.prototype.isInterior=function(){return this._isInterior},Os.prototype.interfaces_=function(){return[hn]},Os.prototype.getClass=function(){return Os};var ci=function(){this._nodeMap=new ii,this._edge=null;var t=arguments[0];this._edge=t};ci.prototype.getSplitCoordinates=function(){var t=this,e=new cl;this.addEndpoints();for(var i=this.iterator(),r=i.next();i.hasNext();){var s=i.next();t.addEdgeCoordinates(r,s,e),r=s}return e.toCoordinateArray()},ci.prototype.addCollapsedNodes=function(){var t=this,e=new Z;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var i=e.iterator();i.hasNext();){var r=i.next().intValue();t.add(t._edge.getCoordinate(r),r)}},ci.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},ci.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,i=0;i<this._edge.size()-2;i++){var r=e._edge.getCoordinate(i),s=e._edge.getCoordinate(i+2);r.equals2D(s)&&t.add(new zn(i+1))}},ci.prototype.addEdgeCoordinates=function(t,e,i){var r=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);i.add(new L(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)i.add(r._edge.getCoordinate(a));o&&i.add(new L(e.coord))},ci.prototype.iterator=function(){return this._nodeMap.values().iterator()},ci.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),r=i.next();i.hasNext();){var s=i.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},ci.prototype.findCollapseIndex=function(t,e,i){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,r===1?(i[0]=t.segmentIndex+1,!0):!1},ci.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,i=new Array(1).fill(null),r=this.iterator(),s=r.next();r.hasNext();){var o=r.next(),a=e.findCollapseIndex(s,o,i);a&&t.add(new zn(i[0])),s=o}},ci.prototype.getEdge=function(){return this._edge},ci.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ci.prototype.createSplitEdge=function(t,e){var i=this,r=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),h=0;a[h++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[h++]=i._edge.getCoordinate(u);return o&&(a[h]=new L(e.coord)),new Se(a,this._edge.getData())},ci.prototype.add=function(t,e){var i=new Os(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(i);return r!==null?(Nt.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(i,i),i)},ci.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),i=t.get(0),r=i.getCoordinate(0);if(!r.equals2D(e[0]))throw new $r("bad split edge start point at "+r);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new $r("bad split edge end point at "+a)},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var ia=function(){};ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},ia.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 ce("Cannot compute the octant for point ( "+t+", "+e+" )");var i=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?i>=r?0:1:i>=r?7:6:e>=0?i>=r?3:2:i>=r?4:5}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var s=arguments[0],o=arguments[1],a=o.x-s.x,h=o.y-s.y;if(a===0&&h===0)throw new ce("Cannot compute the octant for two identical points "+s);return ia.octant(a,h)}};var Cr=function(){};Cr.prototype.getCoordinates=function(){},Cr.prototype.size=function(){},Cr.prototype.getCoordinate=function(t){},Cr.prototype.isClosed=function(){},Cr.prototype.setData=function(t){},Cr.prototype.getData=function(){},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var wl=function(){};wl.prototype.addIntersection=function(t,e){},wl.prototype.interfaces_=function(){return[Cr]},wl.prototype.getClass=function(){return wl};var Se=function(){this._nodeList=new ci(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Se.prototype.getCoordinates=function(){return this._pts},Se.prototype.size=function(){return this._pts.length},Se.prototype.getCoordinate=function(t){return this._pts[t]},Se.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Se.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Se.prototype.setData=function(t){this._data=t},Se.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ia.octant(t,e)},Se.prototype.getData=function(){return this._data},Se.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var i=arguments[0],r=arguments[1],s=arguments[3],o=new L(i.getIntersection(s));this.addIntersection(o,r)}},Se.prototype.toString=function(){return Pn.toLineString(new Ee(this._pts))},Se.prototype.getNodeList=function(){return this._nodeList},Se.prototype.addIntersectionNode=function(t,e){var i=e,r=i+1;if(r<this._pts.length){var s=this._pts[r];t.equals2D(s)&&(i=r)}var o=this._nodeList.add(t,i);return o},Se.prototype.addIntersections=function(t,e,i){for(var r=this,s=0;s<t.getIntersectionNum();s++)r.addIntersection(t,e,i,s)},Se.prototype.interfaces_=function(){return[wl]},Se.prototype.getClass=function(){return Se},Se.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new Z;return Se.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var i=arguments[0],r=arguments[1],s=i.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(r)}};var dt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new L,this.p1=new L;else if(arguments.length===1){var t=arguments[0];this.p0=new L(t.p0),this.p1=new L(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],i=arguments[1],r=arguments[2],s=arguments[3];this.p0=new L(e,i),this.p1=new L(r,s)}},wy={serialVersionUID:{configurable:!0}};dt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dt.prototype.orientationIndex=function(){if(arguments[0]instanceof dt){var t=arguments[0],e=et.orientationIndex(this.p0,this.p1,t.p0),i=et.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&i>=0||e<=0&&i<=0?Math.max(e,i):0}else if(arguments[0]instanceof L){var r=arguments[0];return et.orientationIndex(this.p0,this.p1,r)}},dt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dt.prototype.isVertical=function(){return this.p0.x===this.p1.x},dt.prototype.equals=function(t){if(!(t instanceof dt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dt.prototype.intersection=function(t){var e=new lo;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dt.prototype.project=function(){if(arguments[0]instanceof L){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new L(t);var e=this.projectionFactor(t),i=new L;return i.x=this.p0.x+e*(this.p1.x-this.p0.x),i.y=this.p0.y+e*(this.p1.y-this.p0.y),i}else if(arguments[0]instanceof dt){var r=arguments[0],s=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(r.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var h=this.project(r.p1);return o<0&&(h=this.p0),o>1&&(h=this.p1),new dt(a,h)}},dt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},dt.prototype.distancePerpendicular=function(t){return et.distancePointLinePerpendicular(t,this.p0,this.p1)},dt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dt.prototype.midPoint=function(){return dt.midPoint(this.p0,this.p1)},dt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,r=e*e+i*i;if(r<=0)return Pt.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*i)/r;return s},dt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var i=new Array(2).fill(null),r=Pt.MAX_VALUE,s=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),i[0]=o,i[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<r&&(r=s,i[0]=a,i[1]=t.p1);var h=t.closestPoint(this.p0);s=h.distance(this.p0),s<r&&(r=s,i[0]=this.p0,i[1]=h);var u=t.closestPoint(this.p1);return s=u.distance(this.p1),s<r&&(r=s,i[0]=this.p1,i[1]=u),i},dt.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var i=this.p0.distance(t),r=this.p1.distance(t);return i<r?this.p0:this.p1},dt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dt.prototype.getLength=function(){return this.p0.distance(this.p1)},dt.prototype.compareTo=function(t){var e=t,i=this.p0.compareTo(e.p0);return i!==0?i:this.p1.compareTo(e.p1)},dt.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dt.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)},dt.prototype.lineIntersection=function(t){try{var e=Cn.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(i){if(!(i instanceof lh))throw i}finally{}return null},dt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dt.prototype.pointAlongOffset=function(t,e){var i=this.p0.x+t*(this.p1.x-this.p0.x),r=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),h=0,u=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");h=e*s/a,u=e*o/a}var c=i-u,l=r+h,d=new L(c,l);return d},dt.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=i.x,this.p1.y=i.y}},dt.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Pt.isNaN(e))&&(e=1),e},dt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dt.prototype.distance=function(){if(arguments[0]instanceof dt){var t=arguments[0];return et.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof L){var e=arguments[0];return et.distancePointLine(e,this.p0,this.p1)}},dt.prototype.pointAlong=function(t){var e=new L;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},dt.prototype.hashCode=function(){var t=Pt.doubleToLongBits(this.p0.x);t^=Pt.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),i=Pt.doubleToLongBits(this.p1.x);i^=Pt.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(i)^Math.trunc(i>>32);return e^r},dt.prototype.interfaces_=function(){return[hn,un]},dt.prototype.getClass=function(){return dt},dt.midPoint=function(t,e){return new L((t.x+e.x)/2,(t.y+e.y)/2)},wy.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dt,wy);var El=function(){this.tempEnv1=new ct,this.tempEnv2=new ct,this._overlapSeg1=new dt,this._overlapSeg2=new dt};El.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),i.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var Li=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=i,this._context=r};Li.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Li.prototype.computeSelect=function(t,e,i,r){var s=this._pts[e],o=this._pts[i];if(r.tempEnv1.init(s,o),i-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+i)/2);e<a&&this.computeSelect(t,e,a,r),a<i&&this.computeSelect(t,a,i,r)},Li.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),i=0,r=this._start;r<=this._end;r++)e[i++]=t._pts[r];return e},Li.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Li.prototype.setId=function(t){this._id=t},Li.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Li.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ct(t,e)}return this._env},Li.prototype.getEndIndex=function(){return this._end},Li.prototype.getStartIndex=function(){return this._start},Li.prototype.getContext=function(){return this._context},Li.prototype.getId=function(){return this._id},Li.prototype.computeOverlapsInternal=function(t,e,i,r,s,o){var a=this._pts[t],h=this._pts[e],u=i._pts[r],c=i._pts[s];if(e-t===1&&s-r===1)return o.overlap(this,t,i,r),null;if(o.tempEnv1.init(a,h),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var l=Math.trunc((t+e)/2),d=Math.trunc((r+s)/2);t<l&&(r<d&&this.computeOverlapsInternal(t,l,i,r,d,o),d<s&&this.computeOverlapsInternal(t,l,i,d,s,o)),l<e&&(r<d&&this.computeOverlapsInternal(l,e,i,r,d,o),d<s&&this.computeOverlapsInternal(l,e,i,d,s,o))},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Kn=function(){};Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},Kn.getChainStartIndices=function(t){var e=0,i=new Z;i.add(new zn(e));do{var r=Kn.findChainEnd(t,e);i.add(new zn(r)),e=r}while(e<t.length-1);var s=Kn.toIntArray(i);return s},Kn.findChainEnd=function(t,e){for(var i=e;i<t.length-1&&t[i].equals2D(t[i+1]);)i++;if(i>=t.length-1)return t.length-1;for(var r=Qt.quadrant(t[i],t[i+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=Qt.quadrant(t[s-1],t[s]);if(o!==r)break}s++}return s-1},Kn.getChains=function(){if(arguments.length===1){var t=arguments[0];return Kn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],i=arguments[1],r=new Z,s=Kn.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new Li(e,s[o],s[o+1],i);r.add(a)}return r}},Kn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var po=function(){};po.prototype.computeNodes=function(t){},po.prototype.getNodedSubstrings=function(){},po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po};var Sl=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Sl.prototype.setSegmentIntersector=function(t){this._segInt=t},Sl.prototype.interfaces_=function(){return[po]},Sl.prototype.getClass=function(){return Sl};var Bg=function(n){function t(i){i?n.call(this,i):n.call(this),this._monoChains=new Z,this._index=new _y,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 Se.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(r){for(var s=this,o=Kn.getChains(r.getCoordinates(),r),a=o.iterator();a.hasNext();){var h=a.next();h.setId(s._idCounter++),s._index.insert(h.getEnvelope(),h),s._monoChains.add(h)}},t.prototype.computeNodes=function(r){var s=this;this._nodedSegStrings=r;for(var o=r.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var r=this,s=new Ey(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),h=r._index.query(a.getEnvelope()),u=h.iterator();u.hasNext();){var c=u.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Ey},Object.defineProperties(t,e),t}(Sl),Ey=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 i=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3],a=i.getContext(),h=s.getContext();this._si.processIntersections(a,r,h,o)}else return n.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(El),Yt=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],i=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(i)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},rs={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}};Yt.prototype.getEndCapStyle=function(){return this._endCapStyle},Yt.prototype.isSingleSided=function(){return this._isSingleSided},Yt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Yt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Yt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Yt.JOIN_ROUND&&(this._quadrantSegments=Yt.DEFAULT_QUADRANT_SEGMENTS)},Yt.prototype.getJoinStyle=function(){return this._joinStyle},Yt.prototype.setJoinStyle=function(t){this._joinStyle=t},Yt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Yt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Yt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Yt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Yt.prototype.getMitreLimit=function(){return this._mitreLimit},Yt.prototype.setMitreLimit=function(t){this._mitreLimit=t},Yt.prototype.setSingleSided=function(t){this._isSingleSided=t},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},rs.CAP_ROUND.get=function(){return 1},rs.CAP_FLAT.get=function(){return 2},rs.CAP_SQUARE.get=function(){return 3},rs.JOIN_ROUND.get=function(){return 1},rs.JOIN_MITRE.get=function(){return 2},rs.JOIN_BEVEL.get=function(){return 3},rs.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},rs.DEFAULT_MITRE_LIMIT.get=function(){return 5},rs.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Yt,rs);var me=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=et.COUNTERCLOCKWISE,this._inputLine=t||null},Cl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};me.prototype.isDeletable=function(t,e,i,r){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[i];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,r)?!1:this.isShallowSampled(s,o,t,i,r)},me.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,i=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(i),s=!1;r<this._inputLine.length;){var o=!1;t.isDeletable(e,i,r,t._distanceTol)&&(t._isDeleted[i]=me.DELETE,o=!0,s=!0),o?e=r:e=i,i=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(i)}return s},me.prototype.isShallowConcavity=function(t,e,i,r){var s=et.computeOrientation(t,e,i),o=s===this._angleOrientation;if(!o)return!1;var a=et.distancePointLine(e,t,i);return a<r},me.prototype.isShallowSampled=function(t,e,i,r,s){var o=this,a=Math.trunc((r-i)/me.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var h=i;h<r;h+=a)if(!o.isShallow(t,e,o._inputLine[h],s))return!1;return!0},me.prototype.isConcave=function(t,e,i){var r=et.computeOrientation(t,e,i),s=r===this._angleOrientation;return s},me.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=et.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=e.deleteShallowConcavities();while(i);return this.collapseLine()},me.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===me.DELETE;)e++;return e},me.prototype.isShallow=function(t,e,i,r){var s=et.distancePointLine(e,t,i);return s<r},me.prototype.collapseLine=function(){for(var t=this,e=new cl,i=0;i<this._inputLine.length;i++)t._isDeleted[i]!==me.DELETE&&e.add(t._inputLine[i]);return e.toCoordinateArray()},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.simplify=function(t,e){var i=new me(t);return i.simplify(e)},Cl.INIT.get=function(){return 0},Cl.DELETE.get=function(){return 1},Cl.KEEP.get=function(){return 1},Cl.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(me,Cl);var $i=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Z},Sy={COORDINATE_ARRAY_TYPE:{configurable:!0}};$i.prototype.getCoordinates=function(){var t=this._ptList.toArray($i.COORDINATE_ARRAY_TYPE);return t},$i.prototype.setPrecisionModel=function(t){this._precisionModel=t},$i.prototype.addPt=function(t){var e=new L(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},$i.prototype.revere=function(){},$i.prototype.addPts=function(t,e){var i=this;if(e)for(var r=0;r<t.length;r++)i.addPt(t[r]);else for(var s=t.length-1;s>=0;s--)i.addPt(t[s])},$i.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),i=t.distance(e);return i<this._minimimVertexDistance},$i.prototype.toString=function(){var t=new Ft,e=t.createLineString(this.getCoordinates());return e.toString()},$i.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new L(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},$i.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},Sy.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties($i,Sy);var Gt=function(){},na={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.toDegrees=function(t){return t*180/Math.PI},Gt.normalize=function(t){for(;t>Math.PI;)t-=Gt.PI_TIMES_2;for(;t<=-Math.PI;)t+=Gt.PI_TIMES_2;return t},Gt.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],i=arguments[1],r=i.x-e.x,s=i.y-e.y;return Math.atan2(s,r)}},Gt.isAcute=function(t,e,i){var r=t.x-e.x,s=t.y-e.y,o=i.x-e.x,a=i.y-e.y,h=r*o+s*a;return h>0},Gt.isObtuse=function(t,e,i){var r=t.x-e.x,s=t.y-e.y,o=i.x-e.x,a=i.y-e.y,h=r*o+s*a;return h<0},Gt.interiorAngle=function(t,e,i){var r=Gt.angle(e,t),s=Gt.angle(e,i);return Math.abs(s-r)},Gt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Gt.PI_TIMES_2;t>=Gt.PI_TIMES_2&&(t=0)}else{for(;t>=Gt.PI_TIMES_2;)t-=Gt.PI_TIMES_2;t<0&&(t=0)}return t},Gt.angleBetween=function(t,e,i){var r=Gt.angle(e,t),s=Gt.angle(e,i);return Gt.diff(r,s)},Gt.diff=function(t,e){var i=null;return t<e?i=e-t:i=t-e,i>Math.PI&&(i=2*Math.PI-i),i},Gt.toRadians=function(t){return t*Math.PI/180},Gt.getTurn=function(t,e){var i=Math.sin(e-t);return i>0?Gt.COUNTERCLOCKWISE:i<0?Gt.CLOCKWISE:Gt.NONE},Gt.angleBetweenOriented=function(t,e,i){var r=Gt.angle(e,t),s=Gt.angle(e,i),o=s-r;return o<=-Math.PI?o+Gt.PI_TIMES_2:o>Math.PI?o-Gt.PI_TIMES_2:o},na.PI_TIMES_2.get=function(){return 2*Math.PI},na.PI_OVER_2.get=function(){return Math.PI/2},na.PI_OVER_4.get=function(){return Math.PI/4},na.COUNTERCLOCKWISE.get=function(){return et.COUNTERCLOCKWISE},na.CLOCKWISE.get=function(){return et.CLOCKWISE},na.NONE.get=function(){return et.COLLINEAR},Object.defineProperties(Gt,na);var ue=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 dt,this._seg1=new dt,this._offset0=new dt,this._offset1=new dt,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new lo,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Yt.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},Pl={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}};ue.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var i=et.computeOrientation(this._s0,this._s1,this._s2),r=i===et.CLOCKWISE&&this._side===K.LEFT||i===et.COUNTERCLOCKWISE&&this._side===K.RIGHT;i===0?this.addCollinear(e):r?this.addOutsideTurn(i,e):this.addInsideTurn(i,e)},ue.prototype.addLineEndCap=function(t,e){var i=new dt(t,e),r=new dt;this.computeOffsetSegment(i,K.LEFT,this._distance,r);var s=new dt;this.computeOffsetSegment(i,K.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,h=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Yt.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,h+Math.PI/2,h-Math.PI/2,et.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Yt.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case Yt.CAP_SQUARE:var u=new L;u.x=Math.abs(this._distance)*Math.cos(h),u.y=Math.abs(this._distance)*Math.sin(h);var c=new L(r.p1.x+u.x,r.p1.y+u.y),l=new L(s.p1.x+u.x,s.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l);break}},ue.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ue.prototype.addMitreJoin=function(t,e,i,r){var s=!0,o=null;try{o=Cn.intersection(e.p0,e.p1,i.p0,i.p1);var a=r<=0?1:o.distance(t)/Math.abs(r);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(h){if(h instanceof lh)o=new L(0,0),s=!1;else throw h}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,i,r,this._bufParams.getMitreLimit())},ue.prototype.addFilletCorner=function(t,e,i,r,s){var o=e.x-t.x,a=e.y-t.y,h=Math.atan2(a,o),u=i.x-t.x,c=i.y-t.y,l=Math.atan2(c,u);r===et.CLOCKWISE?h<=l&&(h+=2*Math.PI):h>=l&&(h-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,h,l,r,s),this._segList.addPt(i)},ue.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ue.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Yt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Yt.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))},ue.prototype.createSquare=function(t){this._segList.addPt(new L(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new L(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ue.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ue.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ue.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ue.prototype.initSideSegments=function(t,e,i){this._s1=t,this._s2=e,this._side=i,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},ue.prototype.addLimitedMitreJoin=function(t,e,i,r){var s=this._seg0.p1,o=Gt.angle(s,this._seg0.p0),a=Gt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),h=a/2,u=Gt.normalize(o+h),c=Gt.normalize(u+Math.PI),l=r*i,d=l*Math.abs(Math.sin(h)),g=i-d,p=s.x+l*Math.cos(c),_=s.y+l*Math.sin(c),w=new L(p,_),P=new dt(s,w),v=P.pointAlongOffset(1,g),E=P.pointAlongOffset(1,-g);this._side===K.LEFT?(this._segList.addPt(v),this._segList.addPt(E)):(this._segList.addPt(E),this._segList.addPt(v))},ue.prototype.computeOffsetSegment=function(t,e,i,r){var s=e===K.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,h=Math.sqrt(o*o+a*a),u=s*i*o/h,c=s*i*a/h;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+u},ue.prototype.addFilletArc=function(t,e,i,r,s){var o=this,a=r===et.CLOCKWISE?-1:1,h=Math.abs(e-i),u=Math.trunc(h/this._filletAngleQuantum+.5);if(u<1)return null;for(var c=0,l=h/u,d=c,g=new L;d<h;){var p=e+a*d;g.x=t.x+s*Math.cos(p),g.y=t.y+s*Math.sin(p),o._segList.addPt(g),d+=l}},ue.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*ue.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var i=new L((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i);var r=new L((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},ue.prototype.createCircle=function(t){var e=new L(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ue.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ue.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $i,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ue.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ue.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()===Yt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Yt.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,et.CLOCKWISE,this._distance))},ue.prototype.closeRing=function(){this._segList.closeRing()},ue.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue},Pl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Pl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Pl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Pl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ue,Pl);var Si=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Si.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var i=e<0,r=Math.abs(e),s=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,i,s);var o=s.getCoordinates();return i&&Lt.reverse(o),o},Si.prototype.computeSingleSidedBufferCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);if(e){i.addSegments(t,!0);var s=me.simplify(t,-r),o=s.length-1;i.initSideSegments(s[o],s[o-1],K.LEFT),i.addFirstSegment();for(var a=o-2;a>=0;a--)i.addNextSegment(s[a],!0)}else{i.addSegments(t,!1);var h=me.simplify(t,r),u=h.length-1;i.initSideSegments(h[0],h[1],K.LEFT),i.addFirstSegment();for(var c=2;c<=u;c++)i.addNextSegment(h[c],!0)}i.addLastSegment(),i.closeRing()},Si.prototype.computeRingBufferCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);e===K.RIGHT&&(r=-r);var s=me.simplify(t,r),o=s.length-1;i.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var h=a!==1;i.addNextSegment(s[a],h)}i.closeRing()},Si.prototype.computeLineBufferCurve=function(t,e){var i=this.simplifyTolerance(this._distance),r=me.simplify(t,i),s=r.length-1;e.initSideSegments(r[0],r[1],K.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[s-1],r[s]);var a=me.simplify(t,-i),h=a.length-1;e.initSideSegments(a[h],a[h-1],K.LEFT);for(var u=h-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Si.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Yt.CAP_ROUND:e.createCircle(t);break;case Yt.CAP_SQUARE:e.createSquare(t);break}},Si.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var i=Math.abs(e),r=this.getSegGen(i);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o},Si.prototype.getBufferParameters=function(){return this._bufParams},Si.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Si.prototype.getRingCurve=function(t,e,i){if(this._distance=i,t.length<=2)return this.getLineCurve(t,i);if(i===0)return Si.copyCoordinates(t);var r=this.getSegGen(i);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Si.prototype.computeOffsetCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);if(e){var s=me.simplify(t,-r),o=s.length-1;i.initSideSegments(s[o],s[o-1],K.LEFT),i.addFirstSegment();for(var a=o-2;a>=0;a--)i.addNextSegment(s[a],!0)}else{var h=me.simplify(t,r),u=h.length-1;i.initSideSegments(h[0],h[1],K.LEFT),i.addFirstSegment();for(var c=2;c<=u;c++)i.addNextSegment(h[c],!0)}i.addLastSegment()},Si.prototype.getSegGen=function(t){return new ue(this._precisionModel,this._bufParams,t)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),i=0;i<e.length;i++)e[i]=new L(t[i]);return e};var ra=function(){this._subgraphs=null,this._seg=new dt,this._cga=new et;var t=arguments[0];this._subgraphs=t},Cy={DepthSegment:{configurable:!0}};ra.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],i=new Z,r=this._subgraphs.iterator();r.hasNext();){var s=r.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),i)}return i}else if(arguments.length===3){if(wt(arguments[2],bn)&&arguments[0]instanceof L&&arguments[1]instanceof Gg)for(var a=arguments[0],h=arguments[1],u=arguments[2],c=h.getEdge().getCoordinates(),l=0;l<c.length-1;l++){t._seg.p0=c[l],t._seg.p1=c[l+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var d=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(d<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&et.computeOrientation(t._seg.p0,t._seg.p1,a)!==et.RIGHT){var g=h.getDepth(K.LEFT);t._seg.p0.equals(c[l])||(g=h.getDepth(K.RIGHT));var p=new vo(t._seg,g);u.add(p)}}else if(wt(arguments[2],bn)&&arguments[0]instanceof L&&wt(arguments[1],bn))for(var _=arguments[0],w=arguments[1],P=arguments[2],v=w.iterator();v.hasNext();){var E=v.next();E.isForward()&&t.findStabbedSegments(_,E,P)}}},ra.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var i=Tn.min(e);return i._leftDepth},ra.prototype.interfaces_=function(){return[]},ra.prototype.getClass=function(){return ra},Cy.DepthSegment.get=function(){return vo},Object.defineProperties(ra,Cy);var vo=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dt(t),this._leftDepth=e};vo.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var i=this._upwardSeg.orientationIndex(e._upwardSeg);return i!==0||(i=-1*e._upwardSeg.orientationIndex(this._upwardSeg),i!==0)?i:this._upwardSeg.compareTo(e._upwardSeg)},vo.prototype.compareX=function(t,e){var i=t.p0.compareTo(e.p0);return i!==0?i:t.p1.compareTo(e.p1)},vo.prototype.toString=function(){return this._upwardSeg.toString()},vo.prototype.interfaces_=function(){return[hn]},vo.prototype.getClass=function(){return vo};var Jt=function(t,e,i){this.p0=t||null,this.p1=e||null,this.p2=i||null};Jt.prototype.area=function(){return Jt.area(this.p0,this.p1,this.p2)},Jt.prototype.signedArea=function(){return Jt.signedArea(this.p0,this.p1,this.p2)},Jt.prototype.interpolateZ=function(t){if(t===null)throw new ce("Supplied point is null.");return Jt.interpolateZ(t,this.p0,this.p1,this.p2)},Jt.prototype.longestSideLength=function(){return Jt.longestSideLength(this.p0,this.p1,this.p2)},Jt.prototype.isAcute=function(){return Jt.isAcute(this.p0,this.p1,this.p2)},Jt.prototype.circumcentre=function(){return Jt.circumcentre(this.p0,this.p1,this.p2)},Jt.prototype.area3D=function(){return Jt.area3D(this.p0,this.p1,this.p2)},Jt.prototype.centroid=function(){return Jt.centroid(this.p0,this.p1,this.p2)},Jt.prototype.inCentre=function(){return Jt.inCentre(this.p0,this.p1,this.p2)},Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt},Jt.area=function(t,e,i){return Math.abs(((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2)},Jt.signedArea=function(t,e,i){return((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2},Jt.det=function(t,e,i,r){return t*r-e*i},Jt.interpolateZ=function(t,e,i,r){var s=e.x,o=e.y,a=i.x-s,h=r.x-s,u=i.y-o,c=r.y-o,l=a*c-h*u,d=t.x-s,g=t.y-o,p=(c*d-h*g)/l,_=(-u*d+a*g)/l,w=e.z+p*(i.z-e.z)+_*(r.z-e.z);return w},Jt.longestSideLength=function(t,e,i){var r=t.distance(e),s=e.distance(i),o=i.distance(t),a=r;return s>a&&(a=s),o>a&&(a=o),a},Jt.isAcute=function(t,e,i){return!(!Gt.isAcute(t,e,i)||!Gt.isAcute(e,i,t)||!Gt.isAcute(i,t,e))},Jt.circumcentre=function(t,e,i){var r=i.x,s=i.y,o=t.x-r,a=t.y-s,h=e.x-r,u=e.y-s,c=2*Jt.det(o,a,h,u),l=Jt.det(a,o*o+a*a,u,h*h+u*u),d=Jt.det(o,o*o+a*a,h,h*h+u*u),g=r-l/c,p=s+d/c;return new L(g,p)},Jt.perpendicularBisector=function(t,e){var i=e.x-t.x,r=e.y-t.y,s=new Cn(t.x+i/2,t.y+r/2,1),o=new Cn(t.x-r+i/2,t.y+i+r/2,1);return new Cn(s,o)},Jt.angleBisector=function(t,e,i){var r=e.distance(t),s=e.distance(i),o=r/(r+s),a=i.x-t.x,h=i.y-t.y,u=new L(t.x+o*a,t.y+o*h);return u},Jt.area3D=function(t,e,i){var r=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=i.x-t.x,h=i.y-t.y,u=i.z-t.z,c=s*u-o*h,l=o*a-r*u,d=r*h-s*a,g=c*c+l*l+d*d,p=Math.sqrt(g)/2;return p},Jt.centroid=function(t,e,i){var r=(t.x+e.x+i.x)/3,s=(t.y+e.y+i.y)/3;return new L(r,s)},Jt.inCentre=function(t,e,i){var r=e.distance(i),s=t.distance(i),o=t.distance(e),a=r+s+o,h=(r*t.x+s*e.x+o*i.x)/a,u=(r*t.y+s*e.y+o*i.y)/a;return new L(h,u)};var gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Z;var t=arguments[0],e=arguments[1],i=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=i};gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,V.EXTERIOR,V.INTERIOR)},gn.prototype.addPolygon=function(t){var e=this,i=this._distance,r=K.LEFT;this._distance<0&&(i=-this._distance,r=K.RIGHT);var s=t.getExteriorRing(),o=Lt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,i,r,V.EXTERIOR,V.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var h=t.getInteriorRingN(a),u=Lt.removeRepeatedPoints(h.getCoordinates());e._distance>0&&e.isErodedCompletely(h,-e._distance)||e.addPolygonRing(u,i,K.opposite(r),V.INTERIOR,V.EXTERIOR)}},gn.prototype.isTriangleErodedCompletely=function(t,e){var i=new Jt(t[0],t[1],t[2]),r=i.inCentre(),s=et.distancePointLine(r,i.p0,i.p1);return s<Math.abs(e)},gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Lt.removeRepeatedPoints(t.getCoordinates()),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,V.EXTERIOR,V.INTERIOR)},gn.prototype.addCurve=function(t,e,i){if(t===null||t.length<2)return null;var r=new Se(t,new Kt(0,V.BOUNDARY,e,i));this._curveList.add(r)},gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},gn.prototype.addPolygonRing=function(t,e,i,r,s){if(e===0&&t.length<wr.MINIMUM_VALID_SIZE)return null;var o=r,a=s;t.length>=wr.MINIMUM_VALID_SIZE&&et.isCCW(t)&&(o=s,a=r,i=K.opposite(i));var h=this._curveBuilder.getRingCurve(t,i,e);this.addCurve(h,o,a)},gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof De?this.addPolygon(t):t instanceof ve?this.addLineString(t):t instanceof Ai?this.addPoint(t):t instanceof yh?this.addCollection(t):t instanceof go?this.addCollection(t):t instanceof Er?this.addCollection(t):t instanceof ui&&this.addCollection(t)},gn.prototype.isErodedCompletely=function(t,e){var i=t.getCoordinates();if(i.length<4)return e<0;if(i.length===4)return this.isTriangleErodedCompletely(i,e);var r=t.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>s},gn.prototype.addCollection=function(t){for(var e=this,i=0;i<t.getNumGeometries();i++){var r=t.getGeometryN(i);e.add(r)}},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Ch=function(){};Ch.prototype.locate=function(t){},Ch.prototype.interfaces_=function(){return[]},Ch.prototype.getClass=function(){return Ch};var Pr=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()};Pr.prototype.next=function(){if(this._atStart)return this._atStart=!1,Pr.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 mh;var t=this._parent.getGeometryN(this._index++);return t instanceof ui?(this._subcollectionIterator=new Pr(t),this._subcollectionIterator.next()):t},Pr.prototype.remove=function(){throw new Error(this.getClass().getName())},Pr.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)},Pr.prototype.interfaces_=function(){return[vh]},Pr.prototype.getClass=function(){return Pr},Pr.isAtomic=function(t){return!(t instanceof ui)};var Ki=function(){this._geom=null;var t=arguments[0];this._geom=t};Ki.prototype.locate=function(t){return Ki.locate(t,this._geom)},Ki.prototype.interfaces_=function(){return[Ch]},Ki.prototype.getClass=function(){return Ki},Ki.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?et.isPointInRing(t,e.getCoordinates()):!1},Ki.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var i=e.getExteriorRing();if(!Ki.isPointInRing(t,i))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var s=e.getInteriorRingN(r);if(Ki.isPointInRing(t,s))return!1}return!0},Ki.containsPoint=function(t,e){if(e instanceof De)return Ki.containsPointInPolygon(t,e);if(e instanceof ui)for(var i=new Pr(e);i.hasNext();){var r=i.next();if(r!==e&&Ki.containsPoint(t,r))return!0}return!1},Ki.locate=function(t,e){return e.isEmpty()?V.EXTERIOR:Ki.containsPoint(t,e)?V.INTERIOR:V.EXTERIOR};var ri=function(){this._edgeMap=new ii,this._edgeList=null,this._ptInAreaLocation=[V.NONE,V.NONE]};ri.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),i=e-1;return e===0&&(i=this._edgeList.size()-1),this._edgeList.get(i)},ri.prototype.propagateSideLabels=function(t){for(var e=V.NONE,i=this.iterator();i.hasNext();){var r=i.next(),s=r.getLabel();s.isArea(t)&&s.getLocation(t,K.LEFT)!==V.NONE&&(e=s.getLocation(t,K.LEFT))}if(e===V.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var h=a.next(),u=h.getLabel();if(u.getLocation(t,K.ON)===V.NONE&&u.setLocation(t,K.ON,o),u.isArea(t)){var c=u.getLocation(t,K.LEFT),l=u.getLocation(t,K.RIGHT);if(l!==V.NONE){if(l!==o)throw new is("side location conflict",h.getCoordinate());c===V.NONE&&Nt.shouldNeverReachHere("found single null side (at "+h.getCoordinate()+")"),o=c}else Nt.isTrue(u.getLocation(t,K.LEFT)===V.NONE,"found single null side"),u.setLocation(t,K.RIGHT,o),u.setLocation(t,K.LEFT,o)}}},ri.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},ri.prototype.print=function(t){We.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},ri.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ri.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var i=e.size()-1,r=e.get(i).getLabel(),s=r.getLocation(t,K.LEFT);Nt.isTrue(s!==V.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var h=a.next(),u=h.getLabel();Nt.isTrue(u.isArea(t),"Found non-area edge");var c=u.getLocation(t,K.LEFT),l=u.getLocation(t,K.RIGHT);if(c===l||l!==o)return!1;o=c}return!0},ri.prototype.findIndex=function(t){var e=this;this.iterator();for(var i=0;i<this._edgeList.size();i++){var r=e._edgeList.get(i);if(r===t)return i}return-1},ri.prototype.iterator=function(){return this.getEdges().iterator()},ri.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Z(this._edgeMap.values())),this._edgeList},ri.prototype.getLocation=function(t,e,i){return this._ptInAreaLocation[t]===V.NONE&&(this._ptInAreaLocation[t]=Ki.locate(e,i[t].getGeometry())),this._ptInAreaLocation[t]},ri.prototype.toString=function(){var t=new Vn;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
66
+ `}[t]};var Cn=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],i=arguments[1];this.x=e,this.y=i,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var r=arguments[0],s=arguments[1];this.x=r.y*s.w-s.y*r.w,this.y=s.x*r.w-r.x*s.w,this.w=r.x*s.y-s.x*r.y}else if(arguments[0]instanceof L&&arguments[1]instanceof L){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 h=arguments[0],u=arguments[1],c=arguments[2];this.x=h,this.y=u,this.w=c}else if(arguments.length===4){var l=arguments[0],d=arguments[1],g=arguments[2],p=arguments[3],_=l.y-d.y,w=d.x-l.x,P=l.x*d.y-d.x*l.y,v=g.y-p.y,E=p.x-g.x,m=g.x*p.y-p.x*g.y;this.x=w*m-E*P,this.y=v*P-_*m,this.w=_*E-v*w}};Cn.prototype.getY=function(){var t=this.y/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new lh;return t},Cn.prototype.getX=function(){var t=this.x/this.w;if(Pt.isNaN(t)||Pt.isInfinite(t))throw new lh;return t},Cn.prototype.getCoordinate=function(){var t=new L;return t.x=this.getX(),t.y=this.getY(),t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.intersection=function(t,e,i,r){var s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,h=i.y-r.y,u=r.x-i.x,c=i.x*r.y-r.x*i.y,l=o*c-u*a,d=h*a-s*c,g=s*u-h*o,p=l/g,_=d/g;if(Pt.isNaN(p)||Pt.isInfinite(p)||Pt.isNaN(_)||Pt.isInfinite(_))throw new lh;return new L(p,_)};var ct=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 L){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 i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],h=arguments[3];this.init(s,o,a,h)}},uy={serialVersionUID:{configurable:!0}};ct.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ct.prototype.equals=function(t){if(!(t instanceof ct))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},ct.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ct;var e=this._minx>t._minx?this._minx:t._minx,i=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new ct(e,r,i,s)},ct.prototype.isNull=function(){return this._maxx<this._minx},ct.prototype.getMaxX=function(){return this._maxx},ct.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof ct){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 i=arguments[0],r=arguments[1];return this.isNull()?!1:i>=this._minx&&i<=this._maxx&&r>=this._miny&&r<=this._maxy}},ct.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ct){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 L){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.isNull()?!1:!(i>this._maxx||i<this._minx||r>this._maxy||r<this._miny)}},ct.prototype.getMinY=function(){return this._miny},ct.prototype.getMinX=function(){return this._minx},ct.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ct){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=r,this._maxy=r):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},ct.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ct.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ct.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},ct.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ct.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ct.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ct.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ct.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ct.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ct.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ct){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.covers(i,r)}},ct.prototype.centre=function(){return this.isNull()?null:new L((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ct.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ct){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],h=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<h?(this._miny=a,this._maxy=h):(this._miny=h,this._maxy=a)}},ct.prototype.getMaxY=function(){return this._maxy},ct.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var i=0;return this._maxy<t._miny?i=t._miny-this._maxy:this._miny>t._maxy&&(i=this._miny-t._maxy),e===0?i:i===0?e:Math.sqrt(e*e+i*i)},ct.prototype.hashCode=function(){var t=17;return t=37*t+L.hashCode(this._minx),t=37*t+L.hashCode(this._maxx),t=37*t+L.hashCode(this._miny),t=37*t+L.hashCode(this._maxy),t},ct.prototype.interfaces_=function(){return[hn,un]},ct.prototype.getClass=function(){return ct},ct.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],i=arguments[2];return i.x>=(t.x<e.x?t.x:e.x)&&i.x<=(t.x>e.x?t.x:e.x)&&i.y>=(t.y<e.y?t.y:e.y)&&i.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],h=Math.min(o.x,a.x),u=Math.max(o.x,a.x),c=Math.min(r.x,s.x),l=Math.max(r.x,s.x);return!(c>u||l<h||(h=Math.min(o.y,a.y),u=Math.max(o.y,a.y),c=Math.min(r.y,s.y),l=Math.max(r.y,s.y),c>u)||l<h)}},uy.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ct,uy);var Un={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*$/},Uc=function(t){this.geometryFactory=t||new Ft};Uc.prototype.read=function(t){var e,i,r;t=t.replace(/[\n\r]/g," ");var s=Un.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=Un.emptyTypeStr.exec(t),s[2]=void 0),s&&(i=s[1].toLowerCase(),r=s[2],ch[i]&&(e=ch[i].apply(this,[r]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Uc.prototype.write=function(t){return this.extractGeometry(t)},Uc.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Jr[e])return null;var i=e.toUpperCase(),r;return t.isEmpty()?r=i+" EMPTY":r=i+"("+Jr[e].apply(this,[t])+")",r};var Jr={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Jr.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push("("+Jr.point.apply(e,[t._geometries[r]])+")");return i.join(",")},linestring:function(t){for(var e=this,i=[],r=0,s=t._points._coordinates.length;r<s;++r)i.push(Jr.coordinate.apply(e,[t._points._coordinates[r]]));return i.join(",")},linearring:function(t){for(var e=this,i=[],r=0,s=t._points._coordinates.length;r<s;++r)i.push(Jr.coordinate.apply(e,[t._points._coordinates[r]]));return i.join(",")},multilinestring:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push("("+Jr.linestring.apply(e,[t._geometries[r]])+")");return i.join(",")},polygon:function(t){var e=this,i=[];i.push("("+Jr.linestring.apply(this,[t._shell])+")");for(var r=0,s=t._holes.length;r<s;++r)i.push("("+Jr.linestring.apply(e,[t._holes[r]])+")");return i.join(",")},multipolygon:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push("("+Jr.polygon.apply(e,[t._geometries[r]])+")");return i.join(",")},geometrycollection:function(t){for(var e=this,i=[],r=0,s=t._geometries.length;r<s;++r)i.push(e.extractGeometry(t._geometries[r]));return i.join(",")}},ch={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(Un.spaces);return this.geometryFactory.createPoint(new L(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var i,r=t.trim().split(","),s=[],o=0,a=r.length;o<a;++o)i=r[o].replace(Un.trimParens,"$1"),s.push(ch.point.apply(e,[i]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),i=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(Un.spaces),i.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),i=[],r,s=0,o=e.length;s<o;++s)r=e[s].trim().split(Un.spaces),i.push(new L(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var i,r=t.trim().split(Un.parenComma),s=[],o=0,a=r.length;o<a;++o)i=r[o].replace(Un.trimParens,"$1"),s.push(ch.linestring.apply(e,[i]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var i,r,s,o=t.trim().split(Un.parenComma),a,h=[],u=0,c=o.length;u<c;++u)i=o[u].replace(Un.trimParens,"$1"),r=ch.linestring.apply(e,[i]),s=e.geometryFactory.createLinearRing(r._points),u===0?a=s:h.push(s);return this.geometryFactory.createPolygon(a,h)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var i,r=t.trim().split(Un.doubleParenComma),s=[],o=0,a=r.length;o<a;++o)i=r[o].replace(Un.trimParens,"$1"),s.push(ch.polygon.apply(e,[i]));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 i=t.trim().split("|"),r=[],s=0,o=i.length;s<o;++s)r.push(e.read(i[s]));return this.geometryFactory.createGeometryCollection(r)}},Pn=function(t){this.parser=new Uc(t)};Pn.prototype.write=function(t){return this.parser.write(t)},Pn.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var $r=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),jc=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}($r),Nt=function(){};Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.shouldNeverReachHere=function(){if(arguments.length===0)Nt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new jc("Should never reach here"+(t!==null?": "+t:""))}},Nt.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],Nt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new jc:new jc(e)},Nt.equals=function(){var t,e,i;if(arguments.length===2)t=arguments[0],e=arguments[1],Nt.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],i=arguments[2],!e.equals(t)))throw new jc("Expected "+t+" but encountered "+e+(i!==null?": "+i:""))};var ge=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 L,this._intPt[1]=new L,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Ko={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ge.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ge.prototype.getTopologySummary=function(){var t=new Vn;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ge.prototype.computeIntersection=function(t,e,i,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=i,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,i,r)},ge.prototype.getIntersectionNum=function(){return this._result},ge.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),i=this.getEdgeDistance(t,1);e>i?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ge.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ge.prototype.setPrecisionModel=function(t){this._precisionModel=t},ge.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],i=0;i<this._result;i++)if(!(t._intPt[i].equals2D(t._inputLines[e][0])||t._intPt[i].equals2D(t._inputLines[e][1])))return!0;return!1}},ge.prototype.getIntersection=function(t){return this._intPt[t]},ge.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ge.prototype.hasIntersection=function(){return this._result!==ge.NO_INTERSECTION},ge.prototype.getEdgeDistance=function(t,e){var i=ge.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return i},ge.prototype.isCollinear=function(){return this._result===ge.COLLINEAR_INTERSECTION},ge.prototype.toString=function(){return Pn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Pn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ge.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ge.prototype.isIntersection=function(t){for(var e=this,i=0;i<this._result;i++)if(e._intPt[i].equals2D(t))return!0;return!1},ge.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.computeEdgeDistance=function(t,e,i){var r=Math.abs(i.x-e.x),s=Math.abs(i.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(i))r>s?o=r:o=s;else{var a=Math.abs(t.x-e.x),h=Math.abs(t.y-e.y);r>s?o=a:o=h,o===0&&!t.equals(e)&&(o=Math.max(a,h))}return Nt.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o},ge.nonRobustComputeEdgeDistance=function(t,e,i){var r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s);return Nt.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o},Ko.DONT_INTERSECT.get=function(){return 0},Ko.DO_INTERSECT.get=function(){return 1},Ko.COLLINEAR.get=function(){return 2},Ko.NO_INTERSECTION.get=function(){return 0},Ko.POINT_INTERSECTION.get=function(){return 1},Ko.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ge,Ko);var lo=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(i){var r=new ct(this._inputLines[0][0],this._inputLines[0][1]),s=new ct(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(i)&&s.contains(i)},t.prototype.computeIntersection=function(){if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];if(this._isProper=!1,ct.intersects(r,s,i)&&et.orientationIndex(r,s,i)===0&&et.orientationIndex(s,r,i)===0)return this._isProper=!0,(i.equals(r)||i.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(i,r,s,o,a){a.x=this.smallestInAbsValue(i.x,r.x,s.x,o.x),a.y=this.smallestInAbsValue(i.y,r.y,s.y,o.y),i.x-=a.x,i.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.safeHCoordinateIntersection=function(i,r,s,o){var a=null;try{a=Cn.intersection(i,r,s,o)}catch(h){if(h instanceof lh)a=t.nearestEndpoint(i,r,s,o);else throw h}finally{}return a},t.prototype.intersection=function(i,r,s,o){var a=this.intersectionWithNormalization(i,r,s,o);return this.isInSegmentEnvelopes(a)||(a=new L(t.nearestEndpoint(i,r,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(i,r,s,o){var a=i,h=Math.abs(a);return Math.abs(r)<h&&(a=r,h=Math.abs(r)),Math.abs(s)<h&&(a=s,h=Math.abs(s)),Math.abs(o)<h&&(a=o),a},t.prototype.checkDD=function(i,r,s,o,a){var h=wi.intersection(i,r,s,o),u=this.isInSegmentEnvelopes(h);We.out.println("DD in env = "+u+" --------------------- "+h),a.distance(h)>1e-4&&We.out.println("Distance = "+a.distance(h))},t.prototype.intersectionWithNormalization=function(i,r,s,o){var a=new L(i),h=new L(r),u=new L(s),c=new L(o),l=new L;this.normalizeToEnvCentre(a,h,u,c,l);var d=this.safeHCoordinateIntersection(a,h,u,c);return d.x+=l.x,d.y+=l.y,d},t.prototype.computeCollinearIntersection=function(i,r,s,o){var a=ct.intersects(i,r,s),h=ct.intersects(i,r,o),u=ct.intersects(s,o,i),c=ct.intersects(s,o,r);return a&&h?(this._intPt[0]=s,this._intPt[1]=o,n.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=i,this._intPt[1]=r,n.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!h&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!h&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):h&&u?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!c?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):h&&c?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!a&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(i,r,s,o,a){var h=i.x<r.x?i.x:r.x,u=i.y<r.y?i.y:r.y,c=i.x>r.x?i.x:r.x,l=i.y>r.y?i.y:r.y,d=s.x<o.x?s.x:o.x,g=s.y<o.y?s.y:o.y,p=s.x>o.x?s.x:o.x,_=s.y>o.y?s.y:o.y,w=h>d?h:d,P=c<p?c:p,v=u>g?u:g,E=l<_?l:_,m=(w+P)/2,S=(v+E)/2;a.x=m,a.y=S,i.x-=a.x,i.y-=a.y,r.x-=a.x,r.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},t.prototype.computeIntersect=function(i,r,s,o){if(this._isProper=!1,!ct.intersects(i,r,s,o))return n.NO_INTERSECTION;var a=et.orientationIndex(i,r,s),h=et.orientationIndex(i,r,o);if(a>0&&h>0||a<0&&h<0)return n.NO_INTERSECTION;var u=et.orientationIndex(s,o,i),c=et.orientationIndex(s,o,r);if(u>0&&c>0||u<0&&c<0)return n.NO_INTERSECTION;var l=a===0&&h===0&&u===0&&c===0;return l?this.computeCollinearIntersection(i,r,s,o):(a===0||h===0||u===0||c===0?(this._isProper=!1,i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:r.equals2D(s)||r.equals2D(o)?this._intPt[0]=r:a===0?this._intPt[0]=new L(s):h===0?this._intPt[0]=new L(o):u===0?this._intPt[0]=new L(i):c===0&&(this._intPt[0]=new L(r))):(this._isProper=!0,this._intPt[0]=this.intersection(i,r,s,o)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(i,r,s,o){var a=i,h=et.distancePointLine(i,s,o),u=et.distancePointLine(r,s,o);return u<h&&(h=u,a=r),u=et.distancePointLine(s,i,r),u<h&&(h=u,a=s),u=et.distancePointLine(o,i,r),u<h&&(h=u,a=o),a},t}(ge),Qo=function(){};Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo},Qo.orientationIndex=function(t,e,i){var r=e.x-t.x,s=e.y-t.y,o=i.x-e.x,a=i.y-e.y;return Qo.signOfDet2x2(r,s,o,a)},Qo.signOfDet2x2=function(t,e,i,r){var s=null,o=null,a=null;if(s=1,t===0||r===0)return e===0||i===0?0:e>0?i>0?-s:s:i>0?s:-s;if(e===0||i===0)return r>0?t>0?s:-s:t>0?-s:s;if(e>0?r>0?e<=r||(s=-s,o=t,t=i,i=o,o=e,e=r,r=o):e<=-r?(s=-s,i=-i,r=-r):(o=t,t=-i,i=o,o=e,e=-r,r=o):r>0?-e<=r?(s=-s,t=-t,e=-e):(o=-t,t=i,i=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,i=-i,r=-r):(s=-s,o=-t,t=-i,i=o,o=-e,e=-r,r=o),t>0)if(i>0){if(!(t<=i))return s}else return s;else{if(i>0)return-s;if(t>=i)s=-s,t=-t,i=-i;else return-s}for(;;){if(a=Math.floor(i/t),i=i-a*t,r=r-a*e,r<0)return-s;if(r>e)return s;if(t>i+i){if(e<r+r)return s}else{if(e>r+r)return-s;i=t-i,r=e-r,s=-s}if(r===0)return i===0?0:-s;if(i===0||(a=Math.floor(t/i),t=t-a*i,e=e-a*r,e<0))return s;if(e>r)return-s;if(i>t+t){if(r<e+e)return-s}else{if(r>e+e)return s;t=i-t,e=r-e,s=-s}if(e===0)return t===0?0:s;if(t===0)return-s}};var jn=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};jn.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var i=t.x,r=e.x;return i>r&&(i=e.x,r=t.x),this._p.x>=i&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,h=e.y-this._p.y,u=Qo.signOfDet2x2(s,o,a,h);if(u===0)return this._isPointOnSegment=!0,null;h<o&&(u=-u),u>0&&this._crossingCount++}},jn.prototype.isPointInPolygon=function(){return this.getLocation()!==V.EXTERIOR},jn.prototype.getLocation=function(){return this._isPointOnSegment?V.BOUNDARY:this._crossingCount%2===1?V.INTERIOR:V.EXTERIOR},jn.prototype.isOnSegment=function(){return this._isPointOnSegment},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.locatePointInRing=function(){if(arguments[0]instanceof L&&wt(arguments[1],zt)){for(var t=arguments[0],e=arguments[1],i=new jn(t),r=new L,s=new L,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,s),i.countSegment(r,s),i.isOnSegment())return i.getLocation();return i.getLocation()}else if(arguments[0]instanceof L&&arguments[1]instanceof Array){for(var a=arguments[0],h=arguments[1],u=new jn(a),c=1;c<h.length;c++){var l=h[c],d=h[c-1];if(u.countSegment(l,d),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var et=function(){},Zo={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.orientationIndex=function(t,e,i){return wi.orientationIndex(t,e,i)},et.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,i=t[0].x,r=1;r<t.length-1;r++){var s=t[r].x-i,o=t[r+1].y,a=t[r-1].y;e+=s*(a-o)}return e/2}else if(wt(arguments[0],zt)){var h=arguments[0],u=h.size();if(u<3)return 0;var c=new L,l=new L,d=new L;h.getCoordinate(0,l),h.getCoordinate(1,d);var g=l.x;d.x-=g;for(var p=0,_=1;_<u-1;_++)c.y=l.y,l.x=d.x,l.y=d.y,h.getCoordinate(_+1,d),d.x-=g,p+=l.x*(c.y-d.y);return p/2}},et.distanceLineLine=function(t,e,i,r){if(t.equals(e))return et.distancePointLine(t,i,r);if(i.equals(r))return et.distancePointLine(r,t,e);var s=!1;if(!ct.intersects(t,e,i,r))s=!0;else{var o=(e.x-t.x)*(r.y-i.y)-(e.y-t.y)*(r.x-i.x);if(o===0)s=!0;else{var a=(t.y-i.y)*(r.x-i.x)-(t.x-i.x)*(r.y-i.y),h=(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y),u=h/o,c=a/o;(c<0||c>1||u<0||u>1)&&(s=!0)}}return s?Yi.min(et.distancePointLine(t,i,r),et.distancePointLine(e,i,r),et.distancePointLine(i,t,e),et.distancePointLine(r,t,e)):0},et.isPointInRing=function(t,e){return et.locatePointInRing(t,e)!==V.EXTERIOR},et.computeLength=function(t){var e=t.size();if(e<=1)return 0;var i=0,r=new L;t.getCoordinate(0,r);for(var s=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var h=r.x,u=r.y,c=h-s,l=u-o;i+=Math.sqrt(c*c+l*l),s=h,o=u}return i},et.isCCW=function(t){var e=t.length-1;if(e<3)throw new ce("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=t[0],r=0,s=1;s<=e;s++){var o=t[s];o.y>i.y&&(i=o,r=s)}var a=r;do a=a-1,a<0&&(a=e);while(t[a].equals2D(i)&&a!==r);var h=r;do h=(h+1)%e;while(t[h].equals2D(i)&&h!==r);var u=t[a],c=t[h];if(u.equals2D(i)||c.equals2D(i)||u.equals2D(c))return!1;var l=et.computeOrientation(u,i,c),d=!1;return l===0?d=u.x>c.x:d=l>0,d},et.locatePointInRing=function(t,e){return jn.locatePointInRing(t,e)},et.distancePointLinePerpendicular=function(t,e,i){var r=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),s=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/r;return Math.abs(s)*Math.sqrt(r)},et.computeOrientation=function(t,e,i){return et.orientationIndex(t,e,i)},et.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ce("Line array must contain at least one vertex");for(var i=t.distance(e[0]),r=0;r<e.length-1;r++){var s=et.distancePointLine(t,e[r],e[r+1]);s<i&&(i=s)}return i}else if(arguments.length===3){var o=arguments[0],a=arguments[1],h=arguments[2];if(a.x===h.x&&a.y===h.y)return o.distance(a);var u=(h.x-a.x)*(h.x-a.x)+(h.y-a.y)*(h.y-a.y),c=((o.x-a.x)*(h.x-a.x)+(o.y-a.y)*(h.y-a.y))/u;if(c<=0)return o.distance(a);if(c>=1)return o.distance(h);var l=((a.y-o.y)*(h.x-a.x)-(a.x-o.x)*(h.y-a.y))/u;return Math.abs(l)*Math.sqrt(u)}},et.isOnLine=function(t,e){for(var i=new lo,r=1;r<e.length;r++){var s=e[r-1],o=e[r];if(i.computeIntersection(t,s,o),i.hasIntersection())return!0}return!1},Zo.CLOCKWISE.get=function(){return-1},Zo.RIGHT.get=function(){return et.CLOCKWISE},Zo.COUNTERCLOCKWISE.get=function(){return 1},Zo.LEFT.get=function(){return et.COUNTERCLOCKWISE},Zo.COLLINEAR.get=function(){return 0},Zo.STRAIGHT.get=function(){return et.COLLINEAR},Object.defineProperties(et,Zo);var Kr=function(){};Kr.prototype.filter=function(t){},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr};var yt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},_r={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}};yt.prototype.isGeometryCollection=function(){return this.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION},yt.prototype.getFactory=function(){return this._factory},yt.prototype.getGeometryN=function(t){return this},yt.prototype.getArea=function(){return 0},yt.prototype.isRectangle=function(){return!1},yt.prototype.equals=function(){if(arguments[0]instanceof yt){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof yt))return!1;var i=e;return this.equalsExact(i)}},yt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},yt.prototype.geometryChanged=function(){this.apply(yt.geometryChangedFilter)},yt.prototype.geometryChangedAction=function(){this._envelope=null},yt.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},yt.prototype.getLength=function(){return 0},yt.prototype.getNumGeometries=function(){return 1},yt.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 i=arguments[0],r=arguments[1];return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(i,r)}},yt.prototype.getUserData=function(){return this._userData},yt.prototype.getSRID=function(){return this._SRID},yt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},yt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION)throw new ce("This method does not support GeometryCollection arguments")},yt.prototype.equal=function(t,e,i){return i===0?t.equals(e):t.distance(e)<=i},yt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},yt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},yt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ct(this._envelope)},yt.prototype.setSRID=function(t){this._SRID=t},yt.prototype.setUserData=function(t){this._userData=t},yt.prototype.compare=function(t,e){for(var i=t.iterator(),r=e.iterator();i.hasNext()&&r.hasNext();){var s=i.next(),o=r.next(),a=s.compareTo(o);if(a!==0)return a}return i.hasNext()?1:r.hasNext()?-1:0},yt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},yt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===yt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===yt.SORTINDEX_MULTIPOINT||this.getSortIndex()===yt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===yt.SORTINDEX_MULTIPOLYGON},yt.prototype.interfaces_=function(){return[zc,hn,un]},yt.prototype.getClass=function(){return yt},yt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},yt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},_r.serialVersionUID.get=function(){return 8763622679187377e3},_r.SORTINDEX_POINT.get=function(){return 0},_r.SORTINDEX_MULTIPOINT.get=function(){return 1},_r.SORTINDEX_LINESTRING.get=function(){return 2},_r.SORTINDEX_LINEARRING.get=function(){return 3},_r.SORTINDEX_MULTILINESTRING.get=function(){return 4},_r.SORTINDEX_POLYGON.get=function(){return 5},_r.SORTINDEX_MULTIPOLYGON.get=function(){return 6},_r.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},_r.geometryChangedFilter.get=function(){return Tg},Object.defineProperties(yt,_r);var Tg=function(){};Tg.interfaces_=function(){return[Kr]},Tg.filter=function(t){t.geometryChangedAction()};var yr=function(){};yr.prototype.filter=function(t){},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var ln=function(){},Qr={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}};ln.prototype.isInBoundary=function(t){},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},Qr.Mod2BoundaryNodeRule.get=function(){return dh},Qr.EndPointBoundaryNodeRule.get=function(){return fh},Qr.MultiValentEndPointBoundaryNodeRule.get=function(){return gh},Qr.MonoValentEndPointBoundaryNodeRule.get=function(){return ph},Qr.MOD2_BOUNDARY_RULE.get=function(){return new dh},Qr.ENDPOINT_BOUNDARY_RULE.get=function(){return new fh},Qr.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new gh},Qr.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ph},Qr.OGC_SFS_BOUNDARY_RULE.get=function(){return ln.MOD2_BOUNDARY_RULE},Object.defineProperties(ln,Qr);var dh=function(){};dh.prototype.isInBoundary=function(t){return t%2===1},dh.prototype.interfaces_=function(){return[ln]},dh.prototype.getClass=function(){return dh};var fh=function(){};fh.prototype.isInBoundary=function(t){return t>0},fh.prototype.interfaces_=function(){return[ln]},fh.prototype.getClass=function(){return fh};var gh=function(){};gh.prototype.isInBoundary=function(t){return t>1},gh.prototype.interfaces_=function(){return[ln]},gh.prototype.getClass=function(){return gh};var ph=function(){};ph.prototype.isInBoundary=function(t){return t===1},ph.prototype.interfaces_=function(){return[ln]},ph.prototype.getClass=function(){return ph};var Oe=function(){};Oe.prototype.add=function(){},Oe.prototype.addAll=function(){},Oe.prototype.isEmpty=function(){},Oe.prototype.iterator=function(){},Oe.prototype.size=function(){},Oe.prototype.toArray=function(){},Oe.prototype.remove=function(){};function Ng(n){this.message=n||""}Ng.prototype=new Error,Ng.prototype.name="IndexOutOfBoundsException";var vh=function(){};vh.prototype.hasNext=function(){},vh.prototype.next=function(){},vh.prototype.remove=function(){};var bn=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}(Oe);function mh(n){this.message=n||""}mh.prototype=new Error,mh.prototype.name="NoSuchElementException";var Z=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Oe&&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,Oe]},t.prototype.add=function(i){return arguments.length===1?this.array_.push(i):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(i){for(var r=this,s=i.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.set=function(i,r){var s=this.array_[i];return this.array_[i]=r,s},t.prototype.iterator=function(){return new MM(this)},t.prototype.get=function(i){if(i<0||i>=this.size())throw new Ng;return this.array_[i]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var i=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(i.array_[s]);return r},t.prototype.remove=function(i){for(var r=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(r.array_[o]===i){r.array_.splice(o,1),s=!0;break}return s},t}(bn),MM=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 mh;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(i){return this.arrayList_.set(this.position_-1,i)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(vh),cl=function(n){function t(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.ensureCapacity(i.length),this.add(i,!0)}else if(arguments.length===2){var r=arguments[0],s=arguments[1];this.ensureCapacity(r.length),this.add(r,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(r){return this.get(r)},t.prototype.addAll=function(){var r=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,h=s.iterator();h.hasNext();)r.add(h.next(),o),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var r=this,s=n.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,r.get(o).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var r=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 L&&typeof arguments[1]=="boolean"){var h=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(h))return null}n.prototype.add.call(this,h)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var l=arguments[0],d=arguments[1];return this.add(l,d),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],_=arguments[2];if(_)for(var w=0;w<g.length;w++)r.add(g[w],p);else for(var P=g.length-1;P>=0;P--)r.add(g[P],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof L){var v=arguments[0],E=arguments[1],m=arguments[2];if(!m){var S=this.size();if(S>0){if(v>0){var C=this.get(v-1);if(C.equals2D(E))return null}if(v<S){var b=this.get(v);if(b.equals2D(E))return null}}}n.prototype.add.call(this,v,E)}}else if(arguments.length===4){var I=arguments[0],M=arguments[1],O=arguments[2],x=arguments[3],T=1;O>x&&(T=-1);for(var A=O;A!==x;A+=T)r.add(I[A],M);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new L(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(Z),Lt=function(){},qc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};qc.ForwardComparator.get=function(){return dl},qc.BidirectionalComparator.get=function(){return _h},qc.coordArrayType.get=function(){return new Array(0).fill(null)},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Lt.ptNotInList=function(t,e){for(var i=0;i<t.length;i++){var r=t[i];if(Lt.indexOf(r,e)<0)return r}return null},Lt.scroll=function(t,e){var i=Lt.indexOf(e,t);if(i<0)return null;var r=new Array(t.length).fill(null);We.arraycopy(t,i,r,0,t.length-i),We.arraycopy(t,0,r,t.length-i,i),We.arraycopy(r,0,t,0,t.length)},Lt.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 i=0;i<t.length;i++)if(!t[i].equals(e[i]))return!1;return!0}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(r===s)return!0;if(r===null||s===null||r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(o.compare(r[a],s[a])!==0)return!1;return!0}},Lt.intersection=function(t,e){for(var i=new cl,r=0;r<t.length;r++)e.intersects(t[r])&&i.add(t[r],!0);return i.toCoordinateArray()},Lt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Lt.removeRepeatedPoints=function(t){if(!Lt.hasRepeatedPoints(t))return t;var e=new cl(t,!1);return e.toCoordinateArray()},Lt.reverse=function(t){for(var e=t.length-1,i=Math.trunc(e/2),r=0;r<=i;r++){var s=t[r];t[r]=t[e-r],t[e-r]=s}},Lt.removeNull=function(t){for(var e=0,i=0;i<t.length;i++)t[i]!==null&&e++;var r=new Array(e).fill(null);if(e===0)return r;for(var s=0,o=0;o<t.length;o++)t[o]!==null&&(r[s++]=t[o]);return r},Lt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),i=0;i<t.length;i++)e[i]=new L(t[i]);return e}else if(arguments.length===5)for(var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],h=arguments[4],u=0;u<h;u++)o[a+u]=new L(r[s+u])},Lt.isEqualReversed=function(t,e){for(var i=0;i<t.length;i++){var r=t[i],s=e[t.length-i-1];if(r.compareTo(s)!==0)return!1}return!0},Lt.envelope=function(t){for(var e=new ct,i=0;i<t.length;i++)e.expandToInclude(t[i]);return e},Lt.toCoordinateArray=function(t){return t.toArray(Lt.coordArrayType)},Lt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Lt.indexOf=function(t,e){for(var i=0;i<e.length;i++)if(t.equals(e[i]))return i;return-1},Lt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var i=t.length-1-e,r=t[e].compareTo(t[i]);if(r!==0)return r}return 1},Lt.compare=function(t,e){for(var i=0;i<t.length&&i<e.length;){var r=t[i].compareTo(e[i]);if(r!==0)return r;i++}return i<e.length?-1:i<t.length?1:0},Lt.minCoordinate=function(t){for(var e=null,i=0;i<t.length;i++)(e===null||e.compareTo(t[i])>0)&&(e=t[i]);return e},Lt.extract=function(t,e,i){e=Yi.clamp(e,0,t.length),i=Yi.clamp(i,-1,t.length);var r=i-e+1;i<0&&(r=0),e>=t.length&&(r=0),i<e&&(r=0);var s=new Array(r).fill(null);if(r===0)return s;for(var o=0,a=e;a<=i;a++)s[o++]=t[a];return s},Object.defineProperties(Lt,qc);var dl=function(){};dl.prototype.compare=function(t,e){var i=t,r=e;return Lt.compare(i,r)},dl.prototype.interfaces_=function(){return[hh]},dl.prototype.getClass=function(){return dl};var _h=function(){};_h.prototype.compare=function(t,e){var i=t,r=e;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(i.length===0)return 0;var s=Lt.compare(i,r),o=Lt.isEqualReversed(i,r);return o?0:s},_h.prototype.OLDcompare=function(t,e){var i=t,r=e;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(i.length===0)return 0;for(var s=Lt.increasingDirection(i),o=Lt.increasingDirection(r),a=s>0?0:i.length-1,h=o>0?0:i.length-1,u=0;u<i.length;u++){var c=i[a].compareTo(r[h]);if(c!==0)return c;a+=s,h+=o}return 0},_h.prototype.interfaces_=function(){return[hh]},_h.prototype.getClass=function(){return _h};var ta=function(){};ta.prototype.get=function(){},ta.prototype.put=function(){},ta.prototype.size=function(){},ta.prototype.values=function(){},ta.prototype.entrySet=function(){};var TM=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}(ta);function fl(n){this.message=n||""}fl.prototype=new Error,fl.prototype.name="OperationNotSupported";function Wc(){}Wc.prototype=new Oe,Wc.prototype.contains=function(){};var Og=function(n){function t(){n.call(this),this.array_=[],arguments[0]instanceof Oe&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(i){for(var r=this,s=0,o=this.array_.length;s<o;s++){var a=r.array_[s];if(a===i)return!0}return!1},t.prototype.add=function(i){return this.contains(i)?!1:(this.array_.push(i),!0)},t.prototype.addAll=function(i){for(var r=this,s=i.iterator();s.hasNext();)r.add(s.next());return!0},t.prototype.remove=function(i){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 i=this,r=[],s=0,o=this.array_.length;s<o;s++)r.push(i.array_[s]);return r},t.prototype.iterator=function(){return new NM(this)},t}(Wc),NM=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 mh;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new fl},t}(vh),Zr=0,co=1;function ly(n){return n===null?Zr:n.color}function ne(n){return n===null?null:n.parent}function ts(n,t){n!==null&&(n.color=t)}function Dg(n){return n===null?null:n.left}function cy(n){return n===null?null:n.right}function ii(){this.root_=null,this.size_=0}ii.prototype=new TM,ii.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},ii.prototype.put=function(n,t){if(this.root_===null)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:Zr,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,i,r;do if(i=e,r=n.compareTo(e.key),r<0)e=e.left;else if(r>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:i,color:Zr,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?i.left=o:i.right=o,this.fixAfterInsertion(o),this.size_++,null},ii.prototype.fixAfterInsertion=function(n){var t=this;for(n.color=co;n!=null&&n!==this.root_&&n.parent.color===co;)if(ne(n)===Dg(ne(ne(n)))){var e=cy(ne(ne(n)));ly(e)===co?(ts(ne(n),Zr),ts(e,Zr),ts(ne(ne(n)),co),n=ne(ne(n))):(n===cy(ne(n))&&(n=ne(n),t.rotateLeft(n)),ts(ne(n),Zr),ts(ne(ne(n)),co),t.rotateRight(ne(ne(n))))}else{var i=Dg(ne(ne(n)));ly(i)===co?(ts(ne(n),Zr),ts(i,Zr),ts(ne(ne(n)),co),n=ne(ne(n))):(n===Dg(ne(n))&&(n=ne(n),t.rotateRight(n)),ts(ne(n),Zr),ts(ne(ne(n)),co),t.rotateLeft(ne(ne(n))))}this.root_.color=Zr},ii.prototype.values=function(){var n=new Z,t=this.getFirstEntry();if(t!==null)for(n.add(t.value);(t=ii.successor(t))!==null;)n.add(t.value);return n},ii.prototype.entrySet=function(){var n=new Og,t=this.getFirstEntry();if(t!==null)for(n.add(t);(t=ii.successor(t))!==null;)n.add(t);return n},ii.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}},ii.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}},ii.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},ii.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,i=n;e!==null&&i===e.right;)i=e,e=e.parent;return e}},ii.prototype.size=function(){return this.size_};var gl=function(){};gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl};function dy(){}dy.prototype=new Wc;function qn(){this.array_=[],arguments[0]instanceof Oe&&this.addAll(arguments[0])}qn.prototype=new dy,qn.prototype.contains=function(n){for(var t=this,e=0,i=this.array_.length;e<i;e++){var r=t.array_[e];if(r.compareTo(n)===0)return!0}return!1},qn.prototype.add=function(n){var t=this;if(this.contains(n))return!1;for(var e=0,i=this.array_.length;e<i;e++){var r=t.array_[e];if(r.compareTo(n)===1)return t.array_.splice(e,0,n),!0}return this.array_.push(n),!0},qn.prototype.addAll=function(n){for(var t=this,e=n.iterator();e.hasNext();)t.add(e.next());return!0},qn.prototype.remove=function(n){throw new fl},qn.prototype.size=function(){return this.array_.length},qn.prototype.isEmpty=function(){return this.array_.length===0},qn.prototype.toArray=function(){for(var n=this,t=[],e=0,i=this.array_.length;e<i;e++)t.push(n.array_[e]);return t},qn.prototype.iterator=function(){return new Hc(this)};var Hc=function(n){this.treeSet_=n,this.position_=0};Hc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new mh;return this.treeSet_.array_[this.position_++]},Hc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Hc.prototype.remove=function(){throw new fl};var fo=function(){};fo.sort=function(){var t=arguments[0],e,i,r,s;if(arguments.length===1)s=function(a,h){return a.compareTo(h)},t.sort(s);else if(arguments.length===2)r=arguments[1],s=function(a,h){return r.compare(a,h)},t.sort(s);else if(arguments.length===3){i=t.slice(arguments[1],arguments[2]),i.sort();var o=t.slice(0,arguments[1]).concat(i,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(i=t.slice(arguments[1],arguments[2]),r=arguments[3],s=function(a,h){return r.compare(a,h)},i.sort(s),o=t.slice(0,arguments[1]).concat(i,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])},fo.asList=function(t){for(var e=new Z,i=0,r=t.length;i<r;i++)e.add(t[i]);return e};var Ht=function(){},In={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}};In.P.get=function(){return 0},In.L.get=function(){return 1},In.A.get=function(){return 2},In.FALSE.get=function(){return-1},In.TRUE.get=function(){return-2},In.DONTCARE.get=function(){return-3},In.SYM_FALSE.get=function(){return"F"},In.SYM_TRUE.get=function(){return"T"},In.SYM_DONTCARE.get=function(){return"*"},In.SYM_P.get=function(){return"0"},In.SYM_L.get=function(){return"1"},In.SYM_A.get=function(){return"2"},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.toDimensionSymbol=function(t){switch(t){case Ht.FALSE:return Ht.SYM_FALSE;case Ht.TRUE:return Ht.SYM_TRUE;case Ht.DONTCARE:return Ht.SYM_DONTCARE;case Ht.P:return Ht.SYM_P;case Ht.L:return Ht.SYM_L;case Ht.A:return Ht.SYM_A}throw new ce("Unknown dimension value: "+t)},Ht.toDimensionValue=function(t){switch(ul.toUpperCase(t)){case Ht.SYM_FALSE:return Ht.FALSE;case Ht.SYM_TRUE:return Ht.TRUE;case Ht.SYM_DONTCARE:return Ht.DONTCARE;case Ht.SYM_P:return Ht.P;case Ht.SYM_L:return Ht.L;case Ht.SYM_A:return Ht.A}throw new ce("Unknown dimension symbol: "+t)},Object.defineProperties(Ht,In);var Wn=function(){};Wn.prototype.filter=function(t){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var xn=function(){};xn.prototype.filter=function(t,e){},xn.prototype.isDone=function(){},xn.prototype.isGeometryChanged=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var ui=function(n){function t(i,r){if(n.call(this,r),this._geometries=i||[],n.hasNullElements(this._geometries))throw new ce("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 r=this,s=new ct,o=0;o<this._geometries.length;o++)s.expandToInclude(r._geometries[o].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(r){return this._geometries[r]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var r=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var h=r._geometries[a].getCoordinates(),u=0;u<h.length;u++)o++,s[o]=h[u];return s},t.prototype.getArea=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getArea();return s},t.prototype.equalsExact=function(){var r=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 h=0;h<this._geometries.length;h++)if(!r._geometries[h].equalsExact(a._geometries[h],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<this._geometries.length;s++)r._geometries[s].normalize();fo.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var r=this,s=Ht.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var r=this,s=Ht.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,r._geometries[o].getDimension());return s},t.prototype.getLength=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=0,o=0;o<this._geometries.length;o++)s+=r._geometries[o].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var s=arguments[0],o=new qn(fo.asList(this._geometries)),a=new qn(fo.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var h=arguments[0],u=arguments[1],c=h,l=this.getNumGeometries(),d=c.getNumGeometries(),g=0;g<l&&g<d;){var p=r.getGeometryN(g),_=c.getGeometryN(g),w=p.compareToSameClass(_,u);if(w!==0)return w;g++}return g<l?1:g<d?-1:0}},t.prototype.apply=function(){var r=this;if(wt(arguments[0],yr))for(var s=arguments[0],o=0;o<this._geometries.length;o++)r._geometries[o].apply(s);else if(wt(arguments[0],xn)){var a=arguments[0];if(this._geometries.length===0)return null;for(var h=0;h<this._geometries.length&&(r._geometries[h].apply(a),!a.isDone());h++);a.isGeometryChanged()&&this.geometryChanged()}else if(wt(arguments[0],Wn)){var u=arguments[0];u.filter(this);for(var c=0;c<this._geometries.length;c++)r._geometries[c].apply(u)}else if(wt(arguments[0],Kr)){var l=arguments[0];l.filter(this);for(var d=0;d<this._geometries.length;d++)r._geometries[d].apply(l)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Nt.shouldNeverReachHere(),null},t.prototype.clone=function(){var r=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]=r._geometries[o].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var r=this,s=0;s<this._geometries.length;s++)if(!r._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}(yt),go=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 yt.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?n.prototype.equalsExact.call(this,r,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Ht.FALSE:0},t.prototype.isClosed=function(){var r=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!r._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=r._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},t.prototype.getBoundary=function(){return new cn(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[gl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(ui),cn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=ln.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=r}};cn.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)},cn.prototype.getBoundary=function(){return this._geom instanceof ve?this.boundaryLineString(this._geom):this._geom instanceof go?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},cn.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()])},cn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},cn.prototype.computeBoundaryCoordinates=function(t){var e=this,i=new Z;this._endpointMap=new ii;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);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(),h=a.getValue(),u=h.count;e._bnRule.isInBoundary(u)&&i.add(a.getKey())}return Lt.toCoordinateArray(i)},cn.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Xc,this._endpointMap.put(t,e)),e.count++},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},cn.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new cn(t);return e.getBoundary()}else if(arguments.length===2){var i=arguments[0],r=arguments[1],s=new cn(i,r);return s.getBoundary()}};var Xc=function(){this.count=null};Xc.prototype.interfaces_=function(){return[]},Xc.prototype.getClass=function(){return Xc};function OM(){}function DM(){}var AM=function(){};function RM(){}function LM(){}function FM(){}var dn=function(){},Ag={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn},dn.chars=function(t,e){for(var i=new Array(e).fill(null),r=0;r<e;r++)i[r]=t;return String(i)},dn.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new RM,i=new OM;return t.printStackTrace(i),e.toString()}else if(arguments.length===2){var r=arguments[0],s=arguments[1],o="";new DM(dn.getStackTrace(r));for(var a=new FM,h=0;h<s;h++)try{o+=a.readLine()+dn.NEWLINE}catch(u){if(u instanceof LM)Nt.shouldNeverReachHere();else throw u}finally{}return o}},dn.split=function(t,e){for(var i=e.length,r=new Z,s=""+t,o=s.indexOf(e);o>=0;){var a=s.substring(0,o);r.add(a),s=s.substring(o+i),o=s.indexOf(e)}s.length>0&&r.add(s);for(var h=new Array(r.size()).fill(null),u=0;u<h.length;u++)h[u]=r.get(u);return h},dn.toString=function(){if(arguments.length===1){var t=arguments[0];return dn.SIMPLE_ORDINATE_FORMAT.format(t)}},dn.spaces=function(t){return dn.chars(" ",t)},Ag.NEWLINE.get=function(){return We.getProperty("line.separator")},Ag.SIMPLE_ORDINATE_FORMAT.get=function(){return new AM},Object.defineProperties(dn,Ag);var we=function(){};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.copyCoord=function(t,e,i,r){for(var s=Math.min(t.getDimension(),i.getDimension()),o=0;o<s;o++)i.setOrdinate(r,o,t.getOrdinate(e,o))},we.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,zt.X)===t.getOrdinate(e-1,zt.X)&&t.getOrdinate(0,zt.Y)===t.getOrdinate(e-1,zt.Y)},we.isEqual=function(t,e){var i=t.size(),r=e.size();if(i!==r)return!1;for(var s=Math.min(t.getDimension(),e.getDimension()),o=0;o<i;o++)for(var a=0;a<s;a++){var h=t.getOrdinate(o,a),u=e.getOrdinate(o,a);if(t.getOrdinate(o,a)!==e.getOrdinate(o,a)&&!(Pt.isNaN(h)&&Pt.isNaN(u)))return!1}return!0},we.extend=function(t,e,i){var r=t.create(i,e.getDimension()),s=e.size();if(we.copy(e,0,r,0,s),s>0)for(var o=s;o<i;o++)we.copy(e,s-1,r,o,1);return r},we.reverse=function(t){for(var e=t.size()-1,i=Math.trunc(e/2),r=0;r<=i;r++)we.swap(t,r,e-r)},we.swap=function(t,e,i){if(e===i)return null;for(var r=0;r<t.getDimension();r++){var s=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(i,r)),t.setOrdinate(i,r,s)}},we.copy=function(t,e,i,r,s){for(var o=0;o<s;o++)we.copyCoord(t,e+o,i,r+o)},we.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var i=t.getDimension(),r=new Vn;r.append("(");for(var s=0;s<e;s++){s>0&&r.append(" ");for(var o=0;o<i;o++)o>0&&r.append(","),r.append(dn.toString(t.getOrdinate(s,o)))}return r.append(")"),r.toString()}},we.ensureValidRing=function(t,e){var i=e.size();if(i===0)return e;if(i<=3)return we.createClosedRing(t,e,4);var r=e.getOrdinate(0,zt.X)===e.getOrdinate(i-1,zt.X)&&e.getOrdinate(0,zt.Y)===e.getOrdinate(i-1,zt.Y);return r?e:we.createClosedRing(t,e,i+1)},we.createClosedRing=function(t,e,i){var r=t.create(i,e.getDimension()),s=e.size();we.copy(e,0,r,0,s);for(var o=s;o<i;o++)we.copy(e,0,r,o,1);return r};var ve=function(n){function t(i,r){n.call(this,r),this._points=null,this.init(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.isEmpty()?new ct:this._points.expandEnvelope(new ct)},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 r=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 h=0;h<this._points.size();h++)if(!r.equal(r._points.getCoordinate(h),a._points.getCoordinate(h),o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var r=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=r._points.size()-1-s;if(!r._points.getCoordinate(s).equals(r._points.getCoordinate(o)))return r._points.getCoordinate(s).compareTo(r._points.getCoordinate(o))>0&&we.reverse(r._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Ht.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 et.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var r=this._points.copy();we.reverse(r);var s=this.getFactory().createLineString(r);return s},t.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,h=0;a<this._points.size()&&h<o._points.size();){var u=r._points.getCoordinate(a).compareTo(o._points.getCoordinate(h));if(u!==0)return u;a++,h++}return a<this._points.size()?1:h<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],l=arguments[1],d=c;return l.compare(this._points,d._points)}},t.prototype.apply=function(){var r=this;if(wt(arguments[0],yr))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(r._points.getCoordinate(o));else if(wt(arguments[0],xn)){var a=arguments[0];if(this._points.size()===0)return null;for(var h=0;h<this._points.size()&&(a.filter(r._points,h),!a.isDone());h++);a.isGeometryChanged()&&this.geometryChanged()}else if(wt(arguments[0],Wn)){var u=arguments[0];u.filter(this)}else if(wt(arguments[0],Kr)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new cn(this).getBoundary()},t.prototype.isEquivalentClass=function(r){return r instanceof t},t.prototype.clone=function(){var r=n.prototype.clone.call(this);return r._points=this._points.clone(),r},t.prototype.getCoordinateN=function(r){return this._points.getCoordinate(r)},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(r){if(r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),r.size()===1)throw new ce("Invalid number of points in LineString (found "+r.size()+" - must be 0 or >= 2)");this._points=r},t.prototype.isCoordinate=function(r){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(r))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(r){return this.getFactory().createPoint(this._points.getCoordinate(r))},t.prototype.interfaces_=function(){return[gl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(yt),pl=function(){};pl.prototype.interfaces_=function(){return[]},pl.prototype.getClass=function(){return pl};var Ai=function(n){function t(i,r){n.call(this,r),this._coordinates=i||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 ct;var r=new ct;return r.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),r},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 r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?this.isEmpty()&&r.isEmpty()?!0:this.isEmpty()!==r.isEmpty()?!1:this.equal(r.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 Ht.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 r=arguments[0],s=r;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],h=o;return a.compare(this._coordinates,h._coordinates)}},t.prototype.apply=function(){if(wt(arguments[0],yr)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this.getCoordinate())}else if(wt(arguments[0],xn)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(wt(arguments[0],Wn)){var o=arguments[0];o.filter(this)}else if(wt(arguments[0],Kr)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var r=n.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},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(r){r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),Nt.isTrue(r.size()<=1),this._coordinates=r},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[pl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(yt),Ts=function(){};Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var De=function(n){function t(i,r,s){if(n.call(this,s),this._shell=null,this._holes=null,i===null&&(i=this.getFactory().createLinearRing()),r===null&&(r=[]),n.hasNullElements(r))throw new ce("holes must not contain null elements");if(i.isEmpty()&&n.hasNonEmptyElements(r))throw new ce("shell is empty but holes are not");this._shell=i,this._holes=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._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var r=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),h=0;h<a.length;h++)o++,s[o]=a[h];for(var u=0;u<this._holes.length;u++)for(var c=r._holes[u].getCoordinates(),l=0;l<c.length;l++)o++,s[o]=c[l];return s},t.prototype.getArea=function(){var r=this,s=0;s+=Math.abs(et.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(et.signedArea(r._holes[o].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var r=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=r.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var h=r.getY(o);if(!(h===s.getMinY()||h===s.getMaxY()))return!1}for(var u=r.getX(0),c=r.getY(0),l=1;l<=4;l++){var d=r.getX(l),g=r.getY(l),p=d!==u,_=g!==c;if(p===_)return!1;u=d,c=g}return!0},t.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,h=this._shell,u=a._shell;if(!h.equalsExact(u,o)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!r._holes[c].equalsExact(a._holes[c],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var r=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)r.normalize(r._holes[s],!1);fo.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var h=new Array(o.getCoordinates().length-1).fill(null);We.arraycopy(o.getCoordinates(),0,h,0,h.length);var u=Lt.minCoordinate(o.getCoordinates());Lt.scroll(h,u),We.arraycopy(h,0,o.getCoordinates(),0,h.length),o.getCoordinates()[h.length]=h[0],et.isCCW(o.getCoordinates())===a&&Lt.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 r=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=r._holes[o].getLength();return s},t.prototype.getNumPoints=function(){for(var r=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=r._holes[o].getNumPoints();return s},t.prototype.reverse=function(){var r=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]=r._holes[o].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var r=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 h=arguments[0],u=arguments[1],c=h,l=this._shell,d=c._shell,g=l.compareToSameClass(d,u);if(g!==0)return g;for(var p=this.getNumInteriorRing(),_=c.getNumInteriorRing(),w=0;w<p&&w<_;){var P=r.getInteriorRingN(w),v=c.getInteriorRingN(w),E=P.compareToSameClass(v,u);if(E!==0)return E;w++}return w<p?1:w<_?-1:0}},t.prototype.apply=function(r){var s=this;if(wt(r,yr)){this._shell.apply(r);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(r)}else if(wt(r,xn)){if(this._shell.apply(r),!r.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(r),!r.isDone());a++);r.isGeometryChanged()&&this.geometryChanged()}else if(wt(r,Wn))r.filter(this);else if(wt(r,Kr)){r.filter(this),this._shell.apply(r);for(var h=0;h<this._holes.length;h++)s._holes[h].apply(r)}},t.prototype.getBoundary=function(){var r=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]=r._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var r=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]=r._holes[o].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var r=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=r._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(r){return this._holes[r]},t.prototype.interfaces_=function(){return[Ts]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(yt),yh=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 yt.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?n.prototype.equalsExact.call(this,r,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._geometries[r].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Ht.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 r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[pl]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(ui),wr=function(n){function t(i,r){i instanceof L&&r instanceof Ft&&(i=r.getCoordinateSequenceFactory().create(i)),n.call(this,i,r),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 yt.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Ht.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var r=this._points.copy();we.reverse(r);var s=this.getFactory().createLinearRing(r);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new ce("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ce("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}(ve),Er=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 yt.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return this.isEquivalentClass(r)?n.prototype.equalsExact.call(this,r,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 r=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=r._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},t.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new Z,o=0;o<this._geometries.length;o++)for(var a=r._geometries[o],h=a.getBoundary(),u=0;u<h.getNumGeometries();u++)s.add(h.getGeometryN(u));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 r=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=r._geometries[o].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[Ts]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(ui),fn=function(t){this._factory=t||null,this._isUserDataCopied=!1},Yc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};fn.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},fn.prototype.edit=function(t,e){if(t===null)return null;var i=this.editInternal(t,e);return this._isUserDataCopied&&i.setUserData(t.getUserData()),i},fn.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof ui?this.editGeometryCollection(t,e):t instanceof De?this.editPolygon(t,e):t instanceof Ai?e.edit(t,this._factory):t instanceof ve?e.edit(t,this._factory):(Nt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},fn.prototype.editGeometryCollection=function(t,e){for(var i=this,r=e.edit(t,this._factory),s=new Z,o=0;o<r.getNumGeometries();o++){var a=i.edit(r.getGeometryN(o),e);a===null||a.isEmpty()||s.add(a)}return r.getClass()===yh?this._factory.createMultiPoint(s.toArray([])):r.getClass()===go?this._factory.createMultiLineString(s.toArray([])):r.getClass()===Er?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},fn.prototype.editPolygon=function(t,e){var i=this,r=e.edit(t,this._factory);if(r===null&&(r=this._factory.createPolygon(null)),r.isEmpty())return r;var s=this.edit(r.getExteriorRing(),e);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new Z,a=0;a<r.getNumInteriorRing();a++){var h=i.edit(r.getInteriorRingN(a),e);h===null||h.isEmpty()||o.add(h)}return this._factory.createPolygon(s,o.toArray([]))},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},fn.GeometryEditorOperation=function(){},Yc.NoOpGeometryOperation.get=function(){return vl},Yc.CoordinateOperation.get=function(){return ml},Yc.CoordinateSequenceOperation.get=function(){return _l},Object.defineProperties(fn,Yc);var vl=function(){};vl.prototype.edit=function(t,e){return t},vl.prototype.interfaces_=function(){return[fn.GeometryEditorOperation]},vl.prototype.getClass=function(){return vl};var ml=function(){};ml.prototype.edit=function(t,e){var i=this.editCoordinates(t.getCoordinates(),t);return i===null?t:t instanceof wr?e.createLinearRing(i):t instanceof ve?e.createLineString(i):t instanceof Ai?i.length>0?e.createPoint(i[0]):e.createPoint():t},ml.prototype.interfaces_=function(){return[fn.GeometryEditorOperation]},ml.prototype.getClass=function(){return ml};var _l=function(){};_l.prototype.edit=function(t,e){return t instanceof wr?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ai?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},_l.prototype.interfaces_=function(){return[fn.GeometryEditorOperation]},_l.prototype.getClass=function(){return _l};var Ee=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 i=0;i<e;i++)t._coordinates[i]=new L}else if(wt(arguments[0],zt)){var r=arguments[0];if(r===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=r.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 h=arguments[0],u=arguments[1];this._coordinates=new Array(h).fill(null),this._dimension=u;for(var c=0;c<h;c++)t._coordinates[c]=new L}}},fy={serialVersionUID:{configurable:!0}};Ee.prototype.setOrdinate=function(t,e,i){switch(e){case zt.X:this._coordinates[t].x=i;break;case zt.Y:this._coordinates[t].y=i;break;case zt.Z:this._coordinates[t].z=i;break;default:throw new ce("invalid ordinateIndex")}},Ee.prototype.size=function(){return this._coordinates.length},Ee.prototype.getOrdinate=function(t,e){switch(e){case zt.X:return this._coordinates[t].x;case zt.Y:return this._coordinates[t].y;case zt.Z:return this._coordinates[t].z}return Pt.NaN},Ee.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],i=arguments[1];i.x=this._coordinates[e].x,i.y=this._coordinates[e].y,i.z=this._coordinates[e].z}},Ee.prototype.getCoordinateCopy=function(t){return new L(this._coordinates[t])},Ee.prototype.getDimension=function(){return this._dimension},Ee.prototype.getX=function(t){return this._coordinates[t].x},Ee.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)e[i]=t._coordinates[i].clone();return new Ee(e,this._dimension)},Ee.prototype.expandEnvelope=function(t){for(var e=this,i=0;i<this._coordinates.length;i++)t.expandToInclude(e._coordinates[i]);return t},Ee.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)e[i]=t._coordinates[i].copy();return new Ee(e,this._dimension)},Ee.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new Vn(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)e.append(", "),e.append(t._coordinates[i]);return e.append(")"),e.toString()}else return"()"},Ee.prototype.getY=function(t){return this._coordinates[t].y},Ee.prototype.toCoordinateArray=function(){return this._coordinates},Ee.prototype.interfaces_=function(){return[zt,un]},Ee.prototype.getClass=function(){return Ee},fy.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Ee,fy);var Sr=function(){},Rg={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Sr.prototype.readResolve=function(){return Sr.instance()},Sr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Ee(t)}else if(wt(arguments[0],zt)){var e=arguments[0];return new Ee(e)}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new Ee(i):new Ee(i,r)}},Sr.prototype.interfaces_=function(){return[uh,un]},Sr.prototype.getClass=function(){return Sr},Sr.instance=function(){return Sr.instanceObject},Rg.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Rg.instanceObject.get=function(){return new Sr},Object.defineProperties(Sr,Rg);var gy=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(i){return this.map_.get(i)||null},t.prototype.put=function(i,r){return this.map_.set(i,r),r},t.prototype.values=function(){for(var i=new Z,r=this.map_.values(),s=r.next();!s.done;)i.add(s.value),s=r.next();return i},t.prototype.entrySet=function(){var i=new Og;return this.map_.entries().forEach(function(r){return i.add(r)}),i},t.prototype.size=function(){return this.map_.size()},t}(ta),Xt=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 Hn){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 i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}}},Lg={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Xt.prototype.equals=function(t){if(!(t instanceof Xt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Xt.prototype.compareTo=function(t){var e=t,i=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new zn(i).compareTo(new zn(r))},Xt.prototype.getScale=function(){return this._scale},Xt.prototype.isFloating=function(){return this._modelType===Xt.FLOATING||this._modelType===Xt.FLOATING_SINGLE},Xt.prototype.getType=function(){return this._modelType},Xt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Xt.FLOATING?t="Floating":this._modelType===Xt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Xt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Xt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Pt.isNaN(t))return t;if(this._modelType===Xt.FLOATING_SINGLE){var e=t;return e}return this._modelType===Xt.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof L){var i=arguments[0];if(this._modelType===Xt.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Xt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Xt.FLOATING?t=16:this._modelType===Xt.FLOATING_SINGLE?t=6:this._modelType===Xt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Xt.prototype.setScale=function(t){this._scale=Math.abs(t)},Xt.prototype.interfaces_=function(){return[un,hn]},Xt.prototype.getClass=function(){return Xt},Xt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Lg.serialVersionUID.get=function(){return 7777263578777804e3},Lg.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Xt,Lg);var Hn=function n(t){this._name=t||null,n.nameToTypeMap.put(t,this)},Fg={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Hn.prototype.readResolve=function(){return Hn.nameToTypeMap.get(this._name)},Hn.prototype.toString=function(){return this._name},Hn.prototype.interfaces_=function(){return[un]},Hn.prototype.getClass=function(){return Hn},Fg.serialVersionUID.get=function(){return-552860263173159e4},Fg.nameToTypeMap.get=function(){return new gy},Object.defineProperties(Hn,Fg),Xt.Type=Hn,Xt.FIXED=new Hn("FIXED"),Xt.FLOATING=new Hn("FLOATING"),Xt.FLOATING_SINGLE=new Hn("FLOATING SINGLE");var Ft=function n(){this._precisionModel=new Xt,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?wt(arguments[0],uh)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Xt&&(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]))},py={serialVersionUID:{configurable:!0}};Ft.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new L(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new L(t.getMinX(),t.getMinY()),new L(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new L(t.getMinX(),t.getMinY()),new L(t.getMinX(),t.getMaxY()),new L(t.getMaxX(),t.getMaxY()),new L(t.getMaxX(),t.getMinY()),new L(t.getMinX(),t.getMinY())]),null)},Ft.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new ve(this.getCoordinateSequenceFactory().create(t),this);if(wt(t,zt))return new ve(t,this)}else return new ve(this.getCoordinateSequenceFactory().create([]),this)},Ft.prototype.createMultiLineString=function(){if(arguments.length===0)return new go(null,this);if(arguments.length===1){var t=arguments[0];return new go(t,this)}},Ft.prototype.buildGeometry=function(t){for(var e=null,i=!1,r=!1,s=t.iterator();s.hasNext();){var o=s.next(),a=o.getClass();e===null&&(e=a),a!==e&&(i=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(i||r)return this.createGeometryCollection(Ft.toGeometryArray(t));var h=t.iterator().next(),u=t.size()>1;if(u){if(h instanceof De)return this.createMultiPolygon(Ft.toPolygonArray(t));if(h instanceof ve)return this.createMultiLineString(Ft.toLineStringArray(t));if(h instanceof Ai)return this.createMultiPoint(Ft.toPointArray(t));Nt.shouldNeverReachHere("Unhandled class: "+h.getClass().getName())}return h},Ft.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},Ft.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof L){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(wt(arguments[0],zt)){var e=arguments[0];return new Ai(e,this)}}},Ft.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ft.prototype.createPolygon=function(){if(arguments.length===0)return new De(null,null,this);if(arguments.length===1){if(wt(arguments[0],zt)){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 wr){var i=arguments[0];return this.createPolygon(i,null)}}else if(arguments.length===2){var r=arguments[0],s=arguments[1];return new De(r,s,this)}},Ft.prototype.getSRID=function(){return this._SRID},Ft.prototype.createGeometryCollection=function(){if(arguments.length===0)return new ui(null,this);if(arguments.length===1){var t=arguments[0];return new ui(t,this)}},Ft.prototype.createGeometry=function(t){var e=new fn(this);return e.edit(t,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Ft.prototype.getPrecisionModel=function(){return this._precisionModel},Ft.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(wt(arguments[0],zt)){var e=arguments[0];return new wr(e,this)}}},Ft.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Er(null,this);if(arguments.length===1){var t=arguments[0];return new Er(t,this)}},Ft.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new yh(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new yh(e,this)}else if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}else if(wt(arguments[0],zt)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(r.size()).fill(null),o=0;o<r.size();o++){var a=t.getCoordinateSequenceFactory().create(1,r.getDimension());we.copy(r,o,a,0,1),s[o]=t.createPoint(a)}return this.createMultiPoint(s)}}},Ft.prototype.interfaces_=function(){return[un]},Ft.prototype.getClass=function(){return Ft},Ft.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.getDefaultCoordinateSequenceFactory=function(){return Sr.instance()},Ft.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Ft.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},py.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ft,py);var kM=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Jc=function(t){this.geometryFactory=t||new Ft};Jc.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var i=e.type;if(!Xn[i])throw new Error("Unknown GeoJSON type: "+e.type);return kM.indexOf(i)!==-1?Xn[i].apply(this,[e.coordinates]):i==="GeometryCollection"?Xn[i].apply(this,[e.geometries]):Xn[i].apply(this,[e])},Jc.prototype.write=function(t){var e=t.getGeometryType();if(!es[e])throw new Error("Geometry is not supported");return es[e].apply(this,[t])};var Xn={Feature:function(n){var t={};for(var e in n)t[e]=n[e];if(n.geometry){var i=n.geometry.type;if(!Xn[i])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=Xn.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t=this,e={};if(n.features){e.features=[];for(var i=0;i<n.features.length;++i)e.features.push(t.read(n.features[i]))}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 i=n[e];t.push(new L(i[0],i[1]))}return t},bbox:function(n){return this.geometryFactory.createLinearRing([new L(n[0],n[1]),new L(n[2],n[1]),new L(n[2],n[3]),new L(n[0],n[3]),new L(n[0],n[1])])},Point:function(n){var t=new L(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var t=this,e=[],i=0;i<n.length;++i)e.push(Xn.Point.apply(t,[n[i]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(n){var t=Xn.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var t=this,e=[],i=0;i<n.length;++i)e.push(Xn.LineString.apply(t,[n[i]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(n){for(var t=this,e=Xn.coordinates.apply(this,[n[0]]),i=this.geometryFactory.createLinearRing(e),r=[],s=1;s<n.length;++s){var o=n[s],a=Xn.coordinates.apply(t,[o]),h=t.geometryFactory.createLinearRing(a);r.push(h)}return this.geometryFactory.createPolygon(i,r)},MultiPolygon:function(n){for(var t=this,e=[],i=0;i<n.length;++i){var r=n[i];e.push(Xn.Polygon.apply(t,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(n){for(var t=this,e=[],i=0;i<n.length;++i){var r=n[i];e.push(t.read(r))}return this.geometryFactory.createGeometryCollection(e)}},es={coordinate:function(n){return[n.x,n.y]},Point:function(n){var t=es.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=es.Point.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(n){for(var t=this,e=[],i=n.getCoordinates(),r=0;r<i.length;++r){var s=i[r];e.push(es.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:e}},MultiLineString:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=es.LineString.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(n){var t=this,e=[],i=es.LineString.apply(this,[n._shell]);e.push(i.coordinates);for(var r=0;r<n._holes.length;++r){var s=n._holes[r],o=es.LineString.apply(t,[s]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=es.Polygon.apply(t,[r]);e.push(s.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(n){for(var t=this,e=[],i=0;i<n._geometries.length;++i){var r=n._geometries[i],s=r.getGeometryType();e.push(es[s].apply(t,[r]))}return{type:"GeometryCollection",geometries:e}}},kg=function(t){this.geometryFactory=t||new Ft,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Jc(this.geometryFactory)};kg.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Xt.FIXED&&this.reducePrecision(e),e},kg.prototype.reducePrecision=function(t){var e=this,i,r;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(i=0,r=t.points.length;i<r;i++)e.precisionModel.makePrecise(t.points[i]);else if(t.geometries)for(i=0,r=t.geometries.length;i<r;i++)e.reducePrecision(t.geometries[i])};var vy=function(){this.parser=new Jc(this.geometryFactory)};vy.prototype.write=function(t){return this.parser.write(t)};var K=function(){},$c={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.opposite=function(t){return t===K.LEFT?K.RIGHT:t===K.RIGHT?K.LEFT:t},$c.ON.get=function(){return 0},$c.LEFT.get=function(){return 1},$c.RIGHT.get=function(){return 2},Object.defineProperties(K,$c);function Kc(n){this.message=n||""}Kc.prototype=new Error,Kc.prototype.name="EmptyStackException";function Yn(){this.array_=[]}Yn.prototype=new bn,Yn.prototype.add=function(n){return this.array_.push(n),!0},Yn.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},Yn.prototype.push=function(n){return this.array_.push(n),n},Yn.prototype.pop=function(n){if(this.array_.length===0)throw new Kc;return this.array_.pop()},Yn.prototype.peek=function(){if(this.array_.length===0)throw new Kc;return this.array_[this.array_.length-1]},Yn.prototype.empty=function(){return this.array_.length===0},Yn.prototype.isEmpty=function(){return this.empty()},Yn.prototype.search=function(n){return this.array_.indexOf(n)},Yn.prototype.size=function(){return this.array_.length},Yn.prototype.toArray=function(){for(var n=this,t=[],e=0,i=this.array_.length;e<i;e++)t.push(n.array_[e]);return t};var Jn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Jn.prototype.getCoordinate=function(){return this._minCoord},Jn.prototype.getRightmostSide=function(t,e){var i=this.getRightmostSideOfSegment(t,e);return i<0&&(i=this.getRightmostSideOfSegment(t,e-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),i},Jn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Nt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],i=t[this._minIndex+1],r=et.computeOrientation(this._minCoord,i,e),s=!1;(e.y<this._minCoord.y&&i.y<this._minCoord.y&&r===et.COUNTERCLOCKWISE||e.y>this._minCoord.y&&i.y>this._minCoord.y&&r===et.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},Jn.prototype.getRightmostSideOfSegment=function(t,e){var i=t.getEdge(),r=i.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var s=K.LEFT;return r[e].y<r[e+1].y&&(s=K.RIGHT),s},Jn.prototype.getEdge=function(){return this._orientedDe},Jn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,i=t.getEdge().getCoordinates(),r=0;r<i.length-1;r++)(e._minCoord===null||i[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=i[r])},Jn.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)},Jn.prototype.findEdge=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next();r.isForward()&&e.checkForRightmostCoordinate(r)}Nt.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===K.LEFT&&(this._orientedDe=this._minDe.getSym())},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var is=function(n){function t(e,i){n.call(this,t.msgWithCoord(e,i)),this.pt=i?new L(i):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(i,r){return r?i:i+" [ "+r+" ]"},t}($r),Qc=function(){this.array_=[]};Qc.prototype.addLast=function(t){this.array_.push(t)},Qc.prototype.removeFirst=function(){return this.array_.shift()},Qc.prototype.isEmpty=function(){return this.array_.length===0};var li=function(){this._finder=null,this._dirEdgeList=new Z,this._nodes=new Z,this._rightMostCoord=null,this._env=null,this._finder=new Jn};li.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},li.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},li.prototype.computeNodeDepth=function(t){for(var e=this,i=null,r=t.getEdges().iterator();r.hasNext();){var s=r.next();if(s.isVisited()||s.getSym().isVisited()){i=s;break}}if(i===null)throw new is("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(i);for(var o=t.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),e.copySymDepths(a)}},li.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(K.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},li.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},li.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(K.RIGHT)>=1&&e.getDepth(K.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},li.prototype.computeDepths=function(t){var e=this,i=new Og,r=new Qc,s=t.getNode();for(r.addLast(s),i.add(s),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();i.add(o),e.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var h=a.next(),u=h.getSym();if(!u.isVisited()){var c=u.getNode();i.contains(c)||(r.addLast(c),i.add(c))}}}},li.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},li.prototype.getEnvelope=function(){if(this._env===null){for(var t=new ct,e=this._dirEdgeList.iterator();e.hasNext();)for(var i=e.next(),r=i.getEdge().getCoordinates(),s=0;s<r.length-1;s++)t.expandToInclude(r[s]);this._env=t}return this._env},li.prototype.addReachable=function(t){var e=this,i=new Yn;for(i.add(t);!i.empty();){var r=i.pop();e.add(r,i)}},li.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(K.LEFT,t.getDepth(K.RIGHT)),e.setDepth(K.RIGHT,t.getDepth(K.LEFT))},li.prototype.add=function(t,e){var i=this;t.setVisited(!0),this._nodes.add(t);for(var r=t.getEdges().iterator();r.hasNext();){var s=r.next();i._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||e.push(a)}},li.prototype.getNodes=function(){return this._nodes},li.prototype.getDirectedEdges=function(){return this._dirEdgeList},li.prototype.interfaces_=function(){return[hn]},li.prototype.getClass=function(){return li};var re=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 i=arguments[0];this.init(1),this.location[K.ON]=i}else if(arguments[0]instanceof n){var r=arguments[0];if(this.init(r.location.length),r!==null)for(var s=0;s<this.location.length;s++)t.location[s]=r.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],h=arguments[2];this.init(3),this.location[K.ON]=o,this.location[K.LEFT]=a,this.location[K.RIGHT]=h}};re.prototype.setAllLocations=function(t){for(var e=this,i=0;i<this.location.length;i++)e.location[i]=t},re.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==V.NONE)return!1;return!0},re.prototype.setAllLocationsIfNull=function(t){for(var e=this,i=0;i<this.location.length;i++)e.location[i]===V.NONE&&(e.location[i]=t)},re.prototype.isLine=function(){return this.location.length===1},re.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var i=new Array(3).fill(null);i[K.ON]=this.location[K.ON],i[K.LEFT]=V.NONE,i[K.RIGHT]=V.NONE,this.location=i}for(var r=0;r<this.location.length;r++)e.location[r]===V.NONE&&r<t.location.length&&(e.location[r]=t.location[r])},re.prototype.getLocations=function(){return this.location},re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[K.LEFT];this.location[K.LEFT]=this.location[K.RIGHT],this.location[K.RIGHT]=t},re.prototype.toString=function(){var t=new Vn;return this.location.length>1&&t.append(V.toLocationSymbol(this.location[K.LEFT])),t.append(V.toLocationSymbol(this.location[K.ON])),this.location.length>1&&t.append(V.toLocationSymbol(this.location[K.RIGHT])),t.toString()},re.prototype.setLocations=function(t,e,i){this.location[K.ON]=t,this.location[K.LEFT]=e,this.location[K.RIGHT]=i},re.prototype.get=function(t){return t<this.location.length?this.location[t]:V.NONE},re.prototype.isArea=function(){return this.location.length>1},re.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===V.NONE)return!0;return!1},re.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(K.ON,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.location[e]=i}},re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(V.NONE)},re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},re.prototype.allPositionsEqual=function(t){for(var e=this,i=0;i<this.location.length;i++)if(e.location[i]!==t)return!1;return!0},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re};var Kt=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 re(t),this.elt[1]=new re(t)}else if(arguments[0]instanceof n){var e=arguments[0];this.elt[0]=new re(e.elt[0]),this.elt[1]=new re(e.elt[1])}}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.elt[0]=new re(V.NONE),this.elt[1]=new re(V.NONE),this.elt[i].setLocation(r)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new re(s,o,a),this.elt[1]=new re(s,o,a)}else if(arguments.length===4){var h=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new re(V.NONE,V.NONE,V.NONE),this.elt[1]=new re(V.NONE,V.NONE,V.NONE),this.elt[h].setLocations(u,c,l)}};Kt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Kt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Kt.prototype.isNull=function(t){return this.elt[t].isNull()},Kt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.elt[e].setAllLocationsIfNull(i)}},Kt.prototype.isLine=function(t){return this.elt[t].isLine()},Kt.prototype.merge=function(t){for(var e=this,i=0;i<2;i++)e.elt[i]===null&&t.elt[i]!==null?e.elt[i]=new re(t.elt[i]):e.elt[i].merge(t.elt[i])},Kt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Kt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(K.ON)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.elt[e].get(i)}},Kt.prototype.toString=function(){var t=new Vn;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()},Kt.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()}},Kt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Kt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(K.ON,e)}else if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];this.elt[i].setLocation(r,s)}},Kt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Kt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Kt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new re(this.elt[t].location[0]))},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.toLineLabel=function(t){for(var e=new Kt(V.NONE),i=0;i<2;i++)e.setLocation(i,t.getLocation(i));return e};var Ie=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Z,this._pts=new Z,this._label=new Kt(V.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Z,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ie.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)e[i]=t._pts.get(i);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=et.isCCW(this._ring.getCoordinates())},Ie.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Ie.prototype.computePoints=function(t){var e=this;this._startDe=t;var i=t,r=!0;do{if(i===null)throw new is("Found null DirectedEdge");if(i.getEdgeRing()===e)throw new is("Directed Edge visited twice during ring-building at "+i.getCoordinate());e._edges.add(i);var s=i.getLabel();Nt.isTrue(s.isArea()),e.mergeLabel(s),e.addPoints(i.getEdge(),i.isForward(),r),r=!1,e.setEdgeRing(i,e),i=e.getNext(i)}while(i!==this._startDe)},Ie.prototype.getLinearRing=function(){return this._ring},Ie.prototype.getCoordinate=function(t){return this._pts.get(t)},Ie.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var i=e.getNode(),r=i.getEdges().getOutgoingDegree(t);r>t._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Ie.prototype.addPoints=function(t,e,i){var r=this,s=t.getCoordinates();if(e){var o=1;i&&(o=0);for(var a=o;a<s.length;a++)r._pts.add(s[a])}else{var h=s.length-2;i&&(h=s.length-1);for(var u=h;u>=0;u--)r._pts.add(s[u])}},Ie.prototype.isHole=function(){return this._isHole},Ie.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ie.prototype.containsPoint=function(t){var e=this.getLinearRing(),i=e.getEnvelopeInternal();if(!i.contains(t)||!et.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var s=r.next();if(s.containsPoint(t))return!1}return!0},Ie.prototype.addHole=function(t){this._holes.add(t)},Ie.prototype.isShell=function(){return this._shell===null},Ie.prototype.getLabel=function(){return this._label},Ie.prototype.getEdges=function(){return this._edges},Ie.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ie.prototype.getShell=function(){return this._shell},Ie.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],r=e.getLocation(i,K.RIGHT);if(r===V.NONE)return null;if(this._label.getLocation(i)===V.NONE)return this._label.setLocation(i,r),null}},Ie.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Ie.prototype.toPolygon=function(t){for(var e=this,i=new Array(this._holes.size()).fill(null),r=0;r<this._holes.size();r++)i[r]=e._holes.get(r).getLinearRing();var s=t.createPolygon(this.getLinearRing(),i);return s},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie};var GM=function(n){function t(){var e=arguments[0],i=arguments[1];n.call(this,e,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(i,r){i.setMinEdgeRing(r)},t.prototype.getNext=function(i){return i.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ie),BM=function(n){function t(){var e=arguments[0],i=arguments[1];n.call(this,e,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var i=this,r=new Z,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new GM(s,i._geometryFactory);r.add(o)}s=s.getNext()}while(s!==this._startDe);return r},t.prototype.setEdgeRing=function(i,r){i.setEdgeRing(r)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var i=this,r=this._startDe;do{var s=r.getNode();s.getEdges().linkMinimalDirectedEdges(i),r=r.getNext()}while(r!==this._startDe)},t.prototype.getNext=function(i){return i.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ie),Ji=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}}};Ji.prototype.setVisited=function(t){this._isVisited=t},Ji.prototype.setInResult=function(t){this._isInResult=t},Ji.prototype.isCovered=function(){return this._isCovered},Ji.prototype.isCoveredSet=function(){return this._isCoveredSet},Ji.prototype.setLabel=function(t){this._label=t},Ji.prototype.getLabel=function(){return this._label},Ji.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ji.prototype.updateIM=function(t){Nt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ji.prototype.isInResult=function(){return this._isInResult},Ji.prototype.isVisited=function(){return this._isVisited},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji};var Zc=function(n){function t(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],i=arguments[1];this._coord=e,this._edges=i,this._label=new Kt(0,V.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var i=this.getEdges().getEdges().iterator();i.hasNext();){var r=i.next();if(r.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(i){i.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(i){},t.prototype.computeMergedLocation=function(i,r){var s=V.NONE;if(s=this._label.getLocation(r),!i.isNull(r)){var o=i.getLocation(r);s!==V.BOUNDARY&&(s=o)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];this._label===null?this._label=new Kt(i,r):this._label.setLocation(i,r)}else return n.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var i=this;if(arguments[0]instanceof t){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof Kt)for(var s=arguments[0],o=0;o<2;o++){var a=i.computeMergedLocation(s,o),h=i._label.getLocation(o);h===V.NONE&&i._label.setLocation(o,a)}},t.prototype.add=function(i){this._edges.insert(i),i.setNode(this)},t.prototype.setLabelBoundary=function(i){if(this._label===null)return null;var r=V.NONE;this._label!==null&&(r=this._label.getLocation(i));var s=null;switch(r){case V.BOUNDARY:s=V.INTERIOR;break;case V.INTERIOR:s=V.BOUNDARY;break;default:s=V.BOUNDARY;break}this._label.setLocation(i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ji),$n=function(){this.nodeMap=new ii,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};$n.prototype.find=function(t){return this.nodeMap.get(t)},$n.prototype.addNode=function(){if(arguments[0]instanceof L){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 Zc){var i=arguments[0],r=this.nodeMap.get(i.getCoordinate());return r===null?(this.nodeMap.put(i.getCoordinate(),i),i):(r.mergeLabel(i),r)}},$n.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},$n.prototype.iterator=function(){return this.nodeMap.values().iterator()},$n.prototype.values=function(){return this.nodeMap.values()},$n.prototype.getBoundaryNodes=function(t){for(var e=new Z,i=this.iterator();i.hasNext();){var r=i.next();r.getLabel().getLocation(t)===V.BOUNDARY&&e.add(r)}return e},$n.prototype.add=function(t){var e=t.getCoordinate(),i=this.addNode(e);i.add(t)},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Qt=function(){},yl={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt},Qt.isNorthern=function(t){return t===Qt.NE||t===Qt.NW},Qt.isOpposite=function(t,e){if(t===e)return!1;var i=(t-e+4)%4;return i===2},Qt.commonHalfPlane=function(t,e){if(t===e)return t;var i=(t-e+4)%4;if(i===2)return-1;var r=t<e?t:e,s=t>e?t:e;return r===0&&s===3?3:r},Qt.isInHalfPlane=function(t,e){return e===Qt.SE?t===Qt.SE||t===Qt.SW:t===e||t===e+1},Qt.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 ce("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Qt.NE:Qt.SE:e>=0?Qt.NW:Qt.SW}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new ce("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?Qt.NE:Qt.SE:r.y>=i.y?Qt.NW:Qt.SW}},yl.NE.get=function(){return 0},yl.NW.get=function(){return 1},yl.SW.get=function(){return 2},yl.SE.get=function(){return 3},Object.defineProperties(Qt,yl);var ni=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],i=arguments[1],r=arguments[2],s=null;this._edge=e,this.init(i,r),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],h=arguments[2],u=arguments[3];this._edge=o,this.init(a,h),this._label=u}};ni.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:et.computeOrientation(t._p0,t._p1,this._p1)},ni.prototype.getDy=function(){return this._dy},ni.prototype.getCoordinate=function(){return this._p0},ni.prototype.setNode=function(t){this._node=t},ni.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),r=i.lastIndexOf("."),s=i.substring(r+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},ni.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},ni.prototype.getDirectedCoordinate=function(){return this._p1},ni.prototype.getDx=function(){return this._dx},ni.prototype.getLabel=function(){return this._label},ni.prototype.getEdge=function(){return this._edge},ni.prototype.getQuadrant=function(){return this._quadrant},ni.prototype.getNode=function(){return this._node},ni.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),i=e.lastIndexOf("."),r=e.substring(i+1);return" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},ni.prototype.computeLabel=function(t){},ni.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=Qt.quadrant(this._dx,this._dy),Nt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},ni.prototype.interfaces_=function(){return[hn]},ni.prototype.getClass=function(){return ni};var Gg=function(n){function t(){var e=arguments[0],i=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=i,i)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-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(i){return this._depth[i]},t.prototype.setVisited=function(i){this._isVisited=i},t.prototype.computeDirectedLabel=function(){this._label=new Kt(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(i,r){if(this._depth[i]!==-999&&this._depth[i]!==r)throw new is("assigned depths do not match",this.getCoordinate());this._depth[i]=r},t.prototype.isInteriorAreaEdge=function(){for(var i=this,r=!0,s=0;s<2;s++)i._label.isArea(s)&&i._label.getLocation(s,K.LEFT)===V.INTERIOR&&i._label.getLocation(s,K.RIGHT)===V.INTERIOR||(r=!1);return r},t.prototype.setNextMin=function(i){this._nextMin=i},t.prototype.print=function(i){n.prototype.print.call(this,i),i.print(" "+this._depth[K.LEFT]+"/"+this._depth[K.RIGHT]),i.print(" ("+this.getDepthDelta()+")"),this._isInResult&&i.print(" inResult")},t.prototype.setMinEdgeRing=function(i){this._minEdgeRing=i},t.prototype.isLineEdge=function(){var i=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,V.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,V.EXTERIOR);return i&&r&&s},t.prototype.setEdgeRing=function(i){this._edgeRing=i},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var i=this._edge.getDepthDelta();return this._isForward||(i=-i),i},t.prototype.setInResult=function(i){this._isInResult=i},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(i){this.print(i),i.print(" "),this._isForward?this._edge.print(i):this._edge.printReverse(i)},t.prototype.setSym=function(i){this._sym=i},t.prototype.setVisitedEdge=function(i){this.setVisited(i),this._sym.setVisited(i)},t.prototype.setEdgeDepths=function(i,r){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;i===K.LEFT&&(o=-1);var a=K.opposite(i),h=s*o,u=r+h;this.setDepth(i,r),this.setDepth(a,u)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(i){this._next=i},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(i,r){return i===V.EXTERIOR&&r===V.INTERIOR?1:i===V.INTERIOR&&r===V.EXTERIOR?-1:0},t}(ni),wh=function(){};wh.prototype.createNode=function(t){return new Zc(t,null)},wh.prototype.interfaces_=function(){return[]},wh.prototype.getClass=function(){return wh};var pe=function(){if(this._edges=new Z,this._nodes=null,this._edgeEndList=new Z,arguments.length===0)this._nodes=new $n(new wh);else if(arguments.length===1){var t=arguments[0];this._nodes=new $n(t)}};pe.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var i=0;i<this._edges.size();i++){t.println("edge "+i+":");var r=e._edges.get(i);r.print(t),r.eiList.print(t)}},pe.prototype.find=function(t){return this._nodes.find(t)},pe.prototype.addNode=function(){if(arguments[0]instanceof Zc){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof L){var e=arguments[0];return this._nodes.addNode(e)}},pe.prototype.getNodeIterator=function(){return this._nodes.iterator()},pe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},pe.prototype.debugPrintln=function(t){We.out.println(t)},pe.prototype.isBoundaryNode=function(t,e){var i=this._nodes.find(e);if(i===null)return!1;var r=i.getLabel();return r!==null&&r.getLocation(t)===V.BOUNDARY},pe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},pe.prototype.matchInSameDirection=function(t,e,i,r){return t.equals(i)?et.computeOrientation(t,e,r)===et.COLLINEAR&&Qt.quadrant(t,e)===Qt.quadrant(i,r):!1},pe.prototype.getEdgeEnds=function(){return this._edgeEndList},pe.prototype.debugPrint=function(t){We.out.print(t)},pe.prototype.getEdgeIterator=function(){return this._edges.iterator()},pe.prototype.findEdgeInSameDirection=function(t,e){for(var i=this,r=0;r<this._edges.size();r++){var s=i._edges.get(r),o=s.getCoordinates();if(i.matchInSameDirection(t,e,o[0],o[1])||i.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return s}return null},pe.prototype.insertEdge=function(t){this._edges.add(t)},pe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var i=e.next();if(i.getEdge()===t)return i}return null},pe.prototype.addEdges=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next();e._edges.add(r);var s=new Gg(r,!0),o=new Gg(r,!1);s.setSym(o),o.setSym(s),e.add(s),e.add(o)}},pe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},pe.prototype.getNodes=function(){return this._nodes.values()},pe.prototype.findEdge=function(t,e){for(var i=this,r=0;r<this._edges.size();r++){var s=i._edges.get(r),o=s.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return s}return null},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},pe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();i.getEdges().linkResultDirectedEdges()}};var Ri=function(){this._geometryFactory=null,this._shellList=new Z;var t=arguments[0];this._geometryFactory=t};Ri.prototype.sortShellsAndHoles=function(t,e,i){for(var r=t.iterator();r.hasNext();){var s=r.next();s.isHole()?i.add(s):e.add(s)}},Ri.prototype.computePolygons=function(t){for(var e=this,i=new Z,r=t.iterator();r.hasNext();){var s=r.next(),o=s.toPolygon(e._geometryFactory);i.add(o)}return i},Ri.prototype.placeFreeHoles=function(t,e){for(var i=this,r=e.iterator();r.hasNext();){var s=r.next();if(s.getShell()===null){var o=i.findEdgeRingContaining(s,t);if(o===null)throw new is("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},Ri.prototype.buildMinimalEdgeRings=function(t,e,i){for(var r=this,s=new Z,o=t.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var h=a.buildMinimalRings(),u=r.findShell(h);u!==null?(r.placePolygonHoles(u,h),e.add(u)):i.addAll(h)}else s.add(a)}return s},Ri.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var i=e.next();if(i.containsPoint(t))return!0}return!1},Ri.prototype.buildMaximalEdgeRings=function(t){for(var e=this,i=new Z,r=t.iterator();r.hasNext();){var s=r.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new BM(s,e._geometryFactory);i.add(o),o.setInResult()}}return i},Ri.prototype.placePolygonHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var r=i.next();r.isHole()&&r.setShell(t)}},Ri.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},Ri.prototype.findEdgeRingContaining=function(t,e){for(var i=t.getLinearRing(),r=i.getEnvelopeInternal(),s=i.getCoordinateN(0),o=null,a=null,h=e.iterator();h.hasNext();){var u=h.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var d=!1;l.contains(r)&&et.isPointInRing(s,c.getCoordinates())&&(d=!0),d&&(o===null||a.contains(l))&&(o=u)}return o},Ri.prototype.findShell=function(t){for(var e=0,i=null,r=t.iterator();r.hasNext();){var s=r.next();s.isHole()||(i=s,e++)}return Nt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),i},Ri.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],i=arguments[1];pe.linkResultDirectedEdges(i);var r=this.buildMaximalEdgeRings(e),s=new Z,o=this.buildMinimalEdgeRings(r,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var Eh=function(){};Eh.prototype.getBounds=function(){},Eh.prototype.interfaces_=function(){return[]},Eh.prototype.getClass=function(){return Eh};var Mn=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Mn.prototype.getItem=function(){return this._item},Mn.prototype.getBounds=function(){return this._bounds},Mn.prototype.interfaces_=function(){return[Eh,un]},Mn.prototype.getClass=function(){return Mn};var ns=function(){this._size=null,this._items=null,this._size=0,this._items=new Z,this._items.add(null)};ns.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},ns.prototype.size=function(){return this._size},ns.prototype.reorder=function(t){for(var e=this,i=null,r=this._items.get(t);t*2<=this._size&&(i=t*2,i!==e._size&&e._items.get(i+1).compareTo(e._items.get(i))<0&&i++,e._items.get(i).compareTo(r)<0);t=i)e._items.set(t,e._items.get(i));this._items.set(t,r)},ns.prototype.clear=function(){this._size=0,this._items.clear()},ns.prototype.isEmpty=function(){return this._size===0},ns.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)e._items.set(i,e._items.get(Math.trunc(i/2)));this._items.set(i,t)},ns.prototype.interfaces_=function(){return[]},ns.prototype.getClass=function(){return ns};var Ns=function(){};Ns.prototype.visitItem=function(t){},Ns.prototype.interfaces_=function(){return[]},Ns.prototype.getClass=function(){return Ns};var ea=function(){};ea.prototype.insert=function(t,e){},ea.prototype.remove=function(t,e){},ea.prototype.query=function(){},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea};var Ae=function(){if(this._childBoundables=new Z,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},my={serialVersionUID:{configurable:!0}};Ae.prototype.getLevel=function(){return this._level},Ae.prototype.size=function(){return this._childBoundables.size()},Ae.prototype.getChildBoundables=function(){return this._childBoundables},Ae.prototype.addChildBoundable=function(t){Nt.isTrue(this._bounds===null),this._childBoundables.add(t)},Ae.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ae.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ae.prototype.interfaces_=function(){return[Eh,un]},Ae.prototype.getClass=function(){return Ae},my.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ae,my);var Tn=function(){};Tn.reverseOrder=function(){return{compare:function(e,i){return i.compareTo(e)}}},Tn.min=function(t){return Tn.sort(t),t.get(0)},Tn.sort=function(t,e){var i=t.toArray();e?fo.sort(i,e):fo.sort(i);for(var r=t.iterator(),s=0,o=i.length;s<o;s++)r.next(),r.set(i[s])},Tn.singletonList=function(t){var e=new Z;return e.add(t),e};var xe=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=i,this._distance=this.distance()};xe.prototype.expandToQueue=function(t,e){var i=xe.isComposite(this._boundable1),r=xe.isComposite(this._boundable2);if(i&&r)return xe.area(this._boundable1)>xe.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(i)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ce("neither boundable is composite")},xe.prototype.isLeaves=function(){return!(xe.isComposite(this._boundable1)||xe.isComposite(this._boundable2))},xe.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},xe.prototype.expand=function(t,e,i,r){for(var s=this,o=t.getChildBoundables(),a=o.iterator();a.hasNext();){var h=a.next(),u=new xe(h,e,s._itemDistance);u.getDistance()<r&&i.add(u)}},xe.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},xe.prototype.getDistance=function(){return this._distance},xe.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},xe.prototype.interfaces_=function(){return[hn]},xe.prototype.getClass=function(){return xe},xe.area=function(t){return t.getBounds().getArea()},xe.isComposite=function(t){return t instanceof Ae};var Be=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new Z,this._nodeCapacity=null,arguments.length===0){var t=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];Nt.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},td={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Be.prototype.getNodeCapacity=function(){return this._nodeCapacity},Be.prototype.lastNode=function(t){return t.get(t.size()-1)},Be.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],i=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Ae?i+=t.size(s):s instanceof Mn&&(i+=1)}return i}},Be.prototype.removeItem=function(t,e){for(var i=null,r=t.getChildBoundables().iterator();r.hasNext();){var s=r.next();s instanceof Mn&&s.getItem()===e&&(i=s)}return i!==null?(t.getChildBoundables().remove(i),!0):!1},Be.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new Z:e}else if(arguments.length===1){for(var i=arguments[0],r=new Z,s=i.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof Ae){var a=t.itemsTree(o);a!==null&&r.add(a)}else o instanceof Mn?r.add(o.getItem()):Nt.shouldNeverReachHere()}return r.size()<=0?null:r}},Be.prototype.insert=function(t,e){Nt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Mn(t,e))},Be.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],i=new Z;return this.boundablesAtLevel(e,this._root,i),i}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];if(Nt.isTrue(r>-2),s.getLevel()===r)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var h=a.next();h instanceof Ae?t.boundablesAtLevel(r,h,o):(Nt.isTrue(h instanceof Mn),r===-1&&o.add(h))}return null}},Be.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var i=new Z;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,i),i}else if(arguments.length===2){var r=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,s)}else if(arguments.length===3){if(wt(arguments[2],Ns)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var o=arguments[0],a=arguments[1],h=arguments[2],u=a.getChildBoundables(),c=0;c<u.size();c++){var l=u.get(c);t.getIntersectsOp().intersects(l.getBounds(),o)&&(l instanceof Ae?t.query(o,l,h):l instanceof Mn?h.visitItem(l.getItem()):Nt.shouldNeverReachHere())}else if(wt(arguments[2],bn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae)for(var d=arguments[0],g=arguments[1],p=arguments[2],_=g.getChildBoundables(),w=0;w<_.size();w++){var P=_.get(w);t.getIntersectsOp().intersects(P.getBounds(),d)&&(P instanceof Ae?t.query(d,P,p):P instanceof Mn?p.add(P.getItem()):Nt.shouldNeverReachHere())}}},Be.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},Be.prototype.getRoot=function(){return this.build(),this._root},Be.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],i=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,i):!1}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var h=null,u=s.getChildBoundables().iterator();u.hasNext();){var c=u.next();if(t.getIntersectsOp().intersects(c.getBounds(),r)&&c instanceof Ae&&(a=t.remove(r,c,o),a)){h=c;break}}return h!==null&&h.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(h),a}},Be.prototype.createHigherLevels=function(t,e){Nt.isTrue(!t.isEmpty());var i=this.createParentBoundables(t,e+1);return i.size()===1?i.get(0):this.createHigherLevels(i,e+1)},Be.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],i=0,r=e.getChildBoundables().iterator();r.hasNext();){var s=r.next();if(s instanceof Ae){var o=t.depth(s);o>i&&(i=o)}}return i+1}},Be.prototype.createParentBoundables=function(t,e){var i=this;Nt.isTrue(!t.isEmpty());var r=new Z;r.add(this.createNode(e));var s=new Z(t);Tn.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();i.lastNode(r).getChildBoundables().size()===i.getNodeCapacity()&&r.add(i.createNode(e)),i.lastNode(r).addChildBoundable(a)}return r},Be.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Be.prototype.interfaces_=function(){return[un]},Be.prototype.getClass=function(){return Be},Be.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},td.IntersectsOp.get=function(){return VM},td.serialVersionUID.get=function(){return-3886435814360241e3},td.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Be,td);var VM=function(){},Sh=function(){};Sh.prototype.distance=function(t,e){},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var _y=function(n){function t(i){i=i||t.DEFAULT_NODE_CAPACITY,n.call(this,i)}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(r,s){var o=this;Nt.isTrue(r.length>0);for(var a=new Z,h=0;h<r.length;h++)a.addAll(o.createParentBoundablesFromVerticalSlice(r[h],s));return a},t.prototype.createNode=function(r){return new yy(r)},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 r=arguments[0],s=arguments[1];if(r.isNull())return null;n.prototype.insert.call(this,r,s)}else return n.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(r,s){for(var o=Math.trunc(Math.ceil(r.size()/s)),a=new Array(s).fill(null),h=r.iterator(),u=0;u<s;u++){a[u]=new Z;for(var c=0;h.hasNext()&&c<o;){var l=h.next();a[u].add(l),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var r=arguments[0];return n.prototype.query.call(this,r)}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(wt(arguments[2],Ns)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var a=arguments[0],h=arguments[1],u=arguments[2];n.prototype.query.call(this,a,h,u)}else if(wt(arguments[2],bn)&&arguments[0]instanceof Object&&arguments[1]instanceof Ae){var c=arguments[0],l=arguments[1],d=arguments[2];n.prototype.query.call(this,c,l,d)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(r,s){return n.prototype.createParentBoundables.call(this,r,s)},t.prototype.remove=function(){if(arguments.length===2){var r=arguments[0],s=arguments[1];return n.prototype.remove.call(this,r,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(r,s){Nt.isTrue(!r.isEmpty());var o=Math.trunc(Math.ceil(r.size()/this.getNodeCapacity())),a=new Z(r);Tn.sort(a,t.xComparator);var h=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(h,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(wt(arguments[0],Sh)){var r=arguments[0],s=new xe(this.getRoot(),this.getRoot(),r);return this.nearestNeighbour(s)}else if(arguments[0]instanceof xe){var o=arguments[0];return this.nearestNeighbour(o,Pt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&wt(arguments[1],Sh)){var a=arguments[0],h=arguments[1],u=new xe(this.getRoot(),a.getRoot(),h);return this.nearestNeighbour(u)}else if(arguments[0]instanceof xe&&typeof arguments[1]=="number"){var c=arguments[0],l=arguments[1],d=l,g=null,p=new ns;for(p.add(c);!p.isEmpty()&&d>0;){var _=p.poll(),w=_.getDistance();if(w>=d)break;_.isLeaves()?(d=w,g=_):_.expandToQueue(p,d)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],v=arguments[1],E=arguments[2],m=new Mn(P,v),S=new xe(this.getRoot(),m,E);return this.nearestNeighbour(S)[0]}},t.prototype.interfaces_=function(){return[ea,un]},t.prototype.getClass=function(){return t},t.centreX=function(r){return t.avg(r.getMinX(),r.getMaxX())},t.avg=function(r,s){return(r+s)/2},t.centreY=function(r){return t.avg(r.getMinY(),r.getMaxY())},e.STRtreeNode.get=function(){return yy},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[hh]},compare:function(i,r){return n.compareDoubles(t.centreX(i.getBounds()),t.centreX(r.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[hh]},compare:function(i,r){return n.compareDoubles(t.centreY(i.getBounds()),t.centreY(r.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(i,r){return i.intersects(r)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(Be),yy=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 i=null,r=this.getChildBoundables().iterator();r.hasNext();){var s=r.next();i===null?i=new ct(s.getBounds()):i.expandToInclude(s.getBounds())}return i},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ae),Ei=function(){};Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei},Ei.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Ei.compare=function(t,e,i){if(e.equals2D(i))return 0;var r=Ei.relativeSign(e.x,i.x),s=Ei.relativeSign(e.y,i.y);switch(t){case 0:return Ei.compareValue(r,s);case 1:return Ei.compareValue(s,r);case 2:return Ei.compareValue(s,-r);case 3:return Ei.compareValue(-r,s);case 4:return Ei.compareValue(-r,-s);case 5:return Ei.compareValue(-s,-r);case 6:return Ei.compareValue(-s,r);case 7:return Ei.compareValue(r,-s)}return Nt.shouldNeverReachHere("invalid octant value"),0},Ei.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Os=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this._segString=t,this.coord=new L(e),this.segmentIndex=i,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(i))};Os.prototype.getCoordinate=function(){return this.coord},Os.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Os.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Ei.compare(this._segmentOctant,this.coord,e.coord)},Os.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},Os.prototype.isInterior=function(){return this._isInterior},Os.prototype.interfaces_=function(){return[hn]},Os.prototype.getClass=function(){return Os};var ci=function(){this._nodeMap=new ii,this._edge=null;var t=arguments[0];this._edge=t};ci.prototype.getSplitCoordinates=function(){var t=this,e=new cl;this.addEndpoints();for(var i=this.iterator(),r=i.next();i.hasNext();){var s=i.next();t.addEdgeCoordinates(r,s,e),r=s}return e.toCoordinateArray()},ci.prototype.addCollapsedNodes=function(){var t=this,e=new Z;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var i=e.iterator();i.hasNext();){var r=i.next().intValue();t.add(t._edge.getCoordinate(r),r)}},ci.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},ci.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,i=0;i<this._edge.size()-2;i++){var r=e._edge.getCoordinate(i),s=e._edge.getCoordinate(i+2);r.equals2D(s)&&t.add(new zn(i+1))}},ci.prototype.addEdgeCoordinates=function(t,e,i){var r=this,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);i.add(new L(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)i.add(r._edge.getCoordinate(a));o&&i.add(new L(e.coord))},ci.prototype.iterator=function(){return this._nodeMap.values().iterator()},ci.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),r=i.next();i.hasNext();){var s=i.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},ci.prototype.findCollapseIndex=function(t,e,i){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,r===1?(i[0]=t.segmentIndex+1,!0):!1},ci.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,i=new Array(1).fill(null),r=this.iterator(),s=r.next();r.hasNext();){var o=r.next(),a=e.findCollapseIndex(s,o,i);a&&t.add(new zn(i[0])),s=o}},ci.prototype.getEdge=function(){return this._edge},ci.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ci.prototype.createSplitEdge=function(t,e){var i=this,r=e.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),h=0;a[h++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[h++]=i._edge.getCoordinate(u);return o&&(a[h]=new L(e.coord)),new Se(a,this._edge.getData())},ci.prototype.add=function(t,e){var i=new Os(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(i);return r!==null?(Nt.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(i,i),i)},ci.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),i=t.get(0),r=i.getCoordinate(0);if(!r.equals2D(e[0]))throw new $r("bad split edge start point at "+r);var s=t.get(t.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(e[e.length-1]))throw new $r("bad split edge end point at "+a)},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var ia=function(){};ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},ia.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 ce("Cannot compute the octant for point ( "+t+", "+e+" )");var i=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?i>=r?0:1:i>=r?7:6:e>=0?i>=r?3:2:i>=r?4:5}else if(arguments[0]instanceof L&&arguments[1]instanceof L){var s=arguments[0],o=arguments[1],a=o.x-s.x,h=o.y-s.y;if(a===0&&h===0)throw new ce("Cannot compute the octant for two identical points "+s);return ia.octant(a,h)}};var Cr=function(){};Cr.prototype.getCoordinates=function(){},Cr.prototype.size=function(){},Cr.prototype.getCoordinate=function(t){},Cr.prototype.isClosed=function(){},Cr.prototype.setData=function(t){},Cr.prototype.getData=function(){},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var wl=function(){};wl.prototype.addIntersection=function(t,e){},wl.prototype.interfaces_=function(){return[Cr]},wl.prototype.getClass=function(){return wl};var Se=function(){this._nodeList=new ci(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Se.prototype.getCoordinates=function(){return this._pts},Se.prototype.size=function(){return this._pts.length},Se.prototype.getCoordinate=function(t){return this._pts[t]},Se.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Se.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Se.prototype.setData=function(t){this._data=t},Se.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ia.octant(t,e)},Se.prototype.getData=function(){return this._data},Se.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var i=arguments[0],r=arguments[1],s=arguments[3],o=new L(i.getIntersection(s));this.addIntersection(o,r)}},Se.prototype.toString=function(){return Pn.toLineString(new Ee(this._pts))},Se.prototype.getNodeList=function(){return this._nodeList},Se.prototype.addIntersectionNode=function(t,e){var i=e,r=i+1;if(r<this._pts.length){var s=this._pts[r];t.equals2D(s)&&(i=r)}var o=this._nodeList.add(t,i);return o},Se.prototype.addIntersections=function(t,e,i){for(var r=this,s=0;s<t.getIntersectionNum();s++)r.addIntersection(t,e,i,s)},Se.prototype.interfaces_=function(){return[wl]},Se.prototype.getClass=function(){return Se},Se.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new Z;return Se.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var i=arguments[0],r=arguments[1],s=i.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(r)}};var dt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new L,this.p1=new L;else if(arguments.length===1){var t=arguments[0];this.p0=new L(t.p0),this.p1=new L(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],i=arguments[1],r=arguments[2],s=arguments[3];this.p0=new L(e,i),this.p1=new L(r,s)}},wy={serialVersionUID:{configurable:!0}};dt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dt.prototype.orientationIndex=function(){if(arguments[0]instanceof dt){var t=arguments[0],e=et.orientationIndex(this.p0,this.p1,t.p0),i=et.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&i>=0||e<=0&&i<=0?Math.max(e,i):0}else if(arguments[0]instanceof L){var r=arguments[0];return et.orientationIndex(this.p0,this.p1,r)}},dt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dt.prototype.isVertical=function(){return this.p0.x===this.p1.x},dt.prototype.equals=function(t){if(!(t instanceof dt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dt.prototype.intersection=function(t){var e=new lo;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dt.prototype.project=function(){if(arguments[0]instanceof L){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new L(t);var e=this.projectionFactor(t),i=new L;return i.x=this.p0.x+e*(this.p1.x-this.p0.x),i.y=this.p0.y+e*(this.p1.y-this.p0.y),i}else if(arguments[0]instanceof dt){var r=arguments[0],s=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(r.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var h=this.project(r.p1);return o<0&&(h=this.p0),o>1&&(h=this.p1),new dt(a,h)}},dt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},dt.prototype.distancePerpendicular=function(t){return et.distancePointLinePerpendicular(t,this.p0,this.p1)},dt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dt.prototype.midPoint=function(){return dt.midPoint(this.p0,this.p1)},dt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,r=e*e+i*i;if(r<=0)return Pt.NaN;var s=((t.x-this.p0.x)*e+(t.y-this.p0.y)*i)/r;return s},dt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var i=new Array(2).fill(null),r=Pt.MAX_VALUE,s=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),i[0]=o,i[1]=t.p0;var a=this.closestPoint(t.p1);s=a.distance(t.p1),s<r&&(r=s,i[0]=a,i[1]=t.p1);var h=t.closestPoint(this.p0);s=h.distance(this.p0),s<r&&(r=s,i[0]=this.p0,i[1]=h);var u=t.closestPoint(this.p1);return s=u.distance(this.p1),s<r&&(r=s,i[0]=this.p1,i[1]=u),i},dt.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var i=this.p0.distance(t),r=this.p1.distance(t);return i<r?this.p0:this.p1},dt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dt.prototype.getLength=function(){return this.p0.distance(this.p1)},dt.prototype.compareTo=function(t){var e=t,i=this.p0.compareTo(e.p0);return i!==0?i:this.p1.compareTo(e.p1)},dt.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dt.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)},dt.prototype.lineIntersection=function(t){try{var e=Cn.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(i){if(!(i instanceof lh))throw i}finally{}return null},dt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dt.prototype.pointAlongOffset=function(t,e){var i=this.p0.x+t*(this.p1.x-this.p0.x),r=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),h=0,u=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");h=e*s/a,u=e*o/a}var c=i-u,l=r+h,d=new L(c,l);return d},dt.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=i.x,this.p1.y=i.y}},dt.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Pt.isNaN(e))&&(e=1),e},dt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dt.prototype.distance=function(){if(arguments[0]instanceof dt){var t=arguments[0];return et.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof L){var e=arguments[0];return et.distancePointLine(e,this.p0,this.p1)}},dt.prototype.pointAlong=function(t){var e=new L;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},dt.prototype.hashCode=function(){var t=Pt.doubleToLongBits(this.p0.x);t^=Pt.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),i=Pt.doubleToLongBits(this.p1.x);i^=Pt.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(i)^Math.trunc(i>>32);return e^r},dt.prototype.interfaces_=function(){return[hn,un]},dt.prototype.getClass=function(){return dt},dt.midPoint=function(t,e){return new L((t.x+e.x)/2,(t.y+e.y)/2)},wy.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dt,wy);var El=function(){this.tempEnv1=new ct,this.tempEnv2=new ct,this._overlapSeg1=new dt,this._overlapSeg2=new dt};El.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),i.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var Li=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=i,this._context=r};Li.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Li.prototype.computeSelect=function(t,e,i,r){var s=this._pts[e],o=this._pts[i];if(r.tempEnv1.init(s,o),i-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+i)/2);e<a&&this.computeSelect(t,e,a,r),a<i&&this.computeSelect(t,a,i,r)},Li.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),i=0,r=this._start;r<=this._end;r++)e[i++]=t._pts[r];return e},Li.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Li.prototype.setId=function(t){this._id=t},Li.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Li.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ct(t,e)}return this._env},Li.prototype.getEndIndex=function(){return this._end},Li.prototype.getStartIndex=function(){return this._start},Li.prototype.getContext=function(){return this._context},Li.prototype.getId=function(){return this._id},Li.prototype.computeOverlapsInternal=function(t,e,i,r,s,o){var a=this._pts[t],h=this._pts[e],u=i._pts[r],c=i._pts[s];if(e-t===1&&s-r===1)return o.overlap(this,t,i,r),null;if(o.tempEnv1.init(a,h),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var l=Math.trunc((t+e)/2),d=Math.trunc((r+s)/2);t<l&&(r<d&&this.computeOverlapsInternal(t,l,i,r,d,o),d<s&&this.computeOverlapsInternal(t,l,i,d,s,o)),l<e&&(r<d&&this.computeOverlapsInternal(l,e,i,r,d,o),d<s&&this.computeOverlapsInternal(l,e,i,d,s,o))},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Kn=function(){};Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn},Kn.getChainStartIndices=function(t){var e=0,i=new Z;i.add(new zn(e));do{var r=Kn.findChainEnd(t,e);i.add(new zn(r)),e=r}while(e<t.length-1);var s=Kn.toIntArray(i);return s},Kn.findChainEnd=function(t,e){for(var i=e;i<t.length-1&&t[i].equals2D(t[i+1]);)i++;if(i>=t.length-1)return t.length-1;for(var r=Qt.quadrant(t[i],t[i+1]),s=e+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var o=Qt.quadrant(t[s-1],t[s]);if(o!==r)break}s++}return s-1},Kn.getChains=function(){if(arguments.length===1){var t=arguments[0];return Kn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],i=arguments[1],r=new Z,s=Kn.getChainStartIndices(e),o=0;o<s.length-1;o++){var a=new Li(e,s[o],s[o+1],i);r.add(a)}return r}},Kn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var po=function(){};po.prototype.computeNodes=function(t){},po.prototype.getNodedSubstrings=function(){},po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po};var Sl=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};Sl.prototype.setSegmentIntersector=function(t){this._segInt=t},Sl.prototype.interfaces_=function(){return[po]},Sl.prototype.getClass=function(){return Sl};var Bg=function(n){function t(i){i?n.call(this,i):n.call(this),this._monoChains=new Z,this._index=new _y,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 Se.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(r){for(var s=this,o=Kn.getChains(r.getCoordinates(),r),a=o.iterator();a.hasNext();){var h=a.next();h.setId(s._idCounter++),s._index.insert(h.getEnvelope(),h),s._monoChains.add(h)}},t.prototype.computeNodes=function(r){var s=this;this._nodedSegStrings=r;for(var o=r.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var r=this,s=new Ey(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),h=r._index.query(a.getEnvelope()),u=h.iterator();u.hasNext();){var c=u.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),r._nOverlaps++),r._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return Ey},Object.defineProperties(t,e),t}(Sl),Ey=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 i=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3],a=i.getContext(),h=s.getContext();this._si.processIntersections(a,r,h,o)}else return n.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(El),Yt=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],i=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(i)}else if(arguments.length===4){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},rs={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}};Yt.prototype.getEndCapStyle=function(){return this._endCapStyle},Yt.prototype.isSingleSided=function(){return this._isSingleSided},Yt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Yt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Yt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Yt.JOIN_ROUND&&(this._quadrantSegments=Yt.DEFAULT_QUADRANT_SEGMENTS)},Yt.prototype.getJoinStyle=function(){return this._joinStyle},Yt.prototype.setJoinStyle=function(t){this._joinStyle=t},Yt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Yt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Yt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Yt.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Yt.prototype.getMitreLimit=function(){return this._mitreLimit},Yt.prototype.setMitreLimit=function(t){this._mitreLimit=t},Yt.prototype.setSingleSided=function(t){this._isSingleSided=t},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},rs.CAP_ROUND.get=function(){return 1},rs.CAP_FLAT.get=function(){return 2},rs.CAP_SQUARE.get=function(){return 3},rs.JOIN_ROUND.get=function(){return 1},rs.JOIN_MITRE.get=function(){return 2},rs.JOIN_BEVEL.get=function(){return 3},rs.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},rs.DEFAULT_MITRE_LIMIT.get=function(){return 5},rs.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Yt,rs);var me=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=et.COUNTERCLOCKWISE,this._inputLine=t||null},Cl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};me.prototype.isDeletable=function(t,e,i,r){var s=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[i];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,r)?!1:this.isShallowSampled(s,o,t,i,r)},me.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,i=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(i),s=!1;r<this._inputLine.length;){var o=!1;t.isDeletable(e,i,r,t._distanceTol)&&(t._isDeleted[i]=me.DELETE,o=!0,s=!0),o?e=r:e=i,i=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(i)}return s},me.prototype.isShallowConcavity=function(t,e,i,r){var s=et.computeOrientation(t,e,i),o=s===this._angleOrientation;if(!o)return!1;var a=et.distancePointLine(e,t,i);return a<r},me.prototype.isShallowSampled=function(t,e,i,r,s){var o=this,a=Math.trunc((r-i)/me.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var h=i;h<r;h+=a)if(!o.isShallow(t,e,o._inputLine[h],s))return!1;return!0},me.prototype.isConcave=function(t,e,i){var r=et.computeOrientation(t,e,i),s=r===this._angleOrientation;return s},me.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=et.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=e.deleteShallowConcavities();while(i);return this.collapseLine()},me.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===me.DELETE;)e++;return e},me.prototype.isShallow=function(t,e,i,r){var s=et.distancePointLine(e,t,i);return s<r},me.prototype.collapseLine=function(){for(var t=this,e=new cl,i=0;i<this._inputLine.length;i++)t._isDeleted[i]!==me.DELETE&&e.add(t._inputLine[i]);return e.toCoordinateArray()},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.simplify=function(t,e){var i=new me(t);return i.simplify(e)},Cl.INIT.get=function(){return 0},Cl.DELETE.get=function(){return 1},Cl.KEEP.get=function(){return 1},Cl.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(me,Cl);var $i=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Z},Sy={COORDINATE_ARRAY_TYPE:{configurable:!0}};$i.prototype.getCoordinates=function(){var t=this._ptList.toArray($i.COORDINATE_ARRAY_TYPE);return t},$i.prototype.setPrecisionModel=function(t){this._precisionModel=t},$i.prototype.addPt=function(t){var e=new L(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},$i.prototype.revere=function(){},$i.prototype.addPts=function(t,e){var i=this;if(e)for(var r=0;r<t.length;r++)i.addPt(t[r]);else for(var s=t.length-1;s>=0;s--)i.addPt(t[s])},$i.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),i=t.distance(e);return i<this._minimimVertexDistance},$i.prototype.toString=function(){var t=new Ft,e=t.createLineString(this.getCoordinates());return e.toString()},$i.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new L(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},$i.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},Sy.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties($i,Sy);var Bt=function(){},na={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.toDegrees=function(t){return t*180/Math.PI},Bt.normalize=function(t){for(;t>Math.PI;)t-=Bt.PI_TIMES_2;for(;t<=-Math.PI;)t+=Bt.PI_TIMES_2;return t},Bt.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],i=arguments[1],r=i.x-e.x,s=i.y-e.y;return Math.atan2(s,r)}},Bt.isAcute=function(t,e,i){var r=t.x-e.x,s=t.y-e.y,o=i.x-e.x,a=i.y-e.y,h=r*o+s*a;return h>0},Bt.isObtuse=function(t,e,i){var r=t.x-e.x,s=t.y-e.y,o=i.x-e.x,a=i.y-e.y,h=r*o+s*a;return h<0},Bt.interiorAngle=function(t,e,i){var r=Bt.angle(e,t),s=Bt.angle(e,i);return Math.abs(s-r)},Bt.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Bt.PI_TIMES_2;t>=Bt.PI_TIMES_2&&(t=0)}else{for(;t>=Bt.PI_TIMES_2;)t-=Bt.PI_TIMES_2;t<0&&(t=0)}return t},Bt.angleBetween=function(t,e,i){var r=Bt.angle(e,t),s=Bt.angle(e,i);return Bt.diff(r,s)},Bt.diff=function(t,e){var i=null;return t<e?i=e-t:i=t-e,i>Math.PI&&(i=2*Math.PI-i),i},Bt.toRadians=function(t){return t*Math.PI/180},Bt.getTurn=function(t,e){var i=Math.sin(e-t);return i>0?Bt.COUNTERCLOCKWISE:i<0?Bt.CLOCKWISE:Bt.NONE},Bt.angleBetweenOriented=function(t,e,i){var r=Bt.angle(e,t),s=Bt.angle(e,i),o=s-r;return o<=-Math.PI?o+Bt.PI_TIMES_2:o>Math.PI?o-Bt.PI_TIMES_2:o},na.PI_TIMES_2.get=function(){return 2*Math.PI},na.PI_OVER_2.get=function(){return Math.PI/2},na.PI_OVER_4.get=function(){return Math.PI/4},na.COUNTERCLOCKWISE.get=function(){return et.COUNTERCLOCKWISE},na.CLOCKWISE.get=function(){return et.CLOCKWISE},na.NONE.get=function(){return et.COLLINEAR},Object.defineProperties(Bt,na);var ue=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 dt,this._seg1=new dt,this._offset0=new dt,this._offset1=new dt,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new lo,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Yt.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},Pl={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}};ue.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var i=et.computeOrientation(this._s0,this._s1,this._s2),r=i===et.CLOCKWISE&&this._side===K.LEFT||i===et.COUNTERCLOCKWISE&&this._side===K.RIGHT;i===0?this.addCollinear(e):r?this.addOutsideTurn(i,e):this.addInsideTurn(i,e)},ue.prototype.addLineEndCap=function(t,e){var i=new dt(t,e),r=new dt;this.computeOffsetSegment(i,K.LEFT,this._distance,r);var s=new dt;this.computeOffsetSegment(i,K.RIGHT,this._distance,s);var o=e.x-t.x,a=e.y-t.y,h=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Yt.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,h+Math.PI/2,h-Math.PI/2,et.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Yt.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(s.p1);break;case Yt.CAP_SQUARE:var u=new L;u.x=Math.abs(this._distance)*Math.cos(h),u.y=Math.abs(this._distance)*Math.sin(h);var c=new L(r.p1.x+u.x,r.p1.y+u.y),l=new L(s.p1.x+u.x,s.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l);break}},ue.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ue.prototype.addMitreJoin=function(t,e,i,r){var s=!0,o=null;try{o=Cn.intersection(e.p0,e.p1,i.p0,i.p1);var a=r<=0?1:o.distance(t)/Math.abs(r);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(h){if(h instanceof lh)o=new L(0,0),s=!1;else throw h}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(e,i,r,this._bufParams.getMitreLimit())},ue.prototype.addFilletCorner=function(t,e,i,r,s){var o=e.x-t.x,a=e.y-t.y,h=Math.atan2(a,o),u=i.x-t.x,c=i.y-t.y,l=Math.atan2(c,u);r===et.CLOCKWISE?h<=l&&(h+=2*Math.PI):h>=l&&(h-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,h,l,r,s),this._segList.addPt(i)},ue.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ue.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Yt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Yt.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))},ue.prototype.createSquare=function(t){this._segList.addPt(new L(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new L(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new L(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ue.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ue.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ue.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ue.prototype.initSideSegments=function(t,e,i){this._s1=t,this._s2=e,this._side=i,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},ue.prototype.addLimitedMitreJoin=function(t,e,i,r){var s=this._seg0.p1,o=Bt.angle(s,this._seg0.p0),a=Bt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),h=a/2,u=Bt.normalize(o+h),c=Bt.normalize(u+Math.PI),l=r*i,d=l*Math.abs(Math.sin(h)),g=i-d,p=s.x+l*Math.cos(c),_=s.y+l*Math.sin(c),w=new L(p,_),P=new dt(s,w),v=P.pointAlongOffset(1,g),E=P.pointAlongOffset(1,-g);this._side===K.LEFT?(this._segList.addPt(v),this._segList.addPt(E)):(this._segList.addPt(E),this._segList.addPt(v))},ue.prototype.computeOffsetSegment=function(t,e,i,r){var s=e===K.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,h=Math.sqrt(o*o+a*a),u=s*i*o/h,c=s*i*a/h;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+u},ue.prototype.addFilletArc=function(t,e,i,r,s){var o=this,a=r===et.CLOCKWISE?-1:1,h=Math.abs(e-i),u=Math.trunc(h/this._filletAngleQuantum+.5);if(u<1)return null;for(var c=0,l=h/u,d=c,g=new L;d<h;){var p=e+a*d;g.x=t.x+s*Math.cos(p),g.y=t.y+s*Math.sin(p),o._segList.addPt(g),d+=l}},ue.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*ue.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var i=new L((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i);var r=new L((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},ue.prototype.createCircle=function(t){var e=new L(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ue.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ue.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $i,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ue.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ue.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()===Yt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Yt.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,et.CLOCKWISE,this._distance))},ue.prototype.closeRing=function(){this._segList.closeRing()},ue.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue},Pl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Pl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Pl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Pl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ue,Pl);var Si=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Si.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var i=e<0,r=Math.abs(e),s=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,i,s);var o=s.getCoordinates();return i&&Lt.reverse(o),o},Si.prototype.computeSingleSidedBufferCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);if(e){i.addSegments(t,!0);var s=me.simplify(t,-r),o=s.length-1;i.initSideSegments(s[o],s[o-1],K.LEFT),i.addFirstSegment();for(var a=o-2;a>=0;a--)i.addNextSegment(s[a],!0)}else{i.addSegments(t,!1);var h=me.simplify(t,r),u=h.length-1;i.initSideSegments(h[0],h[1],K.LEFT),i.addFirstSegment();for(var c=2;c<=u;c++)i.addNextSegment(h[c],!0)}i.addLastSegment(),i.closeRing()},Si.prototype.computeRingBufferCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);e===K.RIGHT&&(r=-r);var s=me.simplify(t,r),o=s.length-1;i.initSideSegments(s[o-1],s[0],e);for(var a=1;a<=o;a++){var h=a!==1;i.addNextSegment(s[a],h)}i.closeRing()},Si.prototype.computeLineBufferCurve=function(t,e){var i=this.simplifyTolerance(this._distance),r=me.simplify(t,i),s=r.length-1;e.initSideSegments(r[0],r[1],K.LEFT);for(var o=2;o<=s;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[s-1],r[s]);var a=me.simplify(t,-i),h=a.length-1;e.initSideSegments(a[h],a[h-1],K.LEFT);for(var u=h-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},Si.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Yt.CAP_ROUND:e.createCircle(t);break;case Yt.CAP_SQUARE:e.createSquare(t);break}},Si.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var i=Math.abs(e),r=this.getSegGen(i);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var s=e<0;this.computeSingleSidedBufferCurve(t,s,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o},Si.prototype.getBufferParameters=function(){return this._bufParams},Si.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Si.prototype.getRingCurve=function(t,e,i){if(this._distance=i,t.length<=2)return this.getLineCurve(t,i);if(i===0)return Si.copyCoordinates(t);var r=this.getSegGen(i);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Si.prototype.computeOffsetCurve=function(t,e,i){var r=this.simplifyTolerance(this._distance);if(e){var s=me.simplify(t,-r),o=s.length-1;i.initSideSegments(s[o],s[o-1],K.LEFT),i.addFirstSegment();for(var a=o-2;a>=0;a--)i.addNextSegment(s[a],!0)}else{var h=me.simplify(t,r),u=h.length-1;i.initSideSegments(h[0],h[1],K.LEFT),i.addFirstSegment();for(var c=2;c<=u;c++)i.addNextSegment(h[c],!0)}i.addLastSegment()},Si.prototype.getSegGen=function(t){return new ue(this._precisionModel,this._bufParams,t)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),i=0;i<e.length;i++)e[i]=new L(t[i]);return e};var ra=function(){this._subgraphs=null,this._seg=new dt,this._cga=new et;var t=arguments[0];this._subgraphs=t},Cy={DepthSegment:{configurable:!0}};ra.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],i=new Z,r=this._subgraphs.iterator();r.hasNext();){var s=r.next(),o=s.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,s.getDirectedEdges(),i)}return i}else if(arguments.length===3){if(wt(arguments[2],bn)&&arguments[0]instanceof L&&arguments[1]instanceof Gg)for(var a=arguments[0],h=arguments[1],u=arguments[2],c=h.getEdge().getCoordinates(),l=0;l<c.length-1;l++){t._seg.p0=c[l],t._seg.p1=c[l+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var d=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(d<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&et.computeOrientation(t._seg.p0,t._seg.p1,a)!==et.RIGHT){var g=h.getDepth(K.LEFT);t._seg.p0.equals(c[l])||(g=h.getDepth(K.RIGHT));var p=new vo(t._seg,g);u.add(p)}}else if(wt(arguments[2],bn)&&arguments[0]instanceof L&&wt(arguments[1],bn))for(var _=arguments[0],w=arguments[1],P=arguments[2],v=w.iterator();v.hasNext();){var E=v.next();E.isForward()&&t.findStabbedSegments(_,E,P)}}},ra.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var i=Tn.min(e);return i._leftDepth},ra.prototype.interfaces_=function(){return[]},ra.prototype.getClass=function(){return ra},Cy.DepthSegment.get=function(){return vo},Object.defineProperties(ra,Cy);var vo=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dt(t),this._leftDepth=e};vo.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var i=this._upwardSeg.orientationIndex(e._upwardSeg);return i!==0||(i=-1*e._upwardSeg.orientationIndex(this._upwardSeg),i!==0)?i:this._upwardSeg.compareTo(e._upwardSeg)},vo.prototype.compareX=function(t,e){var i=t.p0.compareTo(e.p0);return i!==0?i:t.p1.compareTo(e.p1)},vo.prototype.toString=function(){return this._upwardSeg.toString()},vo.prototype.interfaces_=function(){return[hn]},vo.prototype.getClass=function(){return vo};var Jt=function(t,e,i){this.p0=t||null,this.p1=e||null,this.p2=i||null};Jt.prototype.area=function(){return Jt.area(this.p0,this.p1,this.p2)},Jt.prototype.signedArea=function(){return Jt.signedArea(this.p0,this.p1,this.p2)},Jt.prototype.interpolateZ=function(t){if(t===null)throw new ce("Supplied point is null.");return Jt.interpolateZ(t,this.p0,this.p1,this.p2)},Jt.prototype.longestSideLength=function(){return Jt.longestSideLength(this.p0,this.p1,this.p2)},Jt.prototype.isAcute=function(){return Jt.isAcute(this.p0,this.p1,this.p2)},Jt.prototype.circumcentre=function(){return Jt.circumcentre(this.p0,this.p1,this.p2)},Jt.prototype.area3D=function(){return Jt.area3D(this.p0,this.p1,this.p2)},Jt.prototype.centroid=function(){return Jt.centroid(this.p0,this.p1,this.p2)},Jt.prototype.inCentre=function(){return Jt.inCentre(this.p0,this.p1,this.p2)},Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt},Jt.area=function(t,e,i){return Math.abs(((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2)},Jt.signedArea=function(t,e,i){return((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2},Jt.det=function(t,e,i,r){return t*r-e*i},Jt.interpolateZ=function(t,e,i,r){var s=e.x,o=e.y,a=i.x-s,h=r.x-s,u=i.y-o,c=r.y-o,l=a*c-h*u,d=t.x-s,g=t.y-o,p=(c*d-h*g)/l,_=(-u*d+a*g)/l,w=e.z+p*(i.z-e.z)+_*(r.z-e.z);return w},Jt.longestSideLength=function(t,e,i){var r=t.distance(e),s=e.distance(i),o=i.distance(t),a=r;return s>a&&(a=s),o>a&&(a=o),a},Jt.isAcute=function(t,e,i){return!(!Bt.isAcute(t,e,i)||!Bt.isAcute(e,i,t)||!Bt.isAcute(i,t,e))},Jt.circumcentre=function(t,e,i){var r=i.x,s=i.y,o=t.x-r,a=t.y-s,h=e.x-r,u=e.y-s,c=2*Jt.det(o,a,h,u),l=Jt.det(a,o*o+a*a,u,h*h+u*u),d=Jt.det(o,o*o+a*a,h,h*h+u*u),g=r-l/c,p=s+d/c;return new L(g,p)},Jt.perpendicularBisector=function(t,e){var i=e.x-t.x,r=e.y-t.y,s=new Cn(t.x+i/2,t.y+r/2,1),o=new Cn(t.x-r+i/2,t.y+i+r/2,1);return new Cn(s,o)},Jt.angleBisector=function(t,e,i){var r=e.distance(t),s=e.distance(i),o=r/(r+s),a=i.x-t.x,h=i.y-t.y,u=new L(t.x+o*a,t.y+o*h);return u},Jt.area3D=function(t,e,i){var r=e.x-t.x,s=e.y-t.y,o=e.z-t.z,a=i.x-t.x,h=i.y-t.y,u=i.z-t.z,c=s*u-o*h,l=o*a-r*u,d=r*h-s*a,g=c*c+l*l+d*d,p=Math.sqrt(g)/2;return p},Jt.centroid=function(t,e,i){var r=(t.x+e.x+i.x)/3,s=(t.y+e.y+i.y)/3;return new L(r,s)},Jt.inCentre=function(t,e,i){var r=e.distance(i),s=t.distance(i),o=t.distance(e),a=r+s+o,h=(r*t.x+s*e.x+o*i.x)/a,u=(r*t.y+s*e.y+o*i.y)/a;return new L(h,u)};var gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Z;var t=arguments[0],e=arguments[1],i=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=i};gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,V.EXTERIOR,V.INTERIOR)},gn.prototype.addPolygon=function(t){var e=this,i=this._distance,r=K.LEFT;this._distance<0&&(i=-this._distance,r=K.RIGHT);var s=t.getExteriorRing(),o=Lt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,i,r,V.EXTERIOR,V.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var h=t.getInteriorRingN(a),u=Lt.removeRepeatedPoints(h.getCoordinates());e._distance>0&&e.isErodedCompletely(h,-e._distance)||e.addPolygonRing(u,i,K.opposite(r),V.INTERIOR,V.EXTERIOR)}},gn.prototype.isTriangleErodedCompletely=function(t,e){var i=new Jt(t[0],t[1],t[2]),r=i.inCentre(),s=et.distancePointLine(r,i.p0,i.p1);return s<Math.abs(e)},gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Lt.removeRepeatedPoints(t.getCoordinates()),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,V.EXTERIOR,V.INTERIOR)},gn.prototype.addCurve=function(t,e,i){if(t===null||t.length<2)return null;var r=new Se(t,new Kt(0,V.BOUNDARY,e,i));this._curveList.add(r)},gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},gn.prototype.addPolygonRing=function(t,e,i,r,s){if(e===0&&t.length<wr.MINIMUM_VALID_SIZE)return null;var o=r,a=s;t.length>=wr.MINIMUM_VALID_SIZE&&et.isCCW(t)&&(o=s,a=r,i=K.opposite(i));var h=this._curveBuilder.getRingCurve(t,i,e);this.addCurve(h,o,a)},gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof De?this.addPolygon(t):t instanceof ve?this.addLineString(t):t instanceof Ai?this.addPoint(t):t instanceof yh?this.addCollection(t):t instanceof go?this.addCollection(t):t instanceof Er?this.addCollection(t):t instanceof ui&&this.addCollection(t)},gn.prototype.isErodedCompletely=function(t,e){var i=t.getCoordinates();if(i.length<4)return e<0;if(i.length===4)return this.isTriangleErodedCompletely(i,e);var r=t.getEnvelopeInternal(),s=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>s},gn.prototype.addCollection=function(t){for(var e=this,i=0;i<t.getNumGeometries();i++){var r=t.getGeometryN(i);e.add(r)}},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var Ch=function(){};Ch.prototype.locate=function(t){},Ch.prototype.interfaces_=function(){return[]},Ch.prototype.getClass=function(){return Ch};var Pr=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()};Pr.prototype.next=function(){if(this._atStart)return this._atStart=!1,Pr.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 mh;var t=this._parent.getGeometryN(this._index++);return t instanceof ui?(this._subcollectionIterator=new Pr(t),this._subcollectionIterator.next()):t},Pr.prototype.remove=function(){throw new Error(this.getClass().getName())},Pr.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)},Pr.prototype.interfaces_=function(){return[vh]},Pr.prototype.getClass=function(){return Pr},Pr.isAtomic=function(t){return!(t instanceof ui)};var Ki=function(){this._geom=null;var t=arguments[0];this._geom=t};Ki.prototype.locate=function(t){return Ki.locate(t,this._geom)},Ki.prototype.interfaces_=function(){return[Ch]},Ki.prototype.getClass=function(){return Ki},Ki.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?et.isPointInRing(t,e.getCoordinates()):!1},Ki.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var i=e.getExteriorRing();if(!Ki.isPointInRing(t,i))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var s=e.getInteriorRingN(r);if(Ki.isPointInRing(t,s))return!1}return!0},Ki.containsPoint=function(t,e){if(e instanceof De)return Ki.containsPointInPolygon(t,e);if(e instanceof ui)for(var i=new Pr(e);i.hasNext();){var r=i.next();if(r!==e&&Ki.containsPoint(t,r))return!0}return!1},Ki.locate=function(t,e){return e.isEmpty()?V.EXTERIOR:Ki.containsPoint(t,e)?V.INTERIOR:V.EXTERIOR};var ri=function(){this._edgeMap=new ii,this._edgeList=null,this._ptInAreaLocation=[V.NONE,V.NONE]};ri.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),i=e-1;return e===0&&(i=this._edgeList.size()-1),this._edgeList.get(i)},ri.prototype.propagateSideLabels=function(t){for(var e=V.NONE,i=this.iterator();i.hasNext();){var r=i.next(),s=r.getLabel();s.isArea(t)&&s.getLocation(t,K.LEFT)!==V.NONE&&(e=s.getLocation(t,K.LEFT))}if(e===V.NONE)return null;for(var o=e,a=this.iterator();a.hasNext();){var h=a.next(),u=h.getLabel();if(u.getLocation(t,K.ON)===V.NONE&&u.setLocation(t,K.ON,o),u.isArea(t)){var c=u.getLocation(t,K.LEFT),l=u.getLocation(t,K.RIGHT);if(l!==V.NONE){if(l!==o)throw new is("side location conflict",h.getCoordinate());c===V.NONE&&Nt.shouldNeverReachHere("found single null side (at "+h.getCoordinate()+")"),o=c}else Nt.isTrue(u.getLocation(t,K.LEFT)===V.NONE,"found single null side"),u.setLocation(t,K.RIGHT,o),u.setLocation(t,K.LEFT,o)}}},ri.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},ri.prototype.print=function(t){We.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},ri.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ri.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var i=e.size()-1,r=e.get(i).getLabel(),s=r.getLocation(t,K.LEFT);Nt.isTrue(s!==V.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var h=a.next(),u=h.getLabel();Nt.isTrue(u.isArea(t),"Found non-area edge");var c=u.getLocation(t,K.LEFT),l=u.getLocation(t,K.RIGHT);if(c===l||l!==o)return!1;o=c}return!0},ri.prototype.findIndex=function(t){var e=this;this.iterator();for(var i=0;i<this._edgeList.size();i++){var r=e._edgeList.get(i);if(r===t)return i}return-1},ri.prototype.iterator=function(){return this.getEdges().iterator()},ri.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Z(this._edgeMap.values())),this._edgeList},ri.prototype.getLocation=function(t,e,i){return this._ptInAreaLocation[t]===V.NONE&&(this._ptInAreaLocation[t]=Ki.locate(e,i[t].getGeometry())),this._ptInAreaLocation[t]},ri.prototype.toString=function(){var t=new Vn;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
67
67
  `);for(var e=this.iterator();e.hasNext();){var i=e.next();t.append(i),t.append(`
68
68
  `)}return t.toString()},ri.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();i.computeLabel(t)}},ri.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var i=[!1,!1],r=this.iterator();r.hasNext();)for(var s=r.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===V.BOUNDARY&&(i[a]=!0);for(var h=this.iterator();h.hasNext();)for(var u=h.next(),c=u.getLabel(),l=0;l<2;l++)if(c.isAnyNull(l)){var d=V.NONE;if(i[l])d=V.EXTERIOR;else{var g=u.getCoordinate();d=e.getLocation(l,g,t)}c.setAllLocationsIfNull(l,d)}},ri.prototype.getDegree=function(){return this._edgeMap.size()},ri.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri};var zM=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 i=this;this.getResultAreaEdges();for(var r=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var h=i._resultAreaEdgeList.get(a),u=h.getSym();if(h.getLabel().isArea())switch(r===null&&h.isInResult()&&(r=h),o){case i._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;s=u,o=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(!h.isInResult())continue;s.setNext(h),o=i._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(r===null)throw new is("no outgoing dirEdge found",this.getCoordinate());Nt.isTrue(r.isInResult(),"unable to link last incoming dirEdge"),s.setNext(r)}},t.prototype.insert=function(i){var r=i;this.insertEdgeEnd(r,r)},t.prototype.getRightmostEdge=function(){var i=this.getEdges(),r=i.size();if(r<1)return null;var s=i.get(0);if(r===1)return s;var o=i.get(r-1),a=s.getQuadrant(),h=o.getQuadrant();return Qt.isNorthern(a)&&Qt.isNorthern(h)?s:!Qt.isNorthern(a)&&!Qt.isNorthern(h)?o:s.getDy()!==0?s:o.getDy()!==0?o:(Nt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(i){We.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();){var s=r.next();i.print("out "),s.print(i),i.println(),i.print("in "),s.getSym().print(i),i.println()}},t.prototype.getResultAreaEdges=function(){var i=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Z;for(var r=this.iterator();r.hasNext();){var s=r.next();(s.isInResult()||s.getSym().isInResult())&&i._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(i){for(var r=this.iterator();r.hasNext();){var s=r.next(),o=s.getLabel();o.setAllLocationsIfNull(0,i.getLocation(0)),o.setAllLocationsIfNull(1,i.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var i=this;this.getEdges();for(var r=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=i._edgeList.get(o),h=a.getSym();s===null&&(s=h),r!==null&&h.setNext(r),r=a}s.setNext(r)},t.prototype.computeDepths=function(){var i=this;if(arguments.length===1){var r=arguments[0],s=this.findIndex(r),o=r.getDepth(K.LEFT),a=r.getDepth(K.RIGHT),h=this.computeDepths(s+1,this._edgeList.size(),o),u=this.computeDepths(0,s,h);if(u!==a)throw new is("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],l=arguments[1],d=arguments[2],g=d,p=c;p<l;p++){var _=i._edgeList.get(p);_.setEdgeDepths(K.RIGHT,g),g=_.getDepth(K.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var i=this.iterator();i.hasNext();){var r=i.next(),s=r.getLabel();s.merge(r.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(i){for(var r=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,h=this._resultAreaEdgeList.size()-1;h>=0;h--){var u=r._resultAreaEdgeList.get(h),c=u.getSym();switch(s===null&&u.getEdgeRing()===i&&(s=u),a){case r._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==i)continue;o=c,a=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==i)continue;o.setNextMin(u),a=r._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(Nt.isTrue(s!==null,"found null for first outgoing dirEdge"),Nt.isTrue(s.getEdgeRing()===i,"unable to link last incoming dirEdge"),o.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var i=0,r=this.iterator();r.hasNext();){var s=r.next();s.isInResult()&&i++}return i}else if(arguments.length===1){for(var o=arguments[0],a=0,h=this.iterator();h.hasNext();){var u=h.next();u.getEdgeRing()===o&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var i=V.NONE,r=this.iterator();r.hasNext();){var s=r.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){i=V.INTERIOR;break}if(o.isInResult()){i=V.EXTERIOR;break}}}if(i===V.NONE)return null;for(var a=i,h=this.iterator();h.hasNext();){var u=h.next(),c=u.getSym();u.isLineEdge()?u.getEdge().setCovered(a===V.INTERIOR):(u.isInResult()&&(a=V.EXTERIOR),c.isInResult()&&(a=V.INTERIOR))}},t.prototype.computeLabelling=function(i){var r=this;n.prototype.computeLabelling.call(this,i),this._label=new Kt(V.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),h=a.getLabel(),u=0;u<2;u++){var c=h.getLocation(u);(c===V.INTERIOR||c===V.BOUNDARY)&&r._label.setLocation(u,V.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ri),Py=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(i){return new Zc(i,new zM)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wh),Ds=function n(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=n.orientation(t)};Ds.prototype.compareTo=function(t){var e=t,i=Ds.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return i},Ds.prototype.interfaces_=function(){return[hn]},Ds.prototype.getClass=function(){return Ds},Ds.orientation=function(t){return Lt.increasingDirection(t)===1},Ds.compareOriented=function(t,e,i,r){for(var s=e?1:-1,o=r?1:-1,a=e?t.length:-1,h=r?i.length:-1,u=e?0:t.length-1,c=r?0:i.length-1;;){var l=t[u].compareTo(i[c]);if(l!==0)return l;u+=s,c+=o;var d=u===a,g=c===h;if(d&&!g)return-1;if(!d&&g)return 1;if(d&&g)return 0}};var Nn=function(){this._edges=new Z,this._ocaMap=new ii};Nn.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var i=0;i<this._edges.size();i++){var r=e._edges.get(i);i>0&&t.print(","),t.print("(");for(var s=r.getCoordinates(),o=0;o<s.length;o++)o>0&&t.print(","),t.print(s[o].x+" "+s[o].y);t.println(")")}t.print(") ")},Nn.prototype.addAll=function(t){for(var e=this,i=t.iterator();i.hasNext();)e.add(i.next())},Nn.prototype.findEdgeIndex=function(t){for(var e=this,i=0;i<this._edges.size();i++)if(e._edges.get(i).equals(t))return i;return-1},Nn.prototype.iterator=function(){return this._edges.iterator()},Nn.prototype.getEdges=function(){return this._edges},Nn.prototype.get=function(t){return this._edges.get(t)},Nn.prototype.findEqualEdge=function(t){var e=new Ds(t.getCoordinates()),i=this._ocaMap.get(e);return i},Nn.prototype.add=function(t){this._edges.add(t);var e=new Ds(t.getCoordinates());this._ocaMap.put(e,t)},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn};var mo=function(){};mo.prototype.processIntersections=function(t,e,i,r){},mo.prototype.isDone=function(){},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo};var Qi=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};Qi.prototype.isTrivialIntersection=function(t,e,i,r){if(t===i&&this._li.getIntersectionNum()===1){if(Qi.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.size()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1},Qi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Qi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Qi.prototype.getLineIntersector=function(){return this._li},Qi.prototype.hasProperIntersection=function(){return this._hasProper},Qi.prototype.processIntersections=function(t,e,i,r){if(t===i&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=i.getCoordinates()[r],h=i.getCoordinates()[r+1];this._li.computeIntersection(s,o,a,h),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,i,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),i.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Qi.prototype.hasIntersection=function(){return this._hasIntersection},Qi.prototype.isDone=function(){return!1},Qi.prototype.hasInteriorIntersection=function(){return this._hasInterior},Qi.prototype.interfaces_=function(){return[mo]},Qi.prototype.getClass=function(){return Qi},Qi.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Qn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],i=arguments[2];this.coord=new L(t),this.segmentIndex=e,this.dist=i};Qn.prototype.getSegmentIndex=function(){return this.segmentIndex},Qn.prototype.getCoordinate=function(){return this.coord},Qn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Qn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Qn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},Qn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Qn.prototype.getDistance=function(){return this.dist},Qn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Qn.prototype.interfaces_=function(){return[hn]},Qn.prototype.getClass=function(){return Qn};var br=function(){this._nodeMap=new ii,this.edge=null;var t=arguments[0];this.edge=t};br.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var i=e.next();i.print(t)}},br.prototype.iterator=function(){return this._nodeMap.values().iterator()},br.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var i=this.iterator(),r=i.next();i.hasNext();){var s=i.next(),o=e.createSplitEdge(r,s);t.add(o),r=s}},br.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)},br.prototype.createSplitEdge=function(t,e){var i=this,r=e.segmentIndex-t.segmentIndex+2,s=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(s);o||r--;var a=new Array(r).fill(null),h=0;a[h++]=new L(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)a[h++]=i.edge.pts[u];return o&&(a[h]=e.coord),new ed(a,new Kt(this.edge._label))},br.prototype.add=function(t,e,i){var r=new Qn(t,e,i),s=this._nodeMap.get(r);return s!==null?s:(this._nodeMap.put(r,r),r)},br.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next();if(i.coord.equals(t))return!0}return!1},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br};var _o=function(){};_o.prototype.getChainStartIndices=function(t){var e=this,i=0,r=new Z;r.add(new zn(i));do{var s=e.findChainEnd(t,i);r.add(new zn(s)),i=s}while(i<t.length-1);var o=_o.toIntArray(r);return o},_o.prototype.findChainEnd=function(t,e){for(var i=Qt.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){var s=Qt.quadrant(t[r-1],t[r]);if(s!==i)break;r++}return r-1},_o.prototype.interfaces_=function(){return[]},_o.prototype.getClass=function(){return _o},_o.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var ss=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ct,this.env2=new ct;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new _o;this.startIndex=e.getChainStartIndices(this.pts)};ss.prototype.getCoordinates=function(){return this.pts},ss.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e>i?e:i},ss.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e<i?e:i},ss.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[i],e.startIndex[i+1],r)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],h=arguments[3],u=arguments[4],c=arguments[5],l=this.pts[s],d=this.pts[o],g=a.pts[h],p=a.pts[u];if(o-s===1&&u-h===1)return c.addIntersections(this.e,s,a.e,h),null;if(this.env1.init(l,d),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var _=Math.trunc((s+o)/2),w=Math.trunc((h+u)/2);s<_&&(h<w&&this.computeIntersectsForChain(s,_,a,h,w,c),w<u&&this.computeIntersectsForChain(s,_,a,w,u,c)),_<o&&(h<w&&this.computeIntersectsForChain(_,o,a,h,w,c),w<u&&this.computeIntersectsForChain(_,o,a,w,u,c))}},ss.prototype.getStartIndexes=function(){return this.startIndex},ss.prototype.computeIntersects=function(t,e){for(var i=this,r=0;r<this.startIndex.length-1;r++)for(var s=0;s<t.startIndex.length-1;s++)i.computeIntersectsForChain(r,t,s,e)},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss};var He=function n(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var i=0;i<3;i++)t._depth[e][i]=n.NULL_VALUE},by={NULL_VALUE:{configurable:!0}};He.prototype.getDepth=function(t,e){return this._depth[t][e]},He.prototype.setDepth=function(t,e,i){this._depth[t][e]=i},He.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var i=0;i<3;i++)if(t._depth[e][i]!==He.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var r=arguments[0];return this._depth[r][1]===He.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===He.NULL_VALUE}},He.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var i=t._depth[e][1];t._depth[e][2]<i&&(i=t._depth[e][2]),i<0&&(i=0);for(var r=1;r<3;r++){var s=0;t._depth[e][r]>i&&(s=1),t._depth[e][r]=s}}},He.prototype.getDelta=function(t){return this._depth[t][K.RIGHT]-this._depth[t][K.LEFT]},He.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?V.EXTERIOR:V.INTERIOR},He.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},He.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],i=0;i<2;i++)for(var r=1;r<3;r++){var s=e.getLocation(i,r);(s===V.EXTERIOR||s===V.INTERIOR)&&(t.isNull(i,r)?t._depth[i][r]=He.depthAtLocation(s):t._depth[i][r]+=He.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],h=arguments[2];h===V.INTERIOR&&this._depth[o][a]++}},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He},He.depthAtLocation=function(t){return t===V.EXTERIOR?0:t===V.INTERIOR?1:He.NULL_VALUE},by.NULL_VALUE.get=function(){return-1},Object.defineProperties(He,by);var ed=function(n){function t(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new br(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new He,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var i=arguments[0],r=arguments[1];this.pts=i,this._label=r}}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 i=new Array(2).fill(null);i[0]=this.pts[0],i[1]=this.pts[1];var r=new t(i,Kt.toLineLabel(this._label));return r},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(i){this._isIsolated=i},t.prototype.setName=function(i){this._name=i},t.prototype.equals=function(i){var r=this;if(!(i instanceof t))return!1;var s=i;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,h=this.pts.length,u=0;u<this.pts.length;u++)if(r.pts[u].equals2D(s.pts[u])||(o=!1),r.pts[u].equals2D(s.pts[--h])||(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 i=arguments[0];return this.pts[i]}},t.prototype.print=function(i){var r=this;i.print("edge "+this._name+": "),i.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.print(","),i.print(r.pts[s].x+" "+r.pts[s].y);i.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(i){t.updateIM(this._label,i)},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(i){var r=this;i.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)i.print(r.pts[s]+" ");i.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new ss(this)),this._mce},t.prototype.getEnvelope=function(){var i=this;if(this._env===null){this._env=new ct;for(var r=0;r<this.pts.length;r++)i._env.expandToInclude(i.pts[r])}return this._env},t.prototype.addIntersection=function(i,r,s,o){var a=new L(i.getIntersection(o)),h=r,u=i.getEdgeDistance(s,o),c=h+1;if(c<this.pts.length){var l=this.pts[c];a.equals2D(l)&&(h=c,u=0)}this.eiList.add(a,h,u)},t.prototype.toString=function(){var i=this,r=new Vn;r.append("edge "+this._name+": "),r.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.append(","),r.append(i.pts[s].x+" "+i.pts[s].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},t.prototype.isPointwiseEqual=function(i){var r=this;if(this.pts.length!==i.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!r.pts[s].equals2D(i.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(i){this._depthDelta=i},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(i,r,s){for(var o=this,a=0;a<i.getIntersectionNum();a++)o.addIntersection(i,r,s,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];r.setAtLeastIfValid(i.getLocation(0,K.ON),i.getLocation(1,K.ON),1),i.isArea()&&(r.setAtLeastIfValid(i.getLocation(0,K.LEFT),i.getLocation(1,K.LEFT),2),r.setAtLeastIfValid(i.getLocation(0,K.RIGHT),i.getLocation(1,K.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},t}(Ji),di=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Nn,this._bufParams=t||null};di.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},di.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var i=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Kt(t.getLabel()),r.flip()),i.merge(r);var s=di.depthDelta(r),o=e.getDepthDelta(),a=o+s;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(di.depthDelta(t.getLabel()))},di.prototype.buildSubgraphs=function(t,e){for(var i=new Z,r=t.iterator();r.hasNext();){var s=r.next(),o=s.getRightmostCoordinate(),a=new ra(i),h=a.getDepth(o);s.computeDepth(h),s.findResultEdges(),i.add(s),e.add(s.getDirectedEdges(),s.getNodes())}},di.prototype.createSubgraphs=function(t){for(var e=new Z,i=t.getNodes().iterator();i.hasNext();){var r=i.next();if(!r.isVisited()){var s=new li;s.create(r),e.add(s)}}return Tn.sort(e,Tn.reverseOrder()),e},di.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},di.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Bg,i=new lo;return i.setPrecisionModel(t),e.setSegmentIntersector(new Qi(i)),e},di.prototype.buffer=function(t,e){var i=this._workingPrecisionModel;i===null&&(i=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Si(i,this._bufParams),s=new gn(t,e,r),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,i),this._graph=new pe(new Py),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),h=new Ri(this._geomFact);this.buildSubgraphs(a,h);var u=h.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(u);return c},di.prototype.computeNodedEdges=function(t,e){var i=this,r=this.getNoder(e);r.computeNodes(t);for(var s=r.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),h=a.getCoordinates();if(!(h.length===2&&h[0].equals2D(h[1]))){var u=a.getData(),c=new ed(a.getCoordinates(),new Kt(u));i.insertUniqueEdge(c)}}},di.prototype.setNoder=function(t){this._workingNoder=t},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.depthDelta=function(t){var e=t.getLocation(0,K.LEFT),i=t.getLocation(0,K.RIGHT);return e===V.INTERIOR&&i===V.EXTERIOR?1:e===V.EXTERIOR&&i===V.INTERIOR?-1:0},di.convertSegStrings=function(t){for(var e=new Ft,i=new Z;t.hasNext();){var r=t.next(),s=e.createLineString(r.getCoordinates());i.add(s)}return e.buildGeometry(i)};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 i=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3];this._noder=i,this._scaleFactor=r,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};As.prototype.rescale=function(){var t=this;if(wt(arguments[0],Oe))for(var e=arguments[0],i=e.iterator();i.hasNext();){var r=i.next();t.rescale(r.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])&&We.out.println(s)}},As.prototype.scale=function(){var t=this;if(wt(arguments[0],Oe)){for(var e=arguments[0],i=new Z,r=e.iterator();r.hasNext();){var s=r.next();i.add(new Se(t.scale(s.getCoordinates()),s.getData()))}return i}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),h=0;h<o.length;h++)a[h]=new L(Math.round((o[h].x-t._offsetX)*t._scaleFactor),Math.round((o[h].y-t._offsetY)*t._scaleFactor),o[h].z);var u=Lt.removeRepeatedPoints(a);return u}},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[po]},As.prototype.getClass=function(){return As};var Zn=function(){this._li=new lo,this._segStrings=null;var t=arguments[0];this._segStrings=t},Iy={fact:{configurable:!0}};Zn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next(),r=i.getCoordinates();t.checkEndPtVertexIntersections(r[0],t._segStrings),t.checkEndPtVertexIntersections(r[r.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var h=a.next(),u=h.getCoordinates(),c=1;c<u.length-1;c++)if(u[c].equals(s))throw new $r("found endpt/interior pt intersection at index "+c+" :pt "+s)}},Zn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var i=e.next(),r=this._segStrings.iterator();r.hasNext();){var s=r.next();t.checkInteriorIntersections(i,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],h=o.getCoordinates(),u=a.getCoordinates(),c=0;c<h.length-1;c++)for(var l=0;l<u.length-1;l++)t.checkInteriorIntersections(o,c,a,l);else if(arguments.length===4){var d=arguments[0],g=arguments[1],p=arguments[2],_=arguments[3];if(d===p&&g===_)return null;var w=d.getCoordinates()[g],P=d.getCoordinates()[g+1],v=p.getCoordinates()[_],E=p.getCoordinates()[_+1];if(this._li.computeIntersection(w,P,v,E),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,w,P)||this.hasInteriorIntersection(this._li,v,E)))throw new $r("found non-noded intersection at "+w+"-"+P+" and "+v+"-"+E)}},Zn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Zn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next();t.checkCollapses(i)}else if(arguments.length===1)for(var r=arguments[0],s=r.getCoordinates(),o=0;o<s.length-2;o++)t.checkCollapse(s[o],s[o+1],s[o+2])},Zn.prototype.hasInteriorIntersection=function(t,e,i){for(var r=0;r<t.getIntersectionNum();r++){var s=t.getIntersection(r);if(!(s.equals(e)||s.equals(i)))return!0}return!1},Zn.prototype.checkCollapse=function(t,e,i){if(t.equals(i))throw new $r("found non-noded collapse at "+Zn.fact.createLineString([t,e,i]))},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Iy.fact.get=function(){return new Ft},Object.defineProperties(Zn,Iy);var Ci=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],i=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=i,e<=0)throw new ce("Scale factor must be non-zero");e!==1&&(this._pt=new L(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new L,this._p1Scaled=new L),this.initCorners(this._pt)},xy={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Ci.prototype.intersectsScaled=function(t,e){var i=Math.min(t.x,e.x),r=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<i||this._minx>r||this._maxy<s||this._miny>o;if(a)return!1;var h=this.intersectsToleranceSquare(t,e);return Nt.isTrue(!(a&&h),"Found bad envelope test"),h},Ci.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 L(this._maxx,this._maxy),this._corner[1]=new L(this._minx,this._maxy),this._corner[2]=new L(this._minx,this._miny),this._corner[3]=new L(this._maxx,this._miny)},Ci.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))},Ci.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},Ci.prototype.getCoordinate=function(){return this._originalPt},Ci.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},Ci.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Ci.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ct(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},Ci.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()))},Ci.prototype.intersectsToleranceSquare=function(t,e){var i=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||i&&r||t.equals(this._pt)||e.equals(this._pt))},Ci.prototype.addSnappedNode=function(t,e){var i=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(i,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci},xy.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Ci,xy);var bl=function(){this.tempEnv1=new ct,this.selectedSegment=new dt};bl.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)}}},bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl};var Ph=function(){this._index=null;var t=arguments[0];this._index=t},My={HotPixelSnapAction:{configurable:!0}};Ph.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],i=arguments[1],r=arguments[2],s=e.getSafeEnvelope(),o=new Ty(e,i,r);return this._index.query(s,{interfaces_:function(){return[Ns]},visitItem:function(a){var h=a;h.select(s,o)}}),o.isNodeAdded()}},Ph.prototype.interfaces_=function(){return[]},Ph.prototype.getClass=function(){return Ph},My.HotPixelSnapAction.get=function(){return Ty},Object.defineProperties(Ph,My);var Ty=function(n){function t(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],i=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=i,this._hotPixelVertexIndex=r}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 i=arguments[0],r=arguments[1],s=i.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,r)}else return n.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(bl),sa=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Z};sa.prototype.processIntersections=function(t,e,i,r){var s=this;if(t===i&&e===r)return null;var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],h=i.getCoordinates()[r],u=i.getCoordinates()[r+1];if(this._li.computeIntersection(o,a,h,u),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),i.addIntersections(this._li,r,1)}},sa.prototype.isDone=function(){return!1},sa.prototype.getInteriorIntersections=function(){return this._interiorIntersections},sa.prototype.interfaces_=function(){return[mo]},sa.prototype.getClass=function(){return sa};var Ir=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 lo,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Ir.prototype.checkCorrectness=function(t){var e=Se.getNodedSubstrings(t),i=new Zn(e);try{i.checkValid()}catch(r){if(r instanceof hy)r.printStackTrace();else throw r}finally{}},Ir.prototype.getNodedSubstrings=function(){return Se.getNodedSubstrings(this._nodedSegStrings)},Ir.prototype.snapRound=function(t,e){var i=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(i),this.computeVertexSnaps(t)},Ir.prototype.findInteriorIntersections=function(t,e){var i=new sa(e);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(t),i.getInteriorIntersections()},Ir.prototype.computeVertexSnaps=function(){var t=this;if(wt(arguments[0],Oe))for(var e=arguments[0],i=e.iterator();i.hasNext();){var r=i.next();t.computeVertexSnaps(r)}else if(arguments[0]instanceof Se)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var h=new Ci(o[a],t._scaleFactor,t._li),u=t._pointSnapper.snap(h,s,a);u&&s.addIntersection(o[a],a)}},Ir.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Bg,this._pointSnapper=new Ph(this._noder.getIndex()),this.snapRound(t,this._li)},Ir.prototype.computeIntersectionSnaps=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next(),s=new Ci(r,e._scaleFactor,e._li);e._pointSnapper.snap(s)}},Ir.prototype.interfaces_=function(){return[po]},Ir.prototype.getClass=function(){return Ir};var Xe=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Yt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._argGeom=e,this._bufParams=i}},bh={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Xe.prototype.bufferFixedPrecision=function(t){var e=new As(new Ir(new Xt(1)),t.getScale()),i=new di(this._bufParams);i.setWorkingPrecisionModel(t),i.setNoder(e),this._resultGeometry=i.buffer(this._argGeom,this._distance)},Xe.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Xe.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof is)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var i=arguments[0],r=Xe.precisionScaleFactor(this._argGeom,this._distance,i),s=new Xt(r);this.bufferFixedPrecision(s)}},Xe.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Xt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Xe.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Xe.prototype.bufferOriginalPrecision=function(){try{var t=new di(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof $r)this._saveException=e;else throw e}finally{}},Xe.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Xe.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Xe.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new Xe(t),r=i.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof yt&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],h=new Xe(s);h.setQuadrantSegments(a);var u=h.getResultGeometry(o);return u}else if(arguments[2]instanceof Yt&&arguments[0]instanceof yt&&typeof arguments[1]=="number"){var c=arguments[0],l=arguments[1],d=arguments[2],g=new Xe(c,d),p=g.getResultGeometry(l);return p}}else if(arguments.length===4){var _=arguments[0],w=arguments[1],P=arguments[2],v=arguments[3],E=new Xe(_);E.setQuadrantSegments(P),E.setEndCapStyle(v);var m=E.getResultGeometry(w);return m}},Xe.precisionScaleFactor=function(t,e,i){var r=t.getEnvelopeInternal(),s=Yi.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),o=e>0?e:0,a=s+2*o,h=Math.trunc(Math.log(a)/Math.log(10)+1),u=i-h,c=Math.pow(10,u);return c},bh.CAP_ROUND.get=function(){return Yt.CAP_ROUND},bh.CAP_BUTT.get=function(){return Yt.CAP_FLAT},bh.CAP_FLAT.get=function(){return Yt.CAP_FLAT},bh.CAP_SQUARE.get=function(){return Yt.CAP_SQUARE},bh.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Xe,bh);var fi=function(){this._pt=[new L,new L],this._distance=Pt.NaN,this._isNull=!0};fi.prototype.getCoordinates=function(){return this._pt},fi.prototype.getCoordinate=function(t){return this._pt[t]},fi.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r<this._distance&&this.initialize(e,i,r)}},fi.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(r),this._distance=s,this._isNull=!1}},fi.prototype.getDistance=function(){return this._distance},fi.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r>this._distance&&this.initialize(e,i,r)}},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi};var xr=function(){};xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},xr.computeDistance=function(){if(arguments[2]instanceof fi&&arguments[0]instanceof ve&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],i=arguments[2],r=t.getCoordinates(),s=new dt,o=0;o<r.length-1;o++){s.setCoordinates(r[o],r[o+1]);var a=s.closestPoint(e);i.setMinimum(a,e)}else if(arguments[2]instanceof fi&&arguments[0]instanceof De&&arguments[1]instanceof L){var h=arguments[0],u=arguments[1],c=arguments[2];xr.computeDistance(h.getExteriorRing(),u,c);for(var l=0;l<h.getNumInteriorRing();l++)xr.computeDistance(h.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof fi&&arguments[0]instanceof yt&&arguments[1]instanceof L){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ve)xr.computeDistance(d,g,p);else if(d instanceof De)xr.computeDistance(d,g,p);else if(d instanceof ui)for(var _=d,w=0;w<_.getNumGeometries();w++){var P=_.getGeometryN(w);xr.computeDistance(P,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof fi&&arguments[0]instanceof dt&&arguments[1]instanceof L){var v=arguments[0],E=arguments[1],m=arguments[2],S=v.closestPoint(E);m.setMinimum(S,E)}};var yo=function(t){this._maxPtDist=new fi,this._inputGeom=t||null},Vg={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};yo.prototype.computeMaxMidpointDistance=function(t){var e=new Rs(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},yo.prototype.computeMaxVertexDistance=function(t){var e=new oa(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},yo.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},yo.prototype.getDistancePoints=function(){return this._maxPtDist},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo},Vg.MaxPointDistanceFilter.get=function(){return oa},Vg.MaxMidpointDistanceFilter.get=function(){return Rs},Object.defineProperties(yo,Vg);var oa=function(t){this._maxPtDist=new fi,this._minPtDist=new fi,this._geom=t||null};oa.prototype.filter=function(t){this._minPtDist.initialize(),xr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},oa.prototype.getMaxPointDistance=function(){return this._maxPtDist},oa.prototype.interfaces_=function(){return[yr]},oa.prototype.getClass=function(){return oa};var Rs=function(t){this._maxPtDist=new fi,this._minPtDist=new fi,this._geom=t||null};Rs.prototype.filter=function(t,e){if(e===0)return null;var i=t.getCoordinate(e-1),r=t.getCoordinate(e),s=new L((i.x+r.x)/2,(i.y+r.y)/2);this._minPtDist.initialize(),xr.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Rs.prototype.isDone=function(){return!1},Rs.prototype.isGeometryChanged=function(){return!1},Rs.prototype.getMaxPointDistance=function(){return this._maxPtDist},Rs.prototype.interfaces_=function(){return[xn]},Rs.prototype.getClass=function(){return Rs};var os=function(t){this._comps=t||null};os.prototype.filter=function(t){t instanceof De&&this._comps.add(t)},os.prototype.interfaces_=function(){return[Wn]},os.prototype.getClass=function(){return os},os.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return os.getPolygons(t,new Z)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof De?i.add(e):e instanceof ui&&e.apply(new os(i)),i}};var Ye=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],i=arguments[1];this._lines=e,this._isForcedToLineString=i}};Ye.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof wr){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof ve&&this._lines.add(t)},Ye.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ye.prototype.interfaces_=function(){return[Kr]},Ye.prototype.getClass=function(){return Ye},Ye.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Ye.getLines(t))}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e.getFactory().buildGeometry(Ye.getLines(e,i))}},Ye.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ye.getLines(t,!1)}else if(arguments.length===2){if(wt(arguments[0],Oe)&&wt(arguments[1],Oe)){for(var e=arguments[0],i=arguments[1],r=e.iterator();r.hasNext();){var s=r.next();Ye.getLines(s,i)}return i}else if(arguments[0]instanceof yt&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],h=new Z;return o.apply(new Ye(h,a)),h}else if(arguments[0]instanceof yt&&wt(arguments[1],Oe)){var u=arguments[0],c=arguments[1];return u instanceof ve?c.add(u):u.apply(new Ye(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&wt(arguments[0],Oe)&&wt(arguments[1],Oe)){for(var l=arguments[0],d=arguments[1],g=arguments[2],p=l.iterator();p.hasNext();){var _=p.next();Ye.getLines(_,d,g)}return d}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof yt&&wt(arguments[1],Oe)){var w=arguments[0],P=arguments[1],v=arguments[2];return w.apply(new Ye(P,v)),P}}};var On=function(){if(this._boundaryRule=ln.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 ce("Rule must be non-null");this._boundaryRule=t}}};On.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof L&&arguments[1]instanceof De){var e=arguments[0],i=arguments[1];if(i.isEmpty())return V.EXTERIOR;var r=i.getExteriorRing(),s=this.locateInPolygonRing(e,r);if(s===V.EXTERIOR)return V.EXTERIOR;if(s===V.BOUNDARY)return V.BOUNDARY;for(var o=0;o<i.getNumInteriorRing();o++){var a=i.getInteriorRingN(o),h=t.locateInPolygonRing(e,a);if(h===V.INTERIOR)return V.EXTERIOR;if(h===V.BOUNDARY)return V.BOUNDARY}return V.INTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof ve){var u=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(u))return V.EXTERIOR;var l=c.getCoordinates();return!c.isClosed()&&(u.equals(l[0])||u.equals(l[l.length-1]))?V.BOUNDARY:et.isOnLine(u,l)?V.INTERIOR:V.EXTERIOR}else if(arguments[0]instanceof L&&arguments[1]instanceof Ai){var d=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(d)?V.INTERIOR:V.EXTERIOR}},On.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?et.locatePointInRing(t,e.getCoordinates()):V.EXTERIOR},On.prototype.intersects=function(t,e){return this.locate(t,e)!==V.EXTERIOR},On.prototype.updateLocationInfo=function(t){t===V.INTERIOR&&(this._isIn=!0),t===V.BOUNDARY&&this._numBoundaries++},On.prototype.computeLocation=function(t,e){var i=this;if(e instanceof Ai&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof ve)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof De)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof go)for(var r=e,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);i.updateLocationInfo(i.locateInternal(t,o))}else if(e instanceof Er)for(var a=e,h=0;h<a.getNumGeometries();h++){var u=a.getGeometryN(h);i.updateLocationInfo(i.locateInternal(t,u))}else if(e instanceof ui)for(var c=new Pr(e);c.hasNext();){var l=c.next();l!==e&&i.computeLocation(t,l)}},On.prototype.locate=function(t,e){return e.isEmpty()?V.EXTERIOR:e instanceof ve?this.locateInternal(t,e):e instanceof De?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?V.BOUNDARY:this._numBoundaries>0||this._isIn?V.INTERIOR:V.EXTERIOR)},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On};var gi=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 i=arguments[0],r=arguments[1],s=arguments[2];this._component=i,this._segIndex=r,this._pt=s}},Ny={INSIDE_AREA:{configurable:!0}};gi.prototype.isInsideArea=function(){return this._segIndex===gi.INSIDE_AREA},gi.prototype.getCoordinate=function(){return this._pt},gi.prototype.getGeometryComponent=function(){return this._component},gi.prototype.getSegmentIndex=function(){return this._segIndex},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},Ny.INSIDE_AREA.get=function(){return-1},Object.defineProperties(gi,Ny);var Ls=function(t){this._pts=t||null};Ls.prototype.filter=function(t){t instanceof Ai&&this._pts.add(t)},Ls.prototype.interfaces_=function(){return[Wn]},Ls.prototype.getClass=function(){return Ls},Ls.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Ai?Tn.singletonList(t):Ls.getPoints(t,new Z)}else if(arguments.length===2){var e=arguments[0],i=arguments[1];return e instanceof Ai?i.add(e):e instanceof ui&&e.apply(new Ls(i)),i}};var aa=function(){this._locations=null;var t=arguments[0];this._locations=t};aa.prototype.filter=function(t){(t instanceof Ai||t instanceof ve||t instanceof De)&&this._locations.add(new gi(t,0,t.getCoordinate()))},aa.prototype.interfaces_=function(){return[Wn]},aa.prototype.getClass=function(){return aa},aa.getLocations=function(t){var e=new Z;return t.apply(new aa(e)),e};var Je=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new On,this._minDistanceLocation=null,this._minDistance=Pt.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=r,this._terminateDistance=s}};Je.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 i=arguments[0],r=arguments[1],s=1-i,o=os.getPolygons(this._geom[i]);if(o.size()>0){var a=aa.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=r[0],this._minDistanceLocation[i]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&wt(arguments[0],bn)&&wt(arguments[1],bn)){for(var h=arguments[0],u=arguments[1],c=arguments[2],l=0;l<h.size();l++)for(var d=h.get(l),g=0;g<u.size();g++)if(t.computeContainmentDistance(d,u.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof gi&&arguments[1]instanceof De){var p=arguments[0],_=arguments[1],w=arguments[2],P=p.getCoordinate();if(V.EXTERIOR!==this._ptLocator.locate(P,_))return this._minDistance=0,w[0]=p,w[1]=new gi(_,P),null}}},Je.prototype.computeMinDistanceLinesPoints=function(t,e,i){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var h=e.get(a);if(r.computeMinDistance(o,h,i),r._minDistance<=r._terminateDistance)return null}},Je.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ye.getLines(this._geom[0]),i=Ye.getLines(this._geom[1]),r=Ls.getPoints(this._geom[0]),s=Ls.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,i,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(i,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(r,s,t),this.updateMinDistance(t,!1)},Je.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Je.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])},Je.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},Je.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 ve&&arguments[1]instanceof Ai){var e=arguments[0],i=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(i.getEnvelopeInternal())>this._minDistance)return null;for(var s=e.getCoordinates(),o=i.getCoordinate(),a=0;a<s.length-1;a++){var h=et.distancePointLine(o,s[a],s[a+1]);if(h<t._minDistance){t._minDistance=h;var u=new dt(s[a],s[a+1]),c=u.closestPoint(o);r[0]=new gi(e,a,c),r[1]=new gi(i,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ve&&arguments[1]instanceof ve){var l=arguments[0],d=arguments[1],g=arguments[2];if(l.getEnvelopeInternal().distance(d.getEnvelopeInternal())>this._minDistance)return null;for(var p=l.getCoordinates(),_=d.getCoordinates(),w=0;w<p.length-1;w++)for(var P=0;P<_.length-1;P++){var v=et.distanceLineLine(p[w],p[w+1],_[P],_[P+1]);if(v<t._minDistance){t._minDistance=v;var E=new dt(p[w],p[w+1]),m=new dt(_[P],_[P+1]),S=E.closestPoints(m);g[0]=new gi(l,w,S[0]),g[1]=new gi(d,P,S[1])}if(t._minDistance<=t._terminateDistance)return null}}}},Je.prototype.computeMinDistancePoints=function(t,e,i){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var h=e.get(a),u=o.getCoordinate().distance(h.getCoordinate());if(u<r._minDistance&&(r._minDistance=u,i[0]=new gi(o,0,o.getCoordinate()),i[1]=new gi(h,0,h.getCoordinate())),r._minDistance<=r._terminateDistance)return null}},Je.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ce("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Je.prototype.computeMinDistanceLines=function(t,e,i){for(var r=this,s=0;s<t.size();s++)for(var o=t.get(s),a=0;a<e.size();a++){var h=e.get(a);if(r.computeMinDistance(o,h,i),r._minDistance<=r._terminateDistance)return null}},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},Je.distance=function(t,e){var i=new Je(t,e);return i.distance()},Je.isWithinDistance=function(t,e,i){var r=new Je(t,e,i);return r.distance()<=i},Je.nearestPoints=function(t,e){var i=new Je(t,e);return i.nearestPoints()};var si=function(){this._pt=[new L,new L],this._distance=Pt.NaN,this._isNull=!0};si.prototype.getCoordinates=function(){return this._pt},si.prototype.getCoordinate=function(t){return this._pt[t]},si.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r<this._distance&&this.initialize(e,i,r)}},si.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var i=arguments[0],r=arguments[1],s=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(r),this._distance=s,this._isNull=!1}},si.prototype.toString=function(){return Pn.toLineString(this._pt[0],this._pt[1])},si.prototype.getDistance=function(){return this._distance},si.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var r=e.distance(i);r>this._distance&&this.initialize(e,i,r)}},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var tr=function(){};tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.computeDistance=function(){if(arguments[2]instanceof si&&arguments[0]instanceof ve&&arguments[1]instanceof L)for(var t=arguments[0],e=arguments[1],i=arguments[2],r=new dt,s=t.getCoordinates(),o=0;o<s.length-1;o++){r.setCoordinates(s[o],s[o+1]);var a=r.closestPoint(e);i.setMinimum(a,e)}else if(arguments[2]instanceof si&&arguments[0]instanceof De&&arguments[1]instanceof L){var h=arguments[0],u=arguments[1],c=arguments[2];tr.computeDistance(h.getExteriorRing(),u,c);for(var l=0;l<h.getNumInteriorRing();l++)tr.computeDistance(h.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof si&&arguments[0]instanceof yt&&arguments[1]instanceof L){var d=arguments[0],g=arguments[1],p=arguments[2];if(d instanceof ve)tr.computeDistance(d,g,p);else if(d instanceof De)tr.computeDistance(d,g,p);else if(d instanceof ui)for(var _=d,w=0;w<_.getNumGeometries();w++){var P=_.getGeometryN(w);tr.computeDistance(P,g,p)}else p.setMinimum(d.getCoordinate(),g)}else if(arguments[2]instanceof si&&arguments[0]instanceof dt&&arguments[1]instanceof L){var v=arguments[0],E=arguments[1],m=arguments[2],S=v.closestPoint(E);m.setMinimum(S,E)}};var pn=function(){this._g0=null,this._g1=null,this._ptDist=new si,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},zg={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};pn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},pn.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ce("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},pn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},pn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},pn.prototype.computeOrientedDistance=function(t,e,i){var r=new ha(e);if(t.apply(r),i.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var s=new Fs(e,this._densifyFrac);t.apply(s),i.setMaximum(s.getMaxPointDistance())}},pn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new pn(t,e);return i.distance()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=new pn(r,s);return a.setDensifyFraction(o),a.distance()}},zg.MaxPointDistanceFilter.get=function(){return ha},zg.MaxDensifiedByFractionDistanceFilter.get=function(){return Fs},Object.defineProperties(pn,zg);var ha=function(){this._maxPtDist=new si,this._minPtDist=new si,this._euclideanDist=new tr,this._geom=null;var t=arguments[0];this._geom=t};ha.prototype.filter=function(t){this._minPtDist.initialize(),tr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ha.prototype.getMaxPointDistance=function(){return this._maxPtDist},ha.prototype.interfaces_=function(){return[yr]},ha.prototype.getClass=function(){return ha};var Fs=function(){this._maxPtDist=new si,this._minPtDist=new si,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Fs.prototype.filter=function(t,e){var i=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),s=t.getCoordinate(e),o=(s.x-r.x)/this._numSubSegs,a=(s.y-r.y)/this._numSubSegs,h=0;h<this._numSubSegs;h++){var u=r.x+h*o,c=r.y+h*a,l=new L(u,c);i._minPtDist.initialize(),tr.computeDistance(i._geom,l,i._minPtDist),i._maxPtDist.setMaximum(i._minPtDist)}},Fs.prototype.isDone=function(){return!1},Fs.prototype.isGeometryChanged=function(){return!1},Fs.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fs.prototype.interfaces_=function(){return[xn]},Fs.prototype.getClass=function(){return Fs};var Fi=function(t,e,i){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=i||null},Ug={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fi.prototype.checkMaximumDistance=function(t,e,i){var r=new pn(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var s=r.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 "+Pn.toLineString(s[0],s[1])+")"}},Fi.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fi.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(),Fi.VERBOSE&&We.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fi.prototype.checkNegativeValid=function(){if(!(this._input instanceof De||this._input instanceof Er||this._input instanceof ui))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)},Fi.prototype.getErrorIndicator=function(){return this._errorIndicator},Fi.prototype.checkMinimumDistance=function(t,e,i){var r=new Je(t,e,i);if(this._minDistanceFound=r.distance(),this._minDistanceFound<i){this._isValid=!1;var s=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Pn.toLineString(s[0],s[1])+" )"}},Fi.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)},Fi.prototype.getErrorLocation=function(){return this._errorLocation},Fi.prototype.getPolygonLines=function(t){for(var e=new Z,i=new Ye(e),r=os.getPolygons(t),s=r.iterator();s.hasNext();){var o=s.next();o.apply(i)}return t.getFactory().buildGeometry(e)},Fi.prototype.getErrorMessage=function(){return this._errMsg},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},Ug.VERBOSE.get=function(){return!1},Ug.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Fi,Ug);var $e=function(t,e,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=i||null},jg={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};$e.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},$e.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*$e.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new ct(this._input.getEnvelopeInternal());e.expandBy(this._distance);var i=new ct(this._result.getEnvelopeInternal());i.expandBy(t),i.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},$e.prototype.checkDistance=function(){var t=new Fi(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")},$e.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")},$e.prototype.checkPolygonal=function(){this._result instanceof De||this._result instanceof Er||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},$e.prototype.getErrorIndicator=function(){return this._errorIndicator},$e.prototype.getErrorLocation=function(){return this._errorLocation},$e.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")},$e.prototype.report=function(t){if(!$e.VERBOSE)return null;We.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},$e.prototype.getErrorMessage=function(){return this._errorMsg},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.isValidMsg=function(t,e,i){var r=new $e(t,e,i);return r.isValid()?null:r.getErrorMessage()},$e.isValid=function(t,e,i){var r=new $e(t,e,i);return!!r.isValid()},jg.VERBOSE.get=function(){return!1},jg.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties($e,jg);var er=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};er.prototype.getCoordinates=function(){return this._pts},er.prototype.size=function(){return this._pts.length},er.prototype.getCoordinate=function(t){return this._pts[t]},er.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},er.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ia.octant(this.getCoordinate(t),this.getCoordinate(t+1))},er.prototype.setData=function(t){this._data=t},er.prototype.getData=function(){return this._data},er.prototype.toString=function(){return Pn.toLineString(new Ee(this._pts))},er.prototype.interfaces_=function(){return[Cr]},er.prototype.getClass=function(){return er};var Ve=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Z,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ve.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ve.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ve.prototype.getIntersectionSegments=function(){return this._intSegments},Ve.prototype.count=function(){return this._intersectionCount},Ve.prototype.getIntersections=function(){return this._intersections},Ve.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ve.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ve.prototype.processIntersections=function(t,e,i,r){if(!this._findAllIntersections&&this.hasIntersection()||t===i&&e===r)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,e)||this.isEndSegment(i,r);if(!s)return null}var o=t.getCoordinates()[e],a=t.getCoordinates()[e+1],h=i.getCoordinates()[r],u=i.getCoordinates()[r+1];this._li.computeIntersection(o,a,h,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=h,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Ve.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ve.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ve.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ve.prototype.interfaces_=function(){return[mo]},Ve.prototype.getClass=function(){return Ve},Ve.createAllIntersectionsFinder=function(t){var e=new Ve(t);return e.setFindAllIntersections(!0),e},Ve.createAnyIntersectionFinder=function(t){return new Ve(t)},Ve.createIntersectionCounter=function(t){var e=new Ve(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Dn=function(){this._li=new lo,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Dn.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Dn.prototype.getIntersections=function(){return this._segInt.getIntersections()},Dn.prototype.isValid=function(){return this.execute(),this._isValid},Dn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Dn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ve(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Bg;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Dn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new is(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Dn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Pn.toLineString(t[0],t[1])+" and "+Pn.toLineString(t[2],t[3])},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.computeIntersections=function(t){var e=new Dn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var wo=function n(){this._nv=null;var t=arguments[0];this._nv=new Dn(n.toSegmentStrings(t))};wo.prototype.checkValid=function(){this._nv.checkValid()},wo.prototype.interfaces_=function(){return[]},wo.prototype.getClass=function(){return wo},wo.toSegmentStrings=function(t){for(var e=new Z,i=t.iterator();i.hasNext();){var r=i.next();e.add(new er(r.getCoordinates(),r))}return e},wo.checkValid=function(t){var e=new wo(t);e.checkValid()};var ua=function(t){this._mapOp=t};ua.prototype.map=function(t){for(var e=this,i=new Z,r=0;r<t.getNumGeometries();r++){var s=e._mapOp.map(t.getGeometryN(r));s.isEmpty()||i.add(s)}return t.getFactory().createGeometryCollection(Ft.toGeometryArray(i))},ua.prototype.interfaces_=function(){return[]},ua.prototype.getClass=function(){return ua},ua.map=function(t,e){var i=new ua(e);return i.map(t)};var ir=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Z,this._resultLineList=new Z;var t=arguments[0],e=arguments[1],i=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=i};ir.prototype.collectLines=function(t){for(var e=this,i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var r=i.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}},ir.prototype.labelIsolatedLine=function(t,e){var i=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,i)},ir.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},ir.prototype.collectLineEdge=function(t,e,i){var r=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&Tt.isResultOfOp(r,e)&&!s.isCovered()&&(i.add(s),t.setVisitedEdge(!0))},ir.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var i=e.next();i.getEdges().findCoveredLineEdges()}for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var s=r.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=t._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},ir.prototype.labelIsolatedLines=function(t){for(var e=this,i=t.iterator();i.hasNext();){var r=i.next(),s=r.getLabel();r.isIsolated()&&(s.isNull(0)?e.labelIsolatedLine(r,0):e.labelIsolatedLine(r,1))}},ir.prototype.buildLines=function(t){for(var e=this,i=this._lineEdgesList.iterator();i.hasNext();){var r=i.next(),s=e._geometryFactory.createLineString(r.getCoordinates());e._resultLineList.add(s),r.setInResult(!0)}},ir.prototype.collectBoundaryTouchEdge=function(t,e,i){var r=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Nt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),Tt.isResultOfOp(r,e)&&e===Tt.INTERSECTION&&(i.add(t.getEdge()),t.setVisitedEdge(!0))},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir};var la=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Z;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};la.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var i=this._geometryFactory.createPoint(e);this._resultPointList.add(i)}},la.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,i=this._op.getGraph().getNodes().iterator();i.hasNext();){var r=i.next();if(!r.isInResult()&&!r.isIncidentEdgeInResult()&&(r.getEdges().getDegree()===0||t===Tt.INTERSECTION)){var s=r.getLabel();Tt.isResultOfOp(s,t)&&e.filterCoveredNodeToPoint(r)}}},la.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},la.prototype.interfaces_=function(){return[]},la.prototype.getClass=function(){return la};var Pi=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Pi.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Pi.prototype.transformPolygon=function(t,e){var i=this,r=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof wr)||s.isEmpty())&&(r=!1);for(var o=new Z,a=0;a<t.getNumInteriorRing();a++){var h=i.transformLinearRing(t.getInteriorRingN(a),t);h===null||h.isEmpty()||(h instanceof wr||(r=!1),o.add(h))}if(r)return this._factory.createPolygon(s,o.toArray([]));var u=new Z;return s!==null&&u.add(s),u.addAll(o),this._factory.buildGeometry(u)},Pi.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Pi.prototype.getInputGeometry=function(){return this._inputGeom},Pi.prototype.transformMultiLineString=function(t,e){for(var i=this,r=new Z,s=0;s<t.getNumGeometries();s++){var o=i.transformLineString(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Pi.prototype.transformCoordinates=function(t,e){return this.copy(t)},Pi.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Pi.prototype.transformMultiPoint=function(t,e){for(var i=this,r=new Z,s=0;s<t.getNumGeometries();s++){var o=i.transformPoint(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Pi.prototype.transformMultiPolygon=function(t,e){for(var i=this,r=new Z,s=0;s<t.getNumGeometries();s++){var o=i.transformPolygon(t.getGeometryN(s),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)},Pi.prototype.copy=function(t){return t.copy()},Pi.prototype.transformGeometryCollection=function(t,e){for(var i=this,r=new Z,s=0;s<t.getNumGeometries();s++){var o=i.transform(t.getGeometryN(s));o!==null&&(i._pruneEmptyGeometry&&o.isEmpty()||r.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Ft.toGeometryArray(r)):this._factory.buildGeometry(r)},Pi.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Ai)return this.transformPoint(t,null);if(t instanceof yh)return this.transformMultiPoint(t,null);if(t instanceof wr)return this.transformLinearRing(t,null);if(t instanceof ve)return this.transformLineString(t,null);if(t instanceof go)return this.transformMultiLineString(t,null);if(t instanceof De)return this.transformPolygon(t,null);if(t instanceof Er)return this.transformMultiPolygon(t,null);if(t instanceof ui)return this.transformGeometryCollection(t,null);throw new ce("Unknown Geometry subtype: "+t.getClass().getName())},Pi.prototype.transformLinearRing=function(t,e){var i=this.transformCoordinates(t.getCoordinateSequence(),t);if(i===null)return this._factory.createLinearRing(null);var r=i.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Mr=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ve&&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 i=arguments[0],r=arguments[1];this._srcPts=i,this._isClosed=n.isClosed(i),this._snapTolerance=r}};Mr.prototype.snapVertices=function(t,e){for(var i=this,r=this._isClosed?t.size()-1:t.size(),s=0;s<r;s++){var o=t.get(s),a=i.findSnapForVertex(o,e);a!==null&&(t.set(s,new L(a)),s===0&&i._isClosed&&t.set(t.size()-1,new L(a)))}},Mr.prototype.findSnapForVertex=function(t,e){for(var i=this,r=0;r<e.length;r++){if(t.equals2D(e[r]))return null;if(t.distance(e[r])<i._snapTolerance)return e[r]}return null},Mr.prototype.snapTo=function(t){var e=new cl(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var i=e.toCoordinateArray();return i},Mr.prototype.snapSegments=function(t,e){var i=this;if(e.length===0)return null;var r=e.length;e[0].equals2D(e[e.length-1])&&(r=e.length-1);for(var s=0;s<r;s++){var o=e[s],a=i.findSegmentIndexToSnap(o,t);a>=0&&t.add(a+1,new L(o),!1)}},Mr.prototype.findSegmentIndexToSnap=function(t,e){for(var i=this,r=Pt.MAX_VALUE,s=-1,o=0;o<e.size()-1;o++){if(i._seg.p0=e.get(o),i._seg.p1=e.get(o+1),i._seg.p0.equals2D(t)||i._seg.p1.equals2D(t)){if(i._allowSnappingToSourceVertices)continue;return-1}var a=i._seg.distance(t);a<i._snapTolerance&&a<r&&(r=a,s=o)}return s},Mr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Ce=function(t){this._srcGeom=t||null},Oy={SNAP_PRECISION_FACTOR:{configurable:!0}};Ce.prototype.snapTo=function(t,e){var i=this.extractTargetCoordinates(t),r=new Dy(e,i);return r.transform(this._srcGeom)},Ce.prototype.snapToSelf=function(t,e){var i=this.extractTargetCoordinates(this._srcGeom),r=new Dy(t,i,!0),s=r.transform(this._srcGeom),o=s;return e&&wt(o,Ts)&&(o=s.buffer(0)),o},Ce.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),i=e/10;return i},Ce.prototype.extractTargetCoordinates=function(t){for(var e=new qn,i=t.getCoordinates(),r=0;r<i.length;r++)e.add(i[r]);return e.toArray(new Array(0).fill(null))},Ce.prototype.computeMinimumSegmentLength=function(t){for(var e=Pt.MAX_VALUE,i=0;i<t.length-1;i++){var r=t[i].distance(t[i+1]);r<e&&(e=r)}return e},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.snap=function(t,e,i){var r=new Array(2).fill(null),s=new Ce(t);r[0]=s.snapTo(e,i);var o=new Ce(e);return r[1]=o.snapTo(r[0],i),r},Ce.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Ce.computeSizeBasedSnapTolerance(t),i=t.getPrecisionModel();if(i.getType()===Xt.FIXED){var r=1/i.getScale()*2/1.415;r>e&&(e=r)}return e}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(Ce.computeOverlaySnapTolerance(s),Ce.computeOverlaySnapTolerance(o))}},Ce.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),i=Math.min(e.getHeight(),e.getWidth()),r=i*Ce.SNAP_PRECISION_FACTOR;return r},Ce.snapToSelf=function(t,e,i){var r=new Ce(t);return r.snapToSelf(e,i)},Oy.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Ce,Oy);var Dy=function(n){function t(e,i,r){n.call(this),this._snapTolerance=e||null,this._snapPts=i||null,this._isSelfSnap=r!==void 0?r:!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(i,r){var s=new Mr(i,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(r)},t.prototype.transformCoordinates=function(i,r){var s=i.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}(Pi),pi=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};pi.prototype.getCommon=function(){return Pt.longBitsToDouble(this._commonBits)},pi.prototype.add=function(t){var e=Pt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=pi.signExpBits(this._commonBits),this._isFirst=!1,null;var i=pi.signExpBits(e);if(i!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=pi.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=pi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},pi.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=Pt.longBitsToDouble(t),i=Pt.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+i,s=r.substring(r.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]";return o}},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},pi.getBit=function(t,e){var i=1<<e;return(t&i)!==0?1:0},pi.signExpBits=function(t){return t>>52},pi.zeroLowerBits=function(t,e){var i=(1<<e)-1,r=~i,s=t&r;return s},pi.numCommonMostSigMantissaBits=function(t,e){for(var i=0,r=52;r>=0;r--){if(pi.getBit(t,r)!==pi.getBit(e,r))return i;i++}return 52};var ks=function(){this._commonCoord=null,this._ccFilter=new ca},qg={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ks.prototype.addCommonBits=function(t){var e=new Gs(this._commonCoord);t.apply(e),t.geometryChanged()},ks.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new L(this._commonCoord);e.x=-e.x,e.y=-e.y;var i=new Gs(e);return t.apply(i),t.geometryChanged(),t},ks.prototype.getCommonCoordinate=function(){return this._commonCoord},ks.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ks.prototype.interfaces_=function(){return[]},ks.prototype.getClass=function(){return ks},qg.CommonCoordinateFilter.get=function(){return ca},qg.Translater.get=function(){return Gs},Object.defineProperties(ks,qg);var ca=function(){this._commonBitsX=new pi,this._commonBitsY=new pi};ca.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ca.prototype.getCommonCoordinate=function(){return new L(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ca.prototype.interfaces_=function(){return[yr]},ca.prototype.getClass=function(){return ca};var Gs=function(){this.trans=null;var t=arguments[0];this.trans=t};Gs.prototype.filter=function(t,e){var i=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,i),t.setOrdinate(e,1,r)},Gs.prototype.isDone=function(){return!1},Gs.prototype.isGeometryChanged=function(){return!0},Gs.prototype.interfaces_=function(){return[xn]},Gs.prototype.getClass=function(){return Gs};var ze=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()};ze.prototype.selfSnap=function(t){var e=new Ce(t),i=e.snapTo(t,this._snapTolerance);return i},ze.prototype.removeCommonBits=function(t){this._cbr=new ks,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},ze.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ze.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),i=Tt.overlayOp(e[0],e[1],t);return this.prepareResult(i)},ze.prototype.checkValid=function(t){t.isValid()||We.out.println("Snapped geometry is invalid")},ze.prototype.computeSnapTolerance=function(){this._snapTolerance=Ce.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ze.prototype.snap=function(t){var e=this.removeCommonBits(t),i=Ce.snap(e[0],e[1],this._snapTolerance);return i},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.overlayOp=function(t,e,i){var r=new ze(t,e);return r.getResultGeometry(i)},ze.union=function(t,e){return ze.overlayOp(t,e,Tt.UNION)},ze.intersection=function(t,e){return ze.overlayOp(t,e,Tt.INTERSECTION)},ze.symDifference=function(t,e){return ze.overlayOp(t,e,Tt.SYMDIFFERENCE)},ze.difference=function(t,e){return ze.overlayOp(t,e,Tt.DIFFERENCE)};var vi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};vi.prototype.getResultGeometry=function(t){var e=null,i=!1,r=null;try{e=Tt.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(i=!0)}catch(o){if(o instanceof $r)r=o;else throw o}finally{}if(!i)try{e=ze.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof $r?r:o}finally{}return e},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi},vi.overlayOp=function(t,e,i){var r=new vi(t,e);return r.getResultGeometry(i)},vi.union=function(t,e){return vi.overlayOp(t,e,Tt.UNION)},vi.intersection=function(t,e){return vi.overlayOp(t,e,Tt.INTERSECTION)},vi.symDifference=function(t,e){return vi.overlayOp(t,e,Tt.SYMDIFFERENCE)},vi.difference=function(t,e){return vi.overlayOp(t,e,Tt.DIFFERENCE)};var Il=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Il.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Il.prototype.interfaces_=function(){return[]},Il.prototype.getClass=function(){return Il};var ki=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 i=arguments[0],r=arguments[1],s=arguments[2];this._eventType=n.INSERT,this._label=i,this._xValue=r,this._obj=s}},Wg={INSERT:{configurable:!0},DELETE:{configurable:!0}};ki.prototype.isDelete=function(){return this._eventType===ki.DELETE},ki.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ki.prototype.getObject=function(){return this._obj},ki.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},ki.prototype.getInsertEvent=function(){return this._insertEvent},ki.prototype.isInsert=function(){return this._eventType===ki.INSERT},ki.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},ki.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ki.prototype.interfaces_=function(){return[hn]},ki.prototype.getClass=function(){return ki},Wg.INSERT.get=function(){return 1},Wg.DELETE.get=function(){return 2},Object.defineProperties(ki,Wg);var id=function(){};id.prototype.interfaces_=function(){return[]},id.prototype.getClass=function(){return id};var Ke=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=i};Ke.prototype.isTrivialIntersection=function(t,e,i,r){if(t===i&&this._li.getIntersectionNum()===1){if(Ke.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(e===0&&r===s||r===0&&e===s)return!0}}return!1},Ke.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ke.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Ke.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ke.prototype.isBoundaryPointInternal=function(t,e){for(var i=e.iterator();i.hasNext();){var r=i.next(),s=r.getCoordinate();if(t.isIntersection(s))return!0}return!1},Ke.prototype.hasProperIntersection=function(){return this._hasProper},Ke.prototype.hasIntersection=function(){return this._hasIntersection},Ke.prototype.isDone=function(){return this._isDone},Ke.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Ke.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Ke.prototype.addIntersections=function(t,e,i,r){if(t===i&&e===r)return null;this.numTests++;var s=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=i.getCoordinates()[r],h=i.getCoordinates()[r+1];this._li.computeIntersection(s,o,a,h),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,i,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),i.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke},Ke.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var UM=function(n){function t(){n.call(this),this.events=new Z,this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var i=this;Tn.sort(this.events);for(var r=0;r<this.events.size();r++){var s=i.events.get(r);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(r)}},t.prototype.computeIntersections=function(){var i=this;if(arguments.length===1){var r=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=i.events.get(s);if(o.isInsert()&&i.processOverlaps(s,o.getDeleteEventIndex(),o,r),r.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Ke&&wt(arguments[0],bn)&&wt(arguments[1],bn)){var a=arguments[0],h=arguments[1],u=arguments[2];this.addEdges(a,a),this.addEdges(h,h),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&wt(arguments[0],bn)&&arguments[1]instanceof Ke){var c=arguments[0],l=arguments[1],d=arguments[2];d?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(l)}}},t.prototype.addEdge=function(i,r){for(var s=this,o=i.getMonotoneChainEdge(),a=o.getStartIndexes(),h=0;h<a.length-1;h++){var u=new Il(o,h),c=new ki(r,o.getMinX(h),u);s.events.add(c),s.events.add(new ki(o.getMaxX(h),c))}},t.prototype.processOverlaps=function(i,r,s,o){for(var a=this,h=s.getObject(),u=i;u<r;u++){var c=a.events.get(u);if(c.isInsert()){var l=c.getObject();s.isSameLabel(c)||(h.computeIntersections(l,o),a.nOverlaps++)}}},t.prototype.addEdges=function(){var i=this;if(arguments.length===1)for(var r=arguments[0],s=r.iterator();s.hasNext();){var o=s.next();i.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],h=arguments[1],u=a.iterator();u.hasNext();){var c=u.next();i.addEdge(c,h)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(id),Tr=function(){this._min=Pt.POSITIVE_INFINITY,this._max=Pt.NEGATIVE_INFINITY},Ay={NodeComparator:{configurable:!0}};Tr.prototype.getMin=function(){return this._min},Tr.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Tr.prototype.getMax=function(){return this._max},Tr.prototype.toString=function(){return Pn.toLineString(new L(this._min,0),new L(this._max,0))},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Ay.NodeComparator.get=function(){return xl},Object.defineProperties(Tr,Ay);var xl=function(){};xl.prototype.compare=function(t,e){var i=t,r=e,s=(i._min+i._max)/2,o=(r._min+r._max)/2;return s<o?-1:s>o?1:0},xl.prototype.interfaces_=function(){return[hh]},xl.prototype.getClass=function(){return xl};var jM=function(n){function t(){n.call(this),this._item=null;var e=arguments[0],i=arguments[1],r=arguments[2];this._min=e,this._max=i,this._item=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(i,r,s){if(!this.intersects(i,r))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Tr),qM=function(n){function t(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],i=arguments[1];this._node1=e,this._node2=i,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(i,r){this._min=Math.min(i._min,r._min),this._max=Math.max(i._max,r._max)},t.prototype.query=function(i,r,s){if(!this.intersects(i,r))return null;this._node1!==null&&this._node1.query(i,r,s),this._node2!==null&&this._node2.query(i,r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Tr),Nr=function(){this._leaves=new Z,this._root=null,this._level=0};Nr.prototype.buildTree=function(){var t=this;Tn.sort(this._leaves,new Tr.NodeComparator);for(var e=this._leaves,i=null,r=new Z;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);i=e,e=r,r=i}},Nr.prototype.insert=function(t,e,i){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new jM(t,e,i))},Nr.prototype.query=function(t,e,i){this.init(),this._root.query(t,e,i)},Nr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Nr.prototype.printNode=function(t){We.out.println(Pn.toLineString(new L(t._min,this._level),new L(t._max,this._level)))},Nr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Nr.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var i=0;i<t.size();i+=2){var r=t.get(i),s=i+1<t.size()?t.get(i):null;if(s===null)e.add(r);else{var o=new qM(t.get(i),t.get(i+1));e.add(o)}}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Ih=function(){this._items=new Z};Ih.prototype.visitItem=function(t){this._items.add(t)},Ih.prototype.getItems=function(){return this._items},Ih.prototype.interfaces_=function(){return[Ns]},Ih.prototype.getClass=function(){return Ih};var xh=function(){this._index=null;var t=arguments[0];if(!wt(t,Ts))throw new ce("Argument must be Polygonal");this._index=new Eo(t)},Hg={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};xh.prototype.locate=function(t){var e=new jn(t),i=new Mh(e);return this._index.query(t.y,t.y,i),e.getLocation()},xh.prototype.interfaces_=function(){return[Ch]},xh.prototype.getClass=function(){return xh},Hg.SegmentVisitor.get=function(){return Mh},Hg.IntervalIndexedGeometry.get=function(){return Eo},Object.defineProperties(xh,Hg);var Mh=function(){this._counter=null;var t=arguments[0];this._counter=t};Mh.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Mh.prototype.interfaces_=function(){return[Ns]},Mh.prototype.getClass=function(){return Mh};var Eo=function(){this._index=new Nr;var t=arguments[0];this.init(t)};Eo.prototype.init=function(t){for(var e=this,i=Ye.getLines(t),r=i.iterator();r.hasNext();){var s=r.next(),o=s.getCoordinates();e.addLine(o)}},Eo.prototype.addLine=function(t){for(var e=this,i=1;i<t.length;i++){var r=new dt(t[i-1],t[i]),s=Math.min(r.p0.y,r.p1.y),o=Math.max(r.p0.y,r.p1.y);e._index.insert(s,o,r)}},Eo.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new Ih;return this._index.query(t,e,i),i.getItems()}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];this._index.query(r,s,o)}},Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo};var Ml=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new gy,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new On,arguments.length===2){var e=arguments[0],i=arguments[1],r=ln.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=i,this._boundaryNodeRule=r,i!==null&&this.add(i)}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(i,r){var s=this._nodes.addNode(r),o=s.getLabel(),a=1,h=V.NONE;h=o.getLocation(i,K.ON),h===V.BOUNDARY&&a++;var u=t.determineBoundary(this._boundaryNodeRule,a);o.setLocation(i,u)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var i=arguments[0],r=arguments[1];return this.computeSelfNodes(i,r,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],h=new Ke(s,!0,!1);h.setIsDoneIfProperInt(a);var u=this.createEdgeSetIntersector(),c=this._parentGeom instanceof wr||this._parentGeom instanceof De||this._parentGeom instanceof Er,l=o||!c;return u.computeIntersections(this._edges,h,l),this.addSelfIntersectionNodes(this._argIndex),h}},t.prototype.computeSplitEdges=function(i){for(var r=this._edges.iterator();r.hasNext();){var s=r.next();s.eiList.addSplitEdges(i)}},t.prototype.computeEdgeIntersections=function(i,r,s){var o=new Ke(r,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),i.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,i._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 Ai){var i=arguments[0],r=i.getCoordinate();this.insertPoint(this._argIndex,r,V.INTERIOR)}else if(arguments[0]instanceof L){var s=arguments[0];this.insertPoint(this._argIndex,s,V.INTERIOR)}},t.prototype.addPolygon=function(i){var r=this;this.addPolygonRing(i.getExteriorRing(),V.EXTERIOR,V.INTERIOR);for(var s=0;s<i.getNumInteriorRing();s++){var o=i.getInteriorRingN(s);r.addPolygonRing(o,V.INTERIOR,V.EXTERIOR)}},t.prototype.addEdge=function(i){this.insertEdge(i);var r=i.getCoordinates();this.insertPoint(this._argIndex,r[0],V.BOUNDARY),this.insertPoint(this._argIndex,r[r.length-1],V.BOUNDARY)},t.prototype.addLineString=function(i){var r=Lt.removeRepeatedPoints(i.getCoordinates());if(r.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var s=new ed(r,new Kt(this._argIndex,V.INTERIOR));this._lineEdgeMap.put(i,s),this.insertEdge(s),Nt.isTrue(r.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var i=this.getBoundaryNodes(),r=new Array(i.size()).fill(null),s=0,o=i.iterator();o.hasNext();){var a=o.next();r[s++]=a.getCoordinate().copy()}return r},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(i,r,s){if(this.isBoundaryNode(i,r))return null;s===V.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(i,r):this.insertPoint(i,r,s)},t.prototype.addPolygonRing=function(i,r,s){if(i.isEmpty())return null;var o=Lt.removeRepeatedPoints(i.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=r,h=s;et.isCCW(o)&&(a=s,h=r);var u=new ed(o,new Kt(this._argIndex,V.BOUNDARY,a,h));this._lineEdgeMap.put(i,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],V.BOUNDARY)},t.prototype.insertPoint=function(i,r,s){var o=this._nodes.addNode(r),a=o.getLabel();a===null?o._label=new Kt(i,s):a.setLocation(i,s)},t.prototype.createEdgeSetIntersector=function(){return new UM},t.prototype.addSelfIntersectionNodes=function(i){for(var r=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(i),h=o.eiList.iterator();h.hasNext();){var u=h.next();r.addSelfIntersectionNode(i,u.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var i=arguments[0];if(i.isEmpty())return null;if(i instanceof Er&&(this._useBoundaryDeterminationRule=!1),i instanceof De)this.addPolygon(i);else if(i instanceof ve)this.addLineString(i);else if(i instanceof Ai)this.addPoint(i);else if(i instanceof yh)this.addCollection(i);else if(i instanceof go)this.addCollection(i);else if(i instanceof Er)this.addCollection(i);else if(i instanceof ui)this.addCollection(i);else throw new Error(i.getClass().getName())}else return n.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(i){for(var r=this,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);r.add(o)}},t.prototype.locate=function(i){return wt(this._parentGeom,Ts)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new xh(this._parentGeom)),this._areaPtLocator.locate(i)):this._ptLocator.locate(i,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var i=arguments[0];return this._lineEdgeMap.get(i)}else return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(i,r){return i.isInBoundary(r)?V.BOUNDARY:V.INTERIOR},t}(pe),Th=function(){if(this._li=new lo,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 Ml(0,t)}else if(arguments.length===2){var e=arguments[0],i=arguments[1],r=ln.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ml(0,e,r),this._arg[1]=new Ml(1,i,r)}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 Ml(0,s,a),this._arg[1]=new Ml(1,o,a)}};Th.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Th.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Th.prototype.interfaces_=function(){return[]},Th.prototype.getClass=function(){return Th};var So=function(){};So.prototype.interfaces_=function(){return[]},So.prototype.getClass=function(){return So},So.map=function(){if(arguments[0]instanceof yt&&wt(arguments[1],So.MapOp)){for(var t=arguments[0],e=arguments[1],i=new Z,r=0;r<t.getNumGeometries();r++){var s=e.map(t.getGeometryN(r));s!==null&&i.add(s)}return t.getFactory().buildGeometry(i)}else if(wt(arguments[0],Oe)&&wt(arguments[1],So.MapOp)){for(var o=arguments[0],a=arguments[1],h=new Z,u=o.iterator();u.hasNext();){var c=u.next(),l=a.map(c);l!==null&&h.add(l)}return h}},So.MapOp=function(){};var Tt=function(n){function t(){var e=arguments[0],i=arguments[1];n.call(this,e,i),this._ptLocator=new On,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Nn,this._resultPolyList=new Z,this._resultLineList=new Z,this._resultPointList=new Z,this._graph=new pe(new Py),this._geomFact=e.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(i){var r=this._edgeList.findEqualEdge(i);if(r!==null){var s=r.getLabel(),o=i.getLabel();r.isPointwiseEqual(i)||(o=new Kt(i.getLabel()),o.flip());var a=r.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(i)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var r=i.next(),s=r.getSym();r.isInResult()&&s.isInResult()&&(r.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(i){return!!(this.isCovered(i,this._resultLineList)||this.isCovered(i,this._resultPolyList))},t.prototype.computeGeometry=function(i,r,s,o){var a=new Z;return a.addAll(i),a.addAll(r),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 i=this._graph.getNodes().iterator();i.hasNext();){var r=i.next();r.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(i,r){for(var s=this,o=r.iterator();o.hasNext();){var a=o.next(),h=s._ptLocator.locate(i,a);if(h!==V.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var i=new Z,r=this._edgeList.iterator();r.hasNext();){var s=r.next();s.isCollapsed()&&(r.remove(),i.add(s.getCollapsedEdge()))}this._edgeList.addAll(i)},t.prototype.updateNodeLabelling=function(){for(var i=this._graph.getNodes().iterator();i.hasNext();){var r=i.next(),s=r.getEdges().getLabel();r.getLabel().merge(s)}},t.prototype.getResultGeometry=function(i){return this.computeOverlay(i),this._resultGeom},t.prototype.insertUniqueEdges=function(i){for(var r=this,s=i.iterator();s.hasNext();){var o=s.next();r.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(i){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var r=new Z;this._arg[0].computeSplitEdges(r),this._arg[1].computeSplitEdges(r),this.insertUniqueEdges(r),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),wo.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(i),this.cancelDuplicateResultEdges();var s=new Ri(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new ir(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(i);var a=new la(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(i),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,i)},t.prototype.labelIncompleteNode=function(i,r){var s=this._ptLocator.locate(i.getCoordinate(),this._arg[r].getGeometry());i.getLabel().setLocation(r,s)},t.prototype.copyPoints=function(i){for(var r=this,s=this._arg[i].getNodeIterator();s.hasNext();){var o=s.next(),a=r._graph.addNode(o.getCoordinate());a.setLabel(i,o.getLabel().getLocation(i))}},t.prototype.findResultAreaEdges=function(i){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var s=r.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,K.RIGHT),o.getLocation(1,K.RIGHT),i)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var i=this._edgeList.iterator();i.hasNext();){var r=i.next(),s=r.getLabel(),o=r.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):(Nt.isTrue(!o.isNull(a,K.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,K.LEFT,o.getLocation(a,K.LEFT)),Nt.isTrue(!o.isNull(a,K.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,K.RIGHT,o.getLocation(a,K.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var i=this,r=this._graph.getNodes().iterator();r.hasNext();){var s=r.next();s.getEdges().computeLabelling(i._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var i=this,r=this._graph.getNodes().iterator();r.hasNext();){var s=r.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?i.labelIncompleteNode(s,0):i.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(i){return!!this.isCovered(i,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Th);Tt.overlayOp=function(n,t,e){var i=new Tt(n,t),r=i.getResultGeometry(e);return r},Tt.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return Tt.createEmptyResult(Tt.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var e=t;return ua.map(n,{interfaces_:function(){return[So.MapOp]},map:function(i){return i.intersection(e)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),vi.overlayOp(n,t,Tt.INTERSECTION)},Tt.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return Tt.createEmptyResult(Tt.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),vi.overlayOp(n,t,Tt.SYMDIFFERENCE)},Tt.resultDimension=function(n,t,e){var i=t.getDimension(),r=e.getDimension(),s=-1;switch(n){case Tt.INTERSECTION:s=Math.min(i,r);break;case Tt.UNION:s=Math.max(i,r);break;case Tt.DIFFERENCE:s=i;break;case Tt.SYMDIFFERENCE:s=Math.max(i,r);break}return s},Tt.createEmptyResult=function(n,t,e,i){var r=null;switch(Tt.resultDimension(n,t,e)){case-1:r=i.createGeometryCollection(new Array(0).fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon();break}return r},Tt.difference=function(n,t){return n.isEmpty()?Tt.createEmptyResult(Tt.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),vi.overlayOp(n,t,Tt.DIFFERENCE))},Tt.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],t=arguments[1],e=n.getLocation(0),i=n.getLocation(1);return Tt.isResultOfOp(e,i,t)}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2];switch(r===V.BOUNDARY&&(r=V.INTERIOR),s===V.BOUNDARY&&(s=V.INTERIOR),o){case Tt.INTERSECTION:return r===V.INTERIOR&&s===V.INTERIOR;case Tt.UNION:return r===V.INTERIOR||s===V.INTERIOR;case Tt.DIFFERENCE:return r===V.INTERIOR&&s!==V.INTERIOR;case Tt.SYMDIFFERENCE:return r===V.INTERIOR&&s!==V.INTERIOR||r!==V.INTERIOR&&s===V.INTERIOR}return!1}},Tt.INTERSECTION=1,Tt.UNION=2,Tt.DIFFERENCE=3,Tt.SYMDIFFERENCE=4;var Bs=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new On,this._seg=new dt;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Bs.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,i=0;i<this._linework.getNumGeometries();i++)for(var r=e._linework.getGeometryN(i),s=r.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},Bs.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?V.BOUNDARY:this._ptLocator.locate(t,this._g)},Bs.prototype.extractLinework=function(t){var e=new Nh;t.apply(e);var i=e.getLinework(),r=Ft.toLineStringArray(i);return t.getFactory().createMultiLineString(r)},Bs.prototype.interfaces_=function(){return[]},Bs.prototype.getClass=function(){return Bs};var Nh=function(){this._linework=null,this._linework=new Z};Nh.prototype.getLinework=function(){return this._linework},Nh.prototype.filter=function(t){var e=this;if(t instanceof De){var i=t;this._linework.add(i.getExteriorRing());for(var r=0;r<i.getNumInteriorRing();r++)e._linework.add(i.getInteriorRingN(r))}},Nh.prototype.interfaces_=function(){return[Wn]},Nh.prototype.getClass=function(){return Nh};var Co=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Co.prototype.extractPoints=function(t,e,i){for(var r=this,s=t.getCoordinates(),o=0;o<s.length-1;o++)r.computeOffsetPoints(s[o],s[o+1],e,i)},Co.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Co.prototype.getPoints=function(t){for(var e=this,i=new Z,r=Ye.getLines(this._g),s=r.iterator();s.hasNext();){var o=s.next();e.extractPoints(o,t,i)}return i},Co.prototype.computeOffsetPoints=function(t,e,i,r){var s=e.x-t.x,o=e.y-t.y,a=Math.sqrt(s*s+o*o),h=i*s/a,u=i*o/a,c=(e.x+t.x)/2,l=(e.y+t.y)/2;if(this._doLeft){var d=new L(c-u,l+h);r.add(d)}if(this._doRight){var g=new L(c+u,l-h);r.add(g)}},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var Zi=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 Z;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,i],this._locFinder=[new Bs(this._geom[0],this._boundaryDistanceTolerance),new Bs(this._geom[1],this._boundaryDistanceTolerance),new Bs(this._geom[2],this._boundaryDistanceTolerance)]},Ry={TOLERANCE:{configurable:!0}};Zi.prototype.reportResult=function(t,e,i){We.out.println("Overlay result invalid - A:"+V.toLocationSymbol(e[0])+" B:"+V.toLocationSymbol(e[1])+" expected:"+(i?"i":"e")+" actual:"+V.toLocationSymbol(e[2]))},Zi.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Zi.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],i=0;i<this._testCoords.size();i++){var r=t._testCoords.get(i);if(!t.checkValid(e,r))return t._invalidLocation=r,!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),Zi.hasLocation(this._location,V.BOUNDARY)?!0:this.isValidResult(s,this._location)}},Zi.prototype.addTestPts=function(t){var e=new Co(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Zi.prototype.isValidResult=function(t,e){var i=Tt.isResultOfOp(e[0],e[1],t),r=e[2]===V.INTERIOR,s=!(i^r);return s||this.reportResult(t,e,i),s},Zi.prototype.getInvalidLocation=function(){return this._invalidLocation},Zi.prototype.interfaces_=function(){return[]},Zi.prototype.getClass=function(){return Zi},Zi.hasLocation=function(t,e){for(var i=0;i<3;i++)if(t[i]===e)return!0;return!1},Zi.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Ce.computeSizeBasedSnapTolerance(t),Ce.computeSizeBasedSnapTolerance(e))},Zi.isValid=function(t,e,i,r){var s=new Zi(t,e,r);return s.isValid(i)},Ry.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Zi,Ry);var tn=function n(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(t),this._inputGeoms=t};tn.prototype.extractElements=function(t,e){var i=this;if(t===null)return null;for(var r=0;r<t.getNumGeometries();r++){var s=t.getGeometryN(r);i._skipEmpty&&s.isEmpty()||e.add(s)}},tn.prototype.combine=function(){for(var t=this,e=new Z,i=this._inputGeoms.iterator();i.hasNext();){var r=i.next();t.extractElements(r,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn},tn.combine=function(){if(arguments.length===1){var t=arguments[0],e=new tn(t);return e.combine()}else if(arguments.length===2){var i=arguments[0],r=arguments[1],s=new tn(tn.createList(i,r));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],h=arguments[2],u=new tn(tn.createList(o,a,h));return u.combine()}},tn.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},tn.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],i=new Z;return i.add(t),i.add(e),i}else if(arguments.length===3){var r=arguments[0],s=arguments[1],o=arguments[2],a=new Z;return a.add(r),a.add(s),a.add(o),a}};var Me=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new Z)},Ly={STRTREE_NODE_CAPACITY:{configurable:!0}};Me.prototype.reduceToGeometries=function(t){for(var e=this,i=new Z,r=t.iterator();r.hasNext();){var s=r.next(),o=null;wt(s,bn)?o=e.unionTree(s):s instanceof yt&&(o=s),i.add(o)}return i},Me.prototype.extractByEnvelope=function(t,e,i){for(var r=new Z,s=0;s<e.getNumGeometries();s++){var o=e.getGeometryN(s);o.getEnvelopeInternal().intersects(t)?r.add(o):i.add(o)}return this._geomFactory.buildGeometry(r)},Me.prototype.unionOptimized=function(t,e){var i=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!i.intersects(r)){var s=tn.combine(t,e);return s}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=i.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,o)},Me.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 _y(Me.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var i=e.next();t.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var r=t.itemsTree(),s=this.unionTree(r);return s},Me.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],i=arguments[1],r=arguments[2];if(r-i<=1){var s=Me.getGeometry(e,i);return this.unionSafe(s,null)}else{if(r-i===2)return this.unionSafe(Me.getGeometry(e,i),Me.getGeometry(e,i+1));var o=Math.trunc((r+i)/2),a=this.binaryUnion(e,i,o),h=this.binaryUnion(e,o,r);return this.unionSafe(a,h)}}},Me.prototype.repeatedUnion=function(t){for(var e=null,i=t.iterator();i.hasNext();){var r=i.next();e===null?e=r.copy():e=e.union(r)}return e},Me.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Me.prototype.unionActual=function(t,e){return Me.restrictToPolygons(t.union(e))},Me.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),i=this.binaryUnion(e);return i},Me.prototype.unionUsingEnvelopeIntersection=function(t,e,i){var r=new Z,s=this.extractByEnvelope(i,t,r),o=this.extractByEnvelope(i,e,r),a=this.unionActual(s,o);r.add(a);var h=tn.combine(r);return h},Me.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),i=e.buildGeometry(t),r=i.buffer(0);return r}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),h=a.createGeometryCollection([s,o]),u=h.buffer(0);return u}},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.restrictToPolygons=function(t){if(wt(t,Ts))return t;var e=os.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(Ft.toPolygonArray(e))},Me.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Me.union=function(t){var e=new Me(t);return e.union()},Ly.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Me,Ly);var nd=function(){};nd.prototype.interfaces_=function(){return[]},nd.prototype.getClass=function(){return nd},nd.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Tt.createEmptyResult(Tt.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),vi.overlayOp(t,e,Tt.UNION)};function Po(){return new rd}function rd(){this.reset()}rd.prototype={constructor:rd,reset:function(){this.s=this.t=0},add:function(n){Fy(sd,n,this.t),Fy(this,sd.s,this.s),this.s?this.t+=sd.t:this.s=sd.t},valueOf:function(){return this.s}};var sd=new rd;function Fy(n,t,e){var i=n.s=t+e,r=i-t,s=i-r;n.t=t-s+(e-r)}var Te=1e-6,Zt=Math.PI,as=Zt/2,ky=Zt/4,hs=Zt*2,bo=180/Zt,nr=Zt/180,mi=Math.abs,WM=Math.atan,Oh=Math.atan2,Re=Math.cos,Le=Math.sin,Dh=Math.sqrt;function Gy(n){return n>1?0:n<-1?Zt:Math.acos(n)}function da(n){return n>1?as:n<-1?-as:Math.asin(n)}function Tl(){}function od(n,t){n&&Vy.hasOwnProperty(n.type)&&Vy[n.type](n,t)}var By={Feature:function(n,t){od(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,i=-1,r=e.length;++i<r;)od(e[i].geometry,t)}},Vy={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,i=-1,r=e.length;++i<r;)n=e[i],t.point(n[0],n[1],n[2])},LineString:function(n,t){Xg(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,i=-1,r=e.length;++i<r;)Xg(e[i],t,0)},Polygon:function(n,t){zy(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,i=-1,r=e.length;++i<r;)zy(e[i],t)},GeometryCollection:function(n,t){for(var e=n.geometries,i=-1,r=e.length;++i<r;)od(e[i],t)}};function Xg(n,t,e){var i=-1,r=n.length-e,s;for(t.lineStart();++i<r;)s=n[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function zy(n,t){var e=-1,i=n.length;for(t.polygonStart();++e<i;)Xg(n[e],t,1);t.polygonEnd()}function HM(n,t){n&&By.hasOwnProperty(n.type)?By[n.type](n,t):od(n,t)}Po(),Po();function Yg(n){return[Oh(n[1],n[0]),da(n[2])]}function Ah(n){var t=n[0],e=n[1],i=Re(e);return[i*Re(t),i*Le(t),Le(e)]}function ad(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function hd(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 Jg(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ud(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function $g(n){var t=Dh(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}Po();function Uy(n,t){function e(i,r){return i=n(i,r),t(i[0],i[1])}return n.invert&&t.invert&&(e.invert=function(i,r){return i=t.invert(i,r),i&&n.invert(i[0],i[1])}),e}function Kg(n,t){return[n>Zt?n-hs:n<-Zt?n+hs:n,t]}Kg.invert=Kg;function XM(n,t,e){return(n%=hs)?t||e?Uy(qy(n),Wy(t,e)):qy(n):t||e?Wy(t,e):Kg}function jy(n){return function(t,e){return t+=n,[t>Zt?t-hs:t<-Zt?t+hs:t,e]}}function qy(n){var t=jy(n);return t.invert=jy(-n),t}function Wy(n,t){var e=Re(n),i=Le(n),r=Re(t),s=Le(t);function o(a,h){var u=Re(h),c=Re(a)*u,l=Le(a)*u,d=Le(h),g=d*e+c*i;return[Oh(l*r-g*s,c*e-d*i),da(g*r+l*s)]}return o.invert=function(a,h){var u=Re(h),c=Re(a)*u,l=Le(a)*u,d=Le(h),g=d*r-l*s;return[Oh(l*r+d*s,c*e+g*i),da(g*e-c*i)]},o}function YM(n,t,e,i,r,s){if(e){var o=Re(t),a=Le(t),h=i*e;r==null?(r=t+i*hs,s=t-h/2):(r=Hy(o,r),s=Hy(o,s),(i>0?r<s:r>s)&&(r+=i*hs));for(var u,c=r;i>0?c>s:c<s;c-=h)u=Yg([o,-a*Re(c),-a*Le(c)]),n.point(u[0],u[1])}}function Hy(n,t){t=Ah(t),t[0]-=n,$g(t);var e=Gy(-t[1]);return((-t[2]<0?-e:e)+hs-Te)%hs}function Xy(){var n=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){n.push(t=[])},lineEnd:Tl,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function JM(n,t,e,i,r,s){var o=n[0],a=n[1],h=t[0],u=t[1],c=0,l=1,d=h-o,g=u-a,p;if(p=e-o,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<l&&(l=p)}else if(d>0){if(p>l)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>l)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<l&&(l=p)}if(p=i-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<l&&(l=p)}else if(g>0){if(p>l)return;p>c&&(c=p)}if(p=s-a,!(!g&&p<0)){if(p/=g,g<0){if(p>l)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<l&&(l=p)}return c>0&&(n[0]=o+c*d,n[1]=a+c*g),l<1&&(t[0]=o+l*d,t[1]=a+l*g),!0}}}}}function ld(n,t){return mi(n[0]-t[0])<Te&&mi(n[1]-t[1])<Te}function cd(n,t,e,i){this.x=n,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function Yy(n,t,e,i,r){var s=[],o=[],a,h;if(n.forEach(function(p){if(!((_=p.length-1)<=0)){var _,w=p[0],P=p[_],v;if(ld(w,P)){for(r.lineStart(),a=0;a<_;++a)r.point((w=p[a])[0],w[1]);r.lineEnd();return}s.push(v=new cd(w,p,null,!0)),o.push(v.o=new cd(w,null,v,!1)),s.push(v=new cd(P,p,null,!1)),o.push(v.o=new cd(P,null,v,!0))}}),!!s.length){for(o.sort(t),Jy(s),Jy(o),a=0,h=o.length;a<h;++a)o[a].e=e=!e;for(var u=s[0],c,l;;){for(var d=u,g=!0;d.v;)if((d=d.n)===u)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(g)for(a=0,h=c.length;a<h;++a)r.point((l=c[a])[0],l[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(g)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((l=c[a])[0],l[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,g=!g}while(!d.v);r.lineEnd()}}}function Jy(n){if(t=n.length){for(var t,e=0,i=n[0],r;++e<t;)i.n=r=n[e],r.p=i,i=r;i.n=r=n[0],r.p=i}}function $y(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function $M(n){return n.length===1&&(n=KM(n)),{left:function(t,e,i,r){for(i==null&&(i=0),r==null&&(r=t.length);i<r;){var s=i+r>>>1;n(t[s],e)<0?i=s+1:r=s}return i},right:function(t,e,i,r){for(i==null&&(i=0),r==null&&(r=t.length);i<r;){var s=i+r>>>1;n(t[s],e)>0?r=s:i=s+1}return i}}}function KM(n){return function(t,e){return $y(n(t),e)}}$M($y);function Ky(n){for(var t=n.length,e,i=-1,r=0,s,o;++i<t;)r+=n[i].length;for(s=new Array(r);--t>=0;)for(o=n[t],e=o.length;--e>=0;)s[--r]=o[e];return s}var dd=1e9,fd=-1e9;function QM(n,t,e,i){function r(u,c){return n<=u&&u<=e&&t<=c&&c<=i}function s(u,c,l,d){var g=0,p=0;if(u==null||(g=o(u,l))!==(p=o(c,l))||h(u,c)<0^l>0)do d.point(g===0||g===3?n:e,g>1?i:t);while((g=(g+l+4)%4)!==p);else d.point(c[0],c[1])}function o(u,c){return mi(u[0]-n)<Te?c>0?0:3:mi(u[0]-e)<Te?c>0?2:1:mi(u[1]-t)<Te?c>0?1:0:c>0?3:2}function a(u,c){return h(u.x,c.x)}function h(u,c){var l=o(u,1),d=o(c,1);return l!==d?l-d:l===0?c[1]-u[1]:l===1?u[0]-c[0]:l===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,l=Xy(),d,g,p,_,w,P,v,E,m,S,C,b={point:I,lineStart:T,lineEnd:A,polygonStart:O,polygonEnd:x};function I(tt,$){r(tt,$)&&c.point(tt,$)}function M(){for(var tt=0,$=0,nt=g.length;$<nt;++$)for(var k=g[$],q=1,B=k.length,z=k[0],D,U,J=z[0],at=z[1];q<B;++q)D=J,U=at,z=k[q],J=z[0],at=z[1],U<=i?at>i&&(J-D)*(i-U)>(at-U)*(n-D)&&++tt:at<=i&&(J-D)*(i-U)<(at-U)*(n-D)&&--tt;return tt}function O(){c=l,d=[],g=[],C=!0}function x(){var tt=M(),$=C&&tt,nt=(d=Ky(d)).length;($||nt)&&(u.polygonStart(),$&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),nt&&Yy(d,a,tt,s,u),u.polygonEnd()),c=u,d=g=p=null}function T(){b.point=G,g&&g.push(p=[]),S=!0,m=!1,v=E=NaN}function A(){d&&(G(_,w),P&&m&&l.rejoin(),d.push(l.result())),b.point=I,m&&c.lineEnd()}function G(tt,$){var nt=r(tt,$);if(g&&p.push([tt,$]),S)_=tt,w=$,P=nt,S=!1,nt&&(c.lineStart(),c.point(tt,$));else if(nt&&m)c.point(tt,$);else{var k=[v=Math.max(fd,Math.min(dd,v)),E=Math.max(fd,Math.min(dd,E))],q=[tt=Math.max(fd,Math.min(dd,tt)),$=Math.max(fd,Math.min(dd,$))];JM(k,q,n,t,e,i)?(m||(c.lineStart(),c.point(k[0],k[1])),c.point(q[0],q[1]),nt||c.lineEnd(),C=!1):nt&&(c.lineStart(),c.point(tt,$),C=!1)}v=tt,E=$,m=nt}return b}}var Qg=Po();function ZM(n,t){var e=t[0],i=t[1],r=[Le(e),-Re(e),0],s=0,o=0;Qg.reset();for(var a=0,h=n.length;a<h;++a)if(c=(u=n[a]).length)for(var u,c,l=u[c-1],d=l[0],g=l[1]/2+ky,p=Le(g),_=Re(g),w=0;w<c;++w,d=v,p=m,_=S,l=P){var P=u[w],v=P[0],E=P[1]/2+ky,m=Le(E),S=Re(E),C=v-d,b=C>=0?1:-1,I=b*C,M=I>Zt,O=p*m;if(Qg.add(Oh(O*b*Le(I),_*S+O*Re(I))),s+=M?C+b*hs:C,M^d>=e^v>=e){var x=hd(Ah(l),Ah(P));$g(x);var T=hd(r,x);$g(T);var A=(M^C>=0?-1:1)*da(T[2]);(i>A||i===A&&(x[0]||x[1]))&&(o+=M^C>=0?1:-1)}}return(s<-1e-6||s<Te&&Qg<-1e-6)^o&1}Po();function Qy(n){return n}Po(),Po();var Rh=1/0,gd=Rh,Nl=-Rh,pd=Nl,Zy={point:tT,lineStart:Tl,lineEnd:Tl,polygonStart:Tl,polygonEnd:Tl,result:function(){var n=[[Rh,gd],[Nl,pd]];return Nl=pd=-(gd=Rh=1/0),n}};function tT(n,t){n<Rh&&(Rh=n),n>Nl&&(Nl=n),t<gd&&(gd=t),t>pd&&(pd=t)}Po();function t1(n,t,e,i){return function(r,s){var o=t(s),a=r.invert(i[0],i[1]),h=Xy(),u=t(h),c=!1,l,d,g,p={point:_,lineStart:P,lineEnd:v,polygonStart:function(){p.point=E,p.lineStart=m,p.lineEnd=S,d=[],l=[]},polygonEnd:function(){p.point=_,p.lineStart=P,p.lineEnd=v,d=Ky(d);var C=ZM(l,a);d.length?(c||(s.polygonStart(),c=!0),Yy(d,iT,C,e,s)):C&&(c||(s.polygonStart(),c=!0),s.lineStart(),e(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),d=l=null},sphere:function(){s.polygonStart(),s.lineStart(),e(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function _(C,b){var I=r(C,b);n(C=I[0],b=I[1])&&s.point(C,b)}function w(C,b){var I=r(C,b);o.point(I[0],I[1])}function P(){p.point=w,o.lineStart()}function v(){p.point=_,o.lineEnd()}function E(C,b){g.push([C,b]);var I=r(C,b);u.point(I[0],I[1])}function m(){u.lineStart(),g=[]}function S(){E(g[0][0],g[0][1]),u.lineEnd();var C=u.clean(),b=h.result(),I,M=b.length,O,x,T;if(g.pop(),l.push(g),g=null,!!M){if(C&1){if(x=b[0],(O=x.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),I=0;I<O;++I)s.point((T=x[I])[0],T[1]);s.lineEnd()}return}M>1&&C&2&&b.push(b.pop().concat(b.shift())),d.push(b.filter(eT))}}return p}}function eT(n){return n.length>1}function iT(n,t){return((n=n.x)[0]<0?n[1]-as-Te:as-n[1])-((t=t.x)[0]<0?t[1]-as-Te:as-t[1])}const e1=t1(function(){return!0},nT,sT,[-Zt,-as]);function nT(n){var t=NaN,e=NaN,i=NaN,r;return{lineStart:function(){n.lineStart(),r=1},point:function(s,o){var a=s>0?Zt:-Zt,h=mi(s-t);mi(h-Zt)<Te?(n.point(t,e=(e+o)/2>0?as:-as),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(s,e),r=0):i!==a&&h>=Zt&&(mi(t-i)<Te&&(t-=i*Te),mi(s-a)<Te&&(s-=a*Te),e=rT(t,e,s,o),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(a,e),r=0),n.point(t=s,e=o),i=a},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-r}}}function rT(n,t,e,i){var r,s,o=Le(n-e);return mi(o)>Te?WM((Le(t)*(s=Re(i))*Le(e)-Le(i)*(r=Re(t))*Le(n))/(r*s*o)):(t+i)/2}function sT(n,t,e,i){var r;if(n==null)r=e*as,i.point(-Zt,r),i.point(0,r),i.point(Zt,r),i.point(Zt,0),i.point(Zt,-r),i.point(0,-r),i.point(-Zt,-r),i.point(-Zt,0),i.point(-Zt,r);else if(mi(n[0]-t[0])>Te){var s=n[0]<t[0]?Zt:-Zt;r=e*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function oT(n,t){var e=Re(n),i=e>0,r=mi(e)>Te;function s(c,l,d,g){YM(g,n,t,d,c,l)}function o(c,l){return Re(c)*Re(l)>e}function a(c){var l,d,g,p,_;return{lineStart:function(){p=g=!1,_=1},point:function(w,P){var v=[w,P],E,m=o(w,P),S=i?m?0:u(w,P):m?u(w+(w<0?Zt:-Zt),P):0;if(!l&&(p=g=m)&&c.lineStart(),m!==g&&(E=h(l,v),(!E||ld(l,E)||ld(v,E))&&(v[0]+=Te,v[1]+=Te,m=o(v[0],v[1]))),m!==g)_=0,m?(c.lineStart(),E=h(v,l),c.point(E[0],E[1])):(E=h(l,v),c.point(E[0],E[1]),c.lineEnd()),l=E;else if(r&&l&&i^m){var C;!(S&d)&&(C=h(v,l,!0))&&(_=0,i?(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&&(!l||!ld(l,v))&&c.point(v[0],v[1]),l=v,g=m,d=S},lineEnd:function(){g&&c.lineEnd(),l=null},clean:function(){return _|(p&&g)<<1}}}function h(c,l,d){var g=Ah(c),p=Ah(l),_=[1,0,0],w=hd(g,p),P=ad(w,w),v=w[0],E=P-v*v;if(!E)return!d&&c;var m=e*P/E,S=-e*v/E,C=hd(_,w),b=ud(_,m),I=ud(w,S);Jg(b,I);var M=C,O=ad(b,M),x=ad(M,M),T=O*O-x*(ad(b,b)-1);if(!(T<0)){var A=Dh(T),G=ud(M,(-O-A)/x);if(Jg(G,b),G=Yg(G),!d)return G;var tt=c[0],$=l[0],nt=c[1],k=l[1],q;$<tt&&(q=tt,tt=$,$=q);var B=$-tt,z=mi(B-Zt)<Te,D=z||B<Te;if(!z&&k<nt&&(q=nt,nt=k,k=q),D?z?nt+k>0^G[1]<(mi(G[0]-tt)<Te?nt:k):nt<=G[1]&&G[1]<=k:B>Zt^(tt<=G[0]&&G[0]<=$)){var U=ud(M,(-O+A)/x);return Jg(U,b),[G,Yg(U)]}}}function u(c,l){var d=i?n:Zt-n,g=0;return c<-d?g|=1:c>d&&(g|=2),l<-d?g|=4:l>d&&(g|=8),g}return t1(o,a,s,i?[0,-n]:[-Zt,n-Zt])}function i1(n){return function(t){var e=new Zg;for(var i in n)e[i]=n[i];return e.stream=t,e}}function Zg(){}Zg.prototype={constructor:Zg,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 n1(n,t,e){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],s=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),s!=null&&n.clipExtent(null),HM(e,n.stream(Zy));var o=Zy.result(),a=Math.min(i/(o[1][0]-o[0][0]),r/(o[1][1]-o[0][1])),h=+t[0][0]+(i-a*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(r-a*(o[1][1]+o[0][1]))/2;return s!=null&&n.clipExtent(s),n.scale(a*150).translate([h,u])}function aT(n,t,e){return n1(n,[[0,0],t],e)}var r1=16,hT=Re(30*nr);function s1(n,t){return+t?lT(n,t):uT(n)}function uT(n){return i1({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}function lT(n,t){function e(i,r,s,o,a,h,u,c,l,d,g,p,_,w){var P=u-i,v=c-r,E=P*P+v*v;if(E>4*t&&_--){var m=o+d,S=a+g,C=h+p,b=Dh(m*m+S*S+C*C),I=da(C/=b),M=mi(mi(C)-1)<Te||mi(s-l)<Te?(s+l)/2:Oh(S,m),O=n(M,I),x=O[0],T=O[1],A=x-i,G=T-r,tt=v*A-P*G;(tt*tt/E>t||mi((P*A+v*G)/E-.5)>.3||o*d+a*g+h*p<hT)&&(e(i,r,s,o,a,h,x,T,M,m/=b,S/=b,C,_,w),w.point(x,T),e(x,T,M,m,S,C,u,c,l,d,g,p,_,w))}}return function(i){var r,s,o,a,h,u,c,l,d,g,p,_,w={point:P,lineStart:v,lineEnd:m,polygonStart:function(){i.polygonStart(),w.lineStart=S},polygonEnd:function(){i.polygonEnd(),w.lineStart=v}};function P(I,M){I=n(I,M),i.point(I[0],I[1])}function v(){l=NaN,w.point=E,i.lineStart()}function E(I,M){var O=Ah([I,M]),x=n(I,M);e(l,d,c,g,p,_,l=x[0],d=x[1],c=I,g=O[0],p=O[1],_=O[2],r1,i),i.point(l,d)}function m(){w.point=P,i.lineEnd()}function S(){v(),w.point=C,w.lineEnd=b}function C(I,M){E(r=I,M),s=l,o=d,a=g,h=p,u=_,w.point=E}function b(){e(l,d,c,g,p,_,s,o,r,a,h,u,r1,i),w.lineEnd=m,m()}return w}}var cT=i1({point:function(n,t){this.stream.point(n*nr,t*nr)}});function dT(n){return fT(function(){return n})()}function fT(n){var t,e=150,i=480,r=250,s,o,a=0,h=0,u=0,c=0,l=0,d,g,p=null,_=e1,w=null,P,v,E,m=Qy,S=.5,C=s1(x,S),b,I;function M(G){return G=g(G[0]*nr,G[1]*nr),[G[0]*e+s,o-G[1]*e]}function O(G){return G=g.invert((G[0]-s)/e,(o-G[1])/e),G&&[G[0]*bo,G[1]*bo]}function x(G,tt){return G=t(G,tt),[G[0]*e+s,o-G[1]*e]}M.stream=function(G){return b&&I===G?b:b=cT(_(d,C(m(I=G))))},M.clipAngle=function(G){return arguments.length?(_=+G?oT(p=G*nr,6*nr):(p=null,e1),A()):p*bo},M.clipExtent=function(G){return arguments.length?(m=G==null?(w=P=v=E=null,Qy):QM(w=+G[0][0],P=+G[0][1],v=+G[1][0],E=+G[1][1]),A()):w==null?null:[[w,P],[v,E]]},M.scale=function(G){return arguments.length?(e=+G,T()):e},M.translate=function(G){return arguments.length?(i=+G[0],r=+G[1],T()):[i,r]},M.center=function(G){return arguments.length?(a=G[0]%360*nr,h=G[1]%360*nr,T()):[a*bo,h*bo]},M.rotate=function(G){return arguments.length?(u=G[0]%360*nr,c=G[1]%360*nr,l=G.length>2?G[2]%360*nr:0,T()):[u*bo,c*bo,l*bo]},M.precision=function(G){return arguments.length?(C=s1(x,S=G*G),A()):Dh(S)},M.fitExtent=function(G,tt){return n1(M,G,tt)},M.fitSize=function(G,tt){return aT(M,G,tt)};function T(){g=Uy(d=XM(u,c,l),t);var G=t(a,h);return s=i-G[0]*e,o=r+G[1]*e,A()}function A(){return b=I=null,M}return function(){return t=n.apply(this,arguments),M.invert=t.invert&&O,T()}}function o1(n){return function(t,e){var i=Re(t),r=Re(e),s=n(i*r);return[s*r*Le(t),s*Le(e)]}}function a1(n){return function(t,e){var i=Dh(t*t+e*e),r=n(i),s=Le(r),o=Re(r);return[Oh(t*s,i*o),da(i&&e*s/i)]}}var gT=o1(function(n){return Dh(2/(1+n))});gT.invert=a1(function(n){return 2*da(n/2)});var h1=o1(function(n){return(n=Gy(n))&&n/Le(n)});h1.invert=a1(function(n){return n});function pT(){return dT(h1).scale(79.4188).clipAngle(179.999)}function u1(n,t){return[n,t]}u1.invert=u1;function vT(n,t,e){e=e||{};var i=e.units||"kilometers",r=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 r!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");var s=[];switch(n.type){case"GeometryCollection":return Ac(n,function(o){var a=vd(o,t,i,r);a&&s.push(a)}),En(s);case"FeatureCollection":return sh(n,function(o){var a=vd(o,t,i,r);a&&sh(a,function(h){h&&s.push(h)})}),En(s)}return vd(n,t,i,r)}function vd(n,t,e,i){var r=n.properties||{},s=n.type==="Feature"?n.geometry:n;if(s.type==="GeometryCollection"){var o=[];return Ac(n,function(_){var w=vd(_,t,e,i);w&&o.push(w)}),En(o)}var a=mT(s),h={type:s.type,coordinates:c1(s.coordinates,a)},u=new kg,c=u.read(h),l=ag(hg(t,e),"meters"),d=Xe.bufferOp(c,l,i),g=new vy;if(d=g.write(d),!l1(d.coordinates)){var p={type:d.type,coordinates:d1(d.coordinates,a)};return kn(p,r)}}function l1(n){return Array.isArray(n[0])?l1(n[0]):isNaN(n[0])}function c1(n,t){return typeof n[0]!="object"?t(n):n.map(function(e){return c1(e,t)})}function d1(n,t){return typeof n[0]!="object"?t.invert(n):n.map(function(e){return d1(e,t)})}function mT(n){var t=E_(n).geometry.coordinates,e=[-t[0],-t[1]];return pT().rotate(e).scale(yi)}function _T(n,t,e){e===void 0&&(e={});var i=Oi(n),r=Oi(t),s=Mg.union(i.coordinates,r.coordinates);return s.length===0?null:s.length===1?he(s[0],e.properties):og(s,e.properties)}function Ol(n,t,e){e===void 0&&(e={});var i=Oi(n),r=Oi(t),s=Mg.intersection(i.coordinates,r.coordinates);return s.length===0?null:s.length===1?he(s[0],e.properties):og(s,e.properties)}function yT(n,t,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),r=n[0],s=n[1],o=n[2],a=n[3],h=(s+a)/2,u=(r+o)/2,c=t*2/ei([r,h],[o,h],e),l=c*(o-r),d=t*2/ei([u,s],[u,a],e),g=d*(a-s),p=l/2,_=p*2,w=Math.sqrt(3)/2*g,P=o-r,v=a-s,E=3/4*_,m=w,S=(P-_)/(_-p/2),C=Math.floor(S),b=(C*E-p/2-P)/2-p/2+E/2,I=Math.floor((v-w)/w),M=(v-I*w)/2,O=I*w-v>w/2;O&&(M-=w/4);for(var x=[],T=[],A=0;A<6;A++){var G=2*Math.PI/6*A;x.push(Math.cos(G)),T.push(Math.sin(G))}for(var tt=[],$=0;$<=C;$++)for(var nt=0;nt<=I;nt++){var k=$%2===1;if(!(nt===0&&k)&&!(nt===0&&O)){var q=$*E+r-b,B=nt*m+s+M;if(k&&(B-=w/2),e.triangles===!0)ET([q,B],l/2,g/2,JSON.parse(i),x,T).forEach(function(D){e.mask?Ol(e.mask,D)&&tt.push(D):tt.push(D)});else{var z=wT([q,B],l/2,g/2,JSON.parse(i),x,T);e.mask?Ol(e.mask,z)&&tt.push(z):tt.push(z)}}}return En(tt)}function wT(n,t,e,i,r,s){for(var o=[],a=0;a<6;a++){var h=n[0]+t*r[a],u=n[1]+e*s[a];o.push([h,u])}return o.push(o[0].slice()),he([o],i)}function ET(n,t,e,i,r,s){for(var o=[],a=0;a<6;a++){var h=[];h.push(n),h.push([n[0]+t*r[a],n[1]+e*s[a]]),h.push([n[0]+t*r[(a+1)%6],n[1]+e*s[(a+1)%6]]),h.push(n),o.push(he([h],i))}return o}function ST(n,t,e,i){i===void 0&&(i={});for(var r=[],s=n[0],o=n[1],a=n[2],h=n[3],u=t/ei([s,o],[a,o],i),c=u*(a-s),l=e/ei([s,o],[s,h],i),d=l*(h-o),g=a-s,p=h-o,_=Math.floor(g/c),w=Math.floor(p/d),P=(g-_*c)/2,v=(p-w*d)/2,E=s+P,m=0;m<_;m++){for(var S=o+v,C=0;C<w;C++){var b=he([[[E,S],[E,S+d],[E+c,S+d],[E+c,S],[E,S]]],i.properties);i.mask?iM(i.mask,b)&&r.push(b):r.push(b),S+=d}E+=c}return En(r)}function CT(n,t,e){return e===void 0&&(e={}),ST(n,t,t,e)}function PT(n,t,e){e===void 0&&(e={});for(var i=[],r=t/ei([n[0],n[1]],[n[2],n[1]],e),s=r*(n[2]-n[0]),o=t/ei([n[0],n[1]],[n[0],n[3]],e),a=o*(n[3]-n[1]),h=0,u=n[0];u<=n[2];){for(var c=0,l=n[1];l<=n[3];){var d=null,g=null;h%2===0&&c%2===0?(d=he([[[u,l],[u,l+a],[u+s,l],[u,l]]],e.properties),g=he([[[u,l+a],[u+s,l+a],[u+s,l],[u,l+a]]],e.properties)):h%2===0&&c%2===1?(d=he([[[u,l],[u+s,l+a],[u+s,l],[u,l]]],e.properties),g=he([[[u,l],[u,l+a],[u+s,l+a],[u,l]]],e.properties)):c%2===0&&h%2===1?(d=he([[[u,l],[u,l+a],[u+s,l+a],[u,l]]],e.properties),g=he([[[u,l],[u+s,l+a],[u+s,l],[u,l]]],e.properties)):c%2===1&&h%2===1&&(d=he([[[u,l],[u,l+a],[u+s,l],[u,l]]],e.properties),g=he([[[u,l+a],[u+s,l+a],[u+s,l],[u,l+a]]],e.properties)),e.mask?(Ol(e.mask,d)&&i.push(d),Ol(e.mask,g)&&i.push(g)):(i.push(d),i.push(g)),l+=a,c++}h++,u+=s}return En(i)}function bT(n,t,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,r=e.property,s=e.weight;if(!n)throw new Error("points is required");if(H2(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");r=r||"elevation",i=i||"square",s=s||1;var o=Gn(n),a;switch(i){case"point":case"points":a=Lx(o,t,e);break;case"square":case"squares":a=CT(o,t,e);break;case"hex":case"hexes":a=yT(o,t,e);break;case"triangle":case"triangles":a=PT(o,t,e);break;default:throw new Error("invalid gridType")}var h=[];return sh(a,function(u){var c=0,l=0;sh(n,function(g){var p=i==="point"?u:fg(u),_=ei(p,g,e),w;if(r!==void 0&&(w=g.properties[r]),w===void 0&&(w=g.geometry.coordinates[2]),w===void 0)throw new Error("zValue is missing");_===0&&(c=w);var P=1/Math.pow(_,s);l+=P,c+=P*w});var d=hx(u);d.properties[r]=c/l,h.push(d)}),En(h)}function IT(n,t){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1])&&n.push(n[0]);const e=ie(t),i=he([n]);return hi(e,i)}function xT(n,t){const e=an(n);return mg(e,t,{units:"meters"}).geometry.coordinates}function tp(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=he([n]);return Px(t)}function MT(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=he([n]),i=S_(t).geometry.coordinates;return[i[0],i[1],i[2]??n[0][2]??0]}function f1(n,t,e,i){const[r,s,o]=n,a=oh(ie([r,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return i=i||[0,0,0],i[0]=a.geometry.coordinates[0],i[1]=a.geometry.coordinates[1],i[2]=o,i}function md(n,t){return ei(ie(n),ie(t),{units:"meters"})}function Dl(n,t){return nl(ie(n),ie(t))}function TT(n,t){return rl(an(n),an(t))}function NT(n,t){const e=ie(n),i=ie(t),r=dx(e,i),s=(n[2]+t[2])/2;return[...r.geometry.coordinates,s]}function OT(n,t){const e=ie(t),i=an(n);return wx(i,e,{units:"meters"})}function DT(n,t){const e=ie(n),i=an(t);return Sx(e,i,{units:"meters"})}function AT(n,t,e,i){const[r,s,o]=n,a=Bx(ie([r,s]),t,e,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return i=i||[0,0,0],i[0]=a.geometry.coordinates[0],i[1]=a.geometry.coordinates[1],i[2]=o,i}function g1(n,t){return O_(ie(n),ie(t),{units:"meters"})}function RT(n,t){return Gx(ie(n),ie(t))}function p1(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=Ol(he([n]),he([t]));if(e)return e.geometry.coordinates}function v1(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=_T(he([n]),he([t]));if(e)return e.geometry.coordinates}function m1(n,t=500,e="meters"){const i=vT(an(n),t,{units:e});if(i)return i.geometry.coordinates}function _1(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=xM(he([n]),he([t]));if(e)return e.geometry.coordinates}function y1(n,t,e=10,i="meters"){return lx(n,t,{steps:e,units:i}).geometry.coordinates}function ep(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=he([n]),i=he([t]);return Xx(e,i)?"oneBig":k_(e,i)?"twoBig":!1}function w1(n){const t=Ks(Go(n,["0"])),e=Ks(Go(n,["1"])),i=Ks(Go(n,["2"])),r=Ss(Go(n,["0"])),s=Ss(Go(n,["1"])),o=Ss(Go(n,["2"]));return{minPos:[t,e,i],maxPos:[r,s,o],center:[(t+r)*.5,(e+s)*.5,(i+o)*.5]}}function E1(n){const{minPos:t,maxPos:e,center:i}=w1(n);if(t.some(a=>!Number.isFinite(a)||e.some(h=>!Number.isFinite(h))||i.some(h=>!Number.isFinite(h)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const r=md(t,e);let s=r*.5;const o=Math.abs(t[2]-e[2]);return o!=0&&(s=Math.sqrt(r*r+o*o)*.5),{center:i,radius:s}}function S1(n,t){const e=Yr(n),i=Yr(t);return y.Vector.distance(e,i)}function Al(n,t){const e=[],i=n.length;let r=0;for(let s=0;s<i-1;++s){if(t===void 0||t==="GEODESIC"){const o=md(n[s],n[s+1]),a=Math.abs(n[s][2]-n[s+1][2]);if(a===0)r+=o;else{const h=Math.sqrt(o*o+a*a);r+=h}}else if(t==="RHUMB"){const o=g1(n[s],n[s+1]),a=Math.abs(n[s][2]-n[s+1][2]);if(a===0)r+=o;else{const h=Math.sqrt(o*o+a*a);r+=h}}else if(t==="NONE"){const o=S1(n[s],n[s+1]);r+=o}else console.warn(`未知的arcType: ${t},导致距离无法计算!`);e.push(r)}return e}function ip(n){const t="__getXyzFromPostion";let e=yn(n,t);return(!e||!y.Vector.equals(e[0],n))&&(e=[[...n],Yr(n)],Ur(n,t,e)),e[1]}class C1 extends Ha{constructor(t){super(t)}get propUiTree(){return this.uiTree}}class np extends Wa{constructor(t,e,i){super(t,e),this._property=i}get property(){return this._property}}class rp extends np{constructor(t,e){super(t,!1,e)}}class sp extends np{constructor(t,e){super(t,!0,e)}get groupChildren(){return this.children}}function P1(n,t){const e=new C1(t),i=n.getProperties("chinese"),r=[];for(let s of i)if(s instanceof Et){const o=new sp(e,s);o.d(()=>s.destroy()),e.children.push(o),r.push(o)}else{const o=new rp(e,s);e.children.push(o),o.d(()=>s.destroy())}for(;r.length>0;){const s=r.pop();if(!s)throw new Error("should not be here!");const o=s;if(!(o.property instanceof Et))throw new Error("!(treeItem.property instanceof GroupProperty)");for(let a of o.property.children)if(a instanceof Et){const h=new sp(e,a);h.d(()=>a.destroy()),o.groupChildren.push(h),r.push(h)}else{const h=new rp(e,a);o.groupChildren.push(h),h.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 Lh extends H{constructor(e){super();f(this,"_propTreeReact",this.dv(X(void 0)));this.d(()=>this._propTreeReact.value=void 0),this.dv(new ke(this.sceneObjectChanged,i=>{if(!i)return;const r=new H;return r.d(i.toDestroyEvent.don(()=>{this.sceneObject=void 0})),r})),this.d(this.sceneObjectChanged.don(i=>{this._propTreeReact.value=void 0,!(!i||!(i instanceof ft))&&(this._propTreeReact.value=P1(i,e))}))}get propTree(){return this._propTreeReact.value}get propTreeChanged(){return this._propTreeReact.changed}}(n=>{n.createDefaultProps=()=>({sceneObject:void 0})})(Lh||(Lh={})),Es(Lh.prototype,Lh.createDefaultProps);function op(n){return $s(n,(t,e)=>t[0]===e[0]&&t[1]===e[1],t=>[...t])}function b1(n,t){const e=new Array;for(let i of n)e.push(t(i));return e}function ap(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 LT(n,t,e){var r;((r=t.attachedViewers.values().toArray()[0])==null?void 0:r.getEngineObject(t))?e.call(n):(n.dispose(t.viewerAttached.don(()=>{e.call(n)})),n.dispose(t.createdEvent.don(()=>e.call(n))))}function FT(n,t,e,i=!0){i&&e(),n.dispose(t.disposableOn(e))}function kT(n,t){const{type:e,id:i}=n;if(e){const r=ft.create(e,i);if(r)return r.json=n,r;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function I1(n){const t=n.children&&af(n.children,i=>{if(!(i instanceof Gi))throw new Error("!(treeItem instanceof SceneTreeItem)");return!i.show})||!1,e=n.sceneTree.getSceneObjectShowFunc(n.sceneObject);return!t||e}class Gi extends Wa{constructor(e,i=!1,r,s,o=!0){super(e,i,r);f(this,"_dragDrop");f(this,"_showChangedNotAffectChildren",!1);f(this,"_showChangedNotAffectParent",!1);f(this,"_type",this.dv(X("Unknown")));f(this,"_isExport",this.dv(X(!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 h;const u=()=>{h&&(h(),h=void 0)};this.dispose(u),this.dispose(this.sceneObjectChanged.disposableOn(c=>{u(),c&&(h=mt([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 l of this.children)l instanceof Gi&&(l._showChangedNotAffectParent=!0,l.show=c,l._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Gi&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=I1(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new ke(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const c=new H;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof N){const l=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};l(),c.dispose(this.sceneObject.showChanged.disposableOn(l))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof N){const l=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};l(),c.dispose(this.sceneObject.enabledChanged.disposableOn(l))}return c})),this.childrenChangedEvent.disposableOn(()=>{const c=I1(this);this._showChangedNotAffectChildren=!0,this.show=c,this._showChangedNotAffectChildren=!1});{const c=()=>{let l="Unknown";this.sceneObject?l=this.sceneObject.typeName:this.children&&(l="Folder"),this._type.value=l};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(i){console.error(`sceneTreeItem.jsonStr error ${i}`,i)}}get json(){const e=this.children&&[...this.children].filter(i=>i.isExport).map(i=>i.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 i of e.children){const r=new Gi(this.tree,!0);r.json=i,this.children.push(r)}}}clone(){try{const e=new Gi(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,i){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(i&&i.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return i&&this.children.push(i),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",i);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",i);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,i)}}(n=>{n.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:de(void 0)})})(Gi||(Gi={})),Es(Gi.prototype,Gi.createDefaultProps);function x1(n,t,e){let{offsetY:i}=t;if(!t.target||!("clientTop"in t.target))return"none";i+=2,i+=t.target.clientTop;let r="none";return n.children?i<=e*.3?r="before":i>=e*.7?!n.uiTreeObject.collapsed&&n.children.length>0?r="inner":r="after":r="inner":i<=e*.5?r="before":r="after",r}class M1 extends s0{constructor(t){super(),this._treeItem=t;const{dragStartDataManager:e}=this._treeItem.sceneTree;let i="none";const r=this.disposeVar(sm(()=>{this._treeItem.uiTreeObject.moveToPositionMode=i,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${i});`)},200));function s(o){i!==o&&(i=o,r.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 h=a.data.value,u=this._treeItem,{tree:c}=u;if(c){const l=[...c.selectedItems];~l.indexOf(h)||l.push(h);const d=x1(u,o,c.itemDivHeight);if(d!=="none"&&Ha.canMoveToTreeItems(l,u,d)){o.dataTransfer.dropEffect="move",s(d);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 h=a.data.value,u=this._treeItem,{tree:c}=u;if(!c)return;const l=[...c.selectedItems];~l.indexOf(h)||l.push(h);const d=x1(u,o,c.itemDivHeight);d!=="none"&&Ha.canMoveToTreeItems(l,u,d)&&(Ha.moveToTreeItems(l,u,d),a.data=void 0,s("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{i="none",r.restart()}))}}function GT(n){if(!(n instanceof Gi))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new M1(n)}function BT(n){let t=!1;return n&&("show"in n?t=n.show??!0:"enabled"in n&&(t=n.enabled??!0)),t}function VT(n,t){n&&("show"in n?n.show=t:"enabled"in n&&(n.enabled=t))}const zT=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function UT(n){const t=[],{root:e={}}=n,i=[e];for(;i.length>0;){const r=i.pop();if(!r)throw new Error("!todo");if(r.children){for(let s of r.children)if(s.children&&i.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&&zT.includes(o)&&t.push(s.sceneObj)}}}return t}async function jT(n,t){const e=UT(n);let i=0;const r=e.length;for(let s of e)if(++i,t){const o=i/r;t(o,i,r)}}class T1 extends H{constructor(e,i){super();f(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=i}get sceneTree(){return this._sceneTree}}class qT extends H{constructor(e){super();f(this,"_jsonLoadingEvent",this.disposeVar(new N));f(this,"_setJsonProcessing",this.disposeVar(wn(async(e,i)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),i&&await e.promise(this._sceneTree.preloadFunc(i)),this._setJson(i),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=i=>{this._jsonLoadingEvent.emit({type:"error",error:i})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(i){console.error(`json数据装配时发生错误!error: ${i}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new dr("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function WT(n){return n.name+"_clone"}function hp(n,t,e){if(n instanceof Gi)return n.insertNewTreeItem(t,e);{const i={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return n.insertNewTreeItem(i[t],e)}}function HT(n){[n,...n.getDescendants()].forEach(t=>t.destroy())}const vn=class vn extends Ha{constructor(e,i,r,s){super(r);f(this,"_jsonLoading",this.disposeVar(new qT(this)));f(this,"createSceneObjectFunc",vn.defaultCreateSceneObjectFunc);f(this,"createTreeItemDragDropFunc",vn.defaultCreateTreeItemDragDropFunc);f(this,"preloadFunc",vn.defaultPreload);f(this,"getSceneObjectShowFunc",vn.defaultGetSceneObjectShow);f(this,"setSceneObjectShowFunc",vn.defaultSetSceneObjectShow);f(this,"getSceneTreeItemCloneNameFunc",vn.defaultGetSceneTreeItemCloneNameFunc);f(this,"debug",!1);f(this,"_contextMenu",this.disposeVar(new T1(this,this.projectManager)));f(this,"_showPropUiOnSelecting",this.disposeVar(X(!0)));this._name=e,this._dragStartDataManager=i,this._projectManager=s,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var a,h;window.lssn=this.lastSelectedItem,window.lsso=(a=this.lastSelectedItem)==null?void 0:a.sceneObject,this.debug&&console.log(((h=this.lastSelectedItem)==null?void 0:h.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(a=>{for(let h of a){const u=h,{sceneObject:c}=u;c&&o.deleteSceneObject(c)&&c.destroy()&&_c(c,void 0);for(let l of u.getDescendants()){const{sceneObject:d}=l;d&&o.deleteSceneObject(d)&&d.destroy()&&_c(d,void 0)}HT(h)}})),this.dispose(this.itemsAdded.disposableOn(a=>{for(let h of a){const u=h;u.sceneObject&&o.addSceneObject(u.sceneObject)&&_c(u.sceneObject,u)}})),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 i=this.getDescendants();let r;for(let s of i)if(s.sceneObject&&s.sceneObject.id===e){r=s;break}return r}get dragStartDataManager(){return this._dragStartDataManager}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var r;e.root=e.root||{};const i=e.root.children??[];this.root.resetChildren(!0);for(let s of i){const o=new Gi(this,!0);o.json=s,(r=this.root.children)==null||r.push(o)}}testAddNewTreeItem(e,i){const r=e||this.lastSelectedItem||this.root;return r?hp(r,i):!1}addNewTreeItem(e,i,r,s){const o=e||this.lastSelectedItem||this.root;if(o&&hp(o,i)){const a=new Gi(this,r);if(a.sceneObject=s,!hp(o,i,a))throw new Error("currentTreeItem.insertNewTreeItem return false!");return a}}createSceneObjectTreeItem(e,i,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${r?r.id:"root"})`);return}const a=ft.create(e,i);return a?this.addNewTreeItem(r,s??"FolderInnerOrAfter",!0,a):void 0}createGroupTreeItem(e,i,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${r?r.id:"root"})`);return}const a=this.addNewTreeItem(r,s??"FolderInnerOrAfter",!0);if(!a){console.warn("addNewTreeItem error!");return}return a.name=e??"未命名组节点",a}createSceneObjectTreeItemFromClass(e,i,r,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(r,o))return;const a=ft.createFromClass(e,i);return a?this.addNewTreeItem(r,o,!0,a):void 0}createSceneObjectTreeItemFromJson(e,i,r){const s=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,s))return;const o=ft.createFromJson(e);return console.log(o),o?this.addNewTreeItem(i,r??"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 i of e)this.destroySceneObjectTreeItem(i)}};f(vn,"defaultCreateSceneObjectFunc",kT),f(vn,"defaultCreateTreeItemDragDropFunc",GT),f(vn,"defaultPreload",jT),f(vn,"defaultGetSceneObjectShow",BT),f(vn,"defaultSetSceneObjectShow",VT),f(vn,"defaultGetSceneTreeItemCloneNameFunc",WT);let Rl=vn;const up={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class XT extends H{constructor(e){super();f(this,"_currentPosition",this.disposeVar(ye(void 0)));f(this,"_currentRotation",this.disposeVar(ye(void 0)));f(this,"_currentHeading",this.disposeVar(X(void 0)));f(this,"_isRotating",this.disposeVar(X(!1)));f(this,"_isGround",this.disposeVar(X(!1)));f(this,"_startPosition",[0,0,0]);f(this,"_startRotation",[0,0,0]);f(this,"_processing",this.disposeVar(wn(async(e,i,r,s)=>{const{currentPosition:o,currentRotation:a}=this;if(!o||s<=0||!a){this._currentPosition.value=i,this._currentRotation.value=r;return}const h=this._startPosition;h.splice(0,3,...o);const u=this._startRotation;u.splice(0,3,...a);let c=Date.now();const l=Dl(h,i);this._currentHeading.value=l;const g=md(h,i)/s,p=[r[0]-u[0],r[1]-u[1],r[2]-u[2]],_=i[2]-h[2];await e.promise(new Promise(w=>{e.disposer.dispose(sc(async()=>{let P=Date.now()-c;P=P<0?0:P,P=P>s?s:P;const v=P*g,E=f1(h,v,l);if(this.isGround&&E){const m=await this._esviewer.getTerrainHeight([E[0],E[1]]);this._currentPosition.value=[E[0],E[1],m??0]}else E&&(E[2]+=_*(P/s)),this._currentPosition.value=E;if(this.isRotating){const[m,S,C]=p,b=P/s;this._currentRotation.value=[u[0]+m*b,u[1]+S*b,u[2]+C*b]}P===s&&(this._currentPosition.value=i,this.isRotating&&(this._currentRotation.value=r),this.isRotating=!1,this.isGround=!1,w())}))}))})));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,i,r){this._processing.restart(void 0,e,i,r)}cancel(){this._processing.cancel()}}function N1(n){let t=0;function e(i,r){r++,t=Math.max(r,t),i.forEach(s=>{Array.isArray(s)&&e(s,r)})}return e(n,0),t}const us=class us extends se{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_area",this.dv(X(0)));f(this,"_perimeter",this.dv(X(0)));this.d(ko(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var i;const e=[];this.editingBindMode=="doublePoints"?e.push(pt.DoublePointsAppend,pt.DoublePointsModify):this.editingBindMode=="lineString"?e.push(pt.LineStringAppend,pt.LineStringInsert,pt.Translation):this.editingBindMode=="circular"?(e.push(pt.CircularAppend,pt.CircularInsert,pt.Translation),this.supportEditingModes().includes(pt.HeightModify)&&e.push(pt.HeightModify)):this.editingBindMode=="visibility"?e.push(pt.VisibilityAppend,pt.VisibilityModify):this.editingBindMode=="scatter"&&e.push(pt.ScatterAppend,pt.ScatterModify),(i=this.activeViewer)==null||i.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 tp([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=Al(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]],i=Al(e,"GEODESIC");return i[i.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const i=p1(this.points,e);if(!i)return;const r=i[0][0][0];if(Array.isArray(r)){const s=[...i],o=[];return s.forEach(a=>{const h=a[0].map(u=>[...u,0]);o.push(h)}),o}else return[[...i][0].map(a=>[...a,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const i=v1(this.points,e);if(!i)return;const r=i[0][0][0];if(Array.isArray(r)){const s=[...i],o=[];return s.forEach(a=>{const h=a[0].map(u=>[...u,0]);o.push(h)}),o}else return[[...i][0].map(a=>[...a,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let i=[...e];const r=e[0],s=e[e.length-1];r[0]===s[0]&&r[1]===s[1]&&r[2]===s[2]||i.push(r);const o=_1([...this.points,this.points[0]],[...i]);if(!o)return{status:"undefined",positions:void 0};const a=[...o];if(N1(a)===3){const h=a.map(d=>d.map(g=>[...g,0]));if(h.length<=1)return{status:"notIncluded",positions:h};const u=h[0],c=h[1];return ep([...u],[...c])==="oneBig"?{status:"included",positions:h}:{status:"notIncluded",positions:h}}else if(N1(a)===4){const u=[...a.map(l=>l.map(d=>d.map(g=>[...g,0])))],c=[];return u.forEach(l=>{c.push(l[0])}),{status:"notIncluded",positions:c}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,i){if(this.points&&this.points.length>=2){const r=m1(this.points,e,i);return r?[r[0].map(s=>[...s,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const i=ep(this.points,e);return i==="oneBig"?!0:i==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new rt([this,"editing"],"编辑",!1),new gt([this,"points"],"位置数组",us.defaults.points,void 0,!0)],style:[...e.style,new Et([],"点样式"),new rt([this,"pointed"],"开启",!1),new F([this,"pointSize"],"点大小",1),new kt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new qt([this,"pointColor"],"点颜色",[1,1,1,1]),new qt([this,"pointOutlineColor"],"轮廓颜色",us.defaults.pointStyle.outlineColor),new F([this,"pointOutlineWidth"],"轮廓宽度",us.defaults.pointStyle.outlineWidth),new Et([],"线样式"),new rt([this,"stroked"],"开启线样式",!0),new rt([this,"strokeGround"],"贴地",!1),new F([this,"strokeWidth"],"线宽",1),new kt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new qt([this,"strokeColor"],"线颜色",[1,1,1,1]),new Et([],"面样式"),new rt([this,"filled"],"开启",!1),new rt([this,"fillGround"],"贴地",!1),new qt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new Et([],"点样式集合"),new Mt([this,"pointMaterial"],"点材质"),new gt([this,"pointMaterialParams"],"点材质参数"),new Et([],"线样式集合"),new Mt([this,"strokeMaterial"],"线材质"),new gt([this,"strokeMaterialParams"],"线材质参数"),new Et([],"面样式集合"),new Mt([this,"fillMaterial"],"面材质"),new gt([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}};f(us,"createDefaultProps",()=>({...se.createDefaultProps(),pointed:!1,pointStyle:Rt({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:Rt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:Rt({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:ic([])})),f(us,"type",us.register("ESGeoVector",us,{chsName:"地理矢量",tags:["ESObjects"],description:"地理矢量"})),f(us,"supportEditingModes",[...se.supportEditingModes,pt.Translation]);let Ut=us;const va=class va extends se{constructor(){super(...arguments);f(this,"_statusDis",this.dv(X(!0)));f(this,"_smoothMoveEvent",this.dv(new N));f(this,"_smoothMoveWithRotationEvent",this.dv(new N));f(this,"_smoothMoveOnGroundEvent",this.dv(new N));f(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new N));f(this,"_automaticLandingEvent",this.dv(new N));f(this,"_smoothMoveKeepPitchEvent",this.dv(new N));f(this,"_smoothMoveRelativelyEvent",this.dv(new N));f(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new N));f(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var i;const e=[];this.editingBindMode=="singlePoint"?(e.push(pt.Place,pt.Translation),["ESLocationMeasurement"].includes(this.typeName)||e.push(pt.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(pt.Scale)):this.editingBindMode=="doublePoints"&&e.push(pt.DoublePointsAppend,pt.DoublePointsModify),(i=this.activeViewer)==null||i.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,i){this._smoothMoveEvent.emit(e,i)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,i,r){this._smoothMoveWithRotationEvent.emit(e,i,r)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,i,r,s){this._smoothMoveOnGroundEvent.emit(e,i,r,s)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,i,r,s,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,i,r,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,i){this._smoothMoveKeepPitchEvent.emit(e,i)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,i){this._smoothMoveRelativelyEvent.emit(e,i)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,i,r){this._smoothMoveRelativelyWithRotationEvent.emit(e,i,r)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",location:[...e.location,new rt([this,"editing"],"是否编辑"),new St([],()=>this.automaticLanding(),[],"自动落地"),new Xa([this,"position"],"位置数组",[0,0,0]),new kf([this,"rotation"],"姿态数组",[0,0,0]),new Mi([this,"scale"],"缩放",[1,1,1]),new F([this,"minVisibleDistance"],"最小可见距离",0),new F([this,"maxVisibleDistance"],"最大可见距离",0)],more:[...e.more,new St(["numbers","number"],(i,r)=>this.smoothMove(i,r),[[0,0,0],0],"平滑移动","smoothMove"),new St(["numbers","number"],(i,r)=>this.smoothMoveKeepPitch(i,r),[[0,0,0],0],"固定方向平滑移动","smoothMoveKeepPitch"),new St(["numbers","numbers","number"],(i,r,s)=>this.smoothMoveWithRotation(i,r,s),[[0,0,0],[0,0,0],0],"平滑偏移","smoothMoveWithRotation"),new St(["number","number","number","string"],(i,r,s,o)=>this.smoothMoveOnGround(i,r,s,o),[0,0,0,""],"贴地平滑移动","smoothMoveOnGround"),new St(["numbers","number","number","number","string"],(i,r,s,o,a)=>this.smoothMoveWithRotationOnGround(i,r,s,o,a),[[0,0,0],0,0,0,""],"贴地平滑偏移","smoothMoveWithRotationOnGround"),new St(["numbers","number"],(i,r)=>this.smoothMoveRelatively(i,r),[[0,0,0],0],"smoothMoveRelatively","smoothMoveRelatively"),new St(["numbers","numbers","number"],(i,r,s)=>this.smoothMoveRelativelyWithRotation(i,r,s),[[0,0,0],[0,0,0],0],"smoothMoveRelativelyWithRotation","smoothMoveRelativelyWithRotation"),new rt([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}};f(va,"createDefaultProps",()=>({...se.createDefaultProps(),pointed:!1,pointStyle:Rt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:It([0,0,0]),rotation:It([0,0,0]),scale:It([1,1,1]),minVisibleDistance:X(0),maxVisibleDistance:X(0)})),f(va,"type",va.register("ESObjectWithLocation",va,{chsName:"对象位置",tags:["ESObjects"],description:"对象位置"})),f(va,"supportEditingModes",[...se.supportEditingModes,pt.Place,pt.Translation,pt.Rotation,pt.Scale,pt.DoublePointsAppend,pt.DoublePointsModify]);let _t=va;const Uh=class Uh extends _t{getESProperties(){const t={...super.getESProperties()};return{...t,style:[...t.style,new Et([],"点样式集合"),new rt([this,"pointed"],"开启点样式",!1),new F([this,"pointSize"],"点大小",1),new kt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new qt([this,"pointColor"],"点颜色",[1,1,1,1]),new Et([],"线样式集合"),new rt([this,"stroked"],"开启线样式",!1),new rt([this,"strokeGround"],"是否贴地(线)",!1),new F([this,"strokeWidth"],"线宽",1),new kt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new qt([this,"strokeColor"],"线颜色",[1,1,1,1]),new Et([],"面样式集合"),new rt([this,"filled"],"开启填充样式",!1),new rt([this,"fillGround"],"是否贴地",!1),new qt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new Et([],"点样式"),new Mt([this,"pointMaterial"],"点材质",""),new gt([this,"pointMaterialParams"],"点材质参数",{}),new Et([],"线样式"),new Mt([this,"strokeMaterial"],"线材质",""),new gt([this,"strokeMaterialParams"],"线材质参数",{}),new Et([],"填充样式"),new Mt([this,"fillMaterial"],"面材质",""),new gt([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}};f(Uh,"createDefaultProps",()=>({..._t.createDefaultProps(),pointed:!1,pointStyle:Rt({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:Rt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:Rt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Uh,"type",Uh.register("ESLocalVector",Uh,{chsName:"本地矢量",tags:["ESObjects"],description:"本地矢量对象"}));let Fh=Uh;const jl=class jl extends Fh{};f(jl,"type",jl.register("ESLocalVector2D",jl,{chsName:"本地矢量2D",tags:["ESObjects"],description:"本地矢量2D对象"}));let Vs=jl;const YT=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],JT=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],jh=class jh extends _t{constructor(){super(...arguments);f(this,"_widgetEvent",this.dv(new N))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new rt([this,"screenRender"],"屏幕渲染",!0),new rt([this,"sizeByContent"],"尺寸自适应",!0),new ti([this,"size"],"尺寸大小",[100,100]),new ti([this,"anchor"],"偏移比例",[.5,1]),new ti([this,"offset"],"像素偏移",[0,0]),new kt([this,"renderMode"],JT,"渲染模式",0),new kt([this,"rotationType"],YT,"漫游旋转类型",1),new Mt([this,"actorTag"],"绑定对象"),new Mt([this,"socketName"],"插槽名称"),new Mi([this,"positionOffset"],"位置偏移"),new Mi([this,"rotationOffset"],"相对姿态")],more:[...e.more,new F([this,"zOrder"],"排序",0)]}}};f(jh,"createDefaultProps",()=>({..._t.createDefaultProps(),screenRender:!0,size:It([100,100]),anchor:It([.5,1]),offset:It([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:It([0,0,0]),rotationOffset:It([0,0,0])})),f(jh,"type",jh.register("ESLabel",jh,{chsName:"标签",tags:["ESObjects"],description:"标签对象"}));let An=jh;const qh=class qh extends ft{constructor(t){super(t)}};f(qh,"createDefaultProps",()=>({...ft.createDefaultProps(),show:!0,fillStyle:Rt({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(qh,"type",qh.register("ESTestObject",qh,{chsName:"测试",tags:["ESObjects"],description:""}));let lp=qh;const ls=class ls extends se{constructor(e){super(e);f(this,"_refreshTilesetEvent",this.dv(new N));f(this,"_tilesetReadyEvent",this.dv(new N));f(this,"_supportEdit",this.dv(X(!0)));f(this,"_highlightFeatureEvent",this.dv(new N));f(this,"_highlightFeatureAndFlyToEvent",this.dv(new N));f(this,"_strokeFeatureEvent",this.disposeVar(new N));f(this,"_getFeatureTableEvent",this.dv(new N));f(this,"_featureTableResultEvent",this.dv(new N));f(this,"_getMaterialNameListEvent",this.disposeVar(new N));f(this,"_setFeatureStyleEvent",this.dv(new N));f(this,"_setFeatureColorEvent",this.dv(new N));f(this,"_setFeatureVisableEvent",this.dv(new N));f(this,"_resetFeatureStyleEvent",this.dv(new N));f(this,"setMaterialInfoEvent",this.ad(new N));f(this,"_setMaterialEvent",this.disposeVar(new N));f(this,"_clippingPlanesId",this.dv(X("")));f(this,"_clippingPlaneIds",this.dv(X([])));f(this,"_flattenedPlaneId",this.dv(X("")));f(this,"_flattenedPlaneEnabled",this.dv(X(!1)));f(this,"_clippingPlaneId",this.dv(X("")));f(this,"_excavateId",this.dv(It([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[pt.Translation,pt.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,i){this._highlightFeatureEvent.emit(e,i)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,i,r,s){this._highlightFeatureAndFlyToEvent.emit(e,i,r,s)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,i=[1,0,0,1]){this._strokeFeatureEvent.emit(e,i)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const i=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{i(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const i=new H;i.d(this.getMaterialNameListEvent.don(r=>{r!=="start"&&(i.destroy(),e(r))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{i.isDestroyed()||(i.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e){this._setFeatureStyleEvent.emit(e)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,i){this._setFeatureColorEvent.emit(e,typeof i=="string"?JSON.parse(i):i)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,i){this._setFeatureVisableEvent.emit(e,typeof i=="string"?JSON.parse(i):i)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(i=>{const r=new H;r.ad(this.setMaterialInfoEvent.donce(s=>{r.destroy(),i(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={...up}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new ai([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new kt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new kt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new gt([this,"materialOverrideMap"],"材质替换",ls.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new gt([this,"url"],"服务地址",ls.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new rt([this,"editing"],"编辑",!1,!0),new Mi([this,"offset"],"偏移",[0,0,0],!0),new kf([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new gt([this,"materialParams"],"materialParams",ls.defaults.materialParams),new St(["string","string"],(i,r)=>this.highlightFeature(i,r),["","rgba(255,0,0,1)"],"highlightFeature"),new St(["string","string"],(i,r)=>this.setFeatureColor(i,r),["",""],"setFeatureColor"),new St(["string","string"],(i,r)=>this.setFeatureVisable(i,r),["",""],"setFeatureVisable"),new St([],()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new Et([],"ue"),new St([],()=>this.refreshTileset(),[],"refreshTileset"),new Mt([this,"actorTag"]),new rt([this,"highlight"],"是否高亮"),new qt([this,"highlightColor"]),new F([this,"highlightID"]),new Et([],"czm"),new Et([],"可视化"),new ti([this,"czmImageBasedLightingFactor"],"反射强度"),new F([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new gt([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new F([this,"czmMaximumMemoryUsage"],"最大内存"),new Et([],"常用"),new kt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new gt([this,"czmStyleJson"],"czmStyle"),new rt([this,"czmBackFaceCulling"]),new rt([this,"czmSkipLevelOfDetail"]),new F([this,"cacheBytes"],"最大缓存",536870912),new Et([],"调试信息"),new rt([this,"czmDebugShowBoundingVolume"]),new rt([this,"czmDebugShowContentBoundingVolume"]),new Et([],"clippingPlanes"),new rt([this,"clippingPlaneEnabled"]),new rt([this,"unionClippingRegions"]),new qt([this,"clippingPlaneEdgeColor"]),new F([this,"clippingPlaneEdgeWidth"])]}}};f(ls,"createDefaultProps",()=>({...se.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:It([1,0,0,1]),offset:ye([0,0,0]),rotation:It([0,0,0]),czmImageBasedLightingFactor:It([1,1]),czmEnvironmentMapManager:de(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:Rt({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:It([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:de({}),featureIdLabel:0,splitDirection:"NONE"})),f(ls,"type",ls.register("ES3DTileset",ls,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"3DTileset"})),f(ls,"supportEditingModes",[...se.supportEditingModes,pt.Translation,pt.Rotation]);let rr=ls;const Wh=class Wh extends _t{constructor(e){super(e);f(this,"_isFlyInCreated",this.dv(X(!1)));f(this,"_readyEvent",this.dv(new N));this.collision=!1,this.d(this.createdEvent.don(()=>{setTimeout(()=>{if((this.editing??!1)||!this.position)this.d(ko([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 kt([this,"mode"],[["柱状警告","cylinder"],["圆形警告","circle"]],"模式","cylinder"),new F([this,"radius"],"半径",10)]}}};f(Wh,"createDefaultProps",()=>({..._t.createDefaultProps(),mode:"cylinder",radius:10})),f(Wh,"type",Wh.register("ESAlarm",Wh,{chsName:"报警",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警告类"}));let cp=Wh;const ma=class ma extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"radius"],"半径",1),new kt([this,"mode"],[["扫描","scan"],["扩散","diffuse"]],"模式",ma.defaults.mode)]}}};f(ma,"createDefaultProps",()=>({..._t.createDefaultProps(),radius:1,mode:"scan",collision:!1})),f(ma,"type",ma.register("ESApertureEffect",ma,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"光圈特效"}));let dp=ma;const _a=class _a extends Ut{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new F([this,"area"],"面积",0,!1,!0),new F([this,"perimeter"],"周长",0,!1,!0)]}}};f(_a,"createDefaultProps",()=>({...Ut.createDefaultProps(),fillStyle:Rt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:Rt({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),f(_a,"type",_a.register("ESGeoPolygon",_a,{chsName:"地理多边形",tags:["ESObjects"],description:"地理多边形"})),f(_a,"supportEditingModes",[...Ut.supportEditingModes,pt.CircularAppend,pt.CircularInsert]);let le=_a;const Us=class Us extends le{get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:Us.defaults.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle??Us.defaults.fillStyle,materialParams:t??Us.defaults.fillStyle.materialParams}}constructor(t){super(t)}};f(Us,"createDefaultProps",()=>({...le.createDefaultProps(),stroked:!0,filled:!0,units:It(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:Rt({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:Rt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(Us,"type",Us.register("ESAreaMeasurement",Us,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:"面积测量"}));let fp=Us;const Hh=class Hh extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"general",more:[...t.more,new Et([],"czm"),new Lu([this,"image"],"图片"),new Mi([this,"translation"],"偏移")]}}};f(Hh,"createDefaultProps",()=>({..._t.createDefaultProps(),image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",translation:It([0,0,0])})),f(Hh,"type",Hh.register("ESBlastParticleSystem",Hh,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"粒子爆炸"}));let gp=Hh;const Rr=class Rr extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new rt([this,"reverse"],"反转",Rr.defaults.reverse),new Mi([this,"size"],"尺寸",Rr.defaults.size),new qt([this,"edgeColor"],"边框颜色",Rr.defaults.edgeColor),new F([this,"edgeWidth"],"边框宽度",Rr.defaults.edgeWidth),new Mt([this,"targetID"],"瓦片图层",Rr.defaults.targetID)]}}};f(Rr,"createDefaultProps",()=>({..._t.createDefaultProps(),reverse:!1,edgeColor:It([1,1,1,1]),edgeWidth:2,size:It([10,10,10]),targetID:""})),f(Rr,"type",Rr.register("ESBoxClipping",Rr,{chsName:"体剖切",tags:["ESObjects","_ES_Impl_Cesium"],description:"体剖切,体裁剪,体裁切,盒裁切"}));let pp=Rr;const ql=class ql extends _t{constructor(){super(...arguments);f(this,"_thumbnail",this.dv(X("")));f(this,"_duration",this.dv(X(1)));f(this,"_resetWithCurrentCameraEvent",this.dv(new N));f(this,"_captureEvent",this.dv(new N))}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,i="default"){this.flyInEvent.emit(e,-1,i)}get resetWithCurrentCameraEvent(){return this._resetWithCurrentCameraEvent}resetWithCurrentCamera(){this._resetWithCurrentCameraEvent.emit()}get captureEvent(){return this._captureEvent}capture(e,i){this._captureEvent.emit(e,i)}execOnCreating(){this.resetWithCurrentCamera()}async initByCurrent(){this.resetWithCurrentCamera()}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"ESCameraView"),new St([],()=>this.resetWithCurrentCamera(),[],"设置为当前视角"),new St(["number","number"],(i,r)=>this.capture(i,r),[64,64],"获取缩略图"),new Mt([this,"thumbnail"],"缩略图","",!0),new F([this,"duration"],"飞行时间",1,!0)]}}};f(ql,"type",ql.register("ESCameraView",ql,{chsName:"视角",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角"}));let _d=ql;class yd extends H{constructor(e,i,r){super();f(this,"_view",this.dv(new _d));if(this.d(e.components.disposableAdd(this._view)),this._view.name=(r==null?void 0:r.name)??`视角${e.views.length+1}`,i){const a=this._view,h=i;a.duration=h.duration??1,a.position=h.position,a.rotation=h.rotation??[0,0,0],a.thumbnail=h.thumbnail??"",a.name=h.name}else{const a=(r==null?void 0:r.size)??[64,64];this.d(Ba(()=>{this._view.resetWithCurrentCamera(),this._view.capture(a[0],a[1])}))}const s=this._view,o=this.dv(je(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 sr=class sr extends ft{constructor(e){super(e);f(this,"_currentViewIndex",this.dv(X(-1)));f(this,"_viewWrappers",this.dv(new xu));f(this,"_currentViewWrapper",this.dv(X(void 0)));f(this,"_container",this.dv(X(void 0)));this.initProcessing();{const i=()=>{if(!this._currentViewWrapper.value)return;this._viewWrappers.indexOf(this._currentViewWrapper.value)===-1&&(this._currentViewWrapper.value=void 0)};i(),this.d(this._viewWrappers.changedEvent.don(i))}{const i=()=>{const r=this._currentViewWrapper.value;this._currentViewIndex.value=r?this._getIndex(r):-1};i(),this.d(this._viewWrappers.changedEvent.don(i)),this.d(this._currentViewWrapper.changed.don(i))}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 b1(this._viewWrappers,e=>e.viewInfo)}get viewsChanged(){return this._viewWrappers.changedEvent}set views(e){if(e.length===this._viewWrappers.length){const i=this._viewWrappers;if(e.every((r,s)=>{const o=i.get(s).view;return r.duration===o.duration&&ap(r.position,o.position)&&ap(r.rotation,o.rotation)&&r.thumbnail===o.thumbnail&&r.name===o.name}))return}this.clearAllViews();for(let i of e)this._viewWrappers.push(new yd(this,i))}_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}`,i=[64,64]){this._viewWrappers.push(new yd(this,void 0,{name:e,size:i}))}update(e,i,r=[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 i&&(s.view.name=i),s.view.resetWithCurrentCamera(),s.view.capture(r[0],r[1]),!0}addView(){this._viewWrappers.push(new yd(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 yd(this))}setCurrentView(e){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const i=this._viewWrappers.get(e);return this._currentViewWrapper.value=i,!0}resetView(e){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const i=this._viewWrappers.get(e);i.view.resetWithCurrentCamera(),i.view.capture()}resetViewName(e,i){if(e>=this._viewWrappers.length||e<0){console.warn("index >= this._viewWrappers.length || index < 0");return}const r=this._viewWrappers.get(e);r.view.name=i}updateView(e,i){if(e>=this._viewWrappers.length||e<0)return console.warn("index >= this._viewWrappers.length || index < 0"),!1;const r=this._viewWrappers.get(e);return r.view.position=i.position,r.view.rotation=i.rotation??[0,0,0],r.view.duration=i.duration??1,r.view.thumbnail=i.thumbnail??"",r.view.name=i.name??"",!0}flyToView(e){if(this.setCurrentView(e)){if(!this._currentViewWrapper.value)throw new Error("this._currentViewWrapper.value");const i=this._currentViewWrapper.value.view.duration;this._currentViewWrapper.value.view.flyIn(i,this.flyMode??sr.defaults.flyMode)}}flyToPrevView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const i=this._getIndex(e);return this.loop??sr.defaults.loop?(this.flyToView((this._viewWrappers.length+i-1)%this._viewWrappers.length),!0):i-1<0?!1:(this.flyToView(i-1),!0)}moveToPreView(){const e=this._currentViewWrapper.value;if(!e)return;const i=this._getIndex(e);if(i===0)return;const r=this._viewWrappers.splice(i-1,1,e)[0];this._viewWrappers.set(i,r)}moveToNextView(){const e=this._currentViewWrapper.value;if(!e)return;const i=this._getIndex(e);if(i===this._viewWrappers.length-1)return;const r=this._viewWrappers.splice(i+1,1,e)[0];this._viewWrappers.set(i,r)}flyToNextView(){const e=this._currentViewWrapper.value;if(!e)return this.flyToView(0),!0;const i=this._getIndex(e);return this.loop??sr.defaults.loop?(this.flyToView((i+1)%this._viewWrappers.length),!0):i+1>this._viewWrappers.length-1?!1:(this.flyToView(i+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 i=this._getIndex(e);if(i===-1){console.warn("index === -1");return}this.deleteView(i)}transitionImageUrl(e){return ft.context.getStrFromEnv(e)}_flyStep(e){var o;if(!this.flyToNextView())return this.playing=!1,Promise.resolve();const i=this.intervalTime??sr.defaults.intervalTime,s=((((o=this._currentViewWrapper.value)==null?void 0:o.viewInfo.duration)??0)+i)*1e3;return e.promise(Nu(s)).then(()=>this._flyStep(e))}initProcessing(){const e=this.dv(wn(async r=>this._flyStep(r))),i=()=>{this.playing?e.restart():e.cancel()};i(),this.d(this.playingChanged.don(i))}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new kt([this,"flyMode"],[["默认","default"],["直线飞行","uniform"]],"飞行模式",sr.defaults.flyMode),new St([],()=>this.addView(),[],"添加视角"),new St(["number"],i=>this.insertView(i),[0],"插入视角"),new St([],()=>this.clearAllViews(),[],"清空所有视角"),new St([],()=>this.insertView(this.currentViewIndex+1),[],"当前位置插入视角"),new St([],()=>this.flyToPrevView(),[],"上一个视角"),new St([],()=>this.flyToNextView(),[],"下一个视角"),new St([],()=>this.moveToPreView(),[],"当前视角移动到上一个视角"),new St([],()=>this.moveToNextView(),[],"当前视角移动到下一个视角"),new St(["number"],i=>this.flyToView(i),[0],"飞入指定视角"),new St(["number"],i=>this.setCurrentView(i),[0],"设置当前视角"),new St([],()=>this.deleteCurrentView(),[],"删除当前视角"),new St(["number"],i=>this.deleteView(i),[0],"删除指定视角"),new St(["number"],i=>this.resetView(i),[0],"重置视角"),new F([this,"currentViewIndex"],"当前序号",-1,!1,!0),new e0([this,"playing"],()=>this.stop(),[this,"loop"],"播放",sr.defaults),new rt([this,"playing"],"是否播放"),new St([],()=>this.stop(),[],"停止"),new rt([this,"loop"],"是否循环"),new F([this,"intervalTime"],"间隔时间"),new gt([this,"views"],"视角集合",[],void 0,!0)]}}};f(sr,"createDefaultProps",()=>({...ft.createDefaultProps(),playing:!1,loop:!0,intervalTime:5,flyMode:"default"})),f(sr,"type",sr.register("ESCameraViewCollection",sr,{chsName:"视角集合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"视角集合"}));let wd=sr;const Xh=class Xh extends _t{constructor(e){super(e);f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new F([this,"aspectRatio"],"宽高比",1.77778),new F([this,"fov"],"横向夹角",90),new F([this,"far"],"视野长度",100),new F([this,"near"],"近面距离",5)]}}};f(Xh,"createDefaultProps",()=>({..._t.createDefaultProps(),fov:90,aspectRatio:1.77778,far:100,near:5,collision:!1})),f(Xh,"type",Xh.register("ESCameraVisibleRange",Xh,{chsName:"摄像头可视域",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"摄像头可视域"}));let vp=Xh;const Yh=class Yh extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new kt([this,"mode"],[["警车","policeCar"]],"模式","policeCar")]}}};f(Yh,"createDefaultProps",()=>({..._t.createDefaultProps(),mode:"policeCar",allowPicking:!0})),f(Yh,"type",Yh.register("ESCar",Yh,{chsName:"车辆",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"警车等基础车辆模型"}));let Ed=Yh;const ya=class ya extends Ut{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new F([this,"height"],"高度",10)],coordinate:[...e.coordinate,new F([this,"area"],"面积",0,!1,!0),new F([this,"perimeter"],"周长",0,!1,!0)]}}};f(ya,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:10,filled:!0,fillStyle:Rt({material:"",materialParams:{},ground:!0,color:[1,1,1,1]})})),f(ya,"type",ya.register("ESClassification",ya,{chsName:"倾斜单体化",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平尾箭头"})),f(ya,"supportEditingModes",[...Ut.supportEditingModes,pt.CircularAppend,pt.CircularInsert,pt.HeightModify]);let Sd=ya;const Jh=class Jh extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new rt([this,"showArrow"],"显示箭头",!0),new qt([this,"edgeColor"],"线框颜色",[1,1,1,1]),new F([this,"edgetWidth"],"线框宽度",2),new F([this,"width"],"裁剪宽度",200),new F([this,"height"],"裁剪高度",200),new Mt([this,"targetID"],"瓦片图层","")]}}};f(Jh,"createDefaultProps",()=>({..._t.createDefaultProps(),showArrow:!0,edgeColor:It([1,1,1,1]),edgetWidth:2,width:200,height:200,targetID:""})),f(Jh,"type",Jh.register("ESClippingPlane",Jh,{chsName:"裁切",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESClippingPlane"}));let mp=Jh;class $T extends H{constructor(t,e,i){super();const r=document.createElement("div");r.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${i.id}) container`);{const h=()=>{const c=` ${e.cssText}
69
69
  ${e.cssAllInitial?"all: initial;":""}
@@ -354,7 +354,7 @@ export type ESJTimeIntervalCollectionJsonType = {
354
354
  \`\`\`
355
355
  ${U1}
356
356
  \`\`\`
357
- `,hN="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",Bt=class Bt extends se{constructor(e){super(e);f(this,"_flyToFeatureEvent",this.dv(new N));f(this,"_flyToFeatureIndexEvent",this.dv(new N));f(this,"_features",this.disposeVar(de(void 0)));f(this,"pickedInfoType","FeatureCollection");f(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(e,i,r){this._flyToFeatureEvent.emit(e,i,r)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(e,i){this._flyToFeatureIndexEvent.emit(e,i)}get features(){return this._features.value}set features(e){this._features.value=e}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var i;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const e=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:Gf(this.url)?this.features=JSON.parse(this.url):await fetch(ft.context.getStrFromEnv(this.url),{signal:e}).then(r=>r.json()).then(r=>{this.features=r}).catch(r=>{r.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",r)}),this.pickedInfoType=((i=this.features)==null?void 0:i.type)??"FeatureCollection"}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",dataSource:[...e.dataSource,new gt([this,"url"],"服务地址",Bt.defaults.url),new F([this,"minFeatureVisibleDistance"],"要素最小可视距离",Bt.defaults.minFeatureVisibleDistance),new F([this,"maxFeatureVisibleDistance"],"要素最大可视距离",Bt.defaults.maxFeatureVisibleDistance),new kt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new kt([this,"classificationType"],Bt.classificationTypes,"贴地附着目标",Bt.defaults.classificationType)],style:[...e.style,new Et([],"点样式集合"),new rt([this,"textShow"],"是否显示",Bt.defaults.textShow),new ti([this,"textAnchor"],"锚点",Bt.defaults.anchor),new Mt([this,"textProperty"],"标注显示属性",Bt.defaults.textStyle.textProperty),new Mt([this,"textDefaultText"],"默认文本",Bt.defaults.textStyle.defaultText),new qt([this,"textColor"],"文本颜色",Bt.defaults.textStyle.color),new qt([this,"textBackgroundColor"],"文本背景颜色",Bt.defaults.textStyle.backgroundColor),new Mt([this,"textFontStyle"],"字体样式",Bt.defaults.textStyle.fontStyle),new Mt([this,"textFontWeight"],"字体粗细",Bt.defaults.textStyle.fontWeight),new F([this,"textFontSize"],"字体大小",Bt.defaults.textStyle.fontSize),new ti([this,"textOffset"],"像素偏移",Bt.defaults.textStyle.offset),new Et([],"点图片样式集合"),new rt([this,"imageShow"],"是否显示",Bt.defaults.imageShow),new ti([this,"imageAnchor"],"锚点",Bt.defaults.imageStyle.anchor),new gt([this,"imageUrl"],"图片地址",Bt.defaults.imageStyle.url),new ti([this,"imageSize"],"图片大小",Bt.defaults.imageStyle.size),new ti([this,"imageOffset"],"像素偏移",Bt.defaults.imageStyle.offset),new Et([],"线样式集合"),new rt([this,"stroked"],"是否显示",Bt.defaults.stroked),new rt([this,"strokeGround"],"贴地",Bt.defaults.strokeStyle.ground),new F([this,"strokeWidth"],"线宽",Bt.defaults.strokeStyle.width),new kt([this,"strokeWidthType"],Bt.strokeStyleWidthTypes,"线宽类型"),new qt([this,"strokeColor"],"线颜色",Bt.defaults.strokeStyle.color),new Mt([this,"strokeMaterial"],"线材质",Bt.defaults.strokeStyle.material),new gt([this,"strokeMaterialParams"],"线材质参数",Bt.defaults.strokeStyle.materialParams),new Et([],"面样式集合"),new rt([this,"filled"],"是否显示",Bt.defaults.filled),new rt([this,"fillGround"],"贴地",Bt.defaults.fillStyle.ground),new qt([this,"fillColor"],"填充颜色",Bt.defaults.fillStyle.color),new Mt([this,"fillMaterial"],"填充材质",Bt.defaults.fillStyle.material),new gt([this,"fillMaterialParams"],"填充材质参数",Bt.defaults.fillStyle.materialParams)],more:[...e.more,new Et([],"标注文本样式"),new Mt([this,"textFontFamily"],"字体",Bt.defaults.textStyle.fontFamily),new Et([],"通用"),new to([this,"loadFuncStr"],"loadFnStr",U1,aN,!0)]}}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}get textProperty(){return this.textStyle.textProperty}set textProperty(e){this.textStyle={...this.textStyle,textProperty:e}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(e){this.textStyle={...this.textStyle,defaultText:e}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(e){this.textStyle={...this.textStyle,color:e}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(e){this.textStyle={...this.textStyle,backgroundColor:e}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(e){this.textStyle={...this.textStyle,fontFamily:e}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(e){this.textStyle={...this.textStyle,fontStyle:e}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(e){this.textStyle={...this.textStyle,fontWeight:e}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(e){this.textStyle={...this.textStyle,fontSize:e}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(e){this.textStyle={...this.textStyle,anchor:e}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(e){this.textStyle={...this.textStyle,offset:e}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(e){this.imageStyle={...this.imageStyle,url:e}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(e){this.imageStyle={...this.imageStyle,size:e}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(e){this.imageStyle={...this.imageStyle,anchor:e}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(e){this.imageStyle={...this.imageStyle,offset:e}}get imageOffsetChanged(){return this.imageStyleChanged}};f(Bt,"createDefaultProps",()=>({...se.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:hN,stroked:!0,strokeStyle:Rt({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:Rt({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:Rt({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:Rt({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})),f(Bt,"type",Bt.register("ESGeoJson",Bt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),f(Bt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),f(Bt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let kl=Bt;const xa=class xa extends Ut{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_height",this.disposeVar(X(0)));{const i=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};i(),this.ad(this.pointsChanged.don(i))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}};f(xa,"createDefaultProps",()=>({...Ut.createDefaultProps(),stroked:!0,strokeStyle:Rt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(xa,"type",xa.register("ESHeightMeasurement",xa,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),f(xa,"supportEditingModes",[...Ut.supportEditingModes,pt.DoublePointsAppend,pt.DoublePointsModify]);let Vp=xa;const eu=class eu extends Vs{constructor(e){super(e);f(this,"_area",this.dv(X(0)));f(this,"_perimeter",this.dv(X(0)));f(this,"editingBindMode","doublePoints");const i=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};i(),this.d(this.radiusChanged.don(i))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(e=10,i){return y1([...this.position],this.radius,e,i)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",basic:[...e.basic,new F([this,"radius"],"圆半径",1,!0)],coordinate:[...e.coordinate,new rt([this,"editing"],"是否编辑"),new Xa([this,"position"],"三维坐标",[0,0,0],!0),new F([this,"area"],"面积",0,!1,!0),new F([this,"perimeter"],"周长",0,!1,!0)]}}};f(eu,"createDefaultProps",()=>({...Vs.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:Rt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),f(eu,"type",eu.register("ESLocalCircle",eu,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let zp=eu;const iu=class iu extends Vs{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Km([this,"points"],"坐标",[])]}}};f(iu,"createDefaultProps",()=>({...Vs.createDefaultProps(),points:op([]),filled:!0})),f(iu,"type",iu.register("ESLocalPolygon",iu,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let Gl=iu;const nu=class nu extends Fh{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Lf([this,"points"],"本地位置数组")]}}};f(nu,"createDefaultProps",()=>({...Fh.createDefaultProps(),points:ic(void 0),filled:!0})),f(nu,"type",nu.register("ESLocalPolygonZ",nu,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Up=nu;const ru=class ru extends Vs{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"width"],"宽度"),new F([this,"height"],"高度")]}}};f(ru,"createDefaultProps",()=>({...Vs.createDefaultProps(),width:5e5,height:3e5,filled:!0})),f(ru,"type",ru.register("ESLocalRectangle",ru,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let jp=ru;const fs=class fs extends Ut{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_distance",this.dv(X(0)));f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const i=()=>{if(this.points&&this.points.length>=2){const r=Al(this.points,"GEODESIC"),s=r[r.length-1];this._distance.value=s}else this._distance.value=0};i(),this.d(this.pointsChanged.don(i))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new F([this,"height"],"高度",10),new F([this,"width"],"宽度",10),new kt([this,"materialMode"],fs.materialModes,"模式",fs.defaults.materialMode)],coordinate:[...e.coordinate,new F([this,"distance"],"距离",0,!1,!0)]}}};f(fs,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:Rt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(fs,"type",fs.register("ESPipeFence",fs,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),f(fs,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),f(fs,"supportEditingModes",[...Ut.supportEditingModes,pt.LineStringAppend,pt.LineStringInsert]);let Md=fs;const qs=class qs extends rr{constructor(e){super(e);f(this,"_setLayerVisibleEvent",this.dv(new N));f(this,"_setLayerColorEvent",this.dv(new N))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,i){this._setLayerVisibleEvent.emit(e,i)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,i){this._setLayerColorEvent.emit(e,i)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"ESPipeserTileset"),new St(["string","string"],(i,r)=>this.setLayerVisible(i,r),["",""],"setLayerVisible"),new St(["string","string"],(i,r)=>this.setLayerColor(i,r),["",""],"setLayerColor"),new kt([this,"colorMode"],qs.colorModes,"colorMode",qs.defaults.colorMode,!0)]}}};f(qs,"createDefaultProps",()=>({...rr.createDefaultProps(),colorMode:"default"})),f(qs,"type",qs.register("ESPipeserTileset",qs,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),f(qs,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let qp=qs;const Ws=class Ws extends Ut{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new F([this,"area"],"面积",0,!1,!0),new F([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new F([this,"height"],"高度",10),new kt([this,"materialMode"],Ws.materialModes,"模式","danger")]}}};f(Ws,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),f(Ws,"type",Ws.register("ESPolygonFence",Ws,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),f(Ws,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),f(Ws,"supportEditingModes",[...Ut.supportEditingModes,pt.CircularAppend,pt.CircularInsert,pt.HeightModify]);let Td=Ws;const Oo=class Oo extends Ut{constructor(e){super(e);f(this,"_deprecated",["ground"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"通用","通用"),new rt([this,"ground"],"是否贴地"),new rt([this,"outlineTranslucent"],"轮廓线半透明"),new F([this,"height"],"高度"),new F([this,"extrudedHeight"],"拉伸高度"),new fr([this,"rectangle"],"范围",Oo.defaults.rectangle,!0),new F([this,"stRotation"],"纹理旋转角度"),new F([this,"rotation"],"旋转角度"),new rt([this,"pointEditing"],"是否单点编辑")]}}};f(Oo,"createDefaultProps",()=>({...Ut.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:ye(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),f(Oo,"type",Oo.register("ESRectangle",Oo,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),f(Oo,"supportEditingModes",[...Ut.supportEditingModes,pt.DoublePointsAppend,pt.DoublePointsModify]);let Wp=Oo;const su=class su extends le{getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new gt([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};f(su,"createDefaultProps",()=>({...le.createDefaultProps(),innerRings:Wv([])})),f(su,"type",su.register("ESPolygonWithHole",su,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let Hp=su;const Do=class Do extends le{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new N));f(this,"_stopEvent",this.dv(new N));f(this,"_surfaceArea",this.disposeVar(X(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(e){this._surfaceArea.value=e}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"表面积测量","表面积测量"),new St([],()=>this.start(),[],"开始计算"),new F([this,"interpolation"],"插值距离",Do.defaults.interpolation),new F([this,"offsetHeight"],"偏移高度",Do.defaults.offsetHeight)]}}};f(Do,"createDefaultProps",()=>({...le.createDefaultProps(),interpolation:.5,offsetHeight:0,units:It(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:Rt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(Do,"type",Do.register("ESSurfaceAreaMeasurement",Do,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Xp=Do;const Ao=class Ao extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"downloadProgress"],"下载进度",Ao.defaults.downloadProgress,!0,!0),new gt([this,"importOptions"],"导入参数",Ao.defaults.importOptions,void 0,!0)],dataSource:[...t.dataSource,new gt([this,"url"],"路径")]}}};f(Ao,"createDefaultProps",()=>({..._t.createDefaultProps(),url:"",importOptions:de({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),f(Ao,"type",Ao.register("ESDatasmithRuntimeModel",Ao,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Yp=Ao;const zi=class zi extends Gl{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new kt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",zi.defaults.waterType),new F([this,"frequency"],"频率",zi.defaults.frequency),new ai([this,"amplitude"],.01,[0,1],"振幅",zi.defaults.amplitude),new ai([this,"flowDirection"],1,[0,360],"流向",zi.defaults.flowDirection),new ai([this,"waveVelocity"],.01,[0,1],"波动频率",zi.defaults.waveVelocity),new ai([this,"specularIntensity"],.01,[0,1],"镜面反射强度",zi.defaults.specularIntensity),new ai([this,"murkiness"],.1,[0,10],"水体浑浊度",zi.defaults.murkiness),new F([this,"flowSpeed"],"水流速度",zi.defaults.flowSpeed),new qt([this,"waterColor"],"水的底色",zi.defaults.waterColor),new gt([this,"waterImage"],"水的图片",zi.defaults.waterImage)]}}};f(zi,"createDefaultProps",()=>({...Gl.createDefaultProps(),allowPicking:!0,waterImage:de(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),f(zi,"type",zi.register("ESDynamicWater",zi,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Jp=zi;const Ui=class Ui extends le{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new kt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ui.defaults.waterType),new F([this,"frequency"],"频率",Ui.defaults.frequency),new ai([this,"amplitude"],.01,[0,1],"振幅",Ui.defaults.amplitude),new ai([this,"flowDirection"],1,[0,360],"流向",Ui.defaults.flowDirection),new ai([this,"waveVelocity"],.01,[0,1],"波动频率",Ui.defaults.waveVelocity),new ai([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ui.defaults.specularIntensity),new ai([this,"murkiness"],.1,[0,10],"水体浑浊度",Ui.defaults.murkiness),new F([this,"flowSpeed"],"水流速度",Ui.defaults.flowSpeed),new qt([this,"waterColor"],"水的底色",Ui.defaults.waterColor),new gt([this,"waterImage"],"水的图片",Ui.defaults.waterImage)]}}};f(Ui,"createDefaultProps",()=>({...le.createDefaultProps(),allowPicking:!0,waterImage:de({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),f(Ui,"type",Ui.register("ESGeoWater",Ui,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let $p=Ui;const Ma=class Ma extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"downloadProgress"],"下载进度",Ma.defaults.downloadProgress,!0,!0),new Mt([this,"levelName"],"levelName",""),new F([this,"levelLoadDistance"],"levelLoadDistance",1e3),new Mi([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...t.dataSource,new gt([this,"url"],"url","")]}}};f(Ma,"createDefaultProps",()=>({..._t.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:It([0,0,0]),levelLoadDistance:1e3})),f(Ma,"type",Ma.register("ESLevelRuntimeModel",Ma,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let Kp=Ma;const Rn=class Rn extends zs{constructor(e){super(e);f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new F([this,"radius"],"半径",Rn.defaults.radius),new F([this,"sides"],"圆边数",Rn.defaults.sides),new F([this,"speed"],"材质速度",Rn.defaults.speed),new kt([this,"materialMode"],Rn.materialModes,"材质模式",Rn.defaults.materialMode),new gt([this,"materialImage"],"材质图片和重复度",Rn.defaults.materialImage)]}}};f(Rn,"createDefaultProps",()=>({...zs.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:Rt({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:Rt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(Rn,"type",Rn.register("ESPipeline",Rn,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),f(Rn,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Qp=Rn;const gs=class gs extends Ut{constructor(e){super(e);f(this,"editingBindMode","visibility")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new qt([this,"visibleColor"],"可视区域颜色",gs.defaults.visibleColor),new qt([this,"invisibleColor"],"遮挡区域颜色",gs.defaults.invisibleColor),new F([this,"heightOffset"],"视点高度偏移",gs.defaults.heightOffset)]}}};f(gs,"createDefaultProps",()=>({...Ut.createDefaultProps(),visibleColor:It([0,1,0,1]),invisibleColor:It([1,0,0,1]),heightOffset:0})),f(gs,"type",gs.register("ESVisibilityAnalysis",gs,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),f(gs,"supportEditingModes",[...Ut.supportEditingModes,pt.VisibilityAppend,pt.VisibilityModify]);let Zp=gs;const ou=class ou extends le{constructor(e){super(e);f(this,"_startEvent",this.dv(new N));f(this,"_clearEvent",this.dv(new N));f(this,"_volume",this.disposeVar(X(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(e){this._volume.value=e}get volumeChanged(){return this._volume.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"通用","通用"),new F([this,"planeHeight"],"基准面高程",void 0,!0),new F([this,"gridWidth"],"采样间距 m"),new F([this,"cutVolume"],"挖方",0,!1,!0),new F([this,"fillVolume"],"填方",0,!1,!0),new F([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new F([this,"progress"],"计算进度",0,!1,!0),new St([],()=>this.start(),[],"开始分析"),new St([],()=>this.clear(),[],"清空分析结果"),new rt([this,"depthTest"],"是否开启深度检测")]}}};f(ou,"createDefaultProps",()=>({...le.createDefaultProps(),planeHeight:X(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:Rt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(ou,"type",ou.register("ESVolumeMeasurement",ou,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let tv=ou;const au=class au extends fa{constructor(e){super(e);f(this,"_human",this.dv(new fa));f(this,"_poi",this.dv(new Fl));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:i,_poi:r}=this;this.d(Y([i,"show"],[this,"show"])),this.d(Y([r,"show"],[this,"show"])),this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([r,"allowPicking"],[this,"allowPicking"])),this.d(mt([i,"scale"],[this,"scale"])),this.d(mt([r,"scale"],[this,"scale"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(Y([r,"collision"],[this,"collision"])),this.d(mt([i,"flyInParam"],[this,"flyInParam"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(Y([i,"animation"],[this,"animation"])),this.d(Y([i,"mode"],[this,"mode"])),this.d(Y([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(Y([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(Y([r,"name"],[this,"name"])),this.d(Y([r,"mode"],[this,"poiMode"])),this.d(Y([r,"autoAnchor"],[this,"autoAnchor"])),this.d(Y([r,"screenRender"],[this,"screenRender"])),this.d(Y([r,"size"],[this,"size"])),this.d(Y([r,"anchor"],[this,"anchor"])),this.d(Y([r,"sizeByContent"],[this,"sizeByContent"])),this.d(Y([r,"renderMode"],[this,"renderMode"])),this.d(Y([r,"rotationType"],[this,"rotationType"])),this.d(Y([r,"zOrder"],[this,"zOrder"])),this.d(Y([r,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(Y([r,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(mt([i,"position"],[this,"position"])),this.d(mt([i,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{i.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{i.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,h)=>{i.smoothMoveOnGround(s,o,a,h)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,h,u)=>{i.smoothMoveWithRotationOnGround(s,o,a,h,u)})),this.d(this.automaticLandingEvent.don(()=>{i.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new kt([this,"poiMode"],Fl.modes,"poi模式","SquareH01"),new F([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};f(au,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:Rt({}),autoAnchor:!0,screenRender:!0,size:It([100,100]),anchor:It([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...fa.createDefaultProps()})),f(au,"type",au.register("ESHumanPoi",au,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let ev=au;const Br=class Br extends le{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"depth"],"深度",Br.defaults.depth),new F([this,"interpolation"],"插值",Br.defaults.interpolation),new F([this,"opacity"],"透明度",Br.defaults.opacity),new gt([this,"sideImage"],"侧面图片",Br.defaults.sideImage),new gt([this,"bottomImage"],"底面图片",Br.defaults.bottomImage)]}}};f(Br,"createDefaultProps",()=>({...le.createDefaultProps(),depth:100,sideImage:Rt({url:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:Rt({url:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),f(Br,"type",Br.register("ESPit",Br,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Gh=Br;const hu=class hu extends Gh{constructor(e){super(e);f(this,"_excavate",this.dv(new Ll));f(this,"_pit",this.dv(new Gh));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:i,_pit:r}=this;this.d(Y([i,"show"],[this,"show"])),this.d(Y([r,"show"],[this,"show"])),this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([r,"allowPicking"],[this,"allowPicking"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(Y([r,"collision"],[this,"collision"])),this.d(mt([r,"points"],[this,"points"])),this.d(Y([i,"points"],[this,"points"])),this.d(Y([r,"pointed"],[this,"pointed"])),this.d(Y([i,"pointed"],[this,"pointed"])),this.d(Y([r,"pointStyle"],[this,"pointStyle"])),this.d(Y([i,"pointStyle"],[this,"pointStyle"])),this.d(Y([r,"stroked"],[this,"stroked"])),this.d(Y([i,"stroked"],[this,"stroked"])),this.d(Y([r,"strokeStyle"],[this,"strokeStyle"])),this.d(Y([i,"strokeStyle"],[this,"strokeStyle"])),this.d(Y([r,"filled"],[this,"filled"])),this.d(Y([r,"fillStyle"],[this,"fillStyle"])),this.d(Y([i,"fillStyle"],[this,"fillStyle"])),this.d(Y([i,"mode"],[this,"mode"])),this.d(Y([i,"targetID"],[this,"targetID"])),this.d(Y([r,"depth"],[this,"depth"])),this.d(Y([r,"sideImage"],[this,"sideImage"])),this.d(Y([r,"bottomImage"],[this,"bottomImage"])),this.d(Y([r,"opacity"],[this,"opacity"])),this.d(Y([r,"interpolation"],[this,"interpolation"])),this.d(mt([r,"flyInParam"],[this,"flyInParam"])),this.d(mt([r,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{r.flyIn(s)})),this.d(this.flyToEvent.don(s=>{r.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{r.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{r.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new kt([this,"mode"],Ll.modes,"模式","in"),new Mt([this,"targetID"],"瓦片图层","")]}}};f(hu,"createDefaultProps",()=>({...Gh.createDefaultProps(),mode:"in",targetID:""})),f(hu,"type",hu.register("ESHole",hu,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let iv=hu;const nv={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},uN=async(n,t,e,i)=>{try{const r=window.localStorage.getItem("Authorization");let s=n+`${nv.layerconfigfind}?tileServiceName=${t}`;e&&(s+=`&earthdstoken=${encodeURIComponent(i)}`);const o={headers:{...!e&&r?{Authorization:r}:{}},mode:"cors"},h=await(await fetch(s,o)).text();return JSON.parse(h)}catch(r){console.error(r)}},lN=async(n,t,e,i,r)=>{try{const s=window.localStorage.getItem("Authorization");let o=n+nv.layerconfigsave;const a=r??{};e&&(o+=`?earthdstoken=${encodeURIComponent(i)}`);const h={method:"POST",headers:{"Content-Type":"application/json",...!e&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:t,layerConfig:JSON.stringify(a)})},c=await(await fetch(o,h)).text();return JSON.parse(c)}catch(s){console.error(s)}},cN=async(n,t,e)=>{try{const i=window.localStorage.getItem("Authorization");let r=n;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),h=JSON.parse(a);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(i){console.error(i)}},dN=async(n,t,e,i,r)=>{try{const s={tileServiceName:t,featureId:e},o=window.localStorage.getItem("Authorization");let a=n+nv.featureproperty;i&&(a+=`?earthdstoken=${encodeURIComponent(r)}`);const u=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!i&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),c=JSON.parse(u);if(c.status=="ok")return c.data;console.error(c.data.status);return}catch(s){console.error(s)}},uu=class uu extends rr{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new rr));f(this,"_ids",this.dv(Rt([])));f(this,"_useEarthDSToken",this.dv(X(!1)));f(this,"_earthdstoken",this.dv(X("")));f(this,"_visJson",this.disposeVar(X({})));f(this,"_highlightInner3DtilesetEvent",this.dv(new N));f(this,"_removeHighlightInner3DtilesetEvent",this.dv(new N));f(this,"_tilesetServePort",this.dv(X("")));{const i=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{i()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const i=this._es3DTileset;this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(Y([i,"actorTag"],[this,"actorTag"])),this.d(Y([i,"materialMode"],[this,"materialMode"])),this.d(Y([i,"highlight"],[this,"highlight"])),this.d(Y([i,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Y([i,"highlightID"],[this,"highlightID"])),this.d(Y([i,"highlightColor"],[this,"highlightColor"])),this.d(mt([i,"offset"],[this,"offset"])),this.d(mt([i,"rotation"],[this,"rotation"])),this.d(Y([i,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Y([i,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Y([i,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Y([i,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Y([i,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Y([i,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Y([i,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Y([i,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Y([i,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Y([i,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Y([i,"cacheBytes"],[this,"cacheBytes"])),this.d(Y([i,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Y([i,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Y([i,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Y([i,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Y([i,"materialParams"],[this,"materialParams"])),this.d(mt([i,"supportEdit"],[this,"supportEdit"])),this.d(mt([i,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([i,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([i,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([i,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([i,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([i,"excavateId"],[this,"excavateId"]))}{const i=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{i.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{i.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{i.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{i.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{i.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{i.resetFeatureStyle(...r)})),this.d(this.setFeatureStyleEvent.don((...r)=>{i.setFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{i.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{i.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{i.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{i.calcFlyInParam(...r)}))}{const i=this._es3DTileset;this.d(i.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(i.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const i=()=>{this.es3DTileset.show=this.show};i(),this.d(this.showChanged.don(()=>{i()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,i){var r;if((r=this.layerConfig)!=null&&r.length){const s={};s[i[0].value]=i[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(e,typeof i=="string"?JSON.parse(i):i)}async getFeatureProperty(e){return await dN(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const e=await uN(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await lN(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,i){var a,h,u;const r=await e.pick(i),s=r.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=r==null?void 0:r.tilesetPickInfo)==null?void 0:a.id],{featureId:(h=r==null?void 0:r.tilesetPickInfo)==null?void 0:h.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}):{featureId:(u=r==null?void 0:r.sceneObject)==null?void 0:u.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await cN(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var r;if(!this.url||typeof this.url!="string")return;const e=(r=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:r[1],i=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${i}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return i}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!i)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return i}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return i}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new gt([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};f(uu,"createDefaultProps",()=>({...rr.createDefaultProps(),layerConfig:de([])})),f(uu,"type",uu.register("ESRtsTileset",uu,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let rv=uu;function fN(n){return typeof n=="number"&&!isNaN(n)}const lu=class lu extends rr{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(t){this._innerSetJson(t)}async init(t,e){this.featureId=e;const i=await t.getFeatureProperty(e);this.uiShowprops=i.allFields.map(o=>({featureClassName:o.featureClassName,fields:o.fields.map(a=>({key:a.name,type:a.type,value:a.type!="Double"?a.value:fN(a.value)?Number(a.value.toFixed(3)):""}))})),this.datasetName=i.datasetName,t.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{t.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const r=t.tileServiceIp,s=t.tilesetServePort;if(!s)throw new Error("ESRtsFeatureEditing: port is not defined");this.url=`${r}:${s}/featuretiles/${this.featureId}/tileset.json`,this.allowPicking=!0,this.d(this.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)})),this.d(()=>{this.editing=!1,t.removeHighlightDSFeature(this)})}constructor(t){super(t)}};f(lu,"createDefaultProps",()=>({...rr.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:Rt({}),changeMaterial:de(void 0),uiShowprops:Rt({}),props:Rt({})})),f(lu,"type",lu.register("ESRtsFeatureEditing",lu,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let sv=lu;const gN=async(n,t,e)=>{try{const i=window.localStorage.getItem("Authorization");let r=n;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),h=JSON.parse(a);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(i){console.error(i)}},Hl=class Hl extends rr{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new rr));f(this,"_tilesetServePort",this.dv(X("")));f(this,"_useEarthDSToken",this.dv(X(!1)));f(this,"_earthdstoken",this.dv(X("")));{const i=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{i()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const i=this._es3DTileset;this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(Y([i,"actorTag"],[this,"actorTag"])),this.d(Y([i,"materialMode"],[this,"materialMode"])),this.d(Y([i,"highlight"],[this,"highlight"])),this.d(Y([i,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Y([i,"highlightID"],[this,"highlightID"])),this.d(Y([i,"highlightColor"],[this,"highlightColor"])),this.d(mt([i,"offset"],[this,"offset"])),this.d(mt([i,"rotation"],[this,"rotation"])),this.d(Y([i,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Y([i,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Y([i,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Y([i,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Y([i,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Y([i,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Y([i,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Y([i,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Y([i,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Y([i,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Y([i,"cacheBytes"],[this,"cacheBytes"])),this.d(Y([i,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Y([i,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Y([i,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Y([i,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Y([i,"materialParams"],[this,"materialParams"])),this.d(mt([i,"supportEdit"],[this,"supportEdit"])),this.d(mt([i,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([i,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([i,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([i,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([i,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([i,"excavateId"],[this,"excavateId"]))}{const i=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{i.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{i.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{i.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{i.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{i.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{i.resetFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{i.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{i.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{i.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{i.calcFlyInParam(...r)}))}{const i=this._es3DTileset;this.d(i.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(i.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const i=()=>{this.es3DTileset.show=this.show};i(),this.d(this.showChanged.don(()=>{i()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}async getport(){const e=await gN(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var r;if(!this.url||typeof this.url!="string")return;const e=(r=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:r[1],i=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${i}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return i}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return i}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!i)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return i}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};f(Hl,"type",Hl.register("ESMsTileset",Hl,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let ov=Hl;const j1={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
357
+ `,hN="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",Gt=class Gt extends se{constructor(e){super(e);f(this,"_flyToFeatureEvent",this.dv(new N));f(this,"_flyToFeatureIndexEvent",this.dv(new N));f(this,"_features",this.disposeVar(de(void 0)));f(this,"pickedInfoType","FeatureCollection");f(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(e,i,r){this._flyToFeatureEvent.emit(e,i,r)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(e,i){this._flyToFeatureIndexEvent.emit(e,i)}get features(){return this._features.value}set features(e){this._features.value=e}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var i;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const e=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:Gf(this.url)?this.features=JSON.parse(this.url):await fetch(ft.context.getStrFromEnv(this.url),{signal:e}).then(r=>r.json()).then(r=>{this.features=r}).catch(r=>{r.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",r)}),this.pickedInfoType=((i=this.features)==null?void 0:i.type)??"FeatureCollection"}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",dataSource:[...e.dataSource,new gt([this,"url"],"服务地址",Gt.defaults.url),new F([this,"minFeatureVisibleDistance"],"要素最小可视距离",Gt.defaults.minFeatureVisibleDistance),new F([this,"maxFeatureVisibleDistance"],"要素最大可视距离",Gt.defaults.maxFeatureVisibleDistance),new kt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new kt([this,"classificationType"],Gt.classificationTypes,"贴地附着目标",Gt.defaults.classificationType),new F([this,"zIndex"],"层级排序",Gt.defaults.zIndex)],style:[...e.style,new Et([],"点样式集合"),new rt([this,"textShow"],"是否显示",Gt.defaults.textShow),new ti([this,"textAnchor"],"锚点",Gt.defaults.anchor),new Mt([this,"textProperty"],"标注显示属性",Gt.defaults.textStyle.textProperty),new Mt([this,"textDefaultText"],"默认文本",Gt.defaults.textStyle.defaultText),new qt([this,"textColor"],"文本颜色",Gt.defaults.textStyle.color),new qt([this,"textBackgroundColor"],"文本背景颜色",Gt.defaults.textStyle.backgroundColor),new Mt([this,"textFontStyle"],"字体样式",Gt.defaults.textStyle.fontStyle),new Mt([this,"textFontWeight"],"字体粗细",Gt.defaults.textStyle.fontWeight),new F([this,"textFontSize"],"字体大小",Gt.defaults.textStyle.fontSize),new ti([this,"textOffset"],"像素偏移",Gt.defaults.textStyle.offset),new Et([],"点图片样式集合"),new rt([this,"imageShow"],"是否显示",Gt.defaults.imageShow),new ti([this,"imageAnchor"],"锚点",Gt.defaults.imageStyle.anchor),new gt([this,"imageUrl"],"图片地址",Gt.defaults.imageStyle.url),new ti([this,"imageSize"],"图片大小",Gt.defaults.imageStyle.size),new ti([this,"imageOffset"],"像素偏移",Gt.defaults.imageStyle.offset),new Et([],"线样式集合"),new rt([this,"stroked"],"是否显示",Gt.defaults.stroked),new rt([this,"strokeGround"],"贴地",Gt.defaults.strokeStyle.ground),new F([this,"strokeWidth"],"线宽",Gt.defaults.strokeStyle.width),new kt([this,"strokeWidthType"],Gt.strokeStyleWidthTypes,"线宽类型"),new qt([this,"strokeColor"],"线颜色",Gt.defaults.strokeStyle.color),new Mt([this,"strokeMaterial"],"线材质",Gt.defaults.strokeStyle.material),new gt([this,"strokeMaterialParams"],"线材质参数",Gt.defaults.strokeStyle.materialParams),new Et([],"面样式集合"),new rt([this,"filled"],"是否显示",Gt.defaults.filled),new rt([this,"fillGround"],"贴地",Gt.defaults.fillStyle.ground),new qt([this,"fillColor"],"填充颜色",Gt.defaults.fillStyle.color),new Mt([this,"fillMaterial"],"填充材质",Gt.defaults.fillStyle.material),new gt([this,"fillMaterialParams"],"填充材质参数",Gt.defaults.fillStyle.materialParams)],more:[...e.more,new Et([],"标注文本样式"),new Mt([this,"textFontFamily"],"字体",Gt.defaults.textStyle.fontFamily),new Et([],"通用"),new to([this,"loadFuncStr"],"loadFnStr",U1,aN,!0)]}}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}get textProperty(){return this.textStyle.textProperty}set textProperty(e){this.textStyle={...this.textStyle,textProperty:e}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(e){this.textStyle={...this.textStyle,defaultText:e}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(e){this.textStyle={...this.textStyle,color:e}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(e){this.textStyle={...this.textStyle,backgroundColor:e}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(e){this.textStyle={...this.textStyle,fontFamily:e}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(e){this.textStyle={...this.textStyle,fontStyle:e}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(e){this.textStyle={...this.textStyle,fontWeight:e}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(e){this.textStyle={...this.textStyle,fontSize:e}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(e){this.textStyle={...this.textStyle,anchor:e}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(e){this.textStyle={...this.textStyle,offset:e}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(e){this.imageStyle={...this.imageStyle,url:e}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(e){this.imageStyle={...this.imageStyle,size:e}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(e){this.imageStyle={...this.imageStyle,anchor:e}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(e){this.imageStyle={...this.imageStyle,offset:e}}get imageOffsetChanged(){return this.imageStyleChanged}};f(Gt,"createDefaultProps",()=>({...se.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:hN,stroked:!0,strokeStyle:Rt({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:Rt({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:Rt({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:Rt({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),f(Gt,"type",Gt.register("ESGeoJson",Gt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),f(Gt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),f(Gt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let kl=Gt;const xa=class xa extends Ut{constructor(e){super(e);f(this,"editingBindMode","doublePoints");f(this,"_height",this.disposeVar(X(0)));{const i=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};i(),this.ad(this.pointsChanged.don(i))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}};f(xa,"createDefaultProps",()=>({...Ut.createDefaultProps(),stroked:!0,strokeStyle:Rt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(xa,"type",xa.register("ESHeightMeasurement",xa,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),f(xa,"supportEditingModes",[...Ut.supportEditingModes,pt.DoublePointsAppend,pt.DoublePointsModify]);let Vp=xa;const eu=class eu extends Vs{constructor(e){super(e);f(this,"_area",this.dv(X(0)));f(this,"_perimeter",this.dv(X(0)));f(this,"editingBindMode","doublePoints");const i=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};i(),this.d(this.radiusChanged.don(i))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(e=10,i){return y1([...this.position],this.radius,e,i)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",basic:[...e.basic,new F([this,"radius"],"圆半径",1,!0)],coordinate:[...e.coordinate,new rt([this,"editing"],"是否编辑"),new Xa([this,"position"],"三维坐标",[0,0,0],!0),new F([this,"area"],"面积",0,!1,!0),new F([this,"perimeter"],"周长",0,!1,!0)]}}};f(eu,"createDefaultProps",()=>({...Vs.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:Rt({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),f(eu,"type",eu.register("ESLocalCircle",eu,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let zp=eu;const iu=class iu extends Vs{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Km([this,"points"],"坐标",[])]}}};f(iu,"createDefaultProps",()=>({...Vs.createDefaultProps(),points:op([]),filled:!0})),f(iu,"type",iu.register("ESLocalPolygon",iu,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let Gl=iu;const nu=class nu extends Fh{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,coordinate:[...t.coordinate,new Lf([this,"points"],"本地位置数组")]}}};f(nu,"createDefaultProps",()=>({...Fh.createDefaultProps(),points:ic(void 0),filled:!0})),f(nu,"type",nu.register("ESLocalPolygonZ",nu,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Up=nu;const ru=class ru extends Vs{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"width"],"宽度"),new F([this,"height"],"高度")]}}};f(ru,"createDefaultProps",()=>({...Vs.createDefaultProps(),width:5e5,height:3e5,filled:!0})),f(ru,"type",ru.register("ESLocalRectangle",ru,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let jp=ru;const fs=class fs extends Ut{constructor(e){super(e);f(this,"editingBindMode","lineString");f(this,"_distance",this.dv(X(0)));f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const i=()=>{if(this.points&&this.points.length>=2){const r=Al(this.points,"GEODESIC"),s=r[r.length-1];this._distance.value=s}else this._distance.value=0};i(),this.d(this.pointsChanged.don(i))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new F([this,"height"],"高度",10),new F([this,"width"],"宽度",10),new kt([this,"materialMode"],fs.materialModes,"模式",fs.defaults.materialMode)],coordinate:[...e.coordinate,new F([this,"distance"],"距离",0,!1,!0)]}}};f(fs,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:Rt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(fs,"type",fs.register("ESPipeFence",fs,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),f(fs,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),f(fs,"supportEditingModes",[...Ut.supportEditingModes,pt.LineStringAppend,pt.LineStringInsert]);let Md=fs;const qs=class qs extends rr{constructor(e){super(e);f(this,"_setLayerVisibleEvent",this.dv(new N));f(this,"_setLayerColorEvent",this.dv(new N))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,i){this._setLayerVisibleEvent.emit(e,i)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,i){this._setLayerColorEvent.emit(e,i)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"ESPipeserTileset"),new St(["string","string"],(i,r)=>this.setLayerVisible(i,r),["",""],"setLayerVisible"),new St(["string","string"],(i,r)=>this.setLayerColor(i,r),["",""],"setLayerColor"),new kt([this,"colorMode"],qs.colorModes,"colorMode",qs.defaults.colorMode,!0)]}}};f(qs,"createDefaultProps",()=>({...rr.createDefaultProps(),colorMode:"default"})),f(qs,"type",qs.register("ESPipeserTileset",qs,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),f(qs,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let qp=qs;const Ws=class Ws extends Ut{constructor(e){super(e);f(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new F([this,"area"],"面积",0,!1,!0),new F([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new F([this,"height"],"高度",10),new kt([this,"materialMode"],Ws.materialModes,"模式","danger")]}}};f(Ws,"createDefaultProps",()=>({...Ut.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),f(Ws,"type",Ws.register("ESPolygonFence",Ws,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),f(Ws,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),f(Ws,"supportEditingModes",[...Ut.supportEditingModes,pt.CircularAppend,pt.CircularInsert,pt.HeightModify]);let Td=Ws;const Oo=class Oo extends Ut{constructor(e){super(e);f(this,"_deprecated",["ground"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());f(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"通用","通用"),new rt([this,"ground"],"是否贴地"),new rt([this,"outlineTranslucent"],"轮廓线半透明"),new F([this,"height"],"高度"),new F([this,"extrudedHeight"],"拉伸高度"),new fr([this,"rectangle"],"范围",Oo.defaults.rectangle,!0),new F([this,"stRotation"],"纹理旋转角度"),new F([this,"rotation"],"旋转角度"),new rt([this,"pointEditing"],"是否单点编辑")]}}};f(Oo,"createDefaultProps",()=>({...Ut.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:ye(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),f(Oo,"type",Oo.register("ESRectangle",Oo,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),f(Oo,"supportEditingModes",[...Ut.supportEditingModes,pt.DoublePointsAppend,pt.DoublePointsModify]);let Wp=Oo;const su=class su extends le{getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new gt([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};f(su,"createDefaultProps",()=>({...le.createDefaultProps(),innerRings:Wv([])})),f(su,"type",su.register("ESPolygonWithHole",su,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let Hp=su;const Do=class Do extends le{constructor(e){super(e);f(this,"_startEvent",this.disposeVar(new N));f(this,"_stopEvent",this.dv(new N));f(this,"_surfaceArea",this.disposeVar(X(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(e){this._surfaceArea.value=e}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"表面积测量","表面积测量"),new St([],()=>this.start(),[],"开始计算"),new F([this,"interpolation"],"插值距离",Do.defaults.interpolation),new F([this,"offsetHeight"],"偏移高度",Do.defaults.offsetHeight)]}}};f(Do,"createDefaultProps",()=>({...le.createDefaultProps(),interpolation:.5,offsetHeight:0,units:It(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:Rt({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),f(Do,"type",Do.register("ESSurfaceAreaMeasurement",Do,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Xp=Do;const Ao=class Ao extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"downloadProgress"],"下载进度",Ao.defaults.downloadProgress,!0,!0),new gt([this,"importOptions"],"导入参数",Ao.defaults.importOptions,void 0,!0)],dataSource:[...t.dataSource,new gt([this,"url"],"路径")]}}};f(Ao,"createDefaultProps",()=>({..._t.createDefaultProps(),url:"",importOptions:de({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),f(Ao,"type",Ao.register("ESDatasmithRuntimeModel",Ao,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Yp=Ao;const zi=class zi extends Gl{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new kt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",zi.defaults.waterType),new F([this,"frequency"],"频率",zi.defaults.frequency),new ai([this,"amplitude"],.01,[0,1],"振幅",zi.defaults.amplitude),new ai([this,"flowDirection"],1,[0,360],"流向",zi.defaults.flowDirection),new ai([this,"waveVelocity"],.01,[0,1],"波动频率",zi.defaults.waveVelocity),new ai([this,"specularIntensity"],.01,[0,1],"镜面反射强度",zi.defaults.specularIntensity),new ai([this,"murkiness"],.1,[0,10],"水体浑浊度",zi.defaults.murkiness),new F([this,"flowSpeed"],"水流速度",zi.defaults.flowSpeed),new qt([this,"waterColor"],"水的底色",zi.defaults.waterColor),new gt([this,"waterImage"],"水的图片",zi.defaults.waterImage)]}}};f(zi,"createDefaultProps",()=>({...Gl.createDefaultProps(),allowPicking:!0,waterImage:de(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),f(zi,"type",zi.register("ESDynamicWater",zi,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Jp=zi;const Ui=class Ui extends le{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new kt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ui.defaults.waterType),new F([this,"frequency"],"频率",Ui.defaults.frequency),new ai([this,"amplitude"],.01,[0,1],"振幅",Ui.defaults.amplitude),new ai([this,"flowDirection"],1,[0,360],"流向",Ui.defaults.flowDirection),new ai([this,"waveVelocity"],.01,[0,1],"波动频率",Ui.defaults.waveVelocity),new ai([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ui.defaults.specularIntensity),new ai([this,"murkiness"],.1,[0,10],"水体浑浊度",Ui.defaults.murkiness),new F([this,"flowSpeed"],"水流速度",Ui.defaults.flowSpeed),new qt([this,"waterColor"],"水的底色",Ui.defaults.waterColor),new gt([this,"waterImage"],"水的图片",Ui.defaults.waterImage)]}}};f(Ui,"createDefaultProps",()=>({...le.createDefaultProps(),allowPicking:!0,waterImage:de({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),f(Ui,"type",Ui.register("ESGeoWater",Ui,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let $p=Ui;const Ma=class Ma extends _t{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"downloadProgress"],"下载进度",Ma.defaults.downloadProgress,!0,!0),new Mt([this,"levelName"],"levelName",""),new F([this,"levelLoadDistance"],"levelLoadDistance",1e3),new Mi([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...t.dataSource,new gt([this,"url"],"url","")]}}};f(Ma,"createDefaultProps",()=>({..._t.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:It([0,0,0]),levelLoadDistance:1e3})),f(Ma,"type",Ma.register("ESLevelRuntimeModel",Ma,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let Kp=Ma;const Rn=class Rn extends zs{constructor(e){super(e);f(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);f(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new F([this,"radius"],"半径",Rn.defaults.radius),new F([this,"sides"],"圆边数",Rn.defaults.sides),new F([this,"speed"],"材质速度",Rn.defaults.speed),new kt([this,"materialMode"],Rn.materialModes,"材质模式",Rn.defaults.materialMode),new gt([this,"materialImage"],"材质图片和重复度",Rn.defaults.materialImage)]}}};f(Rn,"createDefaultProps",()=>({...zs.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:Rt({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:Rt({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),f(Rn,"type",Rn.register("ESPipeline",Rn,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),f(Rn,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Qp=Rn;const gs=class gs extends Ut{constructor(e){super(e);f(this,"editingBindMode","visibility")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new qt([this,"visibleColor"],"可视区域颜色",gs.defaults.visibleColor),new qt([this,"invisibleColor"],"遮挡区域颜色",gs.defaults.invisibleColor),new F([this,"heightOffset"],"视点高度偏移",gs.defaults.heightOffset)]}}};f(gs,"createDefaultProps",()=>({...Ut.createDefaultProps(),visibleColor:It([0,1,0,1]),invisibleColor:It([1,0,0,1]),heightOffset:0})),f(gs,"type",gs.register("ESVisibilityAnalysis",gs,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),f(gs,"supportEditingModes",[...Ut.supportEditingModes,pt.VisibilityAppend,pt.VisibilityModify]);let Zp=gs;const ou=class ou extends le{constructor(e){super(e);f(this,"_startEvent",this.dv(new N));f(this,"_clearEvent",this.dv(new N));f(this,"_volume",this.disposeVar(X(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(e){this._volume.value=e}get volumeChanged(){return this._volume.changed}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Et([],"通用","通用"),new F([this,"planeHeight"],"基准面高程",void 0,!0),new F([this,"gridWidth"],"采样间距 m"),new F([this,"cutVolume"],"挖方",0,!1,!0),new F([this,"fillVolume"],"填方",0,!1,!0),new F([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new F([this,"progress"],"计算进度",0,!1,!0),new St([],()=>this.start(),[],"开始分析"),new St([],()=>this.clear(),[],"清空分析结果"),new rt([this,"depthTest"],"是否开启深度检测")]}}};f(ou,"createDefaultProps",()=>({...le.createDefaultProps(),planeHeight:X(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:Rt({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),f(ou,"type",ou.register("ESVolumeMeasurement",ou,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let tv=ou;const au=class au extends fa{constructor(e){super(e);f(this,"_human",this.dv(new fa));f(this,"_poi",this.dv(new Fl));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:i,_poi:r}=this;this.d(Y([i,"show"],[this,"show"])),this.d(Y([r,"show"],[this,"show"])),this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([r,"allowPicking"],[this,"allowPicking"])),this.d(mt([i,"scale"],[this,"scale"])),this.d(mt([r,"scale"],[this,"scale"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(Y([r,"collision"],[this,"collision"])),this.d(mt([i,"flyInParam"],[this,"flyInParam"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(Y([i,"animation"],[this,"animation"])),this.d(Y([i,"mode"],[this,"mode"])),this.d(Y([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(Y([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(Y([r,"name"],[this,"name"])),this.d(Y([r,"mode"],[this,"poiMode"])),this.d(Y([r,"autoAnchor"],[this,"autoAnchor"])),this.d(Y([r,"screenRender"],[this,"screenRender"])),this.d(Y([r,"size"],[this,"size"])),this.d(Y([r,"anchor"],[this,"anchor"])),this.d(Y([r,"sizeByContent"],[this,"sizeByContent"])),this.d(Y([r,"renderMode"],[this,"renderMode"])),this.d(Y([r,"rotationType"],[this,"rotationType"])),this.d(Y([r,"zOrder"],[this,"zOrder"])),this.d(Y([r,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(Y([r,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(mt([i,"position"],[this,"position"])),this.d(mt([i,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{i.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{i.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,h)=>{i.smoothMoveOnGround(s,o,a,h)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,h,u)=>{i.smoothMoveWithRotationOnGround(s,o,a,h,u)})),this.d(this.automaticLandingEvent.don(()=>{i.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new kt([this,"poiMode"],Fl.modes,"poi模式","SquareH01"),new F([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};f(au,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:Rt({}),autoAnchor:!0,screenRender:!0,size:It([100,100]),anchor:It([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...fa.createDefaultProps()})),f(au,"type",au.register("ESHumanPoi",au,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let ev=au;const Br=class Br extends le{constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new F([this,"depth"],"深度",Br.defaults.depth),new F([this,"interpolation"],"插值",Br.defaults.interpolation),new F([this,"opacity"],"透明度",Br.defaults.opacity),new gt([this,"sideImage"],"侧面图片",Br.defaults.sideImage),new gt([this,"bottomImage"],"底面图片",Br.defaults.bottomImage)]}}};f(Br,"createDefaultProps",()=>({...le.createDefaultProps(),depth:100,sideImage:Rt({url:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:Rt({url:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),f(Br,"type",Br.register("ESPit",Br,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Gh=Br;const hu=class hu extends Gh{constructor(e){super(e);f(this,"_excavate",this.dv(new Ll));f(this,"_pit",this.dv(new Gh));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:i,_pit:r}=this;this.d(Y([i,"show"],[this,"show"])),this.d(Y([r,"show"],[this,"show"])),this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([r,"allowPicking"],[this,"allowPicking"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(Y([r,"collision"],[this,"collision"])),this.d(mt([r,"points"],[this,"points"])),this.d(Y([i,"points"],[this,"points"])),this.d(Y([r,"pointed"],[this,"pointed"])),this.d(Y([i,"pointed"],[this,"pointed"])),this.d(Y([r,"pointStyle"],[this,"pointStyle"])),this.d(Y([i,"pointStyle"],[this,"pointStyle"])),this.d(Y([r,"stroked"],[this,"stroked"])),this.d(Y([i,"stroked"],[this,"stroked"])),this.d(Y([r,"strokeStyle"],[this,"strokeStyle"])),this.d(Y([i,"strokeStyle"],[this,"strokeStyle"])),this.d(Y([r,"filled"],[this,"filled"])),this.d(Y([r,"fillStyle"],[this,"fillStyle"])),this.d(Y([i,"fillStyle"],[this,"fillStyle"])),this.d(Y([i,"mode"],[this,"mode"])),this.d(Y([i,"targetID"],[this,"targetID"])),this.d(Y([r,"depth"],[this,"depth"])),this.d(Y([r,"sideImage"],[this,"sideImage"])),this.d(Y([r,"bottomImage"],[this,"bottomImage"])),this.d(Y([r,"opacity"],[this,"opacity"])),this.d(Y([r,"interpolation"],[this,"interpolation"])),this.d(mt([r,"flyInParam"],[this,"flyInParam"])),this.d(mt([r,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{r.flyIn(s)})),this.d(this.flyToEvent.don(s=>{r.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{r.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{r.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new kt([this,"mode"],Ll.modes,"模式","in"),new Mt([this,"targetID"],"瓦片图层","")]}}};f(hu,"createDefaultProps",()=>({...Gh.createDefaultProps(),mode:"in",targetID:""})),f(hu,"type",hu.register("ESHole",hu,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let iv=hu;const nv={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},uN=async(n,t,e,i)=>{try{const r=window.localStorage.getItem("Authorization");let s=n+`${nv.layerconfigfind}?tileServiceName=${t}`;e&&(s+=`&earthdstoken=${encodeURIComponent(i)}`);const o={headers:{...!e&&r?{Authorization:r}:{}},mode:"cors"},h=await(await fetch(s,o)).text();return JSON.parse(h)}catch(r){console.error(r)}},lN=async(n,t,e,i,r)=>{try{const s=window.localStorage.getItem("Authorization");let o=n+nv.layerconfigsave;const a=r??{};e&&(o+=`?earthdstoken=${encodeURIComponent(i)}`);const h={method:"POST",headers:{"Content-Type":"application/json",...!e&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:t,layerConfig:JSON.stringify(a)})},c=await(await fetch(o,h)).text();return JSON.parse(c)}catch(s){console.error(s)}},cN=async(n,t,e)=>{try{const i=window.localStorage.getItem("Authorization");let r=n;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),h=JSON.parse(a);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(i){console.error(i)}},dN=async(n,t,e,i,r)=>{try{const s={tileServiceName:t,featureId:e},o=window.localStorage.getItem("Authorization");let a=n+nv.featureproperty;i&&(a+=`?earthdstoken=${encodeURIComponent(r)}`);const u=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!i&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),c=JSON.parse(u);if(c.status=="ok")return c.data;console.error(c.data.status);return}catch(s){console.error(s)}},uu=class uu extends rr{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new rr));f(this,"_ids",this.dv(Rt([])));f(this,"_useEarthDSToken",this.dv(X(!1)));f(this,"_earthdstoken",this.dv(X("")));f(this,"_visJson",this.disposeVar(X({})));f(this,"_highlightInner3DtilesetEvent",this.dv(new N));f(this,"_removeHighlightInner3DtilesetEvent",this.dv(new N));f(this,"_tilesetServePort",this.dv(X("")));{const i=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{i()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const i=this._es3DTileset;this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(Y([i,"actorTag"],[this,"actorTag"])),this.d(Y([i,"materialMode"],[this,"materialMode"])),this.d(Y([i,"highlight"],[this,"highlight"])),this.d(Y([i,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Y([i,"highlightID"],[this,"highlightID"])),this.d(Y([i,"highlightColor"],[this,"highlightColor"])),this.d(mt([i,"offset"],[this,"offset"])),this.d(mt([i,"rotation"],[this,"rotation"])),this.d(Y([i,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Y([i,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Y([i,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Y([i,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Y([i,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Y([i,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Y([i,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Y([i,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Y([i,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Y([i,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Y([i,"cacheBytes"],[this,"cacheBytes"])),this.d(Y([i,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Y([i,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Y([i,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Y([i,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Y([i,"materialParams"],[this,"materialParams"])),this.d(mt([i,"supportEdit"],[this,"supportEdit"])),this.d(mt([i,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([i,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([i,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([i,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([i,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([i,"excavateId"],[this,"excavateId"]))}{const i=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{i.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{i.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{i.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{i.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{i.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{i.resetFeatureStyle(...r)})),this.d(this.setFeatureStyleEvent.don((...r)=>{i.setFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{i.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{i.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{i.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{i.calcFlyInParam(...r)}))}{const i=this._es3DTileset;this.d(i.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(i.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const i=()=>{this.es3DTileset.show=this.show};i(),this.d(this.showChanged.don(()=>{i()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,i){var r;if((r=this.layerConfig)!=null&&r.length){const s={};s[i[0].value]=i[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(e,typeof i=="string"?JSON.parse(i):i)}async getFeatureProperty(e){return await dN(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const e=await uN(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await lN(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,i){var a,h,u;const r=await e.pick(i),s=r.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=r==null?void 0:r.tilesetPickInfo)==null?void 0:a.id],{featureId:(h=r==null?void 0:r.tilesetPickInfo)==null?void 0:h.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}):{featureId:(u=r==null?void 0:r.sceneObject)==null?void 0:u.id,pickInnerFields:r==null?void 0:r.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await cN(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var r;if(!this.url||typeof this.url!="string")return;const e=(r=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:r[1],i=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${i}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return i}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!i)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return i}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return i}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new gt([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};f(uu,"createDefaultProps",()=>({...rr.createDefaultProps(),layerConfig:de([])})),f(uu,"type",uu.register("ESRtsTileset",uu,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let rv=uu;function fN(n){return typeof n=="number"&&!isNaN(n)}const lu=class lu extends rr{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(t){this._innerSetJson(t)}async init(t,e){this.featureId=e;const i=await t.getFeatureProperty(e);this.uiShowprops=i.allFields.map(o=>({featureClassName:o.featureClassName,fields:o.fields.map(a=>({key:a.name,type:a.type,value:a.type!="Double"?a.value:fN(a.value)?Number(a.value.toFixed(3)):""}))})),this.datasetName=i.datasetName,t.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{t.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const r=t.tileServiceIp,s=t.tilesetServePort;if(!s)throw new Error("ESRtsFeatureEditing: port is not defined");this.url=`${r}:${s}/featuretiles/${this.featureId}/tileset.json`,this.allowPicking=!0,this.d(this.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)})),this.d(()=>{this.editing=!1,t.removeHighlightDSFeature(this)})}constructor(t){super(t)}};f(lu,"createDefaultProps",()=>({...rr.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:Rt({}),changeMaterial:de(void 0),uiShowprops:Rt({}),props:Rt({})})),f(lu,"type",lu.register("ESRtsFeatureEditing",lu,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let sv=lu;const gN=async(n,t,e)=>{try{const i=window.localStorage.getItem("Authorization");let r=n;t&&(r+=`?earthdstoken=${encodeURIComponent(e)}`);const s={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},a=await(await fetch(r,s)).text(),h=JSON.parse(a);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(i){console.error(i)}},Hl=class Hl extends rr{constructor(e){super(e);f(this,"_es3DTileset",this.dv(new rr));f(this,"_tilesetServePort",this.dv(X("")));f(this,"_useEarthDSToken",this.dv(X(!1)));f(this,"_earthdstoken",this.dv(X("")));{const i=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{i()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const i=this._es3DTileset;this.d(Y([i,"allowPicking"],[this,"allowPicking"])),this.d(Y([i,"collision"],[this,"collision"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(mt([i,"flyToParam"],[this,"flyToParam"])),this.d(Y([i,"actorTag"],[this,"actorTag"])),this.d(Y([i,"materialMode"],[this,"materialMode"])),this.d(Y([i,"highlight"],[this,"highlight"])),this.d(Y([i,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Y([i,"highlightID"],[this,"highlightID"])),this.d(Y([i,"highlightColor"],[this,"highlightColor"])),this.d(mt([i,"offset"],[this,"offset"])),this.d(mt([i,"rotation"],[this,"rotation"])),this.d(Y([i,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Y([i,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Y([i,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Y([i,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Y([i,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Y([i,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Y([i,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Y([i,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Y([i,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Y([i,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Y([i,"cacheBytes"],[this,"cacheBytes"])),this.d(Y([i,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Y([i,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Y([i,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Y([i,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Y([i,"materialParams"],[this,"materialParams"])),this.d(mt([i,"supportEdit"],[this,"supportEdit"])),this.d(mt([i,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([i,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([i,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([i,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([i,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([i,"excavateId"],[this,"excavateId"]))}{const i=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{i.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...r)=>{i.highlightFeature(...r)})),this.d(this.highlightFeatureAndFlyToEvent.don((...r)=>{i.highlightFeatureAndFlyTo(...r)})),this.d(this.setFeatureColorEvent.don((...r)=>{i.setFeatureColor(...r)})),this.d(this.setFeatureVisableEvent.don((...r)=>{i.setFeatureVisable(...r)})),this.d(this.resetFeatureStyleEvent.don((...r)=>{i.resetFeatureStyle(...r)})),this.d(this.flyInEvent.don((...r)=>{i.flyIn(r[0])})),this.d(this.flyToEvent.don((...r)=>{i.flyTo(r[0])})),this.d(this.calcFlyToParamEvent.don((...r)=>{i.calcFlyToParam(...r)})),this.d(this.calcFlyInParamEvent.don((...r)=>{i.calcFlyInParam(...r)}))}{const i=this._es3DTileset;this.d(i.tilesetReady.don(r=>{this.tilesetReady.emit(r)})),this.d(i.pickedEvent.don(r=>{r.assign({sceneObject:this}),this.pickedEvent.emit(r)}))}{const i=()=>{this.es3DTileset.show=this.show};i(),this.d(this.showChanged.don(()=>{i()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(e){this._useEarthDSToken.value=e}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(e){this._earthdstoken.value=e}async getport(){const e=await gN(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){var r;if(!this.url||typeof this.url!="string")return;const e=(r=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:r[1],i=+new Date;if(e){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${i}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return i}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!i)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return i}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var e;if(this.url&&typeof this.url=="string"){const i=(e=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:e[1];if(!i)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return i}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};f(Hl,"type",Hl.register("ESMsTileset",Hl,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let ov=Hl;const j1={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
358
358
  ## 参数类型为 ESPoiType[]
359
359
  \`\`\`js
360
360
  type Vector2D = [number, number]